c745ec35867e0efdc880c08522e72cac458b6dbf
[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_DOUBLEIT);
1038     if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1039     if (no == 3) return(XML_BUFFER_ALLOC_HYBRID);
1040     if (no == 4) return(XML_BUFFER_ALLOC_IMMUTABLE);
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
1484         ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1485         desret_htmlParserCtxtPtr(ret_val);
1486         call_tests++;
1487         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1488         des_int(n_size, size, 1);
1489         xmlResetLastError();
1490         if (mem_base != xmlMemBlocks()) {
1491             printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1492                    xmlMemBlocks() - mem_base);
1493             test_ret++;
1494             printf(" %d", n_buffer);
1495             printf(" %d", n_size);
1496             printf("\n");
1497         }
1498     }
1499     }
1500     function_tests++;
1501 #endif
1502
1503     return(test_ret);
1504 }
1505
1506 #ifdef LIBXML_HTML_ENABLED
1507
1508 #define gen_nb_htmlSAXHandlerPtr 1
1509 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1510     return(NULL);
1511 }
1512 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1513 }
1514 #endif
1515
1516
1517 static int
1518 test_htmlCreatePushParserCtxt(void) {
1519     int test_ret = 0;
1520
1521 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1522     int mem_base;
1523     htmlParserCtxtPtr ret_val;
1524     htmlSAXHandlerPtr sax; /* a SAX handler */
1525     int n_sax;
1526     void * user_data; /* The user data returned on SAX callbacks */
1527     int n_user_data;
1528     char * chunk; /* a pointer to an array of chars */
1529     int n_chunk;
1530     int size; /* number of chars in the array */
1531     int n_size;
1532     const char * filename; /* an optional file name or URI */
1533     int n_filename;
1534     xmlCharEncoding enc; /* an optional encoding */
1535     int n_enc;
1536
1537     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1538     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1539     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1540     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1541     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1542     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1543         mem_base = xmlMemBlocks();
1544         sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1545         user_data = gen_userdata(n_user_data, 1);
1546         chunk = gen_const_char_ptr(n_chunk, 2);
1547         size = gen_int(n_size, 3);
1548         filename = gen_fileoutput(n_filename, 4);
1549         enc = gen_xmlCharEncoding(n_enc, 5);
1550
1551         ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1552         desret_htmlParserCtxtPtr(ret_val);
1553         call_tests++;
1554         des_htmlSAXHandlerPtr(n_sax, sax, 0);
1555         des_userdata(n_user_data, user_data, 1);
1556         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1557         des_int(n_size, size, 3);
1558         des_fileoutput(n_filename, filename, 4);
1559         des_xmlCharEncoding(n_enc, enc, 5);
1560         xmlResetLastError();
1561         if (mem_base != xmlMemBlocks()) {
1562             printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1563                    xmlMemBlocks() - mem_base);
1564             test_ret++;
1565             printf(" %d", n_sax);
1566             printf(" %d", n_user_data);
1567             printf(" %d", n_chunk);
1568             printf(" %d", n_size);
1569             printf(" %d", n_filename);
1570             printf(" %d", n_enc);
1571             printf("\n");
1572         }
1573     }
1574     }
1575     }
1576     }
1577     }
1578     }
1579     function_tests++;
1580 #endif
1581
1582     return(test_ret);
1583 }
1584
1585
1586 static int
1587 test_htmlCtxtReadDoc(void) {
1588     int test_ret = 0;
1589
1590 #if defined(LIBXML_HTML_ENABLED)
1591     int mem_base;
1592     htmlDocPtr ret_val;
1593     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1594     int n_ctxt;
1595     xmlChar * cur; /* a pointer to a zero terminated string */
1596     int n_cur;
1597     const char * URL; /* the base URL to use for the document */
1598     int n_URL;
1599     char * encoding; /* the document encoding, or NULL */
1600     int n_encoding;
1601     int options; /* a combination of htmlParserOption(s) */
1602     int n_options;
1603
1604     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1605     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1606     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1607     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1608     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1609         mem_base = xmlMemBlocks();
1610         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1611         cur = gen_const_xmlChar_ptr(n_cur, 1);
1612         URL = gen_filepath(n_URL, 2);
1613         encoding = gen_const_char_ptr(n_encoding, 3);
1614         options = gen_int(n_options, 4);
1615
1616         ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1617         desret_htmlDocPtr(ret_val);
1618         call_tests++;
1619         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1620         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1621         des_filepath(n_URL, URL, 2);
1622         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1623         des_int(n_options, options, 4);
1624         xmlResetLastError();
1625         if (mem_base != xmlMemBlocks()) {
1626             printf("Leak of %d blocks found in htmlCtxtReadDoc",
1627                    xmlMemBlocks() - mem_base);
1628             test_ret++;
1629             printf(" %d", n_ctxt);
1630             printf(" %d", n_cur);
1631             printf(" %d", n_URL);
1632             printf(" %d", n_encoding);
1633             printf(" %d", n_options);
1634             printf("\n");
1635         }
1636     }
1637     }
1638     }
1639     }
1640     }
1641     function_tests++;
1642 #endif
1643
1644     return(test_ret);
1645 }
1646
1647
1648 static int
1649 test_htmlCtxtReadFile(void) {
1650     int test_ret = 0;
1651
1652 #if defined(LIBXML_HTML_ENABLED)
1653     htmlDocPtr ret_val;
1654     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1655     int n_ctxt;
1656     const char * filename; /* a file or URL */
1657     int n_filename;
1658     char * encoding; /* the document encoding, or NULL */
1659     int n_encoding;
1660     int options; /* a combination of htmlParserOption(s) */
1661     int n_options;
1662
1663     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1664     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1665     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1666     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1667         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1668         filename = gen_filepath(n_filename, 1);
1669         encoding = gen_const_char_ptr(n_encoding, 2);
1670         options = gen_int(n_options, 3);
1671
1672         ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1673         desret_htmlDocPtr(ret_val);
1674         call_tests++;
1675         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1676         des_filepath(n_filename, filename, 1);
1677         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1678         des_int(n_options, options, 3);
1679         xmlResetLastError();
1680     }
1681     }
1682     }
1683     }
1684     function_tests++;
1685 #endif
1686
1687     return(test_ret);
1688 }
1689
1690
1691 static int
1692 test_htmlCtxtReadMemory(void) {
1693     int test_ret = 0;
1694
1695 #if defined(LIBXML_HTML_ENABLED)
1696     int mem_base;
1697     htmlDocPtr ret_val;
1698     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1699     int n_ctxt;
1700     char * buffer; /* a pointer to a char array */
1701     int n_buffer;
1702     int size; /* the size of the array */
1703     int n_size;
1704     const char * URL; /* the base URL to use for the document */
1705     int n_URL;
1706     char * encoding; /* the document encoding, or NULL */
1707     int n_encoding;
1708     int options; /* a combination of htmlParserOption(s) */
1709     int n_options;
1710
1711     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1712     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1713     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1714     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1715     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1716     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1717         mem_base = xmlMemBlocks();
1718         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1719         buffer = gen_const_char_ptr(n_buffer, 1);
1720         size = gen_int(n_size, 2);
1721         URL = gen_filepath(n_URL, 3);
1722         encoding = gen_const_char_ptr(n_encoding, 4);
1723         options = gen_int(n_options, 5);
1724
1725         ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1726         desret_htmlDocPtr(ret_val);
1727         call_tests++;
1728         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1729         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1730         des_int(n_size, size, 2);
1731         des_filepath(n_URL, URL, 3);
1732         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1733         des_int(n_options, options, 5);
1734         xmlResetLastError();
1735         if (mem_base != xmlMemBlocks()) {
1736             printf("Leak of %d blocks found in htmlCtxtReadMemory",
1737                    xmlMemBlocks() - mem_base);
1738             test_ret++;
1739             printf(" %d", n_ctxt);
1740             printf(" %d", n_buffer);
1741             printf(" %d", n_size);
1742             printf(" %d", n_URL);
1743             printf(" %d", n_encoding);
1744             printf(" %d", n_options);
1745             printf("\n");
1746         }
1747     }
1748     }
1749     }
1750     }
1751     }
1752     }
1753     function_tests++;
1754 #endif
1755
1756     return(test_ret);
1757 }
1758
1759
1760 static int
1761 test_htmlCtxtReset(void) {
1762     int test_ret = 0;
1763
1764 #if defined(LIBXML_HTML_ENABLED)
1765     int mem_base;
1766     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1767     int n_ctxt;
1768
1769     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1770         mem_base = xmlMemBlocks();
1771         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1772
1773         htmlCtxtReset(ctxt);
1774         call_tests++;
1775         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1776         xmlResetLastError();
1777         if (mem_base != xmlMemBlocks()) {
1778             printf("Leak of %d blocks found in htmlCtxtReset",
1779                    xmlMemBlocks() - mem_base);
1780             test_ret++;
1781             printf(" %d", n_ctxt);
1782             printf("\n");
1783         }
1784     }
1785     function_tests++;
1786 #endif
1787
1788     return(test_ret);
1789 }
1790
1791
1792 static int
1793 test_htmlCtxtUseOptions(void) {
1794     int test_ret = 0;
1795
1796 #if defined(LIBXML_HTML_ENABLED)
1797     int mem_base;
1798     int ret_val;
1799     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1800     int n_ctxt;
1801     int options; /* a combination of htmlParserOption(s) */
1802     int n_options;
1803
1804     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1805     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1806         mem_base = xmlMemBlocks();
1807         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1808         options = gen_int(n_options, 1);
1809
1810         ret_val = htmlCtxtUseOptions(ctxt, options);
1811         desret_int(ret_val);
1812         call_tests++;
1813         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1814         des_int(n_options, options, 1);
1815         xmlResetLastError();
1816         if (mem_base != xmlMemBlocks()) {
1817             printf("Leak of %d blocks found in htmlCtxtUseOptions",
1818                    xmlMemBlocks() - mem_base);
1819             test_ret++;
1820             printf(" %d", n_ctxt);
1821             printf(" %d", n_options);
1822             printf("\n");
1823         }
1824     }
1825     }
1826     function_tests++;
1827 #endif
1828
1829     return(test_ret);
1830 }
1831
1832
1833 static int
1834 test_htmlElementAllowedHere(void) {
1835     int test_ret = 0;
1836
1837 #if defined(LIBXML_HTML_ENABLED)
1838     int mem_base;
1839     int ret_val;
1840     htmlElemDesc * parent; /* HTML parent element */
1841     int n_parent;
1842     xmlChar * elt; /* HTML element */
1843     int n_elt;
1844
1845     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1846     for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1847         mem_base = xmlMemBlocks();
1848         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1849         elt = gen_const_xmlChar_ptr(n_elt, 1);
1850
1851         ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1852         desret_int(ret_val);
1853         call_tests++;
1854         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1855         des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1856         xmlResetLastError();
1857         if (mem_base != xmlMemBlocks()) {
1858             printf("Leak of %d blocks found in htmlElementAllowedHere",
1859                    xmlMemBlocks() - mem_base);
1860             test_ret++;
1861             printf(" %d", n_parent);
1862             printf(" %d", n_elt);
1863             printf("\n");
1864         }
1865     }
1866     }
1867     function_tests++;
1868 #endif
1869
1870     return(test_ret);
1871 }
1872
1873
1874 static int
1875 test_htmlElementStatusHere(void) {
1876     int test_ret = 0;
1877
1878 #if defined(LIBXML_HTML_ENABLED)
1879     int mem_base;
1880     htmlStatus ret_val;
1881     htmlElemDesc * parent; /* HTML parent element */
1882     int n_parent;
1883     htmlElemDesc * elt; /* HTML element */
1884     int n_elt;
1885
1886     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1887     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1888         mem_base = xmlMemBlocks();
1889         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1890         elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1891
1892         ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1893         desret_htmlStatus(ret_val);
1894         call_tests++;
1895         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1896         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1897         xmlResetLastError();
1898         if (mem_base != xmlMemBlocks()) {
1899             printf("Leak of %d blocks found in htmlElementStatusHere",
1900                    xmlMemBlocks() - mem_base);
1901             test_ret++;
1902             printf(" %d", n_parent);
1903             printf(" %d", n_elt);
1904             printf("\n");
1905         }
1906     }
1907     }
1908     function_tests++;
1909 #endif
1910
1911     return(test_ret);
1912 }
1913
1914
1915 static int
1916 test_htmlEncodeEntities(void) {
1917     int test_ret = 0;
1918
1919 #if defined(LIBXML_HTML_ENABLED)
1920     int mem_base;
1921     int ret_val;
1922     unsigned char * out; /* a pointer to an array of bytes to store the result */
1923     int n_out;
1924     int * outlen; /* the length of @out */
1925     int n_outlen;
1926     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1927     int n_in;
1928     int * inlen; /* the length of @in */
1929     int n_inlen;
1930     int quoteChar; /* the quote character to escape (' or ") or zero. */
1931     int n_quoteChar;
1932
1933     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1934     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1935     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1936     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1937     for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1938         mem_base = xmlMemBlocks();
1939         out = gen_unsigned_char_ptr(n_out, 0);
1940         outlen = gen_int_ptr(n_outlen, 1);
1941         in = gen_const_unsigned_char_ptr(n_in, 2);
1942         inlen = gen_int_ptr(n_inlen, 3);
1943         quoteChar = gen_int(n_quoteChar, 4);
1944
1945         ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1946         desret_int(ret_val);
1947         call_tests++;
1948         des_unsigned_char_ptr(n_out, out, 0);
1949         des_int_ptr(n_outlen, outlen, 1);
1950         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1951         des_int_ptr(n_inlen, inlen, 3);
1952         des_int(n_quoteChar, quoteChar, 4);
1953         xmlResetLastError();
1954         if (mem_base != xmlMemBlocks()) {
1955             printf("Leak of %d blocks found in htmlEncodeEntities",
1956                    xmlMemBlocks() - mem_base);
1957             test_ret++;
1958             printf(" %d", n_out);
1959             printf(" %d", n_outlen);
1960             printf(" %d", n_in);
1961             printf(" %d", n_inlen);
1962             printf(" %d", n_quoteChar);
1963             printf("\n");
1964         }
1965     }
1966     }
1967     }
1968     }
1969     }
1970     function_tests++;
1971 #endif
1972
1973     return(test_ret);
1974 }
1975
1976
1977 static int
1978 test_htmlEntityLookup(void) {
1979     int test_ret = 0;
1980
1981 #if defined(LIBXML_HTML_ENABLED)
1982     int mem_base;
1983     const htmlEntityDesc * ret_val;
1984     xmlChar * name; /* the entity name */
1985     int n_name;
1986
1987     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1988         mem_base = xmlMemBlocks();
1989         name = gen_const_xmlChar_ptr(n_name, 0);
1990
1991         ret_val = htmlEntityLookup((const xmlChar *)name);
1992         desret_const_htmlEntityDesc_ptr(ret_val);
1993         call_tests++;
1994         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1995         xmlResetLastError();
1996         if (mem_base != xmlMemBlocks()) {
1997             printf("Leak of %d blocks found in htmlEntityLookup",
1998                    xmlMemBlocks() - mem_base);
1999             test_ret++;
2000             printf(" %d", n_name);
2001             printf("\n");
2002         }
2003     }
2004     function_tests++;
2005 #endif
2006
2007     return(test_ret);
2008 }
2009
2010
2011 static int
2012 test_htmlEntityValueLookup(void) {
2013     int test_ret = 0;
2014
2015 #if defined(LIBXML_HTML_ENABLED)
2016     int mem_base;
2017     const htmlEntityDesc * ret_val;
2018     unsigned int value; /* the entity's unicode value */
2019     int n_value;
2020
2021     for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2022         mem_base = xmlMemBlocks();
2023         value = gen_unsigned_int(n_value, 0);
2024
2025         ret_val = htmlEntityValueLookup(value);
2026         desret_const_htmlEntityDesc_ptr(ret_val);
2027         call_tests++;
2028         des_unsigned_int(n_value, value, 0);
2029         xmlResetLastError();
2030         if (mem_base != xmlMemBlocks()) {
2031             printf("Leak of %d blocks found in htmlEntityValueLookup",
2032                    xmlMemBlocks() - mem_base);
2033             test_ret++;
2034             printf(" %d", n_value);
2035             printf("\n");
2036         }
2037     }
2038     function_tests++;
2039 #endif
2040
2041     return(test_ret);
2042 }
2043
2044
2045 static int
2046 test_htmlHandleOmittedElem(void) {
2047     int test_ret = 0;
2048
2049 #if defined(LIBXML_HTML_ENABLED)
2050     int mem_base;
2051     int ret_val;
2052     int val; /* int 0 or 1 */
2053     int n_val;
2054
2055     for (n_val = 0;n_val < gen_nb_int;n_val++) {
2056         mem_base = xmlMemBlocks();
2057         val = gen_int(n_val, 0);
2058
2059         ret_val = htmlHandleOmittedElem(val);
2060         desret_int(ret_val);
2061         call_tests++;
2062         des_int(n_val, val, 0);
2063         xmlResetLastError();
2064         if (mem_base != xmlMemBlocks()) {
2065             printf("Leak of %d blocks found in htmlHandleOmittedElem",
2066                    xmlMemBlocks() - mem_base);
2067             test_ret++;
2068             printf(" %d", n_val);
2069             printf("\n");
2070         }
2071     }
2072     function_tests++;
2073 #endif
2074
2075     return(test_ret);
2076 }
2077
2078
2079 static int
2080 test_htmlIsAutoClosed(void) {
2081     int test_ret = 0;
2082
2083 #if defined(LIBXML_HTML_ENABLED)
2084     int mem_base;
2085     int ret_val;
2086     htmlDocPtr doc; /* the HTML document */
2087     int n_doc;
2088     htmlNodePtr elem; /* the HTML element */
2089     int n_elem;
2090
2091     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2092     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2093         mem_base = xmlMemBlocks();
2094         doc = gen_htmlDocPtr(n_doc, 0);
2095         elem = gen_htmlNodePtr(n_elem, 1);
2096
2097         ret_val = htmlIsAutoClosed(doc, elem);
2098         desret_int(ret_val);
2099         call_tests++;
2100         des_htmlDocPtr(n_doc, doc, 0);
2101         des_htmlNodePtr(n_elem, elem, 1);
2102         xmlResetLastError();
2103         if (mem_base != xmlMemBlocks()) {
2104             printf("Leak of %d blocks found in htmlIsAutoClosed",
2105                    xmlMemBlocks() - mem_base);
2106             test_ret++;
2107             printf(" %d", n_doc);
2108             printf(" %d", n_elem);
2109             printf("\n");
2110         }
2111     }
2112     }
2113     function_tests++;
2114 #endif
2115
2116     return(test_ret);
2117 }
2118
2119
2120 static int
2121 test_htmlIsScriptAttribute(void) {
2122     int test_ret = 0;
2123
2124 #if defined(LIBXML_HTML_ENABLED)
2125     int mem_base;
2126     int ret_val;
2127     xmlChar * name; /* an attribute name */
2128     int n_name;
2129
2130     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2131         mem_base = xmlMemBlocks();
2132         name = gen_const_xmlChar_ptr(n_name, 0);
2133
2134         ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2135         desret_int(ret_val);
2136         call_tests++;
2137         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2138         xmlResetLastError();
2139         if (mem_base != xmlMemBlocks()) {
2140             printf("Leak of %d blocks found in htmlIsScriptAttribute",
2141                    xmlMemBlocks() - mem_base);
2142             test_ret++;
2143             printf(" %d", n_name);
2144             printf("\n");
2145         }
2146     }
2147     function_tests++;
2148 #endif
2149
2150     return(test_ret);
2151 }
2152
2153
2154 static int
2155 test_htmlNewParserCtxt(void) {
2156     int test_ret = 0;
2157
2158 #if defined(LIBXML_HTML_ENABLED)
2159     int mem_base;
2160     htmlParserCtxtPtr ret_val;
2161
2162         mem_base = xmlMemBlocks();
2163
2164         ret_val = htmlNewParserCtxt();
2165         desret_htmlParserCtxtPtr(ret_val);
2166         call_tests++;
2167         xmlResetLastError();
2168         if (mem_base != xmlMemBlocks()) {
2169             printf("Leak of %d blocks found in htmlNewParserCtxt",
2170                    xmlMemBlocks() - mem_base);
2171             test_ret++;
2172             printf("\n");
2173         }
2174     function_tests++;
2175 #endif
2176
2177     return(test_ret);
2178 }
2179
2180
2181 static int
2182 test_htmlNodeStatus(void) {
2183     int test_ret = 0;
2184
2185 #if defined(LIBXML_HTML_ENABLED)
2186     int mem_base;
2187     htmlStatus ret_val;
2188     htmlNodePtr node; /* an htmlNodePtr in a tree */
2189     int n_node;
2190     int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2191     int n_legacy;
2192
2193     for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2194     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2195         mem_base = xmlMemBlocks();
2196         node = gen_const_htmlNodePtr(n_node, 0);
2197         legacy = gen_int(n_legacy, 1);
2198
2199         ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2200         desret_htmlStatus(ret_val);
2201         call_tests++;
2202         des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2203         des_int(n_legacy, legacy, 1);
2204         xmlResetLastError();
2205         if (mem_base != xmlMemBlocks()) {
2206             printf("Leak of %d blocks found in htmlNodeStatus",
2207                    xmlMemBlocks() - mem_base);
2208             test_ret++;
2209             printf(" %d", n_node);
2210             printf(" %d", n_legacy);
2211             printf("\n");
2212         }
2213     }
2214     }
2215     function_tests++;
2216 #endif
2217
2218     return(test_ret);
2219 }
2220
2221
2222 static int
2223 test_htmlParseCharRef(void) {
2224     int test_ret = 0;
2225
2226 #if defined(LIBXML_HTML_ENABLED)
2227     int mem_base;
2228     int ret_val;
2229     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2230     int n_ctxt;
2231
2232     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2233         mem_base = xmlMemBlocks();
2234         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2235
2236         ret_val = htmlParseCharRef(ctxt);
2237         desret_int(ret_val);
2238         call_tests++;
2239         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2240         xmlResetLastError();
2241         if (mem_base != xmlMemBlocks()) {
2242             printf("Leak of %d blocks found in htmlParseCharRef",
2243                    xmlMemBlocks() - mem_base);
2244             test_ret++;
2245             printf(" %d", n_ctxt);
2246             printf("\n");
2247         }
2248     }
2249     function_tests++;
2250 #endif
2251
2252     return(test_ret);
2253 }
2254
2255
2256 static int
2257 test_htmlParseChunk(void) {
2258     int test_ret = 0;
2259
2260 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2261     int mem_base;
2262     int ret_val;
2263     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2264     int n_ctxt;
2265     char * chunk; /* an char array */
2266     int n_chunk;
2267     int size; /* the size in byte of the chunk */
2268     int n_size;
2269     int terminate; /* last chunk indicator */
2270     int n_terminate;
2271
2272     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2273     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2274     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2275     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2276         mem_base = xmlMemBlocks();
2277         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2278         chunk = gen_const_char_ptr(n_chunk, 1);
2279         size = gen_int(n_size, 2);
2280         terminate = gen_int(n_terminate, 3);
2281
2282         ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2283         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2284         desret_int(ret_val);
2285         call_tests++;
2286         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2287         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2288         des_int(n_size, size, 2);
2289         des_int(n_terminate, terminate, 3);
2290         xmlResetLastError();
2291         if (mem_base != xmlMemBlocks()) {
2292             printf("Leak of %d blocks found in htmlParseChunk",
2293                    xmlMemBlocks() - mem_base);
2294             test_ret++;
2295             printf(" %d", n_ctxt);
2296             printf(" %d", n_chunk);
2297             printf(" %d", n_size);
2298             printf(" %d", n_terminate);
2299             printf("\n");
2300         }
2301     }
2302     }
2303     }
2304     }
2305     function_tests++;
2306 #endif
2307
2308     return(test_ret);
2309 }
2310
2311
2312 static int
2313 test_htmlParseDoc(void) {
2314     int test_ret = 0;
2315
2316 #if defined(LIBXML_HTML_ENABLED)
2317     int mem_base;
2318     htmlDocPtr ret_val;
2319     xmlChar * cur; /* a pointer to an array of xmlChar */
2320     int n_cur;
2321     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2322     int n_encoding;
2323
2324     for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2325     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2326         mem_base = xmlMemBlocks();
2327         cur = gen_xmlChar_ptr(n_cur, 0);
2328         encoding = gen_const_char_ptr(n_encoding, 1);
2329
2330         ret_val = htmlParseDoc(cur, (const char *)encoding);
2331         desret_htmlDocPtr(ret_val);
2332         call_tests++;
2333         des_xmlChar_ptr(n_cur, cur, 0);
2334         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2335         xmlResetLastError();
2336         if (mem_base != xmlMemBlocks()) {
2337             printf("Leak of %d blocks found in htmlParseDoc",
2338                    xmlMemBlocks() - mem_base);
2339             test_ret++;
2340             printf(" %d", n_cur);
2341             printf(" %d", n_encoding);
2342             printf("\n");
2343         }
2344     }
2345     }
2346     function_tests++;
2347 #endif
2348
2349     return(test_ret);
2350 }
2351
2352
2353 static int
2354 test_htmlParseDocument(void) {
2355     int test_ret = 0;
2356
2357 #if defined(LIBXML_HTML_ENABLED)
2358     int mem_base;
2359     int ret_val;
2360     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2361     int n_ctxt;
2362
2363     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2364         mem_base = xmlMemBlocks();
2365         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2366
2367         ret_val = htmlParseDocument(ctxt);
2368         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2369         desret_int(ret_val);
2370         call_tests++;
2371         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2372         xmlResetLastError();
2373         if (mem_base != xmlMemBlocks()) {
2374             printf("Leak of %d blocks found in htmlParseDocument",
2375                    xmlMemBlocks() - mem_base);
2376             test_ret++;
2377             printf(" %d", n_ctxt);
2378             printf("\n");
2379         }
2380     }
2381     function_tests++;
2382 #endif
2383
2384     return(test_ret);
2385 }
2386
2387
2388 static int
2389 test_htmlParseElement(void) {
2390     int test_ret = 0;
2391
2392 #if defined(LIBXML_HTML_ENABLED)
2393     int mem_base;
2394     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2395     int n_ctxt;
2396
2397     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2398         mem_base = xmlMemBlocks();
2399         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2400
2401         htmlParseElement(ctxt);
2402         call_tests++;
2403         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2404         xmlResetLastError();
2405         if (mem_base != xmlMemBlocks()) {
2406             printf("Leak of %d blocks found in htmlParseElement",
2407                    xmlMemBlocks() - mem_base);
2408             test_ret++;
2409             printf(" %d", n_ctxt);
2410             printf("\n");
2411         }
2412     }
2413     function_tests++;
2414 #endif
2415
2416     return(test_ret);
2417 }
2418
2419
2420 static int
2421 test_htmlParseEntityRef(void) {
2422     int test_ret = 0;
2423
2424 #if defined(LIBXML_HTML_ENABLED)
2425     int mem_base;
2426     const htmlEntityDesc * ret_val;
2427     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2428     int n_ctxt;
2429     xmlChar ** str; /* location to store the entity name */
2430     int n_str;
2431
2432     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2433     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2434         mem_base = xmlMemBlocks();
2435         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2436         str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2437
2438         ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2439         desret_const_htmlEntityDesc_ptr(ret_val);
2440         call_tests++;
2441         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2442         des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2443         xmlResetLastError();
2444         if (mem_base != xmlMemBlocks()) {
2445             printf("Leak of %d blocks found in htmlParseEntityRef",
2446                    xmlMemBlocks() - mem_base);
2447             test_ret++;
2448             printf(" %d", n_ctxt);
2449             printf(" %d", n_str);
2450             printf("\n");
2451         }
2452     }
2453     }
2454     function_tests++;
2455 #endif
2456
2457     return(test_ret);
2458 }
2459
2460
2461 static int
2462 test_htmlParseFile(void) {
2463     int test_ret = 0;
2464
2465 #if defined(LIBXML_HTML_ENABLED)
2466     htmlDocPtr ret_val;
2467     const char * filename; /* the filename */
2468     int n_filename;
2469     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2470     int n_encoding;
2471
2472     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2473     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2474         filename = gen_filepath(n_filename, 0);
2475         encoding = gen_const_char_ptr(n_encoding, 1);
2476
2477         ret_val = htmlParseFile(filename, (const char *)encoding);
2478         desret_htmlDocPtr(ret_val);
2479         call_tests++;
2480         des_filepath(n_filename, filename, 0);
2481         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2482         xmlResetLastError();
2483     }
2484     }
2485     function_tests++;
2486 #endif
2487
2488     return(test_ret);
2489 }
2490
2491
2492 static int
2493 test_htmlReadDoc(void) {
2494     int test_ret = 0;
2495
2496 #if defined(LIBXML_HTML_ENABLED)
2497     int mem_base;
2498     htmlDocPtr ret_val;
2499     xmlChar * cur; /* a pointer to a zero terminated string */
2500     int n_cur;
2501     const char * URL; /* the base URL to use for the document */
2502     int n_URL;
2503     char * encoding; /* the document encoding, or NULL */
2504     int n_encoding;
2505     int options; /* a combination of htmlParserOption(s) */
2506     int n_options;
2507
2508     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2509     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2510     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2511     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2512         mem_base = xmlMemBlocks();
2513         cur = gen_const_xmlChar_ptr(n_cur, 0);
2514         URL = gen_filepath(n_URL, 1);
2515         encoding = gen_const_char_ptr(n_encoding, 2);
2516         options = gen_int(n_options, 3);
2517
2518         ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2519         desret_htmlDocPtr(ret_val);
2520         call_tests++;
2521         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2522         des_filepath(n_URL, URL, 1);
2523         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2524         des_int(n_options, options, 3);
2525         xmlResetLastError();
2526         if (mem_base != xmlMemBlocks()) {
2527             printf("Leak of %d blocks found in htmlReadDoc",
2528                    xmlMemBlocks() - mem_base);
2529             test_ret++;
2530             printf(" %d", n_cur);
2531             printf(" %d", n_URL);
2532             printf(" %d", n_encoding);
2533             printf(" %d", n_options);
2534             printf("\n");
2535         }
2536     }
2537     }
2538     }
2539     }
2540     function_tests++;
2541 #endif
2542
2543     return(test_ret);
2544 }
2545
2546
2547 static int
2548 test_htmlReadFile(void) {
2549     int test_ret = 0;
2550
2551 #if defined(LIBXML_HTML_ENABLED)
2552     int mem_base;
2553     htmlDocPtr ret_val;
2554     const char * filename; /* a file or URL */
2555     int n_filename;
2556     char * encoding; /* the document encoding, or NULL */
2557     int n_encoding;
2558     int options; /* a combination of htmlParserOption(s) */
2559     int n_options;
2560
2561     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2562     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2563     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2564         mem_base = xmlMemBlocks();
2565         filename = gen_filepath(n_filename, 0);
2566         encoding = gen_const_char_ptr(n_encoding, 1);
2567         options = gen_int(n_options, 2);
2568
2569         ret_val = htmlReadFile(filename, (const char *)encoding, options);
2570         desret_htmlDocPtr(ret_val);
2571         call_tests++;
2572         des_filepath(n_filename, filename, 0);
2573         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2574         des_int(n_options, options, 2);
2575         xmlResetLastError();
2576         if (mem_base != xmlMemBlocks()) {
2577             printf("Leak of %d blocks found in htmlReadFile",
2578                    xmlMemBlocks() - mem_base);
2579             test_ret++;
2580             printf(" %d", n_filename);
2581             printf(" %d", n_encoding);
2582             printf(" %d", n_options);
2583             printf("\n");
2584         }
2585     }
2586     }
2587     }
2588     function_tests++;
2589 #endif
2590
2591     return(test_ret);
2592 }
2593
2594
2595 static int
2596 test_htmlReadMemory(void) {
2597     int test_ret = 0;
2598
2599 #if defined(LIBXML_HTML_ENABLED)
2600     int mem_base;
2601     htmlDocPtr ret_val;
2602     char * buffer; /* a pointer to a char array */
2603     int n_buffer;
2604     int size; /* the size of the array */
2605     int n_size;
2606     const char * URL; /* the base URL to use for the document */
2607     int n_URL;
2608     char * encoding; /* the document encoding, or NULL */
2609     int n_encoding;
2610     int options; /* a combination of htmlParserOption(s) */
2611     int n_options;
2612
2613     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2614     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2615     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2616     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2617     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2618         mem_base = xmlMemBlocks();
2619         buffer = gen_const_char_ptr(n_buffer, 0);
2620         size = gen_int(n_size, 1);
2621         URL = gen_filepath(n_URL, 2);
2622         encoding = gen_const_char_ptr(n_encoding, 3);
2623         options = gen_int(n_options, 4);
2624
2625         ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2626         desret_htmlDocPtr(ret_val);
2627         call_tests++;
2628         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2629         des_int(n_size, size, 1);
2630         des_filepath(n_URL, URL, 2);
2631         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2632         des_int(n_options, options, 4);
2633         xmlResetLastError();
2634         if (mem_base != xmlMemBlocks()) {
2635             printf("Leak of %d blocks found in htmlReadMemory",
2636                    xmlMemBlocks() - mem_base);
2637             test_ret++;
2638             printf(" %d", n_buffer);
2639             printf(" %d", n_size);
2640             printf(" %d", n_URL);
2641             printf(" %d", n_encoding);
2642             printf(" %d", n_options);
2643             printf("\n");
2644         }
2645     }
2646     }
2647     }
2648     }
2649     }
2650     function_tests++;
2651 #endif
2652
2653     return(test_ret);
2654 }
2655
2656
2657 static int
2658 test_htmlSAXParseDoc(void) {
2659     int test_ret = 0;
2660
2661 #if defined(LIBXML_HTML_ENABLED)
2662     int mem_base;
2663     htmlDocPtr ret_val;
2664     xmlChar * cur; /* a pointer to an array of xmlChar */
2665     int n_cur;
2666     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2667     int n_encoding;
2668     htmlSAXHandlerPtr sax; /* the SAX handler block */
2669     int n_sax;
2670     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2671     int n_userData;
2672
2673     for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2674     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2675     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2676     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2677         mem_base = xmlMemBlocks();
2678         cur = gen_xmlChar_ptr(n_cur, 0);
2679         encoding = gen_const_char_ptr(n_encoding, 1);
2680         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2681         userData = gen_userdata(n_userData, 3);
2682
2683         ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2684         desret_htmlDocPtr(ret_val);
2685         call_tests++;
2686         des_xmlChar_ptr(n_cur, cur, 0);
2687         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2688         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2689         des_userdata(n_userData, userData, 3);
2690         xmlResetLastError();
2691         if (mem_base != xmlMemBlocks()) {
2692             printf("Leak of %d blocks found in htmlSAXParseDoc",
2693                    xmlMemBlocks() - mem_base);
2694             test_ret++;
2695             printf(" %d", n_cur);
2696             printf(" %d", n_encoding);
2697             printf(" %d", n_sax);
2698             printf(" %d", n_userData);
2699             printf("\n");
2700         }
2701     }
2702     }
2703     }
2704     }
2705     function_tests++;
2706 #endif
2707
2708     return(test_ret);
2709 }
2710
2711
2712 static int
2713 test_htmlSAXParseFile(void) {
2714     int test_ret = 0;
2715
2716 #if defined(LIBXML_HTML_ENABLED)
2717     int mem_base;
2718     htmlDocPtr ret_val;
2719     const char * filename; /* the filename */
2720     int n_filename;
2721     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2722     int n_encoding;
2723     htmlSAXHandlerPtr sax; /* the SAX handler block */
2724     int n_sax;
2725     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2726     int n_userData;
2727
2728     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2729     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2730     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2731     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2732         mem_base = xmlMemBlocks();
2733         filename = gen_filepath(n_filename, 0);
2734         encoding = gen_const_char_ptr(n_encoding, 1);
2735         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2736         userData = gen_userdata(n_userData, 3);
2737
2738         ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2739         desret_htmlDocPtr(ret_val);
2740         call_tests++;
2741         des_filepath(n_filename, filename, 0);
2742         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2743         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2744         des_userdata(n_userData, userData, 3);
2745         xmlResetLastError();
2746         if (mem_base != xmlMemBlocks()) {
2747             printf("Leak of %d blocks found in htmlSAXParseFile",
2748                    xmlMemBlocks() - mem_base);
2749             test_ret++;
2750             printf(" %d", n_filename);
2751             printf(" %d", n_encoding);
2752             printf(" %d", n_sax);
2753             printf(" %d", n_userData);
2754             printf("\n");
2755         }
2756     }
2757     }
2758     }
2759     }
2760     function_tests++;
2761 #endif
2762
2763     return(test_ret);
2764 }
2765
2766
2767 static int
2768 test_htmlTagLookup(void) {
2769     int test_ret = 0;
2770
2771
2772     /* missing type support */
2773     return(test_ret);
2774 }
2775
2776 static int
2777 test_HTMLparser(void) {
2778     int test_ret = 0;
2779
2780     if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2781     test_ret += test_UTF8ToHtml();
2782     test_ret += test_htmlAttrAllowed();
2783     test_ret += test_htmlAutoCloseTag();
2784     test_ret += test_htmlCreateMemoryParserCtxt();
2785     test_ret += test_htmlCreatePushParserCtxt();
2786     test_ret += test_htmlCtxtReadDoc();
2787     test_ret += test_htmlCtxtReadFile();
2788     test_ret += test_htmlCtxtReadMemory();
2789     test_ret += test_htmlCtxtReset();
2790     test_ret += test_htmlCtxtUseOptions();
2791     test_ret += test_htmlElementAllowedHere();
2792     test_ret += test_htmlElementStatusHere();
2793     test_ret += test_htmlEncodeEntities();
2794     test_ret += test_htmlEntityLookup();
2795     test_ret += test_htmlEntityValueLookup();
2796     test_ret += test_htmlHandleOmittedElem();
2797     test_ret += test_htmlIsAutoClosed();
2798     test_ret += test_htmlIsScriptAttribute();
2799     test_ret += test_htmlNewParserCtxt();
2800     test_ret += test_htmlNodeStatus();
2801     test_ret += test_htmlParseCharRef();
2802     test_ret += test_htmlParseChunk();
2803     test_ret += test_htmlParseDoc();
2804     test_ret += test_htmlParseDocument();
2805     test_ret += test_htmlParseElement();
2806     test_ret += test_htmlParseEntityRef();
2807     test_ret += test_htmlParseFile();
2808     test_ret += test_htmlReadDoc();
2809     test_ret += test_htmlReadFile();
2810     test_ret += test_htmlReadMemory();
2811     test_ret += test_htmlSAXParseDoc();
2812     test_ret += test_htmlSAXParseFile();
2813     test_ret += test_htmlTagLookup();
2814
2815     if (test_ret != 0)
2816         printf("Module HTMLparser: %d errors\n", test_ret);
2817     return(test_ret);
2818 }
2819
2820 static int
2821 test_htmlDocContentDumpFormatOutput(void) {
2822     int test_ret = 0;
2823
2824 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2825     int mem_base;
2826     xmlOutputBufferPtr buf; /* the HTML buffer output */
2827     int n_buf;
2828     xmlDocPtr cur; /* the document */
2829     int n_cur;
2830     char * encoding; /* the encoding string */
2831     int n_encoding;
2832     int format; /* should formatting spaces been added */
2833     int n_format;
2834
2835     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2836     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2837     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2838     for (n_format = 0;n_format < gen_nb_int;n_format++) {
2839         mem_base = xmlMemBlocks();
2840         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2841         cur = gen_xmlDocPtr(n_cur, 1);
2842         encoding = gen_const_char_ptr(n_encoding, 2);
2843         format = gen_int(n_format, 3);
2844
2845         htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2846         call_tests++;
2847         des_xmlOutputBufferPtr(n_buf, buf, 0);
2848         des_xmlDocPtr(n_cur, cur, 1);
2849         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2850         des_int(n_format, format, 3);
2851         xmlResetLastError();
2852         if (mem_base != xmlMemBlocks()) {
2853             printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2854                    xmlMemBlocks() - mem_base);
2855             test_ret++;
2856             printf(" %d", n_buf);
2857             printf(" %d", n_cur);
2858             printf(" %d", n_encoding);
2859             printf(" %d", n_format);
2860             printf("\n");
2861         }
2862     }
2863     }
2864     }
2865     }
2866     function_tests++;
2867 #endif
2868
2869     return(test_ret);
2870 }
2871
2872
2873 static int
2874 test_htmlDocContentDumpOutput(void) {
2875     int test_ret = 0;
2876
2877 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2878     int mem_base;
2879     xmlOutputBufferPtr buf; /* the HTML buffer output */
2880     int n_buf;
2881     xmlDocPtr cur; /* the document */
2882     int n_cur;
2883     char * encoding; /* the encoding string */
2884     int n_encoding;
2885
2886     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2887     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2888     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2889         mem_base = xmlMemBlocks();
2890         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2891         cur = gen_xmlDocPtr(n_cur, 1);
2892         encoding = gen_const_char_ptr(n_encoding, 2);
2893
2894         htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2895         call_tests++;
2896         des_xmlOutputBufferPtr(n_buf, buf, 0);
2897         des_xmlDocPtr(n_cur, cur, 1);
2898         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2899         xmlResetLastError();
2900         if (mem_base != xmlMemBlocks()) {
2901             printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2902                    xmlMemBlocks() - mem_base);
2903             test_ret++;
2904             printf(" %d", n_buf);
2905             printf(" %d", n_cur);
2906             printf(" %d", n_encoding);
2907             printf("\n");
2908         }
2909     }
2910     }
2911     }
2912     function_tests++;
2913 #endif
2914
2915     return(test_ret);
2916 }
2917
2918
2919 static int
2920 test_htmlDocDump(void) {
2921     int test_ret = 0;
2922
2923 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2924     int mem_base;
2925     int ret_val;
2926     FILE * f; /* the FILE* */
2927     int n_f;
2928     xmlDocPtr cur; /* the document */
2929     int n_cur;
2930
2931     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2932     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2933         mem_base = xmlMemBlocks();
2934         f = gen_FILE_ptr(n_f, 0);
2935         cur = gen_xmlDocPtr(n_cur, 1);
2936
2937         ret_val = htmlDocDump(f, cur);
2938         desret_int(ret_val);
2939         call_tests++;
2940         des_FILE_ptr(n_f, f, 0);
2941         des_xmlDocPtr(n_cur, cur, 1);
2942         xmlResetLastError();
2943         if (mem_base != xmlMemBlocks()) {
2944             printf("Leak of %d blocks found in htmlDocDump",
2945                    xmlMemBlocks() - mem_base);
2946             test_ret++;
2947             printf(" %d", n_f);
2948             printf(" %d", n_cur);
2949             printf("\n");
2950         }
2951     }
2952     }
2953     function_tests++;
2954 #endif
2955
2956     return(test_ret);
2957 }
2958
2959
2960 #define gen_nb_xmlChar_ptr_ptr 1
2961 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2962     return(NULL);
2963 }
2964 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2965 }
2966
2967 static int
2968 test_htmlDocDumpMemory(void) {
2969     int test_ret = 0;
2970
2971 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2972     int mem_base;
2973     xmlDocPtr cur; /* the document */
2974     int n_cur;
2975     xmlChar ** mem; /* OUT: the memory pointer */
2976     int n_mem;
2977     int * size; /* OUT: the memory length */
2978     int n_size;
2979
2980     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2981     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2982     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2983         mem_base = xmlMemBlocks();
2984         cur = gen_xmlDocPtr(n_cur, 0);
2985         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2986         size = gen_int_ptr(n_size, 2);
2987
2988         htmlDocDumpMemory(cur, mem, size);
2989         call_tests++;
2990         des_xmlDocPtr(n_cur, cur, 0);
2991         des_xmlChar_ptr_ptr(n_mem, mem, 1);
2992         des_int_ptr(n_size, size, 2);
2993         xmlResetLastError();
2994         if (mem_base != xmlMemBlocks()) {
2995             printf("Leak of %d blocks found in htmlDocDumpMemory",
2996                    xmlMemBlocks() - mem_base);
2997             test_ret++;
2998             printf(" %d", n_cur);
2999             printf(" %d", n_mem);
3000             printf(" %d", n_size);
3001             printf("\n");
3002         }
3003     }
3004     }
3005     }
3006     function_tests++;
3007 #endif
3008
3009     return(test_ret);
3010 }
3011
3012
3013 static int
3014 test_htmlDocDumpMemoryFormat(void) {
3015     int test_ret = 0;
3016
3017 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3018     int mem_base;
3019     xmlDocPtr cur; /* the document */
3020     int n_cur;
3021     xmlChar ** mem; /* OUT: the memory pointer */
3022     int n_mem;
3023     int * size; /* OUT: the memory length */
3024     int n_size;
3025     int format; /* should formatting spaces been added */
3026     int n_format;
3027
3028     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3029     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3030     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3031     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3032         mem_base = xmlMemBlocks();
3033         cur = gen_xmlDocPtr(n_cur, 0);
3034         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3035         size = gen_int_ptr(n_size, 2);
3036         format = gen_int(n_format, 3);
3037
3038         htmlDocDumpMemoryFormat(cur, mem, size, format);
3039         call_tests++;
3040         des_xmlDocPtr(n_cur, cur, 0);
3041         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3042         des_int_ptr(n_size, size, 2);
3043         des_int(n_format, format, 3);
3044         xmlResetLastError();
3045         if (mem_base != xmlMemBlocks()) {
3046             printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3047                    xmlMemBlocks() - mem_base);
3048             test_ret++;
3049             printf(" %d", n_cur);
3050             printf(" %d", n_mem);
3051             printf(" %d", n_size);
3052             printf(" %d", n_format);
3053             printf("\n");
3054         }
3055     }
3056     }
3057     }
3058     }
3059     function_tests++;
3060 #endif
3061
3062     return(test_ret);
3063 }
3064
3065
3066 static int
3067 test_htmlGetMetaEncoding(void) {
3068     int test_ret = 0;
3069
3070 #if defined(LIBXML_HTML_ENABLED)
3071     int mem_base;
3072     const xmlChar * ret_val;
3073     htmlDocPtr doc; /* the document */
3074     int n_doc;
3075
3076     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3077         mem_base = xmlMemBlocks();
3078         doc = gen_htmlDocPtr(n_doc, 0);
3079
3080         ret_val = htmlGetMetaEncoding(doc);
3081         desret_const_xmlChar_ptr(ret_val);
3082         call_tests++;
3083         des_htmlDocPtr(n_doc, doc, 0);
3084         xmlResetLastError();
3085         if (mem_base != xmlMemBlocks()) {
3086             printf("Leak of %d blocks found in htmlGetMetaEncoding",
3087                    xmlMemBlocks() - mem_base);
3088             test_ret++;
3089             printf(" %d", n_doc);
3090             printf("\n");
3091         }
3092     }
3093     function_tests++;
3094 #endif
3095
3096     return(test_ret);
3097 }
3098
3099
3100 static int
3101 test_htmlIsBooleanAttr(void) {
3102     int test_ret = 0;
3103
3104 #if defined(LIBXML_HTML_ENABLED)
3105     int mem_base;
3106     int ret_val;
3107     xmlChar * name; /* the name of the attribute to check */
3108     int n_name;
3109
3110     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3111         mem_base = xmlMemBlocks();
3112         name = gen_const_xmlChar_ptr(n_name, 0);
3113
3114         ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3115         desret_int(ret_val);
3116         call_tests++;
3117         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3118         xmlResetLastError();
3119         if (mem_base != xmlMemBlocks()) {
3120             printf("Leak of %d blocks found in htmlIsBooleanAttr",
3121                    xmlMemBlocks() - mem_base);
3122             test_ret++;
3123             printf(" %d", n_name);
3124             printf("\n");
3125         }
3126     }
3127     function_tests++;
3128 #endif
3129
3130     return(test_ret);
3131 }
3132
3133
3134 static int
3135 test_htmlNewDoc(void) {
3136     int test_ret = 0;
3137
3138 #if defined(LIBXML_HTML_ENABLED)
3139     int mem_base;
3140     htmlDocPtr ret_val;
3141     xmlChar * URI; /* URI for the dtd, or NULL */
3142     int n_URI;
3143     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3144     int n_ExternalID;
3145
3146     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3147     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3148         mem_base = xmlMemBlocks();
3149         URI = gen_const_xmlChar_ptr(n_URI, 0);
3150         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3151
3152         ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3153         desret_htmlDocPtr(ret_val);
3154         call_tests++;
3155         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3156         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3157         xmlResetLastError();
3158         if (mem_base != xmlMemBlocks()) {
3159             printf("Leak of %d blocks found in htmlNewDoc",
3160                    xmlMemBlocks() - mem_base);
3161             test_ret++;
3162             printf(" %d", n_URI);
3163             printf(" %d", n_ExternalID);
3164             printf("\n");
3165         }
3166     }
3167     }
3168     function_tests++;
3169 #endif
3170
3171     return(test_ret);
3172 }
3173
3174
3175 static int
3176 test_htmlNewDocNoDtD(void) {
3177     int test_ret = 0;
3178
3179 #if defined(LIBXML_HTML_ENABLED)
3180     int mem_base;
3181     htmlDocPtr ret_val;
3182     xmlChar * URI; /* URI for the dtd, or NULL */
3183     int n_URI;
3184     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3185     int n_ExternalID;
3186
3187     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3188     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3189         mem_base = xmlMemBlocks();
3190         URI = gen_const_xmlChar_ptr(n_URI, 0);
3191         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3192
3193         ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3194         desret_htmlDocPtr(ret_val);
3195         call_tests++;
3196         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3197         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3198         xmlResetLastError();
3199         if (mem_base != xmlMemBlocks()) {
3200             printf("Leak of %d blocks found in htmlNewDocNoDtD",
3201                    xmlMemBlocks() - mem_base);
3202             test_ret++;
3203             printf(" %d", n_URI);
3204             printf(" %d", n_ExternalID);
3205             printf("\n");
3206         }
3207     }
3208     }
3209     function_tests++;
3210 #endif
3211
3212     return(test_ret);
3213 }
3214
3215
3216 static int
3217 test_htmlNodeDump(void) {
3218     int test_ret = 0;
3219
3220 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3221     int mem_base;
3222     int ret_val;
3223     xmlBufferPtr buf; /* the HTML buffer output */
3224     int n_buf;
3225     xmlDocPtr doc; /* the document */
3226     int n_doc;
3227     xmlNodePtr cur; /* the current node */
3228     int n_cur;
3229
3230     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3231     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3232     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3233         mem_base = xmlMemBlocks();
3234         buf = gen_xmlBufferPtr(n_buf, 0);
3235         doc = gen_xmlDocPtr(n_doc, 1);
3236         cur = gen_xmlNodePtr(n_cur, 2);
3237
3238         ret_val = htmlNodeDump(buf, doc, cur);
3239         desret_int(ret_val);
3240         call_tests++;
3241         des_xmlBufferPtr(n_buf, buf, 0);
3242         des_xmlDocPtr(n_doc, doc, 1);
3243         des_xmlNodePtr(n_cur, cur, 2);
3244         xmlResetLastError();
3245         if (mem_base != xmlMemBlocks()) {
3246             printf("Leak of %d blocks found in htmlNodeDump",
3247                    xmlMemBlocks() - mem_base);
3248             test_ret++;
3249             printf(" %d", n_buf);
3250             printf(" %d", n_doc);
3251             printf(" %d", n_cur);
3252             printf("\n");
3253         }
3254     }
3255     }
3256     }
3257     function_tests++;
3258 #endif
3259
3260     return(test_ret);
3261 }
3262
3263
3264 static int
3265 test_htmlNodeDumpFile(void) {
3266     int test_ret = 0;
3267
3268 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3269     int mem_base;
3270     FILE * out; /* the FILE pointer */
3271     int n_out;
3272     xmlDocPtr doc; /* the document */
3273     int n_doc;
3274     xmlNodePtr cur; /* the current node */
3275     int n_cur;
3276
3277     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3278     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3279     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3280         mem_base = xmlMemBlocks();
3281         out = gen_FILE_ptr(n_out, 0);
3282         doc = gen_xmlDocPtr(n_doc, 1);
3283         cur = gen_xmlNodePtr(n_cur, 2);
3284
3285         htmlNodeDumpFile(out, doc, cur);
3286         call_tests++;
3287         des_FILE_ptr(n_out, out, 0);
3288         des_xmlDocPtr(n_doc, doc, 1);
3289         des_xmlNodePtr(n_cur, cur, 2);
3290         xmlResetLastError();
3291         if (mem_base != xmlMemBlocks()) {
3292             printf("Leak of %d blocks found in htmlNodeDumpFile",
3293                    xmlMemBlocks() - mem_base);
3294             test_ret++;
3295             printf(" %d", n_out);
3296             printf(" %d", n_doc);
3297             printf(" %d", n_cur);
3298             printf("\n");
3299         }
3300     }
3301     }
3302     }
3303     function_tests++;
3304 #endif
3305
3306     return(test_ret);
3307 }
3308
3309
3310 static int
3311 test_htmlNodeDumpFileFormat(void) {
3312     int test_ret = 0;
3313
3314 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3315     int mem_base;
3316     int ret_val;
3317     FILE * out; /* the FILE pointer */
3318     int n_out;
3319     xmlDocPtr doc; /* the document */
3320     int n_doc;
3321     xmlNodePtr cur; /* the current node */
3322     int n_cur;
3323     char * encoding; /* the document encoding */
3324     int n_encoding;
3325     int format; /* should formatting spaces been added */
3326     int n_format;
3327
3328     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3329     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3330     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3331     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3332     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3333         mem_base = xmlMemBlocks();
3334         out = gen_FILE_ptr(n_out, 0);
3335         doc = gen_xmlDocPtr(n_doc, 1);
3336         cur = gen_xmlNodePtr(n_cur, 2);
3337         encoding = gen_const_char_ptr(n_encoding, 3);
3338         format = gen_int(n_format, 4);
3339
3340         ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3341         desret_int(ret_val);
3342         call_tests++;
3343         des_FILE_ptr(n_out, out, 0);
3344         des_xmlDocPtr(n_doc, doc, 1);
3345         des_xmlNodePtr(n_cur, cur, 2);
3346         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3347         des_int(n_format, format, 4);
3348         xmlResetLastError();
3349         if (mem_base != xmlMemBlocks()) {
3350             printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3351                    xmlMemBlocks() - mem_base);
3352             test_ret++;
3353             printf(" %d", n_out);
3354             printf(" %d", n_doc);
3355             printf(" %d", n_cur);
3356             printf(" %d", n_encoding);
3357             printf(" %d", n_format);
3358             printf("\n");
3359         }
3360     }
3361     }
3362     }
3363     }
3364     }
3365     function_tests++;
3366 #endif
3367
3368     return(test_ret);
3369 }
3370
3371
3372 static int
3373 test_htmlNodeDumpFormatOutput(void) {
3374     int test_ret = 0;
3375
3376 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3377     int mem_base;
3378     xmlOutputBufferPtr buf; /* the HTML buffer output */
3379     int n_buf;
3380     xmlDocPtr doc; /* the document */
3381     int n_doc;
3382     xmlNodePtr cur; /* the current node */
3383     int n_cur;
3384     char * encoding; /* the encoding string */
3385     int n_encoding;
3386     int format; /* should formatting spaces been added */
3387     int n_format;
3388
3389     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3390     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3391     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3392     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3393     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3394         mem_base = xmlMemBlocks();
3395         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3396         doc = gen_xmlDocPtr(n_doc, 1);
3397         cur = gen_xmlNodePtr(n_cur, 2);
3398         encoding = gen_const_char_ptr(n_encoding, 3);
3399         format = gen_int(n_format, 4);
3400
3401         htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3402         call_tests++;
3403         des_xmlOutputBufferPtr(n_buf, buf, 0);
3404         des_xmlDocPtr(n_doc, doc, 1);
3405         des_xmlNodePtr(n_cur, cur, 2);
3406         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3407         des_int(n_format, format, 4);
3408         xmlResetLastError();
3409         if (mem_base != xmlMemBlocks()) {
3410             printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3411                    xmlMemBlocks() - mem_base);
3412             test_ret++;
3413             printf(" %d", n_buf);
3414             printf(" %d", n_doc);
3415             printf(" %d", n_cur);
3416             printf(" %d", n_encoding);
3417             printf(" %d", n_format);
3418             printf("\n");
3419         }
3420     }
3421     }
3422     }
3423     }
3424     }
3425     function_tests++;
3426 #endif
3427
3428     return(test_ret);
3429 }
3430
3431
3432 static int
3433 test_htmlNodeDumpOutput(void) {
3434     int test_ret = 0;
3435
3436 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3437     int mem_base;
3438     xmlOutputBufferPtr buf; /* the HTML buffer output */
3439     int n_buf;
3440     xmlDocPtr doc; /* the document */
3441     int n_doc;
3442     xmlNodePtr cur; /* the current node */
3443     int n_cur;
3444     char * encoding; /* the encoding string */
3445     int n_encoding;
3446
3447     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3448     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3449     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3450     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3451         mem_base = xmlMemBlocks();
3452         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3453         doc = gen_xmlDocPtr(n_doc, 1);
3454         cur = gen_xmlNodePtr(n_cur, 2);
3455         encoding = gen_const_char_ptr(n_encoding, 3);
3456
3457         htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3458         call_tests++;
3459         des_xmlOutputBufferPtr(n_buf, buf, 0);
3460         des_xmlDocPtr(n_doc, doc, 1);
3461         des_xmlNodePtr(n_cur, cur, 2);
3462         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3463         xmlResetLastError();
3464         if (mem_base != xmlMemBlocks()) {
3465             printf("Leak of %d blocks found in htmlNodeDumpOutput",
3466                    xmlMemBlocks() - mem_base);
3467             test_ret++;
3468             printf(" %d", n_buf);
3469             printf(" %d", n_doc);
3470             printf(" %d", n_cur);
3471             printf(" %d", n_encoding);
3472             printf("\n");
3473         }
3474     }
3475     }
3476     }
3477     }
3478     function_tests++;
3479 #endif
3480
3481     return(test_ret);
3482 }
3483
3484
3485 static int
3486 test_htmlSaveFile(void) {
3487     int test_ret = 0;
3488
3489 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3490     int mem_base;
3491     int ret_val;
3492     const char * filename; /* the filename (or URL) */
3493     int n_filename;
3494     xmlDocPtr cur; /* the document */
3495     int n_cur;
3496
3497     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3498     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3499         mem_base = xmlMemBlocks();
3500         filename = gen_fileoutput(n_filename, 0);
3501         cur = gen_xmlDocPtr(n_cur, 1);
3502
3503         ret_val = htmlSaveFile(filename, cur);
3504         desret_int(ret_val);
3505         call_tests++;
3506         des_fileoutput(n_filename, filename, 0);
3507         des_xmlDocPtr(n_cur, cur, 1);
3508         xmlResetLastError();
3509         if (mem_base != xmlMemBlocks()) {
3510             printf("Leak of %d blocks found in htmlSaveFile",
3511                    xmlMemBlocks() - mem_base);
3512             test_ret++;
3513             printf(" %d", n_filename);
3514             printf(" %d", n_cur);
3515             printf("\n");
3516         }
3517     }
3518     }
3519     function_tests++;
3520 #endif
3521
3522     return(test_ret);
3523 }
3524
3525
3526 static int
3527 test_htmlSaveFileEnc(void) {
3528     int test_ret = 0;
3529
3530 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3531     int mem_base;
3532     int ret_val;
3533     const char * filename; /* the filename */
3534     int n_filename;
3535     xmlDocPtr cur; /* the document */
3536     int n_cur;
3537     char * encoding; /* the document encoding */
3538     int n_encoding;
3539
3540     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3541     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3542     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3543         mem_base = xmlMemBlocks();
3544         filename = gen_fileoutput(n_filename, 0);
3545         cur = gen_xmlDocPtr(n_cur, 1);
3546         encoding = gen_const_char_ptr(n_encoding, 2);
3547
3548         ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3549         desret_int(ret_val);
3550         call_tests++;
3551         des_fileoutput(n_filename, filename, 0);
3552         des_xmlDocPtr(n_cur, cur, 1);
3553         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3554         xmlResetLastError();
3555         if (mem_base != xmlMemBlocks()) {
3556             printf("Leak of %d blocks found in htmlSaveFileEnc",
3557                    xmlMemBlocks() - mem_base);
3558             test_ret++;
3559             printf(" %d", n_filename);
3560             printf(" %d", n_cur);
3561             printf(" %d", n_encoding);
3562             printf("\n");
3563         }
3564     }
3565     }
3566     }
3567     function_tests++;
3568 #endif
3569
3570     return(test_ret);
3571 }
3572
3573
3574 static int
3575 test_htmlSaveFileFormat(void) {
3576     int test_ret = 0;
3577
3578 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3579     int mem_base;
3580     int ret_val;
3581     const char * filename; /* the filename */
3582     int n_filename;
3583     xmlDocPtr cur; /* the document */
3584     int n_cur;
3585     char * encoding; /* the document encoding */
3586     int n_encoding;
3587     int format; /* should formatting spaces been added */
3588     int n_format;
3589
3590     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3591     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3592     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3593     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3594         mem_base = xmlMemBlocks();
3595         filename = gen_fileoutput(n_filename, 0);
3596         cur = gen_xmlDocPtr(n_cur, 1);
3597         encoding = gen_const_char_ptr(n_encoding, 2);
3598         format = gen_int(n_format, 3);
3599
3600         ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3601         desret_int(ret_val);
3602         call_tests++;
3603         des_fileoutput(n_filename, filename, 0);
3604         des_xmlDocPtr(n_cur, cur, 1);
3605         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3606         des_int(n_format, format, 3);
3607         xmlResetLastError();
3608         if (mem_base != xmlMemBlocks()) {
3609             printf("Leak of %d blocks found in htmlSaveFileFormat",
3610                    xmlMemBlocks() - mem_base);
3611             test_ret++;
3612             printf(" %d", n_filename);
3613             printf(" %d", n_cur);
3614             printf(" %d", n_encoding);
3615             printf(" %d", n_format);
3616             printf("\n");
3617         }
3618     }
3619     }
3620     }
3621     }
3622     function_tests++;
3623 #endif
3624
3625     return(test_ret);
3626 }
3627
3628
3629 static int
3630 test_htmlSetMetaEncoding(void) {
3631     int test_ret = 0;
3632
3633 #if defined(LIBXML_HTML_ENABLED)
3634     int mem_base;
3635     int ret_val;
3636     htmlDocPtr doc; /* the document */
3637     int n_doc;
3638     xmlChar * encoding; /* the encoding string */
3639     int n_encoding;
3640
3641     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3642     for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3643         mem_base = xmlMemBlocks();
3644         doc = gen_htmlDocPtr(n_doc, 0);
3645         encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3646
3647         ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3648         desret_int(ret_val);
3649         call_tests++;
3650         des_htmlDocPtr(n_doc, doc, 0);
3651         des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3652         xmlResetLastError();
3653         if (mem_base != xmlMemBlocks()) {
3654             printf("Leak of %d blocks found in htmlSetMetaEncoding",
3655                    xmlMemBlocks() - mem_base);
3656             test_ret++;
3657             printf(" %d", n_doc);
3658             printf(" %d", n_encoding);
3659             printf("\n");
3660         }
3661     }
3662     }
3663     function_tests++;
3664 #endif
3665
3666     return(test_ret);
3667 }
3668
3669 static int
3670 test_HTMLtree(void) {
3671     int test_ret = 0;
3672
3673     if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3674     test_ret += test_htmlDocContentDumpFormatOutput();
3675     test_ret += test_htmlDocContentDumpOutput();
3676     test_ret += test_htmlDocDump();
3677     test_ret += test_htmlDocDumpMemory();
3678     test_ret += test_htmlDocDumpMemoryFormat();
3679     test_ret += test_htmlGetMetaEncoding();
3680     test_ret += test_htmlIsBooleanAttr();
3681     test_ret += test_htmlNewDoc();
3682     test_ret += test_htmlNewDocNoDtD();
3683     test_ret += test_htmlNodeDump();
3684     test_ret += test_htmlNodeDumpFile();
3685     test_ret += test_htmlNodeDumpFileFormat();
3686     test_ret += test_htmlNodeDumpFormatOutput();
3687     test_ret += test_htmlNodeDumpOutput();
3688     test_ret += test_htmlSaveFile();
3689     test_ret += test_htmlSaveFileEnc();
3690     test_ret += test_htmlSaveFileFormat();
3691     test_ret += test_htmlSetMetaEncoding();
3692
3693     if (test_ret != 0)
3694         printf("Module HTMLtree: %d errors\n", test_ret);
3695     return(test_ret);
3696 }
3697
3698 static int
3699 test_docbDefaultSAXHandlerInit(void) {
3700     int test_ret = 0;
3701
3702 #if defined(LIBXML_DOCB_ENABLED)
3703 #ifdef LIBXML_DOCB_ENABLED
3704     int mem_base;
3705
3706         mem_base = xmlMemBlocks();
3707
3708         docbDefaultSAXHandlerInit();
3709         call_tests++;
3710         xmlResetLastError();
3711         if (mem_base != xmlMemBlocks()) {
3712             printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3713                    xmlMemBlocks() - mem_base);
3714             test_ret++;
3715             printf("\n");
3716         }
3717     function_tests++;
3718 #endif
3719 #endif
3720
3721     return(test_ret);
3722 }
3723
3724
3725 static int
3726 test_htmlDefaultSAXHandlerInit(void) {
3727     int test_ret = 0;
3728
3729 #if defined(LIBXML_HTML_ENABLED)
3730 #ifdef LIBXML_HTML_ENABLED
3731     int mem_base;
3732
3733         mem_base = xmlMemBlocks();
3734
3735         htmlDefaultSAXHandlerInit();
3736         call_tests++;
3737         xmlResetLastError();
3738         if (mem_base != xmlMemBlocks()) {
3739             printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3740                    xmlMemBlocks() - mem_base);
3741             test_ret++;
3742             printf("\n");
3743         }
3744     function_tests++;
3745 #endif
3746 #endif
3747
3748     return(test_ret);
3749 }
3750
3751
3752 static int
3753 test_xmlDefaultSAXHandlerInit(void) {
3754     int test_ret = 0;
3755
3756     int mem_base;
3757
3758         mem_base = xmlMemBlocks();
3759
3760         xmlDefaultSAXHandlerInit();
3761         call_tests++;
3762         xmlResetLastError();
3763         if (mem_base != xmlMemBlocks()) {
3764             printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3765                    xmlMemBlocks() - mem_base);
3766             test_ret++;
3767             printf("\n");
3768         }
3769     function_tests++;
3770
3771     return(test_ret);
3772 }
3773
3774
3775 #define gen_nb_xmlEnumerationPtr 1
3776 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3777     return(NULL);
3778 }
3779 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3780 }
3781
3782 static int
3783 test_xmlSAX2AttributeDecl(void) {
3784     int test_ret = 0;
3785
3786     int mem_base;
3787     void * ctx; /* the user data (XML parser context) */
3788     int n_ctx;
3789     xmlChar * elem; /* the name of the element */
3790     int n_elem;
3791     xmlChar * fullname; /* the attribute name */
3792     int n_fullname;
3793     int type; /* the attribute type */
3794     int n_type;
3795     int def; /* the type of default value */
3796     int n_def;
3797     xmlChar * defaultValue; /* the attribute default value */
3798     int n_defaultValue;
3799     xmlEnumerationPtr tree; /* the tree of enumerated value set */
3800     int n_tree;
3801
3802     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3803     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3804     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3805     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3806     for (n_def = 0;n_def < gen_nb_int;n_def++) {
3807     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3808     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3809         mem_base = xmlMemBlocks();
3810         ctx = gen_void_ptr(n_ctx, 0);
3811         elem = gen_const_xmlChar_ptr(n_elem, 1);
3812         fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3813         type = gen_int(n_type, 3);
3814         def = gen_int(n_def, 4);
3815         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3816         tree = gen_xmlEnumerationPtr(n_tree, 6);
3817
3818         xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3819         call_tests++;
3820         des_void_ptr(n_ctx, ctx, 0);
3821         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3822         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3823         des_int(n_type, type, 3);
3824         des_int(n_def, def, 4);
3825         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3826         des_xmlEnumerationPtr(n_tree, tree, 6);
3827         xmlResetLastError();
3828         if (mem_base != xmlMemBlocks()) {
3829             printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3830                    xmlMemBlocks() - mem_base);
3831             test_ret++;
3832             printf(" %d", n_ctx);
3833             printf(" %d", n_elem);
3834             printf(" %d", n_fullname);
3835             printf(" %d", n_type);
3836             printf(" %d", n_def);
3837             printf(" %d", n_defaultValue);
3838             printf(" %d", n_tree);
3839             printf("\n");
3840         }
3841     }
3842     }
3843     }
3844     }
3845     }
3846     }
3847     }
3848     function_tests++;
3849
3850     return(test_ret);
3851 }
3852
3853
3854 static int
3855 test_xmlSAX2CDataBlock(void) {
3856     int test_ret = 0;
3857
3858     int mem_base;
3859     void * ctx; /* the user data (XML parser context) */
3860     int n_ctx;
3861     xmlChar * value; /* The pcdata content */
3862     int n_value;
3863     int len; /* the block length */
3864     int n_len;
3865
3866     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3867     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3868     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3869         mem_base = xmlMemBlocks();
3870         ctx = gen_void_ptr(n_ctx, 0);
3871         value = gen_const_xmlChar_ptr(n_value, 1);
3872         len = gen_int(n_len, 2);
3873
3874         xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3875         call_tests++;
3876         des_void_ptr(n_ctx, ctx, 0);
3877         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3878         des_int(n_len, len, 2);
3879         xmlResetLastError();
3880         if (mem_base != xmlMemBlocks()) {
3881             printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3882                    xmlMemBlocks() - mem_base);
3883             test_ret++;
3884             printf(" %d", n_ctx);
3885             printf(" %d", n_value);
3886             printf(" %d", n_len);
3887             printf("\n");
3888         }
3889     }
3890     }
3891     }
3892     function_tests++;
3893
3894     return(test_ret);
3895 }
3896
3897
3898 static int
3899 test_xmlSAX2Characters(void) {
3900     int test_ret = 0;
3901
3902     int mem_base;
3903     void * ctx; /* the user data (XML parser context) */
3904     int n_ctx;
3905     xmlChar * ch; /* a xmlChar string */
3906     int n_ch;
3907     int len; /* the number of xmlChar */
3908     int n_len;
3909
3910     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3911     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3912     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3913         mem_base = xmlMemBlocks();
3914         ctx = gen_void_ptr(n_ctx, 0);
3915         ch = gen_const_xmlChar_ptr(n_ch, 1);
3916         len = gen_int(n_len, 2);
3917
3918         xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3919         call_tests++;
3920         des_void_ptr(n_ctx, ctx, 0);
3921         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3922         des_int(n_len, len, 2);
3923         xmlResetLastError();
3924         if (mem_base != xmlMemBlocks()) {
3925             printf("Leak of %d blocks found in xmlSAX2Characters",
3926                    xmlMemBlocks() - mem_base);
3927             test_ret++;
3928             printf(" %d", n_ctx);
3929             printf(" %d", n_ch);
3930             printf(" %d", n_len);
3931             printf("\n");
3932         }
3933     }
3934     }
3935     }
3936     function_tests++;
3937
3938     return(test_ret);
3939 }
3940
3941
3942 static int
3943 test_xmlSAX2Comment(void) {
3944     int test_ret = 0;
3945
3946     int mem_base;
3947     void * ctx; /* the user data (XML parser context) */
3948     int n_ctx;
3949     xmlChar * value; /* the xmlSAX2Comment content */
3950     int n_value;
3951
3952     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3953     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3954         mem_base = xmlMemBlocks();
3955         ctx = gen_void_ptr(n_ctx, 0);
3956         value = gen_const_xmlChar_ptr(n_value, 1);
3957
3958         xmlSAX2Comment(ctx, (const xmlChar *)value);
3959         call_tests++;
3960         des_void_ptr(n_ctx, ctx, 0);
3961         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3962         xmlResetLastError();
3963         if (mem_base != xmlMemBlocks()) {
3964             printf("Leak of %d blocks found in xmlSAX2Comment",
3965                    xmlMemBlocks() - mem_base);
3966             test_ret++;
3967             printf(" %d", n_ctx);
3968             printf(" %d", n_value);
3969             printf("\n");
3970         }
3971     }
3972     }
3973     function_tests++;
3974
3975     return(test_ret);
3976 }
3977
3978
3979 static int
3980 test_xmlSAX2ElementDecl(void) {
3981     int test_ret = 0;
3982
3983     int mem_base;
3984     void * ctx; /* the user data (XML parser context) */
3985     int n_ctx;
3986     xmlChar * name; /* the element name */
3987     int n_name;
3988     int type; /* the element type */
3989     int n_type;
3990     xmlElementContentPtr content; /* the element value tree */
3991     int n_content;
3992
3993     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3994     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3995     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3996     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3997         mem_base = xmlMemBlocks();
3998         ctx = gen_void_ptr(n_ctx, 0);
3999         name = gen_const_xmlChar_ptr(n_name, 1);
4000         type = gen_int(n_type, 2);
4001         content = gen_xmlElementContentPtr(n_content, 3);
4002
4003         xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4004         call_tests++;
4005         des_void_ptr(n_ctx, ctx, 0);
4006         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4007         des_int(n_type, type, 2);
4008         des_xmlElementContentPtr(n_content, content, 3);
4009         xmlResetLastError();
4010         if (mem_base != xmlMemBlocks()) {
4011             printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4012                    xmlMemBlocks() - mem_base);
4013             test_ret++;
4014             printf(" %d", n_ctx);
4015             printf(" %d", n_name);
4016             printf(" %d", n_type);
4017             printf(" %d", n_content);
4018             printf("\n");
4019         }
4020     }
4021     }
4022     }
4023     }
4024     function_tests++;
4025
4026     return(test_ret);
4027 }
4028
4029
4030 static int
4031 test_xmlSAX2EndDocument(void) {
4032     int test_ret = 0;
4033
4034     int mem_base;
4035     void * ctx; /* the user data (XML parser context) */
4036     int n_ctx;
4037
4038     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4039         mem_base = xmlMemBlocks();
4040         ctx = gen_void_ptr(n_ctx, 0);
4041
4042         xmlSAX2EndDocument(ctx);
4043         call_tests++;
4044         des_void_ptr(n_ctx, ctx, 0);
4045         xmlResetLastError();
4046         if (mem_base != xmlMemBlocks()) {
4047             printf("Leak of %d blocks found in xmlSAX2EndDocument",
4048                    xmlMemBlocks() - mem_base);
4049             test_ret++;
4050             printf(" %d", n_ctx);
4051             printf("\n");
4052         }
4053     }
4054     function_tests++;
4055
4056     return(test_ret);
4057 }
4058
4059
4060 static int
4061 test_xmlSAX2EndElement(void) {
4062     int test_ret = 0;
4063
4064 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4065 #ifdef LIBXML_SAX1_ENABLED
4066     int mem_base;
4067     void * ctx; /* the user data (XML parser context) */
4068     int n_ctx;
4069     xmlChar * name; /* The element name */
4070     int n_name;
4071
4072     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4073     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4074         mem_base = xmlMemBlocks();
4075         ctx = gen_void_ptr(n_ctx, 0);
4076         name = gen_const_xmlChar_ptr(n_name, 1);
4077
4078         xmlSAX2EndElement(ctx, (const xmlChar *)name);
4079         call_tests++;
4080         des_void_ptr(n_ctx, ctx, 0);
4081         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4082         xmlResetLastError();
4083         if (mem_base != xmlMemBlocks()) {
4084             printf("Leak of %d blocks found in xmlSAX2EndElement",
4085                    xmlMemBlocks() - mem_base);
4086             test_ret++;
4087             printf(" %d", n_ctx);
4088             printf(" %d", n_name);
4089             printf("\n");
4090         }
4091     }
4092     }
4093     function_tests++;
4094 #endif
4095 #endif
4096
4097     return(test_ret);
4098 }
4099
4100
4101 static int
4102 test_xmlSAX2EndElementNs(void) {
4103     int test_ret = 0;
4104
4105     int mem_base;
4106     void * ctx; /* the user data (XML parser context) */
4107     int n_ctx;
4108     xmlChar * localname; /* the local name of the element */
4109     int n_localname;
4110     xmlChar * prefix; /* the element namespace prefix if available */
4111     int n_prefix;
4112     xmlChar * URI; /* the element namespace name if available */
4113     int n_URI;
4114
4115     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4116     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4117     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4118     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4119         mem_base = xmlMemBlocks();
4120         ctx = gen_void_ptr(n_ctx, 0);
4121         localname = gen_const_xmlChar_ptr(n_localname, 1);
4122         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4123         URI = gen_const_xmlChar_ptr(n_URI, 3);
4124
4125         xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4126         call_tests++;
4127         des_void_ptr(n_ctx, ctx, 0);
4128         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4129         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4130         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4131         xmlResetLastError();
4132         if (mem_base != xmlMemBlocks()) {
4133             printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4134                    xmlMemBlocks() - mem_base);
4135             test_ret++;
4136             printf(" %d", n_ctx);
4137             printf(" %d", n_localname);
4138             printf(" %d", n_prefix);
4139             printf(" %d", n_URI);
4140             printf("\n");
4141         }
4142     }
4143     }
4144     }
4145     }
4146     function_tests++;
4147
4148     return(test_ret);
4149 }
4150
4151
4152 static int
4153 test_xmlSAX2EntityDecl(void) {
4154     int test_ret = 0;
4155
4156     int mem_base;
4157     void * ctx; /* the user data (XML parser context) */
4158     int n_ctx;
4159     xmlChar * name; /* the entity name */
4160     int n_name;
4161     int type; /* the entity type */
4162     int n_type;
4163     xmlChar * publicId; /* The public ID of the entity */
4164     int n_publicId;
4165     xmlChar * systemId; /* The system ID of the entity */
4166     int n_systemId;
4167     xmlChar * content; /* the entity value (without processing). */
4168     int n_content;
4169
4170     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4171     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4172     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4173     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4174     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4175     for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4176         mem_base = xmlMemBlocks();
4177         ctx = gen_void_ptr(n_ctx, 0);
4178         name = gen_const_xmlChar_ptr(n_name, 1);
4179         type = gen_int(n_type, 2);
4180         publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4181         systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4182         content = gen_xmlChar_ptr(n_content, 5);
4183
4184         xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4185         call_tests++;
4186         des_void_ptr(n_ctx, ctx, 0);
4187         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4188         des_int(n_type, type, 2);
4189         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4190         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4191         des_xmlChar_ptr(n_content, content, 5);
4192         xmlResetLastError();
4193         if (mem_base != xmlMemBlocks()) {
4194             printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4195                    xmlMemBlocks() - mem_base);
4196             test_ret++;
4197             printf(" %d", n_ctx);
4198             printf(" %d", n_name);
4199             printf(" %d", n_type);
4200             printf(" %d", n_publicId);
4201             printf(" %d", n_systemId);
4202             printf(" %d", n_content);
4203             printf("\n");
4204         }
4205     }
4206     }
4207     }
4208     }
4209     }
4210     }
4211     function_tests++;
4212
4213     return(test_ret);
4214 }
4215
4216
4217 static int
4218 test_xmlSAX2ExternalSubset(void) {
4219     int test_ret = 0;
4220
4221     int mem_base;
4222     void * ctx; /* the user data (XML parser context) */
4223     int n_ctx;
4224     xmlChar * name; /* the root element name */
4225     int n_name;
4226     xmlChar * ExternalID; /* the external ID */
4227     int n_ExternalID;
4228     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4229     int n_SystemID;
4230
4231     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4232     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4233     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4234     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4235         mem_base = xmlMemBlocks();
4236         ctx = gen_void_ptr(n_ctx, 0);
4237         name = gen_const_xmlChar_ptr(n_name, 1);
4238         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4239         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4240
4241         xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4242         call_tests++;
4243         des_void_ptr(n_ctx, ctx, 0);
4244         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4245         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4246         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4247         xmlResetLastError();
4248         if (mem_base != xmlMemBlocks()) {
4249             printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4250                    xmlMemBlocks() - mem_base);
4251             test_ret++;
4252             printf(" %d", n_ctx);
4253             printf(" %d", n_name);
4254             printf(" %d", n_ExternalID);
4255             printf(" %d", n_SystemID);
4256             printf("\n");
4257         }
4258     }
4259     }
4260     }
4261     }
4262     function_tests++;
4263
4264     return(test_ret);
4265 }
4266
4267
4268 static int
4269 test_xmlSAX2GetColumnNumber(void) {
4270     int test_ret = 0;
4271
4272     int mem_base;
4273     int ret_val;
4274     void * ctx; /* the user data (XML parser context) */
4275     int n_ctx;
4276
4277     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4278         mem_base = xmlMemBlocks();
4279         ctx = gen_void_ptr(n_ctx, 0);
4280
4281         ret_val = xmlSAX2GetColumnNumber(ctx);
4282         desret_int(ret_val);
4283         call_tests++;
4284         des_void_ptr(n_ctx, ctx, 0);
4285         xmlResetLastError();
4286         if (mem_base != xmlMemBlocks()) {
4287             printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4288                    xmlMemBlocks() - mem_base);
4289             test_ret++;
4290             printf(" %d", n_ctx);
4291             printf("\n");
4292         }
4293     }
4294     function_tests++;
4295
4296     return(test_ret);
4297 }
4298
4299
4300 static int
4301 test_xmlSAX2GetEntity(void) {
4302     int test_ret = 0;
4303
4304     int mem_base;
4305     xmlEntityPtr ret_val;
4306     void * ctx; /* the user data (XML parser context) */
4307     int n_ctx;
4308     xmlChar * name; /* The entity name */
4309     int n_name;
4310
4311     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4312     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4313         mem_base = xmlMemBlocks();
4314         ctx = gen_void_ptr(n_ctx, 0);
4315         name = gen_const_xmlChar_ptr(n_name, 1);
4316
4317         ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4318         desret_xmlEntityPtr(ret_val);
4319         call_tests++;
4320         des_void_ptr(n_ctx, ctx, 0);
4321         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4322         xmlResetLastError();
4323         if (mem_base != xmlMemBlocks()) {
4324             printf("Leak of %d blocks found in xmlSAX2GetEntity",
4325                    xmlMemBlocks() - mem_base);
4326             test_ret++;
4327             printf(" %d", n_ctx);
4328             printf(" %d", n_name);
4329             printf("\n");
4330         }
4331     }
4332     }
4333     function_tests++;
4334
4335     return(test_ret);
4336 }
4337
4338
4339 static int
4340 test_xmlSAX2GetLineNumber(void) {
4341     int test_ret = 0;
4342
4343     int mem_base;
4344     int ret_val;
4345     void * ctx; /* the user data (XML parser context) */
4346     int n_ctx;
4347
4348     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4349         mem_base = xmlMemBlocks();
4350         ctx = gen_void_ptr(n_ctx, 0);
4351
4352         ret_val = xmlSAX2GetLineNumber(ctx);
4353         desret_int(ret_val);
4354         call_tests++;
4355         des_void_ptr(n_ctx, ctx, 0);
4356         xmlResetLastError();
4357         if (mem_base != xmlMemBlocks()) {
4358             printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4359                    xmlMemBlocks() - mem_base);
4360             test_ret++;
4361             printf(" %d", n_ctx);
4362             printf("\n");
4363         }
4364     }
4365     function_tests++;
4366
4367     return(test_ret);
4368 }
4369
4370
4371 static int
4372 test_xmlSAX2GetParameterEntity(void) {
4373     int test_ret = 0;
4374
4375     int mem_base;
4376     xmlEntityPtr ret_val;
4377     void * ctx; /* the user data (XML parser context) */
4378     int n_ctx;
4379     xmlChar * name; /* The entity name */
4380     int n_name;
4381
4382     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4383     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4384         mem_base = xmlMemBlocks();
4385         ctx = gen_void_ptr(n_ctx, 0);
4386         name = gen_const_xmlChar_ptr(n_name, 1);
4387
4388         ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4389         desret_xmlEntityPtr(ret_val);
4390         call_tests++;
4391         des_void_ptr(n_ctx, ctx, 0);
4392         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4393         xmlResetLastError();
4394         if (mem_base != xmlMemBlocks()) {
4395             printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4396                    xmlMemBlocks() - mem_base);
4397             test_ret++;
4398             printf(" %d", n_ctx);
4399             printf(" %d", n_name);
4400             printf("\n");
4401         }
4402     }
4403     }
4404     function_tests++;
4405
4406     return(test_ret);
4407 }
4408
4409
4410 static int
4411 test_xmlSAX2GetPublicId(void) {
4412     int test_ret = 0;
4413
4414     int mem_base;
4415     const xmlChar * ret_val;
4416     void * ctx; /* the user data (XML parser context) */
4417     int n_ctx;
4418
4419     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4420         mem_base = xmlMemBlocks();
4421         ctx = gen_void_ptr(n_ctx, 0);
4422
4423         ret_val = xmlSAX2GetPublicId(ctx);
4424         desret_const_xmlChar_ptr(ret_val);
4425         call_tests++;
4426         des_void_ptr(n_ctx, ctx, 0);
4427         xmlResetLastError();
4428         if (mem_base != xmlMemBlocks()) {
4429             printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4430                    xmlMemBlocks() - mem_base);
4431             test_ret++;
4432             printf(" %d", n_ctx);
4433             printf("\n");
4434         }
4435     }
4436     function_tests++;
4437
4438     return(test_ret);
4439 }
4440
4441
4442 static int
4443 test_xmlSAX2GetSystemId(void) {
4444     int test_ret = 0;
4445
4446     int mem_base;
4447     const xmlChar * ret_val;
4448     void * ctx; /* the user data (XML parser context) */
4449     int n_ctx;
4450
4451     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4452         mem_base = xmlMemBlocks();
4453         ctx = gen_void_ptr(n_ctx, 0);
4454
4455         ret_val = xmlSAX2GetSystemId(ctx);
4456         desret_const_xmlChar_ptr(ret_val);
4457         call_tests++;
4458         des_void_ptr(n_ctx, ctx, 0);
4459         xmlResetLastError();
4460         if (mem_base != xmlMemBlocks()) {
4461             printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4462                    xmlMemBlocks() - mem_base);
4463             test_ret++;
4464             printf(" %d", n_ctx);
4465             printf("\n");
4466         }
4467     }
4468     function_tests++;
4469
4470     return(test_ret);
4471 }
4472
4473
4474 static int
4475 test_xmlSAX2HasExternalSubset(void) {
4476     int test_ret = 0;
4477
4478     int mem_base;
4479     int ret_val;
4480     void * ctx; /* the user data (XML parser context) */
4481     int n_ctx;
4482
4483     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4484         mem_base = xmlMemBlocks();
4485         ctx = gen_void_ptr(n_ctx, 0);
4486
4487         ret_val = xmlSAX2HasExternalSubset(ctx);
4488         desret_int(ret_val);
4489         call_tests++;
4490         des_void_ptr(n_ctx, ctx, 0);
4491         xmlResetLastError();
4492         if (mem_base != xmlMemBlocks()) {
4493             printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4494                    xmlMemBlocks() - mem_base);
4495             test_ret++;
4496             printf(" %d", n_ctx);
4497             printf("\n");
4498         }
4499     }
4500     function_tests++;
4501
4502     return(test_ret);
4503 }
4504
4505
4506 static int
4507 test_xmlSAX2HasInternalSubset(void) {
4508     int test_ret = 0;
4509
4510     int mem_base;
4511     int ret_val;
4512     void * ctx; /* the user data (XML parser context) */
4513     int n_ctx;
4514
4515     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4516         mem_base = xmlMemBlocks();
4517         ctx = gen_void_ptr(n_ctx, 0);
4518
4519         ret_val = xmlSAX2HasInternalSubset(ctx);
4520         desret_int(ret_val);
4521         call_tests++;
4522         des_void_ptr(n_ctx, ctx, 0);
4523         xmlResetLastError();
4524         if (mem_base != xmlMemBlocks()) {
4525             printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4526                    xmlMemBlocks() - mem_base);
4527             test_ret++;
4528             printf(" %d", n_ctx);
4529             printf("\n");
4530         }
4531     }
4532     function_tests++;
4533
4534     return(test_ret);
4535 }
4536
4537
4538 static int
4539 test_xmlSAX2IgnorableWhitespace(void) {
4540     int test_ret = 0;
4541
4542     int mem_base;
4543     void * ctx; /* the user data (XML parser context) */
4544     int n_ctx;
4545     xmlChar * ch; /* a xmlChar string */
4546     int n_ch;
4547     int len; /* the number of xmlChar */
4548     int n_len;
4549
4550     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4551     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4552     for (n_len = 0;n_len < gen_nb_int;n_len++) {
4553         mem_base = xmlMemBlocks();
4554         ctx = gen_void_ptr(n_ctx, 0);
4555         ch = gen_const_xmlChar_ptr(n_ch, 1);
4556         len = gen_int(n_len, 2);
4557
4558         xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4559         call_tests++;
4560         des_void_ptr(n_ctx, ctx, 0);
4561         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4562         des_int(n_len, len, 2);
4563         xmlResetLastError();
4564         if (mem_base != xmlMemBlocks()) {
4565             printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4566                    xmlMemBlocks() - mem_base);
4567             test_ret++;
4568             printf(" %d", n_ctx);
4569             printf(" %d", n_ch);
4570             printf(" %d", n_len);
4571             printf("\n");
4572         }
4573     }
4574     }
4575     }
4576     function_tests++;
4577
4578     return(test_ret);
4579 }
4580
4581
4582 #define gen_nb_xmlSAXHandler_ptr 1
4583 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4584     return(NULL);
4585 }
4586 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4587 }
4588
4589 static int
4590 test_xmlSAX2InitDefaultSAXHandler(void) {
4591     int test_ret = 0;
4592
4593     int mem_base;
4594     xmlSAXHandler * hdlr; /* the SAX handler */
4595     int n_hdlr;
4596     int warning; /* flag if non-zero sets the handler warning procedure */
4597     int n_warning;
4598
4599     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4600     for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4601         mem_base = xmlMemBlocks();
4602         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4603         warning = gen_int(n_warning, 1);
4604
4605         xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4606         call_tests++;
4607         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4608         des_int(n_warning, warning, 1);
4609         xmlResetLastError();
4610         if (mem_base != xmlMemBlocks()) {
4611             printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4612                    xmlMemBlocks() - mem_base);
4613             test_ret++;
4614             printf(" %d", n_hdlr);
4615             printf(" %d", n_warning);
4616             printf("\n");
4617         }
4618     }
4619     }
4620     function_tests++;
4621
4622     return(test_ret);
4623 }
4624
4625
4626 static int
4627 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4628     int test_ret = 0;
4629
4630 #if defined(LIBXML_DOCB_ENABLED)
4631     int mem_base;
4632     xmlSAXHandler * hdlr; /* the SAX handler */
4633     int n_hdlr;
4634
4635     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4636         mem_base = xmlMemBlocks();
4637         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4638
4639         xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4640         call_tests++;
4641         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4642         xmlResetLastError();
4643         if (mem_base != xmlMemBlocks()) {
4644             printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4645                    xmlMemBlocks() - mem_base);
4646             test_ret++;
4647             printf(" %d", n_hdlr);
4648             printf("\n");
4649         }
4650     }
4651     function_tests++;
4652 #endif
4653
4654     return(test_ret);
4655 }
4656
4657
4658 static int
4659 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4660     int test_ret = 0;
4661
4662 #if defined(LIBXML_HTML_ENABLED)
4663     int mem_base;
4664     xmlSAXHandler * hdlr; /* the SAX handler */
4665     int n_hdlr;
4666
4667     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4668         mem_base = xmlMemBlocks();
4669         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4670
4671         xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4672         call_tests++;
4673         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4674         xmlResetLastError();
4675         if (mem_base != xmlMemBlocks()) {
4676             printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4677                    xmlMemBlocks() - mem_base);
4678             test_ret++;
4679             printf(" %d", n_hdlr);
4680             printf("\n");
4681         }
4682     }
4683     function_tests++;
4684 #endif
4685
4686     return(test_ret);
4687 }
4688
4689
4690 static int
4691 test_xmlSAX2InternalSubset(void) {
4692     int test_ret = 0;
4693
4694     int mem_base;
4695     void * ctx; /* the user data (XML parser context) */
4696     int n_ctx;
4697     xmlChar * name; /* the root element name */
4698     int n_name;
4699     xmlChar * ExternalID; /* the external ID */
4700     int n_ExternalID;
4701     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4702     int n_SystemID;
4703
4704     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4705     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4706     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4707     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4708         mem_base = xmlMemBlocks();
4709         ctx = gen_void_ptr(n_ctx, 0);
4710         name = gen_const_xmlChar_ptr(n_name, 1);
4711         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4712         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4713
4714         xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4715         call_tests++;
4716         des_void_ptr(n_ctx, ctx, 0);
4717         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4718         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4719         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4720         xmlResetLastError();
4721         if (mem_base != xmlMemBlocks()) {
4722             printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4723                    xmlMemBlocks() - mem_base);
4724             test_ret++;
4725             printf(" %d", n_ctx);
4726             printf(" %d", n_name);
4727             printf(" %d", n_ExternalID);
4728             printf(" %d", n_SystemID);
4729             printf("\n");
4730         }
4731     }
4732     }
4733     }
4734     }
4735     function_tests++;
4736
4737     return(test_ret);
4738 }
4739
4740
4741 static int
4742 test_xmlSAX2IsStandalone(void) {
4743     int test_ret = 0;
4744
4745     int mem_base;
4746     int ret_val;
4747     void * ctx; /* the user data (XML parser context) */
4748     int n_ctx;
4749
4750     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4751         mem_base = xmlMemBlocks();
4752         ctx = gen_void_ptr(n_ctx, 0);
4753
4754         ret_val = xmlSAX2IsStandalone(ctx);
4755         desret_int(ret_val);
4756         call_tests++;
4757         des_void_ptr(n_ctx, ctx, 0);
4758         xmlResetLastError();
4759         if (mem_base != xmlMemBlocks()) {
4760             printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4761                    xmlMemBlocks() - mem_base);
4762             test_ret++;
4763             printf(" %d", n_ctx);
4764             printf("\n");
4765         }
4766     }
4767     function_tests++;
4768
4769     return(test_ret);
4770 }
4771
4772
4773 static int
4774 test_xmlSAX2NotationDecl(void) {
4775     int test_ret = 0;
4776
4777     int mem_base;
4778     void * ctx; /* the user data (XML parser context) */
4779     int n_ctx;
4780     xmlChar * name; /* The name of the notation */
4781     int n_name;
4782     xmlChar * publicId; /* The public ID of the entity */
4783     int n_publicId;
4784     xmlChar * systemId; /* The system ID of the entity */
4785     int n_systemId;
4786
4787     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4788     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4789     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4790     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4791         mem_base = xmlMemBlocks();
4792         ctx = gen_void_ptr(n_ctx, 0);
4793         name = gen_const_xmlChar_ptr(n_name, 1);
4794         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4795         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4796
4797         xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4798         call_tests++;
4799         des_void_ptr(n_ctx, ctx, 0);
4800         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4801         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4802         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4803         xmlResetLastError();
4804         if (mem_base != xmlMemBlocks()) {
4805             printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4806                    xmlMemBlocks() - mem_base);
4807             test_ret++;
4808             printf(" %d", n_ctx);
4809             printf(" %d", n_name);
4810             printf(" %d", n_publicId);
4811             printf(" %d", n_systemId);
4812             printf("\n");
4813         }
4814     }
4815     }
4816     }
4817     }
4818     function_tests++;
4819
4820     return(test_ret);
4821 }
4822
4823
4824 static int
4825 test_xmlSAX2ProcessingInstruction(void) {
4826     int test_ret = 0;
4827
4828     int mem_base;
4829     void * ctx; /* the user data (XML parser context) */
4830     int n_ctx;
4831     xmlChar * target; /* the target name */
4832     int n_target;
4833     xmlChar * data; /* the PI data's */
4834     int n_data;
4835
4836     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4837     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4838     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4839         mem_base = xmlMemBlocks();
4840         ctx = gen_void_ptr(n_ctx, 0);
4841         target = gen_const_xmlChar_ptr(n_target, 1);
4842         data = gen_const_xmlChar_ptr(n_data, 2);
4843
4844         xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4845         call_tests++;
4846         des_void_ptr(n_ctx, ctx, 0);
4847         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4848         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4849         xmlResetLastError();
4850         if (mem_base != xmlMemBlocks()) {
4851             printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4852                    xmlMemBlocks() - mem_base);
4853             test_ret++;
4854             printf(" %d", n_ctx);
4855             printf(" %d", n_target);
4856             printf(" %d", n_data);
4857             printf("\n");
4858         }
4859     }
4860     }
4861     }
4862     function_tests++;
4863
4864     return(test_ret);
4865 }
4866
4867
4868 static int
4869 test_xmlSAX2Reference(void) {
4870     int test_ret = 0;
4871
4872     int mem_base;
4873     void * ctx; /* the user data (XML parser context) */
4874     int n_ctx;
4875     xmlChar * name; /* The entity name */
4876     int n_name;
4877
4878     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4879     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4880         mem_base = xmlMemBlocks();
4881         ctx = gen_void_ptr(n_ctx, 0);
4882         name = gen_const_xmlChar_ptr(n_name, 1);
4883
4884         xmlSAX2Reference(ctx, (const xmlChar *)name);
4885         call_tests++;
4886         des_void_ptr(n_ctx, ctx, 0);
4887         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4888         xmlResetLastError();
4889         if (mem_base != xmlMemBlocks()) {
4890             printf("Leak of %d blocks found in xmlSAX2Reference",
4891                    xmlMemBlocks() - mem_base);
4892             test_ret++;
4893             printf(" %d", n_ctx);
4894             printf(" %d", n_name);
4895             printf("\n");
4896         }
4897     }
4898     }
4899     function_tests++;
4900
4901     return(test_ret);
4902 }
4903
4904
4905 static int
4906 test_xmlSAX2ResolveEntity(void) {
4907     int test_ret = 0;
4908
4909     int mem_base;
4910     xmlParserInputPtr ret_val;
4911     void * ctx; /* the user data (XML parser context) */
4912     int n_ctx;
4913     xmlChar * publicId; /* The public ID of the entity */
4914     int n_publicId;
4915     xmlChar * systemId; /* The system ID of the entity */
4916     int n_systemId;
4917
4918     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4919     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4920     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4921         mem_base = xmlMemBlocks();
4922         ctx = gen_void_ptr(n_ctx, 0);
4923         publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4924         systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4925
4926         ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4927         desret_xmlParserInputPtr(ret_val);
4928         call_tests++;
4929         des_void_ptr(n_ctx, ctx, 0);
4930         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4931         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4932         xmlResetLastError();
4933         if (mem_base != xmlMemBlocks()) {
4934             printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4935                    xmlMemBlocks() - mem_base);
4936             test_ret++;
4937             printf(" %d", n_ctx);
4938             printf(" %d", n_publicId);
4939             printf(" %d", n_systemId);
4940             printf("\n");
4941         }
4942     }
4943     }
4944     }
4945     function_tests++;
4946
4947     return(test_ret);
4948 }
4949
4950
4951 #define gen_nb_xmlSAXLocatorPtr 1
4952 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4953     return(NULL);
4954 }
4955 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4956 }
4957
4958 static int
4959 test_xmlSAX2SetDocumentLocator(void) {
4960     int test_ret = 0;
4961
4962     int mem_base;
4963     void * ctx; /* the user data (XML parser context) */
4964     int n_ctx;
4965     xmlSAXLocatorPtr loc; /* A SAX Locator */
4966     int n_loc;
4967
4968     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4969     for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4970         mem_base = xmlMemBlocks();
4971         ctx = gen_void_ptr(n_ctx, 0);
4972         loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4973
4974         xmlSAX2SetDocumentLocator(ctx, loc);
4975         call_tests++;
4976         des_void_ptr(n_ctx, ctx, 0);
4977         des_xmlSAXLocatorPtr(n_loc, loc, 1);
4978         xmlResetLastError();
4979         if (mem_base != xmlMemBlocks()) {
4980             printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4981                    xmlMemBlocks() - mem_base);
4982             test_ret++;
4983             printf(" %d", n_ctx);
4984             printf(" %d", n_loc);
4985             printf("\n");
4986         }
4987     }
4988     }
4989     function_tests++;
4990
4991     return(test_ret);
4992 }
4993
4994
4995 static int
4996 test_xmlSAX2StartDocument(void) {
4997     int test_ret = 0;
4998
4999     int mem_base;
5000     void * ctx; /* the user data (XML parser context) */
5001     int n_ctx;
5002
5003     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5004         mem_base = xmlMemBlocks();
5005         ctx = gen_void_ptr(n_ctx, 0);
5006
5007         xmlSAX2StartDocument(ctx);
5008         call_tests++;
5009         des_void_ptr(n_ctx, ctx, 0);
5010         xmlResetLastError();
5011         if (mem_base != xmlMemBlocks()) {
5012             printf("Leak of %d blocks found in xmlSAX2StartDocument",
5013                    xmlMemBlocks() - mem_base);
5014             test_ret++;
5015             printf(" %d", n_ctx);
5016             printf("\n");
5017         }
5018     }
5019     function_tests++;
5020
5021     return(test_ret);
5022 }
5023
5024
5025 static int
5026 test_xmlSAX2StartElement(void) {
5027     int test_ret = 0;
5028
5029 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
5030 #ifdef LIBXML_SAX1_ENABLED
5031     int mem_base;
5032     void * ctx; /* the user data (XML parser context) */
5033     int n_ctx;
5034     xmlChar * fullname; /* The element name, including namespace prefix */
5035     int n_fullname;
5036     xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5037     int n_atts;
5038
5039     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5040     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5041     for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5042         mem_base = xmlMemBlocks();
5043         ctx = gen_void_ptr(n_ctx, 0);
5044         fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5045         atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5046
5047         xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5048         call_tests++;
5049         des_void_ptr(n_ctx, ctx, 0);
5050         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5051         des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5052         xmlResetLastError();
5053         if (mem_base != xmlMemBlocks()) {
5054             printf("Leak of %d blocks found in xmlSAX2StartElement",
5055                    xmlMemBlocks() - mem_base);
5056             test_ret++;
5057             printf(" %d", n_ctx);
5058             printf(" %d", n_fullname);
5059             printf(" %d", n_atts);
5060             printf("\n");
5061         }
5062     }
5063     }
5064     }
5065     function_tests++;
5066 #endif
5067 #endif
5068
5069     return(test_ret);
5070 }
5071
5072
5073 static int
5074 test_xmlSAX2StartElementNs(void) {
5075     int test_ret = 0;
5076
5077     int mem_base;
5078     void * ctx; /* the user data (XML parser context) */
5079     int n_ctx;
5080     xmlChar * localname; /* the local name of the element */
5081     int n_localname;
5082     xmlChar * prefix; /* the element namespace prefix if available */
5083     int n_prefix;
5084     xmlChar * URI; /* the element namespace name if available */
5085     int n_URI;
5086     int nb_namespaces; /* number of namespace definitions on that node */
5087     int n_nb_namespaces;
5088     xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5089     int n_namespaces;
5090     int nb_attributes; /* the number of attributes on that node */
5091     int n_nb_attributes;
5092     int nb_defaulted; /* the number of defaulted attributes. */
5093     int n_nb_defaulted;
5094     xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5095     int n_attributes;
5096
5097     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5098     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5099     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5100     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5101     for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5102     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5103     for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5104     for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5105     for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5106         mem_base = xmlMemBlocks();
5107         ctx = gen_void_ptr(n_ctx, 0);
5108         localname = gen_const_xmlChar_ptr(n_localname, 1);
5109         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5110         URI = gen_const_xmlChar_ptr(n_URI, 3);
5111         nb_namespaces = gen_int(n_nb_namespaces, 4);
5112         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5113         nb_attributes = gen_int(n_nb_attributes, 6);
5114         nb_defaulted = gen_int(n_nb_defaulted, 7);
5115         attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5116
5117         xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5118         call_tests++;
5119         des_void_ptr(n_ctx, ctx, 0);
5120         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5121         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5122         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5123         des_int(n_nb_namespaces, nb_namespaces, 4);
5124         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5125         des_int(n_nb_attributes, nb_attributes, 6);
5126         des_int(n_nb_defaulted, nb_defaulted, 7);
5127         des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5128         xmlResetLastError();
5129         if (mem_base != xmlMemBlocks()) {
5130             printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5131                    xmlMemBlocks() - mem_base);
5132             test_ret++;
5133             printf(" %d", n_ctx);
5134             printf(" %d", n_localname);
5135             printf(" %d", n_prefix);
5136             printf(" %d", n_URI);
5137             printf(" %d", n_nb_namespaces);
5138             printf(" %d", n_namespaces);
5139             printf(" %d", n_nb_attributes);
5140             printf(" %d", n_nb_defaulted);
5141             printf(" %d", n_attributes);
5142             printf("\n");
5143         }
5144     }
5145     }
5146     }
5147     }
5148     }
5149     }
5150     }
5151     }
5152     }
5153     function_tests++;
5154
5155     return(test_ret);
5156 }
5157
5158
5159 static int
5160 test_xmlSAX2UnparsedEntityDecl(void) {
5161     int test_ret = 0;
5162
5163     int mem_base;
5164     void * ctx; /* the user data (XML parser context) */
5165     int n_ctx;
5166     xmlChar * name; /* The name of the entity */
5167     int n_name;
5168     xmlChar * publicId; /* The public ID of the entity */
5169     int n_publicId;
5170     xmlChar * systemId; /* The system ID of the entity */
5171     int n_systemId;
5172     xmlChar * notationName; /* the name of the notation */
5173     int n_notationName;
5174
5175     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5176     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5177     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5178     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5179     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5180         mem_base = xmlMemBlocks();
5181         ctx = gen_void_ptr(n_ctx, 0);
5182         name = gen_const_xmlChar_ptr(n_name, 1);
5183         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5184         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5185         notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5186
5187         xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5188         call_tests++;
5189         des_void_ptr(n_ctx, ctx, 0);
5190         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5191         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5192         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5193         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5194         xmlResetLastError();
5195         if (mem_base != xmlMemBlocks()) {
5196             printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5197                    xmlMemBlocks() - mem_base);
5198             test_ret++;
5199             printf(" %d", n_ctx);
5200             printf(" %d", n_name);
5201             printf(" %d", n_publicId);
5202             printf(" %d", n_systemId);
5203             printf(" %d", n_notationName);
5204             printf("\n");
5205         }
5206     }
5207     }
5208     }
5209     }
5210     }
5211     function_tests++;
5212
5213     return(test_ret);
5214 }
5215
5216
5217 static int
5218 test_xmlSAXDefaultVersion(void) {
5219     int test_ret = 0;
5220
5221 #if defined(LIBXML_SAX1_ENABLED)
5222 #ifdef LIBXML_SAX1_ENABLED
5223     int mem_base;
5224     int ret_val;
5225     int version; /* the version, 1 or 2 */
5226     int n_version;
5227
5228     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5229         mem_base = xmlMemBlocks();
5230         version = gen_int(n_version, 0);
5231
5232         ret_val = xmlSAXDefaultVersion(version);
5233         desret_int(ret_val);
5234         call_tests++;
5235         des_int(n_version, version, 0);
5236         xmlResetLastError();
5237         if (mem_base != xmlMemBlocks()) {
5238             printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5239                    xmlMemBlocks() - mem_base);
5240             test_ret++;
5241             printf(" %d", n_version);
5242             printf("\n");
5243         }
5244     }
5245     function_tests++;
5246 #endif
5247 #endif
5248
5249     return(test_ret);
5250 }
5251
5252
5253 static int
5254 test_xmlSAXVersion(void) {
5255     int test_ret = 0;
5256
5257     int mem_base;
5258     int ret_val;
5259     xmlSAXHandler * hdlr; /* the SAX handler */
5260     int n_hdlr;
5261     int version; /* the version, 1 or 2 */
5262     int n_version;
5263
5264     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5265     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5266         mem_base = xmlMemBlocks();
5267         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5268         version = gen_int(n_version, 1);
5269
5270         ret_val = xmlSAXVersion(hdlr, version);
5271         desret_int(ret_val);
5272         call_tests++;
5273         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5274         des_int(n_version, version, 1);
5275         xmlResetLastError();
5276         if (mem_base != xmlMemBlocks()) {
5277             printf("Leak of %d blocks found in xmlSAXVersion",
5278                    xmlMemBlocks() - mem_base);
5279             test_ret++;
5280             printf(" %d", n_hdlr);
5281             printf(" %d", n_version);
5282             printf("\n");
5283         }
5284     }
5285     }
5286     function_tests++;
5287
5288     return(test_ret);
5289 }
5290
5291 static int
5292 test_SAX2(void) {
5293     int test_ret = 0;
5294
5295     if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5296     test_ret += test_docbDefaultSAXHandlerInit();
5297     test_ret += test_htmlDefaultSAXHandlerInit();
5298     test_ret += test_xmlDefaultSAXHandlerInit();
5299     test_ret += test_xmlSAX2AttributeDecl();
5300     test_ret += test_xmlSAX2CDataBlock();
5301     test_ret += test_xmlSAX2Characters();
5302     test_ret += test_xmlSAX2Comment();
5303     test_ret += test_xmlSAX2ElementDecl();
5304     test_ret += test_xmlSAX2EndDocument();
5305     test_ret += test_xmlSAX2EndElement();
5306     test_ret += test_xmlSAX2EndElementNs();
5307     test_ret += test_xmlSAX2EntityDecl();
5308     test_ret += test_xmlSAX2ExternalSubset();
5309     test_ret += test_xmlSAX2GetColumnNumber();
5310     test_ret += test_xmlSAX2GetEntity();
5311     test_ret += test_xmlSAX2GetLineNumber();
5312     test_ret += test_xmlSAX2GetParameterEntity();
5313     test_ret += test_xmlSAX2GetPublicId();
5314     test_ret += test_xmlSAX2GetSystemId();
5315     test_ret += test_xmlSAX2HasExternalSubset();
5316     test_ret += test_xmlSAX2HasInternalSubset();
5317     test_ret += test_xmlSAX2IgnorableWhitespace();
5318     test_ret += test_xmlSAX2InitDefaultSAXHandler();
5319     test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5320     test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5321     test_ret += test_xmlSAX2InternalSubset();
5322     test_ret += test_xmlSAX2IsStandalone();
5323     test_ret += test_xmlSAX2NotationDecl();
5324     test_ret += test_xmlSAX2ProcessingInstruction();
5325     test_ret += test_xmlSAX2Reference();
5326     test_ret += test_xmlSAX2ResolveEntity();
5327     test_ret += test_xmlSAX2SetDocumentLocator();
5328     test_ret += test_xmlSAX2StartDocument();
5329     test_ret += test_xmlSAX2StartElement();
5330     test_ret += test_xmlSAX2StartElementNs();
5331     test_ret += test_xmlSAX2UnparsedEntityDecl();
5332     test_ret += test_xmlSAXDefaultVersion();
5333     test_ret += test_xmlSAXVersion();
5334
5335     if (test_ret != 0)
5336         printf("Module SAX2: %d errors\n", test_ret);
5337     return(test_ret);
5338 }
5339
5340 static int
5341 test_xmlC14NDocDumpMemory(void) {
5342     int test_ret = 0;
5343
5344 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5345     int mem_base;
5346     int ret_val;
5347     xmlDocPtr doc; /* the XML document for canonization */
5348     int n_doc;
5349     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5350     int n_nodes;
5351     int mode; /* the c14n mode (see @xmlC14NMode) */
5352     int n_mode;
5353     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) */
5354     int n_inclusive_ns_prefixes;
5355     int with_comments; /* include comments in the result (!=0) or not (==0) */
5356     int n_with_comments;
5357     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 */
5358     int n_doc_txt_ptr;
5359
5360     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5361     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5362     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5363     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5364     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5365     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5366         mem_base = xmlMemBlocks();
5367         doc = gen_xmlDocPtr(n_doc, 0);
5368         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5369         mode = gen_int(n_mode, 2);
5370         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5371         with_comments = gen_int(n_with_comments, 4);
5372         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5373
5374         ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5375         desret_int(ret_val);
5376         call_tests++;
5377         des_xmlDocPtr(n_doc, doc, 0);
5378         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5379         des_int(n_mode, mode, 2);
5380         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5381         des_int(n_with_comments, with_comments, 4);
5382         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5383         xmlResetLastError();
5384         if (mem_base != xmlMemBlocks()) {
5385             printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5386                    xmlMemBlocks() - mem_base);
5387             test_ret++;
5388             printf(" %d", n_doc);
5389             printf(" %d", n_nodes);
5390             printf(" %d", n_mode);
5391             printf(" %d", n_inclusive_ns_prefixes);
5392             printf(" %d", n_with_comments);
5393             printf(" %d", n_doc_txt_ptr);
5394             printf("\n");
5395         }
5396     }
5397     }
5398     }
5399     }
5400     }
5401     }
5402     function_tests++;
5403 #endif
5404
5405     return(test_ret);
5406 }
5407
5408
5409 static int
5410 test_xmlC14NDocSave(void) {
5411     int test_ret = 0;
5412
5413 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5414     int mem_base;
5415     int ret_val;
5416     xmlDocPtr doc; /* the XML document for canonization */
5417     int n_doc;
5418     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5419     int n_nodes;
5420     int mode; /* the c14n mode (see @xmlC14NMode) */
5421     int n_mode;
5422     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) */
5423     int n_inclusive_ns_prefixes;
5424     int with_comments; /* include comments in the result (!=0) or not (==0) */
5425     int n_with_comments;
5426     const char * filename; /* the filename to store canonical XML image */
5427     int n_filename;
5428     int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5429     int n_compression;
5430
5431     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5432     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5433     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5434     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5435     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5436     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5437     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5438         mem_base = xmlMemBlocks();
5439         doc = gen_xmlDocPtr(n_doc, 0);
5440         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5441         mode = gen_int(n_mode, 2);
5442         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5443         with_comments = gen_int(n_with_comments, 4);
5444         filename = gen_fileoutput(n_filename, 5);
5445         compression = gen_int(n_compression, 6);
5446
5447         ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5448         desret_int(ret_val);
5449         call_tests++;
5450         des_xmlDocPtr(n_doc, doc, 0);
5451         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5452         des_int(n_mode, mode, 2);
5453         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5454         des_int(n_with_comments, with_comments, 4);
5455         des_fileoutput(n_filename, filename, 5);
5456         des_int(n_compression, compression, 6);
5457         xmlResetLastError();
5458         if (mem_base != xmlMemBlocks()) {
5459             printf("Leak of %d blocks found in xmlC14NDocSave",
5460                    xmlMemBlocks() - mem_base);
5461             test_ret++;
5462             printf(" %d", n_doc);
5463             printf(" %d", n_nodes);
5464             printf(" %d", n_mode);
5465             printf(" %d", n_inclusive_ns_prefixes);
5466             printf(" %d", n_with_comments);
5467             printf(" %d", n_filename);
5468             printf(" %d", n_compression);
5469             printf("\n");
5470         }
5471     }
5472     }
5473     }
5474     }
5475     }
5476     }
5477     }
5478     function_tests++;
5479 #endif
5480
5481     return(test_ret);
5482 }
5483
5484
5485 static int
5486 test_xmlC14NDocSaveTo(void) {
5487     int test_ret = 0;
5488
5489 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5490     int mem_base;
5491     int ret_val;
5492     xmlDocPtr doc; /* the XML document for canonization */
5493     int n_doc;
5494     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5495     int n_nodes;
5496     int mode; /* the c14n mode (see @xmlC14NMode) */
5497     int n_mode;
5498     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) */
5499     int n_inclusive_ns_prefixes;
5500     int with_comments; /* include comments in the result (!=0) or not (==0) */
5501     int n_with_comments;
5502     xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5503     int n_buf;
5504
5505     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5506     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5507     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5508     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5509     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5510     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5511         mem_base = xmlMemBlocks();
5512         doc = gen_xmlDocPtr(n_doc, 0);
5513         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5514         mode = gen_int(n_mode, 2);
5515         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5516         with_comments = gen_int(n_with_comments, 4);
5517         buf = gen_xmlOutputBufferPtr(n_buf, 5);
5518
5519         ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5520         desret_int(ret_val);
5521         call_tests++;
5522         des_xmlDocPtr(n_doc, doc, 0);
5523         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5524         des_int(n_mode, mode, 2);
5525         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5526         des_int(n_with_comments, with_comments, 4);
5527         des_xmlOutputBufferPtr(n_buf, buf, 5);
5528         xmlResetLastError();
5529         if (mem_base != xmlMemBlocks()) {
5530             printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5531                    xmlMemBlocks() - mem_base);
5532             test_ret++;
5533             printf(" %d", n_doc);
5534             printf(" %d", n_nodes);
5535             printf(" %d", n_mode);
5536             printf(" %d", n_inclusive_ns_prefixes);
5537             printf(" %d", n_with_comments);
5538             printf(" %d", n_buf);
5539             printf("\n");
5540         }
5541     }
5542     }
5543     }
5544     }
5545     }
5546     }
5547     function_tests++;
5548 #endif
5549
5550     return(test_ret);
5551 }
5552
5553
5554 static int
5555 test_xmlC14NExecute(void) {
5556     int test_ret = 0;
5557
5558
5559     /* missing type support */
5560     return(test_ret);
5561 }
5562
5563 static int
5564 test_c14n(void) {
5565     int test_ret = 0;
5566
5567     if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5568     test_ret += test_xmlC14NDocDumpMemory();
5569     test_ret += test_xmlC14NDocSave();
5570     test_ret += test_xmlC14NDocSaveTo();
5571     test_ret += test_xmlC14NExecute();
5572
5573     if (test_ret != 0)
5574         printf("Module c14n: %d errors\n", test_ret);
5575     return(test_ret);
5576 }
5577 #ifdef LIBXML_CATALOG_ENABLED
5578
5579 #define gen_nb_xmlCatalogPtr 1
5580 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5581     return(NULL);
5582 }
5583 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5584 }
5585 #endif
5586
5587
5588 static int
5589 test_xmlACatalogAdd(void) {
5590     int test_ret = 0;
5591
5592 #if defined(LIBXML_CATALOG_ENABLED)
5593     int mem_base;
5594     int ret_val;
5595     xmlCatalogPtr catal; /* a Catalog */
5596     int n_catal;
5597     xmlChar * type; /* the type of record to add to the catalog */
5598     int n_type;
5599     xmlChar * orig; /* the system, public or prefix to match */
5600     int n_orig;
5601     xmlChar * replace; /* the replacement value for the match */
5602     int n_replace;
5603
5604     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5605     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5606     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5607     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5608         mem_base = xmlMemBlocks();
5609         catal = gen_xmlCatalogPtr(n_catal, 0);
5610         type = gen_const_xmlChar_ptr(n_type, 1);
5611         orig = gen_const_xmlChar_ptr(n_orig, 2);
5612         replace = gen_const_xmlChar_ptr(n_replace, 3);
5613
5614         ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5615         desret_int(ret_val);
5616         call_tests++;
5617         des_xmlCatalogPtr(n_catal, catal, 0);
5618         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5619         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5620         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5621         xmlResetLastError();
5622         if (mem_base != xmlMemBlocks()) {
5623             printf("Leak of %d blocks found in xmlACatalogAdd",
5624                    xmlMemBlocks() - mem_base);
5625             test_ret++;
5626             printf(" %d", n_catal);
5627             printf(" %d", n_type);
5628             printf(" %d", n_orig);
5629             printf(" %d", n_replace);
5630             printf("\n");
5631         }
5632     }
5633     }
5634     }
5635     }
5636     function_tests++;
5637 #endif
5638
5639     return(test_ret);
5640 }
5641
5642
5643 static int
5644 test_xmlACatalogDump(void) {
5645     int test_ret = 0;
5646
5647 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5648     int mem_base;
5649     xmlCatalogPtr catal; /* a Catalog */
5650     int n_catal;
5651     FILE * out; /* the file. */
5652     int n_out;
5653
5654     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5655     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5656         mem_base = xmlMemBlocks();
5657         catal = gen_xmlCatalogPtr(n_catal, 0);
5658         out = gen_FILE_ptr(n_out, 1);
5659
5660         xmlACatalogDump(catal, out);
5661         call_tests++;
5662         des_xmlCatalogPtr(n_catal, catal, 0);
5663         des_FILE_ptr(n_out, out, 1);
5664         xmlResetLastError();
5665         if (mem_base != xmlMemBlocks()) {
5666             printf("Leak of %d blocks found in xmlACatalogDump",
5667                    xmlMemBlocks() - mem_base);
5668             test_ret++;
5669             printf(" %d", n_catal);
5670             printf(" %d", n_out);
5671             printf("\n");
5672         }
5673     }
5674     }
5675     function_tests++;
5676 #endif
5677
5678     return(test_ret);
5679 }
5680
5681
5682 static int
5683 test_xmlACatalogRemove(void) {
5684     int test_ret = 0;
5685
5686 #if defined(LIBXML_CATALOG_ENABLED)
5687     int mem_base;
5688     int ret_val;
5689     xmlCatalogPtr catal; /* a Catalog */
5690     int n_catal;
5691     xmlChar * value; /* the value to remove */
5692     int n_value;
5693
5694     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5695     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5696         mem_base = xmlMemBlocks();
5697         catal = gen_xmlCatalogPtr(n_catal, 0);
5698         value = gen_const_xmlChar_ptr(n_value, 1);
5699
5700         ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5701         desret_int(ret_val);
5702         call_tests++;
5703         des_xmlCatalogPtr(n_catal, catal, 0);
5704         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5705         xmlResetLastError();
5706         if (mem_base != xmlMemBlocks()) {
5707             printf("Leak of %d blocks found in xmlACatalogRemove",
5708                    xmlMemBlocks() - mem_base);
5709             test_ret++;
5710             printf(" %d", n_catal);
5711             printf(" %d", n_value);
5712             printf("\n");
5713         }
5714     }
5715     }
5716     function_tests++;
5717 #endif
5718
5719     return(test_ret);
5720 }
5721
5722
5723 static int
5724 test_xmlACatalogResolve(void) {
5725     int test_ret = 0;
5726
5727 #if defined(LIBXML_CATALOG_ENABLED)
5728     int mem_base;
5729     xmlChar * ret_val;
5730     xmlCatalogPtr catal; /* a Catalog */
5731     int n_catal;
5732     xmlChar * pubID; /* the public ID string */
5733     int n_pubID;
5734     xmlChar * sysID; /* the system ID string */
5735     int n_sysID;
5736
5737     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5738     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5739     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5740         mem_base = xmlMemBlocks();
5741         catal = gen_xmlCatalogPtr(n_catal, 0);
5742         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5743         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5744
5745         ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5746         desret_xmlChar_ptr(ret_val);
5747         call_tests++;
5748         des_xmlCatalogPtr(n_catal, catal, 0);
5749         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5750         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5751         xmlResetLastError();
5752         if (mem_base != xmlMemBlocks()) {
5753             printf("Leak of %d blocks found in xmlACatalogResolve",
5754                    xmlMemBlocks() - mem_base);
5755             test_ret++;
5756             printf(" %d", n_catal);
5757             printf(" %d", n_pubID);
5758             printf(" %d", n_sysID);
5759             printf("\n");
5760         }
5761     }
5762     }
5763     }
5764     function_tests++;
5765 #endif
5766
5767     return(test_ret);
5768 }
5769
5770
5771 static int
5772 test_xmlACatalogResolvePublic(void) {
5773     int test_ret = 0;
5774
5775 #if defined(LIBXML_CATALOG_ENABLED)
5776     int mem_base;
5777     xmlChar * ret_val;
5778     xmlCatalogPtr catal; /* a Catalog */
5779     int n_catal;
5780     xmlChar * pubID; /* the public ID string */
5781     int n_pubID;
5782
5783     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5784     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5785         mem_base = xmlMemBlocks();
5786         catal = gen_xmlCatalogPtr(n_catal, 0);
5787         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5788
5789         ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5790         desret_xmlChar_ptr(ret_val);
5791         call_tests++;
5792         des_xmlCatalogPtr(n_catal, catal, 0);
5793         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5794         xmlResetLastError();
5795         if (mem_base != xmlMemBlocks()) {
5796             printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5797                    xmlMemBlocks() - mem_base);
5798             test_ret++;
5799             printf(" %d", n_catal);
5800             printf(" %d", n_pubID);
5801             printf("\n");
5802         }
5803     }
5804     }
5805     function_tests++;
5806 #endif
5807
5808     return(test_ret);
5809 }
5810
5811
5812 static int
5813 test_xmlACatalogResolveSystem(void) {
5814     int test_ret = 0;
5815
5816 #if defined(LIBXML_CATALOG_ENABLED)
5817     int mem_base;
5818     xmlChar * ret_val;
5819     xmlCatalogPtr catal; /* a Catalog */
5820     int n_catal;
5821     xmlChar * sysID; /* the system ID string */
5822     int n_sysID;
5823
5824     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5825     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5826         mem_base = xmlMemBlocks();
5827         catal = gen_xmlCatalogPtr(n_catal, 0);
5828         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5829
5830         ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5831         desret_xmlChar_ptr(ret_val);
5832         call_tests++;
5833         des_xmlCatalogPtr(n_catal, catal, 0);
5834         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5835         xmlResetLastError();
5836         if (mem_base != xmlMemBlocks()) {
5837             printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5838                    xmlMemBlocks() - mem_base);
5839             test_ret++;
5840             printf(" %d", n_catal);
5841             printf(" %d", n_sysID);
5842             printf("\n");
5843         }
5844     }
5845     }
5846     function_tests++;
5847 #endif
5848
5849     return(test_ret);
5850 }
5851
5852
5853 static int
5854 test_xmlACatalogResolveURI(void) {
5855     int test_ret = 0;
5856
5857 #if defined(LIBXML_CATALOG_ENABLED)
5858     int mem_base;
5859     xmlChar * ret_val;
5860     xmlCatalogPtr catal; /* a Catalog */
5861     int n_catal;
5862     xmlChar * URI; /* the URI */
5863     int n_URI;
5864
5865     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5866     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5867         mem_base = xmlMemBlocks();
5868         catal = gen_xmlCatalogPtr(n_catal, 0);
5869         URI = gen_const_xmlChar_ptr(n_URI, 1);
5870
5871         ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5872         desret_xmlChar_ptr(ret_val);
5873         call_tests++;
5874         des_xmlCatalogPtr(n_catal, catal, 0);
5875         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5876         xmlResetLastError();
5877         if (mem_base != xmlMemBlocks()) {
5878             printf("Leak of %d blocks found in xmlACatalogResolveURI",
5879                    xmlMemBlocks() - mem_base);
5880             test_ret++;
5881             printf(" %d", n_catal);
5882             printf(" %d", n_URI);
5883             printf("\n");
5884         }
5885     }
5886     }
5887     function_tests++;
5888 #endif
5889
5890     return(test_ret);
5891 }
5892
5893
5894 static int
5895 test_xmlCatalogAdd(void) {
5896     int test_ret = 0;
5897
5898 #if defined(LIBXML_CATALOG_ENABLED)
5899     int mem_base;
5900     int ret_val;
5901     xmlChar * type; /* the type of record to add to the catalog */
5902     int n_type;
5903     xmlChar * orig; /* the system, public or prefix to match */
5904     int n_orig;
5905     xmlChar * replace; /* the replacement value for the match */
5906     int n_replace;
5907
5908     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5909     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5910     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5911         mem_base = xmlMemBlocks();
5912         type = gen_const_xmlChar_ptr(n_type, 0);
5913         orig = gen_const_xmlChar_ptr(n_orig, 1);
5914         replace = gen_const_xmlChar_ptr(n_replace, 2);
5915
5916         ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5917         desret_int(ret_val);
5918         call_tests++;
5919         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5920         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5921         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5922         xmlResetLastError();
5923         if (mem_base != xmlMemBlocks()) {
5924             printf("Leak of %d blocks found in xmlCatalogAdd",
5925                    xmlMemBlocks() - mem_base);
5926             test_ret++;
5927             printf(" %d", n_type);
5928             printf(" %d", n_orig);
5929             printf(" %d", n_replace);
5930             printf("\n");
5931         }
5932     }
5933     }
5934     }
5935     function_tests++;
5936 #endif
5937
5938     return(test_ret);
5939 }
5940
5941
5942 static int
5943 test_xmlCatalogCleanup(void) {
5944     int test_ret = 0;
5945
5946 #if defined(LIBXML_CATALOG_ENABLED)
5947
5948
5949         xmlCatalogCleanup();
5950         call_tests++;
5951         xmlResetLastError();
5952     function_tests++;
5953 #endif
5954
5955     return(test_ret);
5956 }
5957
5958
5959 static int
5960 test_xmlCatalogConvert(void) {
5961     int test_ret = 0;
5962
5963 #if defined(LIBXML_CATALOG_ENABLED)
5964     int ret_val;
5965
5966
5967         ret_val = xmlCatalogConvert();
5968         desret_int(ret_val);
5969         call_tests++;
5970         xmlResetLastError();
5971     function_tests++;
5972 #endif
5973
5974     return(test_ret);
5975 }
5976
5977
5978 static int
5979 test_xmlCatalogDump(void) {
5980     int test_ret = 0;
5981
5982 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5983     int mem_base;
5984     FILE * out; /* the file. */
5985     int n_out;
5986
5987     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5988         mem_base = xmlMemBlocks();
5989         out = gen_FILE_ptr(n_out, 0);
5990
5991         xmlCatalogDump(out);
5992         call_tests++;
5993         des_FILE_ptr(n_out, out, 0);
5994         xmlResetLastError();
5995         if (mem_base != xmlMemBlocks()) {
5996             printf("Leak of %d blocks found in xmlCatalogDump",
5997                    xmlMemBlocks() - mem_base);
5998             test_ret++;
5999             printf(" %d", n_out);
6000             printf("\n");
6001         }
6002     }
6003     function_tests++;
6004 #endif
6005
6006     return(test_ret);
6007 }
6008
6009
6010 static int
6011 test_xmlCatalogGetDefaults(void) {
6012     int test_ret = 0;
6013
6014 #if defined(LIBXML_CATALOG_ENABLED)
6015     int mem_base;
6016     xmlCatalogAllow ret_val;
6017
6018         mem_base = xmlMemBlocks();
6019
6020         ret_val = xmlCatalogGetDefaults();
6021         desret_xmlCatalogAllow(ret_val);
6022         call_tests++;
6023         xmlResetLastError();
6024         if (mem_base != xmlMemBlocks()) {
6025             printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6026                    xmlMemBlocks() - mem_base);
6027             test_ret++;
6028             printf("\n");
6029         }
6030     function_tests++;
6031 #endif
6032
6033     return(test_ret);
6034 }
6035
6036
6037 static int
6038 test_xmlCatalogIsEmpty(void) {
6039     int test_ret = 0;
6040
6041 #if defined(LIBXML_CATALOG_ENABLED)
6042     int mem_base;
6043     int ret_val;
6044     xmlCatalogPtr catal; /* should this create an SGML catalog */
6045     int n_catal;
6046
6047     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6048         mem_base = xmlMemBlocks();
6049         catal = gen_xmlCatalogPtr(n_catal, 0);
6050
6051         ret_val = xmlCatalogIsEmpty(catal);
6052         desret_int(ret_val);
6053         call_tests++;
6054         des_xmlCatalogPtr(n_catal, catal, 0);
6055         xmlResetLastError();
6056         if (mem_base != xmlMemBlocks()) {
6057             printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6058                    xmlMemBlocks() - mem_base);
6059             test_ret++;
6060             printf(" %d", n_catal);
6061             printf("\n");
6062         }
6063     }
6064     function_tests++;
6065 #endif
6066
6067     return(test_ret);
6068 }
6069
6070
6071 static int
6072 test_xmlCatalogLocalResolve(void) {
6073     int test_ret = 0;
6074
6075 #if defined(LIBXML_CATALOG_ENABLED)
6076     int mem_base;
6077     xmlChar * ret_val;
6078     void * catalogs; /* a document's list of catalogs */
6079     int n_catalogs;
6080     xmlChar * pubID; /* the public ID string */
6081     int n_pubID;
6082     xmlChar * sysID; /* the system ID string */
6083     int n_sysID;
6084
6085     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6086     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6087     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6088         mem_base = xmlMemBlocks();
6089         catalogs = gen_void_ptr(n_catalogs, 0);
6090         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6091         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6092
6093         ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6094         desret_xmlChar_ptr(ret_val);
6095         call_tests++;
6096         des_void_ptr(n_catalogs, catalogs, 0);
6097         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6098         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6099         xmlResetLastError();
6100         if (mem_base != xmlMemBlocks()) {
6101             printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6102                    xmlMemBlocks() - mem_base);
6103             test_ret++;
6104             printf(" %d", n_catalogs);
6105             printf(" %d", n_pubID);
6106             printf(" %d", n_sysID);
6107             printf("\n");
6108         }
6109     }
6110     }
6111     }
6112     function_tests++;
6113 #endif
6114
6115     return(test_ret);
6116 }
6117
6118
6119 static int
6120 test_xmlCatalogLocalResolveURI(void) {
6121     int test_ret = 0;
6122
6123 #if defined(LIBXML_CATALOG_ENABLED)
6124     int mem_base;
6125     xmlChar * ret_val;
6126     void * catalogs; /* a document's list of catalogs */
6127     int n_catalogs;
6128     xmlChar * URI; /* the URI */
6129     int n_URI;
6130
6131     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6132     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6133         mem_base = xmlMemBlocks();
6134         catalogs = gen_void_ptr(n_catalogs, 0);
6135         URI = gen_const_xmlChar_ptr(n_URI, 1);
6136
6137         ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6138         desret_xmlChar_ptr(ret_val);
6139         call_tests++;
6140         des_void_ptr(n_catalogs, catalogs, 0);
6141         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6142         xmlResetLastError();
6143         if (mem_base != xmlMemBlocks()) {
6144             printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6145                    xmlMemBlocks() - mem_base);
6146             test_ret++;
6147             printf(" %d", n_catalogs);
6148             printf(" %d", n_URI);
6149             printf("\n");
6150         }
6151     }
6152     }
6153     function_tests++;
6154 #endif
6155
6156     return(test_ret);
6157 }
6158
6159
6160 static int
6161 test_xmlCatalogRemove(void) {
6162     int test_ret = 0;
6163
6164 #if defined(LIBXML_CATALOG_ENABLED)
6165     int ret_val;
6166     xmlChar * value; /* the value to remove */
6167     int n_value;
6168
6169     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6170         value = gen_const_xmlChar_ptr(n_value, 0);
6171
6172         ret_val = xmlCatalogRemove((const xmlChar *)value);
6173         desret_int(ret_val);
6174         call_tests++;
6175         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6176         xmlResetLastError();
6177     }
6178     function_tests++;
6179 #endif
6180
6181     return(test_ret);
6182 }
6183
6184
6185 static int
6186 test_xmlCatalogResolve(void) {
6187     int test_ret = 0;
6188
6189 #if defined(LIBXML_CATALOG_ENABLED)
6190     xmlChar * ret_val;
6191     xmlChar * pubID; /* the public ID string */
6192     int n_pubID;
6193     xmlChar * sysID; /* the system ID string */
6194     int n_sysID;
6195
6196     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6197     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6198         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6199         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6200
6201         ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6202         desret_xmlChar_ptr(ret_val);
6203         call_tests++;
6204         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6205         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6206         xmlResetLastError();
6207     }
6208     }
6209     function_tests++;
6210 #endif
6211
6212     return(test_ret);
6213 }
6214
6215
6216 static int
6217 test_xmlCatalogResolvePublic(void) {
6218     int test_ret = 0;
6219
6220 #if defined(LIBXML_CATALOG_ENABLED)
6221     int mem_base;
6222     xmlChar * ret_val;
6223     xmlChar * pubID; /* the public ID string */
6224     int n_pubID;
6225
6226     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6227         mem_base = xmlMemBlocks();
6228         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6229
6230         ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6231         desret_xmlChar_ptr(ret_val);
6232         call_tests++;
6233         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6234         xmlResetLastError();
6235         if (mem_base != xmlMemBlocks()) {
6236             printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6237                    xmlMemBlocks() - mem_base);
6238             test_ret++;
6239             printf(" %d", n_pubID);
6240             printf("\n");
6241         }
6242     }
6243     function_tests++;
6244 #endif
6245
6246     return(test_ret);
6247 }
6248
6249
6250 static int
6251 test_xmlCatalogResolveSystem(void) {
6252     int test_ret = 0;
6253
6254 #if defined(LIBXML_CATALOG_ENABLED)
6255     int mem_base;
6256     xmlChar * ret_val;
6257     xmlChar * sysID; /* the system ID string */
6258     int n_sysID;
6259
6260     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6261         mem_base = xmlMemBlocks();
6262         sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6263
6264         ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6265         desret_xmlChar_ptr(ret_val);
6266         call_tests++;
6267         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6268         xmlResetLastError();
6269         if (mem_base != xmlMemBlocks()) {
6270             printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6271                    xmlMemBlocks() - mem_base);
6272             test_ret++;
6273             printf(" %d", n_sysID);
6274             printf("\n");
6275         }
6276     }
6277     function_tests++;
6278 #endif
6279
6280     return(test_ret);
6281 }
6282
6283
6284 static int
6285 test_xmlCatalogResolveURI(void) {
6286     int test_ret = 0;
6287
6288 #if defined(LIBXML_CATALOG_ENABLED)
6289     int mem_base;
6290     xmlChar * ret_val;
6291     xmlChar * URI; /* the URI */
6292     int n_URI;
6293
6294     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6295         mem_base = xmlMemBlocks();
6296         URI = gen_const_xmlChar_ptr(n_URI, 0);
6297
6298         ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6299         desret_xmlChar_ptr(ret_val);
6300         call_tests++;
6301         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6302         xmlResetLastError();
6303         if (mem_base != xmlMemBlocks()) {
6304             printf("Leak of %d blocks found in xmlCatalogResolveURI",
6305                    xmlMemBlocks() - mem_base);
6306             test_ret++;
6307             printf(" %d", n_URI);
6308             printf("\n");
6309         }
6310     }
6311     function_tests++;
6312 #endif
6313
6314     return(test_ret);
6315 }
6316
6317
6318 static int
6319 test_xmlCatalogSetDefaultPrefer(void) {
6320     int test_ret = 0;
6321
6322 #if defined(LIBXML_CATALOG_ENABLED)
6323     int mem_base;
6324     xmlCatalogPrefer ret_val;
6325     xmlCatalogPrefer prefer; /* the default preference for delegation */
6326     int n_prefer;
6327
6328     for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6329         mem_base = xmlMemBlocks();
6330         prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6331
6332         ret_val = xmlCatalogSetDefaultPrefer(prefer);
6333         desret_xmlCatalogPrefer(ret_val);
6334         call_tests++;
6335         des_xmlCatalogPrefer(n_prefer, prefer, 0);
6336         xmlResetLastError();
6337         if (mem_base != xmlMemBlocks()) {
6338             printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6339                    xmlMemBlocks() - mem_base);
6340             test_ret++;
6341             printf(" %d", n_prefer);
6342             printf("\n");
6343         }
6344     }
6345     function_tests++;
6346 #endif
6347
6348     return(test_ret);
6349 }
6350
6351
6352 static int
6353 test_xmlCatalogSetDefaults(void) {
6354     int test_ret = 0;
6355
6356 #if defined(LIBXML_CATALOG_ENABLED)
6357     int mem_base;
6358     xmlCatalogAllow allow; /* what catalogs should be accepted */
6359     int n_allow;
6360
6361     for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6362         mem_base = xmlMemBlocks();
6363         allow = gen_xmlCatalogAllow(n_allow, 0);
6364
6365         xmlCatalogSetDefaults(allow);
6366         call_tests++;
6367         des_xmlCatalogAllow(n_allow, allow, 0);
6368         xmlResetLastError();
6369         if (mem_base != xmlMemBlocks()) {
6370             printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6371                    xmlMemBlocks() - mem_base);
6372             test_ret++;
6373             printf(" %d", n_allow);
6374             printf("\n");
6375         }
6376     }
6377     function_tests++;
6378 #endif
6379
6380     return(test_ret);
6381 }
6382
6383
6384 static int
6385 test_xmlConvertSGMLCatalog(void) {
6386     int test_ret = 0;
6387
6388 #if defined(LIBXML_CATALOG_ENABLED)
6389     int mem_base;
6390     int ret_val;
6391     xmlCatalogPtr catal; /* the catalog */
6392     int n_catal;
6393
6394     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6395         mem_base = xmlMemBlocks();
6396         catal = gen_xmlCatalogPtr(n_catal, 0);
6397
6398         ret_val = xmlConvertSGMLCatalog(catal);
6399         desret_int(ret_val);
6400         call_tests++;
6401         des_xmlCatalogPtr(n_catal, catal, 0);
6402         xmlResetLastError();
6403         if (mem_base != xmlMemBlocks()) {
6404             printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6405                    xmlMemBlocks() - mem_base);
6406             test_ret++;
6407             printf(" %d", n_catal);
6408             printf("\n");
6409         }
6410     }
6411     function_tests++;
6412 #endif
6413
6414     return(test_ret);
6415 }
6416
6417
6418 static int
6419 test_xmlInitializeCatalog(void) {
6420     int test_ret = 0;
6421
6422 #if defined(LIBXML_CATALOG_ENABLED)
6423     int mem_base;
6424
6425         mem_base = xmlMemBlocks();
6426
6427         xmlInitializeCatalog();
6428         call_tests++;
6429         xmlResetLastError();
6430         if (mem_base != xmlMemBlocks()) {
6431             printf("Leak of %d blocks found in xmlInitializeCatalog",
6432                    xmlMemBlocks() - mem_base);
6433             test_ret++;
6434             printf("\n");
6435         }
6436     function_tests++;
6437 #endif
6438
6439     return(test_ret);
6440 }
6441
6442
6443 static int
6444 test_xmlLoadACatalog(void) {
6445     int test_ret = 0;
6446
6447
6448     /* missing type support */
6449     return(test_ret);
6450 }
6451
6452
6453 static int
6454 test_xmlLoadCatalog(void) {
6455     int test_ret = 0;
6456
6457 #if defined(LIBXML_CATALOG_ENABLED)
6458     int ret_val;
6459     const char * filename; /* a file path */
6460     int n_filename;
6461
6462     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6463         filename = gen_filepath(n_filename, 0);
6464
6465         ret_val = xmlLoadCatalog(filename);
6466         desret_int(ret_val);
6467         call_tests++;
6468         des_filepath(n_filename, filename, 0);
6469         xmlResetLastError();
6470     }
6471     function_tests++;
6472 #endif
6473
6474     return(test_ret);
6475 }
6476
6477
6478 static int
6479 test_xmlLoadCatalogs(void) {
6480     int test_ret = 0;
6481
6482 #if defined(LIBXML_CATALOG_ENABLED)
6483     char * pathss; /* a list of directories separated by a colon or a space. */
6484     int n_pathss;
6485
6486     for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6487         pathss = gen_const_char_ptr(n_pathss, 0);
6488
6489         xmlLoadCatalogs((const char *)pathss);
6490         call_tests++;
6491         des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6492         xmlResetLastError();
6493     }
6494     function_tests++;
6495 #endif
6496
6497     return(test_ret);
6498 }
6499
6500
6501 static int
6502 test_xmlLoadSGMLSuperCatalog(void) {
6503     int test_ret = 0;
6504
6505
6506     /* missing type support */
6507     return(test_ret);
6508 }
6509
6510
6511 static int
6512 test_xmlNewCatalog(void) {
6513     int test_ret = 0;
6514
6515
6516     /* missing type support */
6517     return(test_ret);
6518 }
6519
6520
6521 static int
6522 test_xmlParseCatalogFile(void) {
6523     int test_ret = 0;
6524
6525 #if defined(LIBXML_CATALOG_ENABLED)
6526     int mem_base;
6527     xmlDocPtr ret_val;
6528     const char * filename; /* the filename */
6529     int n_filename;
6530
6531     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6532         mem_base = xmlMemBlocks();
6533         filename = gen_filepath(n_filename, 0);
6534
6535         ret_val = xmlParseCatalogFile(filename);
6536         desret_xmlDocPtr(ret_val);
6537         call_tests++;
6538         des_filepath(n_filename, filename, 0);
6539         xmlResetLastError();
6540         if (mem_base != xmlMemBlocks()) {
6541             printf("Leak of %d blocks found in xmlParseCatalogFile",
6542                    xmlMemBlocks() - mem_base);
6543             test_ret++;
6544             printf(" %d", n_filename);
6545             printf("\n");
6546         }
6547     }
6548     function_tests++;
6549 #endif
6550
6551     return(test_ret);
6552 }
6553
6554 static int
6555 test_catalog(void) {
6556     int test_ret = 0;
6557
6558     if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6559     test_ret += test_xmlACatalogAdd();
6560     test_ret += test_xmlACatalogDump();
6561     test_ret += test_xmlACatalogRemove();
6562     test_ret += test_xmlACatalogResolve();
6563     test_ret += test_xmlACatalogResolvePublic();
6564     test_ret += test_xmlACatalogResolveSystem();
6565     test_ret += test_xmlACatalogResolveURI();
6566     test_ret += test_xmlCatalogAdd();
6567     test_ret += test_xmlCatalogCleanup();
6568     test_ret += test_xmlCatalogConvert();
6569     test_ret += test_xmlCatalogDump();
6570     test_ret += test_xmlCatalogGetDefaults();
6571     test_ret += test_xmlCatalogIsEmpty();
6572     test_ret += test_xmlCatalogLocalResolve();
6573     test_ret += test_xmlCatalogLocalResolveURI();
6574     test_ret += test_xmlCatalogRemove();
6575     test_ret += test_xmlCatalogResolve();
6576     test_ret += test_xmlCatalogResolvePublic();
6577     test_ret += test_xmlCatalogResolveSystem();
6578     test_ret += test_xmlCatalogResolveURI();
6579     test_ret += test_xmlCatalogSetDefaultPrefer();
6580     test_ret += test_xmlCatalogSetDefaults();
6581     test_ret += test_xmlConvertSGMLCatalog();
6582     test_ret += test_xmlInitializeCatalog();
6583     test_ret += test_xmlLoadACatalog();
6584     test_ret += test_xmlLoadCatalog();
6585     test_ret += test_xmlLoadCatalogs();
6586     test_ret += test_xmlLoadSGMLSuperCatalog();
6587     test_ret += test_xmlNewCatalog();
6588     test_ret += test_xmlParseCatalogFile();
6589
6590     if (test_ret != 0)
6591         printf("Module catalog: %d errors\n", test_ret);
6592     return(test_ret);
6593 }
6594
6595 #define gen_nb_const_xmlChRangeGroup_ptr 1
6596 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6597     return(NULL);
6598 }
6599 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6600 }
6601
6602 static int
6603 test_xmlCharInRange(void) {
6604     int test_ret = 0;
6605
6606     int mem_base;
6607     int ret_val;
6608     unsigned int val; /* character to be validated */
6609     int n_val;
6610     xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6611     int n_rptr;
6612
6613     for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6614     for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6615         mem_base = xmlMemBlocks();
6616         val = gen_unsigned_int(n_val, 0);
6617         rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6618
6619         ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6620         desret_int(ret_val);
6621         call_tests++;
6622         des_unsigned_int(n_val, val, 0);
6623         des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6624         xmlResetLastError();
6625         if (mem_base != xmlMemBlocks()) {
6626             printf("Leak of %d blocks found in xmlCharInRange",
6627                    xmlMemBlocks() - mem_base);
6628             test_ret++;
6629             printf(" %d", n_val);
6630             printf(" %d", n_rptr);
6631             printf("\n");
6632         }
6633     }
6634     }
6635     function_tests++;
6636
6637     return(test_ret);
6638 }
6639
6640
6641 static int
6642 test_xmlIsBaseChar(void) {
6643     int test_ret = 0;
6644
6645     int mem_base;
6646     int ret_val;
6647     unsigned int ch; /* character to validate */
6648     int n_ch;
6649
6650     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6651         mem_base = xmlMemBlocks();
6652         ch = gen_unsigned_int(n_ch, 0);
6653
6654         ret_val = xmlIsBaseChar(ch);
6655         desret_int(ret_val);
6656         call_tests++;
6657         des_unsigned_int(n_ch, ch, 0);
6658         xmlResetLastError();
6659         if (mem_base != xmlMemBlocks()) {
6660             printf("Leak of %d blocks found in xmlIsBaseChar",
6661                    xmlMemBlocks() - mem_base);
6662             test_ret++;
6663             printf(" %d", n_ch);
6664             printf("\n");
6665         }
6666     }
6667     function_tests++;
6668
6669     return(test_ret);
6670 }
6671
6672
6673 static int
6674 test_xmlIsBlank(void) {
6675     int test_ret = 0;
6676
6677     int mem_base;
6678     int ret_val;
6679     unsigned int ch; /* character to validate */
6680     int n_ch;
6681
6682     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6683         mem_base = xmlMemBlocks();
6684         ch = gen_unsigned_int(n_ch, 0);
6685
6686         ret_val = xmlIsBlank(ch);
6687         desret_int(ret_val);
6688         call_tests++;
6689         des_unsigned_int(n_ch, ch, 0);
6690         xmlResetLastError();
6691         if (mem_base != xmlMemBlocks()) {
6692             printf("Leak of %d blocks found in xmlIsBlank",
6693                    xmlMemBlocks() - mem_base);
6694             test_ret++;
6695             printf(" %d", n_ch);
6696             printf("\n");
6697         }
6698     }
6699     function_tests++;
6700
6701     return(test_ret);
6702 }
6703
6704
6705 static int
6706 test_xmlIsChar(void) {
6707     int test_ret = 0;
6708
6709     int mem_base;
6710     int ret_val;
6711     unsigned int ch; /* character to validate */
6712     int n_ch;
6713
6714     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6715         mem_base = xmlMemBlocks();
6716         ch = gen_unsigned_int(n_ch, 0);
6717
6718         ret_val = xmlIsChar(ch);
6719         desret_int(ret_val);
6720         call_tests++;
6721         des_unsigned_int(n_ch, ch, 0);
6722         xmlResetLastError();
6723         if (mem_base != xmlMemBlocks()) {
6724             printf("Leak of %d blocks found in xmlIsChar",
6725                    xmlMemBlocks() - mem_base);
6726             test_ret++;
6727             printf(" %d", n_ch);
6728             printf("\n");
6729         }
6730     }
6731     function_tests++;
6732
6733     return(test_ret);
6734 }
6735
6736
6737 static int
6738 test_xmlIsCombining(void) {
6739     int test_ret = 0;
6740
6741     int mem_base;
6742     int ret_val;
6743     unsigned int ch; /* character to validate */
6744     int n_ch;
6745
6746     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6747         mem_base = xmlMemBlocks();
6748         ch = gen_unsigned_int(n_ch, 0);
6749
6750         ret_val = xmlIsCombining(ch);
6751         desret_int(ret_val);
6752         call_tests++;
6753         des_unsigned_int(n_ch, ch, 0);
6754         xmlResetLastError();
6755         if (mem_base != xmlMemBlocks()) {
6756             printf("Leak of %d blocks found in xmlIsCombining",
6757                    xmlMemBlocks() - mem_base);
6758             test_ret++;
6759             printf(" %d", n_ch);
6760             printf("\n");
6761         }
6762     }
6763     function_tests++;
6764
6765     return(test_ret);
6766 }
6767
6768
6769 static int
6770 test_xmlIsDigit(void) {
6771     int test_ret = 0;
6772
6773     int mem_base;
6774     int ret_val;
6775     unsigned int ch; /* character to validate */
6776     int n_ch;
6777
6778     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6779         mem_base = xmlMemBlocks();
6780         ch = gen_unsigned_int(n_ch, 0);
6781
6782         ret_val = xmlIsDigit(ch);
6783         desret_int(ret_val);
6784         call_tests++;
6785         des_unsigned_int(n_ch, ch, 0);
6786         xmlResetLastError();
6787         if (mem_base != xmlMemBlocks()) {
6788             printf("Leak of %d blocks found in xmlIsDigit",
6789                    xmlMemBlocks() - mem_base);
6790             test_ret++;
6791             printf(" %d", n_ch);
6792             printf("\n");
6793         }
6794     }
6795     function_tests++;
6796
6797     return(test_ret);
6798 }
6799
6800
6801 static int
6802 test_xmlIsExtender(void) {
6803     int test_ret = 0;
6804
6805     int mem_base;
6806     int ret_val;
6807     unsigned int ch; /* character to validate */
6808     int n_ch;
6809
6810     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6811         mem_base = xmlMemBlocks();
6812         ch = gen_unsigned_int(n_ch, 0);
6813
6814         ret_val = xmlIsExtender(ch);
6815         desret_int(ret_val);
6816         call_tests++;
6817         des_unsigned_int(n_ch, ch, 0);
6818         xmlResetLastError();
6819         if (mem_base != xmlMemBlocks()) {
6820             printf("Leak of %d blocks found in xmlIsExtender",
6821                    xmlMemBlocks() - mem_base);
6822             test_ret++;
6823             printf(" %d", n_ch);
6824             printf("\n");
6825         }
6826     }
6827     function_tests++;
6828
6829     return(test_ret);
6830 }
6831
6832
6833 static int
6834 test_xmlIsIdeographic(void) {
6835     int test_ret = 0;
6836
6837     int mem_base;
6838     int ret_val;
6839     unsigned int ch; /* character to validate */
6840     int n_ch;
6841
6842     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6843         mem_base = xmlMemBlocks();
6844         ch = gen_unsigned_int(n_ch, 0);
6845
6846         ret_val = xmlIsIdeographic(ch);
6847         desret_int(ret_val);
6848         call_tests++;
6849         des_unsigned_int(n_ch, ch, 0);
6850         xmlResetLastError();
6851         if (mem_base != xmlMemBlocks()) {
6852             printf("Leak of %d blocks found in xmlIsIdeographic",
6853                    xmlMemBlocks() - mem_base);
6854             test_ret++;
6855             printf(" %d", n_ch);
6856             printf("\n");
6857         }
6858     }
6859     function_tests++;
6860
6861     return(test_ret);
6862 }
6863
6864
6865 static int
6866 test_xmlIsPubidChar(void) {
6867     int test_ret = 0;
6868
6869     int mem_base;
6870     int ret_val;
6871     unsigned int ch; /* character to validate */
6872     int n_ch;
6873
6874     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6875         mem_base = xmlMemBlocks();
6876         ch = gen_unsigned_int(n_ch, 0);
6877
6878         ret_val = xmlIsPubidChar(ch);
6879         desret_int(ret_val);
6880         call_tests++;
6881         des_unsigned_int(n_ch, ch, 0);
6882         xmlResetLastError();
6883         if (mem_base != xmlMemBlocks()) {
6884             printf("Leak of %d blocks found in xmlIsPubidChar",
6885                    xmlMemBlocks() - mem_base);
6886             test_ret++;
6887             printf(" %d", n_ch);
6888             printf("\n");
6889         }
6890     }
6891     function_tests++;
6892
6893     return(test_ret);
6894 }
6895
6896 static int
6897 test_chvalid(void) {
6898     int test_ret = 0;
6899
6900     if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6901     test_ret += test_xmlCharInRange();
6902     test_ret += test_xmlIsBaseChar();
6903     test_ret += test_xmlIsBlank();
6904     test_ret += test_xmlIsChar();
6905     test_ret += test_xmlIsCombining();
6906     test_ret += test_xmlIsDigit();
6907     test_ret += test_xmlIsExtender();
6908     test_ret += test_xmlIsIdeographic();
6909     test_ret += test_xmlIsPubidChar();
6910
6911     if (test_ret != 0)
6912         printf("Module chvalid: %d errors\n", test_ret);
6913     return(test_ret);
6914 }
6915
6916 static int
6917 test_xmlBoolToText(void) {
6918     int test_ret = 0;
6919
6920 #if defined(LIBXML_DEBUG_ENABLED)
6921     int mem_base;
6922     const char * ret_val;
6923     int boolval; /* a bool to turn into text */
6924     int n_boolval;
6925
6926     for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6927         mem_base = xmlMemBlocks();
6928         boolval = gen_int(n_boolval, 0);
6929
6930         ret_val = xmlBoolToText(boolval);
6931         desret_const_char_ptr(ret_val);
6932         call_tests++;
6933         des_int(n_boolval, boolval, 0);
6934         xmlResetLastError();
6935         if (mem_base != xmlMemBlocks()) {
6936             printf("Leak of %d blocks found in xmlBoolToText",
6937                    xmlMemBlocks() - mem_base);
6938             test_ret++;
6939             printf(" %d", n_boolval);
6940             printf("\n");
6941         }
6942     }
6943     function_tests++;
6944 #endif
6945
6946     return(test_ret);
6947 }
6948
6949
6950 static int
6951 test_xmlDebugCheckDocument(void) {
6952     int test_ret = 0;
6953
6954 #if defined(LIBXML_DEBUG_ENABLED)
6955     int mem_base;
6956     int ret_val;
6957     FILE * output; /* the FILE * for the output */
6958     int n_output;
6959     xmlDocPtr doc; /* the document */
6960     int n_doc;
6961
6962     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6963     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6964         mem_base = xmlMemBlocks();
6965         output = gen_debug_FILE_ptr(n_output, 0);
6966         doc = gen_xmlDocPtr(n_doc, 1);
6967
6968         ret_val = xmlDebugCheckDocument(output, doc);
6969         desret_int(ret_val);
6970         call_tests++;
6971         des_debug_FILE_ptr(n_output, output, 0);
6972         des_xmlDocPtr(n_doc, doc, 1);
6973         xmlResetLastError();
6974         if (mem_base != xmlMemBlocks()) {
6975             printf("Leak of %d blocks found in xmlDebugCheckDocument",
6976                    xmlMemBlocks() - mem_base);
6977             test_ret++;
6978             printf(" %d", n_output);
6979             printf(" %d", n_doc);
6980             printf("\n");
6981         }
6982     }
6983     }
6984     function_tests++;
6985 #endif
6986
6987     return(test_ret);
6988 }
6989
6990
6991 static int
6992 test_xmlDebugDumpAttr(void) {
6993     int test_ret = 0;
6994
6995 #if defined(LIBXML_DEBUG_ENABLED)
6996     int mem_base;
6997     FILE * output; /* the FILE * for the output */
6998     int n_output;
6999     xmlAttrPtr attr; /* the attribute */
7000     int n_attr;
7001     int depth; /* the indentation level. */
7002     int n_depth;
7003
7004     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7005     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7006     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7007         mem_base = xmlMemBlocks();
7008         output = gen_debug_FILE_ptr(n_output, 0);
7009         attr = gen_xmlAttrPtr(n_attr, 1);
7010         depth = gen_int(n_depth, 2);
7011
7012         xmlDebugDumpAttr(output, attr, depth);
7013         call_tests++;
7014         des_debug_FILE_ptr(n_output, output, 0);
7015         des_xmlAttrPtr(n_attr, attr, 1);
7016         des_int(n_depth, depth, 2);
7017         xmlResetLastError();
7018         if (mem_base != xmlMemBlocks()) {
7019             printf("Leak of %d blocks found in xmlDebugDumpAttr",
7020                    xmlMemBlocks() - mem_base);
7021             test_ret++;
7022             printf(" %d", n_output);
7023             printf(" %d", n_attr);
7024             printf(" %d", n_depth);
7025             printf("\n");
7026         }
7027     }
7028     }
7029     }
7030     function_tests++;
7031 #endif
7032
7033     return(test_ret);
7034 }
7035
7036
7037 static int
7038 test_xmlDebugDumpAttrList(void) {
7039     int test_ret = 0;
7040
7041 #if defined(LIBXML_DEBUG_ENABLED)
7042     int mem_base;
7043     FILE * output; /* the FILE * for the output */
7044     int n_output;
7045     xmlAttrPtr attr; /* the attribute list */
7046     int n_attr;
7047     int depth; /* the indentation level. */
7048     int n_depth;
7049
7050     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7051     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7052     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7053         mem_base = xmlMemBlocks();
7054         output = gen_debug_FILE_ptr(n_output, 0);
7055         attr = gen_xmlAttrPtr(n_attr, 1);
7056         depth = gen_int(n_depth, 2);
7057
7058         xmlDebugDumpAttrList(output, attr, depth);
7059         call_tests++;
7060         des_debug_FILE_ptr(n_output, output, 0);
7061         des_xmlAttrPtr(n_attr, attr, 1);
7062         des_int(n_depth, depth, 2);
7063         xmlResetLastError();
7064         if (mem_base != xmlMemBlocks()) {
7065             printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7066                    xmlMemBlocks() - mem_base);
7067             test_ret++;
7068             printf(" %d", n_output);
7069             printf(" %d", n_attr);
7070             printf(" %d", n_depth);
7071             printf("\n");
7072         }
7073     }
7074     }
7075     }
7076     function_tests++;
7077 #endif
7078
7079     return(test_ret);
7080 }
7081
7082
7083 static int
7084 test_xmlDebugDumpDTD(void) {
7085     int test_ret = 0;
7086
7087 #if defined(LIBXML_DEBUG_ENABLED)
7088     int mem_base;
7089     FILE * output; /* the FILE * for the output */
7090     int n_output;
7091     xmlDtdPtr dtd; /* the DTD */
7092     int n_dtd;
7093
7094     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7095     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7096         mem_base = xmlMemBlocks();
7097         output = gen_debug_FILE_ptr(n_output, 0);
7098         dtd = gen_xmlDtdPtr(n_dtd, 1);
7099
7100         xmlDebugDumpDTD(output, dtd);
7101         call_tests++;
7102         des_debug_FILE_ptr(n_output, output, 0);
7103         des_xmlDtdPtr(n_dtd, dtd, 1);
7104         xmlResetLastError();
7105         if (mem_base != xmlMemBlocks()) {
7106             printf("Leak of %d blocks found in xmlDebugDumpDTD",
7107                    xmlMemBlocks() - mem_base);
7108             test_ret++;
7109             printf(" %d", n_output);
7110             printf(" %d", n_dtd);
7111             printf("\n");
7112         }
7113     }
7114     }
7115     function_tests++;
7116 #endif
7117
7118     return(test_ret);
7119 }
7120
7121
7122 static int
7123 test_xmlDebugDumpDocument(void) {
7124     int test_ret = 0;
7125
7126 #if defined(LIBXML_DEBUG_ENABLED)
7127     int mem_base;
7128     FILE * output; /* the FILE * for the output */
7129     int n_output;
7130     xmlDocPtr doc; /* the document */
7131     int n_doc;
7132
7133     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7134     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7135         mem_base = xmlMemBlocks();
7136         output = gen_debug_FILE_ptr(n_output, 0);
7137         doc = gen_xmlDocPtr(n_doc, 1);
7138
7139         xmlDebugDumpDocument(output, doc);
7140         call_tests++;
7141         des_debug_FILE_ptr(n_output, output, 0);
7142         des_xmlDocPtr(n_doc, doc, 1);
7143         xmlResetLastError();
7144         if (mem_base != xmlMemBlocks()) {
7145             printf("Leak of %d blocks found in xmlDebugDumpDocument",
7146                    xmlMemBlocks() - mem_base);
7147             test_ret++;
7148             printf(" %d", n_output);
7149             printf(" %d", n_doc);
7150             printf("\n");
7151         }
7152     }
7153     }
7154     function_tests++;
7155 #endif
7156
7157     return(test_ret);
7158 }
7159
7160
7161 static int
7162 test_xmlDebugDumpDocumentHead(void) {
7163     int test_ret = 0;
7164
7165 #if defined(LIBXML_DEBUG_ENABLED)
7166     int mem_base;
7167     FILE * output; /* the FILE * for the output */
7168     int n_output;
7169     xmlDocPtr doc; /* the document */
7170     int n_doc;
7171
7172     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7173     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7174         mem_base = xmlMemBlocks();
7175         output = gen_debug_FILE_ptr(n_output, 0);
7176         doc = gen_xmlDocPtr(n_doc, 1);
7177
7178         xmlDebugDumpDocumentHead(output, doc);
7179         call_tests++;
7180         des_debug_FILE_ptr(n_output, output, 0);
7181         des_xmlDocPtr(n_doc, doc, 1);
7182         xmlResetLastError();
7183         if (mem_base != xmlMemBlocks()) {
7184             printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7185                    xmlMemBlocks() - mem_base);
7186             test_ret++;
7187             printf(" %d", n_output);
7188             printf(" %d", n_doc);
7189             printf("\n");
7190         }
7191     }
7192     }
7193     function_tests++;
7194 #endif
7195
7196     return(test_ret);
7197 }
7198
7199
7200 static int
7201 test_xmlDebugDumpEntities(void) {
7202     int test_ret = 0;
7203
7204 #if defined(LIBXML_DEBUG_ENABLED)
7205     int mem_base;
7206     FILE * output; /* the FILE * for the output */
7207     int n_output;
7208     xmlDocPtr doc; /* the document */
7209     int n_doc;
7210
7211     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7212     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7213         mem_base = xmlMemBlocks();
7214         output = gen_debug_FILE_ptr(n_output, 0);
7215         doc = gen_xmlDocPtr(n_doc, 1);
7216
7217         xmlDebugDumpEntities(output, doc);
7218         call_tests++;
7219         des_debug_FILE_ptr(n_output, output, 0);
7220         des_xmlDocPtr(n_doc, doc, 1);
7221         xmlResetLastError();
7222         if (mem_base != xmlMemBlocks()) {
7223             printf("Leak of %d blocks found in xmlDebugDumpEntities",
7224                    xmlMemBlocks() - mem_base);
7225             test_ret++;
7226             printf(" %d", n_output);
7227             printf(" %d", n_doc);
7228             printf("\n");
7229         }
7230     }
7231     }
7232     function_tests++;
7233 #endif
7234
7235     return(test_ret);
7236 }
7237
7238
7239 static int
7240 test_xmlDebugDumpNode(void) {
7241     int test_ret = 0;
7242
7243 #if defined(LIBXML_DEBUG_ENABLED)
7244     int mem_base;
7245     FILE * output; /* the FILE * for the output */
7246     int n_output;
7247     xmlNodePtr node; /* the node */
7248     int n_node;
7249     int depth; /* the indentation level. */
7250     int n_depth;
7251
7252     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7253     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7254     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7255         mem_base = xmlMemBlocks();
7256         output = gen_debug_FILE_ptr(n_output, 0);
7257         node = gen_xmlNodePtr(n_node, 1);
7258         depth = gen_int(n_depth, 2);
7259
7260         xmlDebugDumpNode(output, node, depth);
7261         call_tests++;
7262         des_debug_FILE_ptr(n_output, output, 0);
7263         des_xmlNodePtr(n_node, node, 1);
7264         des_int(n_depth, depth, 2);
7265         xmlResetLastError();
7266         if (mem_base != xmlMemBlocks()) {
7267             printf("Leak of %d blocks found in xmlDebugDumpNode",
7268                    xmlMemBlocks() - mem_base);
7269             test_ret++;
7270             printf(" %d", n_output);
7271             printf(" %d", n_node);
7272             printf(" %d", n_depth);
7273             printf("\n");
7274         }
7275     }
7276     }
7277     }
7278     function_tests++;
7279 #endif
7280
7281     return(test_ret);
7282 }
7283
7284
7285 static int
7286 test_xmlDebugDumpNodeList(void) {
7287     int test_ret = 0;
7288
7289 #if defined(LIBXML_DEBUG_ENABLED)
7290     int mem_base;
7291     FILE * output; /* the FILE * for the output */
7292     int n_output;
7293     xmlNodePtr node; /* the node list */
7294     int n_node;
7295     int depth; /* the indentation level. */
7296     int n_depth;
7297
7298     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7299     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7300     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7301         mem_base = xmlMemBlocks();
7302         output = gen_debug_FILE_ptr(n_output, 0);
7303         node = gen_xmlNodePtr(n_node, 1);
7304         depth = gen_int(n_depth, 2);
7305
7306         xmlDebugDumpNodeList(output, node, depth);
7307         call_tests++;
7308         des_debug_FILE_ptr(n_output, output, 0);
7309         des_xmlNodePtr(n_node, node, 1);
7310         des_int(n_depth, depth, 2);
7311         xmlResetLastError();
7312         if (mem_base != xmlMemBlocks()) {
7313             printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7314                    xmlMemBlocks() - mem_base);
7315             test_ret++;
7316             printf(" %d", n_output);
7317             printf(" %d", n_node);
7318             printf(" %d", n_depth);
7319             printf("\n");
7320         }
7321     }
7322     }
7323     }
7324     function_tests++;
7325 #endif
7326
7327     return(test_ret);
7328 }
7329
7330
7331 static int
7332 test_xmlDebugDumpOneNode(void) {
7333     int test_ret = 0;
7334
7335 #if defined(LIBXML_DEBUG_ENABLED)
7336     int mem_base;
7337     FILE * output; /* the FILE * for the output */
7338     int n_output;
7339     xmlNodePtr node; /* the node */
7340     int n_node;
7341     int depth; /* the indentation level. */
7342     int n_depth;
7343
7344     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7345     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7346     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7347         mem_base = xmlMemBlocks();
7348         output = gen_debug_FILE_ptr(n_output, 0);
7349         node = gen_xmlNodePtr(n_node, 1);
7350         depth = gen_int(n_depth, 2);
7351
7352         xmlDebugDumpOneNode(output, node, depth);
7353         call_tests++;
7354         des_debug_FILE_ptr(n_output, output, 0);
7355         des_xmlNodePtr(n_node, node, 1);
7356         des_int(n_depth, depth, 2);
7357         xmlResetLastError();
7358         if (mem_base != xmlMemBlocks()) {
7359             printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7360                    xmlMemBlocks() - mem_base);
7361             test_ret++;
7362             printf(" %d", n_output);
7363             printf(" %d", n_node);
7364             printf(" %d", n_depth);
7365             printf("\n");
7366         }
7367     }
7368     }
7369     }
7370     function_tests++;
7371 #endif
7372
7373     return(test_ret);
7374 }
7375
7376
7377 static int
7378 test_xmlDebugDumpString(void) {
7379     int test_ret = 0;
7380
7381 #if defined(LIBXML_DEBUG_ENABLED)
7382     int mem_base;
7383     FILE * output; /* the FILE * for the output */
7384     int n_output;
7385     xmlChar * str; /* the string */
7386     int n_str;
7387
7388     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7389     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7390         mem_base = xmlMemBlocks();
7391         output = gen_debug_FILE_ptr(n_output, 0);
7392         str = gen_const_xmlChar_ptr(n_str, 1);
7393
7394         xmlDebugDumpString(output, (const xmlChar *)str);
7395         call_tests++;
7396         des_debug_FILE_ptr(n_output, output, 0);
7397         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7398         xmlResetLastError();
7399         if (mem_base != xmlMemBlocks()) {
7400             printf("Leak of %d blocks found in xmlDebugDumpString",
7401                    xmlMemBlocks() - mem_base);
7402             test_ret++;
7403             printf(" %d", n_output);
7404             printf(" %d", n_str);
7405             printf("\n");
7406         }
7407     }
7408     }
7409     function_tests++;
7410 #endif
7411
7412     return(test_ret);
7413 }
7414
7415
7416 static int
7417 test_xmlLsCountNode(void) {
7418     int test_ret = 0;
7419
7420 #if defined(LIBXML_DEBUG_ENABLED)
7421     int mem_base;
7422     int ret_val;
7423     xmlNodePtr node; /* the node to count */
7424     int n_node;
7425
7426     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7427         mem_base = xmlMemBlocks();
7428         node = gen_xmlNodePtr(n_node, 0);
7429
7430         ret_val = xmlLsCountNode(node);
7431         desret_int(ret_val);
7432         call_tests++;
7433         des_xmlNodePtr(n_node, node, 0);
7434         xmlResetLastError();
7435         if (mem_base != xmlMemBlocks()) {
7436             printf("Leak of %d blocks found in xmlLsCountNode",
7437                    xmlMemBlocks() - mem_base);
7438             test_ret++;
7439             printf(" %d", n_node);
7440             printf("\n");
7441         }
7442     }
7443     function_tests++;
7444 #endif
7445
7446     return(test_ret);
7447 }
7448
7449
7450 static int
7451 test_xmlLsOneNode(void) {
7452     int test_ret = 0;
7453
7454 #if defined(LIBXML_DEBUG_ENABLED)
7455     int mem_base;
7456     FILE * output; /* the FILE * for the output */
7457     int n_output;
7458     xmlNodePtr node; /* the node to dump */
7459     int n_node;
7460
7461     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7462     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7463         mem_base = xmlMemBlocks();
7464         output = gen_debug_FILE_ptr(n_output, 0);
7465         node = gen_xmlNodePtr(n_node, 1);
7466
7467         xmlLsOneNode(output, node);
7468         call_tests++;
7469         des_debug_FILE_ptr(n_output, output, 0);
7470         des_xmlNodePtr(n_node, node, 1);
7471         xmlResetLastError();
7472         if (mem_base != xmlMemBlocks()) {
7473             printf("Leak of %d blocks found in xmlLsOneNode",
7474                    xmlMemBlocks() - mem_base);
7475             test_ret++;
7476             printf(" %d", n_output);
7477             printf(" %d", n_node);
7478             printf("\n");
7479         }
7480     }
7481     }
7482     function_tests++;
7483 #endif
7484
7485     return(test_ret);
7486 }
7487
7488
7489 #define gen_nb_char_ptr 1
7490 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7491     return(NULL);
7492 }
7493 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7494 }
7495
7496 static int
7497 test_xmlShell(void) {
7498     int test_ret = 0;
7499
7500
7501     /* missing type support */
7502     return(test_ret);
7503 }
7504
7505
7506 static int
7507 test_xmlShellBase(void) {
7508     int test_ret = 0;
7509
7510 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7511     int mem_base;
7512     int ret_val;
7513     xmlShellCtxtPtr ctxt; /* the shell context */
7514     int n_ctxt;
7515     char * arg; /* unused */
7516     int n_arg;
7517     xmlNodePtr node; /* a node */
7518     int n_node;
7519     xmlNodePtr node2; /* unused */
7520     int n_node2;
7521
7522     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7523     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7524     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7525     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7526         mem_base = xmlMemBlocks();
7527         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7528         arg = gen_char_ptr(n_arg, 1);
7529         node = gen_xmlNodePtr(n_node, 2);
7530         node2 = gen_xmlNodePtr(n_node2, 3);
7531
7532         ret_val = xmlShellBase(ctxt, arg, node, node2);
7533         desret_int(ret_val);
7534         call_tests++;
7535         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7536         des_char_ptr(n_arg, arg, 1);
7537         des_xmlNodePtr(n_node, node, 2);
7538         des_xmlNodePtr(n_node2, node2, 3);
7539         xmlResetLastError();
7540         if (mem_base != xmlMemBlocks()) {
7541             printf("Leak of %d blocks found in xmlShellBase",
7542                    xmlMemBlocks() - mem_base);
7543             test_ret++;
7544             printf(" %d", n_ctxt);
7545             printf(" %d", n_arg);
7546             printf(" %d", n_node);
7547             printf(" %d", n_node2);
7548             printf("\n");
7549         }
7550     }
7551     }
7552     }
7553     }
7554     function_tests++;
7555 #endif
7556
7557     return(test_ret);
7558 }
7559
7560
7561 static int
7562 test_xmlShellCat(void) {
7563     int test_ret = 0;
7564
7565 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7566     int mem_base;
7567     int ret_val;
7568     xmlShellCtxtPtr ctxt; /* the shell context */
7569     int n_ctxt;
7570     char * arg; /* unused */
7571     int n_arg;
7572     xmlNodePtr node; /* a node */
7573     int n_node;
7574     xmlNodePtr node2; /* unused */
7575     int n_node2;
7576
7577     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7578     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7579     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7580     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7581         mem_base = xmlMemBlocks();
7582         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7583         arg = gen_char_ptr(n_arg, 1);
7584         node = gen_xmlNodePtr(n_node, 2);
7585         node2 = gen_xmlNodePtr(n_node2, 3);
7586
7587         ret_val = xmlShellCat(ctxt, arg, node, node2);
7588         desret_int(ret_val);
7589         call_tests++;
7590         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7591         des_char_ptr(n_arg, arg, 1);
7592         des_xmlNodePtr(n_node, node, 2);
7593         des_xmlNodePtr(n_node2, node2, 3);
7594         xmlResetLastError();
7595         if (mem_base != xmlMemBlocks()) {
7596             printf("Leak of %d blocks found in xmlShellCat",
7597                    xmlMemBlocks() - mem_base);
7598             test_ret++;
7599             printf(" %d", n_ctxt);
7600             printf(" %d", n_arg);
7601             printf(" %d", n_node);
7602             printf(" %d", n_node2);
7603             printf("\n");
7604         }
7605     }
7606     }
7607     }
7608     }
7609     function_tests++;
7610 #endif
7611
7612     return(test_ret);
7613 }
7614
7615
7616 static int
7617 test_xmlShellDir(void) {
7618     int test_ret = 0;
7619
7620 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7621     int mem_base;
7622     int ret_val;
7623     xmlShellCtxtPtr ctxt; /* the shell context */
7624     int n_ctxt;
7625     char * arg; /* unused */
7626     int n_arg;
7627     xmlNodePtr node; /* a node */
7628     int n_node;
7629     xmlNodePtr node2; /* unused */
7630     int n_node2;
7631
7632     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7633     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7634     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7635     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7636         mem_base = xmlMemBlocks();
7637         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7638         arg = gen_char_ptr(n_arg, 1);
7639         node = gen_xmlNodePtr(n_node, 2);
7640         node2 = gen_xmlNodePtr(n_node2, 3);
7641
7642         ret_val = xmlShellDir(ctxt, arg, node, node2);
7643         desret_int(ret_val);
7644         call_tests++;
7645         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7646         des_char_ptr(n_arg, arg, 1);
7647         des_xmlNodePtr(n_node, node, 2);
7648         des_xmlNodePtr(n_node2, node2, 3);
7649         xmlResetLastError();
7650         if (mem_base != xmlMemBlocks()) {
7651             printf("Leak of %d blocks found in xmlShellDir",
7652                    xmlMemBlocks() - mem_base);
7653             test_ret++;
7654             printf(" %d", n_ctxt);
7655             printf(" %d", n_arg);
7656             printf(" %d", n_node);
7657             printf(" %d", n_node2);
7658             printf("\n");
7659         }
7660     }
7661     }
7662     }
7663     }
7664     function_tests++;
7665 #endif
7666
7667     return(test_ret);
7668 }
7669
7670
7671 static int
7672 test_xmlShellDu(void) {
7673     int test_ret = 0;
7674
7675 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7676     int mem_base;
7677     int ret_val;
7678     xmlShellCtxtPtr ctxt; /* the shell context */
7679     int n_ctxt;
7680     char * arg; /* unused */
7681     int n_arg;
7682     xmlNodePtr tree; /* a node defining a subtree */
7683     int n_tree;
7684     xmlNodePtr node2; /* unused */
7685     int n_node2;
7686
7687     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7688     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7689     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7690     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7691         mem_base = xmlMemBlocks();
7692         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7693         arg = gen_char_ptr(n_arg, 1);
7694         tree = gen_xmlNodePtr(n_tree, 2);
7695         node2 = gen_xmlNodePtr(n_node2, 3);
7696
7697         ret_val = xmlShellDu(ctxt, arg, tree, node2);
7698         desret_int(ret_val);
7699         call_tests++;
7700         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7701         des_char_ptr(n_arg, arg, 1);
7702         des_xmlNodePtr(n_tree, tree, 2);
7703         des_xmlNodePtr(n_node2, node2, 3);
7704         xmlResetLastError();
7705         if (mem_base != xmlMemBlocks()) {
7706             printf("Leak of %d blocks found in xmlShellDu",
7707                    xmlMemBlocks() - mem_base);
7708             test_ret++;
7709             printf(" %d", n_ctxt);
7710             printf(" %d", n_arg);
7711             printf(" %d", n_tree);
7712             printf(" %d", n_node2);
7713             printf("\n");
7714         }
7715     }
7716     }
7717     }
7718     }
7719     function_tests++;
7720 #endif
7721
7722     return(test_ret);
7723 }
7724
7725
7726 static int
7727 test_xmlShellList(void) {
7728     int test_ret = 0;
7729
7730 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7731     int mem_base;
7732     int ret_val;
7733     xmlShellCtxtPtr ctxt; /* the shell context */
7734     int n_ctxt;
7735     char * arg; /* unused */
7736     int n_arg;
7737     xmlNodePtr node; /* a node */
7738     int n_node;
7739     xmlNodePtr node2; /* unused */
7740     int n_node2;
7741
7742     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7743     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7744     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7745     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7746         mem_base = xmlMemBlocks();
7747         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7748         arg = gen_char_ptr(n_arg, 1);
7749         node = gen_xmlNodePtr(n_node, 2);
7750         node2 = gen_xmlNodePtr(n_node2, 3);
7751
7752         ret_val = xmlShellList(ctxt, arg, node, node2);
7753         desret_int(ret_val);
7754         call_tests++;
7755         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7756         des_char_ptr(n_arg, arg, 1);
7757         des_xmlNodePtr(n_node, node, 2);
7758         des_xmlNodePtr(n_node2, node2, 3);
7759         xmlResetLastError();
7760         if (mem_base != xmlMemBlocks()) {
7761             printf("Leak of %d blocks found in xmlShellList",
7762                    xmlMemBlocks() - mem_base);
7763             test_ret++;
7764             printf(" %d", n_ctxt);
7765             printf(" %d", n_arg);
7766             printf(" %d", n_node);
7767             printf(" %d", n_node2);
7768             printf("\n");
7769         }
7770     }
7771     }
7772     }
7773     }
7774     function_tests++;
7775 #endif
7776
7777     return(test_ret);
7778 }
7779
7780
7781 static int
7782 test_xmlShellLoad(void) {
7783     int test_ret = 0;
7784
7785 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7786     int mem_base;
7787     int ret_val;
7788     xmlShellCtxtPtr ctxt; /* the shell context */
7789     int n_ctxt;
7790     char * filename; /* the file name */
7791     int n_filename;
7792     xmlNodePtr node; /* unused */
7793     int n_node;
7794     xmlNodePtr node2; /* unused */
7795     int n_node2;
7796
7797     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7798     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7799     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7800     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7801         mem_base = xmlMemBlocks();
7802         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7803         filename = gen_char_ptr(n_filename, 1);
7804         node = gen_xmlNodePtr(n_node, 2);
7805         node2 = gen_xmlNodePtr(n_node2, 3);
7806
7807         ret_val = xmlShellLoad(ctxt, filename, node, node2);
7808         desret_int(ret_val);
7809         call_tests++;
7810         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7811         des_char_ptr(n_filename, filename, 1);
7812         des_xmlNodePtr(n_node, node, 2);
7813         des_xmlNodePtr(n_node2, node2, 3);
7814         xmlResetLastError();
7815         if (mem_base != xmlMemBlocks()) {
7816             printf("Leak of %d blocks found in xmlShellLoad",
7817                    xmlMemBlocks() - mem_base);
7818             test_ret++;
7819             printf(" %d", n_ctxt);
7820             printf(" %d", n_filename);
7821             printf(" %d", n_node);
7822             printf(" %d", n_node2);
7823             printf("\n");
7824         }
7825     }
7826     }
7827     }
7828     }
7829     function_tests++;
7830 #endif
7831
7832     return(test_ret);
7833 }
7834
7835
7836 static int
7837 test_xmlShellPrintXPathResult(void) {
7838     int test_ret = 0;
7839
7840 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7841     int mem_base;
7842     xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7843     int n_list;
7844
7845     for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7846         mem_base = xmlMemBlocks();
7847         list = gen_xmlXPathObjectPtr(n_list, 0);
7848
7849         xmlShellPrintXPathResult(list);
7850         call_tests++;
7851         des_xmlXPathObjectPtr(n_list, list, 0);
7852         xmlResetLastError();
7853         if (mem_base != xmlMemBlocks()) {
7854             printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7855                    xmlMemBlocks() - mem_base);
7856             test_ret++;
7857             printf(" %d", n_list);
7858             printf("\n");
7859         }
7860     }
7861     function_tests++;
7862 #endif
7863
7864     return(test_ret);
7865 }
7866
7867
7868 static int
7869 test_xmlShellPwd(void) {
7870     int test_ret = 0;
7871
7872 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7873     int mem_base;
7874     int ret_val;
7875     xmlShellCtxtPtr ctxt; /* the shell context */
7876     int n_ctxt;
7877     char * buffer; /* the output buffer */
7878     int n_buffer;
7879     xmlNodePtr node; /* a node */
7880     int n_node;
7881     xmlNodePtr node2; /* unused */
7882     int n_node2;
7883
7884     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7885     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7886     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7887     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7888         mem_base = xmlMemBlocks();
7889         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7890         buffer = gen_char_ptr(n_buffer, 1);
7891         node = gen_xmlNodePtr(n_node, 2);
7892         node2 = gen_xmlNodePtr(n_node2, 3);
7893
7894         ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7895         desret_int(ret_val);
7896         call_tests++;
7897         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7898         des_char_ptr(n_buffer, buffer, 1);
7899         des_xmlNodePtr(n_node, node, 2);
7900         des_xmlNodePtr(n_node2, node2, 3);
7901         xmlResetLastError();
7902         if (mem_base != xmlMemBlocks()) {
7903             printf("Leak of %d blocks found in xmlShellPwd",
7904                    xmlMemBlocks() - mem_base);
7905             test_ret++;
7906             printf(" %d", n_ctxt);
7907             printf(" %d", n_buffer);
7908             printf(" %d", n_node);
7909             printf(" %d", n_node2);
7910             printf("\n");
7911         }
7912     }
7913     }
7914     }
7915     }
7916     function_tests++;
7917 #endif
7918
7919     return(test_ret);
7920 }
7921
7922
7923 static int
7924 test_xmlShellSave(void) {
7925     int test_ret = 0;
7926
7927 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7928     int mem_base;
7929     int ret_val;
7930     xmlShellCtxtPtr ctxt; /* the shell context */
7931     int n_ctxt;
7932     char * filename; /* the file name (optional) */
7933     int n_filename;
7934     xmlNodePtr node; /* unused */
7935     int n_node;
7936     xmlNodePtr node2; /* unused */
7937     int n_node2;
7938
7939     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7940     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7941     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7942     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7943         mem_base = xmlMemBlocks();
7944         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7945         filename = gen_char_ptr(n_filename, 1);
7946         node = gen_xmlNodePtr(n_node, 2);
7947         node2 = gen_xmlNodePtr(n_node2, 3);
7948
7949         ret_val = xmlShellSave(ctxt, filename, node, node2);
7950         desret_int(ret_val);
7951         call_tests++;
7952         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7953         des_char_ptr(n_filename, filename, 1);
7954         des_xmlNodePtr(n_node, node, 2);
7955         des_xmlNodePtr(n_node2, node2, 3);
7956         xmlResetLastError();
7957         if (mem_base != xmlMemBlocks()) {
7958             printf("Leak of %d blocks found in xmlShellSave",
7959                    xmlMemBlocks() - mem_base);
7960             test_ret++;
7961             printf(" %d", n_ctxt);
7962             printf(" %d", n_filename);
7963             printf(" %d", n_node);
7964             printf(" %d", n_node2);
7965             printf("\n");
7966         }
7967     }
7968     }
7969     }
7970     }
7971     function_tests++;
7972 #endif
7973
7974     return(test_ret);
7975 }
7976
7977
7978 static int
7979 test_xmlShellValidate(void) {
7980     int test_ret = 0;
7981
7982 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7983     int mem_base;
7984     int ret_val;
7985     xmlShellCtxtPtr ctxt; /* the shell context */
7986     int n_ctxt;
7987     char * dtd; /* the DTD URI (optional) */
7988     int n_dtd;
7989     xmlNodePtr node; /* unused */
7990     int n_node;
7991     xmlNodePtr node2; /* unused */
7992     int n_node2;
7993
7994     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7995     for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7996     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7997     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7998         mem_base = xmlMemBlocks();
7999         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8000         dtd = gen_char_ptr(n_dtd, 1);
8001         node = gen_xmlNodePtr(n_node, 2);
8002         node2 = gen_xmlNodePtr(n_node2, 3);
8003
8004         ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8005         desret_int(ret_val);
8006         call_tests++;
8007         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8008         des_char_ptr(n_dtd, dtd, 1);
8009         des_xmlNodePtr(n_node, node, 2);
8010         des_xmlNodePtr(n_node2, node2, 3);
8011         xmlResetLastError();
8012         if (mem_base != xmlMemBlocks()) {
8013             printf("Leak of %d blocks found in xmlShellValidate",
8014                    xmlMemBlocks() - mem_base);
8015             test_ret++;
8016             printf(" %d", n_ctxt);
8017             printf(" %d", n_dtd);
8018             printf(" %d", n_node);
8019             printf(" %d", n_node2);
8020             printf("\n");
8021         }
8022     }
8023     }
8024     }
8025     }
8026     function_tests++;
8027 #endif
8028
8029     return(test_ret);
8030 }
8031
8032
8033 static int
8034 test_xmlShellWrite(void) {
8035     int test_ret = 0;
8036
8037 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8038     int mem_base;
8039     int ret_val;
8040     xmlShellCtxtPtr ctxt; /* the shell context */
8041     int n_ctxt;
8042     char * filename; /* the file name */
8043     int n_filename;
8044     xmlNodePtr node; /* a node in the tree */
8045     int n_node;
8046     xmlNodePtr node2; /* unused */
8047     int n_node2;
8048
8049     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8050     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8051     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8052     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8053         mem_base = xmlMemBlocks();
8054         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8055         filename = gen_char_ptr(n_filename, 1);
8056         node = gen_xmlNodePtr(n_node, 2);
8057         node2 = gen_xmlNodePtr(n_node2, 3);
8058
8059         ret_val = xmlShellWrite(ctxt, filename, node, node2);
8060         desret_int(ret_val);
8061         call_tests++;
8062         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8063         des_char_ptr(n_filename, filename, 1);
8064         des_xmlNodePtr(n_node, node, 2);
8065         des_xmlNodePtr(n_node2, node2, 3);
8066         xmlResetLastError();
8067         if (mem_base != xmlMemBlocks()) {
8068             printf("Leak of %d blocks found in xmlShellWrite",
8069                    xmlMemBlocks() - mem_base);
8070             test_ret++;
8071             printf(" %d", n_ctxt);
8072             printf(" %d", n_filename);
8073             printf(" %d", n_node);
8074             printf(" %d", n_node2);
8075             printf("\n");
8076         }
8077     }
8078     }
8079     }
8080     }
8081     function_tests++;
8082 #endif
8083
8084     return(test_ret);
8085 }
8086
8087 static int
8088 test_debugXML(void) {
8089     int test_ret = 0;
8090
8091     if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8092     test_ret += test_xmlBoolToText();
8093     test_ret += test_xmlDebugCheckDocument();
8094     test_ret += test_xmlDebugDumpAttr();
8095     test_ret += test_xmlDebugDumpAttrList();
8096     test_ret += test_xmlDebugDumpDTD();
8097     test_ret += test_xmlDebugDumpDocument();
8098     test_ret += test_xmlDebugDumpDocumentHead();
8099     test_ret += test_xmlDebugDumpEntities();
8100     test_ret += test_xmlDebugDumpNode();
8101     test_ret += test_xmlDebugDumpNodeList();
8102     test_ret += test_xmlDebugDumpOneNode();
8103     test_ret += test_xmlDebugDumpString();
8104     test_ret += test_xmlLsCountNode();
8105     test_ret += test_xmlLsOneNode();
8106     test_ret += test_xmlShell();
8107     test_ret += test_xmlShellBase();
8108     test_ret += test_xmlShellCat();
8109     test_ret += test_xmlShellDir();
8110     test_ret += test_xmlShellDu();
8111     test_ret += test_xmlShellList();
8112     test_ret += test_xmlShellLoad();
8113     test_ret += test_xmlShellPrintXPathResult();
8114     test_ret += test_xmlShellPwd();
8115     test_ret += test_xmlShellSave();
8116     test_ret += test_xmlShellValidate();
8117     test_ret += test_xmlShellWrite();
8118
8119     if (test_ret != 0)
8120         printf("Module debugXML: %d errors\n", test_ret);
8121     return(test_ret);
8122 }
8123
8124 static int
8125 test_xmlDictCleanup(void) {
8126     int test_ret = 0;
8127
8128     int mem_base;
8129
8130         mem_base = xmlMemBlocks();
8131
8132         xmlDictCleanup();
8133         call_tests++;
8134         xmlResetLastError();
8135         if (mem_base != xmlMemBlocks()) {
8136             printf("Leak of %d blocks found in xmlDictCleanup",
8137                    xmlMemBlocks() - mem_base);
8138             test_ret++;
8139             printf("\n");
8140         }
8141     function_tests++;
8142
8143     return(test_ret);
8144 }
8145
8146
8147 static int
8148 test_xmlDictCreate(void) {
8149     int test_ret = 0;
8150
8151     int mem_base;
8152     xmlDictPtr ret_val;
8153
8154         mem_base = xmlMemBlocks();
8155
8156         ret_val = xmlDictCreate();
8157         desret_xmlDictPtr(ret_val);
8158         call_tests++;
8159         xmlResetLastError();
8160         if (mem_base != xmlMemBlocks()) {
8161             printf("Leak of %d blocks found in xmlDictCreate",
8162                    xmlMemBlocks() - mem_base);
8163             test_ret++;
8164             printf("\n");
8165         }
8166     function_tests++;
8167
8168     return(test_ret);
8169 }
8170
8171
8172 static int
8173 test_xmlDictCreateSub(void) {
8174     int test_ret = 0;
8175
8176     int mem_base;
8177     xmlDictPtr ret_val;
8178     xmlDictPtr sub; /* an existing dictionnary */
8179     int n_sub;
8180
8181     for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8182         mem_base = xmlMemBlocks();
8183         sub = gen_xmlDictPtr(n_sub, 0);
8184
8185         ret_val = xmlDictCreateSub(sub);
8186         desret_xmlDictPtr(ret_val);
8187         call_tests++;
8188         des_xmlDictPtr(n_sub, sub, 0);
8189         xmlResetLastError();
8190         if (mem_base != xmlMemBlocks()) {
8191             printf("Leak of %d blocks found in xmlDictCreateSub",
8192                    xmlMemBlocks() - mem_base);
8193             test_ret++;
8194             printf(" %d", n_sub);
8195             printf("\n");
8196         }
8197     }
8198     function_tests++;
8199
8200     return(test_ret);
8201 }
8202
8203
8204 static int
8205 test_xmlDictExists(void) {
8206     int test_ret = 0;
8207
8208     int mem_base;
8209     const xmlChar * ret_val;
8210     xmlDictPtr dict; /* the dictionnary */
8211     int n_dict;
8212     xmlChar * name; /* the name of the userdata */
8213     int n_name;
8214     int len; /* the length of the name, if -1 it is recomputed */
8215     int n_len;
8216
8217     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8218     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8219     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8220         mem_base = xmlMemBlocks();
8221         dict = gen_xmlDictPtr(n_dict, 0);
8222         name = gen_const_xmlChar_ptr(n_name, 1);
8223         len = gen_int(n_len, 2);
8224
8225         ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8226         desret_const_xmlChar_ptr(ret_val);
8227         call_tests++;
8228         des_xmlDictPtr(n_dict, dict, 0);
8229         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8230         des_int(n_len, len, 2);
8231         xmlResetLastError();
8232         if (mem_base != xmlMemBlocks()) {
8233             printf("Leak of %d blocks found in xmlDictExists",
8234                    xmlMemBlocks() - mem_base);
8235             test_ret++;
8236             printf(" %d", n_dict);
8237             printf(" %d", n_name);
8238             printf(" %d", n_len);
8239             printf("\n");
8240         }
8241     }
8242     }
8243     }
8244     function_tests++;
8245
8246     return(test_ret);
8247 }
8248
8249
8250 static int
8251 test_xmlDictGetUsage(void) {
8252     int test_ret = 0;
8253
8254
8255     /* missing type support */
8256     return(test_ret);
8257 }
8258
8259
8260 static int
8261 test_xmlDictLookup(void) {
8262     int test_ret = 0;
8263
8264     int mem_base;
8265     const xmlChar * ret_val;
8266     xmlDictPtr dict; /* the dictionnary */
8267     int n_dict;
8268     xmlChar * name; /* the name of the userdata */
8269     int n_name;
8270     int len; /* the length of the name, if -1 it is recomputed */
8271     int n_len;
8272
8273     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8274     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8275     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8276         mem_base = xmlMemBlocks();
8277         dict = gen_xmlDictPtr(n_dict, 0);
8278         name = gen_const_xmlChar_ptr(n_name, 1);
8279         len = gen_int(n_len, 2);
8280
8281         ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8282         desret_const_xmlChar_ptr(ret_val);
8283         call_tests++;
8284         des_xmlDictPtr(n_dict, dict, 0);
8285         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8286         des_int(n_len, len, 2);
8287         xmlResetLastError();
8288         if (mem_base != xmlMemBlocks()) {
8289             printf("Leak of %d blocks found in xmlDictLookup",
8290                    xmlMemBlocks() - mem_base);
8291             test_ret++;
8292             printf(" %d", n_dict);
8293             printf(" %d", n_name);
8294             printf(" %d", n_len);
8295             printf("\n");
8296         }
8297     }
8298     }
8299     }
8300     function_tests++;
8301
8302     return(test_ret);
8303 }
8304
8305
8306 static int
8307 test_xmlDictOwns(void) {
8308     int test_ret = 0;
8309
8310     int mem_base;
8311     int ret_val;
8312     xmlDictPtr dict; /* the dictionnary */
8313     int n_dict;
8314     xmlChar * str; /* the string */
8315     int n_str;
8316
8317     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8318     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8319         mem_base = xmlMemBlocks();
8320         dict = gen_xmlDictPtr(n_dict, 0);
8321         str = gen_const_xmlChar_ptr(n_str, 1);
8322
8323         ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8324         desret_int(ret_val);
8325         call_tests++;
8326         des_xmlDictPtr(n_dict, dict, 0);
8327         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8328         xmlResetLastError();
8329         if (mem_base != xmlMemBlocks()) {
8330             printf("Leak of %d blocks found in xmlDictOwns",
8331                    xmlMemBlocks() - mem_base);
8332             test_ret++;
8333             printf(" %d", n_dict);
8334             printf(" %d", n_str);
8335             printf("\n");
8336         }
8337     }
8338     }
8339     function_tests++;
8340
8341     return(test_ret);
8342 }
8343
8344
8345 static int
8346 test_xmlDictQLookup(void) {
8347     int test_ret = 0;
8348
8349     int mem_base;
8350     const xmlChar * ret_val;
8351     xmlDictPtr dict; /* the dictionnary */
8352     int n_dict;
8353     xmlChar * prefix; /* the prefix */
8354     int n_prefix;
8355     xmlChar * name; /* the name */
8356     int n_name;
8357
8358     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8359     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8360     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8361         mem_base = xmlMemBlocks();
8362         dict = gen_xmlDictPtr(n_dict, 0);
8363         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8364         name = gen_const_xmlChar_ptr(n_name, 2);
8365
8366         ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8367         desret_const_xmlChar_ptr(ret_val);
8368         call_tests++;
8369         des_xmlDictPtr(n_dict, dict, 0);
8370         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8371         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8372         xmlResetLastError();
8373         if (mem_base != xmlMemBlocks()) {
8374             printf("Leak of %d blocks found in xmlDictQLookup",
8375                    xmlMemBlocks() - mem_base);
8376             test_ret++;
8377             printf(" %d", n_dict);
8378             printf(" %d", n_prefix);
8379             printf(" %d", n_name);
8380             printf("\n");
8381         }
8382     }
8383     }
8384     }
8385     function_tests++;
8386
8387     return(test_ret);
8388 }
8389
8390
8391 static int
8392 test_xmlDictReference(void) {
8393     int test_ret = 0;
8394
8395     int mem_base;
8396     int ret_val;
8397     xmlDictPtr dict; /* the dictionnary */
8398     int n_dict;
8399
8400     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8401         mem_base = xmlMemBlocks();
8402         dict = gen_xmlDictPtr(n_dict, 0);
8403
8404         ret_val = xmlDictReference(dict);
8405         xmlDictFree(dict);
8406         desret_int(ret_val);
8407         call_tests++;
8408         des_xmlDictPtr(n_dict, dict, 0);
8409         xmlResetLastError();
8410         if (mem_base != xmlMemBlocks()) {
8411             printf("Leak of %d blocks found in xmlDictReference",
8412                    xmlMemBlocks() - mem_base);
8413             test_ret++;
8414             printf(" %d", n_dict);
8415             printf("\n");
8416         }
8417     }
8418     function_tests++;
8419
8420     return(test_ret);
8421 }
8422
8423
8424 static int
8425 test_xmlDictSetLimit(void) {
8426     int test_ret = 0;
8427
8428
8429     /* missing type support */
8430     return(test_ret);
8431 }
8432
8433
8434 static int
8435 test_xmlDictSize(void) {
8436     int test_ret = 0;
8437
8438     int mem_base;
8439     int ret_val;
8440     xmlDictPtr dict; /* the dictionnary */
8441     int n_dict;
8442
8443     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8444         mem_base = xmlMemBlocks();
8445         dict = gen_xmlDictPtr(n_dict, 0);
8446
8447         ret_val = xmlDictSize(dict);
8448         desret_int(ret_val);
8449         call_tests++;
8450         des_xmlDictPtr(n_dict, dict, 0);
8451         xmlResetLastError();
8452         if (mem_base != xmlMemBlocks()) {
8453             printf("Leak of %d blocks found in xmlDictSize",
8454                    xmlMemBlocks() - mem_base);
8455             test_ret++;
8456             printf(" %d", n_dict);
8457             printf("\n");
8458         }
8459     }
8460     function_tests++;
8461
8462     return(test_ret);
8463 }
8464
8465
8466 static int
8467 test_xmlInitializeDict(void) {
8468     int test_ret = 0;
8469
8470     int mem_base;
8471     int ret_val;
8472
8473         mem_base = xmlMemBlocks();
8474
8475         ret_val = xmlInitializeDict();
8476         desret_int(ret_val);
8477         call_tests++;
8478         xmlResetLastError();
8479         if (mem_base != xmlMemBlocks()) {
8480             printf("Leak of %d blocks found in xmlInitializeDict",
8481                    xmlMemBlocks() - mem_base);
8482             test_ret++;
8483             printf("\n");
8484         }
8485     function_tests++;
8486
8487     return(test_ret);
8488 }
8489
8490 static int
8491 test_dict(void) {
8492     int test_ret = 0;
8493
8494     if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
8495     test_ret += test_xmlDictCleanup();
8496     test_ret += test_xmlDictCreate();
8497     test_ret += test_xmlDictCreateSub();
8498     test_ret += test_xmlDictExists();
8499     test_ret += test_xmlDictGetUsage();
8500     test_ret += test_xmlDictLookup();
8501     test_ret += test_xmlDictOwns();
8502     test_ret += test_xmlDictQLookup();
8503     test_ret += test_xmlDictReference();
8504     test_ret += test_xmlDictSetLimit();
8505     test_ret += test_xmlDictSize();
8506     test_ret += test_xmlInitializeDict();
8507
8508     if (test_ret != 0)
8509         printf("Module dict: %d errors\n", test_ret);
8510     return(test_ret);
8511 }
8512
8513 static int
8514 test_UTF8Toisolat1(void) {
8515     int test_ret = 0;
8516
8517 #if defined(LIBXML_OUTPUT_ENABLED)
8518 #ifdef LIBXML_OUTPUT_ENABLED
8519     int mem_base;
8520     int ret_val;
8521     unsigned char * out; /* a pointer to an array of bytes to store the result */
8522     int n_out;
8523     int * outlen; /* the length of @out */
8524     int n_outlen;
8525     unsigned char * in; /* a pointer to an array of UTF-8 chars */
8526     int n_in;
8527     int * inlen; /* the length of @in */
8528     int n_inlen;
8529
8530     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8531     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8532     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8533     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8534         mem_base = xmlMemBlocks();
8535         out = gen_unsigned_char_ptr(n_out, 0);
8536         outlen = gen_int_ptr(n_outlen, 1);
8537         in = gen_const_unsigned_char_ptr(n_in, 2);
8538         inlen = gen_int_ptr(n_inlen, 3);
8539
8540         ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8541         desret_int(ret_val);
8542         call_tests++;
8543         des_unsigned_char_ptr(n_out, out, 0);
8544         des_int_ptr(n_outlen, outlen, 1);
8545         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8546         des_int_ptr(n_inlen, inlen, 3);
8547         xmlResetLastError();
8548         if (mem_base != xmlMemBlocks()) {
8549             printf("Leak of %d blocks found in UTF8Toisolat1",
8550                    xmlMemBlocks() - mem_base);
8551             test_ret++;
8552             printf(" %d", n_out);
8553             printf(" %d", n_outlen);
8554             printf(" %d", n_in);
8555             printf(" %d", n_inlen);
8556             printf("\n");
8557         }
8558     }
8559     }
8560     }
8561     }
8562     function_tests++;
8563 #endif
8564 #endif
8565
8566     return(test_ret);
8567 }
8568
8569
8570 static int
8571 test_isolat1ToUTF8(void) {
8572     int test_ret = 0;
8573
8574     int mem_base;
8575     int ret_val;
8576     unsigned char * out; /* a pointer to an array of bytes to store the result */
8577     int n_out;
8578     int * outlen; /* the length of @out */
8579     int n_outlen;
8580     unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8581     int n_in;
8582     int * inlen; /* the length of @in */
8583     int n_inlen;
8584
8585     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8586     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8587     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8588     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8589         mem_base = xmlMemBlocks();
8590         out = gen_unsigned_char_ptr(n_out, 0);
8591         outlen = gen_int_ptr(n_outlen, 1);
8592         in = gen_const_unsigned_char_ptr(n_in, 2);
8593         inlen = gen_int_ptr(n_inlen, 3);
8594
8595         ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8596         desret_int(ret_val);
8597         call_tests++;
8598         des_unsigned_char_ptr(n_out, out, 0);
8599         des_int_ptr(n_outlen, outlen, 1);
8600         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8601         des_int_ptr(n_inlen, inlen, 3);
8602         xmlResetLastError();
8603         if (mem_base != xmlMemBlocks()) {
8604             printf("Leak of %d blocks found in isolat1ToUTF8",
8605                    xmlMemBlocks() - mem_base);
8606             test_ret++;
8607             printf(" %d", n_out);
8608             printf(" %d", n_outlen);
8609             printf(" %d", n_in);
8610             printf(" %d", n_inlen);
8611             printf("\n");
8612         }
8613     }
8614     }
8615     }
8616     }
8617     function_tests++;
8618
8619     return(test_ret);
8620 }
8621
8622
8623 static int
8624 test_xmlAddEncodingAlias(void) {
8625     int test_ret = 0;
8626
8627     int ret_val;
8628     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8629     int n_name;
8630     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8631     int n_alias;
8632
8633     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8634     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8635         name = gen_const_char_ptr(n_name, 0);
8636         alias = gen_const_char_ptr(n_alias, 1);
8637
8638         ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8639         desret_int(ret_val);
8640         call_tests++;
8641         des_const_char_ptr(n_name, (const char *)name, 0);
8642         des_const_char_ptr(n_alias, (const char *)alias, 1);
8643         xmlResetLastError();
8644     }
8645     }
8646     function_tests++;
8647
8648     return(test_ret);
8649 }
8650
8651
8652 #define gen_nb_xmlCharEncodingHandler_ptr 1
8653 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8654     return(NULL);
8655 }
8656 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8657 }
8658
8659 static int
8660 test_xmlCharEncCloseFunc(void) {
8661     int test_ret = 0;
8662
8663     int mem_base;
8664     int ret_val;
8665     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8666     int n_handler;
8667
8668     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8669         mem_base = xmlMemBlocks();
8670         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8671
8672         ret_val = xmlCharEncCloseFunc(handler);
8673         desret_int(ret_val);
8674         call_tests++;
8675         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8676         xmlResetLastError();
8677         if (mem_base != xmlMemBlocks()) {
8678             printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8679                    xmlMemBlocks() - mem_base);
8680             test_ret++;
8681             printf(" %d", n_handler);
8682             printf("\n");
8683         }
8684     }
8685     function_tests++;
8686
8687     return(test_ret);
8688 }
8689
8690
8691 static int
8692 test_xmlCharEncFirstLine(void) {
8693     int test_ret = 0;
8694
8695     int mem_base;
8696     int ret_val;
8697     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8698     int n_handler;
8699     xmlBufferPtr out; /* an xmlBuffer for the output. */
8700     int n_out;
8701     xmlBufferPtr in; /* an xmlBuffer for the input */
8702     int n_in;
8703
8704     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8705     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8706     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8707         mem_base = xmlMemBlocks();
8708         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8709         out = gen_xmlBufferPtr(n_out, 1);
8710         in = gen_xmlBufferPtr(n_in, 2);
8711
8712         ret_val = xmlCharEncFirstLine(handler, out, in);
8713         desret_int(ret_val);
8714         call_tests++;
8715         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8716         des_xmlBufferPtr(n_out, out, 1);
8717         des_xmlBufferPtr(n_in, in, 2);
8718         xmlResetLastError();
8719         if (mem_base != xmlMemBlocks()) {
8720             printf("Leak of %d blocks found in xmlCharEncFirstLine",
8721                    xmlMemBlocks() - mem_base);
8722             test_ret++;
8723             printf(" %d", n_handler);
8724             printf(" %d", n_out);
8725             printf(" %d", n_in);
8726             printf("\n");
8727         }
8728     }
8729     }
8730     }
8731     function_tests++;
8732
8733     return(test_ret);
8734 }
8735
8736
8737 static int
8738 test_xmlCharEncInFunc(void) {
8739     int test_ret = 0;
8740
8741     int mem_base;
8742     int ret_val;
8743     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8744     int n_handler;
8745     xmlBufferPtr out; /* an xmlBuffer for the output. */
8746     int n_out;
8747     xmlBufferPtr in; /* an xmlBuffer for the input */
8748     int n_in;
8749
8750     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8751     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8752     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8753         mem_base = xmlMemBlocks();
8754         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8755         out = gen_xmlBufferPtr(n_out, 1);
8756         in = gen_xmlBufferPtr(n_in, 2);
8757
8758         ret_val = xmlCharEncInFunc(handler, out, in);
8759         desret_int(ret_val);
8760         call_tests++;
8761         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8762         des_xmlBufferPtr(n_out, out, 1);
8763         des_xmlBufferPtr(n_in, in, 2);
8764         xmlResetLastError();
8765         if (mem_base != xmlMemBlocks()) {
8766             printf("Leak of %d blocks found in xmlCharEncInFunc",
8767                    xmlMemBlocks() - mem_base);
8768             test_ret++;
8769             printf(" %d", n_handler);
8770             printf(" %d", n_out);
8771             printf(" %d", n_in);
8772             printf("\n");
8773         }
8774     }
8775     }
8776     }
8777     function_tests++;
8778
8779     return(test_ret);
8780 }
8781
8782
8783 static int
8784 test_xmlCharEncOutFunc(void) {
8785     int test_ret = 0;
8786
8787     int mem_base;
8788     int ret_val;
8789     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8790     int n_handler;
8791     xmlBufferPtr out; /* an xmlBuffer for the output. */
8792     int n_out;
8793     xmlBufferPtr in; /* an xmlBuffer for the input */
8794     int n_in;
8795
8796     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8797     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8798     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8799         mem_base = xmlMemBlocks();
8800         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8801         out = gen_xmlBufferPtr(n_out, 1);
8802         in = gen_xmlBufferPtr(n_in, 2);
8803
8804         ret_val = xmlCharEncOutFunc(handler, out, in);
8805         desret_int(ret_val);
8806         call_tests++;
8807         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8808         des_xmlBufferPtr(n_out, out, 1);
8809         des_xmlBufferPtr(n_in, in, 2);
8810         xmlResetLastError();
8811         if (mem_base != xmlMemBlocks()) {
8812             printf("Leak of %d blocks found in xmlCharEncOutFunc",
8813                    xmlMemBlocks() - mem_base);
8814             test_ret++;
8815             printf(" %d", n_handler);
8816             printf(" %d", n_out);
8817             printf(" %d", n_in);
8818             printf("\n");
8819         }
8820     }
8821     }
8822     }
8823     function_tests++;
8824
8825     return(test_ret);
8826 }
8827
8828
8829 static int
8830 test_xmlCleanupCharEncodingHandlers(void) {
8831     int test_ret = 0;
8832
8833
8834
8835         xmlCleanupCharEncodingHandlers();
8836         call_tests++;
8837         xmlResetLastError();
8838     function_tests++;
8839
8840     return(test_ret);
8841 }
8842
8843
8844 static int
8845 test_xmlCleanupEncodingAliases(void) {
8846     int test_ret = 0;
8847
8848     int mem_base;
8849
8850         mem_base = xmlMemBlocks();
8851
8852         xmlCleanupEncodingAliases();
8853         call_tests++;
8854         xmlResetLastError();
8855         if (mem_base != xmlMemBlocks()) {
8856             printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8857                    xmlMemBlocks() - mem_base);
8858             test_ret++;
8859             printf("\n");
8860         }
8861     function_tests++;
8862
8863     return(test_ret);
8864 }
8865
8866
8867 static int
8868 test_xmlDelEncodingAlias(void) {
8869     int test_ret = 0;
8870
8871     int mem_base;
8872     int ret_val;
8873     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8874     int n_alias;
8875
8876     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8877         mem_base = xmlMemBlocks();
8878         alias = gen_const_char_ptr(n_alias, 0);
8879
8880         ret_val = xmlDelEncodingAlias((const char *)alias);
8881         desret_int(ret_val);
8882         call_tests++;
8883         des_const_char_ptr(n_alias, (const char *)alias, 0);
8884         xmlResetLastError();
8885         if (mem_base != xmlMemBlocks()) {
8886             printf("Leak of %d blocks found in xmlDelEncodingAlias",
8887                    xmlMemBlocks() - mem_base);
8888             test_ret++;
8889             printf(" %d", n_alias);
8890             printf("\n");
8891         }
8892     }
8893     function_tests++;
8894
8895     return(test_ret);
8896 }
8897
8898
8899 static int
8900 test_xmlDetectCharEncoding(void) {
8901     int test_ret = 0;
8902
8903     int mem_base;
8904     xmlCharEncoding ret_val;
8905     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). */
8906     int n_in;
8907     int len; /* pointer to the length of the buffer */
8908     int n_len;
8909
8910     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8911     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8912         mem_base = xmlMemBlocks();
8913         in = gen_const_unsigned_char_ptr(n_in, 0);
8914         len = gen_int(n_len, 1);
8915
8916         ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8917         desret_xmlCharEncoding(ret_val);
8918         call_tests++;
8919         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8920         des_int(n_len, len, 1);
8921         xmlResetLastError();
8922         if (mem_base != xmlMemBlocks()) {
8923             printf("Leak of %d blocks found in xmlDetectCharEncoding",
8924                    xmlMemBlocks() - mem_base);
8925             test_ret++;
8926             printf(" %d", n_in);
8927             printf(" %d", n_len);
8928             printf("\n");
8929         }
8930     }
8931     }
8932     function_tests++;
8933
8934     return(test_ret);
8935 }
8936
8937
8938 static int
8939 test_xmlFindCharEncodingHandler(void) {
8940     int test_ret = 0;
8941
8942
8943     /* missing type support */
8944     return(test_ret);
8945 }
8946
8947
8948 static int
8949 test_xmlGetCharEncodingHandler(void) {
8950     int test_ret = 0;
8951
8952
8953     /* missing type support */
8954     return(test_ret);
8955 }
8956
8957
8958 static int
8959 test_xmlGetCharEncodingName(void) {
8960     int test_ret = 0;
8961
8962     int mem_base;
8963     const char * ret_val;
8964     xmlCharEncoding enc; /* the encoding */
8965     int n_enc;
8966
8967     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8968         mem_base = xmlMemBlocks();
8969         enc = gen_xmlCharEncoding(n_enc, 0);
8970
8971         ret_val = xmlGetCharEncodingName(enc);
8972         desret_const_char_ptr(ret_val);
8973         call_tests++;
8974         des_xmlCharEncoding(n_enc, enc, 0);
8975         xmlResetLastError();
8976         if (mem_base != xmlMemBlocks()) {
8977             printf("Leak of %d blocks found in xmlGetCharEncodingName",
8978                    xmlMemBlocks() - mem_base);
8979             test_ret++;
8980             printf(" %d", n_enc);
8981             printf("\n");
8982         }
8983     }
8984     function_tests++;
8985
8986     return(test_ret);
8987 }
8988
8989
8990 static int
8991 test_xmlGetEncodingAlias(void) {
8992     int test_ret = 0;
8993
8994     int mem_base;
8995     const char * ret_val;
8996     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8997     int n_alias;
8998
8999     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9000         mem_base = xmlMemBlocks();
9001         alias = gen_const_char_ptr(n_alias, 0);
9002
9003         ret_val = xmlGetEncodingAlias((const char *)alias);
9004         desret_const_char_ptr(ret_val);
9005         call_tests++;
9006         des_const_char_ptr(n_alias, (const char *)alias, 0);
9007         xmlResetLastError();
9008         if (mem_base != xmlMemBlocks()) {
9009             printf("Leak of %d blocks found in xmlGetEncodingAlias",
9010                    xmlMemBlocks() - mem_base);
9011             test_ret++;
9012             printf(" %d", n_alias);
9013             printf("\n");
9014         }
9015     }
9016     function_tests++;
9017
9018     return(test_ret);
9019 }
9020
9021
9022 static int
9023 test_xmlInitCharEncodingHandlers(void) {
9024     int test_ret = 0;
9025
9026
9027
9028         xmlInitCharEncodingHandlers();
9029         call_tests++;
9030         xmlResetLastError();
9031     function_tests++;
9032
9033     return(test_ret);
9034 }
9035
9036
9037 static int
9038 test_xmlNewCharEncodingHandler(void) {
9039     int test_ret = 0;
9040
9041
9042     /* missing type support */
9043     return(test_ret);
9044 }
9045
9046
9047 static int
9048 test_xmlParseCharEncoding(void) {
9049     int test_ret = 0;
9050
9051     int mem_base;
9052     xmlCharEncoding ret_val;
9053     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9054     int n_name;
9055
9056     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9057         mem_base = xmlMemBlocks();
9058         name = gen_const_char_ptr(n_name, 0);
9059
9060         ret_val = xmlParseCharEncoding((const char *)name);
9061         desret_xmlCharEncoding(ret_val);
9062         call_tests++;
9063         des_const_char_ptr(n_name, (const char *)name, 0);
9064         xmlResetLastError();
9065         if (mem_base != xmlMemBlocks()) {
9066             printf("Leak of %d blocks found in xmlParseCharEncoding",
9067                    xmlMemBlocks() - mem_base);
9068             test_ret++;
9069             printf(" %d", n_name);
9070             printf("\n");
9071         }
9072     }
9073     function_tests++;
9074
9075     return(test_ret);
9076 }
9077
9078
9079 #define gen_nb_xmlCharEncodingHandlerPtr 1
9080 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9081     return(NULL);
9082 }
9083 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9084 }
9085
9086 static int
9087 test_xmlRegisterCharEncodingHandler(void) {
9088     int test_ret = 0;
9089
9090     int mem_base;
9091     xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9092     int n_handler;
9093
9094     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9095         mem_base = xmlMemBlocks();
9096         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9097
9098         xmlRegisterCharEncodingHandler(handler);
9099         call_tests++;
9100         des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9101         xmlResetLastError();
9102         if (mem_base != xmlMemBlocks()) {
9103             printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9104                    xmlMemBlocks() - mem_base);
9105             test_ret++;
9106             printf(" %d", n_handler);
9107             printf("\n");
9108         }
9109     }
9110     function_tests++;
9111
9112     return(test_ret);
9113 }
9114
9115 static int
9116 test_encoding(void) {
9117     int test_ret = 0;
9118
9119     if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9120     test_ret += test_UTF8Toisolat1();
9121     test_ret += test_isolat1ToUTF8();
9122     test_ret += test_xmlAddEncodingAlias();
9123     test_ret += test_xmlCharEncCloseFunc();
9124     test_ret += test_xmlCharEncFirstLine();
9125     test_ret += test_xmlCharEncInFunc();
9126     test_ret += test_xmlCharEncOutFunc();
9127     test_ret += test_xmlCleanupCharEncodingHandlers();
9128     test_ret += test_xmlCleanupEncodingAliases();
9129     test_ret += test_xmlDelEncodingAlias();
9130     test_ret += test_xmlDetectCharEncoding();
9131     test_ret += test_xmlFindCharEncodingHandler();
9132     test_ret += test_xmlGetCharEncodingHandler();
9133     test_ret += test_xmlGetCharEncodingName();
9134     test_ret += test_xmlGetEncodingAlias();
9135     test_ret += test_xmlInitCharEncodingHandlers();
9136     test_ret += test_xmlNewCharEncodingHandler();
9137     test_ret += test_xmlParseCharEncoding();
9138     test_ret += test_xmlRegisterCharEncodingHandler();
9139
9140     if (test_ret != 0)
9141         printf("Module encoding: %d errors\n", test_ret);
9142     return(test_ret);
9143 }
9144
9145 static int
9146 test_xmlAddDocEntity(void) {
9147     int test_ret = 0;
9148
9149     int mem_base;
9150     xmlEntityPtr ret_val;
9151     xmlDocPtr doc; /* the document */
9152     int n_doc;
9153     xmlChar * name; /* the entity name */
9154     int n_name;
9155     int type; /* the entity type XML_xxx_yyy_ENTITY */
9156     int n_type;
9157     xmlChar * ExternalID; /* the entity external ID if available */
9158     int n_ExternalID;
9159     xmlChar * SystemID; /* the entity system ID if available */
9160     int n_SystemID;
9161     xmlChar * content; /* the entity content */
9162     int n_content;
9163
9164     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9165     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9166     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9167     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9168     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9169     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9170         mem_base = xmlMemBlocks();
9171         doc = gen_xmlDocPtr(n_doc, 0);
9172         name = gen_const_xmlChar_ptr(n_name, 1);
9173         type = gen_int(n_type, 2);
9174         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9175         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9176         content = gen_const_xmlChar_ptr(n_content, 5);
9177
9178         ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9179         desret_xmlEntityPtr(ret_val);
9180         call_tests++;
9181         des_xmlDocPtr(n_doc, doc, 0);
9182         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9183         des_int(n_type, type, 2);
9184         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9185         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9186         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9187         xmlResetLastError();
9188         if (mem_base != xmlMemBlocks()) {
9189             printf("Leak of %d blocks found in xmlAddDocEntity",
9190                    xmlMemBlocks() - mem_base);
9191             test_ret++;
9192             printf(" %d", n_doc);
9193             printf(" %d", n_name);
9194             printf(" %d", n_type);
9195             printf(" %d", n_ExternalID);
9196             printf(" %d", n_SystemID);
9197             printf(" %d", n_content);
9198             printf("\n");
9199         }
9200     }
9201     }
9202     }
9203     }
9204     }
9205     }
9206     function_tests++;
9207
9208     return(test_ret);
9209 }
9210
9211
9212 static int
9213 test_xmlAddDtdEntity(void) {
9214     int test_ret = 0;
9215
9216     int mem_base;
9217     xmlEntityPtr ret_val;
9218     xmlDocPtr doc; /* the document */
9219     int n_doc;
9220     xmlChar * name; /* the entity name */
9221     int n_name;
9222     int type; /* the entity type XML_xxx_yyy_ENTITY */
9223     int n_type;
9224     xmlChar * ExternalID; /* the entity external ID if available */
9225     int n_ExternalID;
9226     xmlChar * SystemID; /* the entity system ID if available */
9227     int n_SystemID;
9228     xmlChar * content; /* the entity content */
9229     int n_content;
9230
9231     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9232     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9233     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9234     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9235     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9236     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9237         mem_base = xmlMemBlocks();
9238         doc = gen_xmlDocPtr(n_doc, 0);
9239         name = gen_const_xmlChar_ptr(n_name, 1);
9240         type = gen_int(n_type, 2);
9241         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9242         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9243         content = gen_const_xmlChar_ptr(n_content, 5);
9244
9245         ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9246         desret_xmlEntityPtr(ret_val);
9247         call_tests++;
9248         des_xmlDocPtr(n_doc, doc, 0);
9249         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9250         des_int(n_type, type, 2);
9251         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9252         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9253         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9254         xmlResetLastError();
9255         if (mem_base != xmlMemBlocks()) {
9256             printf("Leak of %d blocks found in xmlAddDtdEntity",
9257                    xmlMemBlocks() - mem_base);
9258             test_ret++;
9259             printf(" %d", n_doc);
9260             printf(" %d", n_name);
9261             printf(" %d", n_type);
9262             printf(" %d", n_ExternalID);
9263             printf(" %d", n_SystemID);
9264             printf(" %d", n_content);
9265             printf("\n");
9266         }
9267     }
9268     }
9269     }
9270     }
9271     }
9272     }
9273     function_tests++;
9274
9275     return(test_ret);
9276 }
9277
9278
9279 static int
9280 test_xmlCleanupPredefinedEntities(void) {
9281     int test_ret = 0;
9282
9283 #if defined(LIBXML_LEGACY_ENABLED)
9284 #ifdef LIBXML_LEGACY_ENABLED
9285     int mem_base;
9286
9287         mem_base = xmlMemBlocks();
9288
9289         xmlCleanupPredefinedEntities();
9290         call_tests++;
9291         xmlResetLastError();
9292         if (mem_base != xmlMemBlocks()) {
9293             printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9294                    xmlMemBlocks() - mem_base);
9295             test_ret++;
9296             printf("\n");
9297         }
9298     function_tests++;
9299 #endif
9300 #endif
9301
9302     return(test_ret);
9303 }
9304
9305
9306 #define gen_nb_xmlEntitiesTablePtr 1
9307 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9308     return(NULL);
9309 }
9310 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9311 }
9312
9313 static int
9314 test_xmlCopyEntitiesTable(void) {
9315     int test_ret = 0;
9316
9317
9318     /* missing type support */
9319     return(test_ret);
9320 }
9321
9322
9323 static int
9324 test_xmlCreateEntitiesTable(void) {
9325     int test_ret = 0;
9326
9327
9328     /* missing type support */
9329     return(test_ret);
9330 }
9331
9332
9333 static int
9334 test_xmlDumpEntitiesTable(void) {
9335     int test_ret = 0;
9336
9337 #if defined(LIBXML_OUTPUT_ENABLED)
9338     int mem_base;
9339     xmlBufferPtr buf; /* An XML buffer. */
9340     int n_buf;
9341     xmlEntitiesTablePtr table; /* An entity table */
9342     int n_table;
9343
9344     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9345     for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9346         mem_base = xmlMemBlocks();
9347         buf = gen_xmlBufferPtr(n_buf, 0);
9348         table = gen_xmlEntitiesTablePtr(n_table, 1);
9349
9350         xmlDumpEntitiesTable(buf, table);
9351         call_tests++;
9352         des_xmlBufferPtr(n_buf, buf, 0);
9353         des_xmlEntitiesTablePtr(n_table, table, 1);
9354         xmlResetLastError();
9355         if (mem_base != xmlMemBlocks()) {
9356             printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9357                    xmlMemBlocks() - mem_base);
9358             test_ret++;
9359             printf(" %d", n_buf);
9360             printf(" %d", n_table);
9361             printf("\n");
9362         }
9363     }
9364     }
9365     function_tests++;
9366 #endif
9367
9368     return(test_ret);
9369 }
9370
9371
9372 #define gen_nb_xmlEntityPtr 1
9373 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9374     return(NULL);
9375 }
9376 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9377 }
9378
9379 static int
9380 test_xmlDumpEntityDecl(void) {
9381     int test_ret = 0;
9382
9383 #if defined(LIBXML_OUTPUT_ENABLED)
9384     int mem_base;
9385     xmlBufferPtr buf; /* An XML buffer. */
9386     int n_buf;
9387     xmlEntityPtr ent; /* An entity table */
9388     int n_ent;
9389
9390     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9391     for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9392         mem_base = xmlMemBlocks();
9393         buf = gen_xmlBufferPtr(n_buf, 0);
9394         ent = gen_xmlEntityPtr(n_ent, 1);
9395
9396         xmlDumpEntityDecl(buf, ent);
9397         call_tests++;
9398         des_xmlBufferPtr(n_buf, buf, 0);
9399         des_xmlEntityPtr(n_ent, ent, 1);
9400         xmlResetLastError();
9401         if (mem_base != xmlMemBlocks()) {
9402             printf("Leak of %d blocks found in xmlDumpEntityDecl",
9403                    xmlMemBlocks() - mem_base);
9404             test_ret++;
9405             printf(" %d", n_buf);
9406             printf(" %d", n_ent);
9407             printf("\n");
9408         }
9409     }
9410     }
9411     function_tests++;
9412 #endif
9413
9414     return(test_ret);
9415 }
9416
9417
9418 static int
9419 test_xmlEncodeEntitiesReentrant(void) {
9420     int test_ret = 0;
9421
9422     int mem_base;
9423     xmlChar * ret_val;
9424     xmlDocPtr doc; /* the document containing the string */
9425     int n_doc;
9426     xmlChar * input; /* A string to convert to XML. */
9427     int n_input;
9428
9429     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9430     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9431         mem_base = xmlMemBlocks();
9432         doc = gen_xmlDocPtr(n_doc, 0);
9433         input = gen_const_xmlChar_ptr(n_input, 1);
9434
9435         ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9436         desret_xmlChar_ptr(ret_val);
9437         call_tests++;
9438         des_xmlDocPtr(n_doc, doc, 0);
9439         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9440         xmlResetLastError();
9441         if (mem_base != xmlMemBlocks()) {
9442             printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9443                    xmlMemBlocks() - mem_base);
9444             test_ret++;
9445             printf(" %d", n_doc);
9446             printf(" %d", n_input);
9447             printf("\n");
9448         }
9449     }
9450     }
9451     function_tests++;
9452
9453     return(test_ret);
9454 }
9455
9456
9457 static int
9458 test_xmlEncodeSpecialChars(void) {
9459     int test_ret = 0;
9460
9461     int mem_base;
9462     xmlChar * ret_val;
9463     xmlDocPtr doc; /* the document containing the string */
9464     int n_doc;
9465     xmlChar * input; /* A string to convert to XML. */
9466     int n_input;
9467
9468     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9469     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9470         mem_base = xmlMemBlocks();
9471         doc = gen_xmlDocPtr(n_doc, 0);
9472         input = gen_const_xmlChar_ptr(n_input, 1);
9473
9474         ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9475         desret_xmlChar_ptr(ret_val);
9476         call_tests++;
9477         des_xmlDocPtr(n_doc, doc, 0);
9478         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9479         xmlResetLastError();
9480         if (mem_base != xmlMemBlocks()) {
9481             printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9482                    xmlMemBlocks() - mem_base);
9483             test_ret++;
9484             printf(" %d", n_doc);
9485             printf(" %d", n_input);
9486             printf("\n");
9487         }
9488     }
9489     }
9490     function_tests++;
9491
9492     return(test_ret);
9493 }
9494
9495
9496 static int
9497 test_xmlGetDocEntity(void) {
9498     int test_ret = 0;
9499
9500     int mem_base;
9501     xmlEntityPtr ret_val;
9502     xmlDocPtr doc; /* the document referencing the entity */
9503     int n_doc;
9504     xmlChar * name; /* the entity name */
9505     int n_name;
9506
9507     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9508     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9509         mem_base = xmlMemBlocks();
9510         doc = gen_xmlDocPtr(n_doc, 0);
9511         name = gen_const_xmlChar_ptr(n_name, 1);
9512
9513         ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9514         desret_xmlEntityPtr(ret_val);
9515         call_tests++;
9516         des_xmlDocPtr(n_doc, doc, 0);
9517         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9518         xmlResetLastError();
9519         if (mem_base != xmlMemBlocks()) {
9520             printf("Leak of %d blocks found in xmlGetDocEntity",
9521                    xmlMemBlocks() - mem_base);
9522             test_ret++;
9523             printf(" %d", n_doc);
9524             printf(" %d", n_name);
9525             printf("\n");
9526         }
9527     }
9528     }
9529     function_tests++;
9530
9531     return(test_ret);
9532 }
9533
9534
9535 static int
9536 test_xmlGetDtdEntity(void) {
9537     int test_ret = 0;
9538
9539     int mem_base;
9540     xmlEntityPtr ret_val;
9541     xmlDocPtr doc; /* the document referencing the entity */
9542     int n_doc;
9543     xmlChar * name; /* the entity name */
9544     int n_name;
9545
9546     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9547     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9548         mem_base = xmlMemBlocks();
9549         doc = gen_xmlDocPtr(n_doc, 0);
9550         name = gen_const_xmlChar_ptr(n_name, 1);
9551
9552         ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9553         desret_xmlEntityPtr(ret_val);
9554         call_tests++;
9555         des_xmlDocPtr(n_doc, doc, 0);
9556         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9557         xmlResetLastError();
9558         if (mem_base != xmlMemBlocks()) {
9559             printf("Leak of %d blocks found in xmlGetDtdEntity",
9560                    xmlMemBlocks() - mem_base);
9561             test_ret++;
9562             printf(" %d", n_doc);
9563             printf(" %d", n_name);
9564             printf("\n");
9565         }
9566     }
9567     }
9568     function_tests++;
9569
9570     return(test_ret);
9571 }
9572
9573
9574 static int
9575 test_xmlGetParameterEntity(void) {
9576     int test_ret = 0;
9577
9578     int mem_base;
9579     xmlEntityPtr ret_val;
9580     xmlDocPtr doc; /* the document referencing the entity */
9581     int n_doc;
9582     xmlChar * name; /* the entity name */
9583     int n_name;
9584
9585     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9586     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9587         mem_base = xmlMemBlocks();
9588         doc = gen_xmlDocPtr(n_doc, 0);
9589         name = gen_const_xmlChar_ptr(n_name, 1);
9590
9591         ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9592         desret_xmlEntityPtr(ret_val);
9593         call_tests++;
9594         des_xmlDocPtr(n_doc, doc, 0);
9595         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9596         xmlResetLastError();
9597         if (mem_base != xmlMemBlocks()) {
9598             printf("Leak of %d blocks found in xmlGetParameterEntity",
9599                    xmlMemBlocks() - mem_base);
9600             test_ret++;
9601             printf(" %d", n_doc);
9602             printf(" %d", n_name);
9603             printf("\n");
9604         }
9605     }
9606     }
9607     function_tests++;
9608
9609     return(test_ret);
9610 }
9611
9612
9613 static int
9614 test_xmlGetPredefinedEntity(void) {
9615     int test_ret = 0;
9616
9617     int mem_base;
9618     xmlEntityPtr ret_val;
9619     xmlChar * name; /* the entity name */
9620     int n_name;
9621
9622     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9623         mem_base = xmlMemBlocks();
9624         name = gen_const_xmlChar_ptr(n_name, 0);
9625
9626         ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9627         desret_xmlEntityPtr(ret_val);
9628         call_tests++;
9629         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9630         xmlResetLastError();
9631         if (mem_base != xmlMemBlocks()) {
9632             printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9633                    xmlMemBlocks() - mem_base);
9634             test_ret++;
9635             printf(" %d", n_name);
9636             printf("\n");
9637         }
9638     }
9639     function_tests++;
9640
9641     return(test_ret);
9642 }
9643
9644
9645 static int
9646 test_xmlInitializePredefinedEntities(void) {
9647     int test_ret = 0;
9648
9649 #if defined(LIBXML_LEGACY_ENABLED)
9650 #ifdef LIBXML_LEGACY_ENABLED
9651     int mem_base;
9652
9653         mem_base = xmlMemBlocks();
9654
9655         xmlInitializePredefinedEntities();
9656         call_tests++;
9657         xmlResetLastError();
9658         if (mem_base != xmlMemBlocks()) {
9659             printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9660                    xmlMemBlocks() - mem_base);
9661             test_ret++;
9662             printf("\n");
9663         }
9664     function_tests++;
9665 #endif
9666 #endif
9667
9668     return(test_ret);
9669 }
9670
9671
9672 static int
9673 test_xmlNewEntity(void) {
9674     int test_ret = 0;
9675
9676     int mem_base;
9677     xmlEntityPtr ret_val;
9678     xmlDocPtr doc; /* the document */
9679     int n_doc;
9680     xmlChar * name; /* the entity name */
9681     int n_name;
9682     int type; /* the entity type XML_xxx_yyy_ENTITY */
9683     int n_type;
9684     xmlChar * ExternalID; /* the entity external ID if available */
9685     int n_ExternalID;
9686     xmlChar * SystemID; /* the entity system ID if available */
9687     int n_SystemID;
9688     xmlChar * content; /* the entity content */
9689     int n_content;
9690
9691     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9692     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9693     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9694     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9695     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9696     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9697         mem_base = xmlMemBlocks();
9698         doc = gen_xmlDocPtr(n_doc, 0);
9699         name = gen_const_xmlChar_ptr(n_name, 1);
9700         type = gen_int(n_type, 2);
9701         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9702         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9703         content = gen_const_xmlChar_ptr(n_content, 5);
9704
9705         ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9706         desret_xmlEntityPtr(ret_val);
9707         call_tests++;
9708         des_xmlDocPtr(n_doc, doc, 0);
9709         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9710         des_int(n_type, type, 2);
9711         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9712         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9713         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9714         xmlResetLastError();
9715         if (mem_base != xmlMemBlocks()) {
9716             printf("Leak of %d blocks found in xmlNewEntity",
9717                    xmlMemBlocks() - mem_base);
9718             test_ret++;
9719             printf(" %d", n_doc);
9720             printf(" %d", n_name);
9721             printf(" %d", n_type);
9722             printf(" %d", n_ExternalID);
9723             printf(" %d", n_SystemID);
9724             printf(" %d", n_content);
9725             printf("\n");
9726         }
9727     }
9728     }
9729     }
9730     }
9731     }
9732     }
9733     function_tests++;
9734
9735     return(test_ret);
9736 }
9737
9738 static int
9739 test_entities(void) {
9740     int test_ret = 0;
9741
9742     if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9743     test_ret += test_xmlAddDocEntity();
9744     test_ret += test_xmlAddDtdEntity();
9745     test_ret += test_xmlCleanupPredefinedEntities();
9746     test_ret += test_xmlCopyEntitiesTable();
9747     test_ret += test_xmlCreateEntitiesTable();
9748     test_ret += test_xmlDumpEntitiesTable();
9749     test_ret += test_xmlDumpEntityDecl();
9750     test_ret += test_xmlEncodeEntitiesReentrant();
9751     test_ret += test_xmlEncodeSpecialChars();
9752     test_ret += test_xmlGetDocEntity();
9753     test_ret += test_xmlGetDtdEntity();
9754     test_ret += test_xmlGetParameterEntity();
9755     test_ret += test_xmlGetPredefinedEntity();
9756     test_ret += test_xmlInitializePredefinedEntities();
9757     test_ret += test_xmlNewEntity();
9758
9759     if (test_ret != 0)
9760         printf("Module entities: %d errors\n", test_ret);
9761     return(test_ret);
9762 }
9763
9764 static int
9765 test_xmlHashAddEntry(void) {
9766     int test_ret = 0;
9767
9768     int mem_base;
9769     int ret_val;
9770     xmlHashTablePtr table; /* the hash table */
9771     int n_table;
9772     xmlChar * name; /* the name of the userdata */
9773     int n_name;
9774     void * userdata; /* a pointer to the userdata */
9775     int n_userdata;
9776
9777     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9778     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9779     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9780         mem_base = xmlMemBlocks();
9781         table = gen_xmlHashTablePtr(n_table, 0);
9782         name = gen_const_xmlChar_ptr(n_name, 1);
9783         userdata = gen_userdata(n_userdata, 2);
9784
9785         ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9786         desret_int(ret_val);
9787         call_tests++;
9788         des_xmlHashTablePtr(n_table, table, 0);
9789         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9790         des_userdata(n_userdata, userdata, 2);
9791         xmlResetLastError();
9792         if (mem_base != xmlMemBlocks()) {
9793             printf("Leak of %d blocks found in xmlHashAddEntry",
9794                    xmlMemBlocks() - mem_base);
9795             test_ret++;
9796             printf(" %d", n_table);
9797             printf(" %d", n_name);
9798             printf(" %d", n_userdata);
9799             printf("\n");
9800         }
9801     }
9802     }
9803     }
9804     function_tests++;
9805
9806     return(test_ret);
9807 }
9808
9809
9810 static int
9811 test_xmlHashAddEntry2(void) {
9812     int test_ret = 0;
9813
9814     int mem_base;
9815     int ret_val;
9816     xmlHashTablePtr table; /* the hash table */
9817     int n_table;
9818     xmlChar * name; /* the name of the userdata */
9819     int n_name;
9820     xmlChar * name2; /* a second name of the userdata */
9821     int n_name2;
9822     void * userdata; /* a pointer to the userdata */
9823     int n_userdata;
9824
9825     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9826     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9827     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9828     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9829         mem_base = xmlMemBlocks();
9830         table = gen_xmlHashTablePtr(n_table, 0);
9831         name = gen_const_xmlChar_ptr(n_name, 1);
9832         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9833         userdata = gen_userdata(n_userdata, 3);
9834
9835         ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9836         desret_int(ret_val);
9837         call_tests++;
9838         des_xmlHashTablePtr(n_table, table, 0);
9839         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9840         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9841         des_userdata(n_userdata, userdata, 3);
9842         xmlResetLastError();
9843         if (mem_base != xmlMemBlocks()) {
9844             printf("Leak of %d blocks found in xmlHashAddEntry2",
9845                    xmlMemBlocks() - mem_base);
9846             test_ret++;
9847             printf(" %d", n_table);
9848             printf(" %d", n_name);
9849             printf(" %d", n_name2);
9850             printf(" %d", n_userdata);
9851             printf("\n");
9852         }
9853     }
9854     }
9855     }
9856     }
9857     function_tests++;
9858
9859     return(test_ret);
9860 }
9861
9862
9863 static int
9864 test_xmlHashAddEntry3(void) {
9865     int test_ret = 0;
9866
9867     int mem_base;
9868     int ret_val;
9869     xmlHashTablePtr table; /* the hash table */
9870     int n_table;
9871     xmlChar * name; /* the name of the userdata */
9872     int n_name;
9873     xmlChar * name2; /* a second name of the userdata */
9874     int n_name2;
9875     xmlChar * name3; /* a third name of the userdata */
9876     int n_name3;
9877     void * userdata; /* a pointer to the userdata */
9878     int n_userdata;
9879
9880     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9881     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9882     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9883     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9884     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9885         mem_base = xmlMemBlocks();
9886         table = gen_xmlHashTablePtr(n_table, 0);
9887         name = gen_const_xmlChar_ptr(n_name, 1);
9888         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9889         name3 = gen_const_xmlChar_ptr(n_name3, 3);
9890         userdata = gen_userdata(n_userdata, 4);
9891
9892         ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9893         desret_int(ret_val);
9894         call_tests++;
9895         des_xmlHashTablePtr(n_table, table, 0);
9896         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9897         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9898         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9899         des_userdata(n_userdata, userdata, 4);
9900         xmlResetLastError();
9901         if (mem_base != xmlMemBlocks()) {
9902             printf("Leak of %d blocks found in xmlHashAddEntry3",
9903                    xmlMemBlocks() - mem_base);
9904             test_ret++;
9905             printf(" %d", n_table);
9906             printf(" %d", n_name);
9907             printf(" %d", n_name2);
9908             printf(" %d", n_name3);
9909             printf(" %d", n_userdata);
9910             printf("\n");
9911         }
9912     }
9913     }
9914     }
9915     }
9916     }
9917     function_tests++;
9918
9919     return(test_ret);
9920 }
9921
9922
9923 static int
9924 test_xmlHashCopy(void) {
9925     int test_ret = 0;
9926
9927
9928     /* missing type support */
9929     return(test_ret);
9930 }
9931
9932
9933 static int
9934 test_xmlHashCreate(void) {
9935     int test_ret = 0;
9936
9937
9938     /* missing type support */
9939     return(test_ret);
9940 }
9941
9942
9943 static int
9944 test_xmlHashCreateDict(void) {
9945     int test_ret = 0;
9946
9947
9948     /* missing type support */
9949     return(test_ret);
9950 }
9951
9952
9953 static int
9954 test_xmlHashLookup(void) {
9955     int test_ret = 0;
9956
9957     int mem_base;
9958     void * ret_val;
9959     xmlHashTablePtr table; /* the hash table */
9960     int n_table;
9961     xmlChar * name; /* the name of the userdata */
9962     int n_name;
9963
9964     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9965     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9966         mem_base = xmlMemBlocks();
9967         table = gen_xmlHashTablePtr(n_table, 0);
9968         name = gen_const_xmlChar_ptr(n_name, 1);
9969
9970         ret_val = xmlHashLookup(table, (const xmlChar *)name);
9971         desret_void_ptr(ret_val);
9972         call_tests++;
9973         des_xmlHashTablePtr(n_table, table, 0);
9974         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9975         xmlResetLastError();
9976         if (mem_base != xmlMemBlocks()) {
9977             printf("Leak of %d blocks found in xmlHashLookup",
9978                    xmlMemBlocks() - mem_base);
9979             test_ret++;
9980             printf(" %d", n_table);
9981             printf(" %d", n_name);
9982             printf("\n");
9983         }
9984     }
9985     }
9986     function_tests++;
9987
9988     return(test_ret);
9989 }
9990
9991
9992 static int
9993 test_xmlHashLookup2(void) {
9994     int test_ret = 0;
9995
9996     int mem_base;
9997     void * ret_val;
9998     xmlHashTablePtr table; /* the hash table */
9999     int n_table;
10000     xmlChar * name; /* the name of the userdata */
10001     int n_name;
10002     xmlChar * name2; /* a second name of the userdata */
10003     int n_name2;
10004
10005     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10006     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10007     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10008         mem_base = xmlMemBlocks();
10009         table = gen_xmlHashTablePtr(n_table, 0);
10010         name = gen_const_xmlChar_ptr(n_name, 1);
10011         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10012
10013         ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
10014         desret_void_ptr(ret_val);
10015         call_tests++;
10016         des_xmlHashTablePtr(n_table, table, 0);
10017         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10018         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10019         xmlResetLastError();
10020         if (mem_base != xmlMemBlocks()) {
10021             printf("Leak of %d blocks found in xmlHashLookup2",
10022                    xmlMemBlocks() - mem_base);
10023             test_ret++;
10024             printf(" %d", n_table);
10025             printf(" %d", n_name);
10026             printf(" %d", n_name2);
10027             printf("\n");
10028         }
10029     }
10030     }
10031     }
10032     function_tests++;
10033
10034     return(test_ret);
10035 }
10036
10037
10038 static int
10039 test_xmlHashLookup3(void) {
10040     int test_ret = 0;
10041
10042     int mem_base;
10043     void * ret_val;
10044     xmlHashTablePtr table; /* the hash table */
10045     int n_table;
10046     xmlChar * name; /* the name of the userdata */
10047     int n_name;
10048     xmlChar * name2; /* a second name of the userdata */
10049     int n_name2;
10050     xmlChar * name3; /* a third name of the userdata */
10051     int n_name3;
10052
10053     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10054     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10055     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10056     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10057         mem_base = xmlMemBlocks();
10058         table = gen_xmlHashTablePtr(n_table, 0);
10059         name = gen_const_xmlChar_ptr(n_name, 1);
10060         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10061         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10062
10063         ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10064         desret_void_ptr(ret_val);
10065         call_tests++;
10066         des_xmlHashTablePtr(n_table, table, 0);
10067         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10068         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10069         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10070         xmlResetLastError();
10071         if (mem_base != xmlMemBlocks()) {
10072             printf("Leak of %d blocks found in xmlHashLookup3",
10073                    xmlMemBlocks() - mem_base);
10074             test_ret++;
10075             printf(" %d", n_table);
10076             printf(" %d", n_name);
10077             printf(" %d", n_name2);
10078             printf(" %d", n_name3);
10079             printf("\n");
10080         }
10081     }
10082     }
10083     }
10084     }
10085     function_tests++;
10086
10087     return(test_ret);
10088 }
10089
10090
10091 static int
10092 test_xmlHashQLookup(void) {
10093     int test_ret = 0;
10094
10095     int mem_base;
10096     void * ret_val;
10097     xmlHashTablePtr table; /* the hash table */
10098     int n_table;
10099     xmlChar * prefix; /* the prefix of the userdata */
10100     int n_prefix;
10101     xmlChar * name; /* the name of the userdata */
10102     int n_name;
10103
10104     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10105     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10106     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10107         mem_base = xmlMemBlocks();
10108         table = gen_xmlHashTablePtr(n_table, 0);
10109         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10110         name = gen_const_xmlChar_ptr(n_name, 2);
10111
10112         ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10113         desret_void_ptr(ret_val);
10114         call_tests++;
10115         des_xmlHashTablePtr(n_table, table, 0);
10116         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10117         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10118         xmlResetLastError();
10119         if (mem_base != xmlMemBlocks()) {
10120             printf("Leak of %d blocks found in xmlHashQLookup",
10121                    xmlMemBlocks() - mem_base);
10122             test_ret++;
10123             printf(" %d", n_table);
10124             printf(" %d", n_prefix);
10125             printf(" %d", n_name);
10126             printf("\n");
10127         }
10128     }
10129     }
10130     }
10131     function_tests++;
10132
10133     return(test_ret);
10134 }
10135
10136
10137 static int
10138 test_xmlHashQLookup2(void) {
10139     int test_ret = 0;
10140
10141     int mem_base;
10142     void * ret_val;
10143     xmlHashTablePtr table; /* the hash table */
10144     int n_table;
10145     xmlChar * prefix; /* the prefix of the userdata */
10146     int n_prefix;
10147     xmlChar * name; /* the name of the userdata */
10148     int n_name;
10149     xmlChar * prefix2; /* the second prefix of the userdata */
10150     int n_prefix2;
10151     xmlChar * name2; /* a second name of the userdata */
10152     int n_name2;
10153
10154     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10155     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10156     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10157     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10158     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10159         mem_base = xmlMemBlocks();
10160         table = gen_xmlHashTablePtr(n_table, 0);
10161         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10162         name = gen_const_xmlChar_ptr(n_name, 2);
10163         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10164         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10165
10166         ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10167         desret_void_ptr(ret_val);
10168         call_tests++;
10169         des_xmlHashTablePtr(n_table, table, 0);
10170         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10171         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10172         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10173         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10174         xmlResetLastError();
10175         if (mem_base != xmlMemBlocks()) {
10176             printf("Leak of %d blocks found in xmlHashQLookup2",
10177                    xmlMemBlocks() - mem_base);
10178             test_ret++;
10179             printf(" %d", n_table);
10180             printf(" %d", n_prefix);
10181             printf(" %d", n_name);
10182             printf(" %d", n_prefix2);
10183             printf(" %d", n_name2);
10184             printf("\n");
10185         }
10186     }
10187     }
10188     }
10189     }
10190     }
10191     function_tests++;
10192
10193     return(test_ret);
10194 }
10195
10196
10197 static int
10198 test_xmlHashQLookup3(void) {
10199     int test_ret = 0;
10200
10201     int mem_base;
10202     void * ret_val;
10203     xmlHashTablePtr table; /* the hash table */
10204     int n_table;
10205     xmlChar * prefix; /* the prefix of the userdata */
10206     int n_prefix;
10207     xmlChar * name; /* the name of the userdata */
10208     int n_name;
10209     xmlChar * prefix2; /* the second prefix of the userdata */
10210     int n_prefix2;
10211     xmlChar * name2; /* a second name of the userdata */
10212     int n_name2;
10213     xmlChar * prefix3; /* the third prefix of the userdata */
10214     int n_prefix3;
10215     xmlChar * name3; /* a third name of the userdata */
10216     int n_name3;
10217
10218     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10219     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10220     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10221     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10222     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10223     for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10224     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10225         mem_base = xmlMemBlocks();
10226         table = gen_xmlHashTablePtr(n_table, 0);
10227         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10228         name = gen_const_xmlChar_ptr(n_name, 2);
10229         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10230         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10231         prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10232         name3 = gen_const_xmlChar_ptr(n_name3, 6);
10233
10234         ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10235         desret_void_ptr(ret_val);
10236         call_tests++;
10237         des_xmlHashTablePtr(n_table, table, 0);
10238         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10239         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10240         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10241         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10242         des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10243         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10244         xmlResetLastError();
10245         if (mem_base != xmlMemBlocks()) {
10246             printf("Leak of %d blocks found in xmlHashQLookup3",
10247                    xmlMemBlocks() - mem_base);
10248             test_ret++;
10249             printf(" %d", n_table);
10250             printf(" %d", n_prefix);
10251             printf(" %d", n_name);
10252             printf(" %d", n_prefix2);
10253             printf(" %d", n_name2);
10254             printf(" %d", n_prefix3);
10255             printf(" %d", n_name3);
10256             printf("\n");
10257         }
10258     }
10259     }
10260     }
10261     }
10262     }
10263     }
10264     }
10265     function_tests++;
10266
10267     return(test_ret);
10268 }
10269
10270
10271 static int
10272 test_xmlHashRemoveEntry(void) {
10273     int test_ret = 0;
10274
10275     int mem_base;
10276     int ret_val;
10277     xmlHashTablePtr table; /* the hash table */
10278     int n_table;
10279     xmlChar * name; /* the name of the userdata */
10280     int n_name;
10281     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10282     int n_f;
10283
10284     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10285     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10286     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10287         mem_base = xmlMemBlocks();
10288         table = gen_xmlHashTablePtr(n_table, 0);
10289         name = gen_const_xmlChar_ptr(n_name, 1);
10290         f = gen_xmlHashDeallocator(n_f, 2);
10291
10292         ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10293         desret_int(ret_val);
10294         call_tests++;
10295         des_xmlHashTablePtr(n_table, table, 0);
10296         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10297         des_xmlHashDeallocator(n_f, f, 2);
10298         xmlResetLastError();
10299         if (mem_base != xmlMemBlocks()) {
10300             printf("Leak of %d blocks found in xmlHashRemoveEntry",
10301                    xmlMemBlocks() - mem_base);
10302             test_ret++;
10303             printf(" %d", n_table);
10304             printf(" %d", n_name);
10305             printf(" %d", n_f);
10306             printf("\n");
10307         }
10308     }
10309     }
10310     }
10311     function_tests++;
10312
10313     return(test_ret);
10314 }
10315
10316
10317 static int
10318 test_xmlHashRemoveEntry2(void) {
10319     int test_ret = 0;
10320
10321     int mem_base;
10322     int ret_val;
10323     xmlHashTablePtr table; /* the hash table */
10324     int n_table;
10325     xmlChar * name; /* the name of the userdata */
10326     int n_name;
10327     xmlChar * name2; /* a second name of the userdata */
10328     int n_name2;
10329     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10330     int n_f;
10331
10332     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10333     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10334     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10335     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10336         mem_base = xmlMemBlocks();
10337         table = gen_xmlHashTablePtr(n_table, 0);
10338         name = gen_const_xmlChar_ptr(n_name, 1);
10339         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10340         f = gen_xmlHashDeallocator(n_f, 3);
10341
10342         ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10343         desret_int(ret_val);
10344         call_tests++;
10345         des_xmlHashTablePtr(n_table, table, 0);
10346         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10347         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10348         des_xmlHashDeallocator(n_f, f, 3);
10349         xmlResetLastError();
10350         if (mem_base != xmlMemBlocks()) {
10351             printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10352                    xmlMemBlocks() - mem_base);
10353             test_ret++;
10354             printf(" %d", n_table);
10355             printf(" %d", n_name);
10356             printf(" %d", n_name2);
10357             printf(" %d", n_f);
10358             printf("\n");
10359         }
10360     }
10361     }
10362     }
10363     }
10364     function_tests++;
10365
10366     return(test_ret);
10367 }
10368
10369
10370 static int
10371 test_xmlHashRemoveEntry3(void) {
10372     int test_ret = 0;
10373
10374     int mem_base;
10375     int ret_val;
10376     xmlHashTablePtr table; /* the hash table */
10377     int n_table;
10378     xmlChar * name; /* the name of the userdata */
10379     int n_name;
10380     xmlChar * name2; /* a second name of the userdata */
10381     int n_name2;
10382     xmlChar * name3; /* a third name of the userdata */
10383     int n_name3;
10384     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10385     int n_f;
10386
10387     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10388     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10389     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10390     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10391     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10392         mem_base = xmlMemBlocks();
10393         table = gen_xmlHashTablePtr(n_table, 0);
10394         name = gen_const_xmlChar_ptr(n_name, 1);
10395         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10396         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10397         f = gen_xmlHashDeallocator(n_f, 4);
10398
10399         ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10400         desret_int(ret_val);
10401         call_tests++;
10402         des_xmlHashTablePtr(n_table, table, 0);
10403         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10404         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10405         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10406         des_xmlHashDeallocator(n_f, f, 4);
10407         xmlResetLastError();
10408         if (mem_base != xmlMemBlocks()) {
10409             printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10410                    xmlMemBlocks() - mem_base);
10411             test_ret++;
10412             printf(" %d", n_table);
10413             printf(" %d", n_name);
10414             printf(" %d", n_name2);
10415             printf(" %d", n_name3);
10416             printf(" %d", n_f);
10417             printf("\n");
10418         }
10419     }
10420     }
10421     }
10422     }
10423     }
10424     function_tests++;
10425
10426     return(test_ret);
10427 }
10428
10429
10430 static int
10431 test_xmlHashScan(void) {
10432     int test_ret = 0;
10433
10434
10435     /* missing type support */
10436     return(test_ret);
10437 }
10438
10439
10440 static int
10441 test_xmlHashScan3(void) {
10442     int test_ret = 0;
10443
10444
10445     /* missing type support */
10446     return(test_ret);
10447 }
10448
10449
10450 static int
10451 test_xmlHashScanFull(void) {
10452     int test_ret = 0;
10453
10454
10455     /* missing type support */
10456     return(test_ret);
10457 }
10458
10459
10460 static int
10461 test_xmlHashScanFull3(void) {
10462     int test_ret = 0;
10463
10464
10465     /* missing type support */
10466     return(test_ret);
10467 }
10468
10469
10470 static int
10471 test_xmlHashSize(void) {
10472     int test_ret = 0;
10473
10474     int mem_base;
10475     int ret_val;
10476     xmlHashTablePtr table; /* the hash table */
10477     int n_table;
10478
10479     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10480         mem_base = xmlMemBlocks();
10481         table = gen_xmlHashTablePtr(n_table, 0);
10482
10483         ret_val = xmlHashSize(table);
10484         desret_int(ret_val);
10485         call_tests++;
10486         des_xmlHashTablePtr(n_table, table, 0);
10487         xmlResetLastError();
10488         if (mem_base != xmlMemBlocks()) {
10489             printf("Leak of %d blocks found in xmlHashSize",
10490                    xmlMemBlocks() - mem_base);
10491             test_ret++;
10492             printf(" %d", n_table);
10493             printf("\n");
10494         }
10495     }
10496     function_tests++;
10497
10498     return(test_ret);
10499 }
10500
10501
10502 static int
10503 test_xmlHashUpdateEntry(void) {
10504     int test_ret = 0;
10505
10506     int mem_base;
10507     int ret_val;
10508     xmlHashTablePtr table; /* the hash table */
10509     int n_table;
10510     xmlChar * name; /* the name of the userdata */
10511     int n_name;
10512     void * userdata; /* a pointer to the userdata */
10513     int n_userdata;
10514     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10515     int n_f;
10516
10517     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10518     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10519     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10520     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10521         mem_base = xmlMemBlocks();
10522         table = gen_xmlHashTablePtr(n_table, 0);
10523         name = gen_const_xmlChar_ptr(n_name, 1);
10524         userdata = gen_userdata(n_userdata, 2);
10525         f = gen_xmlHashDeallocator(n_f, 3);
10526
10527         ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10528         desret_int(ret_val);
10529         call_tests++;
10530         des_xmlHashTablePtr(n_table, table, 0);
10531         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10532         des_userdata(n_userdata, userdata, 2);
10533         des_xmlHashDeallocator(n_f, f, 3);
10534         xmlResetLastError();
10535         if (mem_base != xmlMemBlocks()) {
10536             printf("Leak of %d blocks found in xmlHashUpdateEntry",
10537                    xmlMemBlocks() - mem_base);
10538             test_ret++;
10539             printf(" %d", n_table);
10540             printf(" %d", n_name);
10541             printf(" %d", n_userdata);
10542             printf(" %d", n_f);
10543             printf("\n");
10544         }
10545     }
10546     }
10547     }
10548     }
10549     function_tests++;
10550
10551     return(test_ret);
10552 }
10553
10554
10555 static int
10556 test_xmlHashUpdateEntry2(void) {
10557     int test_ret = 0;
10558
10559     int mem_base;
10560     int ret_val;
10561     xmlHashTablePtr table; /* the hash table */
10562     int n_table;
10563     xmlChar * name; /* the name of the userdata */
10564     int n_name;
10565     xmlChar * name2; /* a second name of the userdata */
10566     int n_name2;
10567     void * userdata; /* a pointer to the userdata */
10568     int n_userdata;
10569     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10570     int n_f;
10571
10572     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10573     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10574     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10575     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10576     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10577         mem_base = xmlMemBlocks();
10578         table = gen_xmlHashTablePtr(n_table, 0);
10579         name = gen_const_xmlChar_ptr(n_name, 1);
10580         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10581         userdata = gen_userdata(n_userdata, 3);
10582         f = gen_xmlHashDeallocator(n_f, 4);
10583
10584         ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10585         desret_int(ret_val);
10586         call_tests++;
10587         des_xmlHashTablePtr(n_table, table, 0);
10588         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10589         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10590         des_userdata(n_userdata, userdata, 3);
10591         des_xmlHashDeallocator(n_f, f, 4);
10592         xmlResetLastError();
10593         if (mem_base != xmlMemBlocks()) {
10594             printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10595                    xmlMemBlocks() - mem_base);
10596             test_ret++;
10597             printf(" %d", n_table);
10598             printf(" %d", n_name);
10599             printf(" %d", n_name2);
10600             printf(" %d", n_userdata);
10601             printf(" %d", n_f);
10602             printf("\n");
10603         }
10604     }
10605     }
10606     }
10607     }
10608     }
10609     function_tests++;
10610
10611     return(test_ret);
10612 }
10613
10614
10615 static int
10616 test_xmlHashUpdateEntry3(void) {
10617     int test_ret = 0;
10618
10619     int mem_base;
10620     int ret_val;
10621     xmlHashTablePtr table; /* the hash table */
10622     int n_table;
10623     xmlChar * name; /* the name of the userdata */
10624     int n_name;
10625     xmlChar * name2; /* a second name of the userdata */
10626     int n_name2;
10627     xmlChar * name3; /* a third name of the userdata */
10628     int n_name3;
10629     void * userdata; /* a pointer to the userdata */
10630     int n_userdata;
10631     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10632     int n_f;
10633
10634     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10635     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10636     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10637     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10638     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10639     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10640         mem_base = xmlMemBlocks();
10641         table = gen_xmlHashTablePtr(n_table, 0);
10642         name = gen_const_xmlChar_ptr(n_name, 1);
10643         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10644         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10645         userdata = gen_userdata(n_userdata, 4);
10646         f = gen_xmlHashDeallocator(n_f, 5);
10647
10648         ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10649         desret_int(ret_val);
10650         call_tests++;
10651         des_xmlHashTablePtr(n_table, table, 0);
10652         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10653         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10654         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10655         des_userdata(n_userdata, userdata, 4);
10656         des_xmlHashDeallocator(n_f, f, 5);
10657         xmlResetLastError();
10658         if (mem_base != xmlMemBlocks()) {
10659             printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10660                    xmlMemBlocks() - mem_base);
10661             test_ret++;
10662             printf(" %d", n_table);
10663             printf(" %d", n_name);
10664             printf(" %d", n_name2);
10665             printf(" %d", n_name3);
10666             printf(" %d", n_userdata);
10667             printf(" %d", n_f);
10668             printf("\n");
10669         }
10670     }
10671     }
10672     }
10673     }
10674     }
10675     }
10676     function_tests++;
10677
10678     return(test_ret);
10679 }
10680
10681 static int
10682 test_hash(void) {
10683     int test_ret = 0;
10684
10685     if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10686     test_ret += test_xmlHashAddEntry();
10687     test_ret += test_xmlHashAddEntry2();
10688     test_ret += test_xmlHashAddEntry3();
10689     test_ret += test_xmlHashCopy();
10690     test_ret += test_xmlHashCreate();
10691     test_ret += test_xmlHashCreateDict();
10692     test_ret += test_xmlHashLookup();
10693     test_ret += test_xmlHashLookup2();
10694     test_ret += test_xmlHashLookup3();
10695     test_ret += test_xmlHashQLookup();
10696     test_ret += test_xmlHashQLookup2();
10697     test_ret += test_xmlHashQLookup3();
10698     test_ret += test_xmlHashRemoveEntry();
10699     test_ret += test_xmlHashRemoveEntry2();
10700     test_ret += test_xmlHashRemoveEntry3();
10701     test_ret += test_xmlHashScan();
10702     test_ret += test_xmlHashScan3();
10703     test_ret += test_xmlHashScanFull();
10704     test_ret += test_xmlHashScanFull3();
10705     test_ret += test_xmlHashSize();
10706     test_ret += test_xmlHashUpdateEntry();
10707     test_ret += test_xmlHashUpdateEntry2();
10708     test_ret += test_xmlHashUpdateEntry3();
10709
10710     if (test_ret != 0)
10711         printf("Module hash: %d errors\n", test_ret);
10712     return(test_ret);
10713 }
10714
10715 #define gen_nb_xmlLinkPtr 1
10716 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10717     return(NULL);
10718 }
10719 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10720 }
10721
10722 static int
10723 test_xmlLinkGetData(void) {
10724     int test_ret = 0;
10725
10726     int mem_base;
10727     void * ret_val;
10728     xmlLinkPtr lk; /* a link */
10729     int n_lk;
10730
10731     for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10732         mem_base = xmlMemBlocks();
10733         lk = gen_xmlLinkPtr(n_lk, 0);
10734
10735         ret_val = xmlLinkGetData(lk);
10736         desret_void_ptr(ret_val);
10737         call_tests++;
10738         des_xmlLinkPtr(n_lk, lk, 0);
10739         xmlResetLastError();
10740         if (mem_base != xmlMemBlocks()) {
10741             printf("Leak of %d blocks found in xmlLinkGetData",
10742                    xmlMemBlocks() - mem_base);
10743             test_ret++;
10744             printf(" %d", n_lk);
10745             printf("\n");
10746         }
10747     }
10748     function_tests++;
10749
10750     return(test_ret);
10751 }
10752
10753
10754 static int
10755 test_xmlListAppend(void) {
10756     int test_ret = 0;
10757
10758     int mem_base;
10759     int ret_val;
10760     xmlListPtr l; /* a list */
10761     int n_l;
10762     void * data; /* the data */
10763     int n_data;
10764
10765     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10766     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10767         mem_base = xmlMemBlocks();
10768         l = gen_xmlListPtr(n_l, 0);
10769         data = gen_userdata(n_data, 1);
10770
10771         ret_val = xmlListAppend(l, data);
10772         desret_int(ret_val);
10773         call_tests++;
10774         des_xmlListPtr(n_l, l, 0);
10775         des_userdata(n_data, data, 1);
10776         xmlResetLastError();
10777         if (mem_base != xmlMemBlocks()) {
10778             printf("Leak of %d blocks found in xmlListAppend",
10779                    xmlMemBlocks() - mem_base);
10780             test_ret++;
10781             printf(" %d", n_l);
10782             printf(" %d", n_data);
10783             printf("\n");
10784         }
10785     }
10786     }
10787     function_tests++;
10788
10789     return(test_ret);
10790 }
10791
10792
10793 static int
10794 test_xmlListClear(void) {
10795     int test_ret = 0;
10796
10797     int mem_base;
10798     xmlListPtr l; /* a list */
10799     int n_l;
10800
10801     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10802         mem_base = xmlMemBlocks();
10803         l = gen_xmlListPtr(n_l, 0);
10804
10805         xmlListClear(l);
10806         call_tests++;
10807         des_xmlListPtr(n_l, l, 0);
10808         xmlResetLastError();
10809         if (mem_base != xmlMemBlocks()) {
10810             printf("Leak of %d blocks found in xmlListClear",
10811                    xmlMemBlocks() - mem_base);
10812             test_ret++;
10813             printf(" %d", n_l);
10814             printf("\n");
10815         }
10816     }
10817     function_tests++;
10818
10819     return(test_ret);
10820 }
10821
10822
10823 #define gen_nb_const_xmlListPtr 1
10824 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10825     return(NULL);
10826 }
10827 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10828 }
10829
10830 static int
10831 test_xmlListCopy(void) {
10832     int test_ret = 0;
10833
10834     int mem_base;
10835     int ret_val;
10836     xmlListPtr cur; /* the new list */
10837     int n_cur;
10838     xmlListPtr old; /* the old list */
10839     int n_old;
10840
10841     for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10842     for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10843         mem_base = xmlMemBlocks();
10844         cur = gen_xmlListPtr(n_cur, 0);
10845         old = gen_const_xmlListPtr(n_old, 1);
10846
10847         ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10848         desret_int(ret_val);
10849         call_tests++;
10850         des_xmlListPtr(n_cur, cur, 0);
10851         des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10852         xmlResetLastError();
10853         if (mem_base != xmlMemBlocks()) {
10854             printf("Leak of %d blocks found in xmlListCopy",
10855                    xmlMemBlocks() - mem_base);
10856             test_ret++;
10857             printf(" %d", n_cur);
10858             printf(" %d", n_old);
10859             printf("\n");
10860         }
10861     }
10862     }
10863     function_tests++;
10864
10865     return(test_ret);
10866 }
10867
10868
10869 static int
10870 test_xmlListCreate(void) {
10871     int test_ret = 0;
10872
10873
10874     /* missing type support */
10875     return(test_ret);
10876 }
10877
10878
10879 static int
10880 test_xmlListDup(void) {
10881     int test_ret = 0;
10882
10883
10884     /* missing type support */
10885     return(test_ret);
10886 }
10887
10888
10889 static int
10890 test_xmlListEmpty(void) {
10891     int test_ret = 0;
10892
10893     int mem_base;
10894     int ret_val;
10895     xmlListPtr l; /* a list */
10896     int n_l;
10897
10898     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10899         mem_base = xmlMemBlocks();
10900         l = gen_xmlListPtr(n_l, 0);
10901
10902         ret_val = xmlListEmpty(l);
10903         desret_int(ret_val);
10904         call_tests++;
10905         des_xmlListPtr(n_l, l, 0);
10906         xmlResetLastError();
10907         if (mem_base != xmlMemBlocks()) {
10908             printf("Leak of %d blocks found in xmlListEmpty",
10909                    xmlMemBlocks() - mem_base);
10910             test_ret++;
10911             printf(" %d", n_l);
10912             printf("\n");
10913         }
10914     }
10915     function_tests++;
10916
10917     return(test_ret);
10918 }
10919
10920
10921 static int
10922 test_xmlListEnd(void) {
10923     int test_ret = 0;
10924
10925
10926     /* missing type support */
10927     return(test_ret);
10928 }
10929
10930
10931 static int
10932 test_xmlListFront(void) {
10933     int test_ret = 0;
10934
10935
10936     /* missing type support */
10937     return(test_ret);
10938 }
10939
10940
10941 static int
10942 test_xmlListInsert(void) {
10943     int test_ret = 0;
10944
10945     int mem_base;
10946     int ret_val;
10947     xmlListPtr l; /* a list */
10948     int n_l;
10949     void * data; /* the data */
10950     int n_data;
10951
10952     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10953     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10954         mem_base = xmlMemBlocks();
10955         l = gen_xmlListPtr(n_l, 0);
10956         data = gen_userdata(n_data, 1);
10957
10958         ret_val = xmlListInsert(l, data);
10959         desret_int(ret_val);
10960         call_tests++;
10961         des_xmlListPtr(n_l, l, 0);
10962         des_userdata(n_data, data, 1);
10963         xmlResetLastError();
10964         if (mem_base != xmlMemBlocks()) {
10965             printf("Leak of %d blocks found in xmlListInsert",
10966                    xmlMemBlocks() - mem_base);
10967             test_ret++;
10968             printf(" %d", n_l);
10969             printf(" %d", n_data);
10970             printf("\n");
10971         }
10972     }
10973     }
10974     function_tests++;
10975
10976     return(test_ret);
10977 }
10978
10979
10980 static int
10981 test_xmlListMerge(void) {
10982     int test_ret = 0;
10983
10984     int mem_base;
10985     xmlListPtr l1; /* the original list */
10986     int n_l1;
10987     xmlListPtr l2; /* the new list */
10988     int n_l2;
10989
10990     for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10991     for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10992         mem_base = xmlMemBlocks();
10993         l1 = gen_xmlListPtr(n_l1, 0);
10994         l2 = gen_xmlListPtr(n_l2, 1);
10995
10996         xmlListMerge(l1, l2);
10997         call_tests++;
10998         des_xmlListPtr(n_l1, l1, 0);
10999         des_xmlListPtr(n_l2, l2, 1);
11000         xmlResetLastError();
11001         if (mem_base != xmlMemBlocks()) {
11002             printf("Leak of %d blocks found in xmlListMerge",
11003                    xmlMemBlocks() - mem_base);
11004             test_ret++;
11005             printf(" %d", n_l1);
11006             printf(" %d", n_l2);
11007             printf("\n");
11008         }
11009     }
11010     }
11011     function_tests++;
11012
11013     return(test_ret);
11014 }
11015
11016
11017 static int
11018 test_xmlListPopBack(void) {
11019     int test_ret = 0;
11020
11021     int mem_base;
11022     xmlListPtr l; /* a list */
11023     int n_l;
11024
11025     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11026         mem_base = xmlMemBlocks();
11027         l = gen_xmlListPtr(n_l, 0);
11028
11029         xmlListPopBack(l);
11030         call_tests++;
11031         des_xmlListPtr(n_l, l, 0);
11032         xmlResetLastError();
11033         if (mem_base != xmlMemBlocks()) {
11034             printf("Leak of %d blocks found in xmlListPopBack",
11035                    xmlMemBlocks() - mem_base);
11036             test_ret++;
11037             printf(" %d", n_l);
11038             printf("\n");
11039         }
11040     }
11041     function_tests++;
11042
11043     return(test_ret);
11044 }
11045
11046
11047 static int
11048 test_xmlListPopFront(void) {
11049     int test_ret = 0;
11050
11051     int mem_base;
11052     xmlListPtr l; /* a list */
11053     int n_l;
11054
11055     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11056         mem_base = xmlMemBlocks();
11057         l = gen_xmlListPtr(n_l, 0);
11058
11059         xmlListPopFront(l);
11060         call_tests++;
11061         des_xmlListPtr(n_l, l, 0);
11062         xmlResetLastError();
11063         if (mem_base != xmlMemBlocks()) {
11064             printf("Leak of %d blocks found in xmlListPopFront",
11065                    xmlMemBlocks() - mem_base);
11066             test_ret++;
11067             printf(" %d", n_l);
11068             printf("\n");
11069         }
11070     }
11071     function_tests++;
11072
11073     return(test_ret);
11074 }
11075
11076
11077 static int
11078 test_xmlListPushBack(void) {
11079     int test_ret = 0;
11080
11081     int mem_base;
11082     int ret_val;
11083     xmlListPtr l; /* a list */
11084     int n_l;
11085     void * data; /* new data */
11086     int n_data;
11087
11088     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11089     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11090         mem_base = xmlMemBlocks();
11091         l = gen_xmlListPtr(n_l, 0);
11092         data = gen_userdata(n_data, 1);
11093
11094         ret_val = xmlListPushBack(l, data);
11095         desret_int(ret_val);
11096         call_tests++;
11097         des_xmlListPtr(n_l, l, 0);
11098         des_userdata(n_data, data, 1);
11099         xmlResetLastError();
11100         if (mem_base != xmlMemBlocks()) {
11101             printf("Leak of %d blocks found in xmlListPushBack",
11102                    xmlMemBlocks() - mem_base);
11103             test_ret++;
11104             printf(" %d", n_l);
11105             printf(" %d", n_data);
11106             printf("\n");
11107         }
11108     }
11109     }
11110     function_tests++;
11111
11112     return(test_ret);
11113 }
11114
11115
11116 static int
11117 test_xmlListPushFront(void) {
11118     int test_ret = 0;
11119
11120     int mem_base;
11121     int ret_val;
11122     xmlListPtr l; /* a list */
11123     int n_l;
11124     void * data; /* new data */
11125     int n_data;
11126
11127     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11128     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11129         mem_base = xmlMemBlocks();
11130         l = gen_xmlListPtr(n_l, 0);
11131         data = gen_userdata(n_data, 1);
11132
11133         ret_val = xmlListPushFront(l, data);
11134         desret_int(ret_val);
11135         call_tests++;
11136         des_xmlListPtr(n_l, l, 0);
11137         des_userdata(n_data, data, 1);
11138         xmlResetLastError();
11139         if (mem_base != xmlMemBlocks()) {
11140             printf("Leak of %d blocks found in xmlListPushFront",
11141                    xmlMemBlocks() - mem_base);
11142             test_ret++;
11143             printf(" %d", n_l);
11144             printf(" %d", n_data);
11145             printf("\n");
11146         }
11147     }
11148     }
11149     function_tests++;
11150
11151     return(test_ret);
11152 }
11153
11154
11155 static int
11156 test_xmlListRemoveAll(void) {
11157     int test_ret = 0;
11158
11159     int mem_base;
11160     int ret_val;
11161     xmlListPtr l; /* a list */
11162     int n_l;
11163     void * data; /* list data */
11164     int n_data;
11165
11166     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11167     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11168         mem_base = xmlMemBlocks();
11169         l = gen_xmlListPtr(n_l, 0);
11170         data = gen_userdata(n_data, 1);
11171
11172         ret_val = xmlListRemoveAll(l, data);
11173         desret_int(ret_val);
11174         call_tests++;
11175         des_xmlListPtr(n_l, l, 0);
11176         des_userdata(n_data, data, 1);
11177         xmlResetLastError();
11178         if (mem_base != xmlMemBlocks()) {
11179             printf("Leak of %d blocks found in xmlListRemoveAll",
11180                    xmlMemBlocks() - mem_base);
11181             test_ret++;
11182             printf(" %d", n_l);
11183             printf(" %d", n_data);
11184             printf("\n");
11185         }
11186     }
11187     }
11188     function_tests++;
11189
11190     return(test_ret);
11191 }
11192
11193
11194 static int
11195 test_xmlListRemoveFirst(void) {
11196     int test_ret = 0;
11197
11198     int mem_base;
11199     int ret_val;
11200     xmlListPtr l; /* a list */
11201     int n_l;
11202     void * data; /* list data */
11203     int n_data;
11204
11205     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11206     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11207         mem_base = xmlMemBlocks();
11208         l = gen_xmlListPtr(n_l, 0);
11209         data = gen_userdata(n_data, 1);
11210
11211         ret_val = xmlListRemoveFirst(l, data);
11212         desret_int(ret_val);
11213         call_tests++;
11214         des_xmlListPtr(n_l, l, 0);
11215         des_userdata(n_data, data, 1);
11216         xmlResetLastError();
11217         if (mem_base != xmlMemBlocks()) {
11218             printf("Leak of %d blocks found in xmlListRemoveFirst",
11219                    xmlMemBlocks() - mem_base);
11220             test_ret++;
11221             printf(" %d", n_l);
11222             printf(" %d", n_data);
11223             printf("\n");
11224         }
11225     }
11226     }
11227     function_tests++;
11228
11229     return(test_ret);
11230 }
11231
11232
11233 static int
11234 test_xmlListRemoveLast(void) {
11235     int test_ret = 0;
11236
11237     int mem_base;
11238     int ret_val;
11239     xmlListPtr l; /* a list */
11240     int n_l;
11241     void * data; /* list data */
11242     int n_data;
11243
11244     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11245     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11246         mem_base = xmlMemBlocks();
11247         l = gen_xmlListPtr(n_l, 0);
11248         data = gen_userdata(n_data, 1);
11249
11250         ret_val = xmlListRemoveLast(l, data);
11251         desret_int(ret_val);
11252         call_tests++;
11253         des_xmlListPtr(n_l, l, 0);
11254         des_userdata(n_data, data, 1);
11255         xmlResetLastError();
11256         if (mem_base != xmlMemBlocks()) {
11257             printf("Leak of %d blocks found in xmlListRemoveLast",
11258                    xmlMemBlocks() - mem_base);
11259             test_ret++;
11260             printf(" %d", n_l);
11261             printf(" %d", n_data);
11262             printf("\n");
11263         }
11264     }
11265     }
11266     function_tests++;
11267
11268     return(test_ret);
11269 }
11270
11271
11272 static int
11273 test_xmlListReverse(void) {
11274     int test_ret = 0;
11275
11276     int mem_base;
11277     xmlListPtr l; /* a list */
11278     int n_l;
11279
11280     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11281         mem_base = xmlMemBlocks();
11282         l = gen_xmlListPtr(n_l, 0);
11283
11284         xmlListReverse(l);
11285         call_tests++;
11286         des_xmlListPtr(n_l, l, 0);
11287         xmlResetLastError();
11288         if (mem_base != xmlMemBlocks()) {
11289             printf("Leak of %d blocks found in xmlListReverse",
11290                    xmlMemBlocks() - mem_base);
11291             test_ret++;
11292             printf(" %d", n_l);
11293             printf("\n");
11294         }
11295     }
11296     function_tests++;
11297
11298     return(test_ret);
11299 }
11300
11301
11302 static int
11303 test_xmlListReverseSearch(void) {
11304     int test_ret = 0;
11305
11306     int mem_base;
11307     void * ret_val;
11308     xmlListPtr l; /* a list */
11309     int n_l;
11310     void * data; /* a search value */
11311     int n_data;
11312
11313     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11314     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11315         mem_base = xmlMemBlocks();
11316         l = gen_xmlListPtr(n_l, 0);
11317         data = gen_userdata(n_data, 1);
11318
11319         ret_val = xmlListReverseSearch(l, data);
11320         desret_void_ptr(ret_val);
11321         call_tests++;
11322         des_xmlListPtr(n_l, l, 0);
11323         des_userdata(n_data, data, 1);
11324         xmlResetLastError();
11325         if (mem_base != xmlMemBlocks()) {
11326             printf("Leak of %d blocks found in xmlListReverseSearch",
11327                    xmlMemBlocks() - mem_base);
11328             test_ret++;
11329             printf(" %d", n_l);
11330             printf(" %d", n_data);
11331             printf("\n");
11332         }
11333     }
11334     }
11335     function_tests++;
11336
11337     return(test_ret);
11338 }
11339
11340
11341 static int
11342 test_xmlListReverseWalk(void) {
11343     int test_ret = 0;
11344
11345
11346     /* missing type support */
11347     return(test_ret);
11348 }
11349
11350
11351 static int
11352 test_xmlListSearch(void) {
11353     int test_ret = 0;
11354
11355     int mem_base;
11356     void * ret_val;
11357     xmlListPtr l; /* a list */
11358     int n_l;
11359     void * data; /* a search value */
11360     int n_data;
11361
11362     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11363     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11364         mem_base = xmlMemBlocks();
11365         l = gen_xmlListPtr(n_l, 0);
11366         data = gen_userdata(n_data, 1);
11367
11368         ret_val = xmlListSearch(l, data);
11369         desret_void_ptr(ret_val);
11370         call_tests++;
11371         des_xmlListPtr(n_l, l, 0);
11372         des_userdata(n_data, data, 1);
11373         xmlResetLastError();
11374         if (mem_base != xmlMemBlocks()) {
11375             printf("Leak of %d blocks found in xmlListSearch",
11376                    xmlMemBlocks() - mem_base);
11377             test_ret++;
11378             printf(" %d", n_l);
11379             printf(" %d", n_data);
11380             printf("\n");
11381         }
11382     }
11383     }
11384     function_tests++;
11385
11386     return(test_ret);
11387 }
11388
11389
11390 static int
11391 test_xmlListSize(void) {
11392     int test_ret = 0;
11393
11394     int mem_base;
11395     int ret_val;
11396     xmlListPtr l; /* a list */
11397     int n_l;
11398
11399     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11400         mem_base = xmlMemBlocks();
11401         l = gen_xmlListPtr(n_l, 0);
11402
11403         ret_val = xmlListSize(l);
11404         desret_int(ret_val);
11405         call_tests++;
11406         des_xmlListPtr(n_l, l, 0);
11407         xmlResetLastError();
11408         if (mem_base != xmlMemBlocks()) {
11409             printf("Leak of %d blocks found in xmlListSize",
11410                    xmlMemBlocks() - mem_base);
11411             test_ret++;
11412             printf(" %d", n_l);
11413             printf("\n");
11414         }
11415     }
11416     function_tests++;
11417
11418     return(test_ret);
11419 }
11420
11421
11422 static int
11423 test_xmlListSort(void) {
11424     int test_ret = 0;
11425
11426     int mem_base;
11427     xmlListPtr l; /* a list */
11428     int n_l;
11429
11430     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11431         mem_base = xmlMemBlocks();
11432         l = gen_xmlListPtr(n_l, 0);
11433
11434         xmlListSort(l);
11435         call_tests++;
11436         des_xmlListPtr(n_l, l, 0);
11437         xmlResetLastError();
11438         if (mem_base != xmlMemBlocks()) {
11439             printf("Leak of %d blocks found in xmlListSort",
11440                    xmlMemBlocks() - mem_base);
11441             test_ret++;
11442             printf(" %d", n_l);
11443             printf("\n");
11444         }
11445     }
11446     function_tests++;
11447
11448     return(test_ret);
11449 }
11450
11451
11452 static int
11453 test_xmlListWalk(void) {
11454     int test_ret = 0;
11455
11456
11457     /* missing type support */
11458     return(test_ret);
11459 }
11460
11461 static int
11462 test_list(void) {
11463     int test_ret = 0;
11464
11465     if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11466     test_ret += test_xmlLinkGetData();
11467     test_ret += test_xmlListAppend();
11468     test_ret += test_xmlListClear();
11469     test_ret += test_xmlListCopy();
11470     test_ret += test_xmlListCreate();
11471     test_ret += test_xmlListDup();
11472     test_ret += test_xmlListEmpty();
11473     test_ret += test_xmlListEnd();
11474     test_ret += test_xmlListFront();
11475     test_ret += test_xmlListInsert();
11476     test_ret += test_xmlListMerge();
11477     test_ret += test_xmlListPopBack();
11478     test_ret += test_xmlListPopFront();
11479     test_ret += test_xmlListPushBack();
11480     test_ret += test_xmlListPushFront();
11481     test_ret += test_xmlListRemoveAll();
11482     test_ret += test_xmlListRemoveFirst();
11483     test_ret += test_xmlListRemoveLast();
11484     test_ret += test_xmlListReverse();
11485     test_ret += test_xmlListReverseSearch();
11486     test_ret += test_xmlListReverseWalk();
11487     test_ret += test_xmlListSearch();
11488     test_ret += test_xmlListSize();
11489     test_ret += test_xmlListSort();
11490     test_ret += test_xmlListWalk();
11491
11492     if (test_ret != 0)
11493         printf("Module list: %d errors\n", test_ret);
11494     return(test_ret);
11495 }
11496
11497 static int
11498 test_xmlNanoFTPCheckResponse(void) {
11499     int test_ret = 0;
11500
11501 #if defined(LIBXML_FTP_ENABLED)
11502     int mem_base;
11503     int ret_val;
11504     void * ctx; /* an FTP context */
11505     int n_ctx;
11506
11507     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11508         mem_base = xmlMemBlocks();
11509         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11510
11511         ret_val = xmlNanoFTPCheckResponse(ctx);
11512         desret_int(ret_val);
11513         call_tests++;
11514         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11515         xmlResetLastError();
11516         if (mem_base != xmlMemBlocks()) {
11517             printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11518                    xmlMemBlocks() - mem_base);
11519             test_ret++;
11520             printf(" %d", n_ctx);
11521             printf("\n");
11522         }
11523     }
11524     function_tests++;
11525 #endif
11526
11527     return(test_ret);
11528 }
11529
11530
11531 static int
11532 test_xmlNanoFTPCleanup(void) {
11533     int test_ret = 0;
11534
11535 #if defined(LIBXML_FTP_ENABLED)
11536     int mem_base;
11537
11538         mem_base = xmlMemBlocks();
11539
11540         xmlNanoFTPCleanup();
11541         call_tests++;
11542         xmlResetLastError();
11543         if (mem_base != xmlMemBlocks()) {
11544             printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11545                    xmlMemBlocks() - mem_base);
11546             test_ret++;
11547             printf("\n");
11548         }
11549     function_tests++;
11550 #endif
11551
11552     return(test_ret);
11553 }
11554
11555
11556 static int
11557 test_xmlNanoFTPCloseConnection(void) {
11558     int test_ret = 0;
11559
11560 #if defined(LIBXML_FTP_ENABLED)
11561     int mem_base;
11562     int ret_val;
11563     void * ctx; /* an FTP context */
11564     int n_ctx;
11565
11566     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11567         mem_base = xmlMemBlocks();
11568         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11569
11570         ret_val = xmlNanoFTPCloseConnection(ctx);
11571         desret_int(ret_val);
11572         call_tests++;
11573         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11574         xmlResetLastError();
11575         if (mem_base != xmlMemBlocks()) {
11576             printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11577                    xmlMemBlocks() - mem_base);
11578             test_ret++;
11579             printf(" %d", n_ctx);
11580             printf("\n");
11581         }
11582     }
11583     function_tests++;
11584 #endif
11585
11586     return(test_ret);
11587 }
11588
11589
11590 static int
11591 test_xmlNanoFTPCwd(void) {
11592     int test_ret = 0;
11593
11594 #if defined(LIBXML_FTP_ENABLED)
11595     int mem_base;
11596     int ret_val;
11597     void * ctx; /* an FTP context */
11598     int n_ctx;
11599     char * directory; /* a directory on the server */
11600     int n_directory;
11601
11602     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11603     for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11604         mem_base = xmlMemBlocks();
11605         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11606         directory = gen_const_char_ptr(n_directory, 1);
11607
11608         ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11609         desret_int(ret_val);
11610         call_tests++;
11611         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11612         des_const_char_ptr(n_directory, (const char *)directory, 1);
11613         xmlResetLastError();
11614         if (mem_base != xmlMemBlocks()) {
11615             printf("Leak of %d blocks found in xmlNanoFTPCwd",
11616                    xmlMemBlocks() - mem_base);
11617             test_ret++;
11618             printf(" %d", n_ctx);
11619             printf(" %d", n_directory);
11620             printf("\n");
11621         }
11622     }
11623     }
11624     function_tests++;
11625 #endif
11626
11627     return(test_ret);
11628 }
11629
11630
11631 static int
11632 test_xmlNanoFTPDele(void) {
11633     int test_ret = 0;
11634
11635 #if defined(LIBXML_FTP_ENABLED)
11636     int mem_base;
11637     int ret_val;
11638     void * ctx; /* an FTP context */
11639     int n_ctx;
11640     const char * file; /* a file or directory on the server */
11641     int n_file;
11642
11643     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11644     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11645         mem_base = xmlMemBlocks();
11646         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11647         file = gen_filepath(n_file, 1);
11648
11649         ret_val = xmlNanoFTPDele(ctx, file);
11650         desret_int(ret_val);
11651         call_tests++;
11652         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11653         des_filepath(n_file, file, 1);
11654         xmlResetLastError();
11655         if (mem_base != xmlMemBlocks()) {
11656             printf("Leak of %d blocks found in xmlNanoFTPDele",
11657                    xmlMemBlocks() - mem_base);
11658             test_ret++;
11659             printf(" %d", n_ctx);
11660             printf(" %d", n_file);
11661             printf("\n");
11662         }
11663     }
11664     }
11665     function_tests++;
11666 #endif
11667
11668     return(test_ret);
11669 }
11670
11671
11672 static int
11673 test_xmlNanoFTPGet(void) {
11674     int test_ret = 0;
11675
11676
11677     /* missing type support */
11678     return(test_ret);
11679 }
11680
11681
11682 static int
11683 test_xmlNanoFTPGetConnection(void) {
11684     int test_ret = 0;
11685
11686
11687     /* missing type support */
11688     return(test_ret);
11689 }
11690
11691
11692 static int
11693 test_xmlNanoFTPGetResponse(void) {
11694     int test_ret = 0;
11695
11696 #if defined(LIBXML_FTP_ENABLED)
11697     int mem_base;
11698     int ret_val;
11699     void * ctx; /* an FTP context */
11700     int n_ctx;
11701
11702     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11703         mem_base = xmlMemBlocks();
11704         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11705
11706         ret_val = xmlNanoFTPGetResponse(ctx);
11707         desret_int(ret_val);
11708         call_tests++;
11709         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11710         xmlResetLastError();
11711         if (mem_base != xmlMemBlocks()) {
11712             printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11713                    xmlMemBlocks() - mem_base);
11714             test_ret++;
11715             printf(" %d", n_ctx);
11716             printf("\n");
11717         }
11718     }
11719     function_tests++;
11720 #endif
11721
11722     return(test_ret);
11723 }
11724
11725
11726 static int
11727 test_xmlNanoFTPGetSocket(void) {
11728     int test_ret = 0;
11729
11730
11731     /* missing type support */
11732     return(test_ret);
11733 }
11734
11735
11736 static int
11737 test_xmlNanoFTPInit(void) {
11738     int test_ret = 0;
11739
11740 #if defined(LIBXML_FTP_ENABLED)
11741     int mem_base;
11742
11743         mem_base = xmlMemBlocks();
11744
11745         xmlNanoFTPInit();
11746         call_tests++;
11747         xmlResetLastError();
11748         if (mem_base != xmlMemBlocks()) {
11749             printf("Leak of %d blocks found in xmlNanoFTPInit",
11750                    xmlMemBlocks() - mem_base);
11751             test_ret++;
11752             printf("\n");
11753         }
11754     function_tests++;
11755 #endif
11756
11757     return(test_ret);
11758 }
11759
11760
11761 static int
11762 test_xmlNanoFTPList(void) {
11763     int test_ret = 0;
11764
11765
11766     /* missing type support */
11767     return(test_ret);
11768 }
11769
11770
11771 static int
11772 test_xmlNanoFTPNewCtxt(void) {
11773     int test_ret = 0;
11774
11775 #if defined(LIBXML_FTP_ENABLED)
11776     int mem_base;
11777     void * ret_val;
11778     const char * URL; /* The URL used to initialize the context */
11779     int n_URL;
11780
11781     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11782         mem_base = xmlMemBlocks();
11783         URL = gen_filepath(n_URL, 0);
11784
11785         ret_val = xmlNanoFTPNewCtxt(URL);
11786         desret_xmlNanoFTPCtxtPtr(ret_val);
11787         call_tests++;
11788         des_filepath(n_URL, URL, 0);
11789         xmlResetLastError();
11790         if (mem_base != xmlMemBlocks()) {
11791             printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11792                    xmlMemBlocks() - mem_base);
11793             test_ret++;
11794             printf(" %d", n_URL);
11795             printf("\n");
11796         }
11797     }
11798     function_tests++;
11799 #endif
11800
11801     return(test_ret);
11802 }
11803
11804
11805 static int
11806 test_xmlNanoFTPOpen(void) {
11807     int test_ret = 0;
11808
11809 #if defined(LIBXML_FTP_ENABLED)
11810     int mem_base;
11811     void * ret_val;
11812     const char * URL; /* the URL to the resource */
11813     int n_URL;
11814
11815     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11816         mem_base = xmlMemBlocks();
11817         URL = gen_filepath(n_URL, 0);
11818
11819         ret_val = xmlNanoFTPOpen(URL);
11820         desret_xmlNanoFTPCtxtPtr(ret_val);
11821         call_tests++;
11822         des_filepath(n_URL, URL, 0);
11823         xmlResetLastError();
11824         if (mem_base != xmlMemBlocks()) {
11825             printf("Leak of %d blocks found in xmlNanoFTPOpen",
11826                    xmlMemBlocks() - mem_base);
11827             test_ret++;
11828             printf(" %d", n_URL);
11829             printf("\n");
11830         }
11831     }
11832     function_tests++;
11833 #endif
11834
11835     return(test_ret);
11836 }
11837
11838
11839 static int
11840 test_xmlNanoFTPProxy(void) {
11841     int test_ret = 0;
11842
11843 #if defined(LIBXML_FTP_ENABLED)
11844     char * host; /* the proxy host name */
11845     int n_host;
11846     int port; /* the proxy port */
11847     int n_port;
11848     char * user; /* the proxy user name */
11849     int n_user;
11850     char * passwd; /* the proxy password */
11851     int n_passwd;
11852     int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11853     int n_type;
11854
11855     for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11856     for (n_port = 0;n_port < gen_nb_int;n_port++) {
11857     for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11858     for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11859     for (n_type = 0;n_type < gen_nb_int;n_type++) {
11860         host = gen_const_char_ptr(n_host, 0);
11861         port = gen_int(n_port, 1);
11862         user = gen_const_char_ptr(n_user, 2);
11863         passwd = gen_const_char_ptr(n_passwd, 3);
11864         type = gen_int(n_type, 4);
11865
11866         xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11867         call_tests++;
11868         des_const_char_ptr(n_host, (const char *)host, 0);
11869         des_int(n_port, port, 1);
11870         des_const_char_ptr(n_user, (const char *)user, 2);
11871         des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11872         des_int(n_type, type, 4);
11873         xmlResetLastError();
11874     }
11875     }
11876     }
11877     }
11878     }
11879     function_tests++;
11880 #endif
11881
11882     return(test_ret);
11883 }
11884
11885
11886 static int
11887 test_xmlNanoFTPQuit(void) {
11888     int test_ret = 0;
11889
11890 #if defined(LIBXML_FTP_ENABLED)
11891     int mem_base;
11892     int ret_val;
11893     void * ctx; /* an FTP context */
11894     int n_ctx;
11895
11896     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11897         mem_base = xmlMemBlocks();
11898         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11899
11900         ret_val = xmlNanoFTPQuit(ctx);
11901         desret_int(ret_val);
11902         call_tests++;
11903         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11904         xmlResetLastError();
11905         if (mem_base != xmlMemBlocks()) {
11906             printf("Leak of %d blocks found in xmlNanoFTPQuit",
11907                    xmlMemBlocks() - mem_base);
11908             test_ret++;
11909             printf(" %d", n_ctx);
11910             printf("\n");
11911         }
11912     }
11913     function_tests++;
11914 #endif
11915
11916     return(test_ret);
11917 }
11918
11919
11920 static int
11921 test_xmlNanoFTPRead(void) {
11922     int test_ret = 0;
11923
11924 #if defined(LIBXML_FTP_ENABLED)
11925     int mem_base;
11926     int ret_val;
11927     void * ctx; /* the FTP context */
11928     int n_ctx;
11929     void * dest; /* a buffer */
11930     int n_dest;
11931     int len; /* the buffer length */
11932     int n_len;
11933
11934     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11935     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11936     for (n_len = 0;n_len < gen_nb_int;n_len++) {
11937         mem_base = xmlMemBlocks();
11938         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11939         dest = gen_void_ptr(n_dest, 1);
11940         len = gen_int(n_len, 2);
11941
11942         ret_val = xmlNanoFTPRead(ctx, dest, len);
11943         desret_int(ret_val);
11944         call_tests++;
11945         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11946         des_void_ptr(n_dest, dest, 1);
11947         des_int(n_len, len, 2);
11948         xmlResetLastError();
11949         if (mem_base != xmlMemBlocks()) {
11950             printf("Leak of %d blocks found in xmlNanoFTPRead",
11951                    xmlMemBlocks() - mem_base);
11952             test_ret++;
11953             printf(" %d", n_ctx);
11954             printf(" %d", n_dest);
11955             printf(" %d", n_len);
11956             printf("\n");
11957         }
11958     }
11959     }
11960     }
11961     function_tests++;
11962 #endif
11963
11964     return(test_ret);
11965 }
11966
11967
11968 static int
11969 test_xmlNanoFTPScanProxy(void) {
11970     int test_ret = 0;
11971
11972 #if defined(LIBXML_FTP_ENABLED)
11973     const char * URL; /* The proxy URL used to initialize the proxy context */
11974     int n_URL;
11975
11976     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11977         URL = gen_filepath(n_URL, 0);
11978
11979         xmlNanoFTPScanProxy(URL);
11980         call_tests++;
11981         des_filepath(n_URL, URL, 0);
11982         xmlResetLastError();
11983     }
11984     function_tests++;
11985 #endif
11986
11987     return(test_ret);
11988 }
11989
11990
11991 static int
11992 test_xmlNanoFTPUpdateURL(void) {
11993     int test_ret = 0;
11994
11995 #if defined(LIBXML_FTP_ENABLED)
11996     int mem_base;
11997     int ret_val;
11998     void * ctx; /* an FTP context */
11999     int n_ctx;
12000     const char * URL; /* The URL used to update the context */
12001     int n_URL;
12002
12003     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12004     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12005         mem_base = xmlMemBlocks();
12006         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12007         URL = gen_filepath(n_URL, 1);
12008
12009         ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12010         desret_int(ret_val);
12011         call_tests++;
12012         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12013         des_filepath(n_URL, URL, 1);
12014         xmlResetLastError();
12015         if (mem_base != xmlMemBlocks()) {
12016             printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12017                    xmlMemBlocks() - mem_base);
12018             test_ret++;
12019             printf(" %d", n_ctx);
12020             printf(" %d", n_URL);
12021             printf("\n");
12022         }
12023     }
12024     }
12025     function_tests++;
12026 #endif
12027
12028     return(test_ret);
12029 }
12030
12031 static int
12032 test_nanoftp(void) {
12033     int test_ret = 0;
12034
12035     if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12036     test_ret += test_xmlNanoFTPCheckResponse();
12037     test_ret += test_xmlNanoFTPCleanup();
12038     test_ret += test_xmlNanoFTPCloseConnection();
12039     test_ret += test_xmlNanoFTPCwd();
12040     test_ret += test_xmlNanoFTPDele();
12041     test_ret += test_xmlNanoFTPGet();
12042     test_ret += test_xmlNanoFTPGetConnection();
12043     test_ret += test_xmlNanoFTPGetResponse();
12044     test_ret += test_xmlNanoFTPGetSocket();
12045     test_ret += test_xmlNanoFTPInit();
12046     test_ret += test_xmlNanoFTPList();
12047     test_ret += test_xmlNanoFTPNewCtxt();
12048     test_ret += test_xmlNanoFTPOpen();
12049     test_ret += test_xmlNanoFTPProxy();
12050     test_ret += test_xmlNanoFTPQuit();
12051     test_ret += test_xmlNanoFTPRead();
12052     test_ret += test_xmlNanoFTPScanProxy();
12053     test_ret += test_xmlNanoFTPUpdateURL();
12054
12055     if (test_ret != 0)
12056         printf("Module nanoftp: %d errors\n", test_ret);
12057     return(test_ret);
12058 }
12059
12060 static int
12061 test_xmlNanoHTTPAuthHeader(void) {
12062     int test_ret = 0;
12063
12064 #if defined(LIBXML_HTTP_ENABLED)
12065     int mem_base;
12066     const char * ret_val;
12067     void * ctx; /* the HTTP context */
12068     int n_ctx;
12069
12070     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12071         mem_base = xmlMemBlocks();
12072         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12073
12074         ret_val = xmlNanoHTTPAuthHeader(ctx);
12075         desret_const_char_ptr(ret_val);
12076         call_tests++;
12077         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12078         xmlResetLastError();
12079         if (mem_base != xmlMemBlocks()) {
12080             printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12081                    xmlMemBlocks() - mem_base);
12082             test_ret++;
12083             printf(" %d", n_ctx);
12084             printf("\n");
12085         }
12086     }
12087     function_tests++;
12088 #endif
12089
12090     return(test_ret);
12091 }
12092
12093
12094 static int
12095 test_xmlNanoHTTPCleanup(void) {
12096     int test_ret = 0;
12097
12098 #if defined(LIBXML_HTTP_ENABLED)
12099     int mem_base;
12100
12101         mem_base = xmlMemBlocks();
12102
12103         xmlNanoHTTPCleanup();
12104         call_tests++;
12105         xmlResetLastError();
12106         if (mem_base != xmlMemBlocks()) {
12107             printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12108                    xmlMemBlocks() - mem_base);
12109             test_ret++;
12110             printf("\n");
12111         }
12112     function_tests++;
12113 #endif
12114
12115     return(test_ret);
12116 }
12117
12118
12119 static int
12120 test_xmlNanoHTTPContentLength(void) {
12121     int test_ret = 0;
12122
12123 #if defined(LIBXML_HTTP_ENABLED)
12124     int mem_base;
12125     int ret_val;
12126     void * ctx; /* the HTTP context */
12127     int n_ctx;
12128
12129     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12130         mem_base = xmlMemBlocks();
12131         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12132
12133         ret_val = xmlNanoHTTPContentLength(ctx);
12134         desret_int(ret_val);
12135         call_tests++;
12136         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12137         xmlResetLastError();
12138         if (mem_base != xmlMemBlocks()) {
12139             printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12140                    xmlMemBlocks() - mem_base);
12141             test_ret++;
12142             printf(" %d", n_ctx);
12143             printf("\n");
12144         }
12145     }
12146     function_tests++;
12147 #endif
12148
12149     return(test_ret);
12150 }
12151
12152
12153 static int
12154 test_xmlNanoHTTPEncoding(void) {
12155     int test_ret = 0;
12156
12157 #if defined(LIBXML_HTTP_ENABLED)
12158     int mem_base;
12159     const char * ret_val;
12160     void * ctx; /* the HTTP context */
12161     int n_ctx;
12162
12163     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12164         mem_base = xmlMemBlocks();
12165         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12166
12167         ret_val = xmlNanoHTTPEncoding(ctx);
12168         desret_const_char_ptr(ret_val);
12169         call_tests++;
12170         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12171         xmlResetLastError();
12172         if (mem_base != xmlMemBlocks()) {
12173             printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12174                    xmlMemBlocks() - mem_base);
12175             test_ret++;
12176             printf(" %d", n_ctx);
12177             printf("\n");
12178         }
12179     }
12180     function_tests++;
12181 #endif
12182
12183     return(test_ret);
12184 }
12185
12186
12187 #define gen_nb_char_ptr_ptr 1
12188 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12189     return(NULL);
12190 }
12191 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12192 }
12193
12194 static int
12195 test_xmlNanoHTTPFetch(void) {
12196     int test_ret = 0;
12197
12198 #if defined(LIBXML_HTTP_ENABLED)
12199     int mem_base;
12200     int ret_val;
12201     const char * URL; /* The URL to load */
12202     int n_URL;
12203     const char * filename; /* the filename where the content should be saved */
12204     int n_filename;
12205     char ** contentType; /* if available the Content-Type information will be returned at that location */
12206     int n_contentType;
12207
12208     for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12209     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12210     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12211         mem_base = xmlMemBlocks();
12212         URL = gen_fileoutput(n_URL, 0);
12213         filename = gen_fileoutput(n_filename, 1);
12214         contentType = gen_char_ptr_ptr(n_contentType, 2);
12215
12216         ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12217         desret_int(ret_val);
12218         call_tests++;
12219         des_fileoutput(n_URL, URL, 0);
12220         des_fileoutput(n_filename, filename, 1);
12221         des_char_ptr_ptr(n_contentType, contentType, 2);
12222         xmlResetLastError();
12223         if (mem_base != xmlMemBlocks()) {
12224             printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12225                    xmlMemBlocks() - mem_base);
12226             test_ret++;
12227             printf(" %d", n_URL);
12228             printf(" %d", n_filename);
12229             printf(" %d", n_contentType);
12230             printf("\n");
12231         }
12232     }
12233     }
12234     }
12235     function_tests++;
12236 #endif
12237
12238     return(test_ret);
12239 }
12240
12241
12242 static int
12243 test_xmlNanoHTTPInit(void) {
12244     int test_ret = 0;
12245
12246 #if defined(LIBXML_HTTP_ENABLED)
12247     int mem_base;
12248
12249         mem_base = xmlMemBlocks();
12250
12251         xmlNanoHTTPInit();
12252         call_tests++;
12253         xmlResetLastError();
12254         if (mem_base != xmlMemBlocks()) {
12255             printf("Leak of %d blocks found in xmlNanoHTTPInit",
12256                    xmlMemBlocks() - mem_base);
12257             test_ret++;
12258             printf("\n");
12259         }
12260     function_tests++;
12261 #endif
12262
12263     return(test_ret);
12264 }
12265
12266
12267 static int
12268 test_xmlNanoHTTPMimeType(void) {
12269     int test_ret = 0;
12270
12271 #if defined(LIBXML_HTTP_ENABLED)
12272     int mem_base;
12273     const char * ret_val;
12274     void * ctx; /* the HTTP context */
12275     int n_ctx;
12276
12277     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12278         mem_base = xmlMemBlocks();
12279         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12280
12281         ret_val = xmlNanoHTTPMimeType(ctx);
12282         desret_const_char_ptr(ret_val);
12283         call_tests++;
12284         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12285         xmlResetLastError();
12286         if (mem_base != xmlMemBlocks()) {
12287             printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12288                    xmlMemBlocks() - mem_base);
12289             test_ret++;
12290             printf(" %d", n_ctx);
12291             printf("\n");
12292         }
12293     }
12294     function_tests++;
12295 #endif
12296
12297     return(test_ret);
12298 }
12299
12300
12301 static int
12302 test_xmlNanoHTTPOpen(void) {
12303     int test_ret = 0;
12304
12305 #if defined(LIBXML_HTTP_ENABLED)
12306     int mem_base;
12307     void * ret_val;
12308     const char * URL; /* The URL to load */
12309     int n_URL;
12310     char ** contentType; /* if available the Content-Type information will be returned at that location */
12311     int n_contentType;
12312
12313     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12314     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12315         mem_base = xmlMemBlocks();
12316         URL = gen_filepath(n_URL, 0);
12317         contentType = gen_char_ptr_ptr(n_contentType, 1);
12318
12319         ret_val = xmlNanoHTTPOpen(URL, contentType);
12320         desret_xmlNanoHTTPCtxtPtr(ret_val);
12321         call_tests++;
12322         des_filepath(n_URL, URL, 0);
12323         des_char_ptr_ptr(n_contentType, contentType, 1);
12324         xmlResetLastError();
12325         if (mem_base != xmlMemBlocks()) {
12326             printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12327                    xmlMemBlocks() - mem_base);
12328             test_ret++;
12329             printf(" %d", n_URL);
12330             printf(" %d", n_contentType);
12331             printf("\n");
12332         }
12333     }
12334     }
12335     function_tests++;
12336 #endif
12337
12338     return(test_ret);
12339 }
12340
12341
12342 static int
12343 test_xmlNanoHTTPOpenRedir(void) {
12344     int test_ret = 0;
12345
12346 #if defined(LIBXML_HTTP_ENABLED)
12347     int mem_base;
12348     void * ret_val;
12349     const char * URL; /* The URL to load */
12350     int n_URL;
12351     char ** contentType; /* if available the Content-Type information will be returned at that location */
12352     int n_contentType;
12353     char ** redir; /* if available the redirected URL will be returned */
12354     int n_redir;
12355
12356     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12357     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12358     for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12359         mem_base = xmlMemBlocks();
12360         URL = gen_filepath(n_URL, 0);
12361         contentType = gen_char_ptr_ptr(n_contentType, 1);
12362         redir = gen_char_ptr_ptr(n_redir, 2);
12363
12364         ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12365         desret_xmlNanoHTTPCtxtPtr(ret_val);
12366         call_tests++;
12367         des_filepath(n_URL, URL, 0);
12368         des_char_ptr_ptr(n_contentType, contentType, 1);
12369         des_char_ptr_ptr(n_redir, redir, 2);
12370         xmlResetLastError();
12371         if (mem_base != xmlMemBlocks()) {
12372             printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12373                    xmlMemBlocks() - mem_base);
12374             test_ret++;
12375             printf(" %d", n_URL);
12376             printf(" %d", n_contentType);
12377             printf(" %d", n_redir);
12378             printf("\n");
12379         }
12380     }
12381     }
12382     }
12383     function_tests++;
12384 #endif
12385
12386     return(test_ret);
12387 }
12388
12389
12390 static int
12391 test_xmlNanoHTTPRead(void) {
12392     int test_ret = 0;
12393
12394 #if defined(LIBXML_HTTP_ENABLED)
12395     int mem_base;
12396     int ret_val;
12397     void * ctx; /* the HTTP context */
12398     int n_ctx;
12399     void * dest; /* a buffer */
12400     int n_dest;
12401     int len; /* the buffer length */
12402     int n_len;
12403
12404     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12405     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12406     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12407         mem_base = xmlMemBlocks();
12408         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12409         dest = gen_void_ptr(n_dest, 1);
12410         len = gen_int(n_len, 2);
12411
12412         ret_val = xmlNanoHTTPRead(ctx, dest, len);
12413         desret_int(ret_val);
12414         call_tests++;
12415         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12416         des_void_ptr(n_dest, dest, 1);
12417         des_int(n_len, len, 2);
12418         xmlResetLastError();
12419         if (mem_base != xmlMemBlocks()) {
12420             printf("Leak of %d blocks found in xmlNanoHTTPRead",
12421                    xmlMemBlocks() - mem_base);
12422             test_ret++;
12423             printf(" %d", n_ctx);
12424             printf(" %d", n_dest);
12425             printf(" %d", n_len);
12426             printf("\n");
12427         }
12428     }
12429     }
12430     }
12431     function_tests++;
12432 #endif
12433
12434     return(test_ret);
12435 }
12436
12437
12438 static int
12439 test_xmlNanoHTTPRedir(void) {
12440     int test_ret = 0;
12441
12442
12443     /* missing type support */
12444     return(test_ret);
12445 }
12446
12447
12448 static int
12449 test_xmlNanoHTTPReturnCode(void) {
12450     int test_ret = 0;
12451
12452 #if defined(LIBXML_HTTP_ENABLED)
12453     int mem_base;
12454     int ret_val;
12455     void * ctx; /* the HTTP context */
12456     int n_ctx;
12457
12458     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12459         mem_base = xmlMemBlocks();
12460         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12461
12462         ret_val = xmlNanoHTTPReturnCode(ctx);
12463         desret_int(ret_val);
12464         call_tests++;
12465         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12466         xmlResetLastError();
12467         if (mem_base != xmlMemBlocks()) {
12468             printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12469                    xmlMemBlocks() - mem_base);
12470             test_ret++;
12471             printf(" %d", n_ctx);
12472             printf("\n");
12473         }
12474     }
12475     function_tests++;
12476 #endif
12477
12478     return(test_ret);
12479 }
12480
12481
12482 static int
12483 test_xmlNanoHTTPSave(void) {
12484     int test_ret = 0;
12485
12486 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12487     int mem_base;
12488     int ret_val;
12489     void * ctxt; /* the HTTP context */
12490     int n_ctxt;
12491     const char * filename; /* the filename where the content should be saved */
12492     int n_filename;
12493
12494     for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12495     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12496         mem_base = xmlMemBlocks();
12497         ctxt = gen_void_ptr(n_ctxt, 0);
12498         filename = gen_fileoutput(n_filename, 1);
12499
12500         ret_val = xmlNanoHTTPSave(ctxt, filename);
12501         desret_int(ret_val);
12502         call_tests++;
12503         des_void_ptr(n_ctxt, ctxt, 0);
12504         des_fileoutput(n_filename, filename, 1);
12505         xmlResetLastError();
12506         if (mem_base != xmlMemBlocks()) {
12507             printf("Leak of %d blocks found in xmlNanoHTTPSave",
12508                    xmlMemBlocks() - mem_base);
12509             test_ret++;
12510             printf(" %d", n_ctxt);
12511             printf(" %d", n_filename);
12512             printf("\n");
12513         }
12514     }
12515     }
12516     function_tests++;
12517 #endif
12518
12519     return(test_ret);
12520 }
12521
12522
12523 static int
12524 test_xmlNanoHTTPScanProxy(void) {
12525     int test_ret = 0;
12526
12527 #if defined(LIBXML_HTTP_ENABLED)
12528     const char * URL; /* The proxy URL used to initialize the proxy context */
12529     int n_URL;
12530
12531     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12532         URL = gen_filepath(n_URL, 0);
12533
12534         xmlNanoHTTPScanProxy(URL);
12535         call_tests++;
12536         des_filepath(n_URL, URL, 0);
12537         xmlResetLastError();
12538     }
12539     function_tests++;
12540 #endif
12541
12542     return(test_ret);
12543 }
12544
12545 static int
12546 test_nanohttp(void) {
12547     int test_ret = 0;
12548
12549     if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12550     test_ret += test_xmlNanoHTTPAuthHeader();
12551     test_ret += test_xmlNanoHTTPCleanup();
12552     test_ret += test_xmlNanoHTTPContentLength();
12553     test_ret += test_xmlNanoHTTPEncoding();
12554     test_ret += test_xmlNanoHTTPFetch();
12555     test_ret += test_xmlNanoHTTPInit();
12556     test_ret += test_xmlNanoHTTPMimeType();
12557     test_ret += test_xmlNanoHTTPOpen();
12558     test_ret += test_xmlNanoHTTPOpenRedir();
12559     test_ret += test_xmlNanoHTTPRead();
12560     test_ret += test_xmlNanoHTTPRedir();
12561     test_ret += test_xmlNanoHTTPReturnCode();
12562     test_ret += test_xmlNanoHTTPSave();
12563     test_ret += test_xmlNanoHTTPScanProxy();
12564
12565     if (test_ret != 0)
12566         printf("Module nanohttp: %d errors\n", test_ret);
12567     return(test_ret);
12568 }
12569
12570 static int
12571 test_xmlByteConsumed(void) {
12572     int test_ret = 0;
12573
12574     int mem_base;
12575     long ret_val;
12576     xmlParserCtxtPtr ctxt; /* an XML parser context */
12577     int n_ctxt;
12578
12579     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12580         mem_base = xmlMemBlocks();
12581         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12582
12583         ret_val = xmlByteConsumed(ctxt);
12584         desret_long(ret_val);
12585         call_tests++;
12586         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12587         xmlResetLastError();
12588         if (mem_base != xmlMemBlocks()) {
12589             printf("Leak of %d blocks found in xmlByteConsumed",
12590                    xmlMemBlocks() - mem_base);
12591             test_ret++;
12592             printf(" %d", n_ctxt);
12593             printf("\n");
12594         }
12595     }
12596     function_tests++;
12597
12598     return(test_ret);
12599 }
12600
12601
12602 static int
12603 test_xmlClearNodeInfoSeq(void) {
12604     int test_ret = 0;
12605
12606     int mem_base;
12607     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12608     int n_seq;
12609
12610     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12611         mem_base = xmlMemBlocks();
12612         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12613
12614         xmlClearNodeInfoSeq(seq);
12615         call_tests++;
12616         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12617         xmlResetLastError();
12618         if (mem_base != xmlMemBlocks()) {
12619             printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12620                    xmlMemBlocks() - mem_base);
12621             test_ret++;
12622             printf(" %d", n_seq);
12623             printf("\n");
12624         }
12625     }
12626     function_tests++;
12627
12628     return(test_ret);
12629 }
12630
12631
12632 static int
12633 test_xmlClearParserCtxt(void) {
12634     int test_ret = 0;
12635
12636     int mem_base;
12637     xmlParserCtxtPtr ctxt; /* an XML parser context */
12638     int n_ctxt;
12639
12640     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12641         mem_base = xmlMemBlocks();
12642         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12643
12644         xmlClearParserCtxt(ctxt);
12645         call_tests++;
12646         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12647         xmlResetLastError();
12648         if (mem_base != xmlMemBlocks()) {
12649             printf("Leak of %d blocks found in xmlClearParserCtxt",
12650                    xmlMemBlocks() - mem_base);
12651             test_ret++;
12652             printf(" %d", n_ctxt);
12653             printf("\n");
12654         }
12655     }
12656     function_tests++;
12657
12658     return(test_ret);
12659 }
12660
12661
12662 static int
12663 test_xmlCreateDocParserCtxt(void) {
12664     int test_ret = 0;
12665
12666     int mem_base;
12667     xmlParserCtxtPtr ret_val;
12668     xmlChar * cur; /* a pointer to an array of xmlChar */
12669     int n_cur;
12670
12671     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12672         mem_base = xmlMemBlocks();
12673         cur = gen_const_xmlChar_ptr(n_cur, 0);
12674
12675         ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12676         desret_xmlParserCtxtPtr(ret_val);
12677         call_tests++;
12678         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12679         xmlResetLastError();
12680         if (mem_base != xmlMemBlocks()) {
12681             printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12682                    xmlMemBlocks() - mem_base);
12683             test_ret++;
12684             printf(" %d", n_cur);
12685             printf("\n");
12686         }
12687     }
12688     function_tests++;
12689
12690     return(test_ret);
12691 }
12692
12693
12694 static int
12695 test_xmlCreatePushParserCtxt(void) {
12696     int test_ret = 0;
12697
12698 #if defined(LIBXML_PUSH_ENABLED)
12699     int mem_base;
12700     xmlParserCtxtPtr ret_val;
12701     xmlSAXHandlerPtr sax; /* a SAX handler */
12702     int n_sax;
12703     void * user_data; /* The user data returned on SAX callbacks */
12704     int n_user_data;
12705     char * chunk; /* a pointer to an array of chars */
12706     int n_chunk;
12707     int size; /* number of chars in the array */
12708     int n_size;
12709     const char * filename; /* an optional file name or URI */
12710     int n_filename;
12711
12712     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12713     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12714     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12715     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12716     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12717         mem_base = xmlMemBlocks();
12718         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12719         user_data = gen_userdata(n_user_data, 1);
12720         chunk = gen_const_char_ptr(n_chunk, 2);
12721         size = gen_int(n_size, 3);
12722         filename = gen_fileoutput(n_filename, 4);
12723
12724         ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12725         desret_xmlParserCtxtPtr(ret_val);
12726         call_tests++;
12727         des_xmlSAXHandlerPtr(n_sax, sax, 0);
12728         des_userdata(n_user_data, user_data, 1);
12729         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12730         des_int(n_size, size, 3);
12731         des_fileoutput(n_filename, filename, 4);
12732         xmlResetLastError();
12733         if (mem_base != xmlMemBlocks()) {
12734             printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12735                    xmlMemBlocks() - mem_base);
12736             test_ret++;
12737             printf(" %d", n_sax);
12738             printf(" %d", n_user_data);
12739             printf(" %d", n_chunk);
12740             printf(" %d", n_size);
12741             printf(" %d", n_filename);
12742             printf("\n");
12743         }
12744     }
12745     }
12746     }
12747     }
12748     }
12749     function_tests++;
12750 #endif
12751
12752     return(test_ret);
12753 }
12754
12755
12756 static int
12757 test_xmlCtxtReadDoc(void) {
12758     int test_ret = 0;
12759
12760     int mem_base;
12761     xmlDocPtr ret_val;
12762     xmlParserCtxtPtr ctxt; /* an XML parser context */
12763     int n_ctxt;
12764     xmlChar * cur; /* a pointer to a zero terminated string */
12765     int n_cur;
12766     const char * URL; /* the base URL to use for the document */
12767     int n_URL;
12768     char * encoding; /* the document encoding, or NULL */
12769     int n_encoding;
12770     int options; /* a combination of xmlParserOption */
12771     int n_options;
12772
12773     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12774     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12775     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12776     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12777     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12778         mem_base = xmlMemBlocks();
12779         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12780         cur = gen_const_xmlChar_ptr(n_cur, 1);
12781         URL = gen_filepath(n_URL, 2);
12782         encoding = gen_const_char_ptr(n_encoding, 3);
12783         options = gen_parseroptions(n_options, 4);
12784
12785         ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12786         desret_xmlDocPtr(ret_val);
12787         call_tests++;
12788         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12789         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12790         des_filepath(n_URL, URL, 2);
12791         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12792         des_parseroptions(n_options, options, 4);
12793         xmlResetLastError();
12794         if (mem_base != xmlMemBlocks()) {
12795             printf("Leak of %d blocks found in xmlCtxtReadDoc",
12796                    xmlMemBlocks() - mem_base);
12797             test_ret++;
12798             printf(" %d", n_ctxt);
12799             printf(" %d", n_cur);
12800             printf(" %d", n_URL);
12801             printf(" %d", n_encoding);
12802             printf(" %d", n_options);
12803             printf("\n");
12804         }
12805     }
12806     }
12807     }
12808     }
12809     }
12810     function_tests++;
12811
12812     return(test_ret);
12813 }
12814
12815
12816 static int
12817 test_xmlCtxtReadFile(void) {
12818     int test_ret = 0;
12819
12820     int mem_base;
12821     xmlDocPtr ret_val;
12822     xmlParserCtxtPtr ctxt; /* an XML parser context */
12823     int n_ctxt;
12824     const char * filename; /* a file or URL */
12825     int n_filename;
12826     char * encoding; /* the document encoding, or NULL */
12827     int n_encoding;
12828     int options; /* a combination of xmlParserOption */
12829     int n_options;
12830
12831     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12832     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12833     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12834     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12835         mem_base = xmlMemBlocks();
12836         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12837         filename = gen_filepath(n_filename, 1);
12838         encoding = gen_const_char_ptr(n_encoding, 2);
12839         options = gen_parseroptions(n_options, 3);
12840
12841         ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12842         desret_xmlDocPtr(ret_val);
12843         call_tests++;
12844         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12845         des_filepath(n_filename, filename, 1);
12846         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12847         des_parseroptions(n_options, options, 3);
12848         xmlResetLastError();
12849         if (mem_base != xmlMemBlocks()) {
12850             printf("Leak of %d blocks found in xmlCtxtReadFile",
12851                    xmlMemBlocks() - mem_base);
12852             test_ret++;
12853             printf(" %d", n_ctxt);
12854             printf(" %d", n_filename);
12855             printf(" %d", n_encoding);
12856             printf(" %d", n_options);
12857             printf("\n");
12858         }
12859     }
12860     }
12861     }
12862     }
12863     function_tests++;
12864
12865     return(test_ret);
12866 }
12867
12868
12869 static int
12870 test_xmlCtxtReadMemory(void) {
12871     int test_ret = 0;
12872
12873     int mem_base;
12874     xmlDocPtr ret_val;
12875     xmlParserCtxtPtr ctxt; /* an XML parser context */
12876     int n_ctxt;
12877     char * buffer; /* a pointer to a char array */
12878     int n_buffer;
12879     int size; /* the size of the array */
12880     int n_size;
12881     const char * URL; /* the base URL to use for the document */
12882     int n_URL;
12883     char * encoding; /* the document encoding, or NULL */
12884     int n_encoding;
12885     int options; /* a combination of xmlParserOption */
12886     int n_options;
12887
12888     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12889     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12890     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12891     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12892     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12893     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12894         mem_base = xmlMemBlocks();
12895         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12896         buffer = gen_const_char_ptr(n_buffer, 1);
12897         size = gen_int(n_size, 2);
12898         URL = gen_filepath(n_URL, 3);
12899         encoding = gen_const_char_ptr(n_encoding, 4);
12900         options = gen_parseroptions(n_options, 5);
12901
12902         ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12903         desret_xmlDocPtr(ret_val);
12904         call_tests++;
12905         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12906         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12907         des_int(n_size, size, 2);
12908         des_filepath(n_URL, URL, 3);
12909         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12910         des_parseroptions(n_options, options, 5);
12911         xmlResetLastError();
12912         if (mem_base != xmlMemBlocks()) {
12913             printf("Leak of %d blocks found in xmlCtxtReadMemory",
12914                    xmlMemBlocks() - mem_base);
12915             test_ret++;
12916             printf(" %d", n_ctxt);
12917             printf(" %d", n_buffer);
12918             printf(" %d", n_size);
12919             printf(" %d", n_URL);
12920             printf(" %d", n_encoding);
12921             printf(" %d", n_options);
12922             printf("\n");
12923         }
12924     }
12925     }
12926     }
12927     }
12928     }
12929     }
12930     function_tests++;
12931
12932     return(test_ret);
12933 }
12934
12935
12936 static int
12937 test_xmlCtxtReset(void) {
12938     int test_ret = 0;
12939
12940     int mem_base;
12941     xmlParserCtxtPtr ctxt; /* an XML parser context */
12942     int n_ctxt;
12943
12944     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12945         mem_base = xmlMemBlocks();
12946         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12947
12948         xmlCtxtReset(ctxt);
12949         call_tests++;
12950         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12951         xmlResetLastError();
12952         if (mem_base != xmlMemBlocks()) {
12953             printf("Leak of %d blocks found in xmlCtxtReset",
12954                    xmlMemBlocks() - mem_base);
12955             test_ret++;
12956             printf(" %d", n_ctxt);
12957             printf("\n");
12958         }
12959     }
12960     function_tests++;
12961
12962     return(test_ret);
12963 }
12964
12965
12966 static int
12967 test_xmlCtxtResetPush(void) {
12968     int test_ret = 0;
12969
12970     int mem_base;
12971     int ret_val;
12972     xmlParserCtxtPtr ctxt; /* an XML parser context */
12973     int n_ctxt;
12974     char * chunk; /* a pointer to an array of chars */
12975     int n_chunk;
12976     int size; /* number of chars in the array */
12977     int n_size;
12978     const char * filename; /* an optional file name or URI */
12979     int n_filename;
12980     char * encoding; /* the document encoding, or NULL */
12981     int n_encoding;
12982
12983     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12984     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12985     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12986     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12987     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12988         mem_base = xmlMemBlocks();
12989         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12990         chunk = gen_const_char_ptr(n_chunk, 1);
12991         size = gen_int(n_size, 2);
12992         filename = gen_filepath(n_filename, 3);
12993         encoding = gen_const_char_ptr(n_encoding, 4);
12994
12995         ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12996         desret_int(ret_val);
12997         call_tests++;
12998         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12999         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13000         des_int(n_size, size, 2);
13001         des_filepath(n_filename, filename, 3);
13002         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13003         xmlResetLastError();
13004         if (mem_base != xmlMemBlocks()) {
13005             printf("Leak of %d blocks found in xmlCtxtResetPush",
13006                    xmlMemBlocks() - mem_base);
13007             test_ret++;
13008             printf(" %d", n_ctxt);
13009             printf(" %d", n_chunk);
13010             printf(" %d", n_size);
13011             printf(" %d", n_filename);
13012             printf(" %d", n_encoding);
13013             printf("\n");
13014         }
13015     }
13016     }
13017     }
13018     }
13019     }
13020     function_tests++;
13021
13022     return(test_ret);
13023 }
13024
13025
13026 static int
13027 test_xmlCtxtUseOptions(void) {
13028     int test_ret = 0;
13029
13030     int mem_base;
13031     int ret_val;
13032     xmlParserCtxtPtr ctxt; /* an XML parser context */
13033     int n_ctxt;
13034     int options; /* a combination of xmlParserOption */
13035     int n_options;
13036
13037     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13038     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13039         mem_base = xmlMemBlocks();
13040         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13041         options = gen_parseroptions(n_options, 1);
13042
13043         ret_val = xmlCtxtUseOptions(ctxt, options);
13044         desret_int(ret_val);
13045         call_tests++;
13046         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13047         des_parseroptions(n_options, options, 1);
13048         xmlResetLastError();
13049         if (mem_base != xmlMemBlocks()) {
13050             printf("Leak of %d blocks found in xmlCtxtUseOptions",
13051                    xmlMemBlocks() - mem_base);
13052             test_ret++;
13053             printf(" %d", n_ctxt);
13054             printf(" %d", n_options);
13055             printf("\n");
13056         }
13057     }
13058     }
13059     function_tests++;
13060
13061     return(test_ret);
13062 }
13063
13064
13065 static int
13066 test_xmlGetExternalEntityLoader(void) {
13067     int test_ret = 0;
13068
13069
13070     /* missing type support */
13071     return(test_ret);
13072 }
13073
13074
13075 static int
13076 test_xmlGetFeature(void) {
13077     int test_ret = 0;
13078
13079 #if defined(LIBXML_LEGACY_ENABLED)
13080 #ifdef LIBXML_LEGACY_ENABLED
13081     int mem_base;
13082     int ret_val;
13083     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13084     int n_ctxt;
13085     char * name; /* the feature name */
13086     int n_name;
13087     void * result; /* location to store the result */
13088     int n_result;
13089
13090     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13091     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13092     for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13093         mem_base = xmlMemBlocks();
13094         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13095         name = gen_const_char_ptr(n_name, 1);
13096         result = gen_void_ptr(n_result, 2);
13097
13098         ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13099         desret_int(ret_val);
13100         call_tests++;
13101         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13102         des_const_char_ptr(n_name, (const char *)name, 1);
13103         des_void_ptr(n_result, result, 2);
13104         xmlResetLastError();
13105         if (mem_base != xmlMemBlocks()) {
13106             printf("Leak of %d blocks found in xmlGetFeature",
13107                    xmlMemBlocks() - mem_base);
13108             test_ret++;
13109             printf(" %d", n_ctxt);
13110             printf(" %d", n_name);
13111             printf(" %d", n_result);
13112             printf("\n");
13113         }
13114     }
13115     }
13116     }
13117     function_tests++;
13118 #endif
13119 #endif
13120
13121     return(test_ret);
13122 }
13123
13124
13125 #define gen_nb_const_char_ptr_ptr 1
13126 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13127     return(NULL);
13128 }
13129 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13130 }
13131
13132 static int
13133 test_xmlGetFeaturesList(void) {
13134     int test_ret = 0;
13135
13136 #if defined(LIBXML_LEGACY_ENABLED)
13137 #ifdef LIBXML_LEGACY_ENABLED
13138     int mem_base;
13139     int ret_val;
13140     int * len; /* the length of the features name array (input/output) */
13141     int n_len;
13142     char ** result; /* an array of string to be filled with the features name. */
13143     int n_result;
13144
13145     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13146     for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13147         mem_base = xmlMemBlocks();
13148         len = gen_int_ptr(n_len, 0);
13149         result = gen_const_char_ptr_ptr(n_result, 1);
13150
13151         ret_val = xmlGetFeaturesList(len, (const char **)result);
13152         desret_int(ret_val);
13153         call_tests++;
13154         des_int_ptr(n_len, len, 0);
13155         des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13156         xmlResetLastError();
13157         if (mem_base != xmlMemBlocks()) {
13158             printf("Leak of %d blocks found in xmlGetFeaturesList",
13159                    xmlMemBlocks() - mem_base);
13160             test_ret++;
13161             printf(" %d", n_len);
13162             printf(" %d", n_result);
13163             printf("\n");
13164         }
13165     }
13166     }
13167     function_tests++;
13168 #endif
13169 #endif
13170
13171     return(test_ret);
13172 }
13173
13174
13175 static int
13176 test_xmlHasFeature(void) {
13177     int test_ret = 0;
13178
13179     int mem_base;
13180     int ret_val;
13181     xmlFeature feature; /* the feature to be examined */
13182     int n_feature;
13183
13184     for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13185         mem_base = xmlMemBlocks();
13186         feature = gen_xmlFeature(n_feature, 0);
13187
13188         ret_val = xmlHasFeature(feature);
13189         desret_int(ret_val);
13190         call_tests++;
13191         des_xmlFeature(n_feature, feature, 0);
13192         xmlResetLastError();
13193         if (mem_base != xmlMemBlocks()) {
13194             printf("Leak of %d blocks found in xmlHasFeature",
13195                    xmlMemBlocks() - mem_base);
13196             test_ret++;
13197             printf(" %d", n_feature);
13198             printf("\n");
13199         }
13200     }
13201     function_tests++;
13202
13203     return(test_ret);
13204 }
13205
13206
13207 static int
13208 test_xmlIOParseDTD(void) {
13209     int test_ret = 0;
13210
13211 #if defined(LIBXML_VALID_ENABLED)
13212 #ifdef LIBXML_VALID_ENABLED
13213     xmlDtdPtr ret_val;
13214     xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13215     int n_sax;
13216     xmlParserInputBufferPtr input; /* an Input Buffer */
13217     int n_input;
13218     xmlCharEncoding enc; /* the charset encoding if known */
13219     int n_enc;
13220
13221     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13222     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13223     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13224         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13225         input = gen_xmlParserInputBufferPtr(n_input, 1);
13226         enc = gen_xmlCharEncoding(n_enc, 2);
13227
13228         ret_val = xmlIOParseDTD(sax, input, enc);
13229         input = NULL;
13230         desret_xmlDtdPtr(ret_val);
13231         call_tests++;
13232         des_xmlSAXHandlerPtr(n_sax, sax, 0);
13233         des_xmlParserInputBufferPtr(n_input, input, 1);
13234         des_xmlCharEncoding(n_enc, enc, 2);
13235         xmlResetLastError();
13236     }
13237     }
13238     }
13239     function_tests++;
13240 #endif
13241 #endif
13242
13243     return(test_ret);
13244 }
13245
13246
13247 static int
13248 test_xmlInitNodeInfoSeq(void) {
13249     int test_ret = 0;
13250
13251     int mem_base;
13252     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13253     int n_seq;
13254
13255     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13256         mem_base = xmlMemBlocks();
13257         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13258
13259         xmlInitNodeInfoSeq(seq);
13260         call_tests++;
13261         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13262         xmlResetLastError();
13263         if (mem_base != xmlMemBlocks()) {
13264             printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13265                    xmlMemBlocks() - mem_base);
13266             test_ret++;
13267             printf(" %d", n_seq);
13268             printf("\n");
13269         }
13270     }
13271     function_tests++;
13272
13273     return(test_ret);
13274 }
13275
13276
13277 static int
13278 test_xmlInitParser(void) {
13279     int test_ret = 0;
13280
13281     int mem_base;
13282
13283         mem_base = xmlMemBlocks();
13284
13285         xmlInitParser();
13286         call_tests++;
13287         xmlResetLastError();
13288         if (mem_base != xmlMemBlocks()) {
13289             printf("Leak of %d blocks found in xmlInitParser",
13290                    xmlMemBlocks() - mem_base);
13291             test_ret++;
13292             printf("\n");
13293         }
13294     function_tests++;
13295
13296     return(test_ret);
13297 }
13298
13299
13300 static int
13301 test_xmlInitParserCtxt(void) {
13302     int test_ret = 0;
13303
13304     int mem_base;
13305     int ret_val;
13306     xmlParserCtxtPtr ctxt; /* an XML parser context */
13307     int n_ctxt;
13308
13309     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13310         mem_base = xmlMemBlocks();
13311         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13312
13313         ret_val = xmlInitParserCtxt(ctxt);
13314         desret_int(ret_val);
13315         call_tests++;
13316         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13317         xmlResetLastError();
13318         if (mem_base != xmlMemBlocks()) {
13319             printf("Leak of %d blocks found in xmlInitParserCtxt",
13320                    xmlMemBlocks() - mem_base);
13321             test_ret++;
13322             printf(" %d", n_ctxt);
13323             printf("\n");
13324         }
13325     }
13326     function_tests++;
13327
13328     return(test_ret);
13329 }
13330
13331
13332 static int
13333 test_xmlKeepBlanksDefault(void) {
13334     int test_ret = 0;
13335
13336     int mem_base;
13337     int ret_val;
13338     int val; /* int 0 or 1 */
13339     int n_val;
13340
13341     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13342         mem_base = xmlMemBlocks();
13343         val = gen_int(n_val, 0);
13344
13345         ret_val = xmlKeepBlanksDefault(val);
13346         desret_int(ret_val);
13347         call_tests++;
13348         des_int(n_val, val, 0);
13349         xmlResetLastError();
13350         if (mem_base != xmlMemBlocks()) {
13351             printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13352                    xmlMemBlocks() - mem_base);
13353             test_ret++;
13354             printf(" %d", n_val);
13355             printf("\n");
13356         }
13357     }
13358     function_tests++;
13359
13360     return(test_ret);
13361 }
13362
13363
13364 static int
13365 test_xmlLineNumbersDefault(void) {
13366     int test_ret = 0;
13367
13368     int mem_base;
13369     int ret_val;
13370     int val; /* int 0 or 1 */
13371     int n_val;
13372
13373     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13374         mem_base = xmlMemBlocks();
13375         val = gen_int(n_val, 0);
13376
13377         ret_val = xmlLineNumbersDefault(val);
13378         desret_int(ret_val);
13379         call_tests++;
13380         des_int(n_val, val, 0);
13381         xmlResetLastError();
13382         if (mem_base != xmlMemBlocks()) {
13383             printf("Leak of %d blocks found in xmlLineNumbersDefault",
13384                    xmlMemBlocks() - mem_base);
13385             test_ret++;
13386             printf(" %d", n_val);
13387             printf("\n");
13388         }
13389     }
13390     function_tests++;
13391
13392     return(test_ret);
13393 }
13394
13395
13396 static int
13397 test_xmlLoadExternalEntity(void) {
13398     int test_ret = 0;
13399
13400     int mem_base;
13401     xmlParserInputPtr ret_val;
13402     const char * URL; /* the URL for the entity to load */
13403     int n_URL;
13404     char * ID; /* the Public ID for the entity to load */
13405     int n_ID;
13406     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13407     int n_ctxt;
13408
13409     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13410     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13411     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13412         mem_base = xmlMemBlocks();
13413         URL = gen_filepath(n_URL, 0);
13414         ID = gen_const_char_ptr(n_ID, 1);
13415         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13416
13417         ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13418         desret_xmlParserInputPtr(ret_val);
13419         call_tests++;
13420         des_filepath(n_URL, URL, 0);
13421         des_const_char_ptr(n_ID, (const char *)ID, 1);
13422         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13423         xmlResetLastError();
13424         if (mem_base != xmlMemBlocks()) {
13425             printf("Leak of %d blocks found in xmlLoadExternalEntity",
13426                    xmlMemBlocks() - mem_base);
13427             test_ret++;
13428             printf(" %d", n_URL);
13429             printf(" %d", n_ID);
13430             printf(" %d", n_ctxt);
13431             printf("\n");
13432         }
13433     }
13434     }
13435     }
13436     function_tests++;
13437
13438     return(test_ret);
13439 }
13440
13441
13442 static int
13443 test_xmlNewIOInputStream(void) {
13444     int test_ret = 0;
13445
13446     int mem_base;
13447     xmlParserInputPtr ret_val;
13448     xmlParserCtxtPtr ctxt; /* an XML parser context */
13449     int n_ctxt;
13450     xmlParserInputBufferPtr input; /* an I/O Input */
13451     int n_input;
13452     xmlCharEncoding enc; /* the charset encoding if known */
13453     int n_enc;
13454
13455     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13456     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13457     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13458         mem_base = xmlMemBlocks();
13459         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13460         input = gen_xmlParserInputBufferPtr(n_input, 1);
13461         enc = gen_xmlCharEncoding(n_enc, 2);
13462
13463         ret_val = xmlNewIOInputStream(ctxt, input, enc);
13464         if (ret_val != NULL) input = NULL;
13465         desret_xmlParserInputPtr(ret_val);
13466         call_tests++;
13467         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13468         des_xmlParserInputBufferPtr(n_input, input, 1);
13469         des_xmlCharEncoding(n_enc, enc, 2);
13470         xmlResetLastError();
13471         if (mem_base != xmlMemBlocks()) {
13472             printf("Leak of %d blocks found in xmlNewIOInputStream",
13473                    xmlMemBlocks() - mem_base);
13474             test_ret++;
13475             printf(" %d", n_ctxt);
13476             printf(" %d", n_input);
13477             printf(" %d", n_enc);
13478             printf("\n");
13479         }
13480     }
13481     }
13482     }
13483     function_tests++;
13484
13485     return(test_ret);
13486 }
13487
13488
13489 static int
13490 test_xmlNewParserCtxt(void) {
13491     int test_ret = 0;
13492
13493     int mem_base;
13494     xmlParserCtxtPtr ret_val;
13495
13496         mem_base = xmlMemBlocks();
13497
13498         ret_val = xmlNewParserCtxt();
13499         desret_xmlParserCtxtPtr(ret_val);
13500         call_tests++;
13501         xmlResetLastError();
13502         if (mem_base != xmlMemBlocks()) {
13503             printf("Leak of %d blocks found in xmlNewParserCtxt",
13504                    xmlMemBlocks() - mem_base);
13505             test_ret++;
13506             printf("\n");
13507         }
13508     function_tests++;
13509
13510     return(test_ret);
13511 }
13512
13513
13514 #define gen_nb_xmlNodePtr_ptr 1
13515 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13516     return(NULL);
13517 }
13518 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13519 }
13520
13521 static int
13522 test_xmlParseBalancedChunkMemory(void) {
13523     int test_ret = 0;
13524
13525 #if defined(LIBXML_SAX1_ENABLED)
13526 #ifdef LIBXML_SAX1_ENABLED
13527     int mem_base;
13528     int ret_val;
13529     xmlDocPtr doc; /* the document the chunk pertains to */
13530     int n_doc;
13531     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13532     int n_sax;
13533     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13534     int n_user_data;
13535     int depth; /* Used for loop detection, use 0 */
13536     int n_depth;
13537     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13538     int n_string;
13539     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13540     int n_lst;
13541
13542     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13543     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13544     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13545     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13546     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13547     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13548         mem_base = xmlMemBlocks();
13549         doc = gen_xmlDocPtr(n_doc, 0);
13550         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13551         user_data = gen_userdata(n_user_data, 2);
13552         depth = gen_int(n_depth, 3);
13553         string = gen_const_xmlChar_ptr(n_string, 4);
13554         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13555         
13556 #ifdef LIBXML_SAX1_ENABLED
13557         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13558 #endif
13559
13560
13561         ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13562         desret_int(ret_val);
13563         call_tests++;
13564         des_xmlDocPtr(n_doc, doc, 0);
13565         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13566         des_userdata(n_user_data, user_data, 2);
13567         des_int(n_depth, depth, 3);
13568         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13569         des_xmlNodePtr_ptr(n_lst, lst, 5);
13570         xmlResetLastError();
13571         if (mem_base != xmlMemBlocks()) {
13572             printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13573                    xmlMemBlocks() - mem_base);
13574             test_ret++;
13575             printf(" %d", n_doc);
13576             printf(" %d", n_sax);
13577             printf(" %d", n_user_data);
13578             printf(" %d", n_depth);
13579             printf(" %d", n_string);
13580             printf(" %d", n_lst);
13581             printf("\n");
13582         }
13583     }
13584     }
13585     }
13586     }
13587     }
13588     }
13589     function_tests++;
13590 #endif
13591 #endif
13592
13593     return(test_ret);
13594 }
13595
13596
13597 static int
13598 test_xmlParseBalancedChunkMemoryRecover(void) {
13599     int test_ret = 0;
13600
13601 #if defined(LIBXML_SAX1_ENABLED)
13602 #ifdef LIBXML_SAX1_ENABLED
13603     int mem_base;
13604     int ret_val;
13605     xmlDocPtr doc; /* the document the chunk pertains to */
13606     int n_doc;
13607     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13608     int n_sax;
13609     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13610     int n_user_data;
13611     int depth; /* Used for loop detection, use 0 */
13612     int n_depth;
13613     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13614     int n_string;
13615     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13616     int n_lst;
13617     int recover; /* return nodes even if the data is broken (use 0) */
13618     int n_recover;
13619
13620     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13621     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13622     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13623     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13624     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13625     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13626     for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13627         mem_base = xmlMemBlocks();
13628         doc = gen_xmlDocPtr(n_doc, 0);
13629         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13630         user_data = gen_userdata(n_user_data, 2);
13631         depth = gen_int(n_depth, 3);
13632         string = gen_const_xmlChar_ptr(n_string, 4);
13633         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13634         recover = gen_int(n_recover, 6);
13635         
13636 #ifdef LIBXML_SAX1_ENABLED
13637         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13638 #endif
13639
13640
13641         ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13642         desret_int(ret_val);
13643         call_tests++;
13644         des_xmlDocPtr(n_doc, doc, 0);
13645         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13646         des_userdata(n_user_data, user_data, 2);
13647         des_int(n_depth, depth, 3);
13648         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13649         des_xmlNodePtr_ptr(n_lst, lst, 5);
13650         des_int(n_recover, recover, 6);
13651         xmlResetLastError();
13652         if (mem_base != xmlMemBlocks()) {
13653             printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13654                    xmlMemBlocks() - mem_base);
13655             test_ret++;
13656             printf(" %d", n_doc);
13657             printf(" %d", n_sax);
13658             printf(" %d", n_user_data);
13659             printf(" %d", n_depth);
13660             printf(" %d", n_string);
13661             printf(" %d", n_lst);
13662             printf(" %d", n_recover);
13663             printf("\n");
13664         }
13665     }
13666     }
13667     }
13668     }
13669     }
13670     }
13671     }
13672     function_tests++;
13673 #endif
13674 #endif
13675
13676     return(test_ret);
13677 }
13678
13679
13680 static int
13681 test_xmlParseChunk(void) {
13682     int test_ret = 0;
13683
13684 #if defined(LIBXML_PUSH_ENABLED)
13685     int mem_base;
13686     int ret_val;
13687     xmlParserCtxtPtr ctxt; /* an XML parser context */
13688     int n_ctxt;
13689     char * chunk; /* an char array */
13690     int n_chunk;
13691     int size; /* the size in byte of the chunk */
13692     int n_size;
13693     int terminate; /* last chunk indicator */
13694     int n_terminate;
13695
13696     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13697     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13698     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13699     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13700         mem_base = xmlMemBlocks();
13701         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13702         chunk = gen_const_char_ptr(n_chunk, 1);
13703         size = gen_int(n_size, 2);
13704         terminate = gen_int(n_terminate, 3);
13705
13706         ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13707         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13708         desret_int(ret_val);
13709         call_tests++;
13710         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13711         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13712         des_int(n_size, size, 2);
13713         des_int(n_terminate, terminate, 3);
13714         xmlResetLastError();
13715         if (mem_base != xmlMemBlocks()) {
13716             printf("Leak of %d blocks found in xmlParseChunk",
13717                    xmlMemBlocks() - mem_base);
13718             test_ret++;
13719             printf(" %d", n_ctxt);
13720             printf(" %d", n_chunk);
13721             printf(" %d", n_size);
13722             printf(" %d", n_terminate);
13723             printf("\n");
13724         }
13725     }
13726     }
13727     }
13728     }
13729     function_tests++;
13730 #endif
13731
13732     return(test_ret);
13733 }
13734
13735
13736 static int
13737 test_xmlParseCtxtExternalEntity(void) {
13738     int test_ret = 0;
13739
13740     int mem_base;
13741     int ret_val;
13742     xmlParserCtxtPtr ctx; /* the existing parsing context */
13743     int n_ctx;
13744     xmlChar * URL; /* the URL for the entity to load */
13745     int n_URL;
13746     xmlChar * ID; /* the System ID for the entity to load */
13747     int n_ID;
13748     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13749     int n_lst;
13750
13751     for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13752     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13753     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13754     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13755         mem_base = xmlMemBlocks();
13756         ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13757         URL = gen_const_xmlChar_ptr(n_URL, 1);
13758         ID = gen_const_xmlChar_ptr(n_ID, 2);
13759         lst = gen_xmlNodePtr_ptr(n_lst, 3);
13760
13761         ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13762         desret_int(ret_val);
13763         call_tests++;
13764         des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13765         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13766         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13767         des_xmlNodePtr_ptr(n_lst, lst, 3);
13768         xmlResetLastError();
13769         if (mem_base != xmlMemBlocks()) {
13770             printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13771                    xmlMemBlocks() - mem_base);
13772             test_ret++;
13773             printf(" %d", n_ctx);
13774             printf(" %d", n_URL);
13775             printf(" %d", n_ID);
13776             printf(" %d", n_lst);
13777             printf("\n");
13778         }
13779     }
13780     }
13781     }
13782     }
13783     function_tests++;
13784
13785     return(test_ret);
13786 }
13787
13788
13789 static int
13790 test_xmlParseDTD(void) {
13791     int test_ret = 0;
13792
13793 #if defined(LIBXML_VALID_ENABLED)
13794 #ifdef LIBXML_VALID_ENABLED
13795     int mem_base;
13796     xmlDtdPtr ret_val;
13797     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13798     int n_ExternalID;
13799     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13800     int n_SystemID;
13801
13802     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13803     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13804         mem_base = xmlMemBlocks();
13805         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13806         SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13807
13808         ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13809         desret_xmlDtdPtr(ret_val);
13810         call_tests++;
13811         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13812         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13813         xmlResetLastError();
13814         if (mem_base != xmlMemBlocks()) {
13815             printf("Leak of %d blocks found in xmlParseDTD",
13816                    xmlMemBlocks() - mem_base);
13817             test_ret++;
13818             printf(" %d", n_ExternalID);
13819             printf(" %d", n_SystemID);
13820             printf("\n");
13821         }
13822     }
13823     }
13824     function_tests++;
13825 #endif
13826 #endif
13827
13828     return(test_ret);
13829 }
13830
13831
13832 static int
13833 test_xmlParseDoc(void) {
13834     int test_ret = 0;
13835
13836 #if defined(LIBXML_SAX1_ENABLED)
13837 #ifdef LIBXML_SAX1_ENABLED
13838     int mem_base;
13839     xmlDocPtr ret_val;
13840     xmlChar * cur; /* a pointer to an array of xmlChar */
13841     int n_cur;
13842
13843     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13844         mem_base = xmlMemBlocks();
13845         cur = gen_const_xmlChar_ptr(n_cur, 0);
13846
13847         ret_val = xmlParseDoc((const xmlChar *)cur);
13848         desret_xmlDocPtr(ret_val);
13849         call_tests++;
13850         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13851         xmlResetLastError();
13852         if (mem_base != xmlMemBlocks()) {
13853             printf("Leak of %d blocks found in xmlParseDoc",
13854                    xmlMemBlocks() - mem_base);
13855             test_ret++;
13856             printf(" %d", n_cur);
13857             printf("\n");
13858         }
13859     }
13860     function_tests++;
13861 #endif
13862 #endif
13863
13864     return(test_ret);
13865 }
13866
13867
13868 static int
13869 test_xmlParseDocument(void) {
13870     int test_ret = 0;
13871
13872     int mem_base;
13873     int ret_val;
13874     xmlParserCtxtPtr ctxt; /* an XML parser context */
13875     int n_ctxt;
13876
13877     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13878         mem_base = xmlMemBlocks();
13879         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13880
13881         ret_val = xmlParseDocument(ctxt);
13882         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13883         desret_int(ret_val);
13884         call_tests++;
13885         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13886         xmlResetLastError();
13887         if (mem_base != xmlMemBlocks()) {
13888             printf("Leak of %d blocks found in xmlParseDocument",
13889                    xmlMemBlocks() - mem_base);
13890             test_ret++;
13891             printf(" %d", n_ctxt);
13892             printf("\n");
13893         }
13894     }
13895     function_tests++;
13896
13897     return(test_ret);
13898 }
13899
13900
13901 static int
13902 test_xmlParseEntity(void) {
13903     int test_ret = 0;
13904
13905 #if defined(LIBXML_SAX1_ENABLED)
13906 #ifdef LIBXML_SAX1_ENABLED
13907     int mem_base;
13908     xmlDocPtr ret_val;
13909     const char * filename; /* the filename */
13910     int n_filename;
13911
13912     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13913         mem_base = xmlMemBlocks();
13914         filename = gen_filepath(n_filename, 0);
13915
13916         ret_val = xmlParseEntity(filename);
13917         desret_xmlDocPtr(ret_val);
13918         call_tests++;
13919         des_filepath(n_filename, filename, 0);
13920         xmlResetLastError();
13921         if (mem_base != xmlMemBlocks()) {
13922             printf("Leak of %d blocks found in xmlParseEntity",
13923                    xmlMemBlocks() - mem_base);
13924             test_ret++;
13925             printf(" %d", n_filename);
13926             printf("\n");
13927         }
13928     }
13929     function_tests++;
13930 #endif
13931 #endif
13932
13933     return(test_ret);
13934 }
13935
13936
13937 static int
13938 test_xmlParseExtParsedEnt(void) {
13939     int test_ret = 0;
13940
13941     int mem_base;
13942     int ret_val;
13943     xmlParserCtxtPtr ctxt; /* an XML parser context */
13944     int n_ctxt;
13945
13946     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13947         mem_base = xmlMemBlocks();
13948         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13949
13950         ret_val = xmlParseExtParsedEnt(ctxt);
13951         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13952         desret_int(ret_val);
13953         call_tests++;
13954         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13955         xmlResetLastError();
13956         if (mem_base != xmlMemBlocks()) {
13957             printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13958                    xmlMemBlocks() - mem_base);
13959             test_ret++;
13960             printf(" %d", n_ctxt);
13961             printf("\n");
13962         }
13963     }
13964     function_tests++;
13965
13966     return(test_ret);
13967 }
13968
13969
13970 static int
13971 test_xmlParseExternalEntity(void) {
13972     int test_ret = 0;
13973
13974 #if defined(LIBXML_SAX1_ENABLED)
13975 #ifdef LIBXML_SAX1_ENABLED
13976     int mem_base;
13977     int ret_val;
13978     xmlDocPtr doc; /* the document the chunk pertains to */
13979     int n_doc;
13980     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13981     int n_sax;
13982     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13983     int n_user_data;
13984     int depth; /* Used for loop detection, use 0 */
13985     int n_depth;
13986     xmlChar * URL; /* the URL for the entity to load */
13987     int n_URL;
13988     xmlChar * ID; /* the System ID for the entity to load */
13989     int n_ID;
13990     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13991     int n_lst;
13992
13993     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13994     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13995     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13996     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13997     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13998     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13999     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14000         mem_base = xmlMemBlocks();
14001         doc = gen_xmlDocPtr(n_doc, 0);
14002         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14003         user_data = gen_userdata(n_user_data, 2);
14004         depth = gen_int(n_depth, 3);
14005         URL = gen_const_xmlChar_ptr(n_URL, 4);
14006         ID = gen_const_xmlChar_ptr(n_ID, 5);
14007         lst = gen_xmlNodePtr_ptr(n_lst, 6);
14008
14009         ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14010         desret_int(ret_val);
14011         call_tests++;
14012         des_xmlDocPtr(n_doc, doc, 0);
14013         des_xmlSAXHandlerPtr(n_sax, sax, 1);
14014         des_userdata(n_user_data, user_data, 2);
14015         des_int(n_depth, depth, 3);
14016         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14017         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14018         des_xmlNodePtr_ptr(n_lst, lst, 6);
14019         xmlResetLastError();
14020         if (mem_base != xmlMemBlocks()) {
14021             printf("Leak of %d blocks found in xmlParseExternalEntity",
14022                    xmlMemBlocks() - mem_base);
14023             test_ret++;
14024             printf(" %d", n_doc);
14025             printf(" %d", n_sax);
14026             printf(" %d", n_user_data);
14027             printf(" %d", n_depth);
14028             printf(" %d", n_URL);
14029             printf(" %d", n_ID);
14030             printf(" %d", n_lst);
14031             printf("\n");
14032         }
14033     }
14034     }
14035     }
14036     }
14037     }
14038     }
14039     }
14040     function_tests++;
14041 #endif
14042 #endif
14043
14044     return(test_ret);
14045 }
14046
14047
14048 static int
14049 test_xmlParseFile(void) {
14050     int test_ret = 0;
14051
14052 #if defined(LIBXML_SAX1_ENABLED)
14053 #ifdef LIBXML_SAX1_ENABLED
14054     int mem_base;
14055     xmlDocPtr ret_val;
14056     const char * filename; /* the filename */
14057     int n_filename;
14058
14059     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14060         mem_base = xmlMemBlocks();
14061         filename = gen_filepath(n_filename, 0);
14062
14063         ret_val = xmlParseFile(filename);
14064         desret_xmlDocPtr(ret_val);
14065         call_tests++;
14066         des_filepath(n_filename, filename, 0);
14067         xmlResetLastError();
14068         if (mem_base != xmlMemBlocks()) {
14069             printf("Leak of %d blocks found in xmlParseFile",
14070                    xmlMemBlocks() - mem_base);
14071             test_ret++;
14072             printf(" %d", n_filename);
14073             printf("\n");
14074         }
14075     }
14076     function_tests++;
14077 #endif
14078 #endif
14079
14080     return(test_ret);
14081 }
14082
14083
14084 static int
14085 test_xmlParseInNodeContext(void) {
14086     int test_ret = 0;
14087
14088     int mem_base;
14089     xmlParserErrors ret_val;
14090     xmlNodePtr node; /* the context node */
14091     int n_node;
14092     char * data; /* the input string */
14093     int n_data;
14094     int datalen; /* the input string length in bytes */
14095     int n_datalen;
14096     int options; /* a combination of xmlParserOption */
14097     int n_options;
14098     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14099     int n_lst;
14100
14101     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14102     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14103     for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14104     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14105     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14106         mem_base = xmlMemBlocks();
14107         node = gen_xmlNodePtr(n_node, 0);
14108         data = gen_const_char_ptr(n_data, 1);
14109         datalen = gen_int(n_datalen, 2);
14110         options = gen_parseroptions(n_options, 3);
14111         lst = gen_xmlNodePtr_ptr(n_lst, 4);
14112
14113         ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14114         desret_xmlParserErrors(ret_val);
14115         call_tests++;
14116         des_xmlNodePtr(n_node, node, 0);
14117         des_const_char_ptr(n_data, (const char *)data, 1);
14118         des_int(n_datalen, datalen, 2);
14119         des_parseroptions(n_options, options, 3);
14120         des_xmlNodePtr_ptr(n_lst, lst, 4);
14121         xmlResetLastError();
14122         if (mem_base != xmlMemBlocks()) {
14123             printf("Leak of %d blocks found in xmlParseInNodeContext",
14124                    xmlMemBlocks() - mem_base);
14125             test_ret++;
14126             printf(" %d", n_node);
14127             printf(" %d", n_data);
14128             printf(" %d", n_datalen);
14129             printf(" %d", n_options);
14130             printf(" %d", n_lst);
14131             printf("\n");
14132         }
14133     }
14134     }
14135     }
14136     }
14137     }
14138     function_tests++;
14139
14140     return(test_ret);
14141 }
14142
14143
14144 static int
14145 test_xmlParseMemory(void) {
14146     int test_ret = 0;
14147
14148 #if defined(LIBXML_SAX1_ENABLED)
14149 #ifdef LIBXML_SAX1_ENABLED
14150     int mem_base;
14151     xmlDocPtr ret_val;
14152     char * buffer; /* an pointer to a char array */
14153     int n_buffer;
14154     int size; /* the size of the array */
14155     int n_size;
14156
14157     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14158     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14159         mem_base = xmlMemBlocks();
14160         buffer = gen_const_char_ptr(n_buffer, 0);
14161         size = gen_int(n_size, 1);
14162
14163         ret_val = xmlParseMemory((const char *)buffer, size);
14164         desret_xmlDocPtr(ret_val);
14165         call_tests++;
14166         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14167         des_int(n_size, size, 1);
14168         xmlResetLastError();
14169         if (mem_base != xmlMemBlocks()) {
14170             printf("Leak of %d blocks found in xmlParseMemory",
14171                    xmlMemBlocks() - mem_base);
14172             test_ret++;
14173             printf(" %d", n_buffer);
14174             printf(" %d", n_size);
14175             printf("\n");
14176         }
14177     }
14178     }
14179     function_tests++;
14180 #endif
14181 #endif
14182
14183     return(test_ret);
14184 }
14185
14186
14187 #define gen_nb_const_xmlParserNodeInfoPtr 1
14188 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14189     return(NULL);
14190 }
14191 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14192 }
14193
14194 static int
14195 test_xmlParserAddNodeInfo(void) {
14196     int test_ret = 0;
14197
14198     int mem_base;
14199     xmlParserCtxtPtr ctxt; /* an XML parser context */
14200     int n_ctxt;
14201     xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14202     int n_info;
14203
14204     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14205     for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14206         mem_base = xmlMemBlocks();
14207         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14208         info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14209
14210         xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14211         call_tests++;
14212         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14213         des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14214         xmlResetLastError();
14215         if (mem_base != xmlMemBlocks()) {
14216             printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14217                    xmlMemBlocks() - mem_base);
14218             test_ret++;
14219             printf(" %d", n_ctxt);
14220             printf(" %d", n_info);
14221             printf("\n");
14222         }
14223     }
14224     }
14225     function_tests++;
14226
14227     return(test_ret);
14228 }
14229
14230
14231 #define gen_nb_const_xmlParserCtxtPtr 1
14232 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14233     return(NULL);
14234 }
14235 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14236 }
14237
14238 #define gen_nb_const_xmlNodePtr 1
14239 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14240     return(NULL);
14241 }
14242 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14243 }
14244
14245 static int
14246 test_xmlParserFindNodeInfo(void) {
14247     int test_ret = 0;
14248
14249     int mem_base;
14250     const xmlParserNodeInfo * ret_val;
14251     xmlParserCtxtPtr ctx; /* an XML parser context */
14252     int n_ctx;
14253     xmlNodePtr node; /* an XML node within the tree */
14254     int n_node;
14255
14256     for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14257     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14258         mem_base = xmlMemBlocks();
14259         ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14260         node = gen_const_xmlNodePtr(n_node, 1);
14261
14262         ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14263         desret_const_xmlParserNodeInfo_ptr(ret_val);
14264         call_tests++;
14265         des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14266         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14267         xmlResetLastError();
14268         if (mem_base != xmlMemBlocks()) {
14269             printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14270                    xmlMemBlocks() - mem_base);
14271             test_ret++;
14272             printf(" %d", n_ctx);
14273             printf(" %d", n_node);
14274             printf("\n");
14275         }
14276     }
14277     }
14278     function_tests++;
14279
14280     return(test_ret);
14281 }
14282
14283
14284 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14285 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14286     return(NULL);
14287 }
14288 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14289 }
14290
14291 static int
14292 test_xmlParserFindNodeInfoIndex(void) {
14293     int test_ret = 0;
14294
14295     int mem_base;
14296     unsigned long ret_val;
14297     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14298     int n_seq;
14299     xmlNodePtr node; /* an XML node pointer */
14300     int n_node;
14301
14302     for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14303     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14304         mem_base = xmlMemBlocks();
14305         seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14306         node = gen_const_xmlNodePtr(n_node, 1);
14307
14308         ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14309         desret_unsigned_long(ret_val);
14310         call_tests++;
14311         des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14312         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14313         xmlResetLastError();
14314         if (mem_base != xmlMemBlocks()) {
14315             printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14316                    xmlMemBlocks() - mem_base);
14317             test_ret++;
14318             printf(" %d", n_seq);
14319             printf(" %d", n_node);
14320             printf("\n");
14321         }
14322     }
14323     }
14324     function_tests++;
14325
14326     return(test_ret);
14327 }
14328
14329
14330 #define gen_nb_xmlParserInputPtr 1
14331 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14332     return(NULL);
14333 }
14334 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14335 }
14336
14337 static int
14338 test_xmlParserInputGrow(void) {
14339     int test_ret = 0;
14340
14341     int mem_base;
14342     int ret_val;
14343     xmlParserInputPtr in; /* an XML parser input */
14344     int n_in;
14345     int len; /* an indicative size for the lookahead */
14346     int n_len;
14347
14348     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14349     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14350         mem_base = xmlMemBlocks();
14351         in = gen_xmlParserInputPtr(n_in, 0);
14352         len = gen_int(n_len, 1);
14353
14354         ret_val = xmlParserInputGrow(in, len);
14355         desret_int(ret_val);
14356         call_tests++;
14357         des_xmlParserInputPtr(n_in, in, 0);
14358         des_int(n_len, len, 1);
14359         xmlResetLastError();
14360         if (mem_base != xmlMemBlocks()) {
14361             printf("Leak of %d blocks found in xmlParserInputGrow",
14362                    xmlMemBlocks() - mem_base);
14363             test_ret++;
14364             printf(" %d", n_in);
14365             printf(" %d", n_len);
14366             printf("\n");
14367         }
14368     }
14369     }
14370     function_tests++;
14371
14372     return(test_ret);
14373 }
14374
14375
14376 static int
14377 test_xmlParserInputRead(void) {
14378     int test_ret = 0;
14379
14380     int mem_base;
14381     int ret_val;
14382     xmlParserInputPtr in; /* an XML parser input */
14383     int n_in;
14384     int len; /* an indicative size for the lookahead */
14385     int n_len;
14386
14387     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14388     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14389         mem_base = xmlMemBlocks();
14390         in = gen_xmlParserInputPtr(n_in, 0);
14391         len = gen_int(n_len, 1);
14392
14393         ret_val = xmlParserInputRead(in, len);
14394         desret_int(ret_val);
14395         call_tests++;
14396         des_xmlParserInputPtr(n_in, in, 0);
14397         des_int(n_len, len, 1);
14398         xmlResetLastError();
14399         if (mem_base != xmlMemBlocks()) {
14400             printf("Leak of %d blocks found in xmlParserInputRead",
14401                    xmlMemBlocks() - mem_base);
14402             test_ret++;
14403             printf(" %d", n_in);
14404             printf(" %d", n_len);
14405             printf("\n");
14406         }
14407     }
14408     }
14409     function_tests++;
14410
14411     return(test_ret);
14412 }
14413
14414
14415 static int
14416 test_xmlPedanticParserDefault(void) {
14417     int test_ret = 0;
14418
14419     int mem_base;
14420     int ret_val;
14421     int val; /* int 0 or 1 */
14422     int n_val;
14423
14424     for (n_val = 0;n_val < gen_nb_int;n_val++) {
14425         mem_base = xmlMemBlocks();
14426         val = gen_int(n_val, 0);
14427
14428         ret_val = xmlPedanticParserDefault(val);
14429         desret_int(ret_val);
14430         call_tests++;
14431         des_int(n_val, val, 0);
14432         xmlResetLastError();
14433         if (mem_base != xmlMemBlocks()) {
14434             printf("Leak of %d blocks found in xmlPedanticParserDefault",
14435                    xmlMemBlocks() - mem_base);
14436             test_ret++;
14437             printf(" %d", n_val);
14438             printf("\n");
14439         }
14440     }
14441     function_tests++;
14442
14443     return(test_ret);
14444 }
14445
14446
14447 static int
14448 test_xmlReadDoc(void) {
14449     int test_ret = 0;
14450
14451     int mem_base;
14452     xmlDocPtr ret_val;
14453     xmlChar * cur; /* a pointer to a zero terminated string */
14454     int n_cur;
14455     const char * URL; /* the base URL to use for the document */
14456     int n_URL;
14457     char * encoding; /* the document encoding, or NULL */
14458     int n_encoding;
14459     int options; /* a combination of xmlParserOption */
14460     int n_options;
14461
14462     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14463     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14464     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14465     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14466         mem_base = xmlMemBlocks();
14467         cur = gen_const_xmlChar_ptr(n_cur, 0);
14468         URL = gen_filepath(n_URL, 1);
14469         encoding = gen_const_char_ptr(n_encoding, 2);
14470         options = gen_parseroptions(n_options, 3);
14471
14472         ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14473         desret_xmlDocPtr(ret_val);
14474         call_tests++;
14475         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14476         des_filepath(n_URL, URL, 1);
14477         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14478         des_parseroptions(n_options, options, 3);
14479         xmlResetLastError();
14480         if (mem_base != xmlMemBlocks()) {
14481             printf("Leak of %d blocks found in xmlReadDoc",
14482                    xmlMemBlocks() - mem_base);
14483             test_ret++;
14484             printf(" %d", n_cur);
14485             printf(" %d", n_URL);
14486             printf(" %d", n_encoding);
14487             printf(" %d", n_options);
14488             printf("\n");
14489         }
14490     }
14491     }
14492     }
14493     }
14494     function_tests++;
14495
14496     return(test_ret);
14497 }
14498
14499
14500 static int
14501 test_xmlReadFile(void) {
14502     int test_ret = 0;
14503
14504     int mem_base;
14505     xmlDocPtr ret_val;
14506     const char * filename; /* a file or URL */
14507     int n_filename;
14508     char * encoding; /* the document encoding, or NULL */
14509     int n_encoding;
14510     int options; /* a combination of xmlParserOption */
14511     int n_options;
14512
14513     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14514     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14515     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14516         mem_base = xmlMemBlocks();
14517         filename = gen_filepath(n_filename, 0);
14518         encoding = gen_const_char_ptr(n_encoding, 1);
14519         options = gen_parseroptions(n_options, 2);
14520
14521         ret_val = xmlReadFile(filename, (const char *)encoding, options);
14522         desret_xmlDocPtr(ret_val);
14523         call_tests++;
14524         des_filepath(n_filename, filename, 0);
14525         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14526         des_parseroptions(n_options, options, 2);
14527         xmlResetLastError();
14528         if (mem_base != xmlMemBlocks()) {
14529             printf("Leak of %d blocks found in xmlReadFile",
14530                    xmlMemBlocks() - mem_base);
14531             test_ret++;
14532             printf(" %d", n_filename);
14533             printf(" %d", n_encoding);
14534             printf(" %d", n_options);
14535             printf("\n");
14536         }
14537     }
14538     }
14539     }
14540     function_tests++;
14541
14542     return(test_ret);
14543 }
14544
14545
14546 static int
14547 test_xmlReadMemory(void) {
14548     int test_ret = 0;
14549
14550     int mem_base;
14551     xmlDocPtr ret_val;
14552     char * buffer; /* a pointer to a char array */
14553     int n_buffer;
14554     int size; /* the size of the array */
14555     int n_size;
14556     const char * URL; /* the base URL to use for the document */
14557     int n_URL;
14558     char * encoding; /* the document encoding, or NULL */
14559     int n_encoding;
14560     int options; /* a combination of xmlParserOption */
14561     int n_options;
14562
14563     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14564     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14565     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
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         buffer = gen_const_char_ptr(n_buffer, 0);
14570         size = gen_int(n_size, 1);
14571         URL = gen_filepath(n_URL, 2);
14572         encoding = gen_const_char_ptr(n_encoding, 3);
14573         options = gen_parseroptions(n_options, 4);
14574
14575         ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14576         desret_xmlDocPtr(ret_val);
14577         call_tests++;
14578         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14579         des_int(n_size, size, 1);
14580         des_filepath(n_URL, URL, 2);
14581         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14582         des_parseroptions(n_options, options, 4);
14583         xmlResetLastError();
14584         if (mem_base != xmlMemBlocks()) {
14585             printf("Leak of %d blocks found in xmlReadMemory",
14586                    xmlMemBlocks() - mem_base);
14587             test_ret++;
14588             printf(" %d", n_buffer);
14589             printf(" %d", n_size);
14590             printf(" %d", n_URL);
14591             printf(" %d", n_encoding);
14592             printf(" %d", n_options);
14593             printf("\n");
14594         }
14595     }
14596     }
14597     }
14598     }
14599     }
14600     function_tests++;
14601
14602     return(test_ret);
14603 }
14604
14605
14606 static int
14607 test_xmlRecoverDoc(void) {
14608     int test_ret = 0;
14609
14610 #if defined(LIBXML_SAX1_ENABLED)
14611 #ifdef LIBXML_SAX1_ENABLED
14612     int mem_base;
14613     xmlDocPtr ret_val;
14614     xmlChar * cur; /* a pointer to an array of xmlChar */
14615     int n_cur;
14616
14617     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14618         mem_base = xmlMemBlocks();
14619         cur = gen_const_xmlChar_ptr(n_cur, 0);
14620
14621         ret_val = xmlRecoverDoc((const xmlChar *)cur);
14622         desret_xmlDocPtr(ret_val);
14623         call_tests++;
14624         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14625         xmlResetLastError();
14626         if (mem_base != xmlMemBlocks()) {
14627             printf("Leak of %d blocks found in xmlRecoverDoc",
14628                    xmlMemBlocks() - mem_base);
14629             test_ret++;
14630             printf(" %d", n_cur);
14631             printf("\n");
14632         }
14633     }
14634     function_tests++;
14635 #endif
14636 #endif
14637
14638     return(test_ret);
14639 }
14640
14641
14642 static int
14643 test_xmlRecoverFile(void) {
14644     int test_ret = 0;
14645
14646 #if defined(LIBXML_SAX1_ENABLED)
14647 #ifdef LIBXML_SAX1_ENABLED
14648     int mem_base;
14649     xmlDocPtr ret_val;
14650     const char * filename; /* the filename */
14651     int n_filename;
14652
14653     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14654         mem_base = xmlMemBlocks();
14655         filename = gen_filepath(n_filename, 0);
14656
14657         ret_val = xmlRecoverFile(filename);
14658         desret_xmlDocPtr(ret_val);
14659         call_tests++;
14660         des_filepath(n_filename, filename, 0);
14661         xmlResetLastError();
14662         if (mem_base != xmlMemBlocks()) {
14663             printf("Leak of %d blocks found in xmlRecoverFile",
14664                    xmlMemBlocks() - mem_base);
14665             test_ret++;
14666             printf(" %d", n_filename);
14667             printf("\n");
14668         }
14669     }
14670     function_tests++;
14671 #endif
14672 #endif
14673
14674     return(test_ret);
14675 }
14676
14677
14678 static int
14679 test_xmlRecoverMemory(void) {
14680     int test_ret = 0;
14681
14682 #if defined(LIBXML_SAX1_ENABLED)
14683 #ifdef LIBXML_SAX1_ENABLED
14684     int mem_base;
14685     xmlDocPtr ret_val;
14686     char * buffer; /* an pointer to a char array */
14687     int n_buffer;
14688     int size; /* the size of the array */
14689     int n_size;
14690
14691     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14692     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14693         mem_base = xmlMemBlocks();
14694         buffer = gen_const_char_ptr(n_buffer, 0);
14695         size = gen_int(n_size, 1);
14696
14697         ret_val = xmlRecoverMemory((const char *)buffer, size);
14698         desret_xmlDocPtr(ret_val);
14699         call_tests++;
14700         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14701         des_int(n_size, size, 1);
14702         xmlResetLastError();
14703         if (mem_base != xmlMemBlocks()) {
14704             printf("Leak of %d blocks found in xmlRecoverMemory",
14705                    xmlMemBlocks() - mem_base);
14706             test_ret++;
14707             printf(" %d", n_buffer);
14708             printf(" %d", n_size);
14709             printf("\n");
14710         }
14711     }
14712     }
14713     function_tests++;
14714 #endif
14715 #endif
14716
14717     return(test_ret);
14718 }
14719
14720
14721 static int
14722 test_xmlSAXParseDTD(void) {
14723     int test_ret = 0;
14724
14725 #if defined(LIBXML_VALID_ENABLED)
14726 #ifdef LIBXML_SAX1_ENABLED
14727     int mem_base;
14728     xmlDtdPtr ret_val;
14729     xmlSAXHandlerPtr sax; /* the SAX handler block */
14730     int n_sax;
14731     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14732     int n_ExternalID;
14733     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14734     int n_SystemID;
14735
14736     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14737     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14738     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14739         mem_base = xmlMemBlocks();
14740         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14741         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14742         SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14743
14744         ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14745         desret_xmlDtdPtr(ret_val);
14746         call_tests++;
14747         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14748         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14749         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14750         xmlResetLastError();
14751         if (mem_base != xmlMemBlocks()) {
14752             printf("Leak of %d blocks found in xmlSAXParseDTD",
14753                    xmlMemBlocks() - mem_base);
14754             test_ret++;
14755             printf(" %d", n_sax);
14756             printf(" %d", n_ExternalID);
14757             printf(" %d", n_SystemID);
14758             printf("\n");
14759         }
14760     }
14761     }
14762     }
14763     function_tests++;
14764 #endif
14765 #endif
14766
14767     return(test_ret);
14768 }
14769
14770
14771 static int
14772 test_xmlSAXParseDoc(void) {
14773     int test_ret = 0;
14774
14775 #if defined(LIBXML_SAX1_ENABLED)
14776 #ifdef LIBXML_SAX1_ENABLED
14777     int mem_base;
14778     xmlDocPtr ret_val;
14779     xmlSAXHandlerPtr sax; /* the SAX handler block */
14780     int n_sax;
14781     xmlChar * cur; /* a pointer to an array of xmlChar */
14782     int n_cur;
14783     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14784     int n_recovery;
14785
14786     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14787     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14788     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14789         mem_base = xmlMemBlocks();
14790         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14791         cur = gen_const_xmlChar_ptr(n_cur, 1);
14792         recovery = gen_int(n_recovery, 2);
14793
14794         ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14795         desret_xmlDocPtr(ret_val);
14796         call_tests++;
14797         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14798         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14799         des_int(n_recovery, recovery, 2);
14800         xmlResetLastError();
14801         if (mem_base != xmlMemBlocks()) {
14802             printf("Leak of %d blocks found in xmlSAXParseDoc",
14803                    xmlMemBlocks() - mem_base);
14804             test_ret++;
14805             printf(" %d", n_sax);
14806             printf(" %d", n_cur);
14807             printf(" %d", n_recovery);
14808             printf("\n");
14809         }
14810     }
14811     }
14812     }
14813     function_tests++;
14814 #endif
14815 #endif
14816
14817     return(test_ret);
14818 }
14819
14820
14821 static int
14822 test_xmlSAXParseEntity(void) {
14823     int test_ret = 0;
14824
14825 #if defined(LIBXML_SAX1_ENABLED)
14826 #ifdef LIBXML_SAX1_ENABLED
14827     int mem_base;
14828     xmlDocPtr ret_val;
14829     xmlSAXHandlerPtr sax; /* the SAX handler block */
14830     int n_sax;
14831     const char * filename; /* the filename */
14832     int n_filename;
14833
14834     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14835     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14836         mem_base = xmlMemBlocks();
14837         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14838         filename = gen_filepath(n_filename, 1);
14839
14840         ret_val = xmlSAXParseEntity(sax, filename);
14841         desret_xmlDocPtr(ret_val);
14842         call_tests++;
14843         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14844         des_filepath(n_filename, filename, 1);
14845         xmlResetLastError();
14846         if (mem_base != xmlMemBlocks()) {
14847             printf("Leak of %d blocks found in xmlSAXParseEntity",
14848                    xmlMemBlocks() - mem_base);
14849             test_ret++;
14850             printf(" %d", n_sax);
14851             printf(" %d", n_filename);
14852             printf("\n");
14853         }
14854     }
14855     }
14856     function_tests++;
14857 #endif
14858 #endif
14859
14860     return(test_ret);
14861 }
14862
14863
14864 static int
14865 test_xmlSAXParseFile(void) {
14866     int test_ret = 0;
14867
14868 #if defined(LIBXML_SAX1_ENABLED)
14869 #ifdef LIBXML_SAX1_ENABLED
14870     int mem_base;
14871     xmlDocPtr ret_val;
14872     xmlSAXHandlerPtr sax; /* the SAX handler block */
14873     int n_sax;
14874     const char * filename; /* the filename */
14875     int n_filename;
14876     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14877     int n_recovery;
14878
14879     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14880     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14881     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14882         mem_base = xmlMemBlocks();
14883         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14884         filename = gen_filepath(n_filename, 1);
14885         recovery = gen_int(n_recovery, 2);
14886
14887         ret_val = xmlSAXParseFile(sax, filename, recovery);
14888         desret_xmlDocPtr(ret_val);
14889         call_tests++;
14890         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14891         des_filepath(n_filename, filename, 1);
14892         des_int(n_recovery, recovery, 2);
14893         xmlResetLastError();
14894         if (mem_base != xmlMemBlocks()) {
14895             printf("Leak of %d blocks found in xmlSAXParseFile",
14896                    xmlMemBlocks() - mem_base);
14897             test_ret++;
14898             printf(" %d", n_sax);
14899             printf(" %d", n_filename);
14900             printf(" %d", n_recovery);
14901             printf("\n");
14902         }
14903     }
14904     }
14905     }
14906     function_tests++;
14907 #endif
14908 #endif
14909
14910     return(test_ret);
14911 }
14912
14913
14914 static int
14915 test_xmlSAXParseFileWithData(void) {
14916     int test_ret = 0;
14917
14918 #if defined(LIBXML_SAX1_ENABLED)
14919 #ifdef LIBXML_SAX1_ENABLED
14920     int mem_base;
14921     xmlDocPtr ret_val;
14922     xmlSAXHandlerPtr sax; /* the SAX handler block */
14923     int n_sax;
14924     const char * filename; /* the filename */
14925     int n_filename;
14926     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14927     int n_recovery;
14928     void * data; /* the userdata */
14929     int n_data;
14930
14931     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14932     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14933     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14934     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14935         mem_base = xmlMemBlocks();
14936         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14937         filename = gen_filepath(n_filename, 1);
14938         recovery = gen_int(n_recovery, 2);
14939         data = gen_userdata(n_data, 3);
14940
14941         ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14942         desret_xmlDocPtr(ret_val);
14943         call_tests++;
14944         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14945         des_filepath(n_filename, filename, 1);
14946         des_int(n_recovery, recovery, 2);
14947         des_userdata(n_data, data, 3);
14948         xmlResetLastError();
14949         if (mem_base != xmlMemBlocks()) {
14950             printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14951                    xmlMemBlocks() - mem_base);
14952             test_ret++;
14953             printf(" %d", n_sax);
14954             printf(" %d", n_filename);
14955             printf(" %d", n_recovery);
14956             printf(" %d", n_data);
14957             printf("\n");
14958         }
14959     }
14960     }
14961     }
14962     }
14963     function_tests++;
14964 #endif
14965 #endif
14966
14967     return(test_ret);
14968 }
14969
14970
14971 static int
14972 test_xmlSAXParseMemory(void) {
14973     int test_ret = 0;
14974
14975 #if defined(LIBXML_SAX1_ENABLED)
14976 #ifdef LIBXML_SAX1_ENABLED
14977     int mem_base;
14978     xmlDocPtr ret_val;
14979     xmlSAXHandlerPtr sax; /* the SAX handler block */
14980     int n_sax;
14981     char * buffer; /* an pointer to a char array */
14982     int n_buffer;
14983     int size; /* the size of the array */
14984     int n_size;
14985     int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14986     int n_recovery;
14987
14988     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14989     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14990     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14991     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14992         mem_base = xmlMemBlocks();
14993         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14994         buffer = gen_const_char_ptr(n_buffer, 1);
14995         size = gen_int(n_size, 2);
14996         recovery = gen_int(n_recovery, 3);
14997
14998         ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14999         desret_xmlDocPtr(ret_val);
15000         call_tests++;
15001         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15002         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15003         des_int(n_size, size, 2);
15004         des_int(n_recovery, recovery, 3);
15005         xmlResetLastError();
15006         if (mem_base != xmlMemBlocks()) {
15007             printf("Leak of %d blocks found in xmlSAXParseMemory",
15008                    xmlMemBlocks() - mem_base);
15009             test_ret++;
15010             printf(" %d", n_sax);
15011             printf(" %d", n_buffer);
15012             printf(" %d", n_size);
15013             printf(" %d", n_recovery);
15014             printf("\n");
15015         }
15016     }
15017     }
15018     }
15019     }
15020     function_tests++;
15021 #endif
15022 #endif
15023
15024     return(test_ret);
15025 }
15026
15027
15028 static int
15029 test_xmlSAXParseMemoryWithData(void) {
15030     int test_ret = 0;
15031
15032 #if defined(LIBXML_SAX1_ENABLED)
15033 #ifdef LIBXML_SAX1_ENABLED
15034     int mem_base;
15035     xmlDocPtr ret_val;
15036     xmlSAXHandlerPtr sax; /* the SAX handler block */
15037     int n_sax;
15038     char * buffer; /* an pointer to a char array */
15039     int n_buffer;
15040     int size; /* the size of the array */
15041     int n_size;
15042     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15043     int n_recovery;
15044     void * data; /* the userdata */
15045     int n_data;
15046
15047     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15048     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15049     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15050     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15051     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15052         mem_base = xmlMemBlocks();
15053         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15054         buffer = gen_const_char_ptr(n_buffer, 1);
15055         size = gen_int(n_size, 2);
15056         recovery = gen_int(n_recovery, 3);
15057         data = gen_userdata(n_data, 4);
15058
15059         ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
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         des_userdata(n_data, data, 4);
15067         xmlResetLastError();
15068         if (mem_base != xmlMemBlocks()) {
15069             printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15070                    xmlMemBlocks() - mem_base);
15071             test_ret++;
15072             printf(" %d", n_sax);
15073             printf(" %d", n_buffer);
15074             printf(" %d", n_size);
15075             printf(" %d", n_recovery);
15076             printf(" %d", n_data);
15077             printf("\n");
15078         }
15079     }
15080     }
15081     }
15082     }
15083     }
15084     function_tests++;
15085 #endif
15086 #endif
15087
15088     return(test_ret);
15089 }
15090
15091
15092 static int
15093 test_xmlSAXUserParseFile(void) {
15094     int test_ret = 0;
15095
15096 #if defined(LIBXML_SAX1_ENABLED)
15097 #ifdef LIBXML_SAX1_ENABLED
15098     int mem_base;
15099     int ret_val;
15100     xmlSAXHandlerPtr sax; /* a SAX handler */
15101     int n_sax;
15102     void * user_data; /* The user data returned on SAX callbacks */
15103     int n_user_data;
15104     const char * filename; /* a file name */
15105     int n_filename;
15106
15107     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15108     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15109     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15110         mem_base = xmlMemBlocks();
15111         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15112         user_data = gen_userdata(n_user_data, 1);
15113         filename = gen_filepath(n_filename, 2);
15114         
15115 #ifdef LIBXML_SAX1_ENABLED
15116         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15117 #endif
15118
15119
15120         ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15121         desret_int(ret_val);
15122         call_tests++;
15123         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15124         des_userdata(n_user_data, user_data, 1);
15125         des_filepath(n_filename, filename, 2);
15126         xmlResetLastError();
15127         if (mem_base != xmlMemBlocks()) {
15128             printf("Leak of %d blocks found in xmlSAXUserParseFile",
15129                    xmlMemBlocks() - mem_base);
15130             test_ret++;
15131             printf(" %d", n_sax);
15132             printf(" %d", n_user_data);
15133             printf(" %d", n_filename);
15134             printf("\n");
15135         }
15136     }
15137     }
15138     }
15139     function_tests++;
15140 #endif
15141 #endif
15142
15143     return(test_ret);
15144 }
15145
15146
15147 static int
15148 test_xmlSAXUserParseMemory(void) {
15149     int test_ret = 0;
15150
15151 #if defined(LIBXML_SAX1_ENABLED)
15152 #ifdef LIBXML_SAX1_ENABLED
15153     int mem_base;
15154     int ret_val;
15155     xmlSAXHandlerPtr sax; /* a SAX handler */
15156     int n_sax;
15157     void * user_data; /* The user data returned on SAX callbacks */
15158     int n_user_data;
15159     char * buffer; /* an in-memory XML document input */
15160     int n_buffer;
15161     int size; /* the length of the XML document in bytes */
15162     int n_size;
15163
15164     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15165     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15166     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15167     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15168         mem_base = xmlMemBlocks();
15169         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15170         user_data = gen_userdata(n_user_data, 1);
15171         buffer = gen_const_char_ptr(n_buffer, 2);
15172         size = gen_int(n_size, 3);
15173         
15174 #ifdef LIBXML_SAX1_ENABLED
15175         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15176 #endif
15177
15178
15179         ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15180         desret_int(ret_val);
15181         call_tests++;
15182         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15183         des_userdata(n_user_data, user_data, 1);
15184         des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15185         des_int(n_size, size, 3);
15186         xmlResetLastError();
15187         if (mem_base != xmlMemBlocks()) {
15188             printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15189                    xmlMemBlocks() - mem_base);
15190             test_ret++;
15191             printf(" %d", n_sax);
15192             printf(" %d", n_user_data);
15193             printf(" %d", n_buffer);
15194             printf(" %d", n_size);
15195             printf("\n");
15196         }
15197     }
15198     }
15199     }
15200     }
15201     function_tests++;
15202 #endif
15203 #endif
15204
15205     return(test_ret);
15206 }
15207
15208
15209 static int
15210 test_xmlSetExternalEntityLoader(void) {
15211     int test_ret = 0;
15212
15213
15214     /* missing type support */
15215     return(test_ret);
15216 }
15217
15218
15219 static int
15220 test_xmlSetFeature(void) {
15221     int test_ret = 0;
15222
15223 #if defined(LIBXML_LEGACY_ENABLED)
15224 #ifdef LIBXML_LEGACY_ENABLED
15225     int mem_base;
15226     int ret_val;
15227     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15228     int n_ctxt;
15229     char * name; /* the feature name */
15230     int n_name;
15231     void * value; /* pointer to the location of the new value */
15232     int n_value;
15233
15234     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15235     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15236     for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15237         mem_base = xmlMemBlocks();
15238         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15239         name = gen_const_char_ptr(n_name, 1);
15240         value = gen_void_ptr(n_value, 2);
15241
15242         ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15243         desret_int(ret_val);
15244         call_tests++;
15245         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15246         des_const_char_ptr(n_name, (const char *)name, 1);
15247         des_void_ptr(n_value, value, 2);
15248         xmlResetLastError();
15249         if (mem_base != xmlMemBlocks()) {
15250             printf("Leak of %d blocks found in xmlSetFeature",
15251                    xmlMemBlocks() - mem_base);
15252             test_ret++;
15253             printf(" %d", n_ctxt);
15254             printf(" %d", n_name);
15255             printf(" %d", n_value);
15256             printf("\n");
15257         }
15258     }
15259     }
15260     }
15261     function_tests++;
15262 #endif
15263 #endif
15264
15265     return(test_ret);
15266 }
15267
15268
15269 static int
15270 test_xmlSetupParserForBuffer(void) {
15271     int test_ret = 0;
15272
15273 #if defined(LIBXML_SAX1_ENABLED)
15274 #ifdef LIBXML_SAX1_ENABLED
15275     int mem_base;
15276     xmlParserCtxtPtr ctxt; /* an XML parser context */
15277     int n_ctxt;
15278     xmlChar * buffer; /* a xmlChar * buffer */
15279     int n_buffer;
15280     const char * filename; /* a file name */
15281     int n_filename;
15282
15283     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15284     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15285     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15286         mem_base = xmlMemBlocks();
15287         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15288         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15289         filename = gen_filepath(n_filename, 2);
15290
15291         xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15292         call_tests++;
15293         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15294         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15295         des_filepath(n_filename, filename, 2);
15296         xmlResetLastError();
15297         if (mem_base != xmlMemBlocks()) {
15298             printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15299                    xmlMemBlocks() - mem_base);
15300             test_ret++;
15301             printf(" %d", n_ctxt);
15302             printf(" %d", n_buffer);
15303             printf(" %d", n_filename);
15304             printf("\n");
15305         }
15306     }
15307     }
15308     }
15309     function_tests++;
15310 #endif
15311 #endif
15312
15313     return(test_ret);
15314 }
15315
15316
15317 static int
15318 test_xmlStopParser(void) {
15319     int test_ret = 0;
15320
15321 #ifdef LIBXML_PUSH_ENABLED
15322     int mem_base;
15323     xmlParserCtxtPtr ctxt; /* an XML parser context */
15324     int n_ctxt;
15325
15326     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15327         mem_base = xmlMemBlocks();
15328         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15329
15330         xmlStopParser(ctxt);
15331         call_tests++;
15332         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15333         xmlResetLastError();
15334         if (mem_base != xmlMemBlocks()) {
15335             printf("Leak of %d blocks found in xmlStopParser",
15336                    xmlMemBlocks() - mem_base);
15337             test_ret++;
15338             printf(" %d", n_ctxt);
15339             printf("\n");
15340         }
15341     }
15342     function_tests++;
15343 #endif
15344
15345     return(test_ret);
15346 }
15347
15348
15349 static int
15350 test_xmlSubstituteEntitiesDefault(void) {
15351     int test_ret = 0;
15352
15353     int mem_base;
15354     int ret_val;
15355     int val; /* int 0 or 1 */
15356     int n_val;
15357
15358     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15359         mem_base = xmlMemBlocks();
15360         val = gen_int(n_val, 0);
15361
15362         ret_val = xmlSubstituteEntitiesDefault(val);
15363         desret_int(ret_val);
15364         call_tests++;
15365         des_int(n_val, val, 0);
15366         xmlResetLastError();
15367         if (mem_base != xmlMemBlocks()) {
15368             printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15369                    xmlMemBlocks() - mem_base);
15370             test_ret++;
15371             printf(" %d", n_val);
15372             printf("\n");
15373         }
15374     }
15375     function_tests++;
15376
15377     return(test_ret);
15378 }
15379
15380 static int
15381 test_parser(void) {
15382     int test_ret = 0;
15383
15384     if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15385     test_ret += test_xmlByteConsumed();
15386     test_ret += test_xmlClearNodeInfoSeq();
15387     test_ret += test_xmlClearParserCtxt();
15388     test_ret += test_xmlCreateDocParserCtxt();
15389     test_ret += test_xmlCreatePushParserCtxt();
15390     test_ret += test_xmlCtxtReadDoc();
15391     test_ret += test_xmlCtxtReadFile();
15392     test_ret += test_xmlCtxtReadMemory();
15393     test_ret += test_xmlCtxtReset();
15394     test_ret += test_xmlCtxtResetPush();
15395     test_ret += test_xmlCtxtUseOptions();
15396     test_ret += test_xmlGetExternalEntityLoader();
15397     test_ret += test_xmlGetFeature();
15398     test_ret += test_xmlGetFeaturesList();
15399     test_ret += test_xmlHasFeature();
15400     test_ret += test_xmlIOParseDTD();
15401     test_ret += test_xmlInitNodeInfoSeq();
15402     test_ret += test_xmlInitParser();
15403     test_ret += test_xmlInitParserCtxt();
15404     test_ret += test_xmlKeepBlanksDefault();
15405     test_ret += test_xmlLineNumbersDefault();
15406     test_ret += test_xmlLoadExternalEntity();
15407     test_ret += test_xmlNewIOInputStream();
15408     test_ret += test_xmlNewParserCtxt();
15409     test_ret += test_xmlParseBalancedChunkMemory();
15410     test_ret += test_xmlParseBalancedChunkMemoryRecover();
15411     test_ret += test_xmlParseChunk();
15412     test_ret += test_xmlParseCtxtExternalEntity();
15413     test_ret += test_xmlParseDTD();
15414     test_ret += test_xmlParseDoc();
15415     test_ret += test_xmlParseDocument();
15416     test_ret += test_xmlParseEntity();
15417     test_ret += test_xmlParseExtParsedEnt();
15418     test_ret += test_xmlParseExternalEntity();
15419     test_ret += test_xmlParseFile();
15420     test_ret += test_xmlParseInNodeContext();
15421     test_ret += test_xmlParseMemory();
15422     test_ret += test_xmlParserAddNodeInfo();
15423     test_ret += test_xmlParserFindNodeInfo();
15424     test_ret += test_xmlParserFindNodeInfoIndex();
15425     test_ret += test_xmlParserInputGrow();
15426     test_ret += test_xmlParserInputRead();
15427     test_ret += test_xmlPedanticParserDefault();
15428     test_ret += test_xmlReadDoc();
15429     test_ret += test_xmlReadFile();
15430     test_ret += test_xmlReadMemory();
15431     test_ret += test_xmlRecoverDoc();
15432     test_ret += test_xmlRecoverFile();
15433     test_ret += test_xmlRecoverMemory();
15434     test_ret += test_xmlSAXParseDTD();
15435     test_ret += test_xmlSAXParseDoc();
15436     test_ret += test_xmlSAXParseEntity();
15437     test_ret += test_xmlSAXParseFile();
15438     test_ret += test_xmlSAXParseFileWithData();
15439     test_ret += test_xmlSAXParseMemory();
15440     test_ret += test_xmlSAXParseMemoryWithData();
15441     test_ret += test_xmlSAXUserParseFile();
15442     test_ret += test_xmlSAXUserParseMemory();
15443     test_ret += test_xmlSetExternalEntityLoader();
15444     test_ret += test_xmlSetFeature();
15445     test_ret += test_xmlSetupParserForBuffer();
15446     test_ret += test_xmlStopParser();
15447     test_ret += test_xmlSubstituteEntitiesDefault();
15448
15449     if (test_ret != 0)
15450         printf("Module parser: %d errors\n", test_ret);
15451     return(test_ret);
15452 }
15453
15454 static int
15455 test_htmlCreateFileParserCtxt(void) {
15456     int test_ret = 0;
15457
15458 #if defined(LIBXML_HTML_ENABLED)
15459     int mem_base;
15460     htmlParserCtxtPtr ret_val;
15461     const char * filename; /* the filename */
15462     int n_filename;
15463     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15464     int n_encoding;
15465
15466     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15467     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15468         mem_base = xmlMemBlocks();
15469         filename = gen_fileoutput(n_filename, 0);
15470         encoding = gen_const_char_ptr(n_encoding, 1);
15471
15472         ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15473         desret_htmlParserCtxtPtr(ret_val);
15474         call_tests++;
15475         des_fileoutput(n_filename, filename, 0);
15476         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15477         xmlResetLastError();
15478         if (mem_base != xmlMemBlocks()) {
15479             printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15480                    xmlMemBlocks() - mem_base);
15481             test_ret++;
15482             printf(" %d", n_filename);
15483             printf(" %d", n_encoding);
15484             printf("\n");
15485         }
15486     }
15487     }
15488     function_tests++;
15489 #endif
15490
15491     return(test_ret);
15492 }
15493
15494
15495 static int
15496 test_htmlInitAutoClose(void) {
15497     int test_ret = 0;
15498
15499 #if defined(LIBXML_HTML_ENABLED)
15500     int mem_base;
15501
15502         mem_base = xmlMemBlocks();
15503
15504         htmlInitAutoClose();
15505         call_tests++;
15506         xmlResetLastError();
15507         if (mem_base != xmlMemBlocks()) {
15508             printf("Leak of %d blocks found in htmlInitAutoClose",
15509                    xmlMemBlocks() - mem_base);
15510             test_ret++;
15511             printf("\n");
15512         }
15513     function_tests++;
15514 #endif
15515
15516     return(test_ret);
15517 }
15518
15519
15520 static int
15521 test_inputPop(void) {
15522     int test_ret = 0;
15523
15524     int mem_base;
15525     xmlParserInputPtr ret_val;
15526     xmlParserCtxtPtr ctxt; /* an XML parser context */
15527     int n_ctxt;
15528
15529     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15530         mem_base = xmlMemBlocks();
15531         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15532
15533         ret_val = inputPop(ctxt);
15534         desret_xmlParserInputPtr(ret_val);
15535         call_tests++;
15536         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15537         xmlResetLastError();
15538         if (mem_base != xmlMemBlocks()) {
15539             printf("Leak of %d blocks found in inputPop",
15540                    xmlMemBlocks() - mem_base);
15541             test_ret++;
15542             printf(" %d", n_ctxt);
15543             printf("\n");
15544         }
15545     }
15546     function_tests++;
15547
15548     return(test_ret);
15549 }
15550
15551
15552 static int
15553 test_inputPush(void) {
15554     int test_ret = 0;
15555
15556     int mem_base;
15557     int ret_val;
15558     xmlParserCtxtPtr ctxt; /* an XML parser context */
15559     int n_ctxt;
15560     xmlParserInputPtr value; /* the parser input */
15561     int n_value;
15562
15563     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15564     for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15565         mem_base = xmlMemBlocks();
15566         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15567         value = gen_xmlParserInputPtr(n_value, 1);
15568
15569         ret_val = inputPush(ctxt, value);
15570         desret_int(ret_val);
15571         call_tests++;
15572         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15573         des_xmlParserInputPtr(n_value, value, 1);
15574         xmlResetLastError();
15575         if (mem_base != xmlMemBlocks()) {
15576             printf("Leak of %d blocks found in inputPush",
15577                    xmlMemBlocks() - mem_base);
15578             test_ret++;
15579             printf(" %d", n_ctxt);
15580             printf(" %d", n_value);
15581             printf("\n");
15582         }
15583     }
15584     }
15585     function_tests++;
15586
15587     return(test_ret);
15588 }
15589
15590
15591 static int
15592 test_namePop(void) {
15593     int test_ret = 0;
15594
15595     int mem_base;
15596     const xmlChar * ret_val;
15597     xmlParserCtxtPtr ctxt; /* an XML parser context */
15598     int n_ctxt;
15599
15600     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15601         mem_base = xmlMemBlocks();
15602         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15603
15604         ret_val = namePop(ctxt);
15605         desret_const_xmlChar_ptr(ret_val);
15606         call_tests++;
15607         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15608         xmlResetLastError();
15609         if (mem_base != xmlMemBlocks()) {
15610             printf("Leak of %d blocks found in namePop",
15611                    xmlMemBlocks() - mem_base);
15612             test_ret++;
15613             printf(" %d", n_ctxt);
15614             printf("\n");
15615         }
15616     }
15617     function_tests++;
15618
15619     return(test_ret);
15620 }
15621
15622
15623 static int
15624 test_namePush(void) {
15625     int test_ret = 0;
15626
15627     int mem_base;
15628     int ret_val;
15629     xmlParserCtxtPtr ctxt; /* an XML parser context */
15630     int n_ctxt;
15631     xmlChar * value; /* the element name */
15632     int n_value;
15633
15634     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15635     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15636         mem_base = xmlMemBlocks();
15637         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15638         value = gen_const_xmlChar_ptr(n_value, 1);
15639
15640         ret_val = namePush(ctxt, (const xmlChar *)value);
15641         desret_int(ret_val);
15642         call_tests++;
15643         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15644         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15645         xmlResetLastError();
15646         if (mem_base != xmlMemBlocks()) {
15647             printf("Leak of %d blocks found in namePush",
15648                    xmlMemBlocks() - mem_base);
15649             test_ret++;
15650             printf(" %d", n_ctxt);
15651             printf(" %d", n_value);
15652             printf("\n");
15653         }
15654     }
15655     }
15656     function_tests++;
15657
15658     return(test_ret);
15659 }
15660
15661
15662 static int
15663 test_nodePop(void) {
15664     int test_ret = 0;
15665
15666     int mem_base;
15667     xmlNodePtr ret_val;
15668     xmlParserCtxtPtr ctxt; /* an XML parser context */
15669     int n_ctxt;
15670
15671     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15672         mem_base = xmlMemBlocks();
15673         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15674
15675         ret_val = nodePop(ctxt);
15676         desret_xmlNodePtr(ret_val);
15677         call_tests++;
15678         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15679         xmlResetLastError();
15680         if (mem_base != xmlMemBlocks()) {
15681             printf("Leak of %d blocks found in nodePop",
15682                    xmlMemBlocks() - mem_base);
15683             test_ret++;
15684             printf(" %d", n_ctxt);
15685             printf("\n");
15686         }
15687     }
15688     function_tests++;
15689
15690     return(test_ret);
15691 }
15692
15693
15694 static int
15695 test_nodePush(void) {
15696     int test_ret = 0;
15697
15698     int mem_base;
15699     int ret_val;
15700     xmlParserCtxtPtr ctxt; /* an XML parser context */
15701     int n_ctxt;
15702     xmlNodePtr value; /* the element node */
15703     int n_value;
15704
15705     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15706     for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15707         mem_base = xmlMemBlocks();
15708         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15709         value = gen_xmlNodePtr(n_value, 1);
15710
15711         ret_val = nodePush(ctxt, value);
15712         desret_int(ret_val);
15713         call_tests++;
15714         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15715         des_xmlNodePtr(n_value, value, 1);
15716         xmlResetLastError();
15717         if (mem_base != xmlMemBlocks()) {
15718             printf("Leak of %d blocks found in nodePush",
15719                    xmlMemBlocks() - mem_base);
15720             test_ret++;
15721             printf(" %d", n_ctxt);
15722             printf(" %d", n_value);
15723             printf("\n");
15724         }
15725     }
15726     }
15727     function_tests++;
15728
15729     return(test_ret);
15730 }
15731
15732
15733 static int
15734 test_xmlCheckLanguageID(void) {
15735     int test_ret = 0;
15736
15737     int mem_base;
15738     int ret_val;
15739     xmlChar * lang; /* pointer to the string value */
15740     int n_lang;
15741
15742     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15743         mem_base = xmlMemBlocks();
15744         lang = gen_const_xmlChar_ptr(n_lang, 0);
15745
15746         ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15747         desret_int(ret_val);
15748         call_tests++;
15749         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15750         xmlResetLastError();
15751         if (mem_base != xmlMemBlocks()) {
15752             printf("Leak of %d blocks found in xmlCheckLanguageID",
15753                    xmlMemBlocks() - mem_base);
15754             test_ret++;
15755             printf(" %d", n_lang);
15756             printf("\n");
15757         }
15758     }
15759     function_tests++;
15760
15761     return(test_ret);
15762 }
15763
15764
15765 static int
15766 test_xmlCopyChar(void) {
15767     int test_ret = 0;
15768
15769     int mem_base;
15770     int ret_val;
15771     int len; /* Ignored, compatibility */
15772     int n_len;
15773     xmlChar * out; /* pointer to an array of xmlChar */
15774     int n_out;
15775     int val; /* the char value */
15776     int n_val;
15777
15778     for (n_len = 0;n_len < gen_nb_int;n_len++) {
15779     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15780     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15781         mem_base = xmlMemBlocks();
15782         len = gen_int(n_len, 0);
15783         out = gen_xmlChar_ptr(n_out, 1);
15784         val = gen_int(n_val, 2);
15785
15786         ret_val = xmlCopyChar(len, out, val);
15787         desret_int(ret_val);
15788         call_tests++;
15789         des_int(n_len, len, 0);
15790         des_xmlChar_ptr(n_out, out, 1);
15791         des_int(n_val, val, 2);
15792         xmlResetLastError();
15793         if (mem_base != xmlMemBlocks()) {
15794             printf("Leak of %d blocks found in xmlCopyChar",
15795                    xmlMemBlocks() - mem_base);
15796             test_ret++;
15797             printf(" %d", n_len);
15798             printf(" %d", n_out);
15799             printf(" %d", n_val);
15800             printf("\n");
15801         }
15802     }
15803     }
15804     }
15805     function_tests++;
15806
15807     return(test_ret);
15808 }
15809
15810
15811 static int
15812 test_xmlCopyCharMultiByte(void) {
15813     int test_ret = 0;
15814
15815     int mem_base;
15816     int ret_val;
15817     xmlChar * out; /* pointer to an array of xmlChar */
15818     int n_out;
15819     int val; /* the char value */
15820     int n_val;
15821
15822     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15823     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15824         mem_base = xmlMemBlocks();
15825         out = gen_xmlChar_ptr(n_out, 0);
15826         val = gen_int(n_val, 1);
15827
15828         ret_val = xmlCopyCharMultiByte(out, val);
15829         desret_int(ret_val);
15830         call_tests++;
15831         des_xmlChar_ptr(n_out, out, 0);
15832         des_int(n_val, val, 1);
15833         xmlResetLastError();
15834         if (mem_base != xmlMemBlocks()) {
15835             printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15836                    xmlMemBlocks() - mem_base);
15837             test_ret++;
15838             printf(" %d", n_out);
15839             printf(" %d", n_val);
15840             printf("\n");
15841         }
15842     }
15843     }
15844     function_tests++;
15845
15846     return(test_ret);
15847 }
15848
15849
15850 static int
15851 test_xmlCreateEntityParserCtxt(void) {
15852     int test_ret = 0;
15853
15854     int mem_base;
15855     xmlParserCtxtPtr ret_val;
15856     xmlChar * URL; /* the entity URL */
15857     int n_URL;
15858     xmlChar * ID; /* the entity PUBLIC ID */
15859     int n_ID;
15860     xmlChar * base; /* a possible base for the target URI */
15861     int n_base;
15862
15863     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15864     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15865     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15866         mem_base = xmlMemBlocks();
15867         URL = gen_const_xmlChar_ptr(n_URL, 0);
15868         ID = gen_const_xmlChar_ptr(n_ID, 1);
15869         base = gen_const_xmlChar_ptr(n_base, 2);
15870
15871         ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15872         desret_xmlParserCtxtPtr(ret_val);
15873         call_tests++;
15874         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15875         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15876         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15877         xmlResetLastError();
15878         if (mem_base != xmlMemBlocks()) {
15879             printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15880                    xmlMemBlocks() - mem_base);
15881             test_ret++;
15882             printf(" %d", n_URL);
15883             printf(" %d", n_ID);
15884             printf(" %d", n_base);
15885             printf("\n");
15886         }
15887     }
15888     }
15889     }
15890     function_tests++;
15891
15892     return(test_ret);
15893 }
15894
15895
15896 static int
15897 test_xmlCreateFileParserCtxt(void) {
15898     int test_ret = 0;
15899
15900     int mem_base;
15901     xmlParserCtxtPtr ret_val;
15902     const char * filename; /* the filename */
15903     int n_filename;
15904
15905     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15906         mem_base = xmlMemBlocks();
15907         filename = gen_fileoutput(n_filename, 0);
15908
15909         ret_val = xmlCreateFileParserCtxt(filename);
15910         desret_xmlParserCtxtPtr(ret_val);
15911         call_tests++;
15912         des_fileoutput(n_filename, filename, 0);
15913         xmlResetLastError();
15914         if (mem_base != xmlMemBlocks()) {
15915             printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15916                    xmlMemBlocks() - mem_base);
15917             test_ret++;
15918             printf(" %d", n_filename);
15919             printf("\n");
15920         }
15921     }
15922     function_tests++;
15923
15924     return(test_ret);
15925 }
15926
15927
15928 static int
15929 test_xmlCreateMemoryParserCtxt(void) {
15930     int test_ret = 0;
15931
15932     int mem_base;
15933     xmlParserCtxtPtr ret_val;
15934     char * buffer; /* a pointer to a char array */
15935     int n_buffer;
15936     int size; /* the size of the array */
15937     int n_size;
15938
15939     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15940     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15941         mem_base = xmlMemBlocks();
15942         buffer = gen_const_char_ptr(n_buffer, 0);
15943         size = gen_int(n_size, 1);
15944
15945         ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15946         desret_xmlParserCtxtPtr(ret_val);
15947         call_tests++;
15948         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15949         des_int(n_size, size, 1);
15950         xmlResetLastError();
15951         if (mem_base != xmlMemBlocks()) {
15952             printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15953                    xmlMemBlocks() - mem_base);
15954             test_ret++;
15955             printf(" %d", n_buffer);
15956             printf(" %d", n_size);
15957             printf("\n");
15958         }
15959     }
15960     }
15961     function_tests++;
15962
15963     return(test_ret);
15964 }
15965
15966
15967 static int
15968 test_xmlCreateURLParserCtxt(void) {
15969     int test_ret = 0;
15970
15971     int mem_base;
15972     xmlParserCtxtPtr ret_val;
15973     const char * filename; /* the filename or URL */
15974     int n_filename;
15975     int options; /* a combination of xmlParserOption */
15976     int n_options;
15977
15978     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15979     for (n_options = 0;n_options < gen_nb_int;n_options++) {
15980         mem_base = xmlMemBlocks();
15981         filename = gen_fileoutput(n_filename, 0);
15982         options = gen_int(n_options, 1);
15983
15984         ret_val = xmlCreateURLParserCtxt(filename, options);
15985         desret_xmlParserCtxtPtr(ret_val);
15986         call_tests++;
15987         des_fileoutput(n_filename, filename, 0);
15988         des_int(n_options, options, 1);
15989         xmlResetLastError();
15990         if (mem_base != xmlMemBlocks()) {
15991             printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15992                    xmlMemBlocks() - mem_base);
15993             test_ret++;
15994             printf(" %d", n_filename);
15995             printf(" %d", n_options);
15996             printf("\n");
15997         }
15998     }
15999     }
16000     function_tests++;
16001
16002     return(test_ret);
16003 }
16004
16005
16006 static int
16007 test_xmlCurrentChar(void) {
16008     int test_ret = 0;
16009
16010     int mem_base;
16011     int ret_val;
16012     xmlParserCtxtPtr ctxt; /* the XML parser context */
16013     int n_ctxt;
16014     int * len; /* pointer to the length of the char read */
16015     int n_len;
16016
16017     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16018     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16019         mem_base = xmlMemBlocks();
16020         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16021         len = gen_int_ptr(n_len, 1);
16022
16023         ret_val = xmlCurrentChar(ctxt, len);
16024         desret_int(ret_val);
16025         call_tests++;
16026         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16027         des_int_ptr(n_len, len, 1);
16028         xmlResetLastError();
16029         if (mem_base != xmlMemBlocks()) {
16030             printf("Leak of %d blocks found in xmlCurrentChar",
16031                    xmlMemBlocks() - mem_base);
16032             test_ret++;
16033             printf(" %d", n_ctxt);
16034             printf(" %d", n_len);
16035             printf("\n");
16036         }
16037     }
16038     }
16039     function_tests++;
16040
16041     return(test_ret);
16042 }
16043
16044
16045 static int
16046 test_xmlErrMemory(void) {
16047     int test_ret = 0;
16048
16049     int mem_base;
16050     xmlParserCtxtPtr ctxt; /* an XML parser context */
16051     int n_ctxt;
16052     char * extra; /* extra informations */
16053     int n_extra;
16054
16055     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16056     for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16057         mem_base = xmlMemBlocks();
16058         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16059         extra = gen_const_char_ptr(n_extra, 1);
16060
16061         xmlErrMemory(ctxt, (const char *)extra);
16062         call_tests++;
16063         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16064         des_const_char_ptr(n_extra, (const char *)extra, 1);
16065         xmlResetLastError();
16066         if (mem_base != xmlMemBlocks()) {
16067             printf("Leak of %d blocks found in xmlErrMemory",
16068                    xmlMemBlocks() - mem_base);
16069             test_ret++;
16070             printf(" %d", n_ctxt);
16071             printf(" %d", n_extra);
16072             printf("\n");
16073         }
16074     }
16075     }
16076     function_tests++;
16077
16078     return(test_ret);
16079 }
16080
16081
16082 static int
16083 test_xmlIsLetter(void) {
16084     int test_ret = 0;
16085
16086     int mem_base;
16087     int ret_val;
16088     int c; /* an unicode character (int) */
16089     int n_c;
16090
16091     for (n_c = 0;n_c < gen_nb_int;n_c++) {
16092         mem_base = xmlMemBlocks();
16093         c = gen_int(n_c, 0);
16094
16095         ret_val = xmlIsLetter(c);
16096         desret_int(ret_val);
16097         call_tests++;
16098         des_int(n_c, c, 0);
16099         xmlResetLastError();
16100         if (mem_base != xmlMemBlocks()) {
16101             printf("Leak of %d blocks found in xmlIsLetter",
16102                    xmlMemBlocks() - mem_base);
16103             test_ret++;
16104             printf(" %d", n_c);
16105             printf("\n");
16106         }
16107     }
16108     function_tests++;
16109
16110     return(test_ret);
16111 }
16112
16113
16114 static int
16115 test_xmlNewEntityInputStream(void) {
16116     int test_ret = 0;
16117
16118     int mem_base;
16119     xmlParserInputPtr ret_val;
16120     xmlParserCtxtPtr ctxt; /* an XML parser context */
16121     int n_ctxt;
16122     xmlEntityPtr entity; /* an Entity pointer */
16123     int n_entity;
16124
16125     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16126     for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16127         mem_base = xmlMemBlocks();
16128         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16129         entity = gen_xmlEntityPtr(n_entity, 1);
16130
16131         ret_val = xmlNewEntityInputStream(ctxt, entity);
16132         desret_xmlParserInputPtr(ret_val);
16133         call_tests++;
16134         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16135         des_xmlEntityPtr(n_entity, entity, 1);
16136         xmlResetLastError();
16137         if (mem_base != xmlMemBlocks()) {
16138             printf("Leak of %d blocks found in xmlNewEntityInputStream",
16139                    xmlMemBlocks() - mem_base);
16140             test_ret++;
16141             printf(" %d", n_ctxt);
16142             printf(" %d", n_entity);
16143             printf("\n");
16144         }
16145     }
16146     }
16147     function_tests++;
16148
16149     return(test_ret);
16150 }
16151
16152
16153 static int
16154 test_xmlNewInputFromFile(void) {
16155     int test_ret = 0;
16156
16157     int mem_base;
16158     xmlParserInputPtr ret_val;
16159     xmlParserCtxtPtr ctxt; /* an XML parser context */
16160     int n_ctxt;
16161     const char * filename; /* the filename to use as entity */
16162     int n_filename;
16163
16164     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16165     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16166         mem_base = xmlMemBlocks();
16167         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16168         filename = gen_filepath(n_filename, 1);
16169
16170         ret_val = xmlNewInputFromFile(ctxt, filename);
16171         desret_xmlParserInputPtr(ret_val);
16172         call_tests++;
16173         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16174         des_filepath(n_filename, filename, 1);
16175         xmlResetLastError();
16176         if (mem_base != xmlMemBlocks()) {
16177             printf("Leak of %d blocks found in xmlNewInputFromFile",
16178                    xmlMemBlocks() - mem_base);
16179             test_ret++;
16180             printf(" %d", n_ctxt);
16181             printf(" %d", n_filename);
16182             printf("\n");
16183         }
16184     }
16185     }
16186     function_tests++;
16187
16188     return(test_ret);
16189 }
16190
16191
16192 static int
16193 test_xmlNewInputStream(void) {
16194     int test_ret = 0;
16195
16196     int mem_base;
16197     xmlParserInputPtr ret_val;
16198     xmlParserCtxtPtr ctxt; /* an XML parser context */
16199     int n_ctxt;
16200
16201     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16202         mem_base = xmlMemBlocks();
16203         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16204
16205         ret_val = xmlNewInputStream(ctxt);
16206         desret_xmlParserInputPtr(ret_val);
16207         call_tests++;
16208         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16209         xmlResetLastError();
16210         if (mem_base != xmlMemBlocks()) {
16211             printf("Leak of %d blocks found in xmlNewInputStream",
16212                    xmlMemBlocks() - mem_base);
16213             test_ret++;
16214             printf(" %d", n_ctxt);
16215             printf("\n");
16216         }
16217     }
16218     function_tests++;
16219
16220     return(test_ret);
16221 }
16222
16223
16224 static int
16225 test_xmlNewStringInputStream(void) {
16226     int test_ret = 0;
16227
16228     int mem_base;
16229     xmlParserInputPtr ret_val;
16230     xmlParserCtxtPtr ctxt; /* an XML parser context */
16231     int n_ctxt;
16232     xmlChar * buffer; /* an memory buffer */
16233     int n_buffer;
16234
16235     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16236     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16237         mem_base = xmlMemBlocks();
16238         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16239         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16240
16241         ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16242         desret_xmlParserInputPtr(ret_val);
16243         call_tests++;
16244         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16245         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16246         xmlResetLastError();
16247         if (mem_base != xmlMemBlocks()) {
16248             printf("Leak of %d blocks found in xmlNewStringInputStream",
16249                    xmlMemBlocks() - mem_base);
16250             test_ret++;
16251             printf(" %d", n_ctxt);
16252             printf(" %d", n_buffer);
16253             printf("\n");
16254         }
16255     }
16256     }
16257     function_tests++;
16258
16259     return(test_ret);
16260 }
16261
16262
16263 static int
16264 test_xmlNextChar(void) {
16265     int test_ret = 0;
16266
16267     int mem_base;
16268     xmlParserCtxtPtr ctxt; /* the 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         xmlNextChar(ctxt);
16276         call_tests++;
16277         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16278         xmlResetLastError();
16279         if (mem_base != xmlMemBlocks()) {
16280             printf("Leak of %d blocks found in xmlNextChar",
16281                    xmlMemBlocks() - mem_base);
16282             test_ret++;
16283             printf(" %d", n_ctxt);
16284             printf("\n");
16285         }
16286     }
16287     function_tests++;
16288
16289     return(test_ret);
16290 }
16291
16292
16293 static int
16294 test_xmlParserInputShrink(void) {
16295     int test_ret = 0;
16296
16297     int mem_base;
16298     xmlParserInputPtr in; /* an XML parser input */
16299     int n_in;
16300
16301     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16302         mem_base = xmlMemBlocks();
16303         in = gen_xmlParserInputPtr(n_in, 0);
16304
16305         xmlParserInputShrink(in);
16306         call_tests++;
16307         des_xmlParserInputPtr(n_in, in, 0);
16308         xmlResetLastError();
16309         if (mem_base != xmlMemBlocks()) {
16310             printf("Leak of %d blocks found in xmlParserInputShrink",
16311                    xmlMemBlocks() - mem_base);
16312             test_ret++;
16313             printf(" %d", n_in);
16314             printf("\n");
16315         }
16316     }
16317     function_tests++;
16318
16319     return(test_ret);
16320 }
16321
16322
16323 static int
16324 test_xmlPopInput(void) {
16325     int test_ret = 0;
16326
16327     int mem_base;
16328     xmlChar ret_val;
16329     xmlParserCtxtPtr ctxt; /* an XML parser context */
16330     int n_ctxt;
16331
16332     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16333         mem_base = xmlMemBlocks();
16334         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16335
16336         ret_val = xmlPopInput(ctxt);
16337         desret_xmlChar(ret_val);
16338         call_tests++;
16339         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16340         xmlResetLastError();
16341         if (mem_base != xmlMemBlocks()) {
16342             printf("Leak of %d blocks found in xmlPopInput",
16343                    xmlMemBlocks() - mem_base);
16344             test_ret++;
16345             printf(" %d", n_ctxt);
16346             printf("\n");
16347         }
16348     }
16349     function_tests++;
16350
16351     return(test_ret);
16352 }
16353
16354
16355 static int
16356 test_xmlPushInput(void) {
16357     int test_ret = 0;
16358
16359     int mem_base;
16360     int ret_val;
16361     xmlParserCtxtPtr ctxt; /* an XML parser context */
16362     int n_ctxt;
16363     xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16364     int n_input;
16365
16366     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16367     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16368         mem_base = xmlMemBlocks();
16369         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16370         input = gen_xmlParserInputPtr(n_input, 1);
16371
16372         ret_val = xmlPushInput(ctxt, input);
16373         desret_int(ret_val);
16374         call_tests++;
16375         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16376         des_xmlParserInputPtr(n_input, input, 1);
16377         xmlResetLastError();
16378         if (mem_base != xmlMemBlocks()) {
16379             printf("Leak of %d blocks found in xmlPushInput",
16380                    xmlMemBlocks() - mem_base);
16381             test_ret++;
16382             printf(" %d", n_ctxt);
16383             printf(" %d", n_input);
16384             printf("\n");
16385         }
16386     }
16387     }
16388     function_tests++;
16389
16390     return(test_ret);
16391 }
16392
16393
16394 static int
16395 test_xmlSetEntityReferenceFunc(void) {
16396     int test_ret = 0;
16397
16398
16399     /* missing type support */
16400     return(test_ret);
16401 }
16402
16403
16404 static int
16405 test_xmlSplitQName(void) {
16406     int test_ret = 0;
16407
16408     int mem_base;
16409     xmlChar * ret_val;
16410     xmlParserCtxtPtr ctxt; /* an XML parser context */
16411     int n_ctxt;
16412     xmlChar * name; /* an XML parser context */
16413     int n_name;
16414     xmlChar ** prefix; /* a xmlChar ** */
16415     int n_prefix;
16416
16417     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16418     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16419     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16420         mem_base = xmlMemBlocks();
16421         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16422         name = gen_const_xmlChar_ptr(n_name, 1);
16423         prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16424
16425         ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16426         desret_xmlChar_ptr(ret_val);
16427         call_tests++;
16428         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16429         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16430         des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16431         xmlResetLastError();
16432         if (mem_base != xmlMemBlocks()) {
16433             printf("Leak of %d blocks found in xmlSplitQName",
16434                    xmlMemBlocks() - mem_base);
16435             test_ret++;
16436             printf(" %d", n_ctxt);
16437             printf(" %d", n_name);
16438             printf(" %d", n_prefix);
16439             printf("\n");
16440         }
16441     }
16442     }
16443     }
16444     function_tests++;
16445
16446     return(test_ret);
16447 }
16448
16449
16450 static int
16451 test_xmlStringCurrentChar(void) {
16452     int test_ret = 0;
16453
16454     int mem_base;
16455     int ret_val;
16456     xmlParserCtxtPtr ctxt; /* the XML parser context */
16457     int n_ctxt;
16458     xmlChar * cur; /* pointer to the beginning of the char */
16459     int n_cur;
16460     int * len; /* pointer to the length of the char read */
16461     int n_len;
16462
16463     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16464     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16465     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16466         mem_base = xmlMemBlocks();
16467         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16468         cur = gen_const_xmlChar_ptr(n_cur, 1);
16469         len = gen_int_ptr(n_len, 2);
16470
16471         ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16472         desret_int(ret_val);
16473         call_tests++;
16474         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16475         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16476         des_int_ptr(n_len, len, 2);
16477         xmlResetLastError();
16478         if (mem_base != xmlMemBlocks()) {
16479             printf("Leak of %d blocks found in xmlStringCurrentChar",
16480                    xmlMemBlocks() - mem_base);
16481             test_ret++;
16482             printf(" %d", n_ctxt);
16483             printf(" %d", n_cur);
16484             printf(" %d", n_len);
16485             printf("\n");
16486         }
16487     }
16488     }
16489     }
16490     function_tests++;
16491
16492     return(test_ret);
16493 }
16494
16495
16496 static int
16497 test_xmlStringDecodeEntities(void) {
16498     int test_ret = 0;
16499
16500     int mem_base;
16501     xmlChar * ret_val;
16502     xmlParserCtxtPtr ctxt; /* the parser context */
16503     int n_ctxt;
16504     xmlChar * str; /* the input string */
16505     int n_str;
16506     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16507     int n_what;
16508     xmlChar end; /* an end marker xmlChar, 0 if none */
16509     int n_end;
16510     xmlChar end2; /* an end marker xmlChar, 0 if none */
16511     int n_end2;
16512     xmlChar end3; /* an end marker xmlChar, 0 if none */
16513     int n_end3;
16514
16515     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16516     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16517     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16518     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16519     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16520     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16521         mem_base = xmlMemBlocks();
16522         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16523         str = gen_const_xmlChar_ptr(n_str, 1);
16524         what = gen_int(n_what, 2);
16525         end = gen_xmlChar(n_end, 3);
16526         end2 = gen_xmlChar(n_end2, 4);
16527         end3 = gen_xmlChar(n_end3, 5);
16528
16529         ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16530         desret_xmlChar_ptr(ret_val);
16531         call_tests++;
16532         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16533         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16534         des_int(n_what, what, 2);
16535         des_xmlChar(n_end, end, 3);
16536         des_xmlChar(n_end2, end2, 4);
16537         des_xmlChar(n_end3, end3, 5);
16538         xmlResetLastError();
16539         if (mem_base != xmlMemBlocks()) {
16540             printf("Leak of %d blocks found in xmlStringDecodeEntities",
16541                    xmlMemBlocks() - mem_base);
16542             test_ret++;
16543             printf(" %d", n_ctxt);
16544             printf(" %d", n_str);
16545             printf(" %d", n_what);
16546             printf(" %d", n_end);
16547             printf(" %d", n_end2);
16548             printf(" %d", n_end3);
16549             printf("\n");
16550         }
16551     }
16552     }
16553     }
16554     }
16555     }
16556     }
16557     function_tests++;
16558
16559     return(test_ret);
16560 }
16561
16562
16563 static int
16564 test_xmlStringLenDecodeEntities(void) {
16565     int test_ret = 0;
16566
16567     int mem_base;
16568     xmlChar * ret_val;
16569     xmlParserCtxtPtr ctxt; /* the parser context */
16570     int n_ctxt;
16571     xmlChar * str; /* the input string */
16572     int n_str;
16573     int len; /* the string length */
16574     int n_len;
16575     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16576     int n_what;
16577     xmlChar end; /* an end marker xmlChar, 0 if none */
16578     int n_end;
16579     xmlChar end2; /* an end marker xmlChar, 0 if none */
16580     int n_end2;
16581     xmlChar end3; /* an end marker xmlChar, 0 if none */
16582     int n_end3;
16583
16584     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16585     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16586     for (n_len = 0;n_len < gen_nb_int;n_len++) {
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         len = gen_int(n_len, 2);
16595         what = gen_int(n_what, 3);
16596         end = gen_xmlChar(n_end, 4);
16597         end2 = gen_xmlChar(n_end2, 5);
16598         end3 = gen_xmlChar(n_end3, 6);
16599
16600         ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16601         desret_xmlChar_ptr(ret_val);
16602         call_tests++;
16603         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16604         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16605         des_int(n_len, len, 2);
16606         des_int(n_what, what, 3);
16607         des_xmlChar(n_end, end, 4);
16608         des_xmlChar(n_end2, end2, 5);
16609         des_xmlChar(n_end3, end3, 6);
16610         xmlResetLastError();
16611         if (mem_base != xmlMemBlocks()) {
16612             printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16613                    xmlMemBlocks() - mem_base);
16614             test_ret++;
16615             printf(" %d", n_ctxt);
16616             printf(" %d", n_str);
16617             printf(" %d", n_len);
16618             printf(" %d", n_what);
16619             printf(" %d", n_end);
16620             printf(" %d", n_end2);
16621             printf(" %d", n_end3);
16622             printf("\n");
16623         }
16624     }
16625     }
16626     }
16627     }
16628     }
16629     }
16630     }
16631     function_tests++;
16632
16633     return(test_ret);
16634 }
16635
16636
16637 static int
16638 test_xmlSwitchEncoding(void) {
16639     int test_ret = 0;
16640
16641     int mem_base;
16642     int ret_val;
16643     xmlParserCtxtPtr ctxt; /* the parser context */
16644     int n_ctxt;
16645     xmlCharEncoding enc; /* the encoding value (number) */
16646     int n_enc;
16647
16648     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16649     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16650         mem_base = xmlMemBlocks();
16651         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16652         enc = gen_xmlCharEncoding(n_enc, 1);
16653
16654         ret_val = xmlSwitchEncoding(ctxt, enc);
16655         desret_int(ret_val);
16656         call_tests++;
16657         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16658         des_xmlCharEncoding(n_enc, enc, 1);
16659         xmlResetLastError();
16660         if (mem_base != xmlMemBlocks()) {
16661             printf("Leak of %d blocks found in xmlSwitchEncoding",
16662                    xmlMemBlocks() - mem_base);
16663             test_ret++;
16664             printf(" %d", n_ctxt);
16665             printf(" %d", n_enc);
16666             printf("\n");
16667         }
16668     }
16669     }
16670     function_tests++;
16671
16672     return(test_ret);
16673 }
16674
16675
16676 static int
16677 test_xmlSwitchInputEncoding(void) {
16678     int test_ret = 0;
16679
16680     int mem_base;
16681     int ret_val;
16682     xmlParserCtxtPtr ctxt; /* the parser context */
16683     int n_ctxt;
16684     xmlParserInputPtr input; /* the input stream */
16685     int n_input;
16686     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16687     int n_handler;
16688
16689     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16690     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16691     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16692         mem_base = xmlMemBlocks();
16693         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16694         input = gen_xmlParserInputPtr(n_input, 1);
16695         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16696
16697         ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16698         desret_int(ret_val);
16699         call_tests++;
16700         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16701         des_xmlParserInputPtr(n_input, input, 1);
16702         des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16703         xmlResetLastError();
16704         if (mem_base != xmlMemBlocks()) {
16705             printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16706                    xmlMemBlocks() - mem_base);
16707             test_ret++;
16708             printf(" %d", n_ctxt);
16709             printf(" %d", n_input);
16710             printf(" %d", n_handler);
16711             printf("\n");
16712         }
16713     }
16714     }
16715     }
16716     function_tests++;
16717
16718     return(test_ret);
16719 }
16720
16721
16722 static int
16723 test_xmlSwitchToEncoding(void) {
16724     int test_ret = 0;
16725
16726     int mem_base;
16727     int ret_val;
16728     xmlParserCtxtPtr ctxt; /* the parser context */
16729     int n_ctxt;
16730     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16731     int n_handler;
16732
16733     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16734     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16735         mem_base = xmlMemBlocks();
16736         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16737         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16738
16739         ret_val = xmlSwitchToEncoding(ctxt, handler);
16740         desret_int(ret_val);
16741         call_tests++;
16742         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16743         des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16744         xmlResetLastError();
16745         if (mem_base != xmlMemBlocks()) {
16746             printf("Leak of %d blocks found in xmlSwitchToEncoding",
16747                    xmlMemBlocks() - mem_base);
16748             test_ret++;
16749             printf(" %d", n_ctxt);
16750             printf(" %d", n_handler);
16751             printf("\n");
16752         }
16753     }
16754     }
16755     function_tests++;
16756
16757     return(test_ret);
16758 }
16759
16760 static int
16761 test_parserInternals(void) {
16762     int test_ret = 0;
16763
16764     if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16765     test_ret += test_htmlCreateFileParserCtxt();
16766     test_ret += test_htmlInitAutoClose();
16767     test_ret += test_inputPop();
16768     test_ret += test_inputPush();
16769     test_ret += test_namePop();
16770     test_ret += test_namePush();
16771     test_ret += test_nodePop();
16772     test_ret += test_nodePush();
16773     test_ret += test_xmlCheckLanguageID();
16774     test_ret += test_xmlCopyChar();
16775     test_ret += test_xmlCopyCharMultiByte();
16776     test_ret += test_xmlCreateEntityParserCtxt();
16777     test_ret += test_xmlCreateFileParserCtxt();
16778     test_ret += test_xmlCreateMemoryParserCtxt();
16779     test_ret += test_xmlCreateURLParserCtxt();
16780     test_ret += test_xmlCurrentChar();
16781     test_ret += test_xmlErrMemory();
16782     test_ret += test_xmlIsLetter();
16783     test_ret += test_xmlNewEntityInputStream();
16784     test_ret += test_xmlNewInputFromFile();
16785     test_ret += test_xmlNewInputStream();
16786     test_ret += test_xmlNewStringInputStream();
16787     test_ret += test_xmlNextChar();
16788     test_ret += test_xmlParserInputShrink();
16789     test_ret += test_xmlPopInput();
16790     test_ret += test_xmlPushInput();
16791     test_ret += test_xmlSetEntityReferenceFunc();
16792     test_ret += test_xmlSplitQName();
16793     test_ret += test_xmlStringCurrentChar();
16794     test_ret += test_xmlStringDecodeEntities();
16795     test_ret += test_xmlStringLenDecodeEntities();
16796     test_ret += test_xmlSwitchEncoding();
16797     test_ret += test_xmlSwitchInputEncoding();
16798     test_ret += test_xmlSwitchToEncoding();
16799
16800     if (test_ret != 0)
16801         printf("Module parserInternals: %d errors\n", test_ret);
16802     return(test_ret);
16803 }
16804
16805 static int
16806 test_xmlPatternFromRoot(void) {
16807     int test_ret = 0;
16808
16809 #if defined(LIBXML_PATTERN_ENABLED)
16810     int mem_base;
16811     int ret_val;
16812     xmlPatternPtr comp; /* the precompiled pattern */
16813     int n_comp;
16814
16815     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16816         mem_base = xmlMemBlocks();
16817         comp = gen_xmlPatternPtr(n_comp, 0);
16818
16819         ret_val = xmlPatternFromRoot(comp);
16820         desret_int(ret_val);
16821         call_tests++;
16822         des_xmlPatternPtr(n_comp, comp, 0);
16823         xmlResetLastError();
16824         if (mem_base != xmlMemBlocks()) {
16825             printf("Leak of %d blocks found in xmlPatternFromRoot",
16826                    xmlMemBlocks() - mem_base);
16827             test_ret++;
16828             printf(" %d", n_comp);
16829             printf("\n");
16830         }
16831     }
16832     function_tests++;
16833 #endif
16834
16835     return(test_ret);
16836 }
16837
16838
16839 static int
16840 test_xmlPatternGetStreamCtxt(void) {
16841     int test_ret = 0;
16842
16843
16844     /* missing type support */
16845     return(test_ret);
16846 }
16847
16848
16849 static int
16850 test_xmlPatternMatch(void) {
16851     int test_ret = 0;
16852
16853 #if defined(LIBXML_PATTERN_ENABLED)
16854     int mem_base;
16855     int ret_val;
16856     xmlPatternPtr comp; /* the precompiled pattern */
16857     int n_comp;
16858     xmlNodePtr node; /* a node */
16859     int n_node;
16860
16861     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16862     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16863         mem_base = xmlMemBlocks();
16864         comp = gen_xmlPatternPtr(n_comp, 0);
16865         node = gen_xmlNodePtr(n_node, 1);
16866
16867         ret_val = xmlPatternMatch(comp, node);
16868         desret_int(ret_val);
16869         call_tests++;
16870         des_xmlPatternPtr(n_comp, comp, 0);
16871         des_xmlNodePtr(n_node, node, 1);
16872         xmlResetLastError();
16873         if (mem_base != xmlMemBlocks()) {
16874             printf("Leak of %d blocks found in xmlPatternMatch",
16875                    xmlMemBlocks() - mem_base);
16876             test_ret++;
16877             printf(" %d", n_comp);
16878             printf(" %d", n_node);
16879             printf("\n");
16880         }
16881     }
16882     }
16883     function_tests++;
16884 #endif
16885
16886     return(test_ret);
16887 }
16888
16889
16890 static int
16891 test_xmlPatternMaxDepth(void) {
16892     int test_ret = 0;
16893
16894 #if defined(LIBXML_PATTERN_ENABLED)
16895     int mem_base;
16896     int ret_val;
16897     xmlPatternPtr comp; /* the precompiled pattern */
16898     int n_comp;
16899
16900     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16901         mem_base = xmlMemBlocks();
16902         comp = gen_xmlPatternPtr(n_comp, 0);
16903
16904         ret_val = xmlPatternMaxDepth(comp);
16905         desret_int(ret_val);
16906         call_tests++;
16907         des_xmlPatternPtr(n_comp, comp, 0);
16908         xmlResetLastError();
16909         if (mem_base != xmlMemBlocks()) {
16910             printf("Leak of %d blocks found in xmlPatternMaxDepth",
16911                    xmlMemBlocks() - mem_base);
16912             test_ret++;
16913             printf(" %d", n_comp);
16914             printf("\n");
16915         }
16916     }
16917     function_tests++;
16918 #endif
16919
16920     return(test_ret);
16921 }
16922
16923
16924 static int
16925 test_xmlPatternMinDepth(void) {
16926     int test_ret = 0;
16927
16928 #if defined(LIBXML_PATTERN_ENABLED)
16929     int mem_base;
16930     int ret_val;
16931     xmlPatternPtr comp; /* the precompiled pattern */
16932     int n_comp;
16933
16934     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16935         mem_base = xmlMemBlocks();
16936         comp = gen_xmlPatternPtr(n_comp, 0);
16937
16938         ret_val = xmlPatternMinDepth(comp);
16939         desret_int(ret_val);
16940         call_tests++;
16941         des_xmlPatternPtr(n_comp, comp, 0);
16942         xmlResetLastError();
16943         if (mem_base != xmlMemBlocks()) {
16944             printf("Leak of %d blocks found in xmlPatternMinDepth",
16945                    xmlMemBlocks() - mem_base);
16946             test_ret++;
16947             printf(" %d", n_comp);
16948             printf("\n");
16949         }
16950     }
16951     function_tests++;
16952 #endif
16953
16954     return(test_ret);
16955 }
16956
16957
16958 static int
16959 test_xmlPatternStreamable(void) {
16960     int test_ret = 0;
16961
16962 #if defined(LIBXML_PATTERN_ENABLED)
16963     int mem_base;
16964     int ret_val;
16965     xmlPatternPtr comp; /* the precompiled pattern */
16966     int n_comp;
16967
16968     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16969         mem_base = xmlMemBlocks();
16970         comp = gen_xmlPatternPtr(n_comp, 0);
16971
16972         ret_val = xmlPatternStreamable(comp);
16973         desret_int(ret_val);
16974         call_tests++;
16975         des_xmlPatternPtr(n_comp, comp, 0);
16976         xmlResetLastError();
16977         if (mem_base != xmlMemBlocks()) {
16978             printf("Leak of %d blocks found in xmlPatternStreamable",
16979                    xmlMemBlocks() - mem_base);
16980             test_ret++;
16981             printf(" %d", n_comp);
16982             printf("\n");
16983         }
16984     }
16985     function_tests++;
16986 #endif
16987
16988     return(test_ret);
16989 }
16990
16991
16992 static int
16993 test_xmlPatterncompile(void) {
16994     int test_ret = 0;
16995
16996
16997     /* missing type support */
16998     return(test_ret);
16999 }
17000
17001 #ifdef LIBXML_PATTERN_ENABLED
17002
17003 #define gen_nb_xmlStreamCtxtPtr 1
17004 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17005     return(NULL);
17006 }
17007 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17008 }
17009 #endif
17010
17011
17012 static int
17013 test_xmlStreamPop(void) {
17014     int test_ret = 0;
17015
17016 #if defined(LIBXML_PATTERN_ENABLED)
17017     int mem_base;
17018     int ret_val;
17019     xmlStreamCtxtPtr stream; /* the stream context */
17020     int n_stream;
17021
17022     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17023         mem_base = xmlMemBlocks();
17024         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17025
17026         ret_val = xmlStreamPop(stream);
17027         desret_int(ret_val);
17028         call_tests++;
17029         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17030         xmlResetLastError();
17031         if (mem_base != xmlMemBlocks()) {
17032             printf("Leak of %d blocks found in xmlStreamPop",
17033                    xmlMemBlocks() - mem_base);
17034             test_ret++;
17035             printf(" %d", n_stream);
17036             printf("\n");
17037         }
17038     }
17039     function_tests++;
17040 #endif
17041
17042     return(test_ret);
17043 }
17044
17045
17046 static int
17047 test_xmlStreamPush(void) {
17048     int test_ret = 0;
17049
17050 #if defined(LIBXML_PATTERN_ENABLED)
17051     int mem_base;
17052     int ret_val;
17053     xmlStreamCtxtPtr stream; /* the stream context */
17054     int n_stream;
17055     xmlChar * name; /* the current name */
17056     int n_name;
17057     xmlChar * ns; /* the namespace name */
17058     int n_ns;
17059
17060     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17061     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17062     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17063         mem_base = xmlMemBlocks();
17064         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17065         name = gen_const_xmlChar_ptr(n_name, 1);
17066         ns = gen_const_xmlChar_ptr(n_ns, 2);
17067
17068         ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17069         desret_int(ret_val);
17070         call_tests++;
17071         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17072         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17073         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17074         xmlResetLastError();
17075         if (mem_base != xmlMemBlocks()) {
17076             printf("Leak of %d blocks found in xmlStreamPush",
17077                    xmlMemBlocks() - mem_base);
17078             test_ret++;
17079             printf(" %d", n_stream);
17080             printf(" %d", n_name);
17081             printf(" %d", n_ns);
17082             printf("\n");
17083         }
17084     }
17085     }
17086     }
17087     function_tests++;
17088 #endif
17089
17090     return(test_ret);
17091 }
17092
17093
17094 static int
17095 test_xmlStreamPushAttr(void) {
17096     int test_ret = 0;
17097
17098 #if defined(LIBXML_PATTERN_ENABLED)
17099     int mem_base;
17100     int ret_val;
17101     xmlStreamCtxtPtr stream; /* the stream context */
17102     int n_stream;
17103     xmlChar * name; /* the current name */
17104     int n_name;
17105     xmlChar * ns; /* the namespace name */
17106     int n_ns;
17107
17108     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17109     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17110     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17111         mem_base = xmlMemBlocks();
17112         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17113         name = gen_const_xmlChar_ptr(n_name, 1);
17114         ns = gen_const_xmlChar_ptr(n_ns, 2);
17115
17116         ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17117         desret_int(ret_val);
17118         call_tests++;
17119         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17120         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17121         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17122         xmlResetLastError();
17123         if (mem_base != xmlMemBlocks()) {
17124             printf("Leak of %d blocks found in xmlStreamPushAttr",
17125                    xmlMemBlocks() - mem_base);
17126             test_ret++;
17127             printf(" %d", n_stream);
17128             printf(" %d", n_name);
17129             printf(" %d", n_ns);
17130             printf("\n");
17131         }
17132     }
17133     }
17134     }
17135     function_tests++;
17136 #endif
17137
17138     return(test_ret);
17139 }
17140
17141
17142 static int
17143 test_xmlStreamPushNode(void) {
17144     int test_ret = 0;
17145
17146 #if defined(LIBXML_PATTERN_ENABLED)
17147     int mem_base;
17148     int ret_val;
17149     xmlStreamCtxtPtr stream; /* the stream context */
17150     int n_stream;
17151     xmlChar * name; /* the current name */
17152     int n_name;
17153     xmlChar * ns; /* the namespace name */
17154     int n_ns;
17155     int nodeType; /* the type of the node being pushed */
17156     int n_nodeType;
17157
17158     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17159     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17160     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17161     for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17162         mem_base = xmlMemBlocks();
17163         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17164         name = gen_const_xmlChar_ptr(n_name, 1);
17165         ns = gen_const_xmlChar_ptr(n_ns, 2);
17166         nodeType = gen_int(n_nodeType, 3);
17167
17168         ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17169         desret_int(ret_val);
17170         call_tests++;
17171         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17172         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17173         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17174         des_int(n_nodeType, nodeType, 3);
17175         xmlResetLastError();
17176         if (mem_base != xmlMemBlocks()) {
17177             printf("Leak of %d blocks found in xmlStreamPushNode",
17178                    xmlMemBlocks() - mem_base);
17179             test_ret++;
17180             printf(" %d", n_stream);
17181             printf(" %d", n_name);
17182             printf(" %d", n_ns);
17183             printf(" %d", n_nodeType);
17184             printf("\n");
17185         }
17186     }
17187     }
17188     }
17189     }
17190     function_tests++;
17191 #endif
17192
17193     return(test_ret);
17194 }
17195
17196
17197 static int
17198 test_xmlStreamWantsAnyNode(void) {
17199     int test_ret = 0;
17200
17201 #if defined(LIBXML_PATTERN_ENABLED)
17202     int mem_base;
17203     int ret_val;
17204     xmlStreamCtxtPtr streamCtxt; /* the stream context */
17205     int n_streamCtxt;
17206
17207     for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17208         mem_base = xmlMemBlocks();
17209         streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17210
17211         ret_val = xmlStreamWantsAnyNode(streamCtxt);
17212         desret_int(ret_val);
17213         call_tests++;
17214         des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17215         xmlResetLastError();
17216         if (mem_base != xmlMemBlocks()) {
17217             printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17218                    xmlMemBlocks() - mem_base);
17219             test_ret++;
17220             printf(" %d", n_streamCtxt);
17221             printf("\n");
17222         }
17223     }
17224     function_tests++;
17225 #endif
17226
17227     return(test_ret);
17228 }
17229
17230 static int
17231 test_pattern(void) {
17232     int test_ret = 0;
17233
17234     if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17235     test_ret += test_xmlPatternFromRoot();
17236     test_ret += test_xmlPatternGetStreamCtxt();
17237     test_ret += test_xmlPatternMatch();
17238     test_ret += test_xmlPatternMaxDepth();
17239     test_ret += test_xmlPatternMinDepth();
17240     test_ret += test_xmlPatternStreamable();
17241     test_ret += test_xmlPatterncompile();
17242     test_ret += test_xmlStreamPop();
17243     test_ret += test_xmlStreamPush();
17244     test_ret += test_xmlStreamPushAttr();
17245     test_ret += test_xmlStreamPushNode();
17246     test_ret += test_xmlStreamWantsAnyNode();
17247
17248     if (test_ret != 0)
17249         printf("Module pattern: %d errors\n", test_ret);
17250     return(test_ret);
17251 }
17252 #ifdef LIBXML_SCHEMAS_ENABLED
17253
17254 #define gen_nb_xmlRelaxNGPtr 1
17255 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17256     return(NULL);
17257 }
17258 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17259 }
17260 #endif
17261
17262
17263 static int
17264 test_xmlRelaxNGDump(void) {
17265     int test_ret = 0;
17266
17267 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17268     int mem_base;
17269     FILE * output; /* the file output */
17270     int n_output;
17271     xmlRelaxNGPtr schema; /* a schema structure */
17272     int n_schema;
17273
17274     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17275     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17276         mem_base = xmlMemBlocks();
17277         output = gen_FILE_ptr(n_output, 0);
17278         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17279
17280         xmlRelaxNGDump(output, schema);
17281         call_tests++;
17282         des_FILE_ptr(n_output, output, 0);
17283         des_xmlRelaxNGPtr(n_schema, schema, 1);
17284         xmlResetLastError();
17285         if (mem_base != xmlMemBlocks()) {
17286             printf("Leak of %d blocks found in xmlRelaxNGDump",
17287                    xmlMemBlocks() - mem_base);
17288             test_ret++;
17289             printf(" %d", n_output);
17290             printf(" %d", n_schema);
17291             printf("\n");
17292         }
17293     }
17294     }
17295     function_tests++;
17296 #endif
17297
17298     return(test_ret);
17299 }
17300
17301
17302 static int
17303 test_xmlRelaxNGDumpTree(void) {
17304     int test_ret = 0;
17305
17306 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17307     int mem_base;
17308     FILE * output; /* the file output */
17309     int n_output;
17310     xmlRelaxNGPtr schema; /* a schema structure */
17311     int n_schema;
17312
17313     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17314     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17315         mem_base = xmlMemBlocks();
17316         output = gen_FILE_ptr(n_output, 0);
17317         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17318
17319         xmlRelaxNGDumpTree(output, schema);
17320         call_tests++;
17321         des_FILE_ptr(n_output, output, 0);
17322         des_xmlRelaxNGPtr(n_schema, schema, 1);
17323         xmlResetLastError();
17324         if (mem_base != xmlMemBlocks()) {
17325             printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17326                    xmlMemBlocks() - mem_base);
17327             test_ret++;
17328             printf(" %d", n_output);
17329             printf(" %d", n_schema);
17330             printf("\n");
17331         }
17332     }
17333     }
17334     function_tests++;
17335 #endif
17336
17337     return(test_ret);
17338 }
17339
17340 #ifdef LIBXML_SCHEMAS_ENABLED
17341
17342 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17343 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17344     return(NULL);
17345 }
17346 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17347 }
17348 #endif
17349
17350 #ifdef LIBXML_SCHEMAS_ENABLED
17351
17352 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17353 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17354     return(NULL);
17355 }
17356 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17357 }
17358 #endif
17359
17360 #ifdef LIBXML_SCHEMAS_ENABLED
17361
17362 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17363 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17364     return(NULL);
17365 }
17366 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17367 }
17368 #endif
17369
17370
17371 static int
17372 test_xmlRelaxNGGetParserErrors(void) {
17373     int test_ret = 0;
17374
17375 #if defined(LIBXML_SCHEMAS_ENABLED)
17376     int mem_base;
17377     int ret_val;
17378     xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17379     int n_ctxt;
17380     xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17381     int n_err;
17382     xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17383     int n_warn;
17384     void ** ctx; /* contextual data for the callbacks result */
17385     int n_ctx;
17386
17387     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17388     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17389     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17390     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17391         mem_base = xmlMemBlocks();
17392         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17393         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17394         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17395         ctx = gen_void_ptr_ptr(n_ctx, 3);
17396
17397         ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17398         desret_int(ret_val);
17399         call_tests++;
17400         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17401         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17402         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17403         des_void_ptr_ptr(n_ctx, ctx, 3);
17404         xmlResetLastError();
17405         if (mem_base != xmlMemBlocks()) {
17406             printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17407                    xmlMemBlocks() - mem_base);
17408             test_ret++;
17409             printf(" %d", n_ctxt);
17410             printf(" %d", n_err);
17411             printf(" %d", n_warn);
17412             printf(" %d", n_ctx);
17413             printf("\n");
17414         }
17415     }
17416     }
17417     }
17418     }
17419     function_tests++;
17420 #endif
17421
17422     return(test_ret);
17423 }
17424
17425 #ifdef LIBXML_SCHEMAS_ENABLED
17426
17427 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17428 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17429     return(NULL);
17430 }
17431 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17432 }
17433 #endif
17434
17435
17436 static int
17437 test_xmlRelaxNGGetValidErrors(void) {
17438     int test_ret = 0;
17439
17440 #if defined(LIBXML_SCHEMAS_ENABLED)
17441     int mem_base;
17442     int ret_val;
17443     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17444     int n_ctxt;
17445     xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17446     int n_err;
17447     xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17448     int n_warn;
17449     void ** ctx; /* the functions context result */
17450     int n_ctx;
17451
17452     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17453     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17454     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17455     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17456         mem_base = xmlMemBlocks();
17457         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17458         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17459         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17460         ctx = gen_void_ptr_ptr(n_ctx, 3);
17461
17462         ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17463         desret_int(ret_val);
17464         call_tests++;
17465         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17466         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17467         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17468         des_void_ptr_ptr(n_ctx, ctx, 3);
17469         xmlResetLastError();
17470         if (mem_base != xmlMemBlocks()) {
17471             printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17472                    xmlMemBlocks() - mem_base);
17473             test_ret++;
17474             printf(" %d", n_ctxt);
17475             printf(" %d", n_err);
17476             printf(" %d", n_warn);
17477             printf(" %d", n_ctx);
17478             printf("\n");
17479         }
17480     }
17481     }
17482     }
17483     }
17484     function_tests++;
17485 #endif
17486
17487     return(test_ret);
17488 }
17489
17490
17491 static int
17492 test_xmlRelaxNGInitTypes(void) {
17493     int test_ret = 0;
17494
17495 #if defined(LIBXML_SCHEMAS_ENABLED)
17496     int mem_base;
17497     int ret_val;
17498
17499         mem_base = xmlMemBlocks();
17500
17501         ret_val = xmlRelaxNGInitTypes();
17502         desret_int(ret_val);
17503         call_tests++;
17504         xmlResetLastError();
17505         if (mem_base != xmlMemBlocks()) {
17506             printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17507                    xmlMemBlocks() - mem_base);
17508             test_ret++;
17509             printf("\n");
17510         }
17511     function_tests++;
17512 #endif
17513
17514     return(test_ret);
17515 }
17516
17517
17518 static int
17519 test_xmlRelaxNGNewDocParserCtxt(void) {
17520     int test_ret = 0;
17521
17522 #if defined(LIBXML_SCHEMAS_ENABLED)
17523     int mem_base;
17524     xmlRelaxNGParserCtxtPtr ret_val;
17525     xmlDocPtr doc; /* a preparsed document tree */
17526     int n_doc;
17527
17528     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17529         mem_base = xmlMemBlocks();
17530         doc = gen_xmlDocPtr(n_doc, 0);
17531
17532         ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17533         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17534         call_tests++;
17535         des_xmlDocPtr(n_doc, doc, 0);
17536         xmlResetLastError();
17537         if (mem_base != xmlMemBlocks()) {
17538             printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17539                    xmlMemBlocks() - mem_base);
17540             test_ret++;
17541             printf(" %d", n_doc);
17542             printf("\n");
17543         }
17544     }
17545     function_tests++;
17546 #endif
17547
17548     return(test_ret);
17549 }
17550
17551
17552 static int
17553 test_xmlRelaxNGNewMemParserCtxt(void) {
17554     int test_ret = 0;
17555
17556 #if defined(LIBXML_SCHEMAS_ENABLED)
17557     int mem_base;
17558     xmlRelaxNGParserCtxtPtr ret_val;
17559     char * buffer; /* a pointer to a char array containing the schemas */
17560     int n_buffer;
17561     int size; /* the size of the array */
17562     int n_size;
17563
17564     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17565     for (n_size = 0;n_size < gen_nb_int;n_size++) {
17566         mem_base = xmlMemBlocks();
17567         buffer = gen_const_char_ptr(n_buffer, 0);
17568         size = gen_int(n_size, 1);
17569
17570         ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17571         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17572         call_tests++;
17573         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17574         des_int(n_size, size, 1);
17575         xmlResetLastError();
17576         if (mem_base != xmlMemBlocks()) {
17577             printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17578                    xmlMemBlocks() - mem_base);
17579             test_ret++;
17580             printf(" %d", n_buffer);
17581             printf(" %d", n_size);
17582             printf("\n");
17583         }
17584     }
17585     }
17586     function_tests++;
17587 #endif
17588
17589     return(test_ret);
17590 }
17591
17592
17593 static int
17594 test_xmlRelaxNGNewParserCtxt(void) {
17595     int test_ret = 0;
17596
17597 #if defined(LIBXML_SCHEMAS_ENABLED)
17598     int mem_base;
17599     xmlRelaxNGParserCtxtPtr ret_val;
17600     char * URL; /* the location of the schema */
17601     int n_URL;
17602
17603     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17604         mem_base = xmlMemBlocks();
17605         URL = gen_const_char_ptr(n_URL, 0);
17606
17607         ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17608         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17609         call_tests++;
17610         des_const_char_ptr(n_URL, (const char *)URL, 0);
17611         xmlResetLastError();
17612         if (mem_base != xmlMemBlocks()) {
17613             printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17614                    xmlMemBlocks() - mem_base);
17615             test_ret++;
17616             printf(" %d", n_URL);
17617             printf("\n");
17618         }
17619     }
17620     function_tests++;
17621 #endif
17622
17623     return(test_ret);
17624 }
17625
17626
17627 static int
17628 test_xmlRelaxNGNewValidCtxt(void) {
17629     int test_ret = 0;
17630
17631
17632     /* missing type support */
17633     return(test_ret);
17634 }
17635
17636
17637 static int
17638 test_xmlRelaxNGParse(void) {
17639     int test_ret = 0;
17640
17641
17642     /* missing type support */
17643     return(test_ret);
17644 }
17645
17646
17647 static int
17648 test_xmlRelaxNGSetParserErrors(void) {
17649     int test_ret = 0;
17650
17651
17652     /* missing type support */
17653     return(test_ret);
17654 }
17655
17656
17657 static int
17658 test_xmlRelaxNGSetParserStructuredErrors(void) {
17659     int test_ret = 0;
17660
17661
17662     /* missing type support */
17663     return(test_ret);
17664 }
17665
17666
17667 static int
17668 test_xmlRelaxNGSetValidErrors(void) {
17669     int test_ret = 0;
17670
17671
17672     /* missing type support */
17673     return(test_ret);
17674 }
17675
17676
17677 static int
17678 test_xmlRelaxNGSetValidStructuredErrors(void) {
17679     int test_ret = 0;
17680
17681
17682     /* missing type support */
17683     return(test_ret);
17684 }
17685
17686
17687 static int
17688 test_xmlRelaxNGValidateDoc(void) {
17689     int test_ret = 0;
17690
17691 #if defined(LIBXML_SCHEMAS_ENABLED)
17692     int mem_base;
17693     int ret_val;
17694     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17695     int n_ctxt;
17696     xmlDocPtr doc; /* a parsed document tree */
17697     int n_doc;
17698
17699     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17700     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17701         mem_base = xmlMemBlocks();
17702         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17703         doc = gen_xmlDocPtr(n_doc, 1);
17704
17705         ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17706         desret_int(ret_val);
17707         call_tests++;
17708         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17709         des_xmlDocPtr(n_doc, doc, 1);
17710         xmlResetLastError();
17711         if (mem_base != xmlMemBlocks()) {
17712             printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17713                    xmlMemBlocks() - mem_base);
17714             test_ret++;
17715             printf(" %d", n_ctxt);
17716             printf(" %d", n_doc);
17717             printf("\n");
17718         }
17719     }
17720     }
17721     function_tests++;
17722 #endif
17723
17724     return(test_ret);
17725 }
17726
17727
17728 static int
17729 test_xmlRelaxNGValidateFullElement(void) {
17730     int test_ret = 0;
17731
17732 #if defined(LIBXML_SCHEMAS_ENABLED)
17733     int mem_base;
17734     int ret_val;
17735     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17736     int n_ctxt;
17737     xmlDocPtr doc; /* a document instance */
17738     int n_doc;
17739     xmlNodePtr elem; /* an element instance */
17740     int n_elem;
17741
17742     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17743     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17744     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17745         mem_base = xmlMemBlocks();
17746         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17747         doc = gen_xmlDocPtr(n_doc, 1);
17748         elem = gen_xmlNodePtr(n_elem, 2);
17749
17750         ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17751         desret_int(ret_val);
17752         call_tests++;
17753         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17754         des_xmlDocPtr(n_doc, doc, 1);
17755         des_xmlNodePtr(n_elem, elem, 2);
17756         xmlResetLastError();
17757         if (mem_base != xmlMemBlocks()) {
17758             printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17759                    xmlMemBlocks() - mem_base);
17760             test_ret++;
17761             printf(" %d", n_ctxt);
17762             printf(" %d", n_doc);
17763             printf(" %d", n_elem);
17764             printf("\n");
17765         }
17766     }
17767     }
17768     }
17769     function_tests++;
17770 #endif
17771
17772     return(test_ret);
17773 }
17774
17775
17776 static int
17777 test_xmlRelaxNGValidatePopElement(void) {
17778     int test_ret = 0;
17779
17780 #if defined(LIBXML_SCHEMAS_ENABLED)
17781     int mem_base;
17782     int ret_val;
17783     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17784     int n_ctxt;
17785     xmlDocPtr doc; /* a document instance */
17786     int n_doc;
17787     xmlNodePtr elem; /* an element instance */
17788     int n_elem;
17789
17790     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17791     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17792     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17793         mem_base = xmlMemBlocks();
17794         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17795         doc = gen_xmlDocPtr(n_doc, 1);
17796         elem = gen_xmlNodePtr(n_elem, 2);
17797
17798         ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17799         desret_int(ret_val);
17800         call_tests++;
17801         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17802         des_xmlDocPtr(n_doc, doc, 1);
17803         des_xmlNodePtr(n_elem, elem, 2);
17804         xmlResetLastError();
17805         if (mem_base != xmlMemBlocks()) {
17806             printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17807                    xmlMemBlocks() - mem_base);
17808             test_ret++;
17809             printf(" %d", n_ctxt);
17810             printf(" %d", n_doc);
17811             printf(" %d", n_elem);
17812             printf("\n");
17813         }
17814     }
17815     }
17816     }
17817     function_tests++;
17818 #endif
17819
17820     return(test_ret);
17821 }
17822
17823
17824 static int
17825 test_xmlRelaxNGValidatePushCData(void) {
17826     int test_ret = 0;
17827
17828 #if defined(LIBXML_SCHEMAS_ENABLED)
17829     int mem_base;
17830     int ret_val;
17831     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17832     int n_ctxt;
17833     xmlChar * data; /* some character data read */
17834     int n_data;
17835     int len; /* the length of the data */
17836     int n_len;
17837
17838     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17839     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17840     for (n_len = 0;n_len < gen_nb_int;n_len++) {
17841         mem_base = xmlMemBlocks();
17842         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17843         data = gen_const_xmlChar_ptr(n_data, 1);
17844         len = gen_int(n_len, 2);
17845
17846         ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17847         desret_int(ret_val);
17848         call_tests++;
17849         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17850         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17851         des_int(n_len, len, 2);
17852         xmlResetLastError();
17853         if (mem_base != xmlMemBlocks()) {
17854             printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17855                    xmlMemBlocks() - mem_base);
17856             test_ret++;
17857             printf(" %d", n_ctxt);
17858             printf(" %d", n_data);
17859             printf(" %d", n_len);
17860             printf("\n");
17861         }
17862     }
17863     }
17864     }
17865     function_tests++;
17866 #endif
17867
17868     return(test_ret);
17869 }
17870
17871
17872 static int
17873 test_xmlRelaxNGValidatePushElement(void) {
17874     int test_ret = 0;
17875
17876 #if defined(LIBXML_SCHEMAS_ENABLED)
17877     int mem_base;
17878     int ret_val;
17879     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17880     int n_ctxt;
17881     xmlDocPtr doc; /* a document instance */
17882     int n_doc;
17883     xmlNodePtr elem; /* an element instance */
17884     int n_elem;
17885
17886     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17887     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17888     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17889         mem_base = xmlMemBlocks();
17890         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17891         doc = gen_xmlDocPtr(n_doc, 1);
17892         elem = gen_xmlNodePtr(n_elem, 2);
17893
17894         ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17895         desret_int(ret_val);
17896         call_tests++;
17897         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17898         des_xmlDocPtr(n_doc, doc, 1);
17899         des_xmlNodePtr(n_elem, elem, 2);
17900         xmlResetLastError();
17901         if (mem_base != xmlMemBlocks()) {
17902             printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17903                    xmlMemBlocks() - mem_base);
17904             test_ret++;
17905             printf(" %d", n_ctxt);
17906             printf(" %d", n_doc);
17907             printf(" %d", n_elem);
17908             printf("\n");
17909         }
17910     }
17911     }
17912     }
17913     function_tests++;
17914 #endif
17915
17916     return(test_ret);
17917 }
17918
17919
17920 static int
17921 test_xmlRelaxParserSetFlag(void) {
17922     int test_ret = 0;
17923
17924 #if defined(LIBXML_SCHEMAS_ENABLED)
17925     int mem_base;
17926     int ret_val;
17927     xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17928     int n_ctxt;
17929     int flags; /* a set of flags values */
17930     int n_flags;
17931
17932     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17933     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17934         mem_base = xmlMemBlocks();
17935         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17936         flags = gen_int(n_flags, 1);
17937
17938         ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17939         desret_int(ret_val);
17940         call_tests++;
17941         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17942         des_int(n_flags, flags, 1);
17943         xmlResetLastError();
17944         if (mem_base != xmlMemBlocks()) {
17945             printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17946                    xmlMemBlocks() - mem_base);
17947             test_ret++;
17948             printf(" %d", n_ctxt);
17949             printf(" %d", n_flags);
17950             printf("\n");
17951         }
17952     }
17953     }
17954     function_tests++;
17955 #endif
17956
17957     return(test_ret);
17958 }
17959
17960 static int
17961 test_relaxng(void) {
17962     int test_ret = 0;
17963
17964     if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17965     test_ret += test_xmlRelaxNGDump();
17966     test_ret += test_xmlRelaxNGDumpTree();
17967     test_ret += test_xmlRelaxNGGetParserErrors();
17968     test_ret += test_xmlRelaxNGGetValidErrors();
17969     test_ret += test_xmlRelaxNGInitTypes();
17970     test_ret += test_xmlRelaxNGNewDocParserCtxt();
17971     test_ret += test_xmlRelaxNGNewMemParserCtxt();
17972     test_ret += test_xmlRelaxNGNewParserCtxt();
17973     test_ret += test_xmlRelaxNGNewValidCtxt();
17974     test_ret += test_xmlRelaxNGParse();
17975     test_ret += test_xmlRelaxNGSetParserErrors();
17976     test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17977     test_ret += test_xmlRelaxNGSetValidErrors();
17978     test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17979     test_ret += test_xmlRelaxNGValidateDoc();
17980     test_ret += test_xmlRelaxNGValidateFullElement();
17981     test_ret += test_xmlRelaxNGValidatePopElement();
17982     test_ret += test_xmlRelaxNGValidatePushCData();
17983     test_ret += test_xmlRelaxNGValidatePushElement();
17984     test_ret += test_xmlRelaxParserSetFlag();
17985
17986     if (test_ret != 0)
17987         printf("Module relaxng: %d errors\n", test_ret);
17988     return(test_ret);
17989 }
17990 static int
17991 test_schemasInternals(void) {
17992     int test_ret = 0;
17993
17994     if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17995
17996     if (test_ret != 0)
17997         printf("Module schemasInternals: %d errors\n", test_ret);
17998     return(test_ret);
17999 }
18000
18001 static int
18002 test_xmlSchematronNewDocParserCtxt(void) {
18003     int test_ret = 0;
18004
18005
18006     /* missing type support */
18007     return(test_ret);
18008 }
18009
18010
18011 static int
18012 test_xmlSchematronNewMemParserCtxt(void) {
18013     int test_ret = 0;
18014
18015
18016     /* missing type support */
18017     return(test_ret);
18018 }
18019
18020
18021 static int
18022 test_xmlSchematronNewParserCtxt(void) {
18023     int test_ret = 0;
18024
18025
18026     /* missing type support */
18027     return(test_ret);
18028 }
18029
18030 #ifdef LIBXML_SCHEMATRON_ENABLED
18031
18032 #define gen_nb_xmlSchematronPtr 1
18033 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18034     return(NULL);
18035 }
18036 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18037 }
18038 #endif
18039
18040
18041 static int
18042 test_xmlSchematronNewValidCtxt(void) {
18043     int test_ret = 0;
18044
18045
18046     /* missing type support */
18047     return(test_ret);
18048 }
18049
18050 #ifdef LIBXML_SCHEMATRON_ENABLED
18051
18052 #define gen_nb_xmlSchematronParserCtxtPtr 1
18053 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18054     return(NULL);
18055 }
18056 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18057 }
18058 #endif
18059
18060
18061 static int
18062 test_xmlSchematronParse(void) {
18063     int test_ret = 0;
18064
18065
18066     /* missing type support */
18067     return(test_ret);
18068 }
18069
18070 #ifdef LIBXML_SCHEMATRON_ENABLED
18071
18072 #define gen_nb_xmlSchematronValidCtxtPtr 1
18073 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18074     return(NULL);
18075 }
18076 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18077 }
18078 #endif
18079
18080
18081 static int
18082 test_xmlSchematronSetValidStructuredErrors(void) {
18083     int test_ret = 0;
18084
18085
18086     /* missing type support */
18087     return(test_ret);
18088 }
18089
18090
18091 static int
18092 test_xmlSchematronValidateDoc(void) {
18093     int test_ret = 0;
18094
18095 #if defined(LIBXML_SCHEMATRON_ENABLED)
18096     int mem_base;
18097     int ret_val;
18098     xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18099     int n_ctxt;
18100     xmlDocPtr instance; /* the document instace tree */
18101     int n_instance;
18102
18103     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18104     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18105         mem_base = xmlMemBlocks();
18106         ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18107         instance = gen_xmlDocPtr(n_instance, 1);
18108
18109         ret_val = xmlSchematronValidateDoc(ctxt, instance);
18110         desret_int(ret_val);
18111         call_tests++;
18112         des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18113         des_xmlDocPtr(n_instance, instance, 1);
18114         xmlResetLastError();
18115         if (mem_base != xmlMemBlocks()) {
18116             printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18117                    xmlMemBlocks() - mem_base);
18118             test_ret++;
18119             printf(" %d", n_ctxt);
18120             printf(" %d", n_instance);
18121             printf("\n");
18122         }
18123     }
18124     }
18125     function_tests++;
18126 #endif
18127
18128     return(test_ret);
18129 }
18130
18131 static int
18132 test_schematron(void) {
18133     int test_ret = 0;
18134
18135     if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18136     test_ret += test_xmlSchematronNewDocParserCtxt();
18137     test_ret += test_xmlSchematronNewMemParserCtxt();
18138     test_ret += test_xmlSchematronNewParserCtxt();
18139     test_ret += test_xmlSchematronNewValidCtxt();
18140     test_ret += test_xmlSchematronParse();
18141     test_ret += test_xmlSchematronSetValidStructuredErrors();
18142     test_ret += test_xmlSchematronValidateDoc();
18143
18144     if (test_ret != 0)
18145         printf("Module schematron: %d errors\n", test_ret);
18146     return(test_ret);
18147 }
18148
18149 static int
18150 test_xmlAddChild(void) {
18151     int test_ret = 0;
18152
18153     int mem_base;
18154     xmlNodePtr ret_val;
18155     xmlNodePtr parent; /* the parent node */
18156     int n_parent;
18157     xmlNodePtr cur; /* the child node */
18158     int n_cur;
18159
18160     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18161     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18162         mem_base = xmlMemBlocks();
18163         parent = gen_xmlNodePtr(n_parent, 0);
18164         cur = gen_xmlNodePtr_in(n_cur, 1);
18165
18166         ret_val = xmlAddChild(parent, cur);
18167         if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18168         desret_xmlNodePtr(ret_val);
18169         call_tests++;
18170         des_xmlNodePtr(n_parent, parent, 0);
18171         des_xmlNodePtr_in(n_cur, cur, 1);
18172         xmlResetLastError();
18173         if (mem_base != xmlMemBlocks()) {
18174             printf("Leak of %d blocks found in xmlAddChild",
18175                    xmlMemBlocks() - mem_base);
18176             test_ret++;
18177             printf(" %d", n_parent);
18178             printf(" %d", n_cur);
18179             printf("\n");
18180         }
18181     }
18182     }
18183     function_tests++;
18184
18185     return(test_ret);
18186 }
18187
18188
18189 static int
18190 test_xmlAddChildList(void) {
18191     int test_ret = 0;
18192
18193     int mem_base;
18194     xmlNodePtr ret_val;
18195     xmlNodePtr parent; /* the parent node */
18196     int n_parent;
18197     xmlNodePtr cur; /* the first node in the list */
18198     int n_cur;
18199
18200     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18201     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18202         mem_base = xmlMemBlocks();
18203         parent = gen_xmlNodePtr(n_parent, 0);
18204         cur = gen_xmlNodePtr_in(n_cur, 1);
18205
18206         ret_val = xmlAddChildList(parent, cur);
18207         if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18208         desret_xmlNodePtr(ret_val);
18209         call_tests++;
18210         des_xmlNodePtr(n_parent, parent, 0);
18211         des_xmlNodePtr_in(n_cur, cur, 1);
18212         xmlResetLastError();
18213         if (mem_base != xmlMemBlocks()) {
18214             printf("Leak of %d blocks found in xmlAddChildList",
18215                    xmlMemBlocks() - mem_base);
18216             test_ret++;
18217             printf(" %d", n_parent);
18218             printf(" %d", n_cur);
18219             printf("\n");
18220         }
18221     }
18222     }
18223     function_tests++;
18224
18225     return(test_ret);
18226 }
18227
18228
18229 static int
18230 test_xmlAddNextSibling(void) {
18231     int test_ret = 0;
18232
18233     int mem_base;
18234     xmlNodePtr ret_val;
18235     xmlNodePtr cur; /* the child node */
18236     int n_cur;
18237     xmlNodePtr elem; /* the new node */
18238     int n_elem;
18239
18240     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18241     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18242         mem_base = xmlMemBlocks();
18243         cur = gen_xmlNodePtr(n_cur, 0);
18244         elem = gen_xmlNodePtr_in(n_elem, 1);
18245
18246         ret_val = xmlAddNextSibling(cur, elem);
18247         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18248         desret_xmlNodePtr(ret_val);
18249         call_tests++;
18250         des_xmlNodePtr(n_cur, cur, 0);
18251         des_xmlNodePtr_in(n_elem, elem, 1);
18252         xmlResetLastError();
18253         if (mem_base != xmlMemBlocks()) {
18254             printf("Leak of %d blocks found in xmlAddNextSibling",
18255                    xmlMemBlocks() - mem_base);
18256             test_ret++;
18257             printf(" %d", n_cur);
18258             printf(" %d", n_elem);
18259             printf("\n");
18260         }
18261     }
18262     }
18263     function_tests++;
18264
18265     return(test_ret);
18266 }
18267
18268
18269 static int
18270 test_xmlAddPrevSibling(void) {
18271     int test_ret = 0;
18272
18273 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18274     int mem_base;
18275     xmlNodePtr ret_val;
18276     xmlNodePtr cur; /* the child node */
18277     int n_cur;
18278     xmlNodePtr elem; /* the new node */
18279     int n_elem;
18280
18281     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18282     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18283         mem_base = xmlMemBlocks();
18284         cur = gen_xmlNodePtr(n_cur, 0);
18285         elem = gen_xmlNodePtr_in(n_elem, 1);
18286
18287         ret_val = xmlAddPrevSibling(cur, elem);
18288         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18289         desret_xmlNodePtr(ret_val);
18290         call_tests++;
18291         des_xmlNodePtr(n_cur, cur, 0);
18292         des_xmlNodePtr_in(n_elem, elem, 1);
18293         xmlResetLastError();
18294         if (mem_base != xmlMemBlocks()) {
18295             printf("Leak of %d blocks found in xmlAddPrevSibling",
18296                    xmlMemBlocks() - mem_base);
18297             test_ret++;
18298             printf(" %d", n_cur);
18299             printf(" %d", n_elem);
18300             printf("\n");
18301         }
18302     }
18303     }
18304     function_tests++;
18305 #endif
18306
18307     return(test_ret);
18308 }
18309
18310
18311 static int
18312 test_xmlAddSibling(void) {
18313     int test_ret = 0;
18314
18315     int mem_base;
18316     xmlNodePtr ret_val;
18317     xmlNodePtr cur; /* the child node */
18318     int n_cur;
18319     xmlNodePtr elem; /* the new node */
18320     int n_elem;
18321
18322     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18323     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18324         mem_base = xmlMemBlocks();
18325         cur = gen_xmlNodePtr(n_cur, 0);
18326         elem = gen_xmlNodePtr_in(n_elem, 1);
18327
18328         ret_val = xmlAddSibling(cur, elem);
18329         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18330         desret_xmlNodePtr(ret_val);
18331         call_tests++;
18332         des_xmlNodePtr(n_cur, cur, 0);
18333         des_xmlNodePtr_in(n_elem, elem, 1);
18334         xmlResetLastError();
18335         if (mem_base != xmlMemBlocks()) {
18336             printf("Leak of %d blocks found in xmlAddSibling",
18337                    xmlMemBlocks() - mem_base);
18338             test_ret++;
18339             printf(" %d", n_cur);
18340             printf(" %d", n_elem);
18341             printf("\n");
18342         }
18343     }
18344     }
18345     function_tests++;
18346
18347     return(test_ret);
18348 }
18349
18350
18351 static int
18352 test_xmlAttrSerializeTxtContent(void) {
18353     int test_ret = 0;
18354
18355 #if defined(LIBXML_OUTPUT_ENABLED)
18356 #ifdef LIBXML_OUTPUT_ENABLED
18357     int mem_base;
18358     xmlBufferPtr buf; /* the XML buffer output */
18359     int n_buf;
18360     xmlDocPtr doc; /* the document */
18361     int n_doc;
18362     xmlAttrPtr attr; /* the attribute node */
18363     int n_attr;
18364     xmlChar * string; /* the text content */
18365     int n_string;
18366
18367     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18368     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18369     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18370     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18371         mem_base = xmlMemBlocks();
18372         buf = gen_xmlBufferPtr(n_buf, 0);
18373         doc = gen_xmlDocPtr(n_doc, 1);
18374         attr = gen_xmlAttrPtr(n_attr, 2);
18375         string = gen_const_xmlChar_ptr(n_string, 3);
18376
18377         xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18378         call_tests++;
18379         des_xmlBufferPtr(n_buf, buf, 0);
18380         des_xmlDocPtr(n_doc, doc, 1);
18381         des_xmlAttrPtr(n_attr, attr, 2);
18382         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18383         xmlResetLastError();
18384         if (mem_base != xmlMemBlocks()) {
18385             printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18386                    xmlMemBlocks() - mem_base);
18387             test_ret++;
18388             printf(" %d", n_buf);
18389             printf(" %d", n_doc);
18390             printf(" %d", n_attr);
18391             printf(" %d", n_string);
18392             printf("\n");
18393         }
18394     }
18395     }
18396     }
18397     }
18398     function_tests++;
18399 #endif
18400 #endif
18401
18402     return(test_ret);
18403 }
18404
18405
18406 #define gen_nb_const_xmlBufPtr 1
18407 static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18408     return(NULL);
18409 }
18410 static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18411 }
18412
18413 static int
18414 test_xmlBufContent(void) {
18415     int test_ret = 0;
18416
18417     int mem_base;
18418     xmlChar * ret_val;
18419     xmlBufPtr buf; /* the buffer */
18420     int n_buf;
18421
18422     for (n_buf = 0;n_buf < gen_nb_const_xmlBufPtr;n_buf++) {
18423         mem_base = xmlMemBlocks();
18424         buf = gen_const_xmlBufPtr(n_buf, 0);
18425
18426         ret_val = xmlBufContent((const xmlBufPtr)buf);
18427         desret_xmlChar_ptr(ret_val);
18428         call_tests++;
18429         des_const_xmlBufPtr(n_buf, (const xmlBufPtr)buf, 0);
18430         xmlResetLastError();
18431         if (mem_base != xmlMemBlocks()) {
18432             printf("Leak of %d blocks found in xmlBufContent",
18433                    xmlMemBlocks() - mem_base);
18434             test_ret++;
18435             printf(" %d", n_buf);
18436             printf("\n");
18437         }
18438     }
18439     function_tests++;
18440
18441     return(test_ret);
18442 }
18443
18444
18445 static int
18446 test_xmlBufEnd(void) {
18447     int test_ret = 0;
18448
18449     int mem_base;
18450     xmlChar * ret_val;
18451     xmlBufPtr buf; /* the buffer */
18452     int n_buf;
18453
18454     for (n_buf = 0;n_buf < gen_nb_const_xmlBufPtr;n_buf++) {
18455         mem_base = xmlMemBlocks();
18456         buf = gen_const_xmlBufPtr(n_buf, 0);
18457
18458         ret_val = xmlBufEnd((const xmlBufPtr)buf);
18459         desret_xmlChar_ptr(ret_val);
18460         call_tests++;
18461         des_const_xmlBufPtr(n_buf, (const xmlBufPtr)buf, 0);
18462         xmlResetLastError();
18463         if (mem_base != xmlMemBlocks()) {
18464             printf("Leak of %d blocks found in xmlBufEnd",
18465                    xmlMemBlocks() - mem_base);
18466             test_ret++;
18467             printf(" %d", n_buf);
18468             printf("\n");
18469         }
18470     }
18471     function_tests++;
18472
18473     return(test_ret);
18474 }
18475
18476
18477 #define gen_nb_xmlBufPtr 1
18478 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18479     return(NULL);
18480 }
18481 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18482 }
18483
18484 static int
18485 test_xmlBufGetNodeContent(void) {
18486     int test_ret = 0;
18487
18488     int mem_base;
18489     int ret_val;
18490     xmlBufPtr buf; /* a buffer xmlBufPtr */
18491     int n_buf;
18492     xmlNodePtr cur; /* the node being read */
18493     int n_cur;
18494
18495     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18496     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18497         mem_base = xmlMemBlocks();
18498         buf = gen_xmlBufPtr(n_buf, 0);
18499         cur = gen_xmlNodePtr(n_cur, 1);
18500
18501         ret_val = xmlBufGetNodeContent(buf, cur);
18502         desret_int(ret_val);
18503         call_tests++;
18504         des_xmlBufPtr(n_buf, buf, 0);
18505         des_xmlNodePtr(n_cur, cur, 1);
18506         xmlResetLastError();
18507         if (mem_base != xmlMemBlocks()) {
18508             printf("Leak of %d blocks found in xmlBufGetNodeContent",
18509                    xmlMemBlocks() - mem_base);
18510             test_ret++;
18511             printf(" %d", n_buf);
18512             printf(" %d", n_cur);
18513             printf("\n");
18514         }
18515     }
18516     }
18517     function_tests++;
18518
18519     return(test_ret);
18520 }
18521
18522
18523 static int
18524 test_xmlBufNodeDump(void) {
18525     int test_ret = 0;
18526
18527
18528     /* missing type support */
18529     return(test_ret);
18530 }
18531
18532
18533 static int
18534 test_xmlBufShrink(void) {
18535     int test_ret = 0;
18536
18537
18538     /* missing type support */
18539     return(test_ret);
18540 }
18541
18542
18543 static int
18544 test_xmlBufUse(void) {
18545     int test_ret = 0;
18546
18547
18548     /* missing type support */
18549     return(test_ret);
18550 }
18551
18552
18553 static int
18554 test_xmlBufferAdd(void) {
18555     int test_ret = 0;
18556
18557     int mem_base;
18558     int ret_val;
18559     xmlBufferPtr buf; /* the buffer to dump */
18560     int n_buf;
18561     xmlChar * str; /* the #xmlChar string */
18562     int n_str;
18563     int len; /* the number of #xmlChar to add */
18564     int n_len;
18565
18566     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18567     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18568     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18569         mem_base = xmlMemBlocks();
18570         buf = gen_xmlBufferPtr(n_buf, 0);
18571         str = gen_const_xmlChar_ptr(n_str, 1);
18572         len = gen_int(n_len, 2);
18573
18574         ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18575         desret_int(ret_val);
18576         call_tests++;
18577         des_xmlBufferPtr(n_buf, buf, 0);
18578         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18579         des_int(n_len, len, 2);
18580         xmlResetLastError();
18581         if (mem_base != xmlMemBlocks()) {
18582             printf("Leak of %d blocks found in xmlBufferAdd",
18583                    xmlMemBlocks() - mem_base);
18584             test_ret++;
18585             printf(" %d", n_buf);
18586             printf(" %d", n_str);
18587             printf(" %d", n_len);
18588             printf("\n");
18589         }
18590     }
18591     }
18592     }
18593     function_tests++;
18594
18595     return(test_ret);
18596 }
18597
18598
18599 static int
18600 test_xmlBufferAddHead(void) {
18601     int test_ret = 0;
18602
18603     int mem_base;
18604     int ret_val;
18605     xmlBufferPtr buf; /* the buffer */
18606     int n_buf;
18607     xmlChar * str; /* the #xmlChar string */
18608     int n_str;
18609     int len; /* the number of #xmlChar to add */
18610     int n_len;
18611
18612     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18613     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18614     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18615         mem_base = xmlMemBlocks();
18616         buf = gen_xmlBufferPtr(n_buf, 0);
18617         str = gen_const_xmlChar_ptr(n_str, 1);
18618         len = gen_int(n_len, 2);
18619
18620         ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18621         desret_int(ret_val);
18622         call_tests++;
18623         des_xmlBufferPtr(n_buf, buf, 0);
18624         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18625         des_int(n_len, len, 2);
18626         xmlResetLastError();
18627         if (mem_base != xmlMemBlocks()) {
18628             printf("Leak of %d blocks found in xmlBufferAddHead",
18629                    xmlMemBlocks() - mem_base);
18630             test_ret++;
18631             printf(" %d", n_buf);
18632             printf(" %d", n_str);
18633             printf(" %d", n_len);
18634             printf("\n");
18635         }
18636     }
18637     }
18638     }
18639     function_tests++;
18640
18641     return(test_ret);
18642 }
18643
18644
18645 static int
18646 test_xmlBufferCCat(void) {
18647     int test_ret = 0;
18648
18649     int mem_base;
18650     int ret_val;
18651     xmlBufferPtr buf; /* the buffer to dump */
18652     int n_buf;
18653     char * str; /* the C char string */
18654     int n_str;
18655
18656     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18657     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18658         mem_base = xmlMemBlocks();
18659         buf = gen_xmlBufferPtr(n_buf, 0);
18660         str = gen_const_char_ptr(n_str, 1);
18661
18662         ret_val = xmlBufferCCat(buf, (const char *)str);
18663         desret_int(ret_val);
18664         call_tests++;
18665         des_xmlBufferPtr(n_buf, buf, 0);
18666         des_const_char_ptr(n_str, (const char *)str, 1);
18667         xmlResetLastError();
18668         if (mem_base != xmlMemBlocks()) {
18669             printf("Leak of %d blocks found in xmlBufferCCat",
18670                    xmlMemBlocks() - mem_base);
18671             test_ret++;
18672             printf(" %d", n_buf);
18673             printf(" %d", n_str);
18674             printf("\n");
18675         }
18676     }
18677     }
18678     function_tests++;
18679
18680     return(test_ret);
18681 }
18682
18683
18684 static int
18685 test_xmlBufferCat(void) {
18686     int test_ret = 0;
18687
18688     int mem_base;
18689     int ret_val;
18690     xmlBufferPtr buf; /* the buffer to add to */
18691     int n_buf;
18692     xmlChar * str; /* the #xmlChar string */
18693     int n_str;
18694
18695     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18696     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18697         mem_base = xmlMemBlocks();
18698         buf = gen_xmlBufferPtr(n_buf, 0);
18699         str = gen_const_xmlChar_ptr(n_str, 1);
18700
18701         ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18702         desret_int(ret_val);
18703         call_tests++;
18704         des_xmlBufferPtr(n_buf, buf, 0);
18705         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18706         xmlResetLastError();
18707         if (mem_base != xmlMemBlocks()) {
18708             printf("Leak of %d blocks found in xmlBufferCat",
18709                    xmlMemBlocks() - mem_base);
18710             test_ret++;
18711             printf(" %d", n_buf);
18712             printf(" %d", n_str);
18713             printf("\n");
18714         }
18715     }
18716     }
18717     function_tests++;
18718
18719     return(test_ret);
18720 }
18721
18722
18723 #define gen_nb_const_xmlBufferPtr 1
18724 static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18725     return(NULL);
18726 }
18727 static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18728 }
18729
18730 static int
18731 test_xmlBufferContent(void) {
18732     int test_ret = 0;
18733
18734     int mem_base;
18735     const xmlChar * ret_val;
18736     xmlBufferPtr buf; /* the buffer */
18737     int n_buf;
18738
18739     for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18740         mem_base = xmlMemBlocks();
18741         buf = gen_const_xmlBufferPtr(n_buf, 0);
18742
18743         ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18744         desret_const_xmlChar_ptr(ret_val);
18745         call_tests++;
18746         des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18747         xmlResetLastError();
18748         if (mem_base != xmlMemBlocks()) {
18749             printf("Leak of %d blocks found in xmlBufferContent",
18750                    xmlMemBlocks() - mem_base);
18751             test_ret++;
18752             printf(" %d", n_buf);
18753             printf("\n");
18754         }
18755     }
18756     function_tests++;
18757
18758     return(test_ret);
18759 }
18760
18761
18762 static int
18763 test_xmlBufferCreate(void) {
18764     int test_ret = 0;
18765
18766     int mem_base;
18767     xmlBufferPtr ret_val;
18768
18769         mem_base = xmlMemBlocks();
18770
18771         ret_val = xmlBufferCreate();
18772         desret_xmlBufferPtr(ret_val);
18773         call_tests++;
18774         xmlResetLastError();
18775         if (mem_base != xmlMemBlocks()) {
18776             printf("Leak of %d blocks found in xmlBufferCreate",
18777                    xmlMemBlocks() - mem_base);
18778             test_ret++;
18779             printf("\n");
18780         }
18781     function_tests++;
18782
18783     return(test_ret);
18784 }
18785
18786
18787 static int
18788 test_xmlBufferCreateSize(void) {
18789     int test_ret = 0;
18790
18791
18792     /* missing type support */
18793     return(test_ret);
18794 }
18795
18796
18797 static int
18798 test_xmlBufferCreateStatic(void) {
18799     int test_ret = 0;
18800
18801
18802     /* missing type support */
18803     return(test_ret);
18804 }
18805
18806
18807 static int
18808 test_xmlBufferDetach(void) {
18809     int test_ret = 0;
18810
18811     int mem_base;
18812     xmlChar * ret_val;
18813     xmlBufferPtr buf; /* the buffer */
18814     int n_buf;
18815
18816     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18817         mem_base = xmlMemBlocks();
18818         buf = gen_xmlBufferPtr(n_buf, 0);
18819
18820         ret_val = xmlBufferDetach(buf);
18821         desret_xmlChar_ptr(ret_val);
18822         call_tests++;
18823         des_xmlBufferPtr(n_buf, buf, 0);
18824         xmlResetLastError();
18825         if (mem_base != xmlMemBlocks()) {
18826             printf("Leak of %d blocks found in xmlBufferDetach",
18827                    xmlMemBlocks() - mem_base);
18828             test_ret++;
18829             printf(" %d", n_buf);
18830             printf("\n");
18831         }
18832     }
18833     function_tests++;
18834
18835     return(test_ret);
18836 }
18837
18838
18839 static int
18840 test_xmlBufferEmpty(void) {
18841     int test_ret = 0;
18842
18843     int mem_base;
18844     xmlBufferPtr buf; /* the buffer */
18845     int n_buf;
18846
18847     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18848         mem_base = xmlMemBlocks();
18849         buf = gen_xmlBufferPtr(n_buf, 0);
18850
18851         xmlBufferEmpty(buf);
18852         call_tests++;
18853         des_xmlBufferPtr(n_buf, buf, 0);
18854         xmlResetLastError();
18855         if (mem_base != xmlMemBlocks()) {
18856             printf("Leak of %d blocks found in xmlBufferEmpty",
18857                    xmlMemBlocks() - mem_base);
18858             test_ret++;
18859             printf(" %d", n_buf);
18860             printf("\n");
18861         }
18862     }
18863     function_tests++;
18864
18865     return(test_ret);
18866 }
18867
18868
18869 static int
18870 test_xmlBufferGrow(void) {
18871     int test_ret = 0;
18872
18873     int mem_base;
18874     int ret_val;
18875     xmlBufferPtr buf; /* the buffer */
18876     int n_buf;
18877     unsigned int len; /* the minimum free size to allocate */
18878     int n_len;
18879
18880     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18881     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18882         mem_base = xmlMemBlocks();
18883         buf = gen_xmlBufferPtr(n_buf, 0);
18884         len = gen_unsigned_int(n_len, 1);
18885
18886         ret_val = xmlBufferGrow(buf, len);
18887         desret_int(ret_val);
18888         call_tests++;
18889         des_xmlBufferPtr(n_buf, buf, 0);
18890         des_unsigned_int(n_len, len, 1);
18891         xmlResetLastError();
18892         if (mem_base != xmlMemBlocks()) {
18893             printf("Leak of %d blocks found in xmlBufferGrow",
18894                    xmlMemBlocks() - mem_base);
18895             test_ret++;
18896             printf(" %d", n_buf);
18897             printf(" %d", n_len);
18898             printf("\n");
18899         }
18900     }
18901     }
18902     function_tests++;
18903
18904     return(test_ret);
18905 }
18906
18907
18908 static int
18909 test_xmlBufferLength(void) {
18910     int test_ret = 0;
18911
18912     int mem_base;
18913     int ret_val;
18914     xmlBufferPtr buf; /* the buffer */
18915     int n_buf;
18916
18917     for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18918         mem_base = xmlMemBlocks();
18919         buf = gen_const_xmlBufferPtr(n_buf, 0);
18920
18921         ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18922         desret_int(ret_val);
18923         call_tests++;
18924         des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18925         xmlResetLastError();
18926         if (mem_base != xmlMemBlocks()) {
18927             printf("Leak of %d blocks found in xmlBufferLength",
18928                    xmlMemBlocks() - mem_base);
18929             test_ret++;
18930             printf(" %d", n_buf);
18931             printf("\n");
18932         }
18933     }
18934     function_tests++;
18935
18936     return(test_ret);
18937 }
18938
18939
18940 static int
18941 test_xmlBufferResize(void) {
18942     int test_ret = 0;
18943
18944     int mem_base;
18945     int ret_val;
18946     xmlBufferPtr buf; /* the buffer to resize */
18947     int n_buf;
18948     unsigned int size; /* the desired size */
18949     int n_size;
18950
18951     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18952     for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18953         mem_base = xmlMemBlocks();
18954         buf = gen_xmlBufferPtr(n_buf, 0);
18955         size = gen_unsigned_int(n_size, 1);
18956
18957         ret_val = xmlBufferResize(buf, size);
18958         desret_int(ret_val);
18959         call_tests++;
18960         des_xmlBufferPtr(n_buf, buf, 0);
18961         des_unsigned_int(n_size, size, 1);
18962         xmlResetLastError();
18963         if (mem_base != xmlMemBlocks()) {
18964             printf("Leak of %d blocks found in xmlBufferResize",
18965                    xmlMemBlocks() - mem_base);
18966             test_ret++;
18967             printf(" %d", n_buf);
18968             printf(" %d", n_size);
18969             printf("\n");
18970         }
18971     }
18972     }
18973     function_tests++;
18974
18975     return(test_ret);
18976 }
18977
18978
18979 static int
18980 test_xmlBufferSetAllocationScheme(void) {
18981     int test_ret = 0;
18982
18983     int mem_base;
18984     xmlBufferPtr buf; /* the buffer to tune */
18985     int n_buf;
18986     xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18987     int n_scheme;
18988
18989     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18990     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18991         mem_base = xmlMemBlocks();
18992         buf = gen_xmlBufferPtr(n_buf, 0);
18993         scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18994
18995         xmlBufferSetAllocationScheme(buf, scheme);
18996         if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
18997         call_tests++;
18998         des_xmlBufferPtr(n_buf, buf, 0);
18999         des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
19000         xmlResetLastError();
19001         if (mem_base != xmlMemBlocks()) {
19002             printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
19003                    xmlMemBlocks() - mem_base);
19004             test_ret++;
19005             printf(" %d", n_buf);
19006             printf(" %d", n_scheme);
19007             printf("\n");
19008         }
19009     }
19010     }
19011     function_tests++;
19012
19013     return(test_ret);
19014 }
19015
19016
19017 static int
19018 test_xmlBufferShrink(void) {
19019     int test_ret = 0;
19020
19021     int mem_base;
19022     int ret_val;
19023     xmlBufferPtr buf; /* the buffer to dump */
19024     int n_buf;
19025     unsigned int len; /* the number of xmlChar to remove */
19026     int n_len;
19027
19028     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19029     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19030         mem_base = xmlMemBlocks();
19031         buf = gen_xmlBufferPtr(n_buf, 0);
19032         len = gen_unsigned_int(n_len, 1);
19033
19034         ret_val = xmlBufferShrink(buf, len);
19035         desret_int(ret_val);
19036         call_tests++;
19037         des_xmlBufferPtr(n_buf, buf, 0);
19038         des_unsigned_int(n_len, len, 1);
19039         xmlResetLastError();
19040         if (mem_base != xmlMemBlocks()) {
19041             printf("Leak of %d blocks found in xmlBufferShrink",
19042                    xmlMemBlocks() - mem_base);
19043             test_ret++;
19044             printf(" %d", n_buf);
19045             printf(" %d", n_len);
19046             printf("\n");
19047         }
19048     }
19049     }
19050     function_tests++;
19051
19052     return(test_ret);
19053 }
19054
19055
19056 static int
19057 test_xmlBufferWriteCHAR(void) {
19058     int test_ret = 0;
19059
19060     int mem_base;
19061     xmlBufferPtr buf; /* the XML buffer */
19062     int n_buf;
19063     xmlChar * string; /* the string to add */
19064     int n_string;
19065
19066     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19067     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19068         mem_base = xmlMemBlocks();
19069         buf = gen_xmlBufferPtr(n_buf, 0);
19070         string = gen_const_xmlChar_ptr(n_string, 1);
19071
19072         xmlBufferWriteCHAR(buf, (const xmlChar *)string);
19073         call_tests++;
19074         des_xmlBufferPtr(n_buf, buf, 0);
19075         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19076         xmlResetLastError();
19077         if (mem_base != xmlMemBlocks()) {
19078             printf("Leak of %d blocks found in xmlBufferWriteCHAR",
19079                    xmlMemBlocks() - mem_base);
19080             test_ret++;
19081             printf(" %d", n_buf);
19082             printf(" %d", n_string);
19083             printf("\n");
19084         }
19085     }
19086     }
19087     function_tests++;
19088
19089     return(test_ret);
19090 }
19091
19092
19093 static int
19094 test_xmlBufferWriteChar(void) {
19095     int test_ret = 0;
19096
19097     int mem_base;
19098     xmlBufferPtr buf; /* the XML buffer output */
19099     int n_buf;
19100     char * string; /* the string to add */
19101     int n_string;
19102
19103     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19104     for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
19105         mem_base = xmlMemBlocks();
19106         buf = gen_xmlBufferPtr(n_buf, 0);
19107         string = gen_const_char_ptr(n_string, 1);
19108
19109         xmlBufferWriteChar(buf, (const char *)string);
19110         call_tests++;
19111         des_xmlBufferPtr(n_buf, buf, 0);
19112         des_const_char_ptr(n_string, (const char *)string, 1);
19113         xmlResetLastError();
19114         if (mem_base != xmlMemBlocks()) {
19115             printf("Leak of %d blocks found in xmlBufferWriteChar",
19116                    xmlMemBlocks() - mem_base);
19117             test_ret++;
19118             printf(" %d", n_buf);
19119             printf(" %d", n_string);
19120             printf("\n");
19121         }
19122     }
19123     }
19124     function_tests++;
19125
19126     return(test_ret);
19127 }
19128
19129
19130 static int
19131 test_xmlBufferWriteQuotedString(void) {
19132     int test_ret = 0;
19133
19134     int mem_base;
19135     xmlBufferPtr buf; /* the XML buffer output */
19136     int n_buf;
19137     xmlChar * string; /* the string to add */
19138     int n_string;
19139
19140     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19141     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19142         mem_base = xmlMemBlocks();
19143         buf = gen_xmlBufferPtr(n_buf, 0);
19144         string = gen_const_xmlChar_ptr(n_string, 1);
19145
19146         xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
19147         call_tests++;
19148         des_xmlBufferPtr(n_buf, buf, 0);
19149         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19150         xmlResetLastError();
19151         if (mem_base != xmlMemBlocks()) {
19152             printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
19153                    xmlMemBlocks() - mem_base);
19154             test_ret++;
19155             printf(" %d", n_buf);
19156             printf(" %d", n_string);
19157             printf("\n");
19158         }
19159     }
19160     }
19161     function_tests++;
19162
19163     return(test_ret);
19164 }
19165
19166
19167 static int
19168 test_xmlBuildQName(void) {
19169     int test_ret = 0;
19170
19171     int mem_base;
19172     xmlChar * ret_val;
19173     xmlChar * ncname; /* the Name */
19174     int n_ncname;
19175     xmlChar * prefix; /* the prefix */
19176     int n_prefix;
19177     xmlChar * memory; /* preallocated memory */
19178     int n_memory;
19179     int len; /* preallocated memory length */
19180     int n_len;
19181
19182     for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19183     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19184     for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19185     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19186         mem_base = xmlMemBlocks();
19187         ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19188         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19189         memory = gen_xmlChar_ptr(n_memory, 2);
19190         len = gen_int(n_len, 3);
19191
19192         ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19193         if ((ret_val != NULL) && (ret_val != ncname) &&
19194               (ret_val != prefix) && (ret_val != memory))
19195               xmlFree(ret_val);
19196           ret_val = NULL;
19197         desret_xmlChar_ptr(ret_val);
19198         call_tests++;
19199         des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19200         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19201         des_xmlChar_ptr(n_memory, memory, 2);
19202         des_int(n_len, len, 3);
19203         xmlResetLastError();
19204         if (mem_base != xmlMemBlocks()) {
19205             printf("Leak of %d blocks found in xmlBuildQName",
19206                    xmlMemBlocks() - mem_base);
19207             test_ret++;
19208             printf(" %d", n_ncname);
19209             printf(" %d", n_prefix);
19210             printf(" %d", n_memory);
19211             printf(" %d", n_len);
19212             printf("\n");
19213         }
19214     }
19215     }
19216     }
19217     }
19218     function_tests++;
19219
19220     return(test_ret);
19221 }
19222
19223
19224 static int
19225 test_xmlChildElementCount(void) {
19226     int test_ret = 0;
19227
19228 #if defined(LIBXML_TREE_ENABLED)
19229     int mem_base;
19230     unsigned long ret_val;
19231     xmlNodePtr parent; /* the parent node */
19232     int n_parent;
19233
19234     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19235         mem_base = xmlMemBlocks();
19236         parent = gen_xmlNodePtr(n_parent, 0);
19237
19238         ret_val = xmlChildElementCount(parent);
19239         desret_unsigned_long(ret_val);
19240         call_tests++;
19241         des_xmlNodePtr(n_parent, parent, 0);
19242         xmlResetLastError();
19243         if (mem_base != xmlMemBlocks()) {
19244             printf("Leak of %d blocks found in xmlChildElementCount",
19245                    xmlMemBlocks() - mem_base);
19246             test_ret++;
19247             printf(" %d", n_parent);
19248             printf("\n");
19249         }
19250     }
19251     function_tests++;
19252 #endif
19253
19254     return(test_ret);
19255 }
19256
19257
19258 static int
19259 test_xmlCopyDoc(void) {
19260     int test_ret = 0;
19261
19262 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19263     int mem_base;
19264     xmlDocPtr ret_val;
19265     xmlDocPtr doc; /* the document */
19266     int n_doc;
19267     int recursive; /* if not zero do a recursive copy. */
19268     int n_recursive;
19269
19270     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19271     for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19272         mem_base = xmlMemBlocks();
19273         doc = gen_xmlDocPtr(n_doc, 0);
19274         recursive = gen_int(n_recursive, 1);
19275
19276         ret_val = xmlCopyDoc(doc, recursive);
19277         desret_xmlDocPtr(ret_val);
19278         call_tests++;
19279         des_xmlDocPtr(n_doc, doc, 0);
19280         des_int(n_recursive, recursive, 1);
19281         xmlResetLastError();
19282         if (mem_base != xmlMemBlocks()) {
19283             printf("Leak of %d blocks found in xmlCopyDoc",
19284                    xmlMemBlocks() - mem_base);
19285             test_ret++;
19286             printf(" %d", n_doc);
19287             printf(" %d", n_recursive);
19288             printf("\n");
19289         }
19290     }
19291     }
19292     function_tests++;
19293 #endif
19294
19295     return(test_ret);
19296 }
19297
19298
19299 static int
19300 test_xmlCopyDtd(void) {
19301     int test_ret = 0;
19302
19303 #if defined(LIBXML_TREE_ENABLED)
19304     int mem_base;
19305     xmlDtdPtr ret_val;
19306     xmlDtdPtr dtd; /* the dtd */
19307     int n_dtd;
19308
19309     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19310         mem_base = xmlMemBlocks();
19311         dtd = gen_xmlDtdPtr(n_dtd, 0);
19312
19313         ret_val = xmlCopyDtd(dtd);
19314         desret_xmlDtdPtr(ret_val);
19315         call_tests++;
19316         des_xmlDtdPtr(n_dtd, dtd, 0);
19317         xmlResetLastError();
19318         if (mem_base != xmlMemBlocks()) {
19319             printf("Leak of %d blocks found in xmlCopyDtd",
19320                    xmlMemBlocks() - mem_base);
19321             test_ret++;
19322             printf(" %d", n_dtd);
19323             printf("\n");
19324         }
19325     }
19326     function_tests++;
19327 #endif
19328
19329     return(test_ret);
19330 }
19331
19332
19333 static int
19334 test_xmlCopyNamespace(void) {
19335     int test_ret = 0;
19336
19337     int mem_base;
19338     xmlNsPtr ret_val;
19339     xmlNsPtr cur; /* the namespace */
19340     int n_cur;
19341
19342     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19343         mem_base = xmlMemBlocks();
19344         cur = gen_xmlNsPtr(n_cur, 0);
19345
19346         ret_val = xmlCopyNamespace(cur);
19347         if (ret_val != NULL) xmlFreeNs(ret_val);
19348         desret_xmlNsPtr(ret_val);
19349         call_tests++;
19350         des_xmlNsPtr(n_cur, cur, 0);
19351         xmlResetLastError();
19352         if (mem_base != xmlMemBlocks()) {
19353             printf("Leak of %d blocks found in xmlCopyNamespace",
19354                    xmlMemBlocks() - mem_base);
19355             test_ret++;
19356             printf(" %d", n_cur);
19357             printf("\n");
19358         }
19359     }
19360     function_tests++;
19361
19362     return(test_ret);
19363 }
19364
19365
19366 static int
19367 test_xmlCopyNamespaceList(void) {
19368     int test_ret = 0;
19369
19370     int mem_base;
19371     xmlNsPtr ret_val;
19372     xmlNsPtr cur; /* the first namespace */
19373     int n_cur;
19374
19375     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19376         mem_base = xmlMemBlocks();
19377         cur = gen_xmlNsPtr(n_cur, 0);
19378
19379         ret_val = xmlCopyNamespaceList(cur);
19380         if (ret_val != NULL) xmlFreeNsList(ret_val);
19381         desret_xmlNsPtr(ret_val);
19382         call_tests++;
19383         des_xmlNsPtr(n_cur, cur, 0);
19384         xmlResetLastError();
19385         if (mem_base != xmlMemBlocks()) {
19386             printf("Leak of %d blocks found in xmlCopyNamespaceList",
19387                    xmlMemBlocks() - mem_base);
19388             test_ret++;
19389             printf(" %d", n_cur);
19390             printf("\n");
19391         }
19392     }
19393     function_tests++;
19394
19395     return(test_ret);
19396 }
19397
19398
19399 static int
19400 test_xmlCopyNode(void) {
19401     int test_ret = 0;
19402
19403     int mem_base;
19404     xmlNodePtr ret_val;
19405     xmlNodePtr node; /* the node */
19406     int n_node;
19407     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19408     int n_extended;
19409
19410     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19411     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19412         mem_base = xmlMemBlocks();
19413         node = gen_const_xmlNodePtr(n_node, 0);
19414         extended = gen_int(n_extended, 1);
19415
19416         ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19417         desret_xmlNodePtr(ret_val);
19418         call_tests++;
19419         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19420         des_int(n_extended, extended, 1);
19421         xmlResetLastError();
19422         if (mem_base != xmlMemBlocks()) {
19423             printf("Leak of %d blocks found in xmlCopyNode",
19424                    xmlMemBlocks() - mem_base);
19425             test_ret++;
19426             printf(" %d", n_node);
19427             printf(" %d", n_extended);
19428             printf("\n");
19429         }
19430     }
19431     }
19432     function_tests++;
19433
19434     return(test_ret);
19435 }
19436
19437
19438 static int
19439 test_xmlCopyNodeList(void) {
19440     int test_ret = 0;
19441
19442     int mem_base;
19443     xmlNodePtr ret_val;
19444     xmlNodePtr node; /* the first node in the list. */
19445     int n_node;
19446
19447     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19448         mem_base = xmlMemBlocks();
19449         node = gen_const_xmlNodePtr(n_node, 0);
19450
19451         ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19452         desret_xmlNodePtr(ret_val);
19453         call_tests++;
19454         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19455         xmlResetLastError();
19456         if (mem_base != xmlMemBlocks()) {
19457             printf("Leak of %d blocks found in xmlCopyNodeList",
19458                    xmlMemBlocks() - mem_base);
19459             test_ret++;
19460             printf(" %d", n_node);
19461             printf("\n");
19462         }
19463     }
19464     function_tests++;
19465
19466     return(test_ret);
19467 }
19468
19469
19470 static int
19471 test_xmlCopyProp(void) {
19472     int test_ret = 0;
19473
19474     int mem_base;
19475     xmlAttrPtr ret_val;
19476     xmlNodePtr target; /* the element where the attribute will be grafted */
19477     int n_target;
19478     xmlAttrPtr cur; /* the attribute */
19479     int n_cur;
19480
19481     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19482     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19483         mem_base = xmlMemBlocks();
19484         target = gen_xmlNodePtr(n_target, 0);
19485         cur = gen_xmlAttrPtr(n_cur, 1);
19486
19487         ret_val = xmlCopyProp(target, cur);
19488         desret_xmlAttrPtr(ret_val);
19489         call_tests++;
19490         des_xmlNodePtr(n_target, target, 0);
19491         des_xmlAttrPtr(n_cur, cur, 1);
19492         xmlResetLastError();
19493         if (mem_base != xmlMemBlocks()) {
19494             printf("Leak of %d blocks found in xmlCopyProp",
19495                    xmlMemBlocks() - mem_base);
19496             test_ret++;
19497             printf(" %d", n_target);
19498             printf(" %d", n_cur);
19499             printf("\n");
19500         }
19501     }
19502     }
19503     function_tests++;
19504
19505     return(test_ret);
19506 }
19507
19508
19509 static int
19510 test_xmlCopyPropList(void) {
19511     int test_ret = 0;
19512
19513     int mem_base;
19514     xmlAttrPtr ret_val;
19515     xmlNodePtr target; /* the element where the attributes will be grafted */
19516     int n_target;
19517     xmlAttrPtr cur; /* the first attribute */
19518     int n_cur;
19519
19520     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19521     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19522         mem_base = xmlMemBlocks();
19523         target = gen_xmlNodePtr(n_target, 0);
19524         cur = gen_xmlAttrPtr(n_cur, 1);
19525
19526         ret_val = xmlCopyPropList(target, cur);
19527         desret_xmlAttrPtr(ret_val);
19528         call_tests++;
19529         des_xmlNodePtr(n_target, target, 0);
19530         des_xmlAttrPtr(n_cur, cur, 1);
19531         xmlResetLastError();
19532         if (mem_base != xmlMemBlocks()) {
19533             printf("Leak of %d blocks found in xmlCopyPropList",
19534                    xmlMemBlocks() - mem_base);
19535             test_ret++;
19536             printf(" %d", n_target);
19537             printf(" %d", n_cur);
19538             printf("\n");
19539         }
19540     }
19541     }
19542     function_tests++;
19543
19544     return(test_ret);
19545 }
19546
19547
19548 static int
19549 test_xmlCreateIntSubset(void) {
19550     int test_ret = 0;
19551
19552     int mem_base;
19553     xmlDtdPtr ret_val;
19554     xmlDocPtr doc; /* the document pointer */
19555     int n_doc;
19556     xmlChar * name; /* the DTD name */
19557     int n_name;
19558     xmlChar * ExternalID; /* the external (PUBLIC) ID */
19559     int n_ExternalID;
19560     xmlChar * SystemID; /* the system ID */
19561     int n_SystemID;
19562
19563     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19564     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19565     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19566     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19567         mem_base = xmlMemBlocks();
19568         doc = gen_xmlDocPtr(n_doc, 0);
19569         name = gen_const_xmlChar_ptr(n_name, 1);
19570         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19571         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19572
19573         ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19574         desret_xmlDtdPtr(ret_val);
19575         call_tests++;
19576         des_xmlDocPtr(n_doc, doc, 0);
19577         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19578         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19579         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19580         xmlResetLastError();
19581         if (mem_base != xmlMemBlocks()) {
19582             printf("Leak of %d blocks found in xmlCreateIntSubset",
19583                    xmlMemBlocks() - mem_base);
19584             test_ret++;
19585             printf(" %d", n_doc);
19586             printf(" %d", n_name);
19587             printf(" %d", n_ExternalID);
19588             printf(" %d", n_SystemID);
19589             printf("\n");
19590         }
19591     }
19592     }
19593     }
19594     }
19595     function_tests++;
19596
19597     return(test_ret);
19598 }
19599
19600
19601 #define gen_nb_xmlDOMWrapCtxtPtr 1
19602 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19603     return(NULL);
19604 }
19605 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19606 }
19607
19608 static int
19609 test_xmlDOMWrapAdoptNode(void) {
19610     int test_ret = 0;
19611
19612     int mem_base;
19613     int ret_val;
19614     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19615     int n_ctxt;
19616     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19617     int n_sourceDoc;
19618     xmlNodePtr node; /* the node to start with */
19619     int n_node;
19620     xmlDocPtr destDoc; /* the destination doc */
19621     int n_destDoc;
19622     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19623     int n_destParent;
19624     int options; /* option flags */
19625     int n_options;
19626
19627     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19628     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19629     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19630     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19631     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19632     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19633         mem_base = xmlMemBlocks();
19634         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19635         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19636         node = gen_xmlNodePtr(n_node, 2);
19637         destDoc = gen_xmlDocPtr(n_destDoc, 3);
19638         destParent = gen_xmlNodePtr(n_destParent, 4);
19639         options = gen_int(n_options, 5);
19640
19641         ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19642         if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19643         desret_int(ret_val);
19644         call_tests++;
19645         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19646         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19647         des_xmlNodePtr(n_node, node, 2);
19648         des_xmlDocPtr(n_destDoc, destDoc, 3);
19649         des_xmlNodePtr(n_destParent, destParent, 4);
19650         des_int(n_options, options, 5);
19651         xmlResetLastError();
19652         if (mem_base != xmlMemBlocks()) {
19653             printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19654                    xmlMemBlocks() - mem_base);
19655             test_ret++;
19656             printf(" %d", n_ctxt);
19657             printf(" %d", n_sourceDoc);
19658             printf(" %d", n_node);
19659             printf(" %d", n_destDoc);
19660             printf(" %d", n_destParent);
19661             printf(" %d", n_options);
19662             printf("\n");
19663         }
19664     }
19665     }
19666     }
19667     }
19668     }
19669     }
19670     function_tests++;
19671
19672     return(test_ret);
19673 }
19674
19675
19676 static int
19677 test_xmlDOMWrapCloneNode(void) {
19678     int test_ret = 0;
19679
19680     int mem_base;
19681     int ret_val;
19682     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19683     int n_ctxt;
19684     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19685     int n_sourceDoc;
19686     xmlNodePtr node; /* the node to start with */
19687     int n_node;
19688     xmlNodePtr * resNode; /* the clone of the given @node */
19689     int n_resNode;
19690     xmlDocPtr destDoc; /* the destination doc */
19691     int n_destDoc;
19692     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19693     int n_destParent;
19694     int deep; /* descend into child if set */
19695     int n_deep;
19696     int options; /* option flags */
19697     int n_options;
19698
19699     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19700     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19701     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19702     for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19703     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19704     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19705     for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19706     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19707         mem_base = xmlMemBlocks();
19708         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19709         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19710         node = gen_xmlNodePtr(n_node, 2);
19711         resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19712         destDoc = gen_xmlDocPtr(n_destDoc, 4);
19713         destParent = gen_xmlNodePtr(n_destParent, 5);
19714         deep = gen_int(n_deep, 6);
19715         options = gen_int(n_options, 7);
19716
19717         ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19718         desret_int(ret_val);
19719         call_tests++;
19720         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19721         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19722         des_xmlNodePtr(n_node, node, 2);
19723         des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19724         des_xmlDocPtr(n_destDoc, destDoc, 4);
19725         des_xmlNodePtr(n_destParent, destParent, 5);
19726         des_int(n_deep, deep, 6);
19727         des_int(n_options, options, 7);
19728         xmlResetLastError();
19729         if (mem_base != xmlMemBlocks()) {
19730             printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19731                    xmlMemBlocks() - mem_base);
19732             test_ret++;
19733             printf(" %d", n_ctxt);
19734             printf(" %d", n_sourceDoc);
19735             printf(" %d", n_node);
19736             printf(" %d", n_resNode);
19737             printf(" %d", n_destDoc);
19738             printf(" %d", n_destParent);
19739             printf(" %d", n_deep);
19740             printf(" %d", n_options);
19741             printf("\n");
19742         }
19743     }
19744     }
19745     }
19746     }
19747     }
19748     }
19749     }
19750     }
19751     function_tests++;
19752
19753     return(test_ret);
19754 }
19755
19756
19757 static int
19758 test_xmlDOMWrapNewCtxt(void) {
19759     int test_ret = 0;
19760
19761
19762     /* missing type support */
19763     return(test_ret);
19764 }
19765
19766
19767 static int
19768 test_xmlDOMWrapReconcileNamespaces(void) {
19769     int test_ret = 0;
19770
19771     int mem_base;
19772     int ret_val;
19773     xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19774     int n_ctxt;
19775     xmlNodePtr elem; /* the element-node */
19776     int n_elem;
19777     int options; /* option flags */
19778     int n_options;
19779
19780     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19781     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19782     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19783         mem_base = xmlMemBlocks();
19784         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19785         elem = gen_xmlNodePtr(n_elem, 1);
19786         options = gen_int(n_options, 2);
19787
19788         ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19789         desret_int(ret_val);
19790         call_tests++;
19791         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19792         des_xmlNodePtr(n_elem, elem, 1);
19793         des_int(n_options, options, 2);
19794         xmlResetLastError();
19795         if (mem_base != xmlMemBlocks()) {
19796             printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19797                    xmlMemBlocks() - mem_base);
19798             test_ret++;
19799             printf(" %d", n_ctxt);
19800             printf(" %d", n_elem);
19801             printf(" %d", n_options);
19802             printf("\n");
19803         }
19804     }
19805     }
19806     }
19807     function_tests++;
19808
19809     return(test_ret);
19810 }
19811
19812
19813 static int
19814 test_xmlDOMWrapRemoveNode(void) {
19815     int test_ret = 0;
19816
19817     int mem_base;
19818     int ret_val;
19819     xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19820     int n_ctxt;
19821     xmlDocPtr doc; /* the doc */
19822     int n_doc;
19823     xmlNodePtr node; /* the node to be removed. */
19824     int n_node;
19825     int options; /* set of options, unused at the moment */
19826     int n_options;
19827
19828     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19829     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19830     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19831     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19832         mem_base = xmlMemBlocks();
19833         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19834         doc = gen_xmlDocPtr(n_doc, 1);
19835         node = gen_xmlNodePtr(n_node, 2);
19836         options = gen_int(n_options, 3);
19837
19838         ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19839         desret_int(ret_val);
19840         call_tests++;
19841         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19842         des_xmlDocPtr(n_doc, doc, 1);
19843         des_xmlNodePtr(n_node, node, 2);
19844         des_int(n_options, options, 3);
19845         xmlResetLastError();
19846         if (mem_base != xmlMemBlocks()) {
19847             printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19848                    xmlMemBlocks() - mem_base);
19849             test_ret++;
19850             printf(" %d", n_ctxt);
19851             printf(" %d", n_doc);
19852             printf(" %d", n_node);
19853             printf(" %d", n_options);
19854             printf("\n");
19855         }
19856     }
19857     }
19858     }
19859     }
19860     function_tests++;
19861
19862     return(test_ret);
19863 }
19864
19865
19866 static int
19867 test_xmlDocCopyNode(void) {
19868     int test_ret = 0;
19869
19870     int mem_base;
19871     xmlNodePtr ret_val;
19872     xmlNodePtr node; /* the node */
19873     int n_node;
19874     xmlDocPtr doc; /* the document */
19875     int n_doc;
19876     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19877     int n_extended;
19878
19879     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19880     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19881     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19882         mem_base = xmlMemBlocks();
19883         node = gen_const_xmlNodePtr(n_node, 0);
19884         doc = gen_xmlDocPtr(n_doc, 1);
19885         extended = gen_int(n_extended, 2);
19886
19887         ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19888         desret_xmlNodePtr(ret_val);
19889         call_tests++;
19890         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19891         des_xmlDocPtr(n_doc, doc, 1);
19892         des_int(n_extended, extended, 2);
19893         xmlResetLastError();
19894         if (mem_base != xmlMemBlocks()) {
19895             printf("Leak of %d blocks found in xmlDocCopyNode",
19896                    xmlMemBlocks() - mem_base);
19897             test_ret++;
19898             printf(" %d", n_node);
19899             printf(" %d", n_doc);
19900             printf(" %d", n_extended);
19901             printf("\n");
19902         }
19903     }
19904     }
19905     }
19906     function_tests++;
19907
19908     return(test_ret);
19909 }
19910
19911
19912 static int
19913 test_xmlDocCopyNodeList(void) {
19914     int test_ret = 0;
19915
19916     int mem_base;
19917     xmlNodePtr ret_val;
19918     xmlDocPtr doc; /* the target document */
19919     int n_doc;
19920     xmlNodePtr node; /* the first node in the list. */
19921     int n_node;
19922
19923     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19924     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19925         mem_base = xmlMemBlocks();
19926         doc = gen_xmlDocPtr(n_doc, 0);
19927         node = gen_const_xmlNodePtr(n_node, 1);
19928
19929         ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19930         desret_xmlNodePtr(ret_val);
19931         call_tests++;
19932         des_xmlDocPtr(n_doc, doc, 0);
19933         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19934         xmlResetLastError();
19935         if (mem_base != xmlMemBlocks()) {
19936             printf("Leak of %d blocks found in xmlDocCopyNodeList",
19937                    xmlMemBlocks() - mem_base);
19938             test_ret++;
19939             printf(" %d", n_doc);
19940             printf(" %d", n_node);
19941             printf("\n");
19942         }
19943     }
19944     }
19945     function_tests++;
19946
19947     return(test_ret);
19948 }
19949
19950
19951 static int
19952 test_xmlDocDump(void) {
19953     int test_ret = 0;
19954
19955 #if defined(LIBXML_OUTPUT_ENABLED)
19956     int mem_base;
19957     int ret_val;
19958     FILE * f; /* the FILE* */
19959     int n_f;
19960     xmlDocPtr cur; /* the document */
19961     int n_cur;
19962
19963     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19964     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19965         mem_base = xmlMemBlocks();
19966         f = gen_FILE_ptr(n_f, 0);
19967         cur = gen_xmlDocPtr(n_cur, 1);
19968
19969         ret_val = xmlDocDump(f, cur);
19970         desret_int(ret_val);
19971         call_tests++;
19972         des_FILE_ptr(n_f, f, 0);
19973         des_xmlDocPtr(n_cur, cur, 1);
19974         xmlResetLastError();
19975         if (mem_base != xmlMemBlocks()) {
19976             printf("Leak of %d blocks found in xmlDocDump",
19977                    xmlMemBlocks() - mem_base);
19978             test_ret++;
19979             printf(" %d", n_f);
19980             printf(" %d", n_cur);
19981             printf("\n");
19982         }
19983     }
19984     }
19985     function_tests++;
19986 #endif
19987
19988     return(test_ret);
19989 }
19990
19991
19992 static int
19993 test_xmlDocDumpFormatMemory(void) {
19994     int test_ret = 0;
19995
19996 #if defined(LIBXML_OUTPUT_ENABLED)
19997     int mem_base;
19998     xmlDocPtr cur; /* the document */
19999     int n_cur;
20000     xmlChar ** mem; /* OUT: the memory pointer */
20001     int n_mem;
20002     int * size; /* OUT: the memory length */
20003     int n_size;
20004     int format; /* should formatting spaces been added */
20005     int n_format;
20006
20007     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20008     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20009     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20010     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20011         mem_base = xmlMemBlocks();
20012         cur = gen_xmlDocPtr(n_cur, 0);
20013         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20014         size = gen_int_ptr(n_size, 2);
20015         format = gen_int(n_format, 3);
20016
20017         xmlDocDumpFormatMemory(cur, mem, size, format);
20018         call_tests++;
20019         des_xmlDocPtr(n_cur, cur, 0);
20020         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20021         des_int_ptr(n_size, size, 2);
20022         des_int(n_format, format, 3);
20023         xmlResetLastError();
20024         if (mem_base != xmlMemBlocks()) {
20025             printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
20026                    xmlMemBlocks() - mem_base);
20027             test_ret++;
20028             printf(" %d", n_cur);
20029             printf(" %d", n_mem);
20030             printf(" %d", n_size);
20031             printf(" %d", n_format);
20032             printf("\n");
20033         }
20034     }
20035     }
20036     }
20037     }
20038     function_tests++;
20039 #endif
20040
20041     return(test_ret);
20042 }
20043
20044
20045 static int
20046 test_xmlDocDumpFormatMemoryEnc(void) {
20047     int test_ret = 0;
20048
20049 #if defined(LIBXML_OUTPUT_ENABLED)
20050     int mem_base;
20051     xmlDocPtr out_doc; /* Document to generate XML text from */
20052     int n_out_doc;
20053     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20054     int n_doc_txt_ptr;
20055     int * doc_txt_len; /* Length of the generated XML text */
20056     int n_doc_txt_len;
20057     char * txt_encoding; /* Character encoding to use when generating XML text */
20058     int n_txt_encoding;
20059     int format; /* should formatting spaces been added */
20060     int n_format;
20061
20062     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20063     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20064     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20065     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20066     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20067         mem_base = xmlMemBlocks();
20068         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20069         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20070         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20071         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20072         format = gen_int(n_format, 4);
20073
20074         xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
20075         call_tests++;
20076         des_xmlDocPtr(n_out_doc, out_doc, 0);
20077         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20078         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20079         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20080         des_int(n_format, format, 4);
20081         xmlResetLastError();
20082         if (mem_base != xmlMemBlocks()) {
20083             printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
20084                    xmlMemBlocks() - mem_base);
20085             test_ret++;
20086             printf(" %d", n_out_doc);
20087             printf(" %d", n_doc_txt_ptr);
20088             printf(" %d", n_doc_txt_len);
20089             printf(" %d", n_txt_encoding);
20090             printf(" %d", n_format);
20091             printf("\n");
20092         }
20093     }
20094     }
20095     }
20096     }
20097     }
20098     function_tests++;
20099 #endif
20100
20101     return(test_ret);
20102 }
20103
20104
20105 static int
20106 test_xmlDocDumpMemory(void) {
20107     int test_ret = 0;
20108
20109 #if defined(LIBXML_OUTPUT_ENABLED)
20110     int mem_base;
20111     xmlDocPtr cur; /* the document */
20112     int n_cur;
20113     xmlChar ** mem; /* OUT: the memory pointer */
20114     int n_mem;
20115     int * size; /* OUT: the memory length */
20116     int n_size;
20117
20118     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20119     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20120     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20121         mem_base = xmlMemBlocks();
20122         cur = gen_xmlDocPtr(n_cur, 0);
20123         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20124         size = gen_int_ptr(n_size, 2);
20125
20126         xmlDocDumpMemory(cur, mem, size);
20127         call_tests++;
20128         des_xmlDocPtr(n_cur, cur, 0);
20129         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20130         des_int_ptr(n_size, size, 2);
20131         xmlResetLastError();
20132         if (mem_base != xmlMemBlocks()) {
20133             printf("Leak of %d blocks found in xmlDocDumpMemory",
20134                    xmlMemBlocks() - mem_base);
20135             test_ret++;
20136             printf(" %d", n_cur);
20137             printf(" %d", n_mem);
20138             printf(" %d", n_size);
20139             printf("\n");
20140         }
20141     }
20142     }
20143     }
20144     function_tests++;
20145 #endif
20146
20147     return(test_ret);
20148 }
20149
20150
20151 static int
20152 test_xmlDocDumpMemoryEnc(void) {
20153     int test_ret = 0;
20154
20155 #if defined(LIBXML_OUTPUT_ENABLED)
20156     int mem_base;
20157     xmlDocPtr out_doc; /* Document to generate XML text from */
20158     int n_out_doc;
20159     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20160     int n_doc_txt_ptr;
20161     int * doc_txt_len; /* Length of the generated XML text */
20162     int n_doc_txt_len;
20163     char * txt_encoding; /* Character encoding to use when generating XML text */
20164     int n_txt_encoding;
20165
20166     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20167     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20168     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20169     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20170         mem_base = xmlMemBlocks();
20171         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20172         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20173         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20174         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20175
20176         xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
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         xmlResetLastError();
20183         if (mem_base != xmlMemBlocks()) {
20184             printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20185                    xmlMemBlocks() - mem_base);
20186             test_ret++;
20187             printf(" %d", n_out_doc);
20188             printf(" %d", n_doc_txt_ptr);
20189             printf(" %d", n_doc_txt_len);
20190             printf(" %d", n_txt_encoding);
20191             printf("\n");
20192         }
20193     }
20194     }
20195     }
20196     }
20197     function_tests++;
20198 #endif
20199
20200     return(test_ret);
20201 }
20202
20203
20204 static int
20205 test_xmlDocFormatDump(void) {
20206     int test_ret = 0;
20207
20208 #if defined(LIBXML_OUTPUT_ENABLED)
20209     int mem_base;
20210     int ret_val;
20211     FILE * f; /* the FILE* */
20212     int n_f;
20213     xmlDocPtr cur; /* the document */
20214     int n_cur;
20215     int format; /* should formatting spaces been added */
20216     int n_format;
20217
20218     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20219     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20220     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20221         mem_base = xmlMemBlocks();
20222         f = gen_FILE_ptr(n_f, 0);
20223         cur = gen_xmlDocPtr(n_cur, 1);
20224         format = gen_int(n_format, 2);
20225
20226         ret_val = xmlDocFormatDump(f, cur, format);
20227         desret_int(ret_val);
20228         call_tests++;
20229         des_FILE_ptr(n_f, f, 0);
20230         des_xmlDocPtr(n_cur, cur, 1);
20231         des_int(n_format, format, 2);
20232         xmlResetLastError();
20233         if (mem_base != xmlMemBlocks()) {
20234             printf("Leak of %d blocks found in xmlDocFormatDump",
20235                    xmlMemBlocks() - mem_base);
20236             test_ret++;
20237             printf(" %d", n_f);
20238             printf(" %d", n_cur);
20239             printf(" %d", n_format);
20240             printf("\n");
20241         }
20242     }
20243     }
20244     }
20245     function_tests++;
20246 #endif
20247
20248     return(test_ret);
20249 }
20250
20251
20252 static int
20253 test_xmlDocGetRootElement(void) {
20254     int test_ret = 0;
20255
20256     int mem_base;
20257     xmlNodePtr ret_val;
20258     xmlDocPtr doc; /* the document */
20259     int n_doc;
20260
20261     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20262         mem_base = xmlMemBlocks();
20263         doc = gen_xmlDocPtr(n_doc, 0);
20264
20265         ret_val = xmlDocGetRootElement(doc);
20266         desret_xmlNodePtr(ret_val);
20267         call_tests++;
20268         des_xmlDocPtr(n_doc, doc, 0);
20269         xmlResetLastError();
20270         if (mem_base != xmlMemBlocks()) {
20271             printf("Leak of %d blocks found in xmlDocGetRootElement",
20272                    xmlMemBlocks() - mem_base);
20273             test_ret++;
20274             printf(" %d", n_doc);
20275             printf("\n");
20276         }
20277     }
20278     function_tests++;
20279
20280     return(test_ret);
20281 }
20282
20283
20284 static int
20285 test_xmlDocSetRootElement(void) {
20286     int test_ret = 0;
20287
20288 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20289     int mem_base;
20290     xmlNodePtr ret_val;
20291     xmlDocPtr doc; /* the document */
20292     int n_doc;
20293     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. */
20294     int n_root;
20295
20296     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20297     for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20298         mem_base = xmlMemBlocks();
20299         doc = gen_xmlDocPtr(n_doc, 0);
20300         root = gen_xmlNodePtr_in(n_root, 1);
20301
20302         ret_val = xmlDocSetRootElement(doc, root);
20303         if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20304         desret_xmlNodePtr(ret_val);
20305         call_tests++;
20306         des_xmlDocPtr(n_doc, doc, 0);
20307         des_xmlNodePtr_in(n_root, root, 1);
20308         xmlResetLastError();
20309         if (mem_base != xmlMemBlocks()) {
20310             printf("Leak of %d blocks found in xmlDocSetRootElement",
20311                    xmlMemBlocks() - mem_base);
20312             test_ret++;
20313             printf(" %d", n_doc);
20314             printf(" %d", n_root);
20315             printf("\n");
20316         }
20317     }
20318     }
20319     function_tests++;
20320 #endif
20321
20322     return(test_ret);
20323 }
20324
20325
20326 static int
20327 test_xmlElemDump(void) {
20328     int test_ret = 0;
20329
20330 #if defined(LIBXML_OUTPUT_ENABLED)
20331     int mem_base;
20332     FILE * f; /* the FILE * for the output */
20333     int n_f;
20334     xmlDocPtr doc; /* the document */
20335     int n_doc;
20336     xmlNodePtr cur; /* the current node */
20337     int n_cur;
20338
20339     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20340     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20341     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20342         mem_base = xmlMemBlocks();
20343         f = gen_FILE_ptr(n_f, 0);
20344         doc = gen_xmlDocPtr(n_doc, 1);
20345         cur = gen_xmlNodePtr(n_cur, 2);
20346
20347         xmlElemDump(f, doc, cur);
20348         call_tests++;
20349         des_FILE_ptr(n_f, f, 0);
20350         des_xmlDocPtr(n_doc, doc, 1);
20351         des_xmlNodePtr(n_cur, cur, 2);
20352         xmlResetLastError();
20353         if (mem_base != xmlMemBlocks()) {
20354             printf("Leak of %d blocks found in xmlElemDump",
20355                    xmlMemBlocks() - mem_base);
20356             test_ret++;
20357             printf(" %d", n_f);
20358             printf(" %d", n_doc);
20359             printf(" %d", n_cur);
20360             printf("\n");
20361         }
20362     }
20363     }
20364     }
20365     function_tests++;
20366 #endif
20367
20368     return(test_ret);
20369 }
20370
20371
20372 static int
20373 test_xmlFirstElementChild(void) {
20374     int test_ret = 0;
20375
20376 #if defined(LIBXML_TREE_ENABLED)
20377     int mem_base;
20378     xmlNodePtr ret_val;
20379     xmlNodePtr parent; /* the parent node */
20380     int n_parent;
20381
20382     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20383         mem_base = xmlMemBlocks();
20384         parent = gen_xmlNodePtr(n_parent, 0);
20385
20386         ret_val = xmlFirstElementChild(parent);
20387         desret_xmlNodePtr(ret_val);
20388         call_tests++;
20389         des_xmlNodePtr(n_parent, parent, 0);
20390         xmlResetLastError();
20391         if (mem_base != xmlMemBlocks()) {
20392             printf("Leak of %d blocks found in xmlFirstElementChild",
20393                    xmlMemBlocks() - mem_base);
20394             test_ret++;
20395             printf(" %d", n_parent);
20396             printf("\n");
20397         }
20398     }
20399     function_tests++;
20400 #endif
20401
20402     return(test_ret);
20403 }
20404
20405
20406 static int
20407 test_xmlGetBufferAllocationScheme(void) {
20408     int test_ret = 0;
20409
20410     int mem_base;
20411     xmlBufferAllocationScheme ret_val;
20412
20413         mem_base = xmlMemBlocks();
20414
20415         ret_val = xmlGetBufferAllocationScheme();
20416         desret_xmlBufferAllocationScheme(ret_val);
20417         call_tests++;
20418         xmlResetLastError();
20419         if (mem_base != xmlMemBlocks()) {
20420             printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20421                    xmlMemBlocks() - mem_base);
20422             test_ret++;
20423             printf("\n");
20424         }
20425     function_tests++;
20426
20427     return(test_ret);
20428 }
20429
20430
20431 static int
20432 test_xmlGetCompressMode(void) {
20433     int test_ret = 0;
20434
20435     int mem_base;
20436     int ret_val;
20437
20438         mem_base = xmlMemBlocks();
20439
20440         ret_val = xmlGetCompressMode();
20441         desret_int(ret_val);
20442         call_tests++;
20443         xmlResetLastError();
20444         if (mem_base != xmlMemBlocks()) {
20445             printf("Leak of %d blocks found in xmlGetCompressMode",
20446                    xmlMemBlocks() - mem_base);
20447             test_ret++;
20448             printf("\n");
20449         }
20450     function_tests++;
20451
20452     return(test_ret);
20453 }
20454
20455
20456 static int
20457 test_xmlGetDocCompressMode(void) {
20458     int test_ret = 0;
20459
20460     int mem_base;
20461     int ret_val;
20462     xmlDocPtr doc; /* the document */
20463     int n_doc;
20464
20465     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20466         mem_base = xmlMemBlocks();
20467         doc = gen_xmlDocPtr(n_doc, 0);
20468
20469         ret_val = xmlGetDocCompressMode(doc);
20470         desret_int(ret_val);
20471         call_tests++;
20472         des_xmlDocPtr(n_doc, doc, 0);
20473         xmlResetLastError();
20474         if (mem_base != xmlMemBlocks()) {
20475             printf("Leak of %d blocks found in xmlGetDocCompressMode",
20476                    xmlMemBlocks() - mem_base);
20477             test_ret++;
20478             printf(" %d", n_doc);
20479             printf("\n");
20480         }
20481     }
20482     function_tests++;
20483
20484     return(test_ret);
20485 }
20486
20487
20488 static int
20489 test_xmlGetIntSubset(void) {
20490     int test_ret = 0;
20491
20492     int mem_base;
20493     xmlDtdPtr ret_val;
20494     xmlDocPtr doc; /* the document pointer */
20495     int n_doc;
20496
20497     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20498         mem_base = xmlMemBlocks();
20499         doc = gen_xmlDocPtr(n_doc, 0);
20500
20501         ret_val = xmlGetIntSubset(doc);
20502         desret_xmlDtdPtr(ret_val);
20503         call_tests++;
20504         des_xmlDocPtr(n_doc, doc, 0);
20505         xmlResetLastError();
20506         if (mem_base != xmlMemBlocks()) {
20507             printf("Leak of %d blocks found in xmlGetIntSubset",
20508                    xmlMemBlocks() - mem_base);
20509             test_ret++;
20510             printf(" %d", n_doc);
20511             printf("\n");
20512         }
20513     }
20514     function_tests++;
20515
20516     return(test_ret);
20517 }
20518
20519
20520 static int
20521 test_xmlGetLastChild(void) {
20522     int test_ret = 0;
20523
20524     int mem_base;
20525     xmlNodePtr ret_val;
20526     xmlNodePtr parent; /* the parent node */
20527     int n_parent;
20528
20529     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20530         mem_base = xmlMemBlocks();
20531         parent = gen_xmlNodePtr(n_parent, 0);
20532
20533         ret_val = xmlGetLastChild(parent);
20534         desret_xmlNodePtr(ret_val);
20535         call_tests++;
20536         des_xmlNodePtr(n_parent, parent, 0);
20537         xmlResetLastError();
20538         if (mem_base != xmlMemBlocks()) {
20539             printf("Leak of %d blocks found in xmlGetLastChild",
20540                    xmlMemBlocks() - mem_base);
20541             test_ret++;
20542             printf(" %d", n_parent);
20543             printf("\n");
20544         }
20545     }
20546     function_tests++;
20547
20548     return(test_ret);
20549 }
20550
20551
20552 static int
20553 test_xmlGetLineNo(void) {
20554     int test_ret = 0;
20555
20556     int mem_base;
20557     long ret_val;
20558     xmlNodePtr node; /* valid node */
20559     int n_node;
20560
20561     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20562         mem_base = xmlMemBlocks();
20563         node = gen_xmlNodePtr(n_node, 0);
20564
20565         ret_val = xmlGetLineNo(node);
20566         desret_long(ret_val);
20567         call_tests++;
20568         des_xmlNodePtr(n_node, node, 0);
20569         xmlResetLastError();
20570         if (mem_base != xmlMemBlocks()) {
20571             printf("Leak of %d blocks found in xmlGetLineNo",
20572                    xmlMemBlocks() - mem_base);
20573             test_ret++;
20574             printf(" %d", n_node);
20575             printf("\n");
20576         }
20577     }
20578     function_tests++;
20579
20580     return(test_ret);
20581 }
20582
20583
20584 static int
20585 test_xmlGetNoNsProp(void) {
20586     int test_ret = 0;
20587
20588     int mem_base;
20589     xmlChar * ret_val;
20590     xmlNodePtr node; /* the node */
20591     int n_node;
20592     xmlChar * name; /* the attribute name */
20593     int n_name;
20594
20595     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20596     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20597         mem_base = xmlMemBlocks();
20598         node = gen_xmlNodePtr(n_node, 0);
20599         name = gen_const_xmlChar_ptr(n_name, 1);
20600
20601         ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20602         desret_xmlChar_ptr(ret_val);
20603         call_tests++;
20604         des_xmlNodePtr(n_node, node, 0);
20605         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20606         xmlResetLastError();
20607         if (mem_base != xmlMemBlocks()) {
20608             printf("Leak of %d blocks found in xmlGetNoNsProp",
20609                    xmlMemBlocks() - mem_base);
20610             test_ret++;
20611             printf(" %d", n_node);
20612             printf(" %d", n_name);
20613             printf("\n");
20614         }
20615     }
20616     }
20617     function_tests++;
20618
20619     return(test_ret);
20620 }
20621
20622
20623 static int
20624 test_xmlGetNodePath(void) {
20625     int test_ret = 0;
20626
20627 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20628     int mem_base;
20629     xmlChar * ret_val;
20630     xmlNodePtr node; /* a node */
20631     int n_node;
20632
20633     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20634         mem_base = xmlMemBlocks();
20635         node = gen_xmlNodePtr(n_node, 0);
20636
20637         ret_val = xmlGetNodePath(node);
20638         desret_xmlChar_ptr(ret_val);
20639         call_tests++;
20640         des_xmlNodePtr(n_node, node, 0);
20641         xmlResetLastError();
20642         if (mem_base != xmlMemBlocks()) {
20643             printf("Leak of %d blocks found in xmlGetNodePath",
20644                    xmlMemBlocks() - mem_base);
20645             test_ret++;
20646             printf(" %d", n_node);
20647             printf("\n");
20648         }
20649     }
20650     function_tests++;
20651 #endif
20652
20653     return(test_ret);
20654 }
20655
20656
20657 static int
20658 test_xmlGetNsList(void) {
20659     int test_ret = 0;
20660
20661
20662     /* missing type support */
20663     return(test_ret);
20664 }
20665
20666
20667 static int
20668 test_xmlGetNsProp(void) {
20669     int test_ret = 0;
20670
20671     int mem_base;
20672     xmlChar * ret_val;
20673     xmlNodePtr node; /* the node */
20674     int n_node;
20675     xmlChar * name; /* the attribute name */
20676     int n_name;
20677     xmlChar * nameSpace; /* the URI of the namespace */
20678     int n_nameSpace;
20679
20680     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20681     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20682     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20683         mem_base = xmlMemBlocks();
20684         node = gen_xmlNodePtr(n_node, 0);
20685         name = gen_const_xmlChar_ptr(n_name, 1);
20686         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20687
20688         ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20689         desret_xmlChar_ptr(ret_val);
20690         call_tests++;
20691         des_xmlNodePtr(n_node, node, 0);
20692         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20693         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20694         xmlResetLastError();
20695         if (mem_base != xmlMemBlocks()) {
20696             printf("Leak of %d blocks found in xmlGetNsProp",
20697                    xmlMemBlocks() - mem_base);
20698             test_ret++;
20699             printf(" %d", n_node);
20700             printf(" %d", n_name);
20701             printf(" %d", n_nameSpace);
20702             printf("\n");
20703         }
20704     }
20705     }
20706     }
20707     function_tests++;
20708
20709     return(test_ret);
20710 }
20711
20712
20713 static int
20714 test_xmlGetProp(void) {
20715     int test_ret = 0;
20716
20717     int mem_base;
20718     xmlChar * ret_val;
20719     xmlNodePtr node; /* the node */
20720     int n_node;
20721     xmlChar * name; /* the attribute name */
20722     int n_name;
20723
20724     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20725     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20726         mem_base = xmlMemBlocks();
20727         node = gen_xmlNodePtr(n_node, 0);
20728         name = gen_const_xmlChar_ptr(n_name, 1);
20729
20730         ret_val = xmlGetProp(node, (const xmlChar *)name);
20731         desret_xmlChar_ptr(ret_val);
20732         call_tests++;
20733         des_xmlNodePtr(n_node, node, 0);
20734         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20735         xmlResetLastError();
20736         if (mem_base != xmlMemBlocks()) {
20737             printf("Leak of %d blocks found in xmlGetProp",
20738                    xmlMemBlocks() - mem_base);
20739             test_ret++;
20740             printf(" %d", n_node);
20741             printf(" %d", n_name);
20742             printf("\n");
20743         }
20744     }
20745     }
20746     function_tests++;
20747
20748     return(test_ret);
20749 }
20750
20751
20752 static int
20753 test_xmlHasNsProp(void) {
20754     int test_ret = 0;
20755
20756     int mem_base;
20757     xmlAttrPtr ret_val;
20758     xmlNodePtr node; /* the node */
20759     int n_node;
20760     xmlChar * name; /* the attribute name */
20761     int n_name;
20762     xmlChar * nameSpace; /* the URI of the namespace */
20763     int n_nameSpace;
20764
20765     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20766     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20767     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20768         mem_base = xmlMemBlocks();
20769         node = gen_xmlNodePtr(n_node, 0);
20770         name = gen_const_xmlChar_ptr(n_name, 1);
20771         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20772
20773         ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20774         desret_xmlAttrPtr(ret_val);
20775         call_tests++;
20776         des_xmlNodePtr(n_node, node, 0);
20777         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20778         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20779         xmlResetLastError();
20780         if (mem_base != xmlMemBlocks()) {
20781             printf("Leak of %d blocks found in xmlHasNsProp",
20782                    xmlMemBlocks() - mem_base);
20783             test_ret++;
20784             printf(" %d", n_node);
20785             printf(" %d", n_name);
20786             printf(" %d", n_nameSpace);
20787             printf("\n");
20788         }
20789     }
20790     }
20791     }
20792     function_tests++;
20793
20794     return(test_ret);
20795 }
20796
20797
20798 static int
20799 test_xmlHasProp(void) {
20800     int test_ret = 0;
20801
20802     int mem_base;
20803     xmlAttrPtr ret_val;
20804     xmlNodePtr node; /* the node */
20805     int n_node;
20806     xmlChar * name; /* the attribute name */
20807     int n_name;
20808
20809     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20810     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20811         mem_base = xmlMemBlocks();
20812         node = gen_xmlNodePtr(n_node, 0);
20813         name = gen_const_xmlChar_ptr(n_name, 1);
20814
20815         ret_val = xmlHasProp(node, (const xmlChar *)name);
20816         desret_xmlAttrPtr(ret_val);
20817         call_tests++;
20818         des_xmlNodePtr(n_node, node, 0);
20819         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20820         xmlResetLastError();
20821         if (mem_base != xmlMemBlocks()) {
20822             printf("Leak of %d blocks found in xmlHasProp",
20823                    xmlMemBlocks() - mem_base);
20824             test_ret++;
20825             printf(" %d", n_node);
20826             printf(" %d", n_name);
20827             printf("\n");
20828         }
20829     }
20830     }
20831     function_tests++;
20832
20833     return(test_ret);
20834 }
20835
20836
20837 static int
20838 test_xmlIsBlankNode(void) {
20839     int test_ret = 0;
20840
20841     int mem_base;
20842     int ret_val;
20843     xmlNodePtr node; /* the node */
20844     int n_node;
20845
20846     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20847         mem_base = xmlMemBlocks();
20848         node = gen_xmlNodePtr(n_node, 0);
20849
20850         ret_val = xmlIsBlankNode(node);
20851         desret_int(ret_val);
20852         call_tests++;
20853         des_xmlNodePtr(n_node, node, 0);
20854         xmlResetLastError();
20855         if (mem_base != xmlMemBlocks()) {
20856             printf("Leak of %d blocks found in xmlIsBlankNode",
20857                    xmlMemBlocks() - mem_base);
20858             test_ret++;
20859             printf(" %d", n_node);
20860             printf("\n");
20861         }
20862     }
20863     function_tests++;
20864
20865     return(test_ret);
20866 }
20867
20868
20869 static int
20870 test_xmlIsXHTML(void) {
20871     int test_ret = 0;
20872
20873     int mem_base;
20874     int ret_val;
20875     xmlChar * systemID; /* the system identifier */
20876     int n_systemID;
20877     xmlChar * publicID; /* the public identifier */
20878     int n_publicID;
20879
20880     for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20881     for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20882         mem_base = xmlMemBlocks();
20883         systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20884         publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20885
20886         ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20887         desret_int(ret_val);
20888         call_tests++;
20889         des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20890         des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20891         xmlResetLastError();
20892         if (mem_base != xmlMemBlocks()) {
20893             printf("Leak of %d blocks found in xmlIsXHTML",
20894                    xmlMemBlocks() - mem_base);
20895             test_ret++;
20896             printf(" %d", n_systemID);
20897             printf(" %d", n_publicID);
20898             printf("\n");
20899         }
20900     }
20901     }
20902     function_tests++;
20903
20904     return(test_ret);
20905 }
20906
20907
20908 static int
20909 test_xmlLastElementChild(void) {
20910     int test_ret = 0;
20911
20912 #if defined(LIBXML_TREE_ENABLED)
20913     int mem_base;
20914     xmlNodePtr ret_val;
20915     xmlNodePtr parent; /* the parent node */
20916     int n_parent;
20917
20918     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20919         mem_base = xmlMemBlocks();
20920         parent = gen_xmlNodePtr(n_parent, 0);
20921
20922         ret_val = xmlLastElementChild(parent);
20923         desret_xmlNodePtr(ret_val);
20924         call_tests++;
20925         des_xmlNodePtr(n_parent, parent, 0);
20926         xmlResetLastError();
20927         if (mem_base != xmlMemBlocks()) {
20928             printf("Leak of %d blocks found in xmlLastElementChild",
20929                    xmlMemBlocks() - mem_base);
20930             test_ret++;
20931             printf(" %d", n_parent);
20932             printf("\n");
20933         }
20934     }
20935     function_tests++;
20936 #endif
20937
20938     return(test_ret);
20939 }
20940
20941
20942 static int
20943 test_xmlNewCDataBlock(void) {
20944     int test_ret = 0;
20945
20946     int mem_base;
20947     xmlNodePtr ret_val;
20948     xmlDocPtr doc; /* the document */
20949     int n_doc;
20950     xmlChar * content; /* the CDATA block content content */
20951     int n_content;
20952     int len; /* the length of the block */
20953     int n_len;
20954
20955     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20956     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20957     for (n_len = 0;n_len < gen_nb_int;n_len++) {
20958         mem_base = xmlMemBlocks();
20959         doc = gen_xmlDocPtr(n_doc, 0);
20960         content = gen_const_xmlChar_ptr(n_content, 1);
20961         len = gen_int(n_len, 2);
20962
20963         ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20964         desret_xmlNodePtr(ret_val);
20965         call_tests++;
20966         des_xmlDocPtr(n_doc, doc, 0);
20967         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20968         des_int(n_len, len, 2);
20969         xmlResetLastError();
20970         if (mem_base != xmlMemBlocks()) {
20971             printf("Leak of %d blocks found in xmlNewCDataBlock",
20972                    xmlMemBlocks() - mem_base);
20973             test_ret++;
20974             printf(" %d", n_doc);
20975             printf(" %d", n_content);
20976             printf(" %d", n_len);
20977             printf("\n");
20978         }
20979     }
20980     }
20981     }
20982     function_tests++;
20983
20984     return(test_ret);
20985 }
20986
20987
20988 static int
20989 test_xmlNewCharRef(void) {
20990     int test_ret = 0;
20991
20992     int mem_base;
20993     xmlNodePtr ret_val;
20994     xmlDocPtr doc; /* the document */
20995     int n_doc;
20996     xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20997     int n_name;
20998
20999     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21000     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21001         mem_base = xmlMemBlocks();
21002         doc = gen_xmlDocPtr(n_doc, 0);
21003         name = gen_const_xmlChar_ptr(n_name, 1);
21004
21005         ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
21006         desret_xmlNodePtr(ret_val);
21007         call_tests++;
21008         des_xmlDocPtr(n_doc, doc, 0);
21009         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21010         xmlResetLastError();
21011         if (mem_base != xmlMemBlocks()) {
21012             printf("Leak of %d blocks found in xmlNewCharRef",
21013                    xmlMemBlocks() - mem_base);
21014             test_ret++;
21015             printf(" %d", n_doc);
21016             printf(" %d", n_name);
21017             printf("\n");
21018         }
21019     }
21020     }
21021     function_tests++;
21022
21023     return(test_ret);
21024 }
21025
21026
21027 static int
21028 test_xmlNewChild(void) {
21029     int test_ret = 0;
21030
21031 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21032 #ifdef LIBXML_TREE_ENABLED
21033     int mem_base;
21034     xmlNodePtr ret_val;
21035     xmlNodePtr parent; /* the parent node */
21036     int n_parent;
21037     xmlNsPtr ns; /* a namespace if any */
21038     int n_ns;
21039     xmlChar * name; /* the name of the child */
21040     int n_name;
21041     xmlChar * content; /* the XML content of the child if any. */
21042     int n_content;
21043
21044     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21045     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21046     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21047     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21048         mem_base = xmlMemBlocks();
21049         parent = gen_xmlNodePtr(n_parent, 0);
21050         ns = gen_xmlNsPtr(n_ns, 1);
21051         name = gen_const_xmlChar_ptr(n_name, 2);
21052         content = gen_const_xmlChar_ptr(n_content, 3);
21053
21054         ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21055         desret_xmlNodePtr(ret_val);
21056         call_tests++;
21057         des_xmlNodePtr(n_parent, parent, 0);
21058         des_xmlNsPtr(n_ns, ns, 1);
21059         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21060         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21061         xmlResetLastError();
21062         if (mem_base != xmlMemBlocks()) {
21063             printf("Leak of %d blocks found in xmlNewChild",
21064                    xmlMemBlocks() - mem_base);
21065             test_ret++;
21066             printf(" %d", n_parent);
21067             printf(" %d", n_ns);
21068             printf(" %d", n_name);
21069             printf(" %d", n_content);
21070             printf("\n");
21071         }
21072     }
21073     }
21074     }
21075     }
21076     function_tests++;
21077 #endif
21078 #endif
21079
21080     return(test_ret);
21081 }
21082
21083
21084 static int
21085 test_xmlNewComment(void) {
21086     int test_ret = 0;
21087
21088     int mem_base;
21089     xmlNodePtr ret_val;
21090     xmlChar * content; /* the comment content */
21091     int n_content;
21092
21093     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21094         mem_base = xmlMemBlocks();
21095         content = gen_const_xmlChar_ptr(n_content, 0);
21096
21097         ret_val = xmlNewComment((const xmlChar *)content);
21098         desret_xmlNodePtr(ret_val);
21099         call_tests++;
21100         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21101         xmlResetLastError();
21102         if (mem_base != xmlMemBlocks()) {
21103             printf("Leak of %d blocks found in xmlNewComment",
21104                    xmlMemBlocks() - mem_base);
21105             test_ret++;
21106             printf(" %d", n_content);
21107             printf("\n");
21108         }
21109     }
21110     function_tests++;
21111
21112     return(test_ret);
21113 }
21114
21115
21116 static int
21117 test_xmlNewDoc(void) {
21118     int test_ret = 0;
21119
21120     int mem_base;
21121     xmlDocPtr ret_val;
21122     xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
21123     int n_version;
21124
21125     for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
21126         mem_base = xmlMemBlocks();
21127         version = gen_const_xmlChar_ptr(n_version, 0);
21128
21129         ret_val = xmlNewDoc((const xmlChar *)version);
21130         desret_xmlDocPtr(ret_val);
21131         call_tests++;
21132         des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
21133         xmlResetLastError();
21134         if (mem_base != xmlMemBlocks()) {
21135             printf("Leak of %d blocks found in xmlNewDoc",
21136                    xmlMemBlocks() - mem_base);
21137             test_ret++;
21138             printf(" %d", n_version);
21139             printf("\n");
21140         }
21141     }
21142     function_tests++;
21143
21144     return(test_ret);
21145 }
21146
21147
21148 static int
21149 test_xmlNewDocComment(void) {
21150     int test_ret = 0;
21151
21152     int mem_base;
21153     xmlNodePtr ret_val;
21154     xmlDocPtr doc; /* the document */
21155     int n_doc;
21156     xmlChar * content; /* the comment content */
21157     int n_content;
21158
21159     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21160     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21161         mem_base = xmlMemBlocks();
21162         doc = gen_xmlDocPtr(n_doc, 0);
21163         content = gen_const_xmlChar_ptr(n_content, 1);
21164
21165         ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21166         desret_xmlNodePtr(ret_val);
21167         call_tests++;
21168         des_xmlDocPtr(n_doc, doc, 0);
21169         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21170         xmlResetLastError();
21171         if (mem_base != xmlMemBlocks()) {
21172             printf("Leak of %d blocks found in xmlNewDocComment",
21173                    xmlMemBlocks() - mem_base);
21174             test_ret++;
21175             printf(" %d", n_doc);
21176             printf(" %d", n_content);
21177             printf("\n");
21178         }
21179     }
21180     }
21181     function_tests++;
21182
21183     return(test_ret);
21184 }
21185
21186
21187 static int
21188 test_xmlNewDocFragment(void) {
21189     int test_ret = 0;
21190
21191 #if defined(LIBXML_TREE_ENABLED)
21192     int mem_base;
21193     xmlNodePtr ret_val;
21194     xmlDocPtr doc; /* the document owning the fragment */
21195     int n_doc;
21196
21197     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21198         mem_base = xmlMemBlocks();
21199         doc = gen_xmlDocPtr(n_doc, 0);
21200
21201         ret_val = xmlNewDocFragment(doc);
21202         desret_xmlNodePtr(ret_val);
21203         call_tests++;
21204         des_xmlDocPtr(n_doc, doc, 0);
21205         xmlResetLastError();
21206         if (mem_base != xmlMemBlocks()) {
21207             printf("Leak of %d blocks found in xmlNewDocFragment",
21208                    xmlMemBlocks() - mem_base);
21209             test_ret++;
21210             printf(" %d", n_doc);
21211             printf("\n");
21212         }
21213     }
21214     function_tests++;
21215 #endif
21216
21217     return(test_ret);
21218 }
21219
21220
21221 static int
21222 test_xmlNewDocNode(void) {
21223     int test_ret = 0;
21224
21225     int mem_base;
21226     xmlNodePtr ret_val;
21227     xmlDocPtr doc; /* the document */
21228     int n_doc;
21229     xmlNsPtr ns; /* namespace if any */
21230     int n_ns;
21231     xmlChar * name; /* the node name */
21232     int n_name;
21233     xmlChar * content; /* the XML text content if any */
21234     int n_content;
21235
21236     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21237     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21238     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21239     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21240         mem_base = xmlMemBlocks();
21241         doc = gen_xmlDocPtr(n_doc, 0);
21242         ns = gen_xmlNsPtr(n_ns, 1);
21243         name = gen_const_xmlChar_ptr(n_name, 2);
21244         content = gen_const_xmlChar_ptr(n_content, 3);
21245
21246         ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21247         desret_xmlNodePtr(ret_val);
21248         call_tests++;
21249         des_xmlDocPtr(n_doc, doc, 0);
21250         des_xmlNsPtr(n_ns, ns, 1);
21251         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21252         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21253         xmlResetLastError();
21254         if (mem_base != xmlMemBlocks()) {
21255             printf("Leak of %d blocks found in xmlNewDocNode",
21256                    xmlMemBlocks() - mem_base);
21257             test_ret++;
21258             printf(" %d", n_doc);
21259             printf(" %d", n_ns);
21260             printf(" %d", n_name);
21261             printf(" %d", n_content);
21262             printf("\n");
21263         }
21264     }
21265     }
21266     }
21267     }
21268     function_tests++;
21269
21270     return(test_ret);
21271 }
21272
21273
21274 static int
21275 test_xmlNewDocNodeEatName(void) {
21276     int test_ret = 0;
21277
21278     int mem_base;
21279     xmlNodePtr ret_val;
21280     xmlDocPtr doc; /* the document */
21281     int n_doc;
21282     xmlNsPtr ns; /* namespace if any */
21283     int n_ns;
21284     xmlChar * name; /* the node name */
21285     int n_name;
21286     xmlChar * content; /* the XML text content if any */
21287     int n_content;
21288
21289     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21290     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21291     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21292     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21293         mem_base = xmlMemBlocks();
21294         doc = gen_xmlDocPtr(n_doc, 0);
21295         ns = gen_xmlNsPtr(n_ns, 1);
21296         name = gen_eaten_name(n_name, 2);
21297         content = gen_const_xmlChar_ptr(n_content, 3);
21298
21299         ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21300         desret_xmlNodePtr(ret_val);
21301         call_tests++;
21302         des_xmlDocPtr(n_doc, doc, 0);
21303         des_xmlNsPtr(n_ns, ns, 1);
21304         des_eaten_name(n_name, name, 2);
21305         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21306         xmlResetLastError();
21307         if (mem_base != xmlMemBlocks()) {
21308             printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21309                    xmlMemBlocks() - mem_base);
21310             test_ret++;
21311             printf(" %d", n_doc);
21312             printf(" %d", n_ns);
21313             printf(" %d", n_name);
21314             printf(" %d", n_content);
21315             printf("\n");
21316         }
21317     }
21318     }
21319     }
21320     }
21321     function_tests++;
21322
21323     return(test_ret);
21324 }
21325
21326
21327 static int
21328 test_xmlNewDocPI(void) {
21329     int test_ret = 0;
21330
21331     int mem_base;
21332     xmlNodePtr ret_val;
21333     xmlDocPtr doc; /* the target document */
21334     int n_doc;
21335     xmlChar * name; /* the processing instruction name */
21336     int n_name;
21337     xmlChar * content; /* the PI content */
21338     int n_content;
21339
21340     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21341     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21342     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21343         mem_base = xmlMemBlocks();
21344         doc = gen_xmlDocPtr(n_doc, 0);
21345         name = gen_const_xmlChar_ptr(n_name, 1);
21346         content = gen_const_xmlChar_ptr(n_content, 2);
21347
21348         ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21349         desret_xmlNodePtr(ret_val);
21350         call_tests++;
21351         des_xmlDocPtr(n_doc, doc, 0);
21352         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21353         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21354         xmlResetLastError();
21355         if (mem_base != xmlMemBlocks()) {
21356             printf("Leak of %d blocks found in xmlNewDocPI",
21357                    xmlMemBlocks() - mem_base);
21358             test_ret++;
21359             printf(" %d", n_doc);
21360             printf(" %d", n_name);
21361             printf(" %d", n_content);
21362             printf("\n");
21363         }
21364     }
21365     }
21366     }
21367     function_tests++;
21368
21369     return(test_ret);
21370 }
21371
21372
21373 static int
21374 test_xmlNewDocProp(void) {
21375     int test_ret = 0;
21376
21377     int mem_base;
21378     xmlAttrPtr ret_val;
21379     xmlDocPtr doc; /* the document */
21380     int n_doc;
21381     xmlChar * name; /* the name of the attribute */
21382     int n_name;
21383     xmlChar * value; /* the value of the attribute */
21384     int n_value;
21385
21386     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21387     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21388     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21389         mem_base = xmlMemBlocks();
21390         doc = gen_xmlDocPtr(n_doc, 0);
21391         name = gen_const_xmlChar_ptr(n_name, 1);
21392         value = gen_const_xmlChar_ptr(n_value, 2);
21393
21394         ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21395         desret_xmlAttrPtr(ret_val);
21396         call_tests++;
21397         des_xmlDocPtr(n_doc, doc, 0);
21398         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21399         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21400         xmlResetLastError();
21401         if (mem_base != xmlMemBlocks()) {
21402             printf("Leak of %d blocks found in xmlNewDocProp",
21403                    xmlMemBlocks() - mem_base);
21404             test_ret++;
21405             printf(" %d", n_doc);
21406             printf(" %d", n_name);
21407             printf(" %d", n_value);
21408             printf("\n");
21409         }
21410     }
21411     }
21412     }
21413     function_tests++;
21414
21415     return(test_ret);
21416 }
21417
21418
21419 static int
21420 test_xmlNewDocRawNode(void) {
21421     int test_ret = 0;
21422
21423 #if defined(LIBXML_TREE_ENABLED)
21424 #ifdef LIBXML_TREE_ENABLED
21425     int mem_base;
21426     xmlNodePtr ret_val;
21427     xmlDocPtr doc; /* the document */
21428     int n_doc;
21429     xmlNsPtr ns; /* namespace if any */
21430     int n_ns;
21431     xmlChar * name; /* the node name */
21432     int n_name;
21433     xmlChar * content; /* the text content if any */
21434     int n_content;
21435
21436     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21437     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21438     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21439     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21440         mem_base = xmlMemBlocks();
21441         doc = gen_xmlDocPtr(n_doc, 0);
21442         ns = gen_xmlNsPtr(n_ns, 1);
21443         name = gen_const_xmlChar_ptr(n_name, 2);
21444         content = gen_const_xmlChar_ptr(n_content, 3);
21445
21446         ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21447         desret_xmlNodePtr(ret_val);
21448         call_tests++;
21449         des_xmlDocPtr(n_doc, doc, 0);
21450         des_xmlNsPtr(n_ns, ns, 1);
21451         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21452         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21453         xmlResetLastError();
21454         if (mem_base != xmlMemBlocks()) {
21455             printf("Leak of %d blocks found in xmlNewDocRawNode",
21456                    xmlMemBlocks() - mem_base);
21457             test_ret++;
21458             printf(" %d", n_doc);
21459             printf(" %d", n_ns);
21460             printf(" %d", n_name);
21461             printf(" %d", n_content);
21462             printf("\n");
21463         }
21464     }
21465     }
21466     }
21467     }
21468     function_tests++;
21469 #endif
21470 #endif
21471
21472     return(test_ret);
21473 }
21474
21475
21476 static int
21477 test_xmlNewDocText(void) {
21478     int test_ret = 0;
21479
21480     int mem_base;
21481     xmlNodePtr ret_val;
21482     xmlDocPtr doc; /* the document */
21483     int n_doc;
21484     xmlChar * content; /* the text content */
21485     int n_content;
21486
21487     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21488     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21489         mem_base = xmlMemBlocks();
21490         doc = gen_xmlDocPtr(n_doc, 0);
21491         content = gen_const_xmlChar_ptr(n_content, 1);
21492
21493         ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21494         desret_xmlNodePtr(ret_val);
21495         call_tests++;
21496         des_xmlDocPtr(n_doc, doc, 0);
21497         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21498         xmlResetLastError();
21499         if (mem_base != xmlMemBlocks()) {
21500             printf("Leak of %d blocks found in xmlNewDocText",
21501                    xmlMemBlocks() - mem_base);
21502             test_ret++;
21503             printf(" %d", n_doc);
21504             printf(" %d", n_content);
21505             printf("\n");
21506         }
21507     }
21508     }
21509     function_tests++;
21510
21511     return(test_ret);
21512 }
21513
21514
21515 static int
21516 test_xmlNewDocTextLen(void) {
21517     int test_ret = 0;
21518
21519     int mem_base;
21520     xmlNodePtr ret_val;
21521     xmlDocPtr doc; /* the document */
21522     int n_doc;
21523     xmlChar * content; /* the text content */
21524     int n_content;
21525     int len; /* the text len. */
21526     int n_len;
21527
21528     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21529     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21530     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21531         mem_base = xmlMemBlocks();
21532         doc = gen_xmlDocPtr(n_doc, 0);
21533         content = gen_const_xmlChar_ptr(n_content, 1);
21534         len = gen_int(n_len, 2);
21535
21536         ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21537         desret_xmlNodePtr(ret_val);
21538         call_tests++;
21539         des_xmlDocPtr(n_doc, doc, 0);
21540         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21541         des_int(n_len, len, 2);
21542         xmlResetLastError();
21543         if (mem_base != xmlMemBlocks()) {
21544             printf("Leak of %d blocks found in xmlNewDocTextLen",
21545                    xmlMemBlocks() - mem_base);
21546             test_ret++;
21547             printf(" %d", n_doc);
21548             printf(" %d", n_content);
21549             printf(" %d", n_len);
21550             printf("\n");
21551         }
21552     }
21553     }
21554     }
21555     function_tests++;
21556
21557     return(test_ret);
21558 }
21559
21560
21561 static int
21562 test_xmlNewDtd(void) {
21563     int test_ret = 0;
21564
21565     int mem_base;
21566     xmlDtdPtr ret_val;
21567     xmlDocPtr doc; /* the document pointer */
21568     int n_doc;
21569     xmlChar * name; /* the DTD name */
21570     int n_name;
21571     xmlChar * ExternalID; /* the external ID */
21572     int n_ExternalID;
21573     xmlChar * SystemID; /* the system ID */
21574     int n_SystemID;
21575
21576     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21577     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21578     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21579     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21580         mem_base = xmlMemBlocks();
21581         doc = gen_xmlDocPtr(n_doc, 0);
21582         name = gen_const_xmlChar_ptr(n_name, 1);
21583         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21584         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21585
21586         ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21587         desret_xmlDtdPtr(ret_val);
21588         call_tests++;
21589         des_xmlDocPtr(n_doc, doc, 0);
21590         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21591         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21592         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21593         xmlResetLastError();
21594         if (mem_base != xmlMemBlocks()) {
21595             printf("Leak of %d blocks found in xmlNewDtd",
21596                    xmlMemBlocks() - mem_base);
21597             test_ret++;
21598             printf(" %d", n_doc);
21599             printf(" %d", n_name);
21600             printf(" %d", n_ExternalID);
21601             printf(" %d", n_SystemID);
21602             printf("\n");
21603         }
21604     }
21605     }
21606     }
21607     }
21608     function_tests++;
21609
21610     return(test_ret);
21611 }
21612
21613
21614 static int
21615 test_xmlNewNode(void) {
21616     int test_ret = 0;
21617
21618     int mem_base;
21619     xmlNodePtr ret_val;
21620     xmlNsPtr ns; /* namespace if any */
21621     int n_ns;
21622     xmlChar * name; /* the node name */
21623     int n_name;
21624
21625     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21626     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21627         mem_base = xmlMemBlocks();
21628         ns = gen_xmlNsPtr(n_ns, 0);
21629         name = gen_const_xmlChar_ptr(n_name, 1);
21630
21631         ret_val = xmlNewNode(ns, (const xmlChar *)name);
21632         desret_xmlNodePtr(ret_val);
21633         call_tests++;
21634         des_xmlNsPtr(n_ns, ns, 0);
21635         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21636         xmlResetLastError();
21637         if (mem_base != xmlMemBlocks()) {
21638             printf("Leak of %d blocks found in xmlNewNode",
21639                    xmlMemBlocks() - mem_base);
21640             test_ret++;
21641             printf(" %d", n_ns);
21642             printf(" %d", n_name);
21643             printf("\n");
21644         }
21645     }
21646     }
21647     function_tests++;
21648
21649     return(test_ret);
21650 }
21651
21652
21653 static int
21654 test_xmlNewNodeEatName(void) {
21655     int test_ret = 0;
21656
21657     int mem_base;
21658     xmlNodePtr ret_val;
21659     xmlNsPtr ns; /* namespace if any */
21660     int n_ns;
21661     xmlChar * name; /* the node name */
21662     int n_name;
21663
21664     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21665     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21666         mem_base = xmlMemBlocks();
21667         ns = gen_xmlNsPtr(n_ns, 0);
21668         name = gen_eaten_name(n_name, 1);
21669
21670         ret_val = xmlNewNodeEatName(ns, name);
21671         desret_xmlNodePtr(ret_val);
21672         call_tests++;
21673         des_xmlNsPtr(n_ns, ns, 0);
21674         des_eaten_name(n_name, name, 1);
21675         xmlResetLastError();
21676         if (mem_base != xmlMemBlocks()) {
21677             printf("Leak of %d blocks found in xmlNewNodeEatName",
21678                    xmlMemBlocks() - mem_base);
21679             test_ret++;
21680             printf(" %d", n_ns);
21681             printf(" %d", n_name);
21682             printf("\n");
21683         }
21684     }
21685     }
21686     function_tests++;
21687
21688     return(test_ret);
21689 }
21690
21691
21692 static int
21693 test_xmlNewNs(void) {
21694     int test_ret = 0;
21695
21696     int mem_base;
21697     xmlNsPtr ret_val;
21698     xmlNodePtr node; /* the element carrying the namespace */
21699     int n_node;
21700     xmlChar * href; /* the URI associated */
21701     int n_href;
21702     xmlChar * prefix; /* the prefix for the namespace */
21703     int n_prefix;
21704
21705     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21706     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21707     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21708         mem_base = xmlMemBlocks();
21709         node = gen_xmlNodePtr(n_node, 0);
21710         href = gen_const_xmlChar_ptr(n_href, 1);
21711         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21712
21713         ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21714         if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21715         desret_xmlNsPtr(ret_val);
21716         call_tests++;
21717         des_xmlNodePtr(n_node, node, 0);
21718         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21719         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21720         xmlResetLastError();
21721         if (mem_base != xmlMemBlocks()) {
21722             printf("Leak of %d blocks found in xmlNewNs",
21723                    xmlMemBlocks() - mem_base);
21724             test_ret++;
21725             printf(" %d", n_node);
21726             printf(" %d", n_href);
21727             printf(" %d", n_prefix);
21728             printf("\n");
21729         }
21730     }
21731     }
21732     }
21733     function_tests++;
21734
21735     return(test_ret);
21736 }
21737
21738
21739 static int
21740 test_xmlNewNsProp(void) {
21741     int test_ret = 0;
21742
21743     int mem_base;
21744     xmlAttrPtr ret_val;
21745     xmlNodePtr node; /* the holding node */
21746     int n_node;
21747     xmlNsPtr ns; /* the namespace */
21748     int n_ns;
21749     xmlChar * name; /* the name of the attribute */
21750     int n_name;
21751     xmlChar * value; /* the value of the attribute */
21752     int n_value;
21753
21754     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21755     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21756     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21757     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21758         mem_base = xmlMemBlocks();
21759         node = gen_xmlNodePtr(n_node, 0);
21760         ns = gen_xmlNsPtr(n_ns, 1);
21761         name = gen_const_xmlChar_ptr(n_name, 2);
21762         value = gen_const_xmlChar_ptr(n_value, 3);
21763
21764         ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21765         desret_xmlAttrPtr(ret_val);
21766         call_tests++;
21767         des_xmlNodePtr(n_node, node, 0);
21768         des_xmlNsPtr(n_ns, ns, 1);
21769         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21770         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21771         xmlResetLastError();
21772         if (mem_base != xmlMemBlocks()) {
21773             printf("Leak of %d blocks found in xmlNewNsProp",
21774                    xmlMemBlocks() - mem_base);
21775             test_ret++;
21776             printf(" %d", n_node);
21777             printf(" %d", n_ns);
21778             printf(" %d", n_name);
21779             printf(" %d", n_value);
21780             printf("\n");
21781         }
21782     }
21783     }
21784     }
21785     }
21786     function_tests++;
21787
21788     return(test_ret);
21789 }
21790
21791
21792 static int
21793 test_xmlNewNsPropEatName(void) {
21794     int test_ret = 0;
21795
21796     int mem_base;
21797     xmlAttrPtr ret_val;
21798     xmlNodePtr node; /* the holding node */
21799     int n_node;
21800     xmlNsPtr ns; /* the namespace */
21801     int n_ns;
21802     xmlChar * name; /* the name of the attribute */
21803     int n_name;
21804     xmlChar * value; /* the value of the attribute */
21805     int n_value;
21806
21807     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21808     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21809     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21810     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21811         mem_base = xmlMemBlocks();
21812         node = gen_xmlNodePtr(n_node, 0);
21813         ns = gen_xmlNsPtr(n_ns, 1);
21814         name = gen_eaten_name(n_name, 2);
21815         value = gen_const_xmlChar_ptr(n_value, 3);
21816
21817         ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21818         desret_xmlAttrPtr(ret_val);
21819         call_tests++;
21820         des_xmlNodePtr(n_node, node, 0);
21821         des_xmlNsPtr(n_ns, ns, 1);
21822         des_eaten_name(n_name, name, 2);
21823         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21824         xmlResetLastError();
21825         if (mem_base != xmlMemBlocks()) {
21826             printf("Leak of %d blocks found in xmlNewNsPropEatName",
21827                    xmlMemBlocks() - mem_base);
21828             test_ret++;
21829             printf(" %d", n_node);
21830             printf(" %d", n_ns);
21831             printf(" %d", n_name);
21832             printf(" %d", n_value);
21833             printf("\n");
21834         }
21835     }
21836     }
21837     }
21838     }
21839     function_tests++;
21840
21841     return(test_ret);
21842 }
21843
21844
21845 static int
21846 test_xmlNewPI(void) {
21847     int test_ret = 0;
21848
21849     int mem_base;
21850     xmlNodePtr ret_val;
21851     xmlChar * name; /* the processing instruction name */
21852     int n_name;
21853     xmlChar * content; /* the PI content */
21854     int n_content;
21855
21856     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21857     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21858         mem_base = xmlMemBlocks();
21859         name = gen_const_xmlChar_ptr(n_name, 0);
21860         content = gen_const_xmlChar_ptr(n_content, 1);
21861
21862         ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21863         desret_xmlNodePtr(ret_val);
21864         call_tests++;
21865         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21866         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21867         xmlResetLastError();
21868         if (mem_base != xmlMemBlocks()) {
21869             printf("Leak of %d blocks found in xmlNewPI",
21870                    xmlMemBlocks() - mem_base);
21871             test_ret++;
21872             printf(" %d", n_name);
21873             printf(" %d", n_content);
21874             printf("\n");
21875         }
21876     }
21877     }
21878     function_tests++;
21879
21880     return(test_ret);
21881 }
21882
21883
21884 static int
21885 test_xmlNewProp(void) {
21886     int test_ret = 0;
21887
21888 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21889 #ifdef LIBXML_TREE_ENABLED
21890     int mem_base;
21891     xmlAttrPtr ret_val;
21892     xmlNodePtr node; /* the holding node */
21893     int n_node;
21894     xmlChar * name; /* the name of the attribute */
21895     int n_name;
21896     xmlChar * value; /* the value of the attribute */
21897     int n_value;
21898
21899     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21900     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21901     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21902         mem_base = xmlMemBlocks();
21903         node = gen_xmlNodePtr(n_node, 0);
21904         name = gen_const_xmlChar_ptr(n_name, 1);
21905         value = gen_const_xmlChar_ptr(n_value, 2);
21906
21907         ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21908         desret_xmlAttrPtr(ret_val);
21909         call_tests++;
21910         des_xmlNodePtr(n_node, node, 0);
21911         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21912         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21913         xmlResetLastError();
21914         if (mem_base != xmlMemBlocks()) {
21915             printf("Leak of %d blocks found in xmlNewProp",
21916                    xmlMemBlocks() - mem_base);
21917             test_ret++;
21918             printf(" %d", n_node);
21919             printf(" %d", n_name);
21920             printf(" %d", n_value);
21921             printf("\n");
21922         }
21923     }
21924     }
21925     }
21926     function_tests++;
21927 #endif
21928 #endif
21929
21930     return(test_ret);
21931 }
21932
21933
21934 static int
21935 test_xmlNewReference(void) {
21936     int test_ret = 0;
21937
21938     int mem_base;
21939     xmlNodePtr ret_val;
21940     xmlDocPtr doc; /* the document */
21941     int n_doc;
21942     xmlChar * name; /* the reference name, or the reference string with & and ; */
21943     int n_name;
21944
21945     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21946     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21947         mem_base = xmlMemBlocks();
21948         doc = gen_xmlDocPtr(n_doc, 0);
21949         name = gen_const_xmlChar_ptr(n_name, 1);
21950
21951         ret_val = xmlNewReference(doc, (const xmlChar *)name);
21952         desret_xmlNodePtr(ret_val);
21953         call_tests++;
21954         des_xmlDocPtr(n_doc, doc, 0);
21955         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21956         xmlResetLastError();
21957         if (mem_base != xmlMemBlocks()) {
21958             printf("Leak of %d blocks found in xmlNewReference",
21959                    xmlMemBlocks() - mem_base);
21960             test_ret++;
21961             printf(" %d", n_doc);
21962             printf(" %d", n_name);
21963             printf("\n");
21964         }
21965     }
21966     }
21967     function_tests++;
21968
21969     return(test_ret);
21970 }
21971
21972
21973 static int
21974 test_xmlNewText(void) {
21975     int test_ret = 0;
21976
21977     int mem_base;
21978     xmlNodePtr ret_val;
21979     xmlChar * content; /* the text content */
21980     int n_content;
21981
21982     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21983         mem_base = xmlMemBlocks();
21984         content = gen_const_xmlChar_ptr(n_content, 0);
21985
21986         ret_val = xmlNewText((const xmlChar *)content);
21987         desret_xmlNodePtr(ret_val);
21988         call_tests++;
21989         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21990         xmlResetLastError();
21991         if (mem_base != xmlMemBlocks()) {
21992             printf("Leak of %d blocks found in xmlNewText",
21993                    xmlMemBlocks() - mem_base);
21994             test_ret++;
21995             printf(" %d", n_content);
21996             printf("\n");
21997         }
21998     }
21999     function_tests++;
22000
22001     return(test_ret);
22002 }
22003
22004
22005 static int
22006 test_xmlNewTextChild(void) {
22007     int test_ret = 0;
22008
22009 #if defined(LIBXML_TREE_ENABLED)
22010 #ifdef LIBXML_TREE_ENABLED
22011     int mem_base;
22012     xmlNodePtr ret_val;
22013     xmlNodePtr parent; /* the parent node */
22014     int n_parent;
22015     xmlNsPtr ns; /* a namespace if any */
22016     int n_ns;
22017     xmlChar * name; /* the name of the child */
22018     int n_name;
22019     xmlChar * content; /* the text content of the child if any. */
22020     int n_content;
22021
22022     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
22023     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22024     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22025     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22026         mem_base = xmlMemBlocks();
22027         parent = gen_xmlNodePtr(n_parent, 0);
22028         ns = gen_xmlNsPtr(n_ns, 1);
22029         name = gen_const_xmlChar_ptr(n_name, 2);
22030         content = gen_const_xmlChar_ptr(n_content, 3);
22031
22032         ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
22033         desret_xmlNodePtr(ret_val);
22034         call_tests++;
22035         des_xmlNodePtr(n_parent, parent, 0);
22036         des_xmlNsPtr(n_ns, ns, 1);
22037         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22038         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
22039         xmlResetLastError();
22040         if (mem_base != xmlMemBlocks()) {
22041             printf("Leak of %d blocks found in xmlNewTextChild",
22042                    xmlMemBlocks() - mem_base);
22043             test_ret++;
22044             printf(" %d", n_parent);
22045             printf(" %d", n_ns);
22046             printf(" %d", n_name);
22047             printf(" %d", n_content);
22048             printf("\n");
22049         }
22050     }
22051     }
22052     }
22053     }
22054     function_tests++;
22055 #endif
22056 #endif
22057
22058     return(test_ret);
22059 }
22060
22061
22062 static int
22063 test_xmlNewTextLen(void) {
22064     int test_ret = 0;
22065
22066     int mem_base;
22067     xmlNodePtr ret_val;
22068     xmlChar * content; /* the text content */
22069     int n_content;
22070     int len; /* the text len. */
22071     int n_len;
22072
22073     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22074     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22075         mem_base = xmlMemBlocks();
22076         content = gen_const_xmlChar_ptr(n_content, 0);
22077         len = gen_int(n_len, 1);
22078
22079         ret_val = xmlNewTextLen((const xmlChar *)content, len);
22080         desret_xmlNodePtr(ret_val);
22081         call_tests++;
22082         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22083         des_int(n_len, len, 1);
22084         xmlResetLastError();
22085         if (mem_base != xmlMemBlocks()) {
22086             printf("Leak of %d blocks found in xmlNewTextLen",
22087                    xmlMemBlocks() - mem_base);
22088             test_ret++;
22089             printf(" %d", n_content);
22090             printf(" %d", n_len);
22091             printf("\n");
22092         }
22093     }
22094     }
22095     function_tests++;
22096
22097     return(test_ret);
22098 }
22099
22100
22101 static int
22102 test_xmlNextElementSibling(void) {
22103     int test_ret = 0;
22104
22105 #if defined(LIBXML_TREE_ENABLED)
22106     int mem_base;
22107     xmlNodePtr ret_val;
22108     xmlNodePtr node; /* the current node */
22109     int n_node;
22110
22111     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22112         mem_base = xmlMemBlocks();
22113         node = gen_xmlNodePtr(n_node, 0);
22114
22115         ret_val = xmlNextElementSibling(node);
22116         desret_xmlNodePtr(ret_val);
22117         call_tests++;
22118         des_xmlNodePtr(n_node, node, 0);
22119         xmlResetLastError();
22120         if (mem_base != xmlMemBlocks()) {
22121             printf("Leak of %d blocks found in xmlNextElementSibling",
22122                    xmlMemBlocks() - mem_base);
22123             test_ret++;
22124             printf(" %d", n_node);
22125             printf("\n");
22126         }
22127     }
22128     function_tests++;
22129 #endif
22130
22131     return(test_ret);
22132 }
22133
22134
22135 static int
22136 test_xmlNodeAddContent(void) {
22137     int test_ret = 0;
22138
22139     int mem_base;
22140     xmlNodePtr cur; /* the node being modified */
22141     int n_cur;
22142     xmlChar * content; /* extra content */
22143     int n_content;
22144
22145     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22146     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22147         mem_base = xmlMemBlocks();
22148         cur = gen_xmlNodePtr(n_cur, 0);
22149         content = gen_const_xmlChar_ptr(n_content, 1);
22150
22151         xmlNodeAddContent(cur, (const xmlChar *)content);
22152         call_tests++;
22153         des_xmlNodePtr(n_cur, cur, 0);
22154         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22155         xmlResetLastError();
22156         if (mem_base != xmlMemBlocks()) {
22157             printf("Leak of %d blocks found in xmlNodeAddContent",
22158                    xmlMemBlocks() - mem_base);
22159             test_ret++;
22160             printf(" %d", n_cur);
22161             printf(" %d", n_content);
22162             printf("\n");
22163         }
22164     }
22165     }
22166     function_tests++;
22167
22168     return(test_ret);
22169 }
22170
22171
22172 static int
22173 test_xmlNodeAddContentLen(void) {
22174     int test_ret = 0;
22175
22176     int mem_base;
22177     xmlNodePtr cur; /* the node being modified */
22178     int n_cur;
22179     xmlChar * content; /* extra content */
22180     int n_content;
22181     int len; /* the size of @content */
22182     int n_len;
22183
22184     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22185     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22186     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22187         mem_base = xmlMemBlocks();
22188         cur = gen_xmlNodePtr(n_cur, 0);
22189         content = gen_const_xmlChar_ptr(n_content, 1);
22190         len = gen_int(n_len, 2);
22191
22192         xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22193         call_tests++;
22194         des_xmlNodePtr(n_cur, cur, 0);
22195         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22196         des_int(n_len, len, 2);
22197         xmlResetLastError();
22198         if (mem_base != xmlMemBlocks()) {
22199             printf("Leak of %d blocks found in xmlNodeAddContentLen",
22200                    xmlMemBlocks() - mem_base);
22201             test_ret++;
22202             printf(" %d", n_cur);
22203             printf(" %d", n_content);
22204             printf(" %d", n_len);
22205             printf("\n");
22206         }
22207     }
22208     }
22209     }
22210     function_tests++;
22211
22212     return(test_ret);
22213 }
22214
22215
22216 static int
22217 test_xmlNodeBufGetContent(void) {
22218     int test_ret = 0;
22219
22220     int mem_base;
22221     int ret_val;
22222     xmlBufferPtr buffer; /* a buffer */
22223     int n_buffer;
22224     xmlNodePtr cur; /* the node being read */
22225     int n_cur;
22226
22227     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22228     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22229         mem_base = xmlMemBlocks();
22230         buffer = gen_xmlBufferPtr(n_buffer, 0);
22231         cur = gen_xmlNodePtr(n_cur, 1);
22232
22233         ret_val = xmlNodeBufGetContent(buffer, cur);
22234         desret_int(ret_val);
22235         call_tests++;
22236         des_xmlBufferPtr(n_buffer, buffer, 0);
22237         des_xmlNodePtr(n_cur, cur, 1);
22238         xmlResetLastError();
22239         if (mem_base != xmlMemBlocks()) {
22240             printf("Leak of %d blocks found in xmlNodeBufGetContent",
22241                    xmlMemBlocks() - mem_base);
22242             test_ret++;
22243             printf(" %d", n_buffer);
22244             printf(" %d", n_cur);
22245             printf("\n");
22246         }
22247     }
22248     }
22249     function_tests++;
22250
22251     return(test_ret);
22252 }
22253
22254
22255 static int
22256 test_xmlNodeDump(void) {
22257     int test_ret = 0;
22258
22259 #if defined(LIBXML_OUTPUT_ENABLED)
22260     int mem_base;
22261     int ret_val;
22262     xmlBufferPtr buf; /* the XML buffer output */
22263     int n_buf;
22264     xmlDocPtr doc; /* the document */
22265     int n_doc;
22266     xmlNodePtr cur; /* the current node */
22267     int n_cur;
22268     int level; /* the imbrication level for indenting */
22269     int n_level;
22270     int format; /* is formatting allowed */
22271     int n_format;
22272
22273     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22274     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22275     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22276     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22277     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22278         mem_base = xmlMemBlocks();
22279         buf = gen_xmlBufferPtr(n_buf, 0);
22280         doc = gen_xmlDocPtr(n_doc, 1);
22281         cur = gen_xmlNodePtr(n_cur, 2);
22282         level = gen_int(n_level, 3);
22283         format = gen_int(n_format, 4);
22284
22285         ret_val = xmlNodeDump(buf, doc, cur, level, format);
22286         desret_int(ret_val);
22287         call_tests++;
22288         des_xmlBufferPtr(n_buf, buf, 0);
22289         des_xmlDocPtr(n_doc, doc, 1);
22290         des_xmlNodePtr(n_cur, cur, 2);
22291         des_int(n_level, level, 3);
22292         des_int(n_format, format, 4);
22293         xmlResetLastError();
22294         if (mem_base != xmlMemBlocks()) {
22295             printf("Leak of %d blocks found in xmlNodeDump",
22296                    xmlMemBlocks() - mem_base);
22297             test_ret++;
22298             printf(" %d", n_buf);
22299             printf(" %d", n_doc);
22300             printf(" %d", n_cur);
22301             printf(" %d", n_level);
22302             printf(" %d", n_format);
22303             printf("\n");
22304         }
22305     }
22306     }
22307     }
22308     }
22309     }
22310     function_tests++;
22311 #endif
22312
22313     return(test_ret);
22314 }
22315
22316
22317 static int
22318 test_xmlNodeDumpOutput(void) {
22319     int test_ret = 0;
22320
22321 #if defined(LIBXML_OUTPUT_ENABLED)
22322     int mem_base;
22323     xmlOutputBufferPtr buf; /* the XML buffer output */
22324     int n_buf;
22325     xmlDocPtr doc; /* the document */
22326     int n_doc;
22327     xmlNodePtr cur; /* the current node */
22328     int n_cur;
22329     int level; /* the imbrication level for indenting */
22330     int n_level;
22331     int format; /* is formatting allowed */
22332     int n_format;
22333     char * encoding; /* an optional encoding string */
22334     int n_encoding;
22335
22336     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22337     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22338     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22339     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22340     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22341     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22342         mem_base = xmlMemBlocks();
22343         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22344         doc = gen_xmlDocPtr(n_doc, 1);
22345         cur = gen_xmlNodePtr(n_cur, 2);
22346         level = gen_int(n_level, 3);
22347         format = gen_int(n_format, 4);
22348         encoding = gen_const_char_ptr(n_encoding, 5);
22349
22350         xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22351         call_tests++;
22352         des_xmlOutputBufferPtr(n_buf, buf, 0);
22353         des_xmlDocPtr(n_doc, doc, 1);
22354         des_xmlNodePtr(n_cur, cur, 2);
22355         des_int(n_level, level, 3);
22356         des_int(n_format, format, 4);
22357         des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22358         xmlResetLastError();
22359         if (mem_base != xmlMemBlocks()) {
22360             printf("Leak of %d blocks found in xmlNodeDumpOutput",
22361                    xmlMemBlocks() - mem_base);
22362             test_ret++;
22363             printf(" %d", n_buf);
22364             printf(" %d", n_doc);
22365             printf(" %d", n_cur);
22366             printf(" %d", n_level);
22367             printf(" %d", n_format);
22368             printf(" %d", n_encoding);
22369             printf("\n");
22370         }
22371     }
22372     }
22373     }
22374     }
22375     }
22376     }
22377     function_tests++;
22378 #endif
22379
22380     return(test_ret);
22381 }
22382
22383
22384 static int
22385 test_xmlNodeGetBase(void) {
22386     int test_ret = 0;
22387
22388     int mem_base;
22389     xmlChar * ret_val;
22390     xmlDocPtr doc; /* the document the node pertains to */
22391     int n_doc;
22392     xmlNodePtr cur; /* the node being checked */
22393     int n_cur;
22394
22395     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22396     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22397         mem_base = xmlMemBlocks();
22398         doc = gen_xmlDocPtr(n_doc, 0);
22399         cur = gen_xmlNodePtr(n_cur, 1);
22400
22401         ret_val = xmlNodeGetBase(doc, cur);
22402         desret_xmlChar_ptr(ret_val);
22403         call_tests++;
22404         des_xmlDocPtr(n_doc, doc, 0);
22405         des_xmlNodePtr(n_cur, cur, 1);
22406         xmlResetLastError();
22407         if (mem_base != xmlMemBlocks()) {
22408             printf("Leak of %d blocks found in xmlNodeGetBase",
22409                    xmlMemBlocks() - mem_base);
22410             test_ret++;
22411             printf(" %d", n_doc);
22412             printf(" %d", n_cur);
22413             printf("\n");
22414         }
22415     }
22416     }
22417     function_tests++;
22418
22419     return(test_ret);
22420 }
22421
22422
22423 static int
22424 test_xmlNodeGetContent(void) {
22425     int test_ret = 0;
22426
22427     int mem_base;
22428     xmlChar * ret_val;
22429     xmlNodePtr cur; /* the node being read */
22430     int n_cur;
22431
22432     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22433         mem_base = xmlMemBlocks();
22434         cur = gen_xmlNodePtr(n_cur, 0);
22435
22436         ret_val = xmlNodeGetContent(cur);
22437         desret_xmlChar_ptr(ret_val);
22438         call_tests++;
22439         des_xmlNodePtr(n_cur, cur, 0);
22440         xmlResetLastError();
22441         if (mem_base != xmlMemBlocks()) {
22442             printf("Leak of %d blocks found in xmlNodeGetContent",
22443                    xmlMemBlocks() - mem_base);
22444             test_ret++;
22445             printf(" %d", n_cur);
22446             printf("\n");
22447         }
22448     }
22449     function_tests++;
22450
22451     return(test_ret);
22452 }
22453
22454
22455 static int
22456 test_xmlNodeGetLang(void) {
22457     int test_ret = 0;
22458
22459     int mem_base;
22460     xmlChar * ret_val;
22461     xmlNodePtr cur; /* the node being checked */
22462     int n_cur;
22463
22464     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22465         mem_base = xmlMemBlocks();
22466         cur = gen_xmlNodePtr(n_cur, 0);
22467
22468         ret_val = xmlNodeGetLang(cur);
22469         desret_xmlChar_ptr(ret_val);
22470         call_tests++;
22471         des_xmlNodePtr(n_cur, cur, 0);
22472         xmlResetLastError();
22473         if (mem_base != xmlMemBlocks()) {
22474             printf("Leak of %d blocks found in xmlNodeGetLang",
22475                    xmlMemBlocks() - mem_base);
22476             test_ret++;
22477             printf(" %d", n_cur);
22478             printf("\n");
22479         }
22480     }
22481     function_tests++;
22482
22483     return(test_ret);
22484 }
22485
22486
22487 static int
22488 test_xmlNodeGetSpacePreserve(void) {
22489     int test_ret = 0;
22490
22491     int mem_base;
22492     int ret_val;
22493     xmlNodePtr cur; /* the node being checked */
22494     int n_cur;
22495
22496     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22497         mem_base = xmlMemBlocks();
22498         cur = gen_xmlNodePtr(n_cur, 0);
22499
22500         ret_val = xmlNodeGetSpacePreserve(cur);
22501         desret_int(ret_val);
22502         call_tests++;
22503         des_xmlNodePtr(n_cur, cur, 0);
22504         xmlResetLastError();
22505         if (mem_base != xmlMemBlocks()) {
22506             printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22507                    xmlMemBlocks() - mem_base);
22508             test_ret++;
22509             printf(" %d", n_cur);
22510             printf("\n");
22511         }
22512     }
22513     function_tests++;
22514
22515     return(test_ret);
22516 }
22517
22518
22519 static int
22520 test_xmlNodeIsText(void) {
22521     int test_ret = 0;
22522
22523     int mem_base;
22524     int ret_val;
22525     xmlNodePtr node; /* the node */
22526     int n_node;
22527
22528     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22529         mem_base = xmlMemBlocks();
22530         node = gen_xmlNodePtr(n_node, 0);
22531
22532         ret_val = xmlNodeIsText(node);
22533         desret_int(ret_val);
22534         call_tests++;
22535         des_xmlNodePtr(n_node, node, 0);
22536         xmlResetLastError();
22537         if (mem_base != xmlMemBlocks()) {
22538             printf("Leak of %d blocks found in xmlNodeIsText",
22539                    xmlMemBlocks() - mem_base);
22540             test_ret++;
22541             printf(" %d", n_node);
22542             printf("\n");
22543         }
22544     }
22545     function_tests++;
22546
22547     return(test_ret);
22548 }
22549
22550
22551 static int
22552 test_xmlNodeListGetRawString(void) {
22553     int test_ret = 0;
22554
22555 #if defined(LIBXML_TREE_ENABLED)
22556     int mem_base;
22557     xmlChar * ret_val;
22558     xmlDocPtr doc; /* the document */
22559     int n_doc;
22560     xmlNodePtr list; /* a Node list */
22561     int n_list;
22562     int inLine; /* should we replace entity contents or show their external form */
22563     int n_inLine;
22564
22565     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22566     for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22567     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22568         mem_base = xmlMemBlocks();
22569         doc = gen_xmlDocPtr(n_doc, 0);
22570         list = gen_xmlNodePtr(n_list, 1);
22571         inLine = gen_int(n_inLine, 2);
22572
22573         ret_val = xmlNodeListGetRawString(doc, list, inLine);
22574         desret_xmlChar_ptr(ret_val);
22575         call_tests++;
22576         des_xmlDocPtr(n_doc, doc, 0);
22577         des_xmlNodePtr(n_list, list, 1);
22578         des_int(n_inLine, inLine, 2);
22579         xmlResetLastError();
22580         if (mem_base != xmlMemBlocks()) {
22581             printf("Leak of %d blocks found in xmlNodeListGetRawString",
22582                    xmlMemBlocks() - mem_base);
22583             test_ret++;
22584             printf(" %d", n_doc);
22585             printf(" %d", n_list);
22586             printf(" %d", n_inLine);
22587             printf("\n");
22588         }
22589     }
22590     }
22591     }
22592     function_tests++;
22593 #endif
22594
22595     return(test_ret);
22596 }
22597
22598
22599 static int
22600 test_xmlNodeListGetString(void) {
22601     int test_ret = 0;
22602
22603     int mem_base;
22604     xmlChar * ret_val;
22605     xmlDocPtr doc; /* the document */
22606     int n_doc;
22607     xmlNodePtr list; /* a Node list */
22608     int n_list;
22609     int inLine; /* should we replace entity contents or show their external form */
22610     int n_inLine;
22611
22612     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22613     for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22614     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22615         mem_base = xmlMemBlocks();
22616         doc = gen_xmlDocPtr(n_doc, 0);
22617         list = gen_xmlNodePtr(n_list, 1);
22618         inLine = gen_int(n_inLine, 2);
22619
22620         ret_val = xmlNodeListGetString(doc, list, inLine);
22621         desret_xmlChar_ptr(ret_val);
22622         call_tests++;
22623         des_xmlDocPtr(n_doc, doc, 0);
22624         des_xmlNodePtr(n_list, list, 1);
22625         des_int(n_inLine, inLine, 2);
22626         xmlResetLastError();
22627         if (mem_base != xmlMemBlocks()) {
22628             printf("Leak of %d blocks found in xmlNodeListGetString",
22629                    xmlMemBlocks() - mem_base);
22630             test_ret++;
22631             printf(" %d", n_doc);
22632             printf(" %d", n_list);
22633             printf(" %d", n_inLine);
22634             printf("\n");
22635         }
22636     }
22637     }
22638     }
22639     function_tests++;
22640
22641     return(test_ret);
22642 }
22643
22644
22645 static int
22646 test_xmlNodeSetBase(void) {
22647     int test_ret = 0;
22648
22649 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22650     int mem_base;
22651     xmlNodePtr cur; /* the node being changed */
22652     int n_cur;
22653     xmlChar * uri; /* the new base URI */
22654     int n_uri;
22655
22656     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22657     for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22658         mem_base = xmlMemBlocks();
22659         cur = gen_xmlNodePtr(n_cur, 0);
22660         uri = gen_const_xmlChar_ptr(n_uri, 1);
22661
22662         xmlNodeSetBase(cur, (const xmlChar *)uri);
22663         call_tests++;
22664         des_xmlNodePtr(n_cur, cur, 0);
22665         des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22666         xmlResetLastError();
22667         if (mem_base != xmlMemBlocks()) {
22668             printf("Leak of %d blocks found in xmlNodeSetBase",
22669                    xmlMemBlocks() - mem_base);
22670             test_ret++;
22671             printf(" %d", n_cur);
22672             printf(" %d", n_uri);
22673             printf("\n");
22674         }
22675     }
22676     }
22677     function_tests++;
22678 #endif
22679
22680     return(test_ret);
22681 }
22682
22683
22684 static int
22685 test_xmlNodeSetContent(void) {
22686     int test_ret = 0;
22687
22688     int mem_base;
22689     xmlNodePtr cur; /* the node being modified */
22690     int n_cur;
22691     xmlChar * content; /* the new value of the content */
22692     int n_content;
22693
22694     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22695     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22696         mem_base = xmlMemBlocks();
22697         cur = gen_xmlNodePtr(n_cur, 0);
22698         content = gen_const_xmlChar_ptr(n_content, 1);
22699
22700         xmlNodeSetContent(cur, (const xmlChar *)content);
22701         call_tests++;
22702         des_xmlNodePtr(n_cur, cur, 0);
22703         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22704         xmlResetLastError();
22705         if (mem_base != xmlMemBlocks()) {
22706             printf("Leak of %d blocks found in xmlNodeSetContent",
22707                    xmlMemBlocks() - mem_base);
22708             test_ret++;
22709             printf(" %d", n_cur);
22710             printf(" %d", n_content);
22711             printf("\n");
22712         }
22713     }
22714     }
22715     function_tests++;
22716
22717     return(test_ret);
22718 }
22719
22720
22721 static int
22722 test_xmlNodeSetContentLen(void) {
22723     int test_ret = 0;
22724
22725 #if defined(LIBXML_TREE_ENABLED)
22726     int mem_base;
22727     xmlNodePtr cur; /* the node being modified */
22728     int n_cur;
22729     xmlChar * content; /* the new value of the content */
22730     int n_content;
22731     int len; /* the size of @content */
22732     int n_len;
22733
22734     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22735     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22736     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22737         mem_base = xmlMemBlocks();
22738         cur = gen_xmlNodePtr(n_cur, 0);
22739         content = gen_const_xmlChar_ptr(n_content, 1);
22740         len = gen_int(n_len, 2);
22741
22742         xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22743         call_tests++;
22744         des_xmlNodePtr(n_cur, cur, 0);
22745         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22746         des_int(n_len, len, 2);
22747         xmlResetLastError();
22748         if (mem_base != xmlMemBlocks()) {
22749             printf("Leak of %d blocks found in xmlNodeSetContentLen",
22750                    xmlMemBlocks() - mem_base);
22751             test_ret++;
22752             printf(" %d", n_cur);
22753             printf(" %d", n_content);
22754             printf(" %d", n_len);
22755             printf("\n");
22756         }
22757     }
22758     }
22759     }
22760     function_tests++;
22761 #endif
22762
22763     return(test_ret);
22764 }
22765
22766
22767 static int
22768 test_xmlNodeSetLang(void) {
22769     int test_ret = 0;
22770
22771 #if defined(LIBXML_TREE_ENABLED)
22772     int mem_base;
22773     xmlNodePtr cur; /* the node being changed */
22774     int n_cur;
22775     xmlChar * lang; /* the language description */
22776     int n_lang;
22777
22778     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22779     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22780         mem_base = xmlMemBlocks();
22781         cur = gen_xmlNodePtr(n_cur, 0);
22782         lang = gen_const_xmlChar_ptr(n_lang, 1);
22783
22784         xmlNodeSetLang(cur, (const xmlChar *)lang);
22785         call_tests++;
22786         des_xmlNodePtr(n_cur, cur, 0);
22787         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22788         xmlResetLastError();
22789         if (mem_base != xmlMemBlocks()) {
22790             printf("Leak of %d blocks found in xmlNodeSetLang",
22791                    xmlMemBlocks() - mem_base);
22792             test_ret++;
22793             printf(" %d", n_cur);
22794             printf(" %d", n_lang);
22795             printf("\n");
22796         }
22797     }
22798     }
22799     function_tests++;
22800 #endif
22801
22802     return(test_ret);
22803 }
22804
22805
22806 static int
22807 test_xmlNodeSetName(void) {
22808     int test_ret = 0;
22809
22810 #if defined(LIBXML_TREE_ENABLED)
22811     int mem_base;
22812     xmlNodePtr cur; /* the node being changed */
22813     int n_cur;
22814     xmlChar * name; /* the new tag name */
22815     int n_name;
22816
22817     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22818     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22819         mem_base = xmlMemBlocks();
22820         cur = gen_xmlNodePtr(n_cur, 0);
22821         name = gen_const_xmlChar_ptr(n_name, 1);
22822
22823         xmlNodeSetName(cur, (const xmlChar *)name);
22824         call_tests++;
22825         des_xmlNodePtr(n_cur, cur, 0);
22826         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22827         xmlResetLastError();
22828         if (mem_base != xmlMemBlocks()) {
22829             printf("Leak of %d blocks found in xmlNodeSetName",
22830                    xmlMemBlocks() - mem_base);
22831             test_ret++;
22832             printf(" %d", n_cur);
22833             printf(" %d", n_name);
22834             printf("\n");
22835         }
22836     }
22837     }
22838     function_tests++;
22839 #endif
22840
22841     return(test_ret);
22842 }
22843
22844
22845 static int
22846 test_xmlNodeSetSpacePreserve(void) {
22847     int test_ret = 0;
22848
22849 #if defined(LIBXML_TREE_ENABLED)
22850     int mem_base;
22851     xmlNodePtr cur; /* the node being changed */
22852     int n_cur;
22853     int val; /* the xml:space value ("0": default, 1: "preserve") */
22854     int n_val;
22855
22856     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22857     for (n_val = 0;n_val < gen_nb_int;n_val++) {
22858         mem_base = xmlMemBlocks();
22859         cur = gen_xmlNodePtr(n_cur, 0);
22860         val = gen_int(n_val, 1);
22861
22862         xmlNodeSetSpacePreserve(cur, val);
22863         call_tests++;
22864         des_xmlNodePtr(n_cur, cur, 0);
22865         des_int(n_val, val, 1);
22866         xmlResetLastError();
22867         if (mem_base != xmlMemBlocks()) {
22868             printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22869                    xmlMemBlocks() - mem_base);
22870             test_ret++;
22871             printf(" %d", n_cur);
22872             printf(" %d", n_val);
22873             printf("\n");
22874         }
22875     }
22876     }
22877     function_tests++;
22878 #endif
22879
22880     return(test_ret);
22881 }
22882
22883
22884 static int
22885 test_xmlPreviousElementSibling(void) {
22886     int test_ret = 0;
22887
22888 #if defined(LIBXML_TREE_ENABLED)
22889     int mem_base;
22890     xmlNodePtr ret_val;
22891     xmlNodePtr node; /* the current node */
22892     int n_node;
22893
22894     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22895         mem_base = xmlMemBlocks();
22896         node = gen_xmlNodePtr(n_node, 0);
22897
22898         ret_val = xmlPreviousElementSibling(node);
22899         desret_xmlNodePtr(ret_val);
22900         call_tests++;
22901         des_xmlNodePtr(n_node, node, 0);
22902         xmlResetLastError();
22903         if (mem_base != xmlMemBlocks()) {
22904             printf("Leak of %d blocks found in xmlPreviousElementSibling",
22905                    xmlMemBlocks() - mem_base);
22906             test_ret++;
22907             printf(" %d", n_node);
22908             printf("\n");
22909         }
22910     }
22911     function_tests++;
22912 #endif
22913
22914     return(test_ret);
22915 }
22916
22917
22918 static int
22919 test_xmlReconciliateNs(void) {
22920     int test_ret = 0;
22921
22922 #if defined(LIBXML_TREE_ENABLED)
22923 #ifdef LIBXML_TREE_ENABLED
22924     int mem_base;
22925     int ret_val;
22926     xmlDocPtr doc; /* the document */
22927     int n_doc;
22928     xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22929     int n_tree;
22930
22931     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22932     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22933         mem_base = xmlMemBlocks();
22934         doc = gen_xmlDocPtr(n_doc, 0);
22935         tree = gen_xmlNodePtr(n_tree, 1);
22936
22937         ret_val = xmlReconciliateNs(doc, tree);
22938         desret_int(ret_val);
22939         call_tests++;
22940         des_xmlDocPtr(n_doc, doc, 0);
22941         des_xmlNodePtr(n_tree, tree, 1);
22942         xmlResetLastError();
22943         if (mem_base != xmlMemBlocks()) {
22944             printf("Leak of %d blocks found in xmlReconciliateNs",
22945                    xmlMemBlocks() - mem_base);
22946             test_ret++;
22947             printf(" %d", n_doc);
22948             printf(" %d", n_tree);
22949             printf("\n");
22950         }
22951     }
22952     }
22953     function_tests++;
22954 #endif
22955 #endif
22956
22957     return(test_ret);
22958 }
22959
22960
22961 static int
22962 test_xmlRemoveProp(void) {
22963     int test_ret = 0;
22964
22965     int mem_base;
22966     int ret_val;
22967     xmlAttrPtr cur; /* an attribute */
22968     int n_cur;
22969
22970     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22971         mem_base = xmlMemBlocks();
22972         cur = gen_xmlAttrPtr(n_cur, 0);
22973
22974         ret_val = xmlRemoveProp(cur);
22975         cur = NULL;
22976         desret_int(ret_val);
22977         call_tests++;
22978         des_xmlAttrPtr(n_cur, cur, 0);
22979         xmlResetLastError();
22980         if (mem_base != xmlMemBlocks()) {
22981             printf("Leak of %d blocks found in xmlRemoveProp",
22982                    xmlMemBlocks() - mem_base);
22983             test_ret++;
22984             printf(" %d", n_cur);
22985             printf("\n");
22986         }
22987     }
22988     function_tests++;
22989
22990     return(test_ret);
22991 }
22992
22993
22994 static int
22995 test_xmlReplaceNode(void) {
22996     int test_ret = 0;
22997
22998 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22999     int mem_base;
23000     xmlNodePtr ret_val;
23001     xmlNodePtr old; /* the old node */
23002     int n_old;
23003     xmlNodePtr cur; /* the node */
23004     int n_cur;
23005
23006     for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
23007     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
23008         mem_base = xmlMemBlocks();
23009         old = gen_xmlNodePtr(n_old, 0);
23010         cur = gen_xmlNodePtr_in(n_cur, 1);
23011
23012         ret_val = xmlReplaceNode(old, cur);
23013         if (cur != NULL) {
23014               xmlUnlinkNode(cur);
23015               xmlFreeNode(cur) ; cur = NULL ; }
23016           if (old != NULL) {
23017               xmlUnlinkNode(old);
23018               xmlFreeNode(old) ; old = NULL ; }
23019           ret_val = NULL;
23020         desret_xmlNodePtr(ret_val);
23021         call_tests++;
23022         des_xmlNodePtr(n_old, old, 0);
23023         des_xmlNodePtr_in(n_cur, cur, 1);
23024         xmlResetLastError();
23025         if (mem_base != xmlMemBlocks()) {
23026             printf("Leak of %d blocks found in xmlReplaceNode",
23027                    xmlMemBlocks() - mem_base);
23028             test_ret++;
23029             printf(" %d", n_old);
23030             printf(" %d", n_cur);
23031             printf("\n");
23032         }
23033     }
23034     }
23035     function_tests++;
23036 #endif
23037
23038     return(test_ret);
23039 }
23040
23041
23042 static int
23043 test_xmlSaveFile(void) {
23044     int test_ret = 0;
23045
23046 #if defined(LIBXML_OUTPUT_ENABLED)
23047     int mem_base;
23048     int ret_val;
23049     const char * filename; /* the filename (or URL) */
23050     int n_filename;
23051     xmlDocPtr cur; /* the document */
23052     int n_cur;
23053
23054     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23055     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23056         mem_base = xmlMemBlocks();
23057         filename = gen_fileoutput(n_filename, 0);
23058         cur = gen_xmlDocPtr(n_cur, 1);
23059
23060         ret_val = xmlSaveFile(filename, cur);
23061         desret_int(ret_val);
23062         call_tests++;
23063         des_fileoutput(n_filename, filename, 0);
23064         des_xmlDocPtr(n_cur, cur, 1);
23065         xmlResetLastError();
23066         if (mem_base != xmlMemBlocks()) {
23067             printf("Leak of %d blocks found in xmlSaveFile",
23068                    xmlMemBlocks() - mem_base);
23069             test_ret++;
23070             printf(" %d", n_filename);
23071             printf(" %d", n_cur);
23072             printf("\n");
23073         }
23074     }
23075     }
23076     function_tests++;
23077 #endif
23078
23079     return(test_ret);
23080 }
23081
23082
23083 static int
23084 test_xmlSaveFileEnc(void) {
23085     int test_ret = 0;
23086
23087 #if defined(LIBXML_OUTPUT_ENABLED)
23088     int mem_base;
23089     int ret_val;
23090     const char * filename; /* the filename (or URL) */
23091     int n_filename;
23092     xmlDocPtr cur; /* the document */
23093     int n_cur;
23094     char * encoding; /* the name of an encoding (or NULL) */
23095     int n_encoding;
23096
23097     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23098     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23099     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23100         mem_base = xmlMemBlocks();
23101         filename = gen_fileoutput(n_filename, 0);
23102         cur = gen_xmlDocPtr(n_cur, 1);
23103         encoding = gen_const_char_ptr(n_encoding, 2);
23104
23105         ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
23106         desret_int(ret_val);
23107         call_tests++;
23108         des_fileoutput(n_filename, filename, 0);
23109         des_xmlDocPtr(n_cur, cur, 1);
23110         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23111         xmlResetLastError();
23112         if (mem_base != xmlMemBlocks()) {
23113             printf("Leak of %d blocks found in xmlSaveFileEnc",
23114                    xmlMemBlocks() - mem_base);
23115             test_ret++;
23116             printf(" %d", n_filename);
23117             printf(" %d", n_cur);
23118             printf(" %d", n_encoding);
23119             printf("\n");
23120         }
23121     }
23122     }
23123     }
23124     function_tests++;
23125 #endif
23126
23127     return(test_ret);
23128 }
23129
23130
23131 static int
23132 test_xmlSaveFileTo(void) {
23133     int test_ret = 0;
23134
23135 #if defined(LIBXML_OUTPUT_ENABLED)
23136     int mem_base;
23137     int ret_val;
23138     xmlOutputBufferPtr buf; /* an output I/O buffer */
23139     int n_buf;
23140     xmlDocPtr cur; /* the document */
23141     int n_cur;
23142     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23143     int n_encoding;
23144
23145     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23146     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23147     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23148         mem_base = xmlMemBlocks();
23149         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23150         cur = gen_xmlDocPtr(n_cur, 1);
23151         encoding = gen_const_char_ptr(n_encoding, 2);
23152
23153         ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
23154         buf = NULL;
23155         desret_int(ret_val);
23156         call_tests++;
23157         des_xmlOutputBufferPtr(n_buf, buf, 0);
23158         des_xmlDocPtr(n_cur, cur, 1);
23159         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23160         xmlResetLastError();
23161         if (mem_base != xmlMemBlocks()) {
23162             printf("Leak of %d blocks found in xmlSaveFileTo",
23163                    xmlMemBlocks() - mem_base);
23164             test_ret++;
23165             printf(" %d", n_buf);
23166             printf(" %d", n_cur);
23167             printf(" %d", n_encoding);
23168             printf("\n");
23169         }
23170     }
23171     }
23172     }
23173     function_tests++;
23174 #endif
23175
23176     return(test_ret);
23177 }
23178
23179
23180 static int
23181 test_xmlSaveFormatFile(void) {
23182     int test_ret = 0;
23183
23184 #if defined(LIBXML_OUTPUT_ENABLED)
23185     int mem_base;
23186     int ret_val;
23187     const char * filename; /* the filename (or URL) */
23188     int n_filename;
23189     xmlDocPtr cur; /* the document */
23190     int n_cur;
23191     int format; /* should formatting spaces been added */
23192     int n_format;
23193
23194     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23195     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23196     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23197         mem_base = xmlMemBlocks();
23198         filename = gen_fileoutput(n_filename, 0);
23199         cur = gen_xmlDocPtr(n_cur, 1);
23200         format = gen_int(n_format, 2);
23201
23202         ret_val = xmlSaveFormatFile(filename, cur, format);
23203         desret_int(ret_val);
23204         call_tests++;
23205         des_fileoutput(n_filename, filename, 0);
23206         des_xmlDocPtr(n_cur, cur, 1);
23207         des_int(n_format, format, 2);
23208         xmlResetLastError();
23209         if (mem_base != xmlMemBlocks()) {
23210             printf("Leak of %d blocks found in xmlSaveFormatFile",
23211                    xmlMemBlocks() - mem_base);
23212             test_ret++;
23213             printf(" %d", n_filename);
23214             printf(" %d", n_cur);
23215             printf(" %d", n_format);
23216             printf("\n");
23217         }
23218     }
23219     }
23220     }
23221     function_tests++;
23222 #endif
23223
23224     return(test_ret);
23225 }
23226
23227
23228 static int
23229 test_xmlSaveFormatFileEnc(void) {
23230     int test_ret = 0;
23231
23232 #if defined(LIBXML_OUTPUT_ENABLED)
23233     int mem_base;
23234     int ret_val;
23235     const char * filename; /* the filename or URL to output */
23236     int n_filename;
23237     xmlDocPtr cur; /* the document being saved */
23238     int n_cur;
23239     char * encoding; /* the name of the encoding to use or NULL. */
23240     int n_encoding;
23241     int format; /* should formatting spaces be added. */
23242     int n_format;
23243
23244     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23245     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23246     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23247     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23248         mem_base = xmlMemBlocks();
23249         filename = gen_fileoutput(n_filename, 0);
23250         cur = gen_xmlDocPtr(n_cur, 1);
23251         encoding = gen_const_char_ptr(n_encoding, 2);
23252         format = gen_int(n_format, 3);
23253
23254         ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23255         desret_int(ret_val);
23256         call_tests++;
23257         des_fileoutput(n_filename, filename, 0);
23258         des_xmlDocPtr(n_cur, cur, 1);
23259         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23260         des_int(n_format, format, 3);
23261         xmlResetLastError();
23262         if (mem_base != xmlMemBlocks()) {
23263             printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23264                    xmlMemBlocks() - mem_base);
23265             test_ret++;
23266             printf(" %d", n_filename);
23267             printf(" %d", n_cur);
23268             printf(" %d", n_encoding);
23269             printf(" %d", n_format);
23270             printf("\n");
23271         }
23272     }
23273     }
23274     }
23275     }
23276     function_tests++;
23277 #endif
23278
23279     return(test_ret);
23280 }
23281
23282
23283 static int
23284 test_xmlSaveFormatFileTo(void) {
23285     int test_ret = 0;
23286
23287 #if defined(LIBXML_OUTPUT_ENABLED)
23288     int mem_base;
23289     int ret_val;
23290     xmlOutputBufferPtr buf; /* an output I/O buffer */
23291     int n_buf;
23292     xmlDocPtr cur; /* the document */
23293     int n_cur;
23294     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23295     int n_encoding;
23296     int format; /* should formatting spaces been added */
23297     int n_format;
23298
23299     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23300     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23301     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23302     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23303         mem_base = xmlMemBlocks();
23304         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23305         cur = gen_xmlDocPtr(n_cur, 1);
23306         encoding = gen_const_char_ptr(n_encoding, 2);
23307         format = gen_int(n_format, 3);
23308
23309         ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23310         buf = NULL;
23311         desret_int(ret_val);
23312         call_tests++;
23313         des_xmlOutputBufferPtr(n_buf, buf, 0);
23314         des_xmlDocPtr(n_cur, cur, 1);
23315         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23316         des_int(n_format, format, 3);
23317         xmlResetLastError();
23318         if (mem_base != xmlMemBlocks()) {
23319             printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23320                    xmlMemBlocks() - mem_base);
23321             test_ret++;
23322             printf(" %d", n_buf);
23323             printf(" %d", n_cur);
23324             printf(" %d", n_encoding);
23325             printf(" %d", n_format);
23326             printf("\n");
23327         }
23328     }
23329     }
23330     }
23331     }
23332     function_tests++;
23333 #endif
23334
23335     return(test_ret);
23336 }
23337
23338
23339 static int
23340 test_xmlSearchNs(void) {
23341     int test_ret = 0;
23342
23343     int mem_base;
23344     xmlNsPtr ret_val;
23345     xmlDocPtr doc; /* the document */
23346     int n_doc;
23347     xmlNodePtr node; /* the current node */
23348     int n_node;
23349     xmlChar * nameSpace; /* the namespace prefix */
23350     int n_nameSpace;
23351
23352     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23353     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23354     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23355         mem_base = xmlMemBlocks();
23356         doc = gen_xmlDocPtr(n_doc, 0);
23357         node = gen_xmlNodePtr(n_node, 1);
23358         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23359
23360         ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23361         desret_xmlNsPtr(ret_val);
23362         call_tests++;
23363         des_xmlDocPtr(n_doc, doc, 0);
23364         des_xmlNodePtr(n_node, node, 1);
23365         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23366         xmlResetLastError();
23367         if (mem_base != xmlMemBlocks()) {
23368             printf("Leak of %d blocks found in xmlSearchNs",
23369                    xmlMemBlocks() - mem_base);
23370             test_ret++;
23371             printf(" %d", n_doc);
23372             printf(" %d", n_node);
23373             printf(" %d", n_nameSpace);
23374             printf("\n");
23375         }
23376     }
23377     }
23378     }
23379     function_tests++;
23380
23381     return(test_ret);
23382 }
23383
23384
23385 static int
23386 test_xmlSearchNsByHref(void) {
23387     int test_ret = 0;
23388
23389     int mem_base;
23390     xmlNsPtr ret_val;
23391     xmlDocPtr doc; /* the document */
23392     int n_doc;
23393     xmlNodePtr node; /* the current node */
23394     int n_node;
23395     xmlChar * href; /* the namespace value */
23396     int n_href;
23397
23398     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23399     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23400     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23401         mem_base = xmlMemBlocks();
23402         doc = gen_xmlDocPtr(n_doc, 0);
23403         node = gen_xmlNodePtr(n_node, 1);
23404         href = gen_const_xmlChar_ptr(n_href, 2);
23405
23406         ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23407         desret_xmlNsPtr(ret_val);
23408         call_tests++;
23409         des_xmlDocPtr(n_doc, doc, 0);
23410         des_xmlNodePtr(n_node, node, 1);
23411         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23412         xmlResetLastError();
23413         if (mem_base != xmlMemBlocks()) {
23414             printf("Leak of %d blocks found in xmlSearchNsByHref",
23415                    xmlMemBlocks() - mem_base);
23416             test_ret++;
23417             printf(" %d", n_doc);
23418             printf(" %d", n_node);
23419             printf(" %d", n_href);
23420             printf("\n");
23421         }
23422     }
23423     }
23424     }
23425     function_tests++;
23426
23427     return(test_ret);
23428 }
23429
23430
23431 static int
23432 test_xmlSetBufferAllocationScheme(void) {
23433     int test_ret = 0;
23434
23435     int mem_base;
23436     xmlBufferAllocationScheme scheme; /* allocation method to use */
23437     int n_scheme;
23438
23439     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23440         mem_base = xmlMemBlocks();
23441         scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23442
23443         xmlSetBufferAllocationScheme(scheme);
23444         call_tests++;
23445         des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23446         xmlResetLastError();
23447         if (mem_base != xmlMemBlocks()) {
23448             printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23449                    xmlMemBlocks() - mem_base);
23450             test_ret++;
23451             printf(" %d", n_scheme);
23452             printf("\n");
23453         }
23454     }
23455     function_tests++;
23456
23457     return(test_ret);
23458 }
23459
23460
23461 static int
23462 test_xmlSetCompressMode(void) {
23463     int test_ret = 0;
23464
23465     int mem_base;
23466     int mode; /* the compression ratio */
23467     int n_mode;
23468
23469     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23470         mem_base = xmlMemBlocks();
23471         mode = gen_int(n_mode, 0);
23472
23473         xmlSetCompressMode(mode);
23474         call_tests++;
23475         des_int(n_mode, mode, 0);
23476         xmlResetLastError();
23477         if (mem_base != xmlMemBlocks()) {
23478             printf("Leak of %d blocks found in xmlSetCompressMode",
23479                    xmlMemBlocks() - mem_base);
23480             test_ret++;
23481             printf(" %d", n_mode);
23482             printf("\n");
23483         }
23484     }
23485     function_tests++;
23486
23487     return(test_ret);
23488 }
23489
23490
23491 static int
23492 test_xmlSetDocCompressMode(void) {
23493     int test_ret = 0;
23494
23495     int mem_base;
23496     xmlDocPtr doc; /* the document */
23497     int n_doc;
23498     int mode; /* the compression ratio */
23499     int n_mode;
23500
23501     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23502     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23503         mem_base = xmlMemBlocks();
23504         doc = gen_xmlDocPtr(n_doc, 0);
23505         mode = gen_int(n_mode, 1);
23506
23507         xmlSetDocCompressMode(doc, mode);
23508         call_tests++;
23509         des_xmlDocPtr(n_doc, doc, 0);
23510         des_int(n_mode, mode, 1);
23511         xmlResetLastError();
23512         if (mem_base != xmlMemBlocks()) {
23513             printf("Leak of %d blocks found in xmlSetDocCompressMode",
23514                    xmlMemBlocks() - mem_base);
23515             test_ret++;
23516             printf(" %d", n_doc);
23517             printf(" %d", n_mode);
23518             printf("\n");
23519         }
23520     }
23521     }
23522     function_tests++;
23523
23524     return(test_ret);
23525 }
23526
23527
23528 static int
23529 test_xmlSetNs(void) {
23530     int test_ret = 0;
23531
23532     int mem_base;
23533     xmlNodePtr node; /* a node in the document */
23534     int n_node;
23535     xmlNsPtr ns; /* a namespace pointer */
23536     int n_ns;
23537
23538     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23539     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23540         mem_base = xmlMemBlocks();
23541         node = gen_xmlNodePtr(n_node, 0);
23542         ns = gen_xmlNsPtr(n_ns, 1);
23543
23544         xmlSetNs(node, ns);
23545         call_tests++;
23546         des_xmlNodePtr(n_node, node, 0);
23547         des_xmlNsPtr(n_ns, ns, 1);
23548         xmlResetLastError();
23549         if (mem_base != xmlMemBlocks()) {
23550             printf("Leak of %d blocks found in xmlSetNs",
23551                    xmlMemBlocks() - mem_base);
23552             test_ret++;
23553             printf(" %d", n_node);
23554             printf(" %d", n_ns);
23555             printf("\n");
23556         }
23557     }
23558     }
23559     function_tests++;
23560
23561     return(test_ret);
23562 }
23563
23564
23565 static int
23566 test_xmlSetNsProp(void) {
23567     int test_ret = 0;
23568
23569 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23570     int mem_base;
23571     xmlAttrPtr ret_val;
23572     xmlNodePtr node; /* the node */
23573     int n_node;
23574     xmlNsPtr ns; /* the namespace definition */
23575     int n_ns;
23576     xmlChar * name; /* the attribute name */
23577     int n_name;
23578     xmlChar * value; /* the attribute value */
23579     int n_value;
23580
23581     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23582     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23583     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23584     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23585         mem_base = xmlMemBlocks();
23586         node = gen_xmlNodePtr(n_node, 0);
23587         ns = gen_xmlNsPtr(n_ns, 1);
23588         name = gen_const_xmlChar_ptr(n_name, 2);
23589         value = gen_const_xmlChar_ptr(n_value, 3);
23590
23591         ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23592         desret_xmlAttrPtr(ret_val);
23593         call_tests++;
23594         des_xmlNodePtr(n_node, node, 0);
23595         des_xmlNsPtr(n_ns, ns, 1);
23596         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23597         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23598         xmlResetLastError();
23599         if (mem_base != xmlMemBlocks()) {
23600             printf("Leak of %d blocks found in xmlSetNsProp",
23601                    xmlMemBlocks() - mem_base);
23602             test_ret++;
23603             printf(" %d", n_node);
23604             printf(" %d", n_ns);
23605             printf(" %d", n_name);
23606             printf(" %d", n_value);
23607             printf("\n");
23608         }
23609     }
23610     }
23611     }
23612     }
23613     function_tests++;
23614 #endif
23615
23616     return(test_ret);
23617 }
23618
23619
23620 static int
23621 test_xmlSetProp(void) {
23622     int test_ret = 0;
23623
23624 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23625     int mem_base;
23626     xmlAttrPtr ret_val;
23627     xmlNodePtr node; /* the node */
23628     int n_node;
23629     xmlChar * name; /* the attribute name (a QName) */
23630     int n_name;
23631     xmlChar * value; /* the attribute value */
23632     int n_value;
23633
23634     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23635     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23636     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23637         mem_base = xmlMemBlocks();
23638         node = gen_xmlNodePtr(n_node, 0);
23639         name = gen_const_xmlChar_ptr(n_name, 1);
23640         value = gen_const_xmlChar_ptr(n_value, 2);
23641
23642         ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23643         desret_xmlAttrPtr(ret_val);
23644         call_tests++;
23645         des_xmlNodePtr(n_node, node, 0);
23646         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23647         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23648         xmlResetLastError();
23649         if (mem_base != xmlMemBlocks()) {
23650             printf("Leak of %d blocks found in xmlSetProp",
23651                    xmlMemBlocks() - mem_base);
23652             test_ret++;
23653             printf(" %d", n_node);
23654             printf(" %d", n_name);
23655             printf(" %d", n_value);
23656             printf("\n");
23657         }
23658     }
23659     }
23660     }
23661     function_tests++;
23662 #endif
23663
23664     return(test_ret);
23665 }
23666
23667
23668 static int
23669 test_xmlSplitQName2(void) {
23670     int test_ret = 0;
23671
23672     int mem_base;
23673     xmlChar * ret_val;
23674     xmlChar * name; /* the full QName */
23675     int n_name;
23676     xmlChar ** prefix; /* a xmlChar ** */
23677     int n_prefix;
23678
23679     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23680     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23681         mem_base = xmlMemBlocks();
23682         name = gen_const_xmlChar_ptr(n_name, 0);
23683         prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23684
23685         ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23686         desret_xmlChar_ptr(ret_val);
23687         call_tests++;
23688         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23689         des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23690         xmlResetLastError();
23691         if (mem_base != xmlMemBlocks()) {
23692             printf("Leak of %d blocks found in xmlSplitQName2",
23693                    xmlMemBlocks() - mem_base);
23694             test_ret++;
23695             printf(" %d", n_name);
23696             printf(" %d", n_prefix);
23697             printf("\n");
23698         }
23699     }
23700     }
23701     function_tests++;
23702
23703     return(test_ret);
23704 }
23705
23706
23707 static int
23708 test_xmlSplitQName3(void) {
23709     int test_ret = 0;
23710
23711     int mem_base;
23712     const xmlChar * ret_val;
23713     xmlChar * name; /* the full QName */
23714     int n_name;
23715     int * len; /* an int * */
23716     int n_len;
23717
23718     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23719     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23720         mem_base = xmlMemBlocks();
23721         name = gen_const_xmlChar_ptr(n_name, 0);
23722         len = gen_int_ptr(n_len, 1);
23723
23724         ret_val = xmlSplitQName3((const xmlChar *)name, len);
23725         desret_const_xmlChar_ptr(ret_val);
23726         call_tests++;
23727         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23728         des_int_ptr(n_len, len, 1);
23729         xmlResetLastError();
23730         if (mem_base != xmlMemBlocks()) {
23731             printf("Leak of %d blocks found in xmlSplitQName3",
23732                    xmlMemBlocks() - mem_base);
23733             test_ret++;
23734             printf(" %d", n_name);
23735             printf(" %d", n_len);
23736             printf("\n");
23737         }
23738     }
23739     }
23740     function_tests++;
23741
23742     return(test_ret);
23743 }
23744
23745
23746 static int
23747 test_xmlStringGetNodeList(void) {
23748     int test_ret = 0;
23749
23750     int mem_base;
23751     xmlNodePtr ret_val;
23752     xmlDocPtr doc; /* the document */
23753     int n_doc;
23754     xmlChar * value; /* the value of the attribute */
23755     int n_value;
23756
23757     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23758     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23759         mem_base = xmlMemBlocks();
23760         doc = gen_xmlDocPtr(n_doc, 0);
23761         value = gen_const_xmlChar_ptr(n_value, 1);
23762
23763         ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23764         desret_xmlNodePtr(ret_val);
23765         call_tests++;
23766         des_xmlDocPtr(n_doc, doc, 0);
23767         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23768         xmlResetLastError();
23769         if (mem_base != xmlMemBlocks()) {
23770             printf("Leak of %d blocks found in xmlStringGetNodeList",
23771                    xmlMemBlocks() - mem_base);
23772             test_ret++;
23773             printf(" %d", n_doc);
23774             printf(" %d", n_value);
23775             printf("\n");
23776         }
23777     }
23778     }
23779     function_tests++;
23780
23781     return(test_ret);
23782 }
23783
23784
23785 static int
23786 test_xmlStringLenGetNodeList(void) {
23787     int test_ret = 0;
23788
23789     int mem_base;
23790     xmlNodePtr ret_val;
23791     xmlDocPtr doc; /* the document */
23792     int n_doc;
23793     xmlChar * value; /* the value of the text */
23794     int n_value;
23795     int len; /* the length of the string value */
23796     int n_len;
23797
23798     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23799     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23800     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23801         mem_base = xmlMemBlocks();
23802         doc = gen_xmlDocPtr(n_doc, 0);
23803         value = gen_const_xmlChar_ptr(n_value, 1);
23804         len = gen_int(n_len, 2);
23805
23806         ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23807         desret_xmlNodePtr(ret_val);
23808         call_tests++;
23809         des_xmlDocPtr(n_doc, doc, 0);
23810         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23811         des_int(n_len, len, 2);
23812         xmlResetLastError();
23813         if (mem_base != xmlMemBlocks()) {
23814             printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23815                    xmlMemBlocks() - mem_base);
23816             test_ret++;
23817             printf(" %d", n_doc);
23818             printf(" %d", n_value);
23819             printf(" %d", n_len);
23820             printf("\n");
23821         }
23822     }
23823     }
23824     }
23825     function_tests++;
23826
23827     return(test_ret);
23828 }
23829
23830
23831 static int
23832 test_xmlTextConcat(void) {
23833     int test_ret = 0;
23834
23835     int mem_base;
23836     int ret_val;
23837     xmlNodePtr node; /* the node */
23838     int n_node;
23839     xmlChar * content; /* the content */
23840     int n_content;
23841     int len; /* @content length */
23842     int n_len;
23843
23844     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23845     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23846     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23847         mem_base = xmlMemBlocks();
23848         node = gen_xmlNodePtr(n_node, 0);
23849         content = gen_const_xmlChar_ptr(n_content, 1);
23850         len = gen_int(n_len, 2);
23851
23852         ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23853         desret_int(ret_val);
23854         call_tests++;
23855         des_xmlNodePtr(n_node, node, 0);
23856         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23857         des_int(n_len, len, 2);
23858         xmlResetLastError();
23859         if (mem_base != xmlMemBlocks()) {
23860             printf("Leak of %d blocks found in xmlTextConcat",
23861                    xmlMemBlocks() - mem_base);
23862             test_ret++;
23863             printf(" %d", n_node);
23864             printf(" %d", n_content);
23865             printf(" %d", n_len);
23866             printf("\n");
23867         }
23868     }
23869     }
23870     }
23871     function_tests++;
23872
23873     return(test_ret);
23874 }
23875
23876
23877 static int
23878 test_xmlTextMerge(void) {
23879     int test_ret = 0;
23880
23881     int mem_base;
23882     xmlNodePtr ret_val;
23883     xmlNodePtr first; /* the first text node */
23884     int n_first;
23885     xmlNodePtr second; /* the second text node being merged */
23886     int n_second;
23887
23888     for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23889     for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23890         mem_base = xmlMemBlocks();
23891         first = gen_xmlNodePtr_in(n_first, 0);
23892         second = gen_xmlNodePtr_in(n_second, 1);
23893
23894         ret_val = xmlTextMerge(first, second);
23895         if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23896               xmlUnlinkNode(second);
23897               xmlFreeNode(second) ; second = NULL ; }
23898         desret_xmlNodePtr(ret_val);
23899         call_tests++;
23900         des_xmlNodePtr_in(n_first, first, 0);
23901         des_xmlNodePtr_in(n_second, second, 1);
23902         xmlResetLastError();
23903         if (mem_base != xmlMemBlocks()) {
23904             printf("Leak of %d blocks found in xmlTextMerge",
23905                    xmlMemBlocks() - mem_base);
23906             test_ret++;
23907             printf(" %d", n_first);
23908             printf(" %d", n_second);
23909             printf("\n");
23910         }
23911     }
23912     }
23913     function_tests++;
23914
23915     return(test_ret);
23916 }
23917
23918
23919 static int
23920 test_xmlUnsetNsProp(void) {
23921     int test_ret = 0;
23922
23923 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23924     int mem_base;
23925     int ret_val;
23926     xmlNodePtr node; /* the node */
23927     int n_node;
23928     xmlNsPtr ns; /* the namespace definition */
23929     int n_ns;
23930     xmlChar * name; /* the attribute name */
23931     int n_name;
23932
23933     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23934     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23935     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23936         mem_base = xmlMemBlocks();
23937         node = gen_xmlNodePtr(n_node, 0);
23938         ns = gen_xmlNsPtr(n_ns, 1);
23939         name = gen_const_xmlChar_ptr(n_name, 2);
23940
23941         ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23942         desret_int(ret_val);
23943         call_tests++;
23944         des_xmlNodePtr(n_node, node, 0);
23945         des_xmlNsPtr(n_ns, ns, 1);
23946         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23947         xmlResetLastError();
23948         if (mem_base != xmlMemBlocks()) {
23949             printf("Leak of %d blocks found in xmlUnsetNsProp",
23950                    xmlMemBlocks() - mem_base);
23951             test_ret++;
23952             printf(" %d", n_node);
23953             printf(" %d", n_ns);
23954             printf(" %d", n_name);
23955             printf("\n");
23956         }
23957     }
23958     }
23959     }
23960     function_tests++;
23961 #endif
23962
23963     return(test_ret);
23964 }
23965
23966
23967 static int
23968 test_xmlUnsetProp(void) {
23969     int test_ret = 0;
23970
23971 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23972     int mem_base;
23973     int ret_val;
23974     xmlNodePtr node; /* the node */
23975     int n_node;
23976     xmlChar * name; /* the attribute name */
23977     int n_name;
23978
23979     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23980     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23981         mem_base = xmlMemBlocks();
23982         node = gen_xmlNodePtr(n_node, 0);
23983         name = gen_const_xmlChar_ptr(n_name, 1);
23984
23985         ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23986         desret_int(ret_val);
23987         call_tests++;
23988         des_xmlNodePtr(n_node, node, 0);
23989         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23990         xmlResetLastError();
23991         if (mem_base != xmlMemBlocks()) {
23992             printf("Leak of %d blocks found in xmlUnsetProp",
23993                    xmlMemBlocks() - mem_base);
23994             test_ret++;
23995             printf(" %d", n_node);
23996             printf(" %d", n_name);
23997             printf("\n");
23998         }
23999     }
24000     }
24001     function_tests++;
24002 #endif
24003
24004     return(test_ret);
24005 }
24006
24007
24008 static int
24009 test_xmlValidateNCName(void) {
24010     int test_ret = 0;
24011
24012 #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)
24013 #ifdef LIBXML_TREE_ENABLED
24014     int mem_base;
24015     int ret_val;
24016     xmlChar * value; /* the value to check */
24017     int n_value;
24018     int space; /* allow spaces in front and end of the string */
24019     int n_space;
24020
24021     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24022     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24023         mem_base = xmlMemBlocks();
24024         value = gen_const_xmlChar_ptr(n_value, 0);
24025         space = gen_int(n_space, 1);
24026
24027         ret_val = xmlValidateNCName((const xmlChar *)value, space);
24028         desret_int(ret_val);
24029         call_tests++;
24030         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24031         des_int(n_space, space, 1);
24032         xmlResetLastError();
24033         if (mem_base != xmlMemBlocks()) {
24034             printf("Leak of %d blocks found in xmlValidateNCName",
24035                    xmlMemBlocks() - mem_base);
24036             test_ret++;
24037             printf(" %d", n_value);
24038             printf(" %d", n_space);
24039             printf("\n");
24040         }
24041     }
24042     }
24043     function_tests++;
24044 #endif
24045 #endif
24046
24047     return(test_ret);
24048 }
24049
24050
24051 static int
24052 test_xmlValidateNMToken(void) {
24053     int test_ret = 0;
24054
24055 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24056 #ifdef LIBXML_TREE_ENABLED
24057     int mem_base;
24058     int ret_val;
24059     xmlChar * value; /* the value to check */
24060     int n_value;
24061     int space; /* allow spaces in front and end of the string */
24062     int n_space;
24063
24064     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24065     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24066         mem_base = xmlMemBlocks();
24067         value = gen_const_xmlChar_ptr(n_value, 0);
24068         space = gen_int(n_space, 1);
24069
24070         ret_val = xmlValidateNMToken((const xmlChar *)value, space);
24071         desret_int(ret_val);
24072         call_tests++;
24073         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24074         des_int(n_space, space, 1);
24075         xmlResetLastError();
24076         if (mem_base != xmlMemBlocks()) {
24077             printf("Leak of %d blocks found in xmlValidateNMToken",
24078                    xmlMemBlocks() - mem_base);
24079             test_ret++;
24080             printf(" %d", n_value);
24081             printf(" %d", n_space);
24082             printf("\n");
24083         }
24084     }
24085     }
24086     function_tests++;
24087 #endif
24088 #endif
24089
24090     return(test_ret);
24091 }
24092
24093
24094 static int
24095 test_xmlValidateName(void) {
24096     int test_ret = 0;
24097
24098 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24099 #ifdef LIBXML_TREE_ENABLED
24100     int mem_base;
24101     int ret_val;
24102     xmlChar * value; /* the value to check */
24103     int n_value;
24104     int space; /* allow spaces in front and end of the string */
24105     int n_space;
24106
24107     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24108     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24109         mem_base = xmlMemBlocks();
24110         value = gen_const_xmlChar_ptr(n_value, 0);
24111         space = gen_int(n_space, 1);
24112
24113         ret_val = xmlValidateName((const xmlChar *)value, space);
24114         desret_int(ret_val);
24115         call_tests++;
24116         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24117         des_int(n_space, space, 1);
24118         xmlResetLastError();
24119         if (mem_base != xmlMemBlocks()) {
24120             printf("Leak of %d blocks found in xmlValidateName",
24121                    xmlMemBlocks() - mem_base);
24122             test_ret++;
24123             printf(" %d", n_value);
24124             printf(" %d", n_space);
24125             printf("\n");
24126         }
24127     }
24128     }
24129     function_tests++;
24130 #endif
24131 #endif
24132
24133     return(test_ret);
24134 }
24135
24136
24137 static int
24138 test_xmlValidateQName(void) {
24139     int test_ret = 0;
24140
24141 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24142 #ifdef LIBXML_TREE_ENABLED
24143     int mem_base;
24144     int ret_val;
24145     xmlChar * value; /* the value to check */
24146     int n_value;
24147     int space; /* allow spaces in front and end of the string */
24148     int n_space;
24149
24150     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24151     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24152         mem_base = xmlMemBlocks();
24153         value = gen_const_xmlChar_ptr(n_value, 0);
24154         space = gen_int(n_space, 1);
24155
24156         ret_val = xmlValidateQName((const xmlChar *)value, space);
24157         desret_int(ret_val);
24158         call_tests++;
24159         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24160         des_int(n_space, space, 1);
24161         xmlResetLastError();
24162         if (mem_base != xmlMemBlocks()) {
24163             printf("Leak of %d blocks found in xmlValidateQName",
24164                    xmlMemBlocks() - mem_base);
24165             test_ret++;
24166             printf(" %d", n_value);
24167             printf(" %d", n_space);
24168             printf("\n");
24169         }
24170     }
24171     }
24172     function_tests++;
24173 #endif
24174 #endif
24175
24176     return(test_ret);
24177 }
24178
24179 static int
24180 test_tree(void) {
24181     int test_ret = 0;
24182
24183     if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
24184     test_ret += test_xmlAddChild();
24185     test_ret += test_xmlAddChildList();
24186     test_ret += test_xmlAddNextSibling();
24187     test_ret += test_xmlAddPrevSibling();
24188     test_ret += test_xmlAddSibling();
24189     test_ret += test_xmlAttrSerializeTxtContent();
24190     test_ret += test_xmlBufContent();
24191     test_ret += test_xmlBufEnd();
24192     test_ret += test_xmlBufGetNodeContent();
24193     test_ret += test_xmlBufNodeDump();
24194     test_ret += test_xmlBufShrink();
24195     test_ret += test_xmlBufUse();
24196     test_ret += test_xmlBufferAdd();
24197     test_ret += test_xmlBufferAddHead();
24198     test_ret += test_xmlBufferCCat();
24199     test_ret += test_xmlBufferCat();
24200     test_ret += test_xmlBufferContent();
24201     test_ret += test_xmlBufferCreate();
24202     test_ret += test_xmlBufferCreateSize();
24203     test_ret += test_xmlBufferCreateStatic();
24204     test_ret += test_xmlBufferDetach();
24205     test_ret += test_xmlBufferEmpty();
24206     test_ret += test_xmlBufferGrow();
24207     test_ret += test_xmlBufferLength();
24208     test_ret += test_xmlBufferResize();
24209     test_ret += test_xmlBufferSetAllocationScheme();
24210     test_ret += test_xmlBufferShrink();
24211     test_ret += test_xmlBufferWriteCHAR();
24212     test_ret += test_xmlBufferWriteChar();
24213     test_ret += test_xmlBufferWriteQuotedString();
24214     test_ret += test_xmlBuildQName();
24215     test_ret += test_xmlChildElementCount();
24216     test_ret += test_xmlCopyDoc();
24217     test_ret += test_xmlCopyDtd();
24218     test_ret += test_xmlCopyNamespace();
24219     test_ret += test_xmlCopyNamespaceList();
24220     test_ret += test_xmlCopyNode();
24221     test_ret += test_xmlCopyNodeList();
24222     test_ret += test_xmlCopyProp();
24223     test_ret += test_xmlCopyPropList();
24224     test_ret += test_xmlCreateIntSubset();
24225     test_ret += test_xmlDOMWrapAdoptNode();
24226     test_ret += test_xmlDOMWrapCloneNode();
24227     test_ret += test_xmlDOMWrapNewCtxt();
24228     test_ret += test_xmlDOMWrapReconcileNamespaces();
24229     test_ret += test_xmlDOMWrapRemoveNode();
24230     test_ret += test_xmlDocCopyNode();
24231     test_ret += test_xmlDocCopyNodeList();
24232     test_ret += test_xmlDocDump();
24233     test_ret += test_xmlDocDumpFormatMemory();
24234     test_ret += test_xmlDocDumpFormatMemoryEnc();
24235     test_ret += test_xmlDocDumpMemory();
24236     test_ret += test_xmlDocDumpMemoryEnc();
24237     test_ret += test_xmlDocFormatDump();
24238     test_ret += test_xmlDocGetRootElement();
24239     test_ret += test_xmlDocSetRootElement();
24240     test_ret += test_xmlElemDump();
24241     test_ret += test_xmlFirstElementChild();
24242     test_ret += test_xmlGetBufferAllocationScheme();
24243     test_ret += test_xmlGetCompressMode();
24244     test_ret += test_xmlGetDocCompressMode();
24245     test_ret += test_xmlGetIntSubset();
24246     test_ret += test_xmlGetLastChild();
24247     test_ret += test_xmlGetLineNo();
24248     test_ret += test_xmlGetNoNsProp();
24249     test_ret += test_xmlGetNodePath();
24250     test_ret += test_xmlGetNsList();
24251     test_ret += test_xmlGetNsProp();
24252     test_ret += test_xmlGetProp();
24253     test_ret += test_xmlHasNsProp();
24254     test_ret += test_xmlHasProp();
24255     test_ret += test_xmlIsBlankNode();
24256     test_ret += test_xmlIsXHTML();
24257     test_ret += test_xmlLastElementChild();
24258     test_ret += test_xmlNewCDataBlock();
24259     test_ret += test_xmlNewCharRef();
24260     test_ret += test_xmlNewChild();
24261     test_ret += test_xmlNewComment();
24262     test_ret += test_xmlNewDoc();
24263     test_ret += test_xmlNewDocComment();
24264     test_ret += test_xmlNewDocFragment();
24265     test_ret += test_xmlNewDocNode();
24266     test_ret += test_xmlNewDocNodeEatName();
24267     test_ret += test_xmlNewDocPI();
24268     test_ret += test_xmlNewDocProp();
24269     test_ret += test_xmlNewDocRawNode();
24270     test_ret += test_xmlNewDocText();
24271     test_ret += test_xmlNewDocTextLen();
24272     test_ret += test_xmlNewDtd();
24273     test_ret += test_xmlNewNode();
24274     test_ret += test_xmlNewNodeEatName();
24275     test_ret += test_xmlNewNs();
24276     test_ret += test_xmlNewNsProp();
24277     test_ret += test_xmlNewNsPropEatName();
24278     test_ret += test_xmlNewPI();
24279     test_ret += test_xmlNewProp();
24280     test_ret += test_xmlNewReference();
24281     test_ret += test_xmlNewText();
24282     test_ret += test_xmlNewTextChild();
24283     test_ret += test_xmlNewTextLen();
24284     test_ret += test_xmlNextElementSibling();
24285     test_ret += test_xmlNodeAddContent();
24286     test_ret += test_xmlNodeAddContentLen();
24287     test_ret += test_xmlNodeBufGetContent();
24288     test_ret += test_xmlNodeDump();
24289     test_ret += test_xmlNodeDumpOutput();
24290     test_ret += test_xmlNodeGetBase();
24291     test_ret += test_xmlNodeGetContent();
24292     test_ret += test_xmlNodeGetLang();
24293     test_ret += test_xmlNodeGetSpacePreserve();
24294     test_ret += test_xmlNodeIsText();
24295     test_ret += test_xmlNodeListGetRawString();
24296     test_ret += test_xmlNodeListGetString();
24297     test_ret += test_xmlNodeSetBase();
24298     test_ret += test_xmlNodeSetContent();
24299     test_ret += test_xmlNodeSetContentLen();
24300     test_ret += test_xmlNodeSetLang();
24301     test_ret += test_xmlNodeSetName();
24302     test_ret += test_xmlNodeSetSpacePreserve();
24303     test_ret += test_xmlPreviousElementSibling();
24304     test_ret += test_xmlReconciliateNs();
24305     test_ret += test_xmlRemoveProp();
24306     test_ret += test_xmlReplaceNode();
24307     test_ret += test_xmlSaveFile();
24308     test_ret += test_xmlSaveFileEnc();
24309     test_ret += test_xmlSaveFileTo();
24310     test_ret += test_xmlSaveFormatFile();
24311     test_ret += test_xmlSaveFormatFileEnc();
24312     test_ret += test_xmlSaveFormatFileTo();
24313     test_ret += test_xmlSearchNs();
24314     test_ret += test_xmlSearchNsByHref();
24315     test_ret += test_xmlSetBufferAllocationScheme();
24316     test_ret += test_xmlSetCompressMode();
24317     test_ret += test_xmlSetDocCompressMode();
24318     test_ret += test_xmlSetNs();
24319     test_ret += test_xmlSetNsProp();
24320     test_ret += test_xmlSetProp();
24321     test_ret += test_xmlSplitQName2();
24322     test_ret += test_xmlSplitQName3();
24323     test_ret += test_xmlStringGetNodeList();
24324     test_ret += test_xmlStringLenGetNodeList();
24325     test_ret += test_xmlTextConcat();
24326     test_ret += test_xmlTextMerge();
24327     test_ret += test_xmlUnsetNsProp();
24328     test_ret += test_xmlUnsetProp();
24329     test_ret += test_xmlValidateNCName();
24330     test_ret += test_xmlValidateNMToken();
24331     test_ret += test_xmlValidateName();
24332     test_ret += test_xmlValidateQName();
24333
24334     if (test_ret != 0)
24335         printf("Module tree: %d errors\n", test_ret);
24336     return(test_ret);
24337 }
24338
24339 static int
24340 test_xmlBuildRelativeURI(void) {
24341     int test_ret = 0;
24342
24343     int mem_base;
24344     xmlChar * ret_val;
24345     xmlChar * URI; /* the URI reference under consideration */
24346     int n_URI;
24347     xmlChar * base; /* the base value */
24348     int n_base;
24349
24350     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24351     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24352         mem_base = xmlMemBlocks();
24353         URI = gen_const_xmlChar_ptr(n_URI, 0);
24354         base = gen_const_xmlChar_ptr(n_base, 1);
24355
24356         ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24357         desret_xmlChar_ptr(ret_val);
24358         call_tests++;
24359         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24360         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24361         xmlResetLastError();
24362         if (mem_base != xmlMemBlocks()) {
24363             printf("Leak of %d blocks found in xmlBuildRelativeURI",
24364                    xmlMemBlocks() - mem_base);
24365             test_ret++;
24366             printf(" %d", n_URI);
24367             printf(" %d", n_base);
24368             printf("\n");
24369         }
24370     }
24371     }
24372     function_tests++;
24373
24374     return(test_ret);
24375 }
24376
24377
24378 static int
24379 test_xmlBuildURI(void) {
24380     int test_ret = 0;
24381
24382     int mem_base;
24383     xmlChar * ret_val;
24384     xmlChar * URI; /* the URI instance found in the document */
24385     int n_URI;
24386     xmlChar * base; /* the base value */
24387     int n_base;
24388
24389     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24390     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24391         mem_base = xmlMemBlocks();
24392         URI = gen_const_xmlChar_ptr(n_URI, 0);
24393         base = gen_const_xmlChar_ptr(n_base, 1);
24394
24395         ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24396         desret_xmlChar_ptr(ret_val);
24397         call_tests++;
24398         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24399         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24400         xmlResetLastError();
24401         if (mem_base != xmlMemBlocks()) {
24402             printf("Leak of %d blocks found in xmlBuildURI",
24403                    xmlMemBlocks() - mem_base);
24404             test_ret++;
24405             printf(" %d", n_URI);
24406             printf(" %d", n_base);
24407             printf("\n");
24408         }
24409     }
24410     }
24411     function_tests++;
24412
24413     return(test_ret);
24414 }
24415
24416
24417 static int
24418 test_xmlCanonicPath(void) {
24419     int test_ret = 0;
24420
24421     int mem_base;
24422     xmlChar * ret_val;
24423     xmlChar * path; /* the resource locator in a filesystem notation */
24424     int n_path;
24425
24426     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24427         mem_base = xmlMemBlocks();
24428         path = gen_const_xmlChar_ptr(n_path, 0);
24429
24430         ret_val = xmlCanonicPath((const xmlChar *)path);
24431         desret_xmlChar_ptr(ret_val);
24432         call_tests++;
24433         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24434         xmlResetLastError();
24435         if (mem_base != xmlMemBlocks()) {
24436             printf("Leak of %d blocks found in xmlCanonicPath",
24437                    xmlMemBlocks() - mem_base);
24438             test_ret++;
24439             printf(" %d", n_path);
24440             printf("\n");
24441         }
24442     }
24443     function_tests++;
24444
24445     return(test_ret);
24446 }
24447
24448
24449 static int
24450 test_xmlCreateURI(void) {
24451     int test_ret = 0;
24452
24453
24454     /* missing type support */
24455     return(test_ret);
24456 }
24457
24458
24459 static int
24460 test_xmlNormalizeURIPath(void) {
24461     int test_ret = 0;
24462
24463     int mem_base;
24464     int ret_val;
24465     char * path; /* pointer to the path string */
24466     int n_path;
24467
24468     for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24469         mem_base = xmlMemBlocks();
24470         path = gen_char_ptr(n_path, 0);
24471
24472         ret_val = xmlNormalizeURIPath(path);
24473         desret_int(ret_val);
24474         call_tests++;
24475         des_char_ptr(n_path, path, 0);
24476         xmlResetLastError();
24477         if (mem_base != xmlMemBlocks()) {
24478             printf("Leak of %d blocks found in xmlNormalizeURIPath",
24479                    xmlMemBlocks() - mem_base);
24480             test_ret++;
24481             printf(" %d", n_path);
24482             printf("\n");
24483         }
24484     }
24485     function_tests++;
24486
24487     return(test_ret);
24488 }
24489
24490
24491 static int
24492 test_xmlParseURI(void) {
24493     int test_ret = 0;
24494
24495
24496     /* missing type support */
24497     return(test_ret);
24498 }
24499
24500
24501 static int
24502 test_xmlParseURIRaw(void) {
24503     int test_ret = 0;
24504
24505
24506     /* missing type support */
24507     return(test_ret);
24508 }
24509
24510
24511 #define gen_nb_xmlURIPtr 1
24512 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24513     return(NULL);
24514 }
24515 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24516 }
24517
24518 static int
24519 test_xmlParseURIReference(void) {
24520     int test_ret = 0;
24521
24522     int mem_base;
24523     int ret_val;
24524     xmlURIPtr uri; /* pointer to an URI structure */
24525     int n_uri;
24526     char * str; /* the string to analyze */
24527     int n_str;
24528
24529     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24530     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24531         mem_base = xmlMemBlocks();
24532         uri = gen_xmlURIPtr(n_uri, 0);
24533         str = gen_const_char_ptr(n_str, 1);
24534
24535         ret_val = xmlParseURIReference(uri, (const char *)str);
24536         desret_int(ret_val);
24537         call_tests++;
24538         des_xmlURIPtr(n_uri, uri, 0);
24539         des_const_char_ptr(n_str, (const char *)str, 1);
24540         xmlResetLastError();
24541         if (mem_base != xmlMemBlocks()) {
24542             printf("Leak of %d blocks found in xmlParseURIReference",
24543                    xmlMemBlocks() - mem_base);
24544             test_ret++;
24545             printf(" %d", n_uri);
24546             printf(" %d", n_str);
24547             printf("\n");
24548         }
24549     }
24550     }
24551     function_tests++;
24552
24553     return(test_ret);
24554 }
24555
24556
24557 static int
24558 test_xmlPathToURI(void) {
24559     int test_ret = 0;
24560
24561     int mem_base;
24562     xmlChar * ret_val;
24563     xmlChar * path; /* the resource locator in a filesystem notation */
24564     int n_path;
24565
24566     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24567         mem_base = xmlMemBlocks();
24568         path = gen_const_xmlChar_ptr(n_path, 0);
24569
24570         ret_val = xmlPathToURI((const xmlChar *)path);
24571         desret_xmlChar_ptr(ret_val);
24572         call_tests++;
24573         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24574         xmlResetLastError();
24575         if (mem_base != xmlMemBlocks()) {
24576             printf("Leak of %d blocks found in xmlPathToURI",
24577                    xmlMemBlocks() - mem_base);
24578             test_ret++;
24579             printf(" %d", n_path);
24580             printf("\n");
24581         }
24582     }
24583     function_tests++;
24584
24585     return(test_ret);
24586 }
24587
24588
24589 static int
24590 test_xmlPrintURI(void) {
24591     int test_ret = 0;
24592
24593     int mem_base;
24594     FILE * stream; /* a FILE* for the output */
24595     int n_stream;
24596     xmlURIPtr uri; /* pointer to an xmlURI */
24597     int n_uri;
24598
24599     for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24600     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24601         mem_base = xmlMemBlocks();
24602         stream = gen_FILE_ptr(n_stream, 0);
24603         uri = gen_xmlURIPtr(n_uri, 1);
24604
24605         xmlPrintURI(stream, uri);
24606         call_tests++;
24607         des_FILE_ptr(n_stream, stream, 0);
24608         des_xmlURIPtr(n_uri, uri, 1);
24609         xmlResetLastError();
24610         if (mem_base != xmlMemBlocks()) {
24611             printf("Leak of %d blocks found in xmlPrintURI",
24612                    xmlMemBlocks() - mem_base);
24613             test_ret++;
24614             printf(" %d", n_stream);
24615             printf(" %d", n_uri);
24616             printf("\n");
24617         }
24618     }
24619     }
24620     function_tests++;
24621
24622     return(test_ret);
24623 }
24624
24625
24626 static int
24627 test_xmlSaveUri(void) {
24628     int test_ret = 0;
24629
24630     int mem_base;
24631     xmlChar * ret_val;
24632     xmlURIPtr uri; /* pointer to an xmlURI */
24633     int n_uri;
24634
24635     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24636         mem_base = xmlMemBlocks();
24637         uri = gen_xmlURIPtr(n_uri, 0);
24638
24639         ret_val = xmlSaveUri(uri);
24640         desret_xmlChar_ptr(ret_val);
24641         call_tests++;
24642         des_xmlURIPtr(n_uri, uri, 0);
24643         xmlResetLastError();
24644         if (mem_base != xmlMemBlocks()) {
24645             printf("Leak of %d blocks found in xmlSaveUri",
24646                    xmlMemBlocks() - mem_base);
24647             test_ret++;
24648             printf(" %d", n_uri);
24649             printf("\n");
24650         }
24651     }
24652     function_tests++;
24653
24654     return(test_ret);
24655 }
24656
24657
24658 static int
24659 test_xmlURIEscape(void) {
24660     int test_ret = 0;
24661
24662     int mem_base;
24663     xmlChar * ret_val;
24664     xmlChar * str; /* the string of the URI to escape */
24665     int n_str;
24666
24667     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24668         mem_base = xmlMemBlocks();
24669         str = gen_const_xmlChar_ptr(n_str, 0);
24670
24671         ret_val = xmlURIEscape((const xmlChar *)str);
24672         desret_xmlChar_ptr(ret_val);
24673         call_tests++;
24674         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24675         xmlResetLastError();
24676         if (mem_base != xmlMemBlocks()) {
24677             printf("Leak of %d blocks found in xmlURIEscape",
24678                    xmlMemBlocks() - mem_base);
24679             test_ret++;
24680             printf(" %d", n_str);
24681             printf("\n");
24682         }
24683     }
24684     function_tests++;
24685
24686     return(test_ret);
24687 }
24688
24689
24690 static int
24691 test_xmlURIEscapeStr(void) {
24692     int test_ret = 0;
24693
24694     int mem_base;
24695     xmlChar * ret_val;
24696     xmlChar * str; /* string to escape */
24697     int n_str;
24698     xmlChar * list; /* exception list string of chars not to escape */
24699     int n_list;
24700
24701     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24702     for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24703         mem_base = xmlMemBlocks();
24704         str = gen_const_xmlChar_ptr(n_str, 0);
24705         list = gen_const_xmlChar_ptr(n_list, 1);
24706
24707         ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24708         desret_xmlChar_ptr(ret_val);
24709         call_tests++;
24710         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24711         des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24712         xmlResetLastError();
24713         if (mem_base != xmlMemBlocks()) {
24714             printf("Leak of %d blocks found in xmlURIEscapeStr",
24715                    xmlMemBlocks() - mem_base);
24716             test_ret++;
24717             printf(" %d", n_str);
24718             printf(" %d", n_list);
24719             printf("\n");
24720         }
24721     }
24722     }
24723     function_tests++;
24724
24725     return(test_ret);
24726 }
24727
24728
24729 static int
24730 test_xmlURIUnescapeString(void) {
24731     int test_ret = 0;
24732
24733
24734     /* missing type support */
24735     return(test_ret);
24736 }
24737
24738 static int
24739 test_uri(void) {
24740     int test_ret = 0;
24741
24742     if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24743     test_ret += test_xmlBuildRelativeURI();
24744     test_ret += test_xmlBuildURI();
24745     test_ret += test_xmlCanonicPath();
24746     test_ret += test_xmlCreateURI();
24747     test_ret += test_xmlNormalizeURIPath();
24748     test_ret += test_xmlParseURI();
24749     test_ret += test_xmlParseURIRaw();
24750     test_ret += test_xmlParseURIReference();
24751     test_ret += test_xmlPathToURI();
24752     test_ret += test_xmlPrintURI();
24753     test_ret += test_xmlSaveUri();
24754     test_ret += test_xmlURIEscape();
24755     test_ret += test_xmlURIEscapeStr();
24756     test_ret += test_xmlURIUnescapeString();
24757
24758     if (test_ret != 0)
24759         printf("Module uri: %d errors\n", test_ret);
24760     return(test_ret);
24761 }
24762
24763 static int
24764 test_xmlAddAttributeDecl(void) {
24765     int test_ret = 0;
24766
24767     int mem_base;
24768     xmlAttributePtr ret_val;
24769     xmlValidCtxtPtr ctxt; /* the validation context */
24770     int n_ctxt;
24771     xmlDtdPtr dtd; /* pointer to the DTD */
24772     int n_dtd;
24773     xmlChar * elem; /* the element name */
24774     int n_elem;
24775     xmlChar * name; /* the attribute name */
24776     int n_name;
24777     xmlChar * ns; /* the attribute namespace prefix */
24778     int n_ns;
24779     xmlAttributeType type; /* the attribute type */
24780     int n_type;
24781     xmlAttributeDefault def; /* the attribute default type */
24782     int n_def;
24783     xmlChar * defaultValue; /* the attribute default value */
24784     int n_defaultValue;
24785     xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24786     int n_tree;
24787
24788     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24789     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24790     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24791     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24792     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24793     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24794     for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24795     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24796     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24797         mem_base = xmlMemBlocks();
24798         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24799         dtd = gen_xmlDtdPtr(n_dtd, 1);
24800         elem = gen_const_xmlChar_ptr(n_elem, 2);
24801         name = gen_const_xmlChar_ptr(n_name, 3);
24802         ns = gen_const_xmlChar_ptr(n_ns, 4);
24803         type = gen_xmlAttributeType(n_type, 5);
24804         def = gen_xmlAttributeDefault(n_def, 6);
24805         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24806         tree = gen_xmlEnumerationPtr(n_tree, 8);
24807
24808         ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24809         desret_xmlAttributePtr(ret_val);
24810         call_tests++;
24811         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24812         des_xmlDtdPtr(n_dtd, dtd, 1);
24813         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24814         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24815         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24816         des_xmlAttributeType(n_type, type, 5);
24817         des_xmlAttributeDefault(n_def, def, 6);
24818         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24819         des_xmlEnumerationPtr(n_tree, tree, 8);
24820         xmlResetLastError();
24821         if (mem_base != xmlMemBlocks()) {
24822             printf("Leak of %d blocks found in xmlAddAttributeDecl",
24823                    xmlMemBlocks() - mem_base);
24824             test_ret++;
24825             printf(" %d", n_ctxt);
24826             printf(" %d", n_dtd);
24827             printf(" %d", n_elem);
24828             printf(" %d", n_name);
24829             printf(" %d", n_ns);
24830             printf(" %d", n_type);
24831             printf(" %d", n_def);
24832             printf(" %d", n_defaultValue);
24833             printf(" %d", n_tree);
24834             printf("\n");
24835         }
24836     }
24837     }
24838     }
24839     }
24840     }
24841     }
24842     }
24843     }
24844     }
24845     function_tests++;
24846
24847     return(test_ret);
24848 }
24849
24850
24851 static int
24852 test_xmlAddElementDecl(void) {
24853     int test_ret = 0;
24854
24855     int mem_base;
24856     xmlElementPtr ret_val;
24857     xmlValidCtxtPtr ctxt; /* the validation context */
24858     int n_ctxt;
24859     xmlDtdPtr dtd; /* pointer to the DTD */
24860     int n_dtd;
24861     xmlChar * name; /* the entity name */
24862     int n_name;
24863     xmlElementTypeVal type; /* the element type */
24864     int n_type;
24865     xmlElementContentPtr content; /* the element content tree or NULL */
24866     int n_content;
24867
24868     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24869     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24870     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24871     for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24872     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24873         mem_base = xmlMemBlocks();
24874         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24875         dtd = gen_xmlDtdPtr(n_dtd, 1);
24876         name = gen_const_xmlChar_ptr(n_name, 2);
24877         type = gen_xmlElementTypeVal(n_type, 3);
24878         content = gen_xmlElementContentPtr(n_content, 4);
24879
24880         ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24881         desret_xmlElementPtr(ret_val);
24882         call_tests++;
24883         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24884         des_xmlDtdPtr(n_dtd, dtd, 1);
24885         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24886         des_xmlElementTypeVal(n_type, type, 3);
24887         des_xmlElementContentPtr(n_content, content, 4);
24888         xmlResetLastError();
24889         if (mem_base != xmlMemBlocks()) {
24890             printf("Leak of %d blocks found in xmlAddElementDecl",
24891                    xmlMemBlocks() - mem_base);
24892             test_ret++;
24893             printf(" %d", n_ctxt);
24894             printf(" %d", n_dtd);
24895             printf(" %d", n_name);
24896             printf(" %d", n_type);
24897             printf(" %d", n_content);
24898             printf("\n");
24899         }
24900     }
24901     }
24902     }
24903     }
24904     }
24905     function_tests++;
24906
24907     return(test_ret);
24908 }
24909
24910
24911 static int
24912 test_xmlAddID(void) {
24913     int test_ret = 0;
24914
24915
24916     /* missing type support */
24917     return(test_ret);
24918 }
24919
24920
24921 static int
24922 test_xmlAddNotationDecl(void) {
24923     int test_ret = 0;
24924
24925
24926     /* missing type support */
24927     return(test_ret);
24928 }
24929
24930
24931 static int
24932 test_xmlAddRef(void) {
24933     int test_ret = 0;
24934
24935
24936     /* missing type support */
24937     return(test_ret);
24938 }
24939
24940
24941 #define gen_nb_xmlAttributeTablePtr 1
24942 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24943     return(NULL);
24944 }
24945 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24946 }
24947
24948 static int
24949 test_xmlCopyAttributeTable(void) {
24950     int test_ret = 0;
24951
24952
24953     /* missing type support */
24954     return(test_ret);
24955 }
24956
24957
24958 static int
24959 test_xmlCopyDocElementContent(void) {
24960     int test_ret = 0;
24961
24962     int mem_base;
24963     xmlElementContentPtr ret_val;
24964     xmlDocPtr doc; /* the document owning the element declaration */
24965     int n_doc;
24966     xmlElementContentPtr cur; /* An element content pointer. */
24967     int n_cur;
24968
24969     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24970     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24971         mem_base = xmlMemBlocks();
24972         doc = gen_xmlDocPtr(n_doc, 0);
24973         cur = gen_xmlElementContentPtr(n_cur, 1);
24974
24975         ret_val = xmlCopyDocElementContent(doc, cur);
24976         desret_xmlElementContentPtr(ret_val);
24977         call_tests++;
24978         des_xmlDocPtr(n_doc, doc, 0);
24979         des_xmlElementContentPtr(n_cur, cur, 1);
24980         xmlResetLastError();
24981         if (mem_base != xmlMemBlocks()) {
24982             printf("Leak of %d blocks found in xmlCopyDocElementContent",
24983                    xmlMemBlocks() - mem_base);
24984             test_ret++;
24985             printf(" %d", n_doc);
24986             printf(" %d", n_cur);
24987             printf("\n");
24988         }
24989     }
24990     }
24991     function_tests++;
24992
24993     return(test_ret);
24994 }
24995
24996
24997 static int
24998 test_xmlCopyElementContent(void) {
24999     int test_ret = 0;
25000
25001     int mem_base;
25002     xmlElementContentPtr ret_val;
25003     xmlElementContentPtr cur; /* An element content pointer. */
25004     int n_cur;
25005
25006     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25007         mem_base = xmlMemBlocks();
25008         cur = gen_xmlElementContentPtr(n_cur, 0);
25009
25010         ret_val = xmlCopyElementContent(cur);
25011         desret_xmlElementContentPtr(ret_val);
25012         call_tests++;
25013         des_xmlElementContentPtr(n_cur, cur, 0);
25014         xmlResetLastError();
25015         if (mem_base != xmlMemBlocks()) {
25016             printf("Leak of %d blocks found in xmlCopyElementContent",
25017                    xmlMemBlocks() - mem_base);
25018             test_ret++;
25019             printf(" %d", n_cur);
25020             printf("\n");
25021         }
25022     }
25023     function_tests++;
25024
25025     return(test_ret);
25026 }
25027
25028
25029 #define gen_nb_xmlElementTablePtr 1
25030 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25031     return(NULL);
25032 }
25033 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25034 }
25035
25036 static int
25037 test_xmlCopyElementTable(void) {
25038     int test_ret = 0;
25039
25040
25041     /* missing type support */
25042     return(test_ret);
25043 }
25044
25045
25046 static int
25047 test_xmlCopyEnumeration(void) {
25048     int test_ret = 0;
25049
25050
25051     /* missing type support */
25052     return(test_ret);
25053 }
25054
25055
25056 #define gen_nb_xmlNotationTablePtr 1
25057 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25058     return(NULL);
25059 }
25060 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25061 }
25062
25063 static int
25064 test_xmlCopyNotationTable(void) {
25065     int test_ret = 0;
25066
25067
25068     /* missing type support */
25069     return(test_ret);
25070 }
25071
25072
25073 static int
25074 test_xmlCreateEnumeration(void) {
25075     int test_ret = 0;
25076
25077
25078     /* missing type support */
25079     return(test_ret);
25080 }
25081
25082
25083 #define gen_nb_xmlAttributePtr 1
25084 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25085     return(NULL);
25086 }
25087 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25088 }
25089
25090 static int
25091 test_xmlDumpAttributeDecl(void) {
25092     int test_ret = 0;
25093
25094 #if defined(LIBXML_OUTPUT_ENABLED)
25095     int mem_base;
25096     xmlBufferPtr buf; /* the XML buffer output */
25097     int n_buf;
25098     xmlAttributePtr attr; /* An attribute declaration */
25099     int n_attr;
25100
25101     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25102     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25103         mem_base = xmlMemBlocks();
25104         buf = gen_xmlBufferPtr(n_buf, 0);
25105         attr = gen_xmlAttributePtr(n_attr, 1);
25106
25107         xmlDumpAttributeDecl(buf, attr);
25108         call_tests++;
25109         des_xmlBufferPtr(n_buf, buf, 0);
25110         des_xmlAttributePtr(n_attr, attr, 1);
25111         xmlResetLastError();
25112         if (mem_base != xmlMemBlocks()) {
25113             printf("Leak of %d blocks found in xmlDumpAttributeDecl",
25114                    xmlMemBlocks() - mem_base);
25115             test_ret++;
25116             printf(" %d", n_buf);
25117             printf(" %d", n_attr);
25118             printf("\n");
25119         }
25120     }
25121     }
25122     function_tests++;
25123 #endif
25124
25125     return(test_ret);
25126 }
25127
25128
25129 static int
25130 test_xmlDumpAttributeTable(void) {
25131     int test_ret = 0;
25132
25133 #if defined(LIBXML_OUTPUT_ENABLED)
25134     int mem_base;
25135     xmlBufferPtr buf; /* the XML buffer output */
25136     int n_buf;
25137     xmlAttributeTablePtr table; /* An attribute table */
25138     int n_table;
25139
25140     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25141     for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
25142         mem_base = xmlMemBlocks();
25143         buf = gen_xmlBufferPtr(n_buf, 0);
25144         table = gen_xmlAttributeTablePtr(n_table, 1);
25145
25146         xmlDumpAttributeTable(buf, table);
25147         call_tests++;
25148         des_xmlBufferPtr(n_buf, buf, 0);
25149         des_xmlAttributeTablePtr(n_table, table, 1);
25150         xmlResetLastError();
25151         if (mem_base != xmlMemBlocks()) {
25152             printf("Leak of %d blocks found in xmlDumpAttributeTable",
25153                    xmlMemBlocks() - mem_base);
25154             test_ret++;
25155             printf(" %d", n_buf);
25156             printf(" %d", n_table);
25157             printf("\n");
25158         }
25159     }
25160     }
25161     function_tests++;
25162 #endif
25163
25164     return(test_ret);
25165 }
25166
25167
25168 #define gen_nb_xmlElementPtr 1
25169 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25170     return(NULL);
25171 }
25172 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25173 }
25174
25175 static int
25176 test_xmlDumpElementDecl(void) {
25177     int test_ret = 0;
25178
25179 #if defined(LIBXML_OUTPUT_ENABLED)
25180     int mem_base;
25181     xmlBufferPtr buf; /* the XML buffer output */
25182     int n_buf;
25183     xmlElementPtr elem; /* An element table */
25184     int n_elem;
25185
25186     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25187     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25188         mem_base = xmlMemBlocks();
25189         buf = gen_xmlBufferPtr(n_buf, 0);
25190         elem = gen_xmlElementPtr(n_elem, 1);
25191
25192         xmlDumpElementDecl(buf, elem);
25193         call_tests++;
25194         des_xmlBufferPtr(n_buf, buf, 0);
25195         des_xmlElementPtr(n_elem, elem, 1);
25196         xmlResetLastError();
25197         if (mem_base != xmlMemBlocks()) {
25198             printf("Leak of %d blocks found in xmlDumpElementDecl",
25199                    xmlMemBlocks() - mem_base);
25200             test_ret++;
25201             printf(" %d", n_buf);
25202             printf(" %d", n_elem);
25203             printf("\n");
25204         }
25205     }
25206     }
25207     function_tests++;
25208 #endif
25209
25210     return(test_ret);
25211 }
25212
25213
25214 static int
25215 test_xmlDumpElementTable(void) {
25216     int test_ret = 0;
25217
25218 #if defined(LIBXML_OUTPUT_ENABLED)
25219     int mem_base;
25220     xmlBufferPtr buf; /* the XML buffer output */
25221     int n_buf;
25222     xmlElementTablePtr table; /* An element table */
25223     int n_table;
25224
25225     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25226     for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25227         mem_base = xmlMemBlocks();
25228         buf = gen_xmlBufferPtr(n_buf, 0);
25229         table = gen_xmlElementTablePtr(n_table, 1);
25230
25231         xmlDumpElementTable(buf, table);
25232         call_tests++;
25233         des_xmlBufferPtr(n_buf, buf, 0);
25234         des_xmlElementTablePtr(n_table, table, 1);
25235         xmlResetLastError();
25236         if (mem_base != xmlMemBlocks()) {
25237             printf("Leak of %d blocks found in xmlDumpElementTable",
25238                    xmlMemBlocks() - mem_base);
25239             test_ret++;
25240             printf(" %d", n_buf);
25241             printf(" %d", n_table);
25242             printf("\n");
25243         }
25244     }
25245     }
25246     function_tests++;
25247 #endif
25248
25249     return(test_ret);
25250 }
25251
25252
25253 #define gen_nb_xmlNotationPtr 1
25254 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25255     return(NULL);
25256 }
25257 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25258 }
25259
25260 static int
25261 test_xmlDumpNotationDecl(void) {
25262     int test_ret = 0;
25263
25264 #if defined(LIBXML_OUTPUT_ENABLED)
25265     int mem_base;
25266     xmlBufferPtr buf; /* the XML buffer output */
25267     int n_buf;
25268     xmlNotationPtr nota; /* A notation declaration */
25269     int n_nota;
25270
25271     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25272     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25273         mem_base = xmlMemBlocks();
25274         buf = gen_xmlBufferPtr(n_buf, 0);
25275         nota = gen_xmlNotationPtr(n_nota, 1);
25276
25277         xmlDumpNotationDecl(buf, nota);
25278         call_tests++;
25279         des_xmlBufferPtr(n_buf, buf, 0);
25280         des_xmlNotationPtr(n_nota, nota, 1);
25281         xmlResetLastError();
25282         if (mem_base != xmlMemBlocks()) {
25283             printf("Leak of %d blocks found in xmlDumpNotationDecl",
25284                    xmlMemBlocks() - mem_base);
25285             test_ret++;
25286             printf(" %d", n_buf);
25287             printf(" %d", n_nota);
25288             printf("\n");
25289         }
25290     }
25291     }
25292     function_tests++;
25293 #endif
25294
25295     return(test_ret);
25296 }
25297
25298
25299 static int
25300 test_xmlDumpNotationTable(void) {
25301     int test_ret = 0;
25302
25303 #if defined(LIBXML_OUTPUT_ENABLED)
25304     int mem_base;
25305     xmlBufferPtr buf; /* the XML buffer output */
25306     int n_buf;
25307     xmlNotationTablePtr table; /* A notation table */
25308     int n_table;
25309
25310     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25311     for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25312         mem_base = xmlMemBlocks();
25313         buf = gen_xmlBufferPtr(n_buf, 0);
25314         table = gen_xmlNotationTablePtr(n_table, 1);
25315
25316         xmlDumpNotationTable(buf, table);
25317         call_tests++;
25318         des_xmlBufferPtr(n_buf, buf, 0);
25319         des_xmlNotationTablePtr(n_table, table, 1);
25320         xmlResetLastError();
25321         if (mem_base != xmlMemBlocks()) {
25322             printf("Leak of %d blocks found in xmlDumpNotationTable",
25323                    xmlMemBlocks() - mem_base);
25324             test_ret++;
25325             printf(" %d", n_buf);
25326             printf(" %d", n_table);
25327             printf("\n");
25328         }
25329     }
25330     }
25331     function_tests++;
25332 #endif
25333
25334     return(test_ret);
25335 }
25336
25337
25338 static int
25339 test_xmlGetDtdAttrDesc(void) {
25340     int test_ret = 0;
25341
25342     int mem_base;
25343     xmlAttributePtr ret_val;
25344     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25345     int n_dtd;
25346     xmlChar * elem; /* the element name */
25347     int n_elem;
25348     xmlChar * name; /* the attribute name */
25349     int n_name;
25350
25351     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25352     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25353     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25354         mem_base = xmlMemBlocks();
25355         dtd = gen_xmlDtdPtr(n_dtd, 0);
25356         elem = gen_const_xmlChar_ptr(n_elem, 1);
25357         name = gen_const_xmlChar_ptr(n_name, 2);
25358
25359         ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25360         desret_xmlAttributePtr(ret_val);
25361         call_tests++;
25362         des_xmlDtdPtr(n_dtd, dtd, 0);
25363         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25364         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25365         xmlResetLastError();
25366         if (mem_base != xmlMemBlocks()) {
25367             printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25368                    xmlMemBlocks() - mem_base);
25369             test_ret++;
25370             printf(" %d", n_dtd);
25371             printf(" %d", n_elem);
25372             printf(" %d", n_name);
25373             printf("\n");
25374         }
25375     }
25376     }
25377     }
25378     function_tests++;
25379
25380     return(test_ret);
25381 }
25382
25383
25384 static int
25385 test_xmlGetDtdElementDesc(void) {
25386     int test_ret = 0;
25387
25388     int mem_base;
25389     xmlElementPtr ret_val;
25390     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25391     int n_dtd;
25392     xmlChar * name; /* the element name */
25393     int n_name;
25394
25395     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25396     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25397         mem_base = xmlMemBlocks();
25398         dtd = gen_xmlDtdPtr(n_dtd, 0);
25399         name = gen_const_xmlChar_ptr(n_name, 1);
25400
25401         ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25402         desret_xmlElementPtr(ret_val);
25403         call_tests++;
25404         des_xmlDtdPtr(n_dtd, dtd, 0);
25405         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25406         xmlResetLastError();
25407         if (mem_base != xmlMemBlocks()) {
25408             printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25409                    xmlMemBlocks() - mem_base);
25410             test_ret++;
25411             printf(" %d", n_dtd);
25412             printf(" %d", n_name);
25413             printf("\n");
25414         }
25415     }
25416     }
25417     function_tests++;
25418
25419     return(test_ret);
25420 }
25421
25422
25423 static int
25424 test_xmlGetDtdNotationDesc(void) {
25425     int test_ret = 0;
25426
25427
25428     /* missing type support */
25429     return(test_ret);
25430 }
25431
25432
25433 static int
25434 test_xmlGetDtdQAttrDesc(void) {
25435     int test_ret = 0;
25436
25437     int mem_base;
25438     xmlAttributePtr ret_val;
25439     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25440     int n_dtd;
25441     xmlChar * elem; /* the element name */
25442     int n_elem;
25443     xmlChar * name; /* the attribute name */
25444     int n_name;
25445     xmlChar * prefix; /* the attribute namespace prefix */
25446     int n_prefix;
25447
25448     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25449     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25450     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25451     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25452         mem_base = xmlMemBlocks();
25453         dtd = gen_xmlDtdPtr(n_dtd, 0);
25454         elem = gen_const_xmlChar_ptr(n_elem, 1);
25455         name = gen_const_xmlChar_ptr(n_name, 2);
25456         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25457
25458         ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25459         desret_xmlAttributePtr(ret_val);
25460         call_tests++;
25461         des_xmlDtdPtr(n_dtd, dtd, 0);
25462         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25463         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25464         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25465         xmlResetLastError();
25466         if (mem_base != xmlMemBlocks()) {
25467             printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25468                    xmlMemBlocks() - mem_base);
25469             test_ret++;
25470             printf(" %d", n_dtd);
25471             printf(" %d", n_elem);
25472             printf(" %d", n_name);
25473             printf(" %d", n_prefix);
25474             printf("\n");
25475         }
25476     }
25477     }
25478     }
25479     }
25480     function_tests++;
25481
25482     return(test_ret);
25483 }
25484
25485
25486 static int
25487 test_xmlGetDtdQElementDesc(void) {
25488     int test_ret = 0;
25489
25490     int mem_base;
25491     xmlElementPtr ret_val;
25492     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25493     int n_dtd;
25494     xmlChar * name; /* the element name */
25495     int n_name;
25496     xmlChar * prefix; /* the element namespace prefix */
25497     int n_prefix;
25498
25499     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25500     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25501     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25502         mem_base = xmlMemBlocks();
25503         dtd = gen_xmlDtdPtr(n_dtd, 0);
25504         name = gen_const_xmlChar_ptr(n_name, 1);
25505         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25506
25507         ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25508         desret_xmlElementPtr(ret_val);
25509         call_tests++;
25510         des_xmlDtdPtr(n_dtd, dtd, 0);
25511         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25512         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25513         xmlResetLastError();
25514         if (mem_base != xmlMemBlocks()) {
25515             printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25516                    xmlMemBlocks() - mem_base);
25517             test_ret++;
25518             printf(" %d", n_dtd);
25519             printf(" %d", n_name);
25520             printf(" %d", n_prefix);
25521             printf("\n");
25522         }
25523     }
25524     }
25525     }
25526     function_tests++;
25527
25528     return(test_ret);
25529 }
25530
25531
25532 static int
25533 test_xmlGetID(void) {
25534     int test_ret = 0;
25535
25536     int mem_base;
25537     xmlAttrPtr ret_val;
25538     xmlDocPtr doc; /* pointer to the document */
25539     int n_doc;
25540     xmlChar * ID; /* the ID value */
25541     int n_ID;
25542
25543     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25544     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25545         mem_base = xmlMemBlocks();
25546         doc = gen_xmlDocPtr(n_doc, 0);
25547         ID = gen_const_xmlChar_ptr(n_ID, 1);
25548
25549         ret_val = xmlGetID(doc, (const xmlChar *)ID);
25550         desret_xmlAttrPtr(ret_val);
25551         call_tests++;
25552         des_xmlDocPtr(n_doc, doc, 0);
25553         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25554         xmlResetLastError();
25555         if (mem_base != xmlMemBlocks()) {
25556             printf("Leak of %d blocks found in xmlGetID",
25557                    xmlMemBlocks() - mem_base);
25558             test_ret++;
25559             printf(" %d", n_doc);
25560             printf(" %d", n_ID);
25561             printf("\n");
25562         }
25563     }
25564     }
25565     function_tests++;
25566
25567     return(test_ret);
25568 }
25569
25570
25571 static int
25572 test_xmlGetRefs(void) {
25573     int test_ret = 0;
25574
25575
25576     /* missing type support */
25577     return(test_ret);
25578 }
25579
25580
25581 static int
25582 test_xmlIsID(void) {
25583     int test_ret = 0;
25584
25585     int mem_base;
25586     int ret_val;
25587     xmlDocPtr doc; /* the document */
25588     int n_doc;
25589     xmlNodePtr elem; /* the element carrying the attribute */
25590     int n_elem;
25591     xmlAttrPtr attr; /* the attribute */
25592     int n_attr;
25593
25594     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25595     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25596     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25597         mem_base = xmlMemBlocks();
25598         doc = gen_xmlDocPtr(n_doc, 0);
25599         elem = gen_xmlNodePtr(n_elem, 1);
25600         attr = gen_xmlAttrPtr(n_attr, 2);
25601
25602         ret_val = xmlIsID(doc, elem, attr);
25603         desret_int(ret_val);
25604         call_tests++;
25605         des_xmlDocPtr(n_doc, doc, 0);
25606         des_xmlNodePtr(n_elem, elem, 1);
25607         des_xmlAttrPtr(n_attr, attr, 2);
25608         xmlResetLastError();
25609         if (mem_base != xmlMemBlocks()) {
25610             printf("Leak of %d blocks found in xmlIsID",
25611                    xmlMemBlocks() - mem_base);
25612             test_ret++;
25613             printf(" %d", n_doc);
25614             printf(" %d", n_elem);
25615             printf(" %d", n_attr);
25616             printf("\n");
25617         }
25618     }
25619     }
25620     }
25621     function_tests++;
25622
25623     return(test_ret);
25624 }
25625
25626
25627 static int
25628 test_xmlIsMixedElement(void) {
25629     int test_ret = 0;
25630
25631     int mem_base;
25632     int ret_val;
25633     xmlDocPtr doc; /* the document */
25634     int n_doc;
25635     xmlChar * name; /* the element name */
25636     int n_name;
25637
25638     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25639     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25640         mem_base = xmlMemBlocks();
25641         doc = gen_xmlDocPtr(n_doc, 0);
25642         name = gen_const_xmlChar_ptr(n_name, 1);
25643
25644         ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25645         desret_int(ret_val);
25646         call_tests++;
25647         des_xmlDocPtr(n_doc, doc, 0);
25648         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25649         xmlResetLastError();
25650         if (mem_base != xmlMemBlocks()) {
25651             printf("Leak of %d blocks found in xmlIsMixedElement",
25652                    xmlMemBlocks() - mem_base);
25653             test_ret++;
25654             printf(" %d", n_doc);
25655             printf(" %d", n_name);
25656             printf("\n");
25657         }
25658     }
25659     }
25660     function_tests++;
25661
25662     return(test_ret);
25663 }
25664
25665
25666 static int
25667 test_xmlIsRef(void) {
25668     int test_ret = 0;
25669
25670     int mem_base;
25671     int ret_val;
25672     xmlDocPtr doc; /* the document */
25673     int n_doc;
25674     xmlNodePtr elem; /* the element carrying the attribute */
25675     int n_elem;
25676     xmlAttrPtr attr; /* the attribute */
25677     int n_attr;
25678
25679     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25680     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25681     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25682         mem_base = xmlMemBlocks();
25683         doc = gen_xmlDocPtr(n_doc, 0);
25684         elem = gen_xmlNodePtr(n_elem, 1);
25685         attr = gen_xmlAttrPtr(n_attr, 2);
25686
25687         ret_val = xmlIsRef(doc, elem, attr);
25688         desret_int(ret_val);
25689         call_tests++;
25690         des_xmlDocPtr(n_doc, doc, 0);
25691         des_xmlNodePtr(n_elem, elem, 1);
25692         des_xmlAttrPtr(n_attr, attr, 2);
25693         xmlResetLastError();
25694         if (mem_base != xmlMemBlocks()) {
25695             printf("Leak of %d blocks found in xmlIsRef",
25696                    xmlMemBlocks() - mem_base);
25697             test_ret++;
25698             printf(" %d", n_doc);
25699             printf(" %d", n_elem);
25700             printf(" %d", n_attr);
25701             printf("\n");
25702         }
25703     }
25704     }
25705     }
25706     function_tests++;
25707
25708     return(test_ret);
25709 }
25710
25711
25712 static int
25713 test_xmlNewDocElementContent(void) {
25714     int test_ret = 0;
25715
25716     int mem_base;
25717     xmlElementContentPtr ret_val;
25718     xmlDocPtr doc; /* the document */
25719     int n_doc;
25720     xmlChar * name; /* the subelement name or NULL */
25721     int n_name;
25722     xmlElementContentType type; /* the type of element content decl */
25723     int n_type;
25724
25725     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25726     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25727     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25728         mem_base = xmlMemBlocks();
25729         doc = gen_xmlDocPtr(n_doc, 0);
25730         name = gen_const_xmlChar_ptr(n_name, 1);
25731         type = gen_xmlElementContentType(n_type, 2);
25732
25733         ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25734         xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25735         desret_xmlElementContentPtr(ret_val);
25736         call_tests++;
25737         des_xmlDocPtr(n_doc, doc, 0);
25738         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25739         des_xmlElementContentType(n_type, type, 2);
25740         xmlResetLastError();
25741         if (mem_base != xmlMemBlocks()) {
25742             printf("Leak of %d blocks found in xmlNewDocElementContent",
25743                    xmlMemBlocks() - mem_base);
25744             test_ret++;
25745             printf(" %d", n_doc);
25746             printf(" %d", n_name);
25747             printf(" %d", n_type);
25748             printf("\n");
25749         }
25750     }
25751     }
25752     }
25753     function_tests++;
25754
25755     return(test_ret);
25756 }
25757
25758
25759 static int
25760 test_xmlNewElementContent(void) {
25761     int test_ret = 0;
25762
25763     int mem_base;
25764     xmlElementContentPtr ret_val;
25765     xmlChar * name; /* the subelement name or NULL */
25766     int n_name;
25767     xmlElementContentType type; /* the type of element content decl */
25768     int n_type;
25769
25770     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25771     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25772         mem_base = xmlMemBlocks();
25773         name = gen_const_xmlChar_ptr(n_name, 0);
25774         type = gen_xmlElementContentType(n_type, 1);
25775
25776         ret_val = xmlNewElementContent((const xmlChar *)name, type);
25777         desret_xmlElementContentPtr(ret_val);
25778         call_tests++;
25779         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25780         des_xmlElementContentType(n_type, type, 1);
25781         xmlResetLastError();
25782         if (mem_base != xmlMemBlocks()) {
25783             printf("Leak of %d blocks found in xmlNewElementContent",
25784                    xmlMemBlocks() - mem_base);
25785             test_ret++;
25786             printf(" %d", n_name);
25787             printf(" %d", n_type);
25788             printf("\n");
25789         }
25790     }
25791     }
25792     function_tests++;
25793
25794     return(test_ret);
25795 }
25796
25797
25798 static int
25799 test_xmlNewValidCtxt(void) {
25800     int test_ret = 0;
25801
25802
25803     /* missing type support */
25804     return(test_ret);
25805 }
25806
25807
25808 static int
25809 test_xmlRemoveID(void) {
25810     int test_ret = 0;
25811
25812     int mem_base;
25813     int ret_val;
25814     xmlDocPtr doc; /* the document */
25815     int n_doc;
25816     xmlAttrPtr attr; /* the attribute */
25817     int n_attr;
25818
25819     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25820     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25821         mem_base = xmlMemBlocks();
25822         doc = gen_xmlDocPtr(n_doc, 0);
25823         attr = gen_xmlAttrPtr(n_attr, 1);
25824
25825         ret_val = xmlRemoveID(doc, attr);
25826         desret_int(ret_val);
25827         call_tests++;
25828         des_xmlDocPtr(n_doc, doc, 0);
25829         des_xmlAttrPtr(n_attr, attr, 1);
25830         xmlResetLastError();
25831         if (mem_base != xmlMemBlocks()) {
25832             printf("Leak of %d blocks found in xmlRemoveID",
25833                    xmlMemBlocks() - mem_base);
25834             test_ret++;
25835             printf(" %d", n_doc);
25836             printf(" %d", n_attr);
25837             printf("\n");
25838         }
25839     }
25840     }
25841     function_tests++;
25842
25843     return(test_ret);
25844 }
25845
25846
25847 static int
25848 test_xmlRemoveRef(void) {
25849     int test_ret = 0;
25850
25851     int mem_base;
25852     int ret_val;
25853     xmlDocPtr doc; /* the document */
25854     int n_doc;
25855     xmlAttrPtr attr; /* the attribute */
25856     int n_attr;
25857
25858     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25859     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25860         mem_base = xmlMemBlocks();
25861         doc = gen_xmlDocPtr(n_doc, 0);
25862         attr = gen_xmlAttrPtr(n_attr, 1);
25863
25864         ret_val = xmlRemoveRef(doc, attr);
25865         desret_int(ret_val);
25866         call_tests++;
25867         des_xmlDocPtr(n_doc, doc, 0);
25868         des_xmlAttrPtr(n_attr, attr, 1);
25869         xmlResetLastError();
25870         if (mem_base != xmlMemBlocks()) {
25871             printf("Leak of %d blocks found in xmlRemoveRef",
25872                    xmlMemBlocks() - mem_base);
25873             test_ret++;
25874             printf(" %d", n_doc);
25875             printf(" %d", n_attr);
25876             printf("\n");
25877         }
25878     }
25879     }
25880     function_tests++;
25881
25882     return(test_ret);
25883 }
25884
25885
25886 static int
25887 test_xmlSnprintfElementContent(void) {
25888     int test_ret = 0;
25889
25890     int mem_base;
25891     char * buf; /* an output buffer */
25892     int n_buf;
25893     int size; /* the buffer size */
25894     int n_size;
25895     xmlElementContentPtr content; /* An element table */
25896     int n_content;
25897     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25898     int n_englob;
25899
25900     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25901     for (n_size = 0;n_size < gen_nb_int;n_size++) {
25902     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25903     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25904         mem_base = xmlMemBlocks();
25905         buf = gen_char_ptr(n_buf, 0);
25906         size = gen_int(n_size, 1);
25907         content = gen_xmlElementContentPtr(n_content, 2);
25908         englob = gen_int(n_englob, 3);
25909
25910         xmlSnprintfElementContent(buf, size, content, englob);
25911         call_tests++;
25912         des_char_ptr(n_buf, buf, 0);
25913         des_int(n_size, size, 1);
25914         des_xmlElementContentPtr(n_content, content, 2);
25915         des_int(n_englob, englob, 3);
25916         xmlResetLastError();
25917         if (mem_base != xmlMemBlocks()) {
25918             printf("Leak of %d blocks found in xmlSnprintfElementContent",
25919                    xmlMemBlocks() - mem_base);
25920             test_ret++;
25921             printf(" %d", n_buf);
25922             printf(" %d", n_size);
25923             printf(" %d", n_content);
25924             printf(" %d", n_englob);
25925             printf("\n");
25926         }
25927     }
25928     }
25929     }
25930     }
25931     function_tests++;
25932
25933     return(test_ret);
25934 }
25935
25936
25937 static int
25938 test_xmlSprintfElementContent(void) {
25939     int test_ret = 0;
25940
25941 #if defined(LIBXML_OUTPUT_ENABLED)
25942 #ifdef LIBXML_OUTPUT_ENABLED
25943     int mem_base;
25944     char * buf; /* an output buffer */
25945     int n_buf;
25946     xmlElementContentPtr content; /* An element table */
25947     int n_content;
25948     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25949     int n_englob;
25950
25951     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25952     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25953     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25954         mem_base = xmlMemBlocks();
25955         buf = gen_char_ptr(n_buf, 0);
25956         content = gen_xmlElementContentPtr(n_content, 1);
25957         englob = gen_int(n_englob, 2);
25958
25959         xmlSprintfElementContent(buf, content, englob);
25960         call_tests++;
25961         des_char_ptr(n_buf, buf, 0);
25962         des_xmlElementContentPtr(n_content, content, 1);
25963         des_int(n_englob, englob, 2);
25964         xmlResetLastError();
25965         if (mem_base != xmlMemBlocks()) {
25966             printf("Leak of %d blocks found in xmlSprintfElementContent",
25967                    xmlMemBlocks() - mem_base);
25968             test_ret++;
25969             printf(" %d", n_buf);
25970             printf(" %d", n_content);
25971             printf(" %d", n_englob);
25972             printf("\n");
25973         }
25974     }
25975     }
25976     }
25977     function_tests++;
25978 #endif
25979 #endif
25980
25981     return(test_ret);
25982 }
25983
25984
25985 static int
25986 test_xmlValidBuildContentModel(void) {
25987     int test_ret = 0;
25988
25989 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25990     int mem_base;
25991     int ret_val;
25992     xmlValidCtxtPtr ctxt; /* a validation context */
25993     int n_ctxt;
25994     xmlElementPtr elem; /* an element declaration node */
25995     int n_elem;
25996
25997     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25998     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25999         mem_base = xmlMemBlocks();
26000         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26001         elem = gen_xmlElementPtr(n_elem, 1);
26002
26003         ret_val = xmlValidBuildContentModel(ctxt, elem);
26004         desret_int(ret_val);
26005         call_tests++;
26006         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26007         des_xmlElementPtr(n_elem, elem, 1);
26008         xmlResetLastError();
26009         if (mem_base != xmlMemBlocks()) {
26010             printf("Leak of %d blocks found in xmlValidBuildContentModel",
26011                    xmlMemBlocks() - mem_base);
26012             test_ret++;
26013             printf(" %d", n_ctxt);
26014             printf(" %d", n_elem);
26015             printf("\n");
26016         }
26017     }
26018     }
26019     function_tests++;
26020 #endif
26021
26022     return(test_ret);
26023 }
26024
26025
26026 static int
26027 test_xmlValidCtxtNormalizeAttributeValue(void) {
26028     int test_ret = 0;
26029
26030 #if defined(LIBXML_VALID_ENABLED)
26031     int mem_base;
26032     xmlChar * ret_val;
26033     xmlValidCtxtPtr ctxt; /* the validation context or NULL */
26034     int n_ctxt;
26035     xmlDocPtr doc; /* the document */
26036     int n_doc;
26037     xmlNodePtr elem; /* the parent */
26038     int n_elem;
26039     xmlChar * name; /* the attribute name */
26040     int n_name;
26041     xmlChar * value; /* the attribute value */
26042     int n_value;
26043
26044     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26045     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26046     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26047     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26048     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26049         mem_base = xmlMemBlocks();
26050         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26051         doc = gen_xmlDocPtr(n_doc, 1);
26052         elem = gen_xmlNodePtr(n_elem, 2);
26053         name = gen_const_xmlChar_ptr(n_name, 3);
26054         value = gen_const_xmlChar_ptr(n_value, 4);
26055
26056         ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26057         desret_xmlChar_ptr(ret_val);
26058         call_tests++;
26059         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26060         des_xmlDocPtr(n_doc, doc, 1);
26061         des_xmlNodePtr(n_elem, elem, 2);
26062         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
26063         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26064         xmlResetLastError();
26065         if (mem_base != xmlMemBlocks()) {
26066             printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
26067                    xmlMemBlocks() - mem_base);
26068             test_ret++;
26069             printf(" %d", n_ctxt);
26070             printf(" %d", n_doc);
26071             printf(" %d", n_elem);
26072             printf(" %d", n_name);
26073             printf(" %d", n_value);
26074             printf("\n");
26075         }
26076     }
26077     }
26078     }
26079     }
26080     }
26081     function_tests++;
26082 #endif
26083
26084     return(test_ret);
26085 }
26086
26087
26088 #define gen_nb_xmlElementContent_ptr 1
26089 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26090     return(NULL);
26091 }
26092 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26093 }
26094
26095 static int
26096 test_xmlValidGetPotentialChildren(void) {
26097     int test_ret = 0;
26098
26099 #if defined(LIBXML_VALID_ENABLED)
26100 #ifdef LIBXML_VALID_ENABLED
26101     int mem_base;
26102     int ret_val;
26103     xmlElementContent * ctree; /* an element content tree */
26104     int n_ctree;
26105     xmlChar ** names; /* an array to store the list of child names */
26106     int n_names;
26107     int * len; /* a pointer to the number of element in the list */
26108     int n_len;
26109     int max; /* the size of the array */
26110     int n_max;
26111
26112     for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
26113     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26114     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
26115     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26116         mem_base = xmlMemBlocks();
26117         ctree = gen_xmlElementContent_ptr(n_ctree, 0);
26118         names = gen_const_xmlChar_ptr_ptr(n_names, 1);
26119         len = gen_int_ptr(n_len, 2);
26120         max = gen_int(n_max, 3);
26121
26122         ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
26123         desret_int(ret_val);
26124         call_tests++;
26125         des_xmlElementContent_ptr(n_ctree, ctree, 0);
26126         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
26127         des_int_ptr(n_len, len, 2);
26128         des_int(n_max, max, 3);
26129         xmlResetLastError();
26130         if (mem_base != xmlMemBlocks()) {
26131             printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
26132                    xmlMemBlocks() - mem_base);
26133             test_ret++;
26134             printf(" %d", n_ctree);
26135             printf(" %d", n_names);
26136             printf(" %d", n_len);
26137             printf(" %d", n_max);
26138             printf("\n");
26139         }
26140     }
26141     }
26142     }
26143     }
26144     function_tests++;
26145 #endif
26146 #endif
26147
26148     return(test_ret);
26149 }
26150
26151
26152 static int
26153 test_xmlValidGetValidElements(void) {
26154     int test_ret = 0;
26155
26156 #if defined(LIBXML_VALID_ENABLED)
26157 #ifdef LIBXML_VALID_ENABLED
26158     int mem_base;
26159     int ret_val;
26160     xmlNode * prev; /* an element to insert after */
26161     int n_prev;
26162     xmlNode * next; /* an element to insert next */
26163     int n_next;
26164     xmlChar ** names; /* an array to store the list of child names */
26165     int n_names;
26166     int max; /* the size of the array */
26167     int n_max;
26168
26169     for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
26170     for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26171     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26172     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26173         mem_base = xmlMemBlocks();
26174         prev = gen_xmlNodePtr(n_prev, 0);
26175         next = gen_xmlNodePtr(n_next, 1);
26176         names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26177         max = gen_int(n_max, 3);
26178
26179         ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26180         desret_int(ret_val);
26181         call_tests++;
26182         des_xmlNodePtr(n_prev, prev, 0);
26183         des_xmlNodePtr(n_next, next, 1);
26184         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26185         des_int(n_max, max, 3);
26186         xmlResetLastError();
26187         if (mem_base != xmlMemBlocks()) {
26188             printf("Leak of %d blocks found in xmlValidGetValidElements",
26189                    xmlMemBlocks() - mem_base);
26190             test_ret++;
26191             printf(" %d", n_prev);
26192             printf(" %d", n_next);
26193             printf(" %d", n_names);
26194             printf(" %d", n_max);
26195             printf("\n");
26196         }
26197     }
26198     }
26199     }
26200     }
26201     function_tests++;
26202 #endif
26203 #endif
26204
26205     return(test_ret);
26206 }
26207
26208
26209 static int
26210 test_xmlValidNormalizeAttributeValue(void) {
26211     int test_ret = 0;
26212
26213 #if defined(LIBXML_VALID_ENABLED)
26214     int mem_base;
26215     xmlChar * ret_val;
26216     xmlDocPtr doc; /* the document */
26217     int n_doc;
26218     xmlNodePtr elem; /* the parent */
26219     int n_elem;
26220     xmlChar * name; /* the attribute name */
26221     int n_name;
26222     xmlChar * value; /* the attribute value */
26223     int n_value;
26224
26225     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26226     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26227     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26228     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26229         mem_base = xmlMemBlocks();
26230         doc = gen_xmlDocPtr(n_doc, 0);
26231         elem = gen_xmlNodePtr(n_elem, 1);
26232         name = gen_const_xmlChar_ptr(n_name, 2);
26233         value = gen_const_xmlChar_ptr(n_value, 3);
26234
26235         ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26236         desret_xmlChar_ptr(ret_val);
26237         call_tests++;
26238         des_xmlDocPtr(n_doc, doc, 0);
26239         des_xmlNodePtr(n_elem, elem, 1);
26240         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26241         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26242         xmlResetLastError();
26243         if (mem_base != xmlMemBlocks()) {
26244             printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26245                    xmlMemBlocks() - mem_base);
26246             test_ret++;
26247             printf(" %d", n_doc);
26248             printf(" %d", n_elem);
26249             printf(" %d", n_name);
26250             printf(" %d", n_value);
26251             printf("\n");
26252         }
26253     }
26254     }
26255     }
26256     }
26257     function_tests++;
26258 #endif
26259
26260     return(test_ret);
26261 }
26262
26263
26264 static int
26265 test_xmlValidateAttributeDecl(void) {
26266     int test_ret = 0;
26267
26268 #if defined(LIBXML_VALID_ENABLED)
26269     int mem_base;
26270     int ret_val;
26271     xmlValidCtxtPtr ctxt; /* the validation context */
26272     int n_ctxt;
26273     xmlDocPtr doc; /* a document instance */
26274     int n_doc;
26275     xmlAttributePtr attr; /* an attribute definition */
26276     int n_attr;
26277
26278     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26279     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26280     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26281         mem_base = xmlMemBlocks();
26282         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26283         doc = gen_xmlDocPtr(n_doc, 1);
26284         attr = gen_xmlAttributePtr(n_attr, 2);
26285
26286         ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26287         desret_int(ret_val);
26288         call_tests++;
26289         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26290         des_xmlDocPtr(n_doc, doc, 1);
26291         des_xmlAttributePtr(n_attr, attr, 2);
26292         xmlResetLastError();
26293         if (mem_base != xmlMemBlocks()) {
26294             printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26295                    xmlMemBlocks() - mem_base);
26296             test_ret++;
26297             printf(" %d", n_ctxt);
26298             printf(" %d", n_doc);
26299             printf(" %d", n_attr);
26300             printf("\n");
26301         }
26302     }
26303     }
26304     }
26305     function_tests++;
26306 #endif
26307
26308     return(test_ret);
26309 }
26310
26311
26312 static int
26313 test_xmlValidateAttributeValue(void) {
26314     int test_ret = 0;
26315
26316 #if defined(LIBXML_VALID_ENABLED)
26317     int mem_base;
26318     int ret_val;
26319     xmlAttributeType type; /* an attribute type */
26320     int n_type;
26321     xmlChar * value; /* an attribute value */
26322     int n_value;
26323
26324     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26325     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26326         mem_base = xmlMemBlocks();
26327         type = gen_xmlAttributeType(n_type, 0);
26328         value = gen_const_xmlChar_ptr(n_value, 1);
26329
26330         ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26331         desret_int(ret_val);
26332         call_tests++;
26333         des_xmlAttributeType(n_type, type, 0);
26334         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26335         xmlResetLastError();
26336         if (mem_base != xmlMemBlocks()) {
26337             printf("Leak of %d blocks found in xmlValidateAttributeValue",
26338                    xmlMemBlocks() - mem_base);
26339             test_ret++;
26340             printf(" %d", n_type);
26341             printf(" %d", n_value);
26342             printf("\n");
26343         }
26344     }
26345     }
26346     function_tests++;
26347 #endif
26348
26349     return(test_ret);
26350 }
26351
26352
26353 static int
26354 test_xmlValidateDocument(void) {
26355     int test_ret = 0;
26356
26357 #if defined(LIBXML_VALID_ENABLED)
26358     int mem_base;
26359     int ret_val;
26360     xmlValidCtxtPtr ctxt; /* the validation context */
26361     int n_ctxt;
26362     xmlDocPtr doc; /* a document instance */
26363     int n_doc;
26364
26365     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26366     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26367         mem_base = xmlMemBlocks();
26368         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26369         doc = gen_xmlDocPtr(n_doc, 1);
26370
26371         ret_val = xmlValidateDocument(ctxt, doc);
26372         desret_int(ret_val);
26373         call_tests++;
26374         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26375         des_xmlDocPtr(n_doc, doc, 1);
26376         xmlResetLastError();
26377         if (mem_base != xmlMemBlocks()) {
26378             printf("Leak of %d blocks found in xmlValidateDocument",
26379                    xmlMemBlocks() - mem_base);
26380             test_ret++;
26381             printf(" %d", n_ctxt);
26382             printf(" %d", n_doc);
26383             printf("\n");
26384         }
26385     }
26386     }
26387     function_tests++;
26388 #endif
26389
26390     return(test_ret);
26391 }
26392
26393
26394 static int
26395 test_xmlValidateDocumentFinal(void) {
26396     int test_ret = 0;
26397
26398 #if defined(LIBXML_VALID_ENABLED)
26399     int mem_base;
26400     int ret_val;
26401     xmlValidCtxtPtr ctxt; /* the validation context */
26402     int n_ctxt;
26403     xmlDocPtr doc; /* a document instance */
26404     int n_doc;
26405
26406     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26407     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26408         mem_base = xmlMemBlocks();
26409         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26410         doc = gen_xmlDocPtr(n_doc, 1);
26411
26412         ret_val = xmlValidateDocumentFinal(ctxt, doc);
26413         desret_int(ret_val);
26414         call_tests++;
26415         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26416         des_xmlDocPtr(n_doc, doc, 1);
26417         xmlResetLastError();
26418         if (mem_base != xmlMemBlocks()) {
26419             printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26420                    xmlMemBlocks() - mem_base);
26421             test_ret++;
26422             printf(" %d", n_ctxt);
26423             printf(" %d", n_doc);
26424             printf("\n");
26425         }
26426     }
26427     }
26428     function_tests++;
26429 #endif
26430
26431     return(test_ret);
26432 }
26433
26434
26435 static int
26436 test_xmlValidateDtd(void) {
26437     int test_ret = 0;
26438
26439 #if defined(LIBXML_VALID_ENABLED)
26440     int mem_base;
26441     int ret_val;
26442     xmlValidCtxtPtr ctxt; /* the validation context */
26443     int n_ctxt;
26444     xmlDocPtr doc; /* a document instance */
26445     int n_doc;
26446     xmlDtdPtr dtd; /* a dtd instance */
26447     int n_dtd;
26448
26449     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26450     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26451     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26452         mem_base = xmlMemBlocks();
26453         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26454         doc = gen_xmlDocPtr(n_doc, 1);
26455         dtd = gen_xmlDtdPtr(n_dtd, 2);
26456
26457         ret_val = xmlValidateDtd(ctxt, doc, dtd);
26458         desret_int(ret_val);
26459         call_tests++;
26460         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26461         des_xmlDocPtr(n_doc, doc, 1);
26462         des_xmlDtdPtr(n_dtd, dtd, 2);
26463         xmlResetLastError();
26464         if (mem_base != xmlMemBlocks()) {
26465             printf("Leak of %d blocks found in xmlValidateDtd",
26466                    xmlMemBlocks() - mem_base);
26467             test_ret++;
26468             printf(" %d", n_ctxt);
26469             printf(" %d", n_doc);
26470             printf(" %d", n_dtd);
26471             printf("\n");
26472         }
26473     }
26474     }
26475     }
26476     function_tests++;
26477 #endif
26478
26479     return(test_ret);
26480 }
26481
26482
26483 static int
26484 test_xmlValidateDtdFinal(void) {
26485     int test_ret = 0;
26486
26487 #if defined(LIBXML_VALID_ENABLED)
26488     int mem_base;
26489     int ret_val;
26490     xmlValidCtxtPtr ctxt; /* the validation context */
26491     int n_ctxt;
26492     xmlDocPtr doc; /* a document instance */
26493     int n_doc;
26494
26495     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26496     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26497         mem_base = xmlMemBlocks();
26498         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26499         doc = gen_xmlDocPtr(n_doc, 1);
26500
26501         ret_val = xmlValidateDtdFinal(ctxt, doc);
26502         desret_int(ret_val);
26503         call_tests++;
26504         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26505         des_xmlDocPtr(n_doc, doc, 1);
26506         xmlResetLastError();
26507         if (mem_base != xmlMemBlocks()) {
26508             printf("Leak of %d blocks found in xmlValidateDtdFinal",
26509                    xmlMemBlocks() - mem_base);
26510             test_ret++;
26511             printf(" %d", n_ctxt);
26512             printf(" %d", n_doc);
26513             printf("\n");
26514         }
26515     }
26516     }
26517     function_tests++;
26518 #endif
26519
26520     return(test_ret);
26521 }
26522
26523
26524 static int
26525 test_xmlValidateElement(void) {
26526     int test_ret = 0;
26527
26528 #if defined(LIBXML_VALID_ENABLED)
26529     int mem_base;
26530     int ret_val;
26531     xmlValidCtxtPtr ctxt; /* the validation context */
26532     int n_ctxt;
26533     xmlDocPtr doc; /* a document instance */
26534     int n_doc;
26535     xmlNodePtr elem; /* an element instance */
26536     int n_elem;
26537
26538     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26539     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26540     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26541         mem_base = xmlMemBlocks();
26542         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26543         doc = gen_xmlDocPtr(n_doc, 1);
26544         elem = gen_xmlNodePtr(n_elem, 2);
26545
26546         ret_val = xmlValidateElement(ctxt, doc, elem);
26547         desret_int(ret_val);
26548         call_tests++;
26549         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26550         des_xmlDocPtr(n_doc, doc, 1);
26551         des_xmlNodePtr(n_elem, elem, 2);
26552         xmlResetLastError();
26553         if (mem_base != xmlMemBlocks()) {
26554             printf("Leak of %d blocks found in xmlValidateElement",
26555                    xmlMemBlocks() - mem_base);
26556             test_ret++;
26557             printf(" %d", n_ctxt);
26558             printf(" %d", n_doc);
26559             printf(" %d", n_elem);
26560             printf("\n");
26561         }
26562     }
26563     }
26564     }
26565     function_tests++;
26566 #endif
26567
26568     return(test_ret);
26569 }
26570
26571
26572 static int
26573 test_xmlValidateElementDecl(void) {
26574     int test_ret = 0;
26575
26576 #if defined(LIBXML_VALID_ENABLED)
26577     int mem_base;
26578     int ret_val;
26579     xmlValidCtxtPtr ctxt; /* the validation context */
26580     int n_ctxt;
26581     xmlDocPtr doc; /* a document instance */
26582     int n_doc;
26583     xmlElementPtr elem; /* an element definition */
26584     int n_elem;
26585
26586     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26587     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26588     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26589         mem_base = xmlMemBlocks();
26590         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26591         doc = gen_xmlDocPtr(n_doc, 1);
26592         elem = gen_xmlElementPtr(n_elem, 2);
26593
26594         ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26595         desret_int(ret_val);
26596         call_tests++;
26597         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26598         des_xmlDocPtr(n_doc, doc, 1);
26599         des_xmlElementPtr(n_elem, elem, 2);
26600         xmlResetLastError();
26601         if (mem_base != xmlMemBlocks()) {
26602             printf("Leak of %d blocks found in xmlValidateElementDecl",
26603                    xmlMemBlocks() - mem_base);
26604             test_ret++;
26605             printf(" %d", n_ctxt);
26606             printf(" %d", n_doc);
26607             printf(" %d", n_elem);
26608             printf("\n");
26609         }
26610     }
26611     }
26612     }
26613     function_tests++;
26614 #endif
26615
26616     return(test_ret);
26617 }
26618
26619
26620 static int
26621 test_xmlValidateNameValue(void) {
26622     int test_ret = 0;
26623
26624 #if defined(LIBXML_VALID_ENABLED)
26625     int mem_base;
26626     int ret_val;
26627     xmlChar * value; /* an Name value */
26628     int n_value;
26629
26630     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26631         mem_base = xmlMemBlocks();
26632         value = gen_const_xmlChar_ptr(n_value, 0);
26633
26634         ret_val = xmlValidateNameValue((const xmlChar *)value);
26635         desret_int(ret_val);
26636         call_tests++;
26637         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26638         xmlResetLastError();
26639         if (mem_base != xmlMemBlocks()) {
26640             printf("Leak of %d blocks found in xmlValidateNameValue",
26641                    xmlMemBlocks() - mem_base);
26642             test_ret++;
26643             printf(" %d", n_value);
26644             printf("\n");
26645         }
26646     }
26647     function_tests++;
26648 #endif
26649
26650     return(test_ret);
26651 }
26652
26653
26654 static int
26655 test_xmlValidateNamesValue(void) {
26656     int test_ret = 0;
26657
26658 #if defined(LIBXML_VALID_ENABLED)
26659     int mem_base;
26660     int ret_val;
26661     xmlChar * value; /* an Names value */
26662     int n_value;
26663
26664     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26665         mem_base = xmlMemBlocks();
26666         value = gen_const_xmlChar_ptr(n_value, 0);
26667
26668         ret_val = xmlValidateNamesValue((const xmlChar *)value);
26669         desret_int(ret_val);
26670         call_tests++;
26671         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26672         xmlResetLastError();
26673         if (mem_base != xmlMemBlocks()) {
26674             printf("Leak of %d blocks found in xmlValidateNamesValue",
26675                    xmlMemBlocks() - mem_base);
26676             test_ret++;
26677             printf(" %d", n_value);
26678             printf("\n");
26679         }
26680     }
26681     function_tests++;
26682 #endif
26683
26684     return(test_ret);
26685 }
26686
26687
26688 static int
26689 test_xmlValidateNmtokenValue(void) {
26690     int test_ret = 0;
26691
26692 #if defined(LIBXML_VALID_ENABLED)
26693     int mem_base;
26694     int ret_val;
26695     xmlChar * value; /* an Nmtoken value */
26696     int n_value;
26697
26698     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26699         mem_base = xmlMemBlocks();
26700         value = gen_const_xmlChar_ptr(n_value, 0);
26701
26702         ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26703         desret_int(ret_val);
26704         call_tests++;
26705         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26706         xmlResetLastError();
26707         if (mem_base != xmlMemBlocks()) {
26708             printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26709                    xmlMemBlocks() - mem_base);
26710             test_ret++;
26711             printf(" %d", n_value);
26712             printf("\n");
26713         }
26714     }
26715     function_tests++;
26716 #endif
26717
26718     return(test_ret);
26719 }
26720
26721
26722 static int
26723 test_xmlValidateNmtokensValue(void) {
26724     int test_ret = 0;
26725
26726 #if defined(LIBXML_VALID_ENABLED)
26727     int mem_base;
26728     int ret_val;
26729     xmlChar * value; /* an Nmtokens value */
26730     int n_value;
26731
26732     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26733         mem_base = xmlMemBlocks();
26734         value = gen_const_xmlChar_ptr(n_value, 0);
26735
26736         ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26737         desret_int(ret_val);
26738         call_tests++;
26739         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26740         xmlResetLastError();
26741         if (mem_base != xmlMemBlocks()) {
26742             printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26743                    xmlMemBlocks() - mem_base);
26744             test_ret++;
26745             printf(" %d", n_value);
26746             printf("\n");
26747         }
26748     }
26749     function_tests++;
26750 #endif
26751
26752     return(test_ret);
26753 }
26754
26755
26756 static int
26757 test_xmlValidateNotationDecl(void) {
26758     int test_ret = 0;
26759
26760 #if defined(LIBXML_VALID_ENABLED)
26761     int mem_base;
26762     int ret_val;
26763     xmlValidCtxtPtr ctxt; /* the validation context */
26764     int n_ctxt;
26765     xmlDocPtr doc; /* a document instance */
26766     int n_doc;
26767     xmlNotationPtr nota; /* a notation definition */
26768     int n_nota;
26769
26770     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26771     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26772     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26773         mem_base = xmlMemBlocks();
26774         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26775         doc = gen_xmlDocPtr(n_doc, 1);
26776         nota = gen_xmlNotationPtr(n_nota, 2);
26777
26778         ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26779         desret_int(ret_val);
26780         call_tests++;
26781         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26782         des_xmlDocPtr(n_doc, doc, 1);
26783         des_xmlNotationPtr(n_nota, nota, 2);
26784         xmlResetLastError();
26785         if (mem_base != xmlMemBlocks()) {
26786             printf("Leak of %d blocks found in xmlValidateNotationDecl",
26787                    xmlMemBlocks() - mem_base);
26788             test_ret++;
26789             printf(" %d", n_ctxt);
26790             printf(" %d", n_doc);
26791             printf(" %d", n_nota);
26792             printf("\n");
26793         }
26794     }
26795     }
26796     }
26797     function_tests++;
26798 #endif
26799
26800     return(test_ret);
26801 }
26802
26803
26804 static int
26805 test_xmlValidateNotationUse(void) {
26806     int test_ret = 0;
26807
26808 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26809     int mem_base;
26810     int ret_val;
26811     xmlValidCtxtPtr ctxt; /* the validation context */
26812     int n_ctxt;
26813     xmlDocPtr doc; /* the document */
26814     int n_doc;
26815     xmlChar * notationName; /* the notation name to check */
26816     int n_notationName;
26817
26818     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26819     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26820     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26821         mem_base = xmlMemBlocks();
26822         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26823         doc = gen_xmlDocPtr(n_doc, 1);
26824         notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26825
26826         ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26827         desret_int(ret_val);
26828         call_tests++;
26829         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26830         des_xmlDocPtr(n_doc, doc, 1);
26831         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26832         xmlResetLastError();
26833         if (mem_base != xmlMemBlocks()) {
26834             printf("Leak of %d blocks found in xmlValidateNotationUse",
26835                    xmlMemBlocks() - mem_base);
26836             test_ret++;
26837             printf(" %d", n_ctxt);
26838             printf(" %d", n_doc);
26839             printf(" %d", n_notationName);
26840             printf("\n");
26841         }
26842     }
26843     }
26844     }
26845     function_tests++;
26846 #endif
26847
26848     return(test_ret);
26849 }
26850
26851
26852 static int
26853 test_xmlValidateOneAttribute(void) {
26854     int test_ret = 0;
26855
26856 #if defined(LIBXML_VALID_ENABLED)
26857     int mem_base;
26858     int ret_val;
26859     xmlValidCtxtPtr ctxt; /* the validation context */
26860     int n_ctxt;
26861     xmlDocPtr doc; /* a document instance */
26862     int n_doc;
26863     xmlNodePtr elem; /* an element instance */
26864     int n_elem;
26865     xmlAttrPtr attr; /* an attribute instance */
26866     int n_attr;
26867     xmlChar * value; /* the attribute value (without entities processing) */
26868     int n_value;
26869
26870     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26871     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26872     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26873     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26874     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26875         mem_base = xmlMemBlocks();
26876         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26877         doc = gen_xmlDocPtr(n_doc, 1);
26878         elem = gen_xmlNodePtr(n_elem, 2);
26879         attr = gen_xmlAttrPtr(n_attr, 3);
26880         value = gen_const_xmlChar_ptr(n_value, 4);
26881
26882         ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26883         desret_int(ret_val);
26884         call_tests++;
26885         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26886         des_xmlDocPtr(n_doc, doc, 1);
26887         des_xmlNodePtr(n_elem, elem, 2);
26888         des_xmlAttrPtr(n_attr, attr, 3);
26889         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26890         xmlResetLastError();
26891         if (mem_base != xmlMemBlocks()) {
26892             printf("Leak of %d blocks found in xmlValidateOneAttribute",
26893                    xmlMemBlocks() - mem_base);
26894             test_ret++;
26895             printf(" %d", n_ctxt);
26896             printf(" %d", n_doc);
26897             printf(" %d", n_elem);
26898             printf(" %d", n_attr);
26899             printf(" %d", n_value);
26900             printf("\n");
26901         }
26902     }
26903     }
26904     }
26905     }
26906     }
26907     function_tests++;
26908 #endif
26909
26910     return(test_ret);
26911 }
26912
26913
26914 static int
26915 test_xmlValidateOneElement(void) {
26916     int test_ret = 0;
26917
26918 #if defined(LIBXML_VALID_ENABLED)
26919     int mem_base;
26920     int ret_val;
26921     xmlValidCtxtPtr ctxt; /* the validation context */
26922     int n_ctxt;
26923     xmlDocPtr doc; /* a document instance */
26924     int n_doc;
26925     xmlNodePtr elem; /* an element instance */
26926     int n_elem;
26927
26928     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26929     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26930     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26931         mem_base = xmlMemBlocks();
26932         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26933         doc = gen_xmlDocPtr(n_doc, 1);
26934         elem = gen_xmlNodePtr(n_elem, 2);
26935
26936         ret_val = xmlValidateOneElement(ctxt, doc, elem);
26937         desret_int(ret_val);
26938         call_tests++;
26939         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26940         des_xmlDocPtr(n_doc, doc, 1);
26941         des_xmlNodePtr(n_elem, elem, 2);
26942         xmlResetLastError();
26943         if (mem_base != xmlMemBlocks()) {
26944             printf("Leak of %d blocks found in xmlValidateOneElement",
26945                    xmlMemBlocks() - mem_base);
26946             test_ret++;
26947             printf(" %d", n_ctxt);
26948             printf(" %d", n_doc);
26949             printf(" %d", n_elem);
26950             printf("\n");
26951         }
26952     }
26953     }
26954     }
26955     function_tests++;
26956 #endif
26957
26958     return(test_ret);
26959 }
26960
26961
26962 static int
26963 test_xmlValidateOneNamespace(void) {
26964     int test_ret = 0;
26965
26966 #if defined(LIBXML_VALID_ENABLED)
26967     int mem_base;
26968     int ret_val;
26969     xmlValidCtxtPtr ctxt; /* the validation context */
26970     int n_ctxt;
26971     xmlDocPtr doc; /* a document instance */
26972     int n_doc;
26973     xmlNodePtr elem; /* an element instance */
26974     int n_elem;
26975     xmlChar * prefix; /* the namespace prefix */
26976     int n_prefix;
26977     xmlNsPtr ns; /* an namespace declaration instance */
26978     int n_ns;
26979     xmlChar * value; /* the attribute value (without entities processing) */
26980     int n_value;
26981
26982     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26983     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26984     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26985     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26986     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26987     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26988         mem_base = xmlMemBlocks();
26989         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26990         doc = gen_xmlDocPtr(n_doc, 1);
26991         elem = gen_xmlNodePtr(n_elem, 2);
26992         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26993         ns = gen_xmlNsPtr(n_ns, 4);
26994         value = gen_const_xmlChar_ptr(n_value, 5);
26995
26996         ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26997         desret_int(ret_val);
26998         call_tests++;
26999         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27000         des_xmlDocPtr(n_doc, doc, 1);
27001         des_xmlNodePtr(n_elem, elem, 2);
27002         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
27003         des_xmlNsPtr(n_ns, ns, 4);
27004         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
27005         xmlResetLastError();
27006         if (mem_base != xmlMemBlocks()) {
27007             printf("Leak of %d blocks found in xmlValidateOneNamespace",
27008                    xmlMemBlocks() - mem_base);
27009             test_ret++;
27010             printf(" %d", n_ctxt);
27011             printf(" %d", n_doc);
27012             printf(" %d", n_elem);
27013             printf(" %d", n_prefix);
27014             printf(" %d", n_ns);
27015             printf(" %d", n_value);
27016             printf("\n");
27017         }
27018     }
27019     }
27020     }
27021     }
27022     }
27023     }
27024     function_tests++;
27025 #endif
27026
27027     return(test_ret);
27028 }
27029
27030
27031 static int
27032 test_xmlValidatePopElement(void) {
27033     int test_ret = 0;
27034
27035 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27036     int mem_base;
27037     int ret_val;
27038     xmlValidCtxtPtr ctxt; /* the validation context */
27039     int n_ctxt;
27040     xmlDocPtr doc; /* a document instance */
27041     int n_doc;
27042     xmlNodePtr elem; /* an element instance */
27043     int n_elem;
27044     xmlChar * qname; /* the qualified name as appearing in the serialization */
27045     int n_qname;
27046
27047     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27048     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27049     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27050     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27051         mem_base = xmlMemBlocks();
27052         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27053         doc = gen_xmlDocPtr(n_doc, 1);
27054         elem = gen_xmlNodePtr(n_elem, 2);
27055         qname = gen_const_xmlChar_ptr(n_qname, 3);
27056
27057         ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
27058         desret_int(ret_val);
27059         call_tests++;
27060         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27061         des_xmlDocPtr(n_doc, doc, 1);
27062         des_xmlNodePtr(n_elem, elem, 2);
27063         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27064         xmlResetLastError();
27065         if (mem_base != xmlMemBlocks()) {
27066             printf("Leak of %d blocks found in xmlValidatePopElement",
27067                    xmlMemBlocks() - mem_base);
27068             test_ret++;
27069             printf(" %d", n_ctxt);
27070             printf(" %d", n_doc);
27071             printf(" %d", n_elem);
27072             printf(" %d", n_qname);
27073             printf("\n");
27074         }
27075     }
27076     }
27077     }
27078     }
27079     function_tests++;
27080 #endif
27081
27082     return(test_ret);
27083 }
27084
27085
27086 static int
27087 test_xmlValidatePushCData(void) {
27088     int test_ret = 0;
27089
27090 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27091     int mem_base;
27092     int ret_val;
27093     xmlValidCtxtPtr ctxt; /* the validation context */
27094     int n_ctxt;
27095     xmlChar * data; /* some character data read */
27096     int n_data;
27097     int len; /* the length of the data */
27098     int n_len;
27099
27100     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27101     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
27102     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27103         mem_base = xmlMemBlocks();
27104         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27105         data = gen_const_xmlChar_ptr(n_data, 1);
27106         len = gen_int(n_len, 2);
27107
27108         ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
27109         desret_int(ret_val);
27110         call_tests++;
27111         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27112         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
27113         des_int(n_len, len, 2);
27114         xmlResetLastError();
27115         if (mem_base != xmlMemBlocks()) {
27116             printf("Leak of %d blocks found in xmlValidatePushCData",
27117                    xmlMemBlocks() - mem_base);
27118             test_ret++;
27119             printf(" %d", n_ctxt);
27120             printf(" %d", n_data);
27121             printf(" %d", n_len);
27122             printf("\n");
27123         }
27124     }
27125     }
27126     }
27127     function_tests++;
27128 #endif
27129
27130     return(test_ret);
27131 }
27132
27133
27134 static int
27135 test_xmlValidatePushElement(void) {
27136     int test_ret = 0;
27137
27138 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27139     int mem_base;
27140     int ret_val;
27141     xmlValidCtxtPtr ctxt; /* the validation context */
27142     int n_ctxt;
27143     xmlDocPtr doc; /* a document instance */
27144     int n_doc;
27145     xmlNodePtr elem; /* an element instance */
27146     int n_elem;
27147     xmlChar * qname; /* the qualified name as appearing in the serialization */
27148     int n_qname;
27149
27150     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27151     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27152     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27153     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27154         mem_base = xmlMemBlocks();
27155         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27156         doc = gen_xmlDocPtr(n_doc, 1);
27157         elem = gen_xmlNodePtr(n_elem, 2);
27158         qname = gen_const_xmlChar_ptr(n_qname, 3);
27159
27160         ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
27161         desret_int(ret_val);
27162         call_tests++;
27163         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27164         des_xmlDocPtr(n_doc, doc, 1);
27165         des_xmlNodePtr(n_elem, elem, 2);
27166         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27167         xmlResetLastError();
27168         if (mem_base != xmlMemBlocks()) {
27169             printf("Leak of %d blocks found in xmlValidatePushElement",
27170                    xmlMemBlocks() - mem_base);
27171             test_ret++;
27172             printf(" %d", n_ctxt);
27173             printf(" %d", n_doc);
27174             printf(" %d", n_elem);
27175             printf(" %d", n_qname);
27176             printf("\n");
27177         }
27178     }
27179     }
27180     }
27181     }
27182     function_tests++;
27183 #endif
27184
27185     return(test_ret);
27186 }
27187
27188
27189 static int
27190 test_xmlValidateRoot(void) {
27191     int test_ret = 0;
27192
27193 #if defined(LIBXML_VALID_ENABLED)
27194     int mem_base;
27195     int ret_val;
27196     xmlValidCtxtPtr ctxt; /* the validation context */
27197     int n_ctxt;
27198     xmlDocPtr doc; /* a document instance */
27199     int n_doc;
27200
27201     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27202     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27203         mem_base = xmlMemBlocks();
27204         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27205         doc = gen_xmlDocPtr(n_doc, 1);
27206
27207         ret_val = xmlValidateRoot(ctxt, doc);
27208         desret_int(ret_val);
27209         call_tests++;
27210         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27211         des_xmlDocPtr(n_doc, doc, 1);
27212         xmlResetLastError();
27213         if (mem_base != xmlMemBlocks()) {
27214             printf("Leak of %d blocks found in xmlValidateRoot",
27215                    xmlMemBlocks() - mem_base);
27216             test_ret++;
27217             printf(" %d", n_ctxt);
27218             printf(" %d", n_doc);
27219             printf("\n");
27220         }
27221     }
27222     }
27223     function_tests++;
27224 #endif
27225
27226     return(test_ret);
27227 }
27228
27229 static int
27230 test_valid(void) {
27231     int test_ret = 0;
27232
27233     if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27234     test_ret += test_xmlAddAttributeDecl();
27235     test_ret += test_xmlAddElementDecl();
27236     test_ret += test_xmlAddID();
27237     test_ret += test_xmlAddNotationDecl();
27238     test_ret += test_xmlAddRef();
27239     test_ret += test_xmlCopyAttributeTable();
27240     test_ret += test_xmlCopyDocElementContent();
27241     test_ret += test_xmlCopyElementContent();
27242     test_ret += test_xmlCopyElementTable();
27243     test_ret += test_xmlCopyEnumeration();
27244     test_ret += test_xmlCopyNotationTable();
27245     test_ret += test_xmlCreateEnumeration();
27246     test_ret += test_xmlDumpAttributeDecl();
27247     test_ret += test_xmlDumpAttributeTable();
27248     test_ret += test_xmlDumpElementDecl();
27249     test_ret += test_xmlDumpElementTable();
27250     test_ret += test_xmlDumpNotationDecl();
27251     test_ret += test_xmlDumpNotationTable();
27252     test_ret += test_xmlGetDtdAttrDesc();
27253     test_ret += test_xmlGetDtdElementDesc();
27254     test_ret += test_xmlGetDtdNotationDesc();
27255     test_ret += test_xmlGetDtdQAttrDesc();
27256     test_ret += test_xmlGetDtdQElementDesc();
27257     test_ret += test_xmlGetID();
27258     test_ret += test_xmlGetRefs();
27259     test_ret += test_xmlIsID();
27260     test_ret += test_xmlIsMixedElement();
27261     test_ret += test_xmlIsRef();
27262     test_ret += test_xmlNewDocElementContent();
27263     test_ret += test_xmlNewElementContent();
27264     test_ret += test_xmlNewValidCtxt();
27265     test_ret += test_xmlRemoveID();
27266     test_ret += test_xmlRemoveRef();
27267     test_ret += test_xmlSnprintfElementContent();
27268     test_ret += test_xmlSprintfElementContent();
27269     test_ret += test_xmlValidBuildContentModel();
27270     test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27271     test_ret += test_xmlValidGetPotentialChildren();
27272     test_ret += test_xmlValidGetValidElements();
27273     test_ret += test_xmlValidNormalizeAttributeValue();
27274     test_ret += test_xmlValidateAttributeDecl();
27275     test_ret += test_xmlValidateAttributeValue();
27276     test_ret += test_xmlValidateDocument();
27277     test_ret += test_xmlValidateDocumentFinal();
27278     test_ret += test_xmlValidateDtd();
27279     test_ret += test_xmlValidateDtdFinal();
27280     test_ret += test_xmlValidateElement();
27281     test_ret += test_xmlValidateElementDecl();
27282     test_ret += test_xmlValidateNameValue();
27283     test_ret += test_xmlValidateNamesValue();
27284     test_ret += test_xmlValidateNmtokenValue();
27285     test_ret += test_xmlValidateNmtokensValue();
27286     test_ret += test_xmlValidateNotationDecl();
27287     test_ret += test_xmlValidateNotationUse();
27288     test_ret += test_xmlValidateOneAttribute();
27289     test_ret += test_xmlValidateOneElement();
27290     test_ret += test_xmlValidateOneNamespace();
27291     test_ret += test_xmlValidatePopElement();
27292     test_ret += test_xmlValidatePushCData();
27293     test_ret += test_xmlValidatePushElement();
27294     test_ret += test_xmlValidateRoot();
27295
27296     if (test_ret != 0)
27297         printf("Module valid: %d errors\n", test_ret);
27298     return(test_ret);
27299 }
27300
27301 static int
27302 test_xmlXIncludeNewContext(void) {
27303     int test_ret = 0;
27304
27305
27306     /* missing type support */
27307     return(test_ret);
27308 }
27309
27310
27311 static int
27312 test_xmlXIncludeProcess(void) {
27313     int test_ret = 0;
27314
27315 #if defined(LIBXML_XINCLUDE_ENABLED)
27316     int mem_base;
27317     int ret_val;
27318     xmlDocPtr doc; /* an XML document */
27319     int n_doc;
27320
27321     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27322         mem_base = xmlMemBlocks();
27323         doc = gen_xmlDocPtr(n_doc, 0);
27324
27325         ret_val = xmlXIncludeProcess(doc);
27326         desret_int(ret_val);
27327         call_tests++;
27328         des_xmlDocPtr(n_doc, doc, 0);
27329         xmlResetLastError();
27330         if (mem_base != xmlMemBlocks()) {
27331             printf("Leak of %d blocks found in xmlXIncludeProcess",
27332                    xmlMemBlocks() - mem_base);
27333             test_ret++;
27334             printf(" %d", n_doc);
27335             printf("\n");
27336         }
27337     }
27338     function_tests++;
27339 #endif
27340
27341     return(test_ret);
27342 }
27343
27344
27345 static int
27346 test_xmlXIncludeProcessFlags(void) {
27347     int test_ret = 0;
27348
27349 #if defined(LIBXML_XINCLUDE_ENABLED)
27350     int mem_base;
27351     int ret_val;
27352     xmlDocPtr doc; /* an XML document */
27353     int n_doc;
27354     int flags; /* a set of xmlParserOption used for parsing XML includes */
27355     int n_flags;
27356
27357     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27358     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27359         mem_base = xmlMemBlocks();
27360         doc = gen_xmlDocPtr(n_doc, 0);
27361         flags = gen_int(n_flags, 1);
27362
27363         ret_val = xmlXIncludeProcessFlags(doc, flags);
27364         desret_int(ret_val);
27365         call_tests++;
27366         des_xmlDocPtr(n_doc, doc, 0);
27367         des_int(n_flags, flags, 1);
27368         xmlResetLastError();
27369         if (mem_base != xmlMemBlocks()) {
27370             printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27371                    xmlMemBlocks() - mem_base);
27372             test_ret++;
27373             printf(" %d", n_doc);
27374             printf(" %d", n_flags);
27375             printf("\n");
27376         }
27377     }
27378     }
27379     function_tests++;
27380 #endif
27381
27382     return(test_ret);
27383 }
27384
27385
27386 static int
27387 test_xmlXIncludeProcessFlagsData(void) {
27388     int test_ret = 0;
27389
27390 #if defined(LIBXML_XINCLUDE_ENABLED)
27391     int mem_base;
27392     int ret_val;
27393     xmlDocPtr doc; /* an XML document */
27394     int n_doc;
27395     int flags; /* a set of xmlParserOption used for parsing XML includes */
27396     int n_flags;
27397     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27398     int n_data;
27399
27400     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27401     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27402     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27403         mem_base = xmlMemBlocks();
27404         doc = gen_xmlDocPtr(n_doc, 0);
27405         flags = gen_int(n_flags, 1);
27406         data = gen_userdata(n_data, 2);
27407
27408         ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27409         desret_int(ret_val);
27410         call_tests++;
27411         des_xmlDocPtr(n_doc, doc, 0);
27412         des_int(n_flags, flags, 1);
27413         des_userdata(n_data, data, 2);
27414         xmlResetLastError();
27415         if (mem_base != xmlMemBlocks()) {
27416             printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27417                    xmlMemBlocks() - mem_base);
27418             test_ret++;
27419             printf(" %d", n_doc);
27420             printf(" %d", n_flags);
27421             printf(" %d", n_data);
27422             printf("\n");
27423         }
27424     }
27425     }
27426     }
27427     function_tests++;
27428 #endif
27429
27430     return(test_ret);
27431 }
27432
27433 #ifdef LIBXML_XINCLUDE_ENABLED
27434
27435 #define gen_nb_xmlXIncludeCtxtPtr 1
27436 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27437     return(NULL);
27438 }
27439 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27440 }
27441 #endif
27442
27443
27444 static int
27445 test_xmlXIncludeProcessNode(void) {
27446     int test_ret = 0;
27447
27448 #if defined(LIBXML_XINCLUDE_ENABLED)
27449     int mem_base;
27450     int ret_val;
27451     xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27452     int n_ctxt;
27453     xmlNodePtr node; /* a node in an XML document */
27454     int n_node;
27455
27456     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27457     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27458         mem_base = xmlMemBlocks();
27459         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27460         node = gen_xmlNodePtr(n_node, 1);
27461
27462         ret_val = xmlXIncludeProcessNode(ctxt, node);
27463         desret_int(ret_val);
27464         call_tests++;
27465         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27466         des_xmlNodePtr(n_node, node, 1);
27467         xmlResetLastError();
27468         if (mem_base != xmlMemBlocks()) {
27469             printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27470                    xmlMemBlocks() - mem_base);
27471             test_ret++;
27472             printf(" %d", n_ctxt);
27473             printf(" %d", n_node);
27474             printf("\n");
27475         }
27476     }
27477     }
27478     function_tests++;
27479 #endif
27480
27481     return(test_ret);
27482 }
27483
27484
27485 static int
27486 test_xmlXIncludeProcessTree(void) {
27487     int test_ret = 0;
27488
27489 #if defined(LIBXML_XINCLUDE_ENABLED)
27490     int mem_base;
27491     int ret_val;
27492     xmlNodePtr tree; /* a node in an XML document */
27493     int n_tree;
27494
27495     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27496         mem_base = xmlMemBlocks();
27497         tree = gen_xmlNodePtr(n_tree, 0);
27498
27499         ret_val = xmlXIncludeProcessTree(tree);
27500         desret_int(ret_val);
27501         call_tests++;
27502         des_xmlNodePtr(n_tree, tree, 0);
27503         xmlResetLastError();
27504         if (mem_base != xmlMemBlocks()) {
27505             printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27506                    xmlMemBlocks() - mem_base);
27507             test_ret++;
27508             printf(" %d", n_tree);
27509             printf("\n");
27510         }
27511     }
27512     function_tests++;
27513 #endif
27514
27515     return(test_ret);
27516 }
27517
27518
27519 static int
27520 test_xmlXIncludeProcessTreeFlags(void) {
27521     int test_ret = 0;
27522
27523 #if defined(LIBXML_XINCLUDE_ENABLED)
27524     int mem_base;
27525     int ret_val;
27526     xmlNodePtr tree; /* a node in an XML document */
27527     int n_tree;
27528     int flags; /* a set of xmlParserOption used for parsing XML includes */
27529     int n_flags;
27530
27531     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27532     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27533         mem_base = xmlMemBlocks();
27534         tree = gen_xmlNodePtr(n_tree, 0);
27535         flags = gen_int(n_flags, 1);
27536
27537         ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27538         desret_int(ret_val);
27539         call_tests++;
27540         des_xmlNodePtr(n_tree, tree, 0);
27541         des_int(n_flags, flags, 1);
27542         xmlResetLastError();
27543         if (mem_base != xmlMemBlocks()) {
27544             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27545                    xmlMemBlocks() - mem_base);
27546             test_ret++;
27547             printf(" %d", n_tree);
27548             printf(" %d", n_flags);
27549             printf("\n");
27550         }
27551     }
27552     }
27553     function_tests++;
27554 #endif
27555
27556     return(test_ret);
27557 }
27558
27559
27560 static int
27561 test_xmlXIncludeProcessTreeFlagsData(void) {
27562     int test_ret = 0;
27563
27564 #if defined(LIBXML_XINCLUDE_ENABLED)
27565     int mem_base;
27566     int ret_val;
27567     xmlNodePtr tree; /* an XML node */
27568     int n_tree;
27569     int flags; /* a set of xmlParserOption used for parsing XML includes */
27570     int n_flags;
27571     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27572     int n_data;
27573
27574     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27575     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27576     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27577         mem_base = xmlMemBlocks();
27578         tree = gen_xmlNodePtr(n_tree, 0);
27579         flags = gen_int(n_flags, 1);
27580         data = gen_userdata(n_data, 2);
27581
27582         ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27583         desret_int(ret_val);
27584         call_tests++;
27585         des_xmlNodePtr(n_tree, tree, 0);
27586         des_int(n_flags, flags, 1);
27587         des_userdata(n_data, data, 2);
27588         xmlResetLastError();
27589         if (mem_base != xmlMemBlocks()) {
27590             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27591                    xmlMemBlocks() - mem_base);
27592             test_ret++;
27593             printf(" %d", n_tree);
27594             printf(" %d", n_flags);
27595             printf(" %d", n_data);
27596             printf("\n");
27597         }
27598     }
27599     }
27600     }
27601     function_tests++;
27602 #endif
27603
27604     return(test_ret);
27605 }
27606
27607
27608 static int
27609 test_xmlXIncludeSetFlags(void) {
27610     int test_ret = 0;
27611
27612 #if defined(LIBXML_XINCLUDE_ENABLED)
27613     int mem_base;
27614     int ret_val;
27615     xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27616     int n_ctxt;
27617     int flags; /* a set of xmlParserOption used for parsing XML includes */
27618     int n_flags;
27619
27620     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27621     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27622         mem_base = xmlMemBlocks();
27623         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27624         flags = gen_int(n_flags, 1);
27625
27626         ret_val = xmlXIncludeSetFlags(ctxt, flags);
27627         desret_int(ret_val);
27628         call_tests++;
27629         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27630         des_int(n_flags, flags, 1);
27631         xmlResetLastError();
27632         if (mem_base != xmlMemBlocks()) {
27633             printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27634                    xmlMemBlocks() - mem_base);
27635             test_ret++;
27636             printf(" %d", n_ctxt);
27637             printf(" %d", n_flags);
27638             printf("\n");
27639         }
27640     }
27641     }
27642     function_tests++;
27643 #endif
27644
27645     return(test_ret);
27646 }
27647
27648 static int
27649 test_xinclude(void) {
27650     int test_ret = 0;
27651
27652     if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27653     test_ret += test_xmlXIncludeNewContext();
27654     test_ret += test_xmlXIncludeProcess();
27655     test_ret += test_xmlXIncludeProcessFlags();
27656     test_ret += test_xmlXIncludeProcessFlagsData();
27657     test_ret += test_xmlXIncludeProcessNode();
27658     test_ret += test_xmlXIncludeProcessTree();
27659     test_ret += test_xmlXIncludeProcessTreeFlags();
27660     test_ret += test_xmlXIncludeProcessTreeFlagsData();
27661     test_ret += test_xmlXIncludeSetFlags();
27662
27663     if (test_ret != 0)
27664         printf("Module xinclude: %d errors\n", test_ret);
27665     return(test_ret);
27666 }
27667
27668 static int
27669 test_xmlAllocOutputBuffer(void) {
27670     int test_ret = 0;
27671
27672 #if defined(LIBXML_OUTPUT_ENABLED)
27673     int mem_base;
27674     xmlOutputBufferPtr ret_val;
27675     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27676     int n_encoder;
27677
27678     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27679         mem_base = xmlMemBlocks();
27680         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27681
27682         ret_val = xmlAllocOutputBuffer(encoder);
27683         desret_xmlOutputBufferPtr(ret_val);
27684         call_tests++;
27685         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27686         xmlResetLastError();
27687         if (mem_base != xmlMemBlocks()) {
27688             printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27689                    xmlMemBlocks() - mem_base);
27690             test_ret++;
27691             printf(" %d", n_encoder);
27692             printf("\n");
27693         }
27694     }
27695     function_tests++;
27696 #endif
27697
27698     return(test_ret);
27699 }
27700
27701
27702 static int
27703 test_xmlAllocParserInputBuffer(void) {
27704     int test_ret = 0;
27705
27706     int mem_base;
27707     xmlParserInputBufferPtr ret_val;
27708     xmlCharEncoding enc; /* the charset encoding if known */
27709     int n_enc;
27710
27711     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27712         mem_base = xmlMemBlocks();
27713         enc = gen_xmlCharEncoding(n_enc, 0);
27714
27715         ret_val = xmlAllocParserInputBuffer(enc);
27716         desret_xmlParserInputBufferPtr(ret_val);
27717         call_tests++;
27718         des_xmlCharEncoding(n_enc, enc, 0);
27719         xmlResetLastError();
27720         if (mem_base != xmlMemBlocks()) {
27721             printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27722                    xmlMemBlocks() - mem_base);
27723             test_ret++;
27724             printf(" %d", n_enc);
27725             printf("\n");
27726         }
27727     }
27728     function_tests++;
27729
27730     return(test_ret);
27731 }
27732
27733
27734 static int
27735 test_xmlCheckFilename(void) {
27736     int test_ret = 0;
27737
27738     int mem_base;
27739     int ret_val;
27740     char * path; /* the path to check */
27741     int n_path;
27742
27743     for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27744         mem_base = xmlMemBlocks();
27745         path = gen_const_char_ptr(n_path, 0);
27746
27747         ret_val = xmlCheckFilename((const char *)path);
27748         desret_int(ret_val);
27749         call_tests++;
27750         des_const_char_ptr(n_path, (const char *)path, 0);
27751         xmlResetLastError();
27752         if (mem_base != xmlMemBlocks()) {
27753             printf("Leak of %d blocks found in xmlCheckFilename",
27754                    xmlMemBlocks() - mem_base);
27755             test_ret++;
27756             printf(" %d", n_path);
27757             printf("\n");
27758         }
27759     }
27760     function_tests++;
27761
27762     return(test_ret);
27763 }
27764
27765
27766 static int
27767 test_xmlCheckHTTPInput(void) {
27768     int test_ret = 0;
27769
27770     int mem_base;
27771     xmlParserInputPtr ret_val;
27772     xmlParserCtxtPtr ctxt; /* an XML parser context */
27773     int n_ctxt;
27774     xmlParserInputPtr ret; /* an XML parser input */
27775     int n_ret;
27776
27777     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27778     for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27779         mem_base = xmlMemBlocks();
27780         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27781         ret = gen_xmlParserInputPtr(n_ret, 1);
27782
27783         ret_val = xmlCheckHTTPInput(ctxt, ret);
27784         desret_xmlParserInputPtr(ret_val);
27785         call_tests++;
27786         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27787         des_xmlParserInputPtr(n_ret, ret, 1);
27788         xmlResetLastError();
27789         if (mem_base != xmlMemBlocks()) {
27790             printf("Leak of %d blocks found in xmlCheckHTTPInput",
27791                    xmlMemBlocks() - mem_base);
27792             test_ret++;
27793             printf(" %d", n_ctxt);
27794             printf(" %d", n_ret);
27795             printf("\n");
27796         }
27797     }
27798     }
27799     function_tests++;
27800
27801     return(test_ret);
27802 }
27803
27804
27805 static int
27806 test_xmlCleanupInputCallbacks(void) {
27807     int test_ret = 0;
27808
27809     int mem_base;
27810
27811         mem_base = xmlMemBlocks();
27812
27813         xmlCleanupInputCallbacks();
27814         call_tests++;
27815         xmlResetLastError();
27816         if (mem_base != xmlMemBlocks()) {
27817             printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27818                    xmlMemBlocks() - mem_base);
27819             test_ret++;
27820             printf("\n");
27821         }
27822     function_tests++;
27823
27824     return(test_ret);
27825 }
27826
27827
27828 static int
27829 test_xmlCleanupOutputCallbacks(void) {
27830     int test_ret = 0;
27831
27832 #if defined(LIBXML_OUTPUT_ENABLED)
27833     int mem_base;
27834
27835         mem_base = xmlMemBlocks();
27836
27837         xmlCleanupOutputCallbacks();
27838         call_tests++;
27839         xmlResetLastError();
27840         if (mem_base != xmlMemBlocks()) {
27841             printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27842                    xmlMemBlocks() - mem_base);
27843             test_ret++;
27844             printf("\n");
27845         }
27846     function_tests++;
27847 #endif
27848
27849     return(test_ret);
27850 }
27851
27852
27853 static int
27854 test_xmlFileClose(void) {
27855     int test_ret = 0;
27856
27857     int mem_base;
27858     int ret_val;
27859     void * context; /* the I/O context */
27860     int n_context;
27861
27862     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27863         mem_base = xmlMemBlocks();
27864         context = gen_void_ptr(n_context, 0);
27865
27866         ret_val = xmlFileClose(context);
27867         desret_int(ret_val);
27868         call_tests++;
27869         des_void_ptr(n_context, context, 0);
27870         xmlResetLastError();
27871         if (mem_base != xmlMemBlocks()) {
27872             printf("Leak of %d blocks found in xmlFileClose",
27873                    xmlMemBlocks() - mem_base);
27874             test_ret++;
27875             printf(" %d", n_context);
27876             printf("\n");
27877         }
27878     }
27879     function_tests++;
27880
27881     return(test_ret);
27882 }
27883
27884
27885 static int
27886 test_xmlFileMatch(void) {
27887     int test_ret = 0;
27888
27889     int mem_base;
27890     int ret_val;
27891     const char * filename; /* the URI for matching */
27892     int n_filename;
27893
27894     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27895         mem_base = xmlMemBlocks();
27896         filename = gen_filepath(n_filename, 0);
27897
27898         ret_val = xmlFileMatch(filename);
27899         desret_int(ret_val);
27900         call_tests++;
27901         des_filepath(n_filename, filename, 0);
27902         xmlResetLastError();
27903         if (mem_base != xmlMemBlocks()) {
27904             printf("Leak of %d blocks found in xmlFileMatch",
27905                    xmlMemBlocks() - mem_base);
27906             test_ret++;
27907             printf(" %d", n_filename);
27908             printf("\n");
27909         }
27910     }
27911     function_tests++;
27912
27913     return(test_ret);
27914 }
27915
27916
27917 static int
27918 test_xmlFileOpen(void) {
27919     int test_ret = 0;
27920
27921     int mem_base;
27922     void * ret_val;
27923     const char * filename; /* the URI for matching */
27924     int n_filename;
27925
27926     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27927         mem_base = xmlMemBlocks();
27928         filename = gen_filepath(n_filename, 0);
27929
27930         ret_val = xmlFileOpen(filename);
27931         desret_void_ptr(ret_val);
27932         call_tests++;
27933         des_filepath(n_filename, filename, 0);
27934         xmlResetLastError();
27935         if (mem_base != xmlMemBlocks()) {
27936             printf("Leak of %d blocks found in xmlFileOpen",
27937                    xmlMemBlocks() - mem_base);
27938             test_ret++;
27939             printf(" %d", n_filename);
27940             printf("\n");
27941         }
27942     }
27943     function_tests++;
27944
27945     return(test_ret);
27946 }
27947
27948
27949 static int
27950 test_xmlFileRead(void) {
27951     int test_ret = 0;
27952
27953     int mem_base;
27954     int ret_val;
27955     void * context; /* the I/O context */
27956     int n_context;
27957     char * buffer; /* where to drop data */
27958     int n_buffer;
27959     int len; /* number of bytes to write */
27960     int n_len;
27961
27962     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27963     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27964     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27965         mem_base = xmlMemBlocks();
27966         context = gen_void_ptr(n_context, 0);
27967         buffer = gen_char_ptr(n_buffer, 1);
27968         len = gen_int(n_len, 2);
27969
27970         ret_val = xmlFileRead(context, buffer, len);
27971         desret_int(ret_val);
27972         call_tests++;
27973         des_void_ptr(n_context, context, 0);
27974         des_char_ptr(n_buffer, buffer, 1);
27975         des_int(n_len, len, 2);
27976         xmlResetLastError();
27977         if (mem_base != xmlMemBlocks()) {
27978             printf("Leak of %d blocks found in xmlFileRead",
27979                    xmlMemBlocks() - mem_base);
27980             test_ret++;
27981             printf(" %d", n_context);
27982             printf(" %d", n_buffer);
27983             printf(" %d", n_len);
27984             printf("\n");
27985         }
27986     }
27987     }
27988     }
27989     function_tests++;
27990
27991     return(test_ret);
27992 }
27993
27994
27995 static int
27996 test_xmlIOFTPClose(void) {
27997     int test_ret = 0;
27998
27999 #if defined(LIBXML_FTP_ENABLED)
28000     int mem_base;
28001     int ret_val;
28002     void * context; /* the I/O context */
28003     int n_context;
28004
28005     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28006         mem_base = xmlMemBlocks();
28007         context = gen_void_ptr(n_context, 0);
28008
28009         ret_val = xmlIOFTPClose(context);
28010         desret_int(ret_val);
28011         call_tests++;
28012         des_void_ptr(n_context, context, 0);
28013         xmlResetLastError();
28014         if (mem_base != xmlMemBlocks()) {
28015             printf("Leak of %d blocks found in xmlIOFTPClose",
28016                    xmlMemBlocks() - mem_base);
28017             test_ret++;
28018             printf(" %d", n_context);
28019             printf("\n");
28020         }
28021     }
28022     function_tests++;
28023 #endif
28024
28025     return(test_ret);
28026 }
28027
28028
28029 static int
28030 test_xmlIOFTPMatch(void) {
28031     int test_ret = 0;
28032
28033 #if defined(LIBXML_FTP_ENABLED)
28034     int mem_base;
28035     int ret_val;
28036     const char * filename; /* the URI for matching */
28037     int n_filename;
28038
28039     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28040         mem_base = xmlMemBlocks();
28041         filename = gen_filepath(n_filename, 0);
28042
28043         ret_val = xmlIOFTPMatch(filename);
28044         desret_int(ret_val);
28045         call_tests++;
28046         des_filepath(n_filename, filename, 0);
28047         xmlResetLastError();
28048         if (mem_base != xmlMemBlocks()) {
28049             printf("Leak of %d blocks found in xmlIOFTPMatch",
28050                    xmlMemBlocks() - mem_base);
28051             test_ret++;
28052             printf(" %d", n_filename);
28053             printf("\n");
28054         }
28055     }
28056     function_tests++;
28057 #endif
28058
28059     return(test_ret);
28060 }
28061
28062
28063 static int
28064 test_xmlIOFTPOpen(void) {
28065     int test_ret = 0;
28066
28067 #if defined(LIBXML_FTP_ENABLED)
28068     int mem_base;
28069     void * ret_val;
28070     const char * filename; /* the URI for matching */
28071     int n_filename;
28072
28073     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28074         mem_base = xmlMemBlocks();
28075         filename = gen_filepath(n_filename, 0);
28076
28077         ret_val = xmlIOFTPOpen(filename);
28078         desret_void_ptr(ret_val);
28079         call_tests++;
28080         des_filepath(n_filename, filename, 0);
28081         xmlResetLastError();
28082         if (mem_base != xmlMemBlocks()) {
28083             printf("Leak of %d blocks found in xmlIOFTPOpen",
28084                    xmlMemBlocks() - mem_base);
28085             test_ret++;
28086             printf(" %d", n_filename);
28087             printf("\n");
28088         }
28089     }
28090     function_tests++;
28091 #endif
28092
28093     return(test_ret);
28094 }
28095
28096
28097 static int
28098 test_xmlIOFTPRead(void) {
28099     int test_ret = 0;
28100
28101 #if defined(LIBXML_FTP_ENABLED)
28102     int mem_base;
28103     int ret_val;
28104     void * context; /* the I/O context */
28105     int n_context;
28106     char * buffer; /* where to drop data */
28107     int n_buffer;
28108     int len; /* number of bytes to write */
28109     int n_len;
28110
28111     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28112     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28113     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28114         mem_base = xmlMemBlocks();
28115         context = gen_void_ptr(n_context, 0);
28116         buffer = gen_char_ptr(n_buffer, 1);
28117         len = gen_int(n_len, 2);
28118
28119         ret_val = xmlIOFTPRead(context, buffer, len);
28120         desret_int(ret_val);
28121         call_tests++;
28122         des_void_ptr(n_context, context, 0);
28123         des_char_ptr(n_buffer, buffer, 1);
28124         des_int(n_len, len, 2);
28125         xmlResetLastError();
28126         if (mem_base != xmlMemBlocks()) {
28127             printf("Leak of %d blocks found in xmlIOFTPRead",
28128                    xmlMemBlocks() - mem_base);
28129             test_ret++;
28130             printf(" %d", n_context);
28131             printf(" %d", n_buffer);
28132             printf(" %d", n_len);
28133             printf("\n");
28134         }
28135     }
28136     }
28137     }
28138     function_tests++;
28139 #endif
28140
28141     return(test_ret);
28142 }
28143
28144
28145 static int
28146 test_xmlIOHTTPClose(void) {
28147     int test_ret = 0;
28148
28149 #if defined(LIBXML_HTTP_ENABLED)
28150     int mem_base;
28151     int ret_val;
28152     void * context; /* the I/O context */
28153     int n_context;
28154
28155     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28156         mem_base = xmlMemBlocks();
28157         context = gen_void_ptr(n_context, 0);
28158
28159         ret_val = xmlIOHTTPClose(context);
28160         desret_int(ret_val);
28161         call_tests++;
28162         des_void_ptr(n_context, context, 0);
28163         xmlResetLastError();
28164         if (mem_base != xmlMemBlocks()) {
28165             printf("Leak of %d blocks found in xmlIOHTTPClose",
28166                    xmlMemBlocks() - mem_base);
28167             test_ret++;
28168             printf(" %d", n_context);
28169             printf("\n");
28170         }
28171     }
28172     function_tests++;
28173 #endif
28174
28175     return(test_ret);
28176 }
28177
28178
28179 static int
28180 test_xmlIOHTTPMatch(void) {
28181     int test_ret = 0;
28182
28183 #if defined(LIBXML_HTTP_ENABLED)
28184     int mem_base;
28185     int ret_val;
28186     const char * filename; /* the URI for matching */
28187     int n_filename;
28188
28189     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28190         mem_base = xmlMemBlocks();
28191         filename = gen_filepath(n_filename, 0);
28192
28193         ret_val = xmlIOHTTPMatch(filename);
28194         desret_int(ret_val);
28195         call_tests++;
28196         des_filepath(n_filename, filename, 0);
28197         xmlResetLastError();
28198         if (mem_base != xmlMemBlocks()) {
28199             printf("Leak of %d blocks found in xmlIOHTTPMatch",
28200                    xmlMemBlocks() - mem_base);
28201             test_ret++;
28202             printf(" %d", n_filename);
28203             printf("\n");
28204         }
28205     }
28206     function_tests++;
28207 #endif
28208
28209     return(test_ret);
28210 }
28211
28212
28213 static int
28214 test_xmlIOHTTPOpen(void) {
28215     int test_ret = 0;
28216
28217 #if defined(LIBXML_HTTP_ENABLED)
28218     int mem_base;
28219     void * ret_val;
28220     const char * filename; /* the URI for matching */
28221     int n_filename;
28222
28223     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28224         mem_base = xmlMemBlocks();
28225         filename = gen_filepath(n_filename, 0);
28226
28227         ret_val = xmlIOHTTPOpen(filename);
28228         desret_xmlNanoHTTPCtxtPtr(ret_val);
28229         call_tests++;
28230         des_filepath(n_filename, filename, 0);
28231         xmlResetLastError();
28232         if (mem_base != xmlMemBlocks()) {
28233             printf("Leak of %d blocks found in xmlIOHTTPOpen",
28234                    xmlMemBlocks() - mem_base);
28235             test_ret++;
28236             printf(" %d", n_filename);
28237             printf("\n");
28238         }
28239     }
28240     function_tests++;
28241 #endif
28242
28243     return(test_ret);
28244 }
28245
28246
28247 static int
28248 test_xmlIOHTTPRead(void) {
28249     int test_ret = 0;
28250
28251 #if defined(LIBXML_HTTP_ENABLED)
28252     int mem_base;
28253     int ret_val;
28254     void * context; /* the I/O context */
28255     int n_context;
28256     char * buffer; /* where to drop data */
28257     int n_buffer;
28258     int len; /* number of bytes to write */
28259     int n_len;
28260
28261     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28262     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28263     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28264         mem_base = xmlMemBlocks();
28265         context = gen_void_ptr(n_context, 0);
28266         buffer = gen_char_ptr(n_buffer, 1);
28267         len = gen_int(n_len, 2);
28268
28269         ret_val = xmlIOHTTPRead(context, buffer, len);
28270         desret_int(ret_val);
28271         call_tests++;
28272         des_void_ptr(n_context, context, 0);
28273         des_char_ptr(n_buffer, buffer, 1);
28274         des_int(n_len, len, 2);
28275         xmlResetLastError();
28276         if (mem_base != xmlMemBlocks()) {
28277             printf("Leak of %d blocks found in xmlIOHTTPRead",
28278                    xmlMemBlocks() - mem_base);
28279             test_ret++;
28280             printf(" %d", n_context);
28281             printf(" %d", n_buffer);
28282             printf(" %d", n_len);
28283             printf("\n");
28284         }
28285     }
28286     }
28287     }
28288     function_tests++;
28289 #endif
28290
28291     return(test_ret);
28292 }
28293
28294
28295 static int
28296 test_xmlNoNetExternalEntityLoader(void) {
28297     int test_ret = 0;
28298
28299     int mem_base;
28300     xmlParserInputPtr ret_val;
28301     const char * URL; /* the URL for the entity to load */
28302     int n_URL;
28303     char * ID; /* the System ID for the entity to load */
28304     int n_ID;
28305     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28306     int n_ctxt;
28307
28308     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28309     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28310     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28311         mem_base = xmlMemBlocks();
28312         URL = gen_filepath(n_URL, 0);
28313         ID = gen_const_char_ptr(n_ID, 1);
28314         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28315
28316         ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28317         desret_xmlParserInputPtr(ret_val);
28318         call_tests++;
28319         des_filepath(n_URL, URL, 0);
28320         des_const_char_ptr(n_ID, (const char *)ID, 1);
28321         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28322         xmlResetLastError();
28323         if (mem_base != xmlMemBlocks()) {
28324             printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28325                    xmlMemBlocks() - mem_base);
28326             test_ret++;
28327             printf(" %d", n_URL);
28328             printf(" %d", n_ID);
28329             printf(" %d", n_ctxt);
28330             printf("\n");
28331         }
28332     }
28333     }
28334     }
28335     function_tests++;
28336
28337     return(test_ret);
28338 }
28339
28340
28341 static int
28342 test_xmlNormalizeWindowsPath(void) {
28343     int test_ret = 0;
28344
28345     int mem_base;
28346     xmlChar * ret_val;
28347     xmlChar * path; /* the input file path */
28348     int n_path;
28349
28350     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28351         mem_base = xmlMemBlocks();
28352         path = gen_const_xmlChar_ptr(n_path, 0);
28353
28354         ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28355         desret_xmlChar_ptr(ret_val);
28356         call_tests++;
28357         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28358         xmlResetLastError();
28359         if (mem_base != xmlMemBlocks()) {
28360             printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28361                    xmlMemBlocks() - mem_base);
28362             test_ret++;
28363             printf(" %d", n_path);
28364             printf("\n");
28365         }
28366     }
28367     function_tests++;
28368
28369     return(test_ret);
28370 }
28371
28372
28373 static int
28374 test_xmlOutputBufferCreateBuffer(void) {
28375     int test_ret = 0;
28376
28377 #if defined(LIBXML_OUTPUT_ENABLED)
28378     int mem_base;
28379     xmlOutputBufferPtr ret_val;
28380     xmlBufferPtr buffer; /* a xmlBufferPtr */
28381     int n_buffer;
28382     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28383     int n_encoder;
28384
28385     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28386     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28387         mem_base = xmlMemBlocks();
28388         buffer = gen_xmlBufferPtr(n_buffer, 0);
28389         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28390
28391         ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28392         desret_xmlOutputBufferPtr(ret_val);
28393         call_tests++;
28394         des_xmlBufferPtr(n_buffer, buffer, 0);
28395         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28396         xmlResetLastError();
28397         if (mem_base != xmlMemBlocks()) {
28398             printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28399                    xmlMemBlocks() - mem_base);
28400             test_ret++;
28401             printf(" %d", n_buffer);
28402             printf(" %d", n_encoder);
28403             printf("\n");
28404         }
28405     }
28406     }
28407     function_tests++;
28408 #endif
28409
28410     return(test_ret);
28411 }
28412
28413
28414 static int
28415 test_xmlOutputBufferCreateFd(void) {
28416     int test_ret = 0;
28417
28418 #if defined(LIBXML_OUTPUT_ENABLED)
28419     int mem_base;
28420     xmlOutputBufferPtr ret_val;
28421     int fd; /* a file descriptor number */
28422     int n_fd;
28423     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28424     int n_encoder;
28425
28426     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28427     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28428         mem_base = xmlMemBlocks();
28429         fd = gen_int(n_fd, 0);
28430         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28431
28432         ret_val = xmlOutputBufferCreateFd(fd, encoder);
28433         desret_xmlOutputBufferPtr(ret_val);
28434         call_tests++;
28435         des_int(n_fd, fd, 0);
28436         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28437         xmlResetLastError();
28438         if (mem_base != xmlMemBlocks()) {
28439             printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28440                    xmlMemBlocks() - mem_base);
28441             test_ret++;
28442             printf(" %d", n_fd);
28443             printf(" %d", n_encoder);
28444             printf("\n");
28445         }
28446     }
28447     }
28448     function_tests++;
28449 #endif
28450
28451     return(test_ret);
28452 }
28453
28454
28455 static int
28456 test_xmlOutputBufferCreateFile(void) {
28457     int test_ret = 0;
28458
28459 #if defined(LIBXML_OUTPUT_ENABLED)
28460     int mem_base;
28461     xmlOutputBufferPtr ret_val;
28462     FILE * file; /* a FILE* */
28463     int n_file;
28464     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28465     int n_encoder;
28466
28467     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28468     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28469         mem_base = xmlMemBlocks();
28470         file = gen_FILE_ptr(n_file, 0);
28471         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28472
28473         ret_val = xmlOutputBufferCreateFile(file, encoder);
28474         desret_xmlOutputBufferPtr(ret_val);
28475         call_tests++;
28476         des_FILE_ptr(n_file, file, 0);
28477         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28478         xmlResetLastError();
28479         if (mem_base != xmlMemBlocks()) {
28480             printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28481                    xmlMemBlocks() - mem_base);
28482             test_ret++;
28483             printf(" %d", n_file);
28484             printf(" %d", n_encoder);
28485             printf("\n");
28486         }
28487     }
28488     }
28489     function_tests++;
28490 #endif
28491
28492     return(test_ret);
28493 }
28494
28495
28496 static int
28497 test_xmlOutputBufferCreateFilename(void) {
28498     int test_ret = 0;
28499
28500 #if defined(LIBXML_OUTPUT_ENABLED)
28501     int mem_base;
28502     xmlOutputBufferPtr ret_val;
28503     const char * URI; /* a C string containing the URI or filename */
28504     int n_URI;
28505     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28506     int n_encoder;
28507     int compression; /* the compression ration (0 none, 9 max). */
28508     int n_compression;
28509
28510     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28511     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28512     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28513         mem_base = xmlMemBlocks();
28514         URI = gen_fileoutput(n_URI, 0);
28515         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28516         compression = gen_int(n_compression, 2);
28517
28518         ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28519         desret_xmlOutputBufferPtr(ret_val);
28520         call_tests++;
28521         des_fileoutput(n_URI, URI, 0);
28522         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28523         des_int(n_compression, compression, 2);
28524         xmlResetLastError();
28525         if (mem_base != xmlMemBlocks()) {
28526             printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28527                    xmlMemBlocks() - mem_base);
28528             test_ret++;
28529             printf(" %d", n_URI);
28530             printf(" %d", n_encoder);
28531             printf(" %d", n_compression);
28532             printf("\n");
28533         }
28534     }
28535     }
28536     }
28537     function_tests++;
28538 #endif
28539
28540     return(test_ret);
28541 }
28542
28543
28544 static int
28545 test_xmlOutputBufferFlush(void) {
28546     int test_ret = 0;
28547
28548 #if defined(LIBXML_OUTPUT_ENABLED)
28549     int mem_base;
28550     int ret_val;
28551     xmlOutputBufferPtr out; /* a buffered output */
28552     int n_out;
28553
28554     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28555         mem_base = xmlMemBlocks();
28556         out = gen_xmlOutputBufferPtr(n_out, 0);
28557
28558         ret_val = xmlOutputBufferFlush(out);
28559         desret_int(ret_val);
28560         call_tests++;
28561         des_xmlOutputBufferPtr(n_out, out, 0);
28562         xmlResetLastError();
28563         if (mem_base != xmlMemBlocks()) {
28564             printf("Leak of %d blocks found in xmlOutputBufferFlush",
28565                    xmlMemBlocks() - mem_base);
28566             test_ret++;
28567             printf(" %d", n_out);
28568             printf("\n");
28569         }
28570     }
28571     function_tests++;
28572 #endif
28573
28574     return(test_ret);
28575 }
28576
28577
28578 static int
28579 test_xmlOutputBufferGetContent(void) {
28580     int test_ret = 0;
28581
28582 #if defined(LIBXML_OUTPUT_ENABLED)
28583     int mem_base;
28584     const xmlChar * ret_val;
28585     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
28586     int n_out;
28587
28588     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28589         mem_base = xmlMemBlocks();
28590         out = gen_xmlOutputBufferPtr(n_out, 0);
28591
28592         ret_val = xmlOutputBufferGetContent(out);
28593         desret_const_xmlChar_ptr(ret_val);
28594         call_tests++;
28595         des_xmlOutputBufferPtr(n_out, out, 0);
28596         xmlResetLastError();
28597         if (mem_base != xmlMemBlocks()) {
28598             printf("Leak of %d blocks found in xmlOutputBufferGetContent",
28599                    xmlMemBlocks() - mem_base);
28600             test_ret++;
28601             printf(" %d", n_out);
28602             printf("\n");
28603         }
28604     }
28605     function_tests++;
28606 #endif
28607
28608     return(test_ret);
28609 }
28610
28611
28612 static int
28613 test_xmlOutputBufferGetSize(void) {
28614     int test_ret = 0;
28615
28616
28617     /* missing type support */
28618     return(test_ret);
28619 }
28620
28621
28622 static int
28623 test_xmlOutputBufferWrite(void) {
28624     int test_ret = 0;
28625
28626 #if defined(LIBXML_OUTPUT_ENABLED)
28627     int mem_base;
28628     int ret_val;
28629     xmlOutputBufferPtr out; /* a buffered parser output */
28630     int n_out;
28631     int len; /* the size in bytes of the array. */
28632     int n_len;
28633     char * buf; /* an char array */
28634     int n_buf;
28635
28636     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28637     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28638     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28639         mem_base = xmlMemBlocks();
28640         out = gen_xmlOutputBufferPtr(n_out, 0);
28641         len = gen_int(n_len, 1);
28642         buf = gen_const_char_ptr(n_buf, 2);
28643
28644         ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28645         desret_int(ret_val);
28646         call_tests++;
28647         des_xmlOutputBufferPtr(n_out, out, 0);
28648         des_int(n_len, len, 1);
28649         des_const_char_ptr(n_buf, (const char *)buf, 2);
28650         xmlResetLastError();
28651         if (mem_base != xmlMemBlocks()) {
28652             printf("Leak of %d blocks found in xmlOutputBufferWrite",
28653                    xmlMemBlocks() - mem_base);
28654             test_ret++;
28655             printf(" %d", n_out);
28656             printf(" %d", n_len);
28657             printf(" %d", n_buf);
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_xmlOutputBufferWriteEscape(void) {
28672     int test_ret = 0;
28673
28674
28675     /* missing type support */
28676     return(test_ret);
28677 }
28678
28679
28680 static int
28681 test_xmlOutputBufferWriteString(void) {
28682     int test_ret = 0;
28683
28684 #if defined(LIBXML_OUTPUT_ENABLED)
28685     int mem_base;
28686     int ret_val;
28687     xmlOutputBufferPtr out; /* a buffered parser output */
28688     int n_out;
28689     char * str; /* a zero terminated C string */
28690     int n_str;
28691
28692     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28693     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28694         mem_base = xmlMemBlocks();
28695         out = gen_xmlOutputBufferPtr(n_out, 0);
28696         str = gen_const_char_ptr(n_str, 1);
28697
28698         ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28699         desret_int(ret_val);
28700         call_tests++;
28701         des_xmlOutputBufferPtr(n_out, out, 0);
28702         des_const_char_ptr(n_str, (const char *)str, 1);
28703         xmlResetLastError();
28704         if (mem_base != xmlMemBlocks()) {
28705             printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28706                    xmlMemBlocks() - mem_base);
28707             test_ret++;
28708             printf(" %d", n_out);
28709             printf(" %d", n_str);
28710             printf("\n");
28711         }
28712     }
28713     }
28714     function_tests++;
28715 #endif
28716
28717     return(test_ret);
28718 }
28719
28720
28721 static int
28722 test_xmlParserGetDirectory(void) {
28723     int test_ret = 0;
28724
28725
28726     /* missing type support */
28727     return(test_ret);
28728 }
28729
28730
28731 static int
28732 test_xmlParserInputBufferCreateFd(void) {
28733     int test_ret = 0;
28734
28735     int mem_base;
28736     xmlParserInputBufferPtr ret_val;
28737     int fd; /* a file descriptor number */
28738     int n_fd;
28739     xmlCharEncoding enc; /* the charset encoding if known */
28740     int n_enc;
28741
28742     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28743     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28744         mem_base = xmlMemBlocks();
28745         fd = gen_int(n_fd, 0);
28746         enc = gen_xmlCharEncoding(n_enc, 1);
28747         if (fd >= 0) fd = -1;
28748
28749         ret_val = xmlParserInputBufferCreateFd(fd, enc);
28750         desret_xmlParserInputBufferPtr(ret_val);
28751         call_tests++;
28752         des_int(n_fd, fd, 0);
28753         des_xmlCharEncoding(n_enc, enc, 1);
28754         xmlResetLastError();
28755         if (mem_base != xmlMemBlocks()) {
28756             printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28757                    xmlMemBlocks() - mem_base);
28758             test_ret++;
28759             printf(" %d", n_fd);
28760             printf(" %d", n_enc);
28761             printf("\n");
28762         }
28763     }
28764     }
28765     function_tests++;
28766
28767     return(test_ret);
28768 }
28769
28770
28771 static int
28772 test_xmlParserInputBufferCreateFile(void) {
28773     int test_ret = 0;
28774
28775     int mem_base;
28776     xmlParserInputBufferPtr ret_val;
28777     FILE * file; /* a FILE* */
28778     int n_file;
28779     xmlCharEncoding enc; /* the charset encoding if known */
28780     int n_enc;
28781
28782     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28783     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28784         mem_base = xmlMemBlocks();
28785         file = gen_FILE_ptr(n_file, 0);
28786         enc = gen_xmlCharEncoding(n_enc, 1);
28787
28788         ret_val = xmlParserInputBufferCreateFile(file, enc);
28789         desret_xmlParserInputBufferPtr(ret_val);
28790         call_tests++;
28791         des_FILE_ptr(n_file, file, 0);
28792         des_xmlCharEncoding(n_enc, enc, 1);
28793         xmlResetLastError();
28794         if (mem_base != xmlMemBlocks()) {
28795             printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28796                    xmlMemBlocks() - mem_base);
28797             test_ret++;
28798             printf(" %d", n_file);
28799             printf(" %d", n_enc);
28800             printf("\n");
28801         }
28802     }
28803     }
28804     function_tests++;
28805
28806     return(test_ret);
28807 }
28808
28809
28810 static int
28811 test_xmlParserInputBufferCreateFilename(void) {
28812     int test_ret = 0;
28813
28814     int mem_base;
28815     xmlParserInputBufferPtr ret_val;
28816     const char * URI; /* a C string containing the URI or filename */
28817     int n_URI;
28818     xmlCharEncoding enc; /* the charset encoding if known */
28819     int n_enc;
28820
28821     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28822     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28823         mem_base = xmlMemBlocks();
28824         URI = gen_fileoutput(n_URI, 0);
28825         enc = gen_xmlCharEncoding(n_enc, 1);
28826
28827         ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28828         desret_xmlParserInputBufferPtr(ret_val);
28829         call_tests++;
28830         des_fileoutput(n_URI, URI, 0);
28831         des_xmlCharEncoding(n_enc, enc, 1);
28832         xmlResetLastError();
28833         if (mem_base != xmlMemBlocks()) {
28834             printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28835                    xmlMemBlocks() - mem_base);
28836             test_ret++;
28837             printf(" %d", n_URI);
28838             printf(" %d", n_enc);
28839             printf("\n");
28840         }
28841     }
28842     }
28843     function_tests++;
28844
28845     return(test_ret);
28846 }
28847
28848
28849 static int
28850 test_xmlParserInputBufferCreateMem(void) {
28851     int test_ret = 0;
28852
28853     int mem_base;
28854     xmlParserInputBufferPtr ret_val;
28855     char * mem; /* the memory input */
28856     int n_mem;
28857     int size; /* the length of the memory block */
28858     int n_size;
28859     xmlCharEncoding enc; /* the charset encoding if known */
28860     int n_enc;
28861
28862     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28863     for (n_size = 0;n_size < gen_nb_int;n_size++) {
28864     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28865         mem_base = xmlMemBlocks();
28866         mem = gen_const_char_ptr(n_mem, 0);
28867         size = gen_int(n_size, 1);
28868         enc = gen_xmlCharEncoding(n_enc, 2);
28869
28870         ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28871         desret_xmlParserInputBufferPtr(ret_val);
28872         call_tests++;
28873         des_const_char_ptr(n_mem, (const char *)mem, 0);
28874         des_int(n_size, size, 1);
28875         des_xmlCharEncoding(n_enc, enc, 2);
28876         xmlResetLastError();
28877         if (mem_base != xmlMemBlocks()) {
28878             printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28879                    xmlMemBlocks() - mem_base);
28880             test_ret++;
28881             printf(" %d", n_mem);
28882             printf(" %d", n_size);
28883             printf(" %d", n_enc);
28884             printf("\n");
28885         }
28886     }
28887     }
28888     }
28889     function_tests++;
28890
28891     return(test_ret);
28892 }
28893
28894
28895 static int
28896 test_xmlParserInputBufferCreateStatic(void) {
28897     int test_ret = 0;
28898
28899     int mem_base;
28900     xmlParserInputBufferPtr ret_val;
28901     char * mem; /* the memory input */
28902     int n_mem;
28903     int size; /* the length of the memory block */
28904     int n_size;
28905     xmlCharEncoding enc; /* the charset encoding if known */
28906     int n_enc;
28907
28908     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28909     for (n_size = 0;n_size < gen_nb_int;n_size++) {
28910     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28911         mem_base = xmlMemBlocks();
28912         mem = gen_const_char_ptr(n_mem, 0);
28913         size = gen_int(n_size, 1);
28914         enc = gen_xmlCharEncoding(n_enc, 2);
28915
28916         ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28917         desret_xmlParserInputBufferPtr(ret_val);
28918         call_tests++;
28919         des_const_char_ptr(n_mem, (const char *)mem, 0);
28920         des_int(n_size, size, 1);
28921         des_xmlCharEncoding(n_enc, enc, 2);
28922         xmlResetLastError();
28923         if (mem_base != xmlMemBlocks()) {
28924             printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28925                    xmlMemBlocks() - mem_base);
28926             test_ret++;
28927             printf(" %d", n_mem);
28928             printf(" %d", n_size);
28929             printf(" %d", n_enc);
28930             printf("\n");
28931         }
28932     }
28933     }
28934     }
28935     function_tests++;
28936
28937     return(test_ret);
28938 }
28939
28940
28941 static int
28942 test_xmlParserInputBufferGrow(void) {
28943     int test_ret = 0;
28944
28945     int mem_base;
28946     int ret_val;
28947     xmlParserInputBufferPtr in; /* a buffered parser input */
28948     int n_in;
28949     int len; /* indicative value of the amount of chars to read */
28950     int n_len;
28951
28952     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28953     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28954         mem_base = xmlMemBlocks();
28955         in = gen_xmlParserInputBufferPtr(n_in, 0);
28956         len = gen_int(n_len, 1);
28957
28958         ret_val = xmlParserInputBufferGrow(in, len);
28959         desret_int(ret_val);
28960         call_tests++;
28961         des_xmlParserInputBufferPtr(n_in, in, 0);
28962         des_int(n_len, len, 1);
28963         xmlResetLastError();
28964         if (mem_base != xmlMemBlocks()) {
28965             printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28966                    xmlMemBlocks() - mem_base);
28967             test_ret++;
28968             printf(" %d", n_in);
28969             printf(" %d", n_len);
28970             printf("\n");
28971         }
28972     }
28973     }
28974     function_tests++;
28975
28976     return(test_ret);
28977 }
28978
28979
28980 static int
28981 test_xmlParserInputBufferPush(void) {
28982     int test_ret = 0;
28983
28984     int mem_base;
28985     int ret_val;
28986     xmlParserInputBufferPtr in; /* a buffered parser input */
28987     int n_in;
28988     int len; /* the size in bytes of the array. */
28989     int n_len;
28990     char * buf; /* an char array */
28991     int n_buf;
28992
28993     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28994     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28995     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28996         mem_base = xmlMemBlocks();
28997         in = gen_xmlParserInputBufferPtr(n_in, 0);
28998         len = gen_int(n_len, 1);
28999         buf = gen_const_char_ptr(n_buf, 2);
29000
29001         ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
29002         desret_int(ret_val);
29003         call_tests++;
29004         des_xmlParserInputBufferPtr(n_in, in, 0);
29005         des_int(n_len, len, 1);
29006         des_const_char_ptr(n_buf, (const char *)buf, 2);
29007         xmlResetLastError();
29008         if (mem_base != xmlMemBlocks()) {
29009             printf("Leak of %d blocks found in xmlParserInputBufferPush",
29010                    xmlMemBlocks() - mem_base);
29011             test_ret++;
29012             printf(" %d", n_in);
29013             printf(" %d", n_len);
29014             printf(" %d", n_buf);
29015             printf("\n");
29016         }
29017     }
29018     }
29019     }
29020     function_tests++;
29021
29022     return(test_ret);
29023 }
29024
29025
29026 static int
29027 test_xmlParserInputBufferRead(void) {
29028     int test_ret = 0;
29029
29030     int mem_base;
29031     int ret_val;
29032     xmlParserInputBufferPtr in; /* a buffered parser input */
29033     int n_in;
29034     int len; /* indicative value of the amount of chars to read */
29035     int n_len;
29036
29037     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29038     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29039         mem_base = xmlMemBlocks();
29040         in = gen_xmlParserInputBufferPtr(n_in, 0);
29041         len = gen_int(n_len, 1);
29042
29043         ret_val = xmlParserInputBufferRead(in, len);
29044         desret_int(ret_val);
29045         call_tests++;
29046         des_xmlParserInputBufferPtr(n_in, in, 0);
29047         des_int(n_len, len, 1);
29048         xmlResetLastError();
29049         if (mem_base != xmlMemBlocks()) {
29050             printf("Leak of %d blocks found in xmlParserInputBufferRead",
29051                    xmlMemBlocks() - mem_base);
29052             test_ret++;
29053             printf(" %d", n_in);
29054             printf(" %d", n_len);
29055             printf("\n");
29056         }
29057     }
29058     }
29059     function_tests++;
29060
29061     return(test_ret);
29062 }
29063
29064
29065 static int
29066 test_xmlPopInputCallbacks(void) {
29067     int test_ret = 0;
29068
29069     int mem_base;
29070     int ret_val;
29071
29072         mem_base = xmlMemBlocks();
29073
29074         ret_val = xmlPopInputCallbacks();
29075         desret_int(ret_val);
29076         call_tests++;
29077         xmlResetLastError();
29078         if (mem_base != xmlMemBlocks()) {
29079             printf("Leak of %d blocks found in xmlPopInputCallbacks",
29080                    xmlMemBlocks() - mem_base);
29081             test_ret++;
29082             printf("\n");
29083         }
29084     function_tests++;
29085
29086     return(test_ret);
29087 }
29088
29089
29090 static int
29091 test_xmlRegisterDefaultInputCallbacks(void) {
29092     int test_ret = 0;
29093
29094     int mem_base;
29095
29096         mem_base = xmlMemBlocks();
29097
29098         xmlRegisterDefaultInputCallbacks();
29099         call_tests++;
29100         xmlResetLastError();
29101         if (mem_base != xmlMemBlocks()) {
29102             printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
29103                    xmlMemBlocks() - mem_base);
29104             test_ret++;
29105             printf("\n");
29106         }
29107     function_tests++;
29108
29109     return(test_ret);
29110 }
29111
29112
29113 static int
29114 test_xmlRegisterDefaultOutputCallbacks(void) {
29115     int test_ret = 0;
29116
29117 #if defined(LIBXML_OUTPUT_ENABLED)
29118     int mem_base;
29119
29120         mem_base = xmlMemBlocks();
29121
29122         xmlRegisterDefaultOutputCallbacks();
29123         call_tests++;
29124         xmlResetLastError();
29125         if (mem_base != xmlMemBlocks()) {
29126             printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
29127                    xmlMemBlocks() - mem_base);
29128             test_ret++;
29129             printf("\n");
29130         }
29131     function_tests++;
29132 #endif
29133
29134     return(test_ret);
29135 }
29136
29137
29138 static int
29139 test_xmlRegisterHTTPPostCallbacks(void) {
29140     int test_ret = 0;
29141
29142 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
29143     int mem_base;
29144
29145         mem_base = xmlMemBlocks();
29146
29147         xmlRegisterHTTPPostCallbacks();
29148         call_tests++;
29149         xmlResetLastError();
29150         if (mem_base != xmlMemBlocks()) {
29151             printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
29152                    xmlMemBlocks() - mem_base);
29153             test_ret++;
29154             printf("\n");
29155         }
29156     function_tests++;
29157 #endif
29158
29159     return(test_ret);
29160 }
29161
29162 static int
29163 test_xmlIO(void) {
29164     int test_ret = 0;
29165
29166     if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
29167     test_ret += test_xmlAllocOutputBuffer();
29168     test_ret += test_xmlAllocParserInputBuffer();
29169     test_ret += test_xmlCheckFilename();
29170     test_ret += test_xmlCheckHTTPInput();
29171     test_ret += test_xmlCleanupInputCallbacks();
29172     test_ret += test_xmlCleanupOutputCallbacks();
29173     test_ret += test_xmlFileClose();
29174     test_ret += test_xmlFileMatch();
29175     test_ret += test_xmlFileOpen();
29176     test_ret += test_xmlFileRead();
29177     test_ret += test_xmlIOFTPClose();
29178     test_ret += test_xmlIOFTPMatch();
29179     test_ret += test_xmlIOFTPOpen();
29180     test_ret += test_xmlIOFTPRead();
29181     test_ret += test_xmlIOHTTPClose();
29182     test_ret += test_xmlIOHTTPMatch();
29183     test_ret += test_xmlIOHTTPOpen();
29184     test_ret += test_xmlIOHTTPRead();
29185     test_ret += test_xmlNoNetExternalEntityLoader();
29186     test_ret += test_xmlNormalizeWindowsPath();
29187     test_ret += test_xmlOutputBufferCreateBuffer();
29188     test_ret += test_xmlOutputBufferCreateFd();
29189     test_ret += test_xmlOutputBufferCreateFile();
29190     test_ret += test_xmlOutputBufferCreateFilename();
29191     test_ret += test_xmlOutputBufferFlush();
29192     test_ret += test_xmlOutputBufferGetContent();
29193     test_ret += test_xmlOutputBufferGetSize();
29194     test_ret += test_xmlOutputBufferWrite();
29195     test_ret += test_xmlOutputBufferWriteEscape();
29196     test_ret += test_xmlOutputBufferWriteString();
29197     test_ret += test_xmlParserGetDirectory();
29198     test_ret += test_xmlParserInputBufferCreateFd();
29199     test_ret += test_xmlParserInputBufferCreateFile();
29200     test_ret += test_xmlParserInputBufferCreateFilename();
29201     test_ret += test_xmlParserInputBufferCreateMem();
29202     test_ret += test_xmlParserInputBufferCreateStatic();
29203     test_ret += test_xmlParserInputBufferGrow();
29204     test_ret += test_xmlParserInputBufferPush();
29205     test_ret += test_xmlParserInputBufferRead();
29206     test_ret += test_xmlPopInputCallbacks();
29207     test_ret += test_xmlRegisterDefaultInputCallbacks();
29208     test_ret += test_xmlRegisterDefaultOutputCallbacks();
29209     test_ret += test_xmlRegisterHTTPPostCallbacks();
29210
29211     if (test_ret != 0)
29212         printf("Module xmlIO: %d errors\n", test_ret);
29213     return(test_ret);
29214 }
29215 #ifdef LIBXML_AUTOMATA_ENABLED
29216
29217 #define gen_nb_xmlAutomataPtr 1
29218 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29219     return(NULL);
29220 }
29221 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29222 }
29223 #endif
29224
29225
29226 static int
29227 test_xmlAutomataCompile(void) {
29228     int test_ret = 0;
29229
29230
29231     /* missing type support */
29232     return(test_ret);
29233 }
29234
29235
29236 static int
29237 test_xmlAutomataGetInitState(void) {
29238     int test_ret = 0;
29239
29240
29241     /* missing type support */
29242     return(test_ret);
29243 }
29244
29245
29246 static int
29247 test_xmlAutomataIsDeterminist(void) {
29248     int test_ret = 0;
29249
29250 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29251     int mem_base;
29252     int ret_val;
29253     xmlAutomataPtr am; /* an automata */
29254     int n_am;
29255
29256     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29257         mem_base = xmlMemBlocks();
29258         am = gen_xmlAutomataPtr(n_am, 0);
29259
29260         ret_val = xmlAutomataIsDeterminist(am);
29261         desret_int(ret_val);
29262         call_tests++;
29263         des_xmlAutomataPtr(n_am, am, 0);
29264         xmlResetLastError();
29265         if (mem_base != xmlMemBlocks()) {
29266             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29267                    xmlMemBlocks() - mem_base);
29268             test_ret++;
29269             printf(" %d", n_am);
29270             printf("\n");
29271         }
29272     }
29273     function_tests++;
29274 #endif
29275
29276     return(test_ret);
29277 }
29278
29279 #ifdef LIBXML_AUTOMATA_ENABLED
29280
29281 #define gen_nb_xmlAutomataStatePtr 1
29282 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29283     return(NULL);
29284 }
29285 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29286 }
29287 #endif
29288
29289
29290 static int
29291 test_xmlAutomataNewAllTrans(void) {
29292     int test_ret = 0;
29293
29294
29295     /* missing type support */
29296     return(test_ret);
29297 }
29298
29299
29300 static int
29301 test_xmlAutomataNewCountTrans(void) {
29302     int test_ret = 0;
29303
29304
29305     /* missing type support */
29306     return(test_ret);
29307 }
29308
29309
29310 static int
29311 test_xmlAutomataNewCountTrans2(void) {
29312     int test_ret = 0;
29313
29314
29315     /* missing type support */
29316     return(test_ret);
29317 }
29318
29319
29320 static int
29321 test_xmlAutomataNewCountedTrans(void) {
29322     int test_ret = 0;
29323
29324
29325     /* missing type support */
29326     return(test_ret);
29327 }
29328
29329
29330 static int
29331 test_xmlAutomataNewCounter(void) {
29332     int test_ret = 0;
29333
29334 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29335     int mem_base;
29336     int ret_val;
29337     xmlAutomataPtr am; /* an automata */
29338     int n_am;
29339     int min; /* the minimal value on the counter */
29340     int n_min;
29341     int max; /* the maximal value on the counter */
29342     int n_max;
29343
29344     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29345     for (n_min = 0;n_min < gen_nb_int;n_min++) {
29346     for (n_max = 0;n_max < gen_nb_int;n_max++) {
29347         mem_base = xmlMemBlocks();
29348         am = gen_xmlAutomataPtr(n_am, 0);
29349         min = gen_int(n_min, 1);
29350         max = gen_int(n_max, 2);
29351
29352         ret_val = xmlAutomataNewCounter(am, min, max);
29353         desret_int(ret_val);
29354         call_tests++;
29355         des_xmlAutomataPtr(n_am, am, 0);
29356         des_int(n_min, min, 1);
29357         des_int(n_max, max, 2);
29358         xmlResetLastError();
29359         if (mem_base != xmlMemBlocks()) {
29360             printf("Leak of %d blocks found in xmlAutomataNewCounter",
29361                    xmlMemBlocks() - mem_base);
29362             test_ret++;
29363             printf(" %d", n_am);
29364             printf(" %d", n_min);
29365             printf(" %d", n_max);
29366             printf("\n");
29367         }
29368     }
29369     }
29370     }
29371     function_tests++;
29372 #endif
29373
29374     return(test_ret);
29375 }
29376
29377
29378 static int
29379 test_xmlAutomataNewCounterTrans(void) {
29380     int test_ret = 0;
29381
29382
29383     /* missing type support */
29384     return(test_ret);
29385 }
29386
29387
29388 static int
29389 test_xmlAutomataNewEpsilon(void) {
29390     int test_ret = 0;
29391
29392
29393     /* missing type support */
29394     return(test_ret);
29395 }
29396
29397
29398 static int
29399 test_xmlAutomataNewNegTrans(void) {
29400     int test_ret = 0;
29401
29402
29403     /* missing type support */
29404     return(test_ret);
29405 }
29406
29407
29408 static int
29409 test_xmlAutomataNewOnceTrans(void) {
29410     int test_ret = 0;
29411
29412
29413     /* missing type support */
29414     return(test_ret);
29415 }
29416
29417
29418 static int
29419 test_xmlAutomataNewOnceTrans2(void) {
29420     int test_ret = 0;
29421
29422
29423     /* missing type support */
29424     return(test_ret);
29425 }
29426
29427
29428 static int
29429 test_xmlAutomataNewState(void) {
29430     int test_ret = 0;
29431
29432
29433     /* missing type support */
29434     return(test_ret);
29435 }
29436
29437
29438 static int
29439 test_xmlAutomataNewTransition(void) {
29440     int test_ret = 0;
29441
29442
29443     /* missing type support */
29444     return(test_ret);
29445 }
29446
29447
29448 static int
29449 test_xmlAutomataNewTransition2(void) {
29450     int test_ret = 0;
29451
29452
29453     /* missing type support */
29454     return(test_ret);
29455 }
29456
29457
29458 static int
29459 test_xmlAutomataSetFinalState(void) {
29460     int test_ret = 0;
29461
29462 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29463     int mem_base;
29464     int ret_val;
29465     xmlAutomataPtr am; /* an automata */
29466     int n_am;
29467     xmlAutomataStatePtr state; /* a state in this automata */
29468     int n_state;
29469
29470     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29471     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29472         mem_base = xmlMemBlocks();
29473         am = gen_xmlAutomataPtr(n_am, 0);
29474         state = gen_xmlAutomataStatePtr(n_state, 1);
29475
29476         ret_val = xmlAutomataSetFinalState(am, state);
29477         desret_int(ret_val);
29478         call_tests++;
29479         des_xmlAutomataPtr(n_am, am, 0);
29480         des_xmlAutomataStatePtr(n_state, state, 1);
29481         xmlResetLastError();
29482         if (mem_base != xmlMemBlocks()) {
29483             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29484                    xmlMemBlocks() - mem_base);
29485             test_ret++;
29486             printf(" %d", n_am);
29487             printf(" %d", n_state);
29488             printf("\n");
29489         }
29490     }
29491     }
29492     function_tests++;
29493 #endif
29494
29495     return(test_ret);
29496 }
29497
29498
29499 static int
29500 test_xmlNewAutomata(void) {
29501     int test_ret = 0;
29502
29503
29504     /* missing type support */
29505     return(test_ret);
29506 }
29507
29508 static int
29509 test_xmlautomata(void) {
29510     int test_ret = 0;
29511
29512     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29513     test_ret += test_xmlAutomataCompile();
29514     test_ret += test_xmlAutomataGetInitState();
29515     test_ret += test_xmlAutomataIsDeterminist();
29516     test_ret += test_xmlAutomataNewAllTrans();
29517     test_ret += test_xmlAutomataNewCountTrans();
29518     test_ret += test_xmlAutomataNewCountTrans2();
29519     test_ret += test_xmlAutomataNewCountedTrans();
29520     test_ret += test_xmlAutomataNewCounter();
29521     test_ret += test_xmlAutomataNewCounterTrans();
29522     test_ret += test_xmlAutomataNewEpsilon();
29523     test_ret += test_xmlAutomataNewNegTrans();
29524     test_ret += test_xmlAutomataNewOnceTrans();
29525     test_ret += test_xmlAutomataNewOnceTrans2();
29526     test_ret += test_xmlAutomataNewState();
29527     test_ret += test_xmlAutomataNewTransition();
29528     test_ret += test_xmlAutomataNewTransition2();
29529     test_ret += test_xmlAutomataSetFinalState();
29530     test_ret += test_xmlNewAutomata();
29531
29532     if (test_ret != 0)
29533         printf("Module xmlautomata: %d errors\n", test_ret);
29534     return(test_ret);
29535 }
29536
29537 #define gen_nb_xmlGenericErrorFunc_ptr 1
29538 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29539     return(NULL);
29540 }
29541 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29542 }
29543
29544 static int
29545 test_initGenericErrorDefaultFunc(void) {
29546     int test_ret = 0;
29547
29548     int mem_base;
29549     xmlGenericErrorFunc * handler; /* the handler */
29550     int n_handler;
29551
29552     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29553         mem_base = xmlMemBlocks();
29554         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29555
29556         initGenericErrorDefaultFunc(handler);
29557         call_tests++;
29558         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29559         xmlResetLastError();
29560         if (mem_base != xmlMemBlocks()) {
29561             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29562                    xmlMemBlocks() - mem_base);
29563             test_ret++;
29564             printf(" %d", n_handler);
29565             printf("\n");
29566         }
29567     }
29568     function_tests++;
29569
29570     return(test_ret);
29571 }
29572
29573
29574 #define gen_nb_xmlErrorPtr 1
29575 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29576     return(NULL);
29577 }
29578 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29579 }
29580
29581 static int
29582 test_xmlCopyError(void) {
29583     int test_ret = 0;
29584
29585     int mem_base;
29586     int ret_val;
29587     xmlErrorPtr from; /* a source error */
29588     int n_from;
29589     xmlErrorPtr to; /* a target error */
29590     int n_to;
29591
29592     for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29593     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29594         mem_base = xmlMemBlocks();
29595         from = gen_xmlErrorPtr(n_from, 0);
29596         to = gen_xmlErrorPtr(n_to, 1);
29597
29598         ret_val = xmlCopyError(from, to);
29599         desret_int(ret_val);
29600         call_tests++;
29601         des_xmlErrorPtr(n_from, from, 0);
29602         des_xmlErrorPtr(n_to, to, 1);
29603         xmlResetLastError();
29604         if (mem_base != xmlMemBlocks()) {
29605             printf("Leak of %d blocks found in xmlCopyError",
29606                    xmlMemBlocks() - mem_base);
29607             test_ret++;
29608             printf(" %d", n_from);
29609             printf(" %d", n_to);
29610             printf("\n");
29611         }
29612     }
29613     }
29614     function_tests++;
29615
29616     return(test_ret);
29617 }
29618
29619
29620 static int
29621 test_xmlCtxtGetLastError(void) {
29622     int test_ret = 0;
29623
29624
29625     /* missing type support */
29626     return(test_ret);
29627 }
29628
29629
29630 static int
29631 test_xmlCtxtResetLastError(void) {
29632     int test_ret = 0;
29633
29634     int mem_base;
29635     void * ctx; /* an XML parser context */
29636     int n_ctx;
29637
29638     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29639         mem_base = xmlMemBlocks();
29640         ctx = gen_void_ptr(n_ctx, 0);
29641
29642         xmlCtxtResetLastError(ctx);
29643         call_tests++;
29644         des_void_ptr(n_ctx, ctx, 0);
29645         xmlResetLastError();
29646         if (mem_base != xmlMemBlocks()) {
29647             printf("Leak of %d blocks found in xmlCtxtResetLastError",
29648                    xmlMemBlocks() - mem_base);
29649             test_ret++;
29650             printf(" %d", n_ctx);
29651             printf("\n");
29652         }
29653     }
29654     function_tests++;
29655
29656     return(test_ret);
29657 }
29658
29659
29660 static int
29661 test_xmlGetLastError(void) {
29662     int test_ret = 0;
29663
29664
29665     /* missing type support */
29666     return(test_ret);
29667 }
29668
29669
29670 static int
29671 test_xmlParserError(void) {
29672     int test_ret = 0;
29673
29674
29675     /* missing type support */
29676     return(test_ret);
29677 }
29678
29679
29680 static int
29681 test_xmlParserPrintFileContext(void) {
29682     int test_ret = 0;
29683
29684     int mem_base;
29685     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29686     int n_input;
29687
29688     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29689         mem_base = xmlMemBlocks();
29690         input = gen_xmlParserInputPtr(n_input, 0);
29691
29692         xmlParserPrintFileContext(input);
29693         call_tests++;
29694         des_xmlParserInputPtr(n_input, input, 0);
29695         xmlResetLastError();
29696         if (mem_base != xmlMemBlocks()) {
29697             printf("Leak of %d blocks found in xmlParserPrintFileContext",
29698                    xmlMemBlocks() - mem_base);
29699             test_ret++;
29700             printf(" %d", n_input);
29701             printf("\n");
29702         }
29703     }
29704     function_tests++;
29705
29706     return(test_ret);
29707 }
29708
29709
29710 static int
29711 test_xmlParserPrintFileInfo(void) {
29712     int test_ret = 0;
29713
29714     int mem_base;
29715     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29716     int n_input;
29717
29718     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29719         mem_base = xmlMemBlocks();
29720         input = gen_xmlParserInputPtr(n_input, 0);
29721
29722         xmlParserPrintFileInfo(input);
29723         call_tests++;
29724         des_xmlParserInputPtr(n_input, input, 0);
29725         xmlResetLastError();
29726         if (mem_base != xmlMemBlocks()) {
29727             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29728                    xmlMemBlocks() - mem_base);
29729             test_ret++;
29730             printf(" %d", n_input);
29731             printf("\n");
29732         }
29733     }
29734     function_tests++;
29735
29736     return(test_ret);
29737 }
29738
29739
29740 static int
29741 test_xmlParserValidityError(void) {
29742     int test_ret = 0;
29743
29744
29745     /* missing type support */
29746     return(test_ret);
29747 }
29748
29749
29750 static int
29751 test_xmlParserValidityWarning(void) {
29752     int test_ret = 0;
29753
29754
29755     /* missing type support */
29756     return(test_ret);
29757 }
29758
29759
29760 static int
29761 test_xmlParserWarning(void) {
29762     int test_ret = 0;
29763
29764
29765     /* missing type support */
29766     return(test_ret);
29767 }
29768
29769
29770 static int
29771 test_xmlResetError(void) {
29772     int test_ret = 0;
29773
29774     int mem_base;
29775     xmlErrorPtr err; /* pointer to the error. */
29776     int n_err;
29777
29778     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29779         mem_base = xmlMemBlocks();
29780         err = gen_xmlErrorPtr(n_err, 0);
29781
29782         xmlResetError(err);
29783         call_tests++;
29784         des_xmlErrorPtr(n_err, err, 0);
29785         xmlResetLastError();
29786         if (mem_base != xmlMemBlocks()) {
29787             printf("Leak of %d blocks found in xmlResetError",
29788                    xmlMemBlocks() - mem_base);
29789             test_ret++;
29790             printf(" %d", n_err);
29791             printf("\n");
29792         }
29793     }
29794     function_tests++;
29795
29796     return(test_ret);
29797 }
29798
29799
29800 static int
29801 test_xmlResetLastError(void) {
29802     int test_ret = 0;
29803
29804
29805
29806         xmlResetLastError();
29807         call_tests++;
29808         xmlResetLastError();
29809     function_tests++;
29810
29811     return(test_ret);
29812 }
29813
29814
29815 static int
29816 test_xmlSetGenericErrorFunc(void) {
29817     int test_ret = 0;
29818
29819
29820     /* missing type support */
29821     return(test_ret);
29822 }
29823
29824
29825 static int
29826 test_xmlSetStructuredErrorFunc(void) {
29827     int test_ret = 0;
29828
29829
29830     /* missing type support */
29831     return(test_ret);
29832 }
29833
29834 static int
29835 test_xmlerror(void) {
29836     int test_ret = 0;
29837
29838     if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29839     test_ret += test_initGenericErrorDefaultFunc();
29840     test_ret += test_xmlCopyError();
29841     test_ret += test_xmlCtxtGetLastError();
29842     test_ret += test_xmlCtxtResetLastError();
29843     test_ret += test_xmlGetLastError();
29844     test_ret += test_xmlParserError();
29845     test_ret += test_xmlParserPrintFileContext();
29846     test_ret += test_xmlParserPrintFileInfo();
29847     test_ret += test_xmlParserValidityError();
29848     test_ret += test_xmlParserValidityWarning();
29849     test_ret += test_xmlParserWarning();
29850     test_ret += test_xmlResetError();
29851     test_ret += test_xmlResetLastError();
29852     test_ret += test_xmlSetGenericErrorFunc();
29853     test_ret += test_xmlSetStructuredErrorFunc();
29854
29855     if (test_ret != 0)
29856         printf("Module xmlerror: %d errors\n", test_ret);
29857     return(test_ret);
29858 }
29859 #ifdef LIBXML_MODULES_ENABLED
29860
29861 #define gen_nb_xmlModulePtr 1
29862 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29863     return(NULL);
29864 }
29865 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29866 }
29867 #endif
29868
29869
29870 static int
29871 test_xmlModuleClose(void) {
29872     int test_ret = 0;
29873
29874 #if defined(LIBXML_MODULES_ENABLED)
29875     int mem_base;
29876     int ret_val;
29877     xmlModulePtr module; /* the module handle */
29878     int n_module;
29879
29880     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29881         mem_base = xmlMemBlocks();
29882         module = gen_xmlModulePtr(n_module, 0);
29883
29884         ret_val = xmlModuleClose(module);
29885         desret_int(ret_val);
29886         call_tests++;
29887         des_xmlModulePtr(n_module, module, 0);
29888         xmlResetLastError();
29889         if (mem_base != xmlMemBlocks()) {
29890             printf("Leak of %d blocks found in xmlModuleClose",
29891                    xmlMemBlocks() - mem_base);
29892             test_ret++;
29893             printf(" %d", n_module);
29894             printf("\n");
29895         }
29896     }
29897     function_tests++;
29898 #endif
29899
29900     return(test_ret);
29901 }
29902
29903
29904 static int
29905 test_xmlModuleOpen(void) {
29906     int test_ret = 0;
29907
29908
29909     /* missing type support */
29910     return(test_ret);
29911 }
29912
29913
29914 static int
29915 test_xmlModuleSymbol(void) {
29916     int test_ret = 0;
29917
29918 #if defined(LIBXML_MODULES_ENABLED)
29919     int mem_base;
29920     int ret_val;
29921     xmlModulePtr module; /* the module */
29922     int n_module;
29923     char * name; /* the name of the symbol */
29924     int n_name;
29925     void ** symbol; /* the resulting symbol address */
29926     int n_symbol;
29927
29928     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29929     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29930     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29931         mem_base = xmlMemBlocks();
29932         module = gen_xmlModulePtr(n_module, 0);
29933         name = gen_const_char_ptr(n_name, 1);
29934         symbol = gen_void_ptr_ptr(n_symbol, 2);
29935
29936         ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29937         desret_int(ret_val);
29938         call_tests++;
29939         des_xmlModulePtr(n_module, module, 0);
29940         des_const_char_ptr(n_name, (const char *)name, 1);
29941         des_void_ptr_ptr(n_symbol, symbol, 2);
29942         xmlResetLastError();
29943         if (mem_base != xmlMemBlocks()) {
29944             printf("Leak of %d blocks found in xmlModuleSymbol",
29945                    xmlMemBlocks() - mem_base);
29946             test_ret++;
29947             printf(" %d", n_module);
29948             printf(" %d", n_name);
29949             printf(" %d", n_symbol);
29950             printf("\n");
29951         }
29952     }
29953     }
29954     }
29955     function_tests++;
29956 #endif
29957
29958     return(test_ret);
29959 }
29960
29961 static int
29962 test_xmlmodule(void) {
29963     int test_ret = 0;
29964
29965     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29966     test_ret += test_xmlModuleClose();
29967     test_ret += test_xmlModuleOpen();
29968     test_ret += test_xmlModuleSymbol();
29969
29970     if (test_ret != 0)
29971         printf("Module xmlmodule: %d errors\n", test_ret);
29972     return(test_ret);
29973 }
29974
29975 static int
29976 test_xmlNewTextReader(void) {
29977     int test_ret = 0;
29978
29979 #if defined(LIBXML_READER_ENABLED)
29980     int mem_base;
29981     xmlTextReaderPtr ret_val;
29982     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29983     int n_input;
29984     const char * URI; /* the URI information for the source if available */
29985     int n_URI;
29986
29987     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29988     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29989         mem_base = xmlMemBlocks();
29990         input = gen_xmlParserInputBufferPtr(n_input, 0);
29991         URI = gen_filepath(n_URI, 1);
29992
29993         ret_val = xmlNewTextReader(input, URI);
29994         desret_xmlTextReaderPtr(ret_val);
29995         call_tests++;
29996         des_xmlParserInputBufferPtr(n_input, input, 0);
29997         des_filepath(n_URI, URI, 1);
29998         xmlResetLastError();
29999         if (mem_base != xmlMemBlocks()) {
30000             printf("Leak of %d blocks found in xmlNewTextReader",
30001                    xmlMemBlocks() - mem_base);
30002             test_ret++;
30003             printf(" %d", n_input);
30004             printf(" %d", n_URI);
30005             printf("\n");
30006         }
30007     }
30008     }
30009     function_tests++;
30010 #endif
30011
30012     return(test_ret);
30013 }
30014
30015
30016 static int
30017 test_xmlNewTextReaderFilename(void) {
30018     int test_ret = 0;
30019
30020 #if defined(LIBXML_READER_ENABLED)
30021     int mem_base;
30022     xmlTextReaderPtr ret_val;
30023     const char * URI; /* the URI of the resource to process */
30024     int n_URI;
30025
30026     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30027         mem_base = xmlMemBlocks();
30028         URI = gen_filepath(n_URI, 0);
30029
30030         ret_val = xmlNewTextReaderFilename(URI);
30031         desret_xmlTextReaderPtr(ret_val);
30032         call_tests++;
30033         des_filepath(n_URI, URI, 0);
30034         xmlResetLastError();
30035         if (mem_base != xmlMemBlocks()) {
30036             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
30037                    xmlMemBlocks() - mem_base);
30038             test_ret++;
30039             printf(" %d", n_URI);
30040             printf("\n");
30041         }
30042     }
30043     function_tests++;
30044 #endif
30045
30046     return(test_ret);
30047 }
30048
30049
30050 static int
30051 test_xmlReaderForDoc(void) {
30052     int test_ret = 0;
30053
30054 #if defined(LIBXML_READER_ENABLED)
30055     int mem_base;
30056     xmlTextReaderPtr ret_val;
30057     xmlChar * cur; /* a pointer to a zero terminated string */
30058     int n_cur;
30059     const char * URL; /* the base URL to use for the document */
30060     int n_URL;
30061     char * encoding; /* the document encoding, or NULL */
30062     int n_encoding;
30063     int options; /* a combination of xmlParserOption */
30064     int n_options;
30065
30066     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30067     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30068     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30069     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30070         mem_base = xmlMemBlocks();
30071         cur = gen_const_xmlChar_ptr(n_cur, 0);
30072         URL = gen_filepath(n_URL, 1);
30073         encoding = gen_const_char_ptr(n_encoding, 2);
30074         options = gen_parseroptions(n_options, 3);
30075
30076         ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
30077         desret_xmlTextReaderPtr(ret_val);
30078         call_tests++;
30079         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
30080         des_filepath(n_URL, URL, 1);
30081         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30082         des_parseroptions(n_options, options, 3);
30083         xmlResetLastError();
30084         if (mem_base != xmlMemBlocks()) {
30085             printf("Leak of %d blocks found in xmlReaderForDoc",
30086                    xmlMemBlocks() - mem_base);
30087             test_ret++;
30088             printf(" %d", n_cur);
30089             printf(" %d", n_URL);
30090             printf(" %d", n_encoding);
30091             printf(" %d", n_options);
30092             printf("\n");
30093         }
30094     }
30095     }
30096     }
30097     }
30098     function_tests++;
30099 #endif
30100
30101     return(test_ret);
30102 }
30103
30104
30105 static int
30106 test_xmlReaderForFile(void) {
30107     int test_ret = 0;
30108
30109 #if defined(LIBXML_READER_ENABLED)
30110     int mem_base;
30111     xmlTextReaderPtr ret_val;
30112     const char * filename; /* a file or URL */
30113     int n_filename;
30114     char * encoding; /* the document encoding, or NULL */
30115     int n_encoding;
30116     int options; /* a combination of xmlParserOption */
30117     int n_options;
30118
30119     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30120     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30121     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30122         mem_base = xmlMemBlocks();
30123         filename = gen_filepath(n_filename, 0);
30124         encoding = gen_const_char_ptr(n_encoding, 1);
30125         options = gen_parseroptions(n_options, 2);
30126
30127         ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
30128         desret_xmlTextReaderPtr(ret_val);
30129         call_tests++;
30130         des_filepath(n_filename, filename, 0);
30131         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
30132         des_parseroptions(n_options, options, 2);
30133         xmlResetLastError();
30134         if (mem_base != xmlMemBlocks()) {
30135             printf("Leak of %d blocks found in xmlReaderForFile",
30136                    xmlMemBlocks() - mem_base);
30137             test_ret++;
30138             printf(" %d", n_filename);
30139             printf(" %d", n_encoding);
30140             printf(" %d", n_options);
30141             printf("\n");
30142         }
30143     }
30144     }
30145     }
30146     function_tests++;
30147 #endif
30148
30149     return(test_ret);
30150 }
30151
30152
30153 static int
30154 test_xmlReaderForMemory(void) {
30155     int test_ret = 0;
30156
30157 #if defined(LIBXML_READER_ENABLED)
30158     int mem_base;
30159     xmlTextReaderPtr ret_val;
30160     char * buffer; /* a pointer to a char array */
30161     int n_buffer;
30162     int size; /* the size of the array */
30163     int n_size;
30164     const char * URL; /* the base URL to use for the document */
30165     int n_URL;
30166     char * encoding; /* the document encoding, or NULL */
30167     int n_encoding;
30168     int options; /* a combination of xmlParserOption */
30169     int n_options;
30170
30171     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30172     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30173     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30174     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30175     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30176         mem_base = xmlMemBlocks();
30177         buffer = gen_const_char_ptr(n_buffer, 0);
30178         size = gen_int(n_size, 1);
30179         URL = gen_filepath(n_URL, 2);
30180         encoding = gen_const_char_ptr(n_encoding, 3);
30181         options = gen_parseroptions(n_options, 4);
30182
30183         ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
30184         desret_xmlTextReaderPtr(ret_val);
30185         call_tests++;
30186         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
30187         des_int(n_size, size, 1);
30188         des_filepath(n_URL, URL, 2);
30189         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30190         des_parseroptions(n_options, options, 4);
30191         xmlResetLastError();
30192         if (mem_base != xmlMemBlocks()) {
30193             printf("Leak of %d blocks found in xmlReaderForMemory",
30194                    xmlMemBlocks() - mem_base);
30195             test_ret++;
30196             printf(" %d", n_buffer);
30197             printf(" %d", n_size);
30198             printf(" %d", n_URL);
30199             printf(" %d", n_encoding);
30200             printf(" %d", n_options);
30201             printf("\n");
30202         }
30203     }
30204     }
30205     }
30206     }
30207     }
30208     function_tests++;
30209 #endif
30210
30211     return(test_ret);
30212 }
30213
30214
30215 static int
30216 test_xmlReaderNewDoc(void) {
30217     int test_ret = 0;
30218
30219 #if defined(LIBXML_READER_ENABLED)
30220     int mem_base;
30221     int ret_val;
30222     xmlTextReaderPtr reader; /* an XML reader */
30223     int n_reader;
30224     xmlChar * cur; /* a pointer to a zero terminated string */
30225     int n_cur;
30226     const char * URL; /* the base URL to use for the document */
30227     int n_URL;
30228     char * encoding; /* the document encoding, or NULL */
30229     int n_encoding;
30230     int options; /* a combination of xmlParserOption */
30231     int n_options;
30232
30233     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30234     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30235     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30236     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30237     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30238         mem_base = xmlMemBlocks();
30239         reader = gen_xmlTextReaderPtr(n_reader, 0);
30240         cur = gen_const_xmlChar_ptr(n_cur, 1);
30241         URL = gen_filepath(n_URL, 2);
30242         encoding = gen_const_char_ptr(n_encoding, 3);
30243         options = gen_parseroptions(n_options, 4);
30244
30245         ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30246         desret_int(ret_val);
30247         call_tests++;
30248         des_xmlTextReaderPtr(n_reader, reader, 0);
30249         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30250         des_filepath(n_URL, URL, 2);
30251         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30252         des_parseroptions(n_options, options, 4);
30253         xmlResetLastError();
30254         if (mem_base != xmlMemBlocks()) {
30255             printf("Leak of %d blocks found in xmlReaderNewDoc",
30256                    xmlMemBlocks() - mem_base);
30257             test_ret++;
30258             printf(" %d", n_reader);
30259             printf(" %d", n_cur);
30260             printf(" %d", n_URL);
30261             printf(" %d", n_encoding);
30262             printf(" %d", n_options);
30263             printf("\n");
30264         }
30265     }
30266     }
30267     }
30268     }
30269     }
30270     function_tests++;
30271 #endif
30272
30273     return(test_ret);
30274 }
30275
30276
30277 static int
30278 test_xmlReaderNewFile(void) {
30279     int test_ret = 0;
30280
30281 #if defined(LIBXML_READER_ENABLED)
30282     int mem_base;
30283     int ret_val;
30284     xmlTextReaderPtr reader; /* an XML reader */
30285     int n_reader;
30286     const char * filename; /* a file or URL */
30287     int n_filename;
30288     char * encoding; /* the document encoding, or NULL */
30289     int n_encoding;
30290     int options; /* a combination of xmlParserOption */
30291     int n_options;
30292
30293     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30294     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30295     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30296     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30297         mem_base = xmlMemBlocks();
30298         reader = gen_xmlTextReaderPtr(n_reader, 0);
30299         filename = gen_filepath(n_filename, 1);
30300         encoding = gen_const_char_ptr(n_encoding, 2);
30301         options = gen_parseroptions(n_options, 3);
30302
30303         ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30304         desret_int(ret_val);
30305         call_tests++;
30306         des_xmlTextReaderPtr(n_reader, reader, 0);
30307         des_filepath(n_filename, filename, 1);
30308         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30309         des_parseroptions(n_options, options, 3);
30310         xmlResetLastError();
30311         if (mem_base != xmlMemBlocks()) {
30312             printf("Leak of %d blocks found in xmlReaderNewFile",
30313                    xmlMemBlocks() - mem_base);
30314             test_ret++;
30315             printf(" %d", n_reader);
30316             printf(" %d", n_filename);
30317             printf(" %d", n_encoding);
30318             printf(" %d", n_options);
30319             printf("\n");
30320         }
30321     }
30322     }
30323     }
30324     }
30325     function_tests++;
30326 #endif
30327
30328     return(test_ret);
30329 }
30330
30331
30332 static int
30333 test_xmlReaderNewMemory(void) {
30334     int test_ret = 0;
30335
30336 #if defined(LIBXML_READER_ENABLED)
30337     int mem_base;
30338     int ret_val;
30339     xmlTextReaderPtr reader; /* an XML reader */
30340     int n_reader;
30341     char * buffer; /* a pointer to a char array */
30342     int n_buffer;
30343     int size; /* the size of the array */
30344     int n_size;
30345     const char * URL; /* the base URL to use for the document */
30346     int n_URL;
30347     char * encoding; /* the document encoding, or NULL */
30348     int n_encoding;
30349     int options; /* a combination of xmlParserOption */
30350     int n_options;
30351
30352     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30353     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30354     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30355     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30356     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30357     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30358         mem_base = xmlMemBlocks();
30359         reader = gen_xmlTextReaderPtr(n_reader, 0);
30360         buffer = gen_const_char_ptr(n_buffer, 1);
30361         size = gen_int(n_size, 2);
30362         URL = gen_filepath(n_URL, 3);
30363         encoding = gen_const_char_ptr(n_encoding, 4);
30364         options = gen_parseroptions(n_options, 5);
30365
30366         ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30367         desret_int(ret_val);
30368         call_tests++;
30369         des_xmlTextReaderPtr(n_reader, reader, 0);
30370         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30371         des_int(n_size, size, 2);
30372         des_filepath(n_URL, URL, 3);
30373         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30374         des_parseroptions(n_options, options, 5);
30375         xmlResetLastError();
30376         if (mem_base != xmlMemBlocks()) {
30377             printf("Leak of %d blocks found in xmlReaderNewMemory",
30378                    xmlMemBlocks() - mem_base);
30379             test_ret++;
30380             printf(" %d", n_reader);
30381             printf(" %d", n_buffer);
30382             printf(" %d", n_size);
30383             printf(" %d", n_URL);
30384             printf(" %d", n_encoding);
30385             printf(" %d", n_options);
30386             printf("\n");
30387         }
30388     }
30389     }
30390     }
30391     }
30392     }
30393     }
30394     function_tests++;
30395 #endif
30396
30397     return(test_ret);
30398 }
30399
30400
30401 static int
30402 test_xmlReaderNewWalker(void) {
30403     int test_ret = 0;
30404
30405 #if defined(LIBXML_READER_ENABLED)
30406     int mem_base;
30407     int ret_val;
30408     xmlTextReaderPtr reader; /* an XML reader */
30409     int n_reader;
30410     xmlDocPtr doc; /* a preparsed document */
30411     int n_doc;
30412
30413     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30414     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30415         mem_base = xmlMemBlocks();
30416         reader = gen_xmlTextReaderPtr(n_reader, 0);
30417         doc = gen_xmlDocPtr(n_doc, 1);
30418
30419         ret_val = xmlReaderNewWalker(reader, doc);
30420         desret_int(ret_val);
30421         call_tests++;
30422         des_xmlTextReaderPtr(n_reader, reader, 0);
30423         des_xmlDocPtr(n_doc, doc, 1);
30424         xmlResetLastError();
30425         if (mem_base != xmlMemBlocks()) {
30426             printf("Leak of %d blocks found in xmlReaderNewWalker",
30427                    xmlMemBlocks() - mem_base);
30428             test_ret++;
30429             printf(" %d", n_reader);
30430             printf(" %d", n_doc);
30431             printf("\n");
30432         }
30433     }
30434     }
30435     function_tests++;
30436 #endif
30437
30438     return(test_ret);
30439 }
30440
30441
30442 static int
30443 test_xmlReaderWalker(void) {
30444     int test_ret = 0;
30445
30446 #if defined(LIBXML_READER_ENABLED)
30447     int mem_base;
30448     xmlTextReaderPtr ret_val;
30449     xmlDocPtr doc; /* a preparsed document */
30450     int n_doc;
30451
30452     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30453         mem_base = xmlMemBlocks();
30454         doc = gen_xmlDocPtr(n_doc, 0);
30455
30456         ret_val = xmlReaderWalker(doc);
30457         desret_xmlTextReaderPtr(ret_val);
30458         call_tests++;
30459         des_xmlDocPtr(n_doc, doc, 0);
30460         xmlResetLastError();
30461         if (mem_base != xmlMemBlocks()) {
30462             printf("Leak of %d blocks found in xmlReaderWalker",
30463                    xmlMemBlocks() - mem_base);
30464             test_ret++;
30465             printf(" %d", n_doc);
30466             printf("\n");
30467         }
30468     }
30469     function_tests++;
30470 #endif
30471
30472     return(test_ret);
30473 }
30474
30475
30476 static int
30477 test_xmlTextReaderAttributeCount(void) {
30478     int test_ret = 0;
30479
30480 #if defined(LIBXML_READER_ENABLED)
30481     int mem_base;
30482     int ret_val;
30483     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30484     int n_reader;
30485
30486     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30487         mem_base = xmlMemBlocks();
30488         reader = gen_xmlTextReaderPtr(n_reader, 0);
30489
30490         ret_val = xmlTextReaderAttributeCount(reader);
30491         desret_int(ret_val);
30492         call_tests++;
30493         des_xmlTextReaderPtr(n_reader, reader, 0);
30494         xmlResetLastError();
30495         if (mem_base != xmlMemBlocks()) {
30496             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30497                    xmlMemBlocks() - mem_base);
30498             test_ret++;
30499             printf(" %d", n_reader);
30500             printf("\n");
30501         }
30502     }
30503     function_tests++;
30504 #endif
30505
30506     return(test_ret);
30507 }
30508
30509
30510 static int
30511 test_xmlTextReaderBaseUri(void) {
30512     int test_ret = 0;
30513
30514 #if defined(LIBXML_READER_ENABLED)
30515     int mem_base;
30516     xmlChar * ret_val;
30517     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30518     int n_reader;
30519
30520     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30521         mem_base = xmlMemBlocks();
30522         reader = gen_xmlTextReaderPtr(n_reader, 0);
30523
30524         ret_val = xmlTextReaderBaseUri(reader);
30525         desret_xmlChar_ptr(ret_val);
30526         call_tests++;
30527         des_xmlTextReaderPtr(n_reader, reader, 0);
30528         xmlResetLastError();
30529         if (mem_base != xmlMemBlocks()) {
30530             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30531                    xmlMemBlocks() - mem_base);
30532             test_ret++;
30533             printf(" %d", n_reader);
30534             printf("\n");
30535         }
30536     }
30537     function_tests++;
30538 #endif
30539
30540     return(test_ret);
30541 }
30542
30543
30544 static int
30545 test_xmlTextReaderByteConsumed(void) {
30546     int test_ret = 0;
30547
30548 #if defined(LIBXML_READER_ENABLED)
30549     int mem_base;
30550     long ret_val;
30551     xmlTextReaderPtr reader; /* an XML reader */
30552     int n_reader;
30553
30554     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30555         mem_base = xmlMemBlocks();
30556         reader = gen_xmlTextReaderPtr(n_reader, 0);
30557
30558         ret_val = xmlTextReaderByteConsumed(reader);
30559         desret_long(ret_val);
30560         call_tests++;
30561         des_xmlTextReaderPtr(n_reader, reader, 0);
30562         xmlResetLastError();
30563         if (mem_base != xmlMemBlocks()) {
30564             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30565                    xmlMemBlocks() - mem_base);
30566             test_ret++;
30567             printf(" %d", n_reader);
30568             printf("\n");
30569         }
30570     }
30571     function_tests++;
30572 #endif
30573
30574     return(test_ret);
30575 }
30576
30577
30578 static int
30579 test_xmlTextReaderClose(void) {
30580     int test_ret = 0;
30581
30582 #if defined(LIBXML_READER_ENABLED)
30583     int mem_base;
30584     int ret_val;
30585     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30586     int n_reader;
30587
30588     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30589         mem_base = xmlMemBlocks();
30590         reader = gen_xmlTextReaderPtr(n_reader, 0);
30591
30592         ret_val = xmlTextReaderClose(reader);
30593         desret_int(ret_val);
30594         call_tests++;
30595         des_xmlTextReaderPtr(n_reader, reader, 0);
30596         xmlResetLastError();
30597         if (mem_base != xmlMemBlocks()) {
30598             printf("Leak of %d blocks found in xmlTextReaderClose",
30599                    xmlMemBlocks() - mem_base);
30600             test_ret++;
30601             printf(" %d", n_reader);
30602             printf("\n");
30603         }
30604     }
30605     function_tests++;
30606 #endif
30607
30608     return(test_ret);
30609 }
30610
30611
30612 static int
30613 test_xmlTextReaderConstBaseUri(void) {
30614     int test_ret = 0;
30615
30616 #if defined(LIBXML_READER_ENABLED)
30617     int mem_base;
30618     const xmlChar * ret_val;
30619     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30620     int n_reader;
30621
30622     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30623         mem_base = xmlMemBlocks();
30624         reader = gen_xmlTextReaderPtr(n_reader, 0);
30625
30626         ret_val = xmlTextReaderConstBaseUri(reader);
30627         desret_const_xmlChar_ptr(ret_val);
30628         call_tests++;
30629         des_xmlTextReaderPtr(n_reader, reader, 0);
30630         xmlResetLastError();
30631         if (mem_base != xmlMemBlocks()) {
30632             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30633                    xmlMemBlocks() - mem_base);
30634             test_ret++;
30635             printf(" %d", n_reader);
30636             printf("\n");
30637         }
30638     }
30639     function_tests++;
30640 #endif
30641
30642     return(test_ret);
30643 }
30644
30645
30646 static int
30647 test_xmlTextReaderConstEncoding(void) {
30648     int test_ret = 0;
30649
30650 #if defined(LIBXML_READER_ENABLED)
30651     int mem_base;
30652     const xmlChar * ret_val;
30653     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30654     int n_reader;
30655
30656     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30657         mem_base = xmlMemBlocks();
30658         reader = gen_xmlTextReaderPtr(n_reader, 0);
30659
30660         ret_val = xmlTextReaderConstEncoding(reader);
30661         desret_const_xmlChar_ptr(ret_val);
30662         call_tests++;
30663         des_xmlTextReaderPtr(n_reader, reader, 0);
30664         xmlResetLastError();
30665         if (mem_base != xmlMemBlocks()) {
30666             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30667                    xmlMemBlocks() - mem_base);
30668             test_ret++;
30669             printf(" %d", n_reader);
30670             printf("\n");
30671         }
30672     }
30673     function_tests++;
30674 #endif
30675
30676     return(test_ret);
30677 }
30678
30679
30680 static int
30681 test_xmlTextReaderConstLocalName(void) {
30682     int test_ret = 0;
30683
30684 #if defined(LIBXML_READER_ENABLED)
30685     int mem_base;
30686     const xmlChar * ret_val;
30687     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30688     int n_reader;
30689
30690     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30691         mem_base = xmlMemBlocks();
30692         reader = gen_xmlTextReaderPtr(n_reader, 0);
30693
30694         ret_val = xmlTextReaderConstLocalName(reader);
30695         desret_const_xmlChar_ptr(ret_val);
30696         call_tests++;
30697         des_xmlTextReaderPtr(n_reader, reader, 0);
30698         xmlResetLastError();
30699         if (mem_base != xmlMemBlocks()) {
30700             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30701                    xmlMemBlocks() - mem_base);
30702             test_ret++;
30703             printf(" %d", n_reader);
30704             printf("\n");
30705         }
30706     }
30707     function_tests++;
30708 #endif
30709
30710     return(test_ret);
30711 }
30712
30713
30714 static int
30715 test_xmlTextReaderConstName(void) {
30716     int test_ret = 0;
30717
30718 #if defined(LIBXML_READER_ENABLED)
30719     int mem_base;
30720     const xmlChar * ret_val;
30721     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30722     int n_reader;
30723
30724     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30725         mem_base = xmlMemBlocks();
30726         reader = gen_xmlTextReaderPtr(n_reader, 0);
30727
30728         ret_val = xmlTextReaderConstName(reader);
30729         desret_const_xmlChar_ptr(ret_val);
30730         call_tests++;
30731         des_xmlTextReaderPtr(n_reader, reader, 0);
30732         xmlResetLastError();
30733         if (mem_base != xmlMemBlocks()) {
30734             printf("Leak of %d blocks found in xmlTextReaderConstName",
30735                    xmlMemBlocks() - mem_base);
30736             test_ret++;
30737             printf(" %d", n_reader);
30738             printf("\n");
30739         }
30740     }
30741     function_tests++;
30742 #endif
30743
30744     return(test_ret);
30745 }
30746
30747
30748 static int
30749 test_xmlTextReaderConstNamespaceUri(void) {
30750     int test_ret = 0;
30751
30752 #if defined(LIBXML_READER_ENABLED)
30753     int mem_base;
30754     const xmlChar * ret_val;
30755     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30756     int n_reader;
30757
30758     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30759         mem_base = xmlMemBlocks();
30760         reader = gen_xmlTextReaderPtr(n_reader, 0);
30761
30762         ret_val = xmlTextReaderConstNamespaceUri(reader);
30763         desret_const_xmlChar_ptr(ret_val);
30764         call_tests++;
30765         des_xmlTextReaderPtr(n_reader, reader, 0);
30766         xmlResetLastError();
30767         if (mem_base != xmlMemBlocks()) {
30768             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30769                    xmlMemBlocks() - mem_base);
30770             test_ret++;
30771             printf(" %d", n_reader);
30772             printf("\n");
30773         }
30774     }
30775     function_tests++;
30776 #endif
30777
30778     return(test_ret);
30779 }
30780
30781
30782 static int
30783 test_xmlTextReaderConstPrefix(void) {
30784     int test_ret = 0;
30785
30786 #if defined(LIBXML_READER_ENABLED)
30787     int mem_base;
30788     const xmlChar * ret_val;
30789     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30790     int n_reader;
30791
30792     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30793         mem_base = xmlMemBlocks();
30794         reader = gen_xmlTextReaderPtr(n_reader, 0);
30795
30796         ret_val = xmlTextReaderConstPrefix(reader);
30797         desret_const_xmlChar_ptr(ret_val);
30798         call_tests++;
30799         des_xmlTextReaderPtr(n_reader, reader, 0);
30800         xmlResetLastError();
30801         if (mem_base != xmlMemBlocks()) {
30802             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30803                    xmlMemBlocks() - mem_base);
30804             test_ret++;
30805             printf(" %d", n_reader);
30806             printf("\n");
30807         }
30808     }
30809     function_tests++;
30810 #endif
30811
30812     return(test_ret);
30813 }
30814
30815
30816 static int
30817 test_xmlTextReaderConstString(void) {
30818     int test_ret = 0;
30819
30820 #if defined(LIBXML_READER_ENABLED)
30821     int mem_base;
30822     const xmlChar * ret_val;
30823     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30824     int n_reader;
30825     xmlChar * str; /* the string to intern. */
30826     int n_str;
30827
30828     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30829     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30830         mem_base = xmlMemBlocks();
30831         reader = gen_xmlTextReaderPtr(n_reader, 0);
30832         str = gen_const_xmlChar_ptr(n_str, 1);
30833
30834         ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30835         desret_const_xmlChar_ptr(ret_val);
30836         call_tests++;
30837         des_xmlTextReaderPtr(n_reader, reader, 0);
30838         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30839         xmlResetLastError();
30840         if (mem_base != xmlMemBlocks()) {
30841             printf("Leak of %d blocks found in xmlTextReaderConstString",
30842                    xmlMemBlocks() - mem_base);
30843             test_ret++;
30844             printf(" %d", n_reader);
30845             printf(" %d", n_str);
30846             printf("\n");
30847         }
30848     }
30849     }
30850     function_tests++;
30851 #endif
30852
30853     return(test_ret);
30854 }
30855
30856
30857 static int
30858 test_xmlTextReaderConstValue(void) {
30859     int test_ret = 0;
30860
30861 #if defined(LIBXML_READER_ENABLED)
30862     int mem_base;
30863     const xmlChar * ret_val;
30864     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30865     int n_reader;
30866
30867     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30868         mem_base = xmlMemBlocks();
30869         reader = gen_xmlTextReaderPtr(n_reader, 0);
30870
30871         ret_val = xmlTextReaderConstValue(reader);
30872         desret_const_xmlChar_ptr(ret_val);
30873         call_tests++;
30874         des_xmlTextReaderPtr(n_reader, reader, 0);
30875         xmlResetLastError();
30876         if (mem_base != xmlMemBlocks()) {
30877             printf("Leak of %d blocks found in xmlTextReaderConstValue",
30878                    xmlMemBlocks() - mem_base);
30879             test_ret++;
30880             printf(" %d", n_reader);
30881             printf("\n");
30882         }
30883     }
30884     function_tests++;
30885 #endif
30886
30887     return(test_ret);
30888 }
30889
30890
30891 static int
30892 test_xmlTextReaderConstXmlLang(void) {
30893     int test_ret = 0;
30894
30895 #if defined(LIBXML_READER_ENABLED)
30896     int mem_base;
30897     const xmlChar * ret_val;
30898     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30899     int n_reader;
30900
30901     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30902         mem_base = xmlMemBlocks();
30903         reader = gen_xmlTextReaderPtr(n_reader, 0);
30904
30905         ret_val = xmlTextReaderConstXmlLang(reader);
30906         desret_const_xmlChar_ptr(ret_val);
30907         call_tests++;
30908         des_xmlTextReaderPtr(n_reader, reader, 0);
30909         xmlResetLastError();
30910         if (mem_base != xmlMemBlocks()) {
30911             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30912                    xmlMemBlocks() - mem_base);
30913             test_ret++;
30914             printf(" %d", n_reader);
30915             printf("\n");
30916         }
30917     }
30918     function_tests++;
30919 #endif
30920
30921     return(test_ret);
30922 }
30923
30924
30925 static int
30926 test_xmlTextReaderConstXmlVersion(void) {
30927     int test_ret = 0;
30928
30929 #if defined(LIBXML_READER_ENABLED)
30930     int mem_base;
30931     const xmlChar * ret_val;
30932     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30933     int n_reader;
30934
30935     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30936         mem_base = xmlMemBlocks();
30937         reader = gen_xmlTextReaderPtr(n_reader, 0);
30938
30939         ret_val = xmlTextReaderConstXmlVersion(reader);
30940         desret_const_xmlChar_ptr(ret_val);
30941         call_tests++;
30942         des_xmlTextReaderPtr(n_reader, reader, 0);
30943         xmlResetLastError();
30944         if (mem_base != xmlMemBlocks()) {
30945             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30946                    xmlMemBlocks() - mem_base);
30947             test_ret++;
30948             printf(" %d", n_reader);
30949             printf("\n");
30950         }
30951     }
30952     function_tests++;
30953 #endif
30954
30955     return(test_ret);
30956 }
30957
30958
30959 static int
30960 test_xmlTextReaderCurrentDoc(void) {
30961     int test_ret = 0;
30962
30963 #if defined(LIBXML_READER_ENABLED)
30964     int mem_base;
30965     xmlDocPtr ret_val;
30966     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30967     int n_reader;
30968
30969     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30970         mem_base = xmlMemBlocks();
30971         reader = gen_xmlTextReaderPtr(n_reader, 0);
30972
30973         ret_val = xmlTextReaderCurrentDoc(reader);
30974         desret_xmlDocPtr(ret_val);
30975         call_tests++;
30976         des_xmlTextReaderPtr(n_reader, reader, 0);
30977         xmlResetLastError();
30978         if (mem_base != xmlMemBlocks()) {
30979             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30980                    xmlMemBlocks() - mem_base);
30981             test_ret++;
30982             printf(" %d", n_reader);
30983             printf("\n");
30984         }
30985     }
30986     function_tests++;
30987 #endif
30988
30989     return(test_ret);
30990 }
30991
30992
30993 static int
30994 test_xmlTextReaderCurrentNode(void) {
30995     int test_ret = 0;
30996
30997 #if defined(LIBXML_READER_ENABLED)
30998     int mem_base;
30999     xmlNodePtr ret_val;
31000     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31001     int n_reader;
31002
31003     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31004         mem_base = xmlMemBlocks();
31005         reader = gen_xmlTextReaderPtr(n_reader, 0);
31006
31007         ret_val = xmlTextReaderCurrentNode(reader);
31008         desret_xmlNodePtr(ret_val);
31009         call_tests++;
31010         des_xmlTextReaderPtr(n_reader, reader, 0);
31011         xmlResetLastError();
31012         if (mem_base != xmlMemBlocks()) {
31013             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
31014                    xmlMemBlocks() - mem_base);
31015             test_ret++;
31016             printf(" %d", n_reader);
31017             printf("\n");
31018         }
31019     }
31020     function_tests++;
31021 #endif
31022
31023     return(test_ret);
31024 }
31025
31026
31027 static int
31028 test_xmlTextReaderDepth(void) {
31029     int test_ret = 0;
31030
31031 #if defined(LIBXML_READER_ENABLED)
31032     int mem_base;
31033     int ret_val;
31034     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31035     int n_reader;
31036
31037     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31038         mem_base = xmlMemBlocks();
31039         reader = gen_xmlTextReaderPtr(n_reader, 0);
31040
31041         ret_val = xmlTextReaderDepth(reader);
31042         desret_int(ret_val);
31043         call_tests++;
31044         des_xmlTextReaderPtr(n_reader, reader, 0);
31045         xmlResetLastError();
31046         if (mem_base != xmlMemBlocks()) {
31047             printf("Leak of %d blocks found in xmlTextReaderDepth",
31048                    xmlMemBlocks() - mem_base);
31049             test_ret++;
31050             printf(" %d", n_reader);
31051             printf("\n");
31052         }
31053     }
31054     function_tests++;
31055 #endif
31056
31057     return(test_ret);
31058 }
31059
31060
31061 static int
31062 test_xmlTextReaderExpand(void) {
31063     int test_ret = 0;
31064
31065 #if defined(LIBXML_READER_ENABLED)
31066     int mem_base;
31067     xmlNodePtr ret_val;
31068     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31069     int n_reader;
31070
31071     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31072         mem_base = xmlMemBlocks();
31073         reader = gen_xmlTextReaderPtr(n_reader, 0);
31074
31075         ret_val = xmlTextReaderExpand(reader);
31076         desret_xmlNodePtr(ret_val);
31077         call_tests++;
31078         des_xmlTextReaderPtr(n_reader, reader, 0);
31079         xmlResetLastError();
31080         if (mem_base != xmlMemBlocks()) {
31081             printf("Leak of %d blocks found in xmlTextReaderExpand",
31082                    xmlMemBlocks() - mem_base);
31083             test_ret++;
31084             printf(" %d", n_reader);
31085             printf("\n");
31086         }
31087     }
31088     function_tests++;
31089 #endif
31090
31091     return(test_ret);
31092 }
31093
31094
31095 static int
31096 test_xmlTextReaderGetAttribute(void) {
31097     int test_ret = 0;
31098
31099 #if defined(LIBXML_READER_ENABLED)
31100     int mem_base;
31101     xmlChar * ret_val;
31102     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31103     int n_reader;
31104     xmlChar * name; /* the qualified name of the attribute. */
31105     int n_name;
31106
31107     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31108     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31109         mem_base = xmlMemBlocks();
31110         reader = gen_xmlTextReaderPtr(n_reader, 0);
31111         name = gen_const_xmlChar_ptr(n_name, 1);
31112
31113         ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
31114         desret_xmlChar_ptr(ret_val);
31115         call_tests++;
31116         des_xmlTextReaderPtr(n_reader, reader, 0);
31117         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31118         xmlResetLastError();
31119         if (mem_base != xmlMemBlocks()) {
31120             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
31121                    xmlMemBlocks() - mem_base);
31122             test_ret++;
31123             printf(" %d", n_reader);
31124             printf(" %d", n_name);
31125             printf("\n");
31126         }
31127     }
31128     }
31129     function_tests++;
31130 #endif
31131
31132     return(test_ret);
31133 }
31134
31135
31136 static int
31137 test_xmlTextReaderGetAttributeNo(void) {
31138     int test_ret = 0;
31139
31140 #if defined(LIBXML_READER_ENABLED)
31141     int mem_base;
31142     xmlChar * ret_val;
31143     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31144     int n_reader;
31145     int no; /* the zero-based index of the attribute relative to the containing element */
31146     int n_no;
31147
31148     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31149     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31150         mem_base = xmlMemBlocks();
31151         reader = gen_xmlTextReaderPtr(n_reader, 0);
31152         no = gen_int(n_no, 1);
31153
31154         ret_val = xmlTextReaderGetAttributeNo(reader, no);
31155         desret_xmlChar_ptr(ret_val);
31156         call_tests++;
31157         des_xmlTextReaderPtr(n_reader, reader, 0);
31158         des_int(n_no, no, 1);
31159         xmlResetLastError();
31160         if (mem_base != xmlMemBlocks()) {
31161             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
31162                    xmlMemBlocks() - mem_base);
31163             test_ret++;
31164             printf(" %d", n_reader);
31165             printf(" %d", n_no);
31166             printf("\n");
31167         }
31168     }
31169     }
31170     function_tests++;
31171 #endif
31172
31173     return(test_ret);
31174 }
31175
31176
31177 static int
31178 test_xmlTextReaderGetAttributeNs(void) {
31179     int test_ret = 0;
31180
31181 #if defined(LIBXML_READER_ENABLED)
31182     int mem_base;
31183     xmlChar * ret_val;
31184     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31185     int n_reader;
31186     xmlChar * localName; /* the local name of the attribute. */
31187     int n_localName;
31188     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31189     int n_namespaceURI;
31190
31191     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31192     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31193     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31194         mem_base = xmlMemBlocks();
31195         reader = gen_xmlTextReaderPtr(n_reader, 0);
31196         localName = gen_const_xmlChar_ptr(n_localName, 1);
31197         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31198
31199         ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31200         desret_xmlChar_ptr(ret_val);
31201         call_tests++;
31202         des_xmlTextReaderPtr(n_reader, reader, 0);
31203         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31204         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31205         xmlResetLastError();
31206         if (mem_base != xmlMemBlocks()) {
31207             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
31208                    xmlMemBlocks() - mem_base);
31209             test_ret++;
31210             printf(" %d", n_reader);
31211             printf(" %d", n_localName);
31212             printf(" %d", n_namespaceURI);
31213             printf("\n");
31214         }
31215     }
31216     }
31217     }
31218     function_tests++;
31219 #endif
31220
31221     return(test_ret);
31222 }
31223
31224 #ifdef LIBXML_READER_ENABLED
31225
31226 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
31227 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31228     return(NULL);
31229 }
31230 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31231 }
31232 #endif
31233
31234
31235 static int
31236 test_xmlTextReaderGetErrorHandler(void) {
31237     int test_ret = 0;
31238
31239 #if defined(LIBXML_READER_ENABLED)
31240     int mem_base;
31241     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31242     int n_reader;
31243     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31244     int n_f;
31245     void ** arg; /* a user argument */
31246     int n_arg;
31247
31248     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31249     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31250     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31251         mem_base = xmlMemBlocks();
31252         reader = gen_xmlTextReaderPtr(n_reader, 0);
31253         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31254         arg = gen_void_ptr_ptr(n_arg, 2);
31255
31256         xmlTextReaderGetErrorHandler(reader, f, arg);
31257         call_tests++;
31258         des_xmlTextReaderPtr(n_reader, reader, 0);
31259         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31260         des_void_ptr_ptr(n_arg, arg, 2);
31261         xmlResetLastError();
31262         if (mem_base != xmlMemBlocks()) {
31263             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31264                    xmlMemBlocks() - mem_base);
31265             test_ret++;
31266             printf(" %d", n_reader);
31267             printf(" %d", n_f);
31268             printf(" %d", n_arg);
31269             printf("\n");
31270         }
31271     }
31272     }
31273     }
31274     function_tests++;
31275 #endif
31276
31277     return(test_ret);
31278 }
31279
31280
31281 static int
31282 test_xmlTextReaderGetParserColumnNumber(void) {
31283     int test_ret = 0;
31284
31285 #if defined(LIBXML_READER_ENABLED)
31286     int mem_base;
31287     int ret_val;
31288     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31289     int n_reader;
31290
31291     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31292         mem_base = xmlMemBlocks();
31293         reader = gen_xmlTextReaderPtr(n_reader, 0);
31294
31295         ret_val = xmlTextReaderGetParserColumnNumber(reader);
31296         desret_int(ret_val);
31297         call_tests++;
31298         des_xmlTextReaderPtr(n_reader, reader, 0);
31299         xmlResetLastError();
31300         if (mem_base != xmlMemBlocks()) {
31301             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31302                    xmlMemBlocks() - mem_base);
31303             test_ret++;
31304             printf(" %d", n_reader);
31305             printf("\n");
31306         }
31307     }
31308     function_tests++;
31309 #endif
31310
31311     return(test_ret);
31312 }
31313
31314
31315 static int
31316 test_xmlTextReaderGetParserLineNumber(void) {
31317     int test_ret = 0;
31318
31319 #if defined(LIBXML_READER_ENABLED)
31320     int mem_base;
31321     int ret_val;
31322     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31323     int n_reader;
31324
31325     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31326         mem_base = xmlMemBlocks();
31327         reader = gen_xmlTextReaderPtr(n_reader, 0);
31328
31329         ret_val = xmlTextReaderGetParserLineNumber(reader);
31330         desret_int(ret_val);
31331         call_tests++;
31332         des_xmlTextReaderPtr(n_reader, reader, 0);
31333         xmlResetLastError();
31334         if (mem_base != xmlMemBlocks()) {
31335             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31336                    xmlMemBlocks() - mem_base);
31337             test_ret++;
31338             printf(" %d", n_reader);
31339             printf("\n");
31340         }
31341     }
31342     function_tests++;
31343 #endif
31344
31345     return(test_ret);
31346 }
31347
31348
31349 static int
31350 test_xmlTextReaderGetParserProp(void) {
31351     int test_ret = 0;
31352
31353 #if defined(LIBXML_READER_ENABLED)
31354     int mem_base;
31355     int ret_val;
31356     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31357     int n_reader;
31358     int prop; /* the xmlParserProperties to get */
31359     int n_prop;
31360
31361     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31362     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31363         mem_base = xmlMemBlocks();
31364         reader = gen_xmlTextReaderPtr(n_reader, 0);
31365         prop = gen_int(n_prop, 1);
31366
31367         ret_val = xmlTextReaderGetParserProp(reader, prop);
31368         desret_int(ret_val);
31369         call_tests++;
31370         des_xmlTextReaderPtr(n_reader, reader, 0);
31371         des_int(n_prop, prop, 1);
31372         xmlResetLastError();
31373         if (mem_base != xmlMemBlocks()) {
31374             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31375                    xmlMemBlocks() - mem_base);
31376             test_ret++;
31377             printf(" %d", n_reader);
31378             printf(" %d", n_prop);
31379             printf("\n");
31380         }
31381     }
31382     }
31383     function_tests++;
31384 #endif
31385
31386     return(test_ret);
31387 }
31388
31389
31390 static int
31391 test_xmlTextReaderGetRemainder(void) {
31392     int test_ret = 0;
31393
31394 #if defined(LIBXML_READER_ENABLED)
31395     int mem_base;
31396     xmlParserInputBufferPtr ret_val;
31397     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31398     int n_reader;
31399
31400     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31401         mem_base = xmlMemBlocks();
31402         reader = gen_xmlTextReaderPtr(n_reader, 0);
31403
31404         ret_val = xmlTextReaderGetRemainder(reader);
31405         desret_xmlParserInputBufferPtr(ret_val);
31406         call_tests++;
31407         des_xmlTextReaderPtr(n_reader, reader, 0);
31408         xmlResetLastError();
31409         if (mem_base != xmlMemBlocks()) {
31410             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31411                    xmlMemBlocks() - mem_base);
31412             test_ret++;
31413             printf(" %d", n_reader);
31414             printf("\n");
31415         }
31416     }
31417     function_tests++;
31418 #endif
31419
31420     return(test_ret);
31421 }
31422
31423
31424 static int
31425 test_xmlTextReaderHasAttributes(void) {
31426     int test_ret = 0;
31427
31428 #if defined(LIBXML_READER_ENABLED)
31429     int mem_base;
31430     int ret_val;
31431     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31432     int n_reader;
31433
31434     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31435         mem_base = xmlMemBlocks();
31436         reader = gen_xmlTextReaderPtr(n_reader, 0);
31437
31438         ret_val = xmlTextReaderHasAttributes(reader);
31439         desret_int(ret_val);
31440         call_tests++;
31441         des_xmlTextReaderPtr(n_reader, reader, 0);
31442         xmlResetLastError();
31443         if (mem_base != xmlMemBlocks()) {
31444             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31445                    xmlMemBlocks() - mem_base);
31446             test_ret++;
31447             printf(" %d", n_reader);
31448             printf("\n");
31449         }
31450     }
31451     function_tests++;
31452 #endif
31453
31454     return(test_ret);
31455 }
31456
31457
31458 static int
31459 test_xmlTextReaderHasValue(void) {
31460     int test_ret = 0;
31461
31462 #if defined(LIBXML_READER_ENABLED)
31463     int mem_base;
31464     int ret_val;
31465     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31466     int n_reader;
31467
31468     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31469         mem_base = xmlMemBlocks();
31470         reader = gen_xmlTextReaderPtr(n_reader, 0);
31471
31472         ret_val = xmlTextReaderHasValue(reader);
31473         desret_int(ret_val);
31474         call_tests++;
31475         des_xmlTextReaderPtr(n_reader, reader, 0);
31476         xmlResetLastError();
31477         if (mem_base != xmlMemBlocks()) {
31478             printf("Leak of %d blocks found in xmlTextReaderHasValue",
31479                    xmlMemBlocks() - mem_base);
31480             test_ret++;
31481             printf(" %d", n_reader);
31482             printf("\n");
31483         }
31484     }
31485     function_tests++;
31486 #endif
31487
31488     return(test_ret);
31489 }
31490
31491
31492 static int
31493 test_xmlTextReaderIsDefault(void) {
31494     int test_ret = 0;
31495
31496 #if defined(LIBXML_READER_ENABLED)
31497     int mem_base;
31498     int ret_val;
31499     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31500     int n_reader;
31501
31502     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31503         mem_base = xmlMemBlocks();
31504         reader = gen_xmlTextReaderPtr(n_reader, 0);
31505
31506         ret_val = xmlTextReaderIsDefault(reader);
31507         desret_int(ret_val);
31508         call_tests++;
31509         des_xmlTextReaderPtr(n_reader, reader, 0);
31510         xmlResetLastError();
31511         if (mem_base != xmlMemBlocks()) {
31512             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31513                    xmlMemBlocks() - mem_base);
31514             test_ret++;
31515             printf(" %d", n_reader);
31516             printf("\n");
31517         }
31518     }
31519     function_tests++;
31520 #endif
31521
31522     return(test_ret);
31523 }
31524
31525
31526 static int
31527 test_xmlTextReaderIsEmptyElement(void) {
31528     int test_ret = 0;
31529
31530 #if defined(LIBXML_READER_ENABLED)
31531     int mem_base;
31532     int ret_val;
31533     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31534     int n_reader;
31535
31536     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31537         mem_base = xmlMemBlocks();
31538         reader = gen_xmlTextReaderPtr(n_reader, 0);
31539
31540         ret_val = xmlTextReaderIsEmptyElement(reader);
31541         desret_int(ret_val);
31542         call_tests++;
31543         des_xmlTextReaderPtr(n_reader, reader, 0);
31544         xmlResetLastError();
31545         if (mem_base != xmlMemBlocks()) {
31546             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31547                    xmlMemBlocks() - mem_base);
31548             test_ret++;
31549             printf(" %d", n_reader);
31550             printf("\n");
31551         }
31552     }
31553     function_tests++;
31554 #endif
31555
31556     return(test_ret);
31557 }
31558
31559
31560 static int
31561 test_xmlTextReaderIsNamespaceDecl(void) {
31562     int test_ret = 0;
31563
31564 #if defined(LIBXML_READER_ENABLED)
31565     int mem_base;
31566     int ret_val;
31567     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31568     int n_reader;
31569
31570     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31571         mem_base = xmlMemBlocks();
31572         reader = gen_xmlTextReaderPtr(n_reader, 0);
31573
31574         ret_val = xmlTextReaderIsNamespaceDecl(reader);
31575         desret_int(ret_val);
31576         call_tests++;
31577         des_xmlTextReaderPtr(n_reader, reader, 0);
31578         xmlResetLastError();
31579         if (mem_base != xmlMemBlocks()) {
31580             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31581                    xmlMemBlocks() - mem_base);
31582             test_ret++;
31583             printf(" %d", n_reader);
31584             printf("\n");
31585         }
31586     }
31587     function_tests++;
31588 #endif
31589
31590     return(test_ret);
31591 }
31592
31593
31594 static int
31595 test_xmlTextReaderIsValid(void) {
31596     int test_ret = 0;
31597
31598 #if defined(LIBXML_READER_ENABLED)
31599     int mem_base;
31600     int ret_val;
31601     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31602     int n_reader;
31603
31604     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31605         mem_base = xmlMemBlocks();
31606         reader = gen_xmlTextReaderPtr(n_reader, 0);
31607
31608         ret_val = xmlTextReaderIsValid(reader);
31609         desret_int(ret_val);
31610         call_tests++;
31611         des_xmlTextReaderPtr(n_reader, reader, 0);
31612         xmlResetLastError();
31613         if (mem_base != xmlMemBlocks()) {
31614             printf("Leak of %d blocks found in xmlTextReaderIsValid",
31615                    xmlMemBlocks() - mem_base);
31616             test_ret++;
31617             printf(" %d", n_reader);
31618             printf("\n");
31619         }
31620     }
31621     function_tests++;
31622 #endif
31623
31624     return(test_ret);
31625 }
31626
31627
31628 static int
31629 test_xmlTextReaderLocalName(void) {
31630     int test_ret = 0;
31631
31632 #if defined(LIBXML_READER_ENABLED)
31633     int mem_base;
31634     xmlChar * ret_val;
31635     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31636     int n_reader;
31637
31638     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31639         mem_base = xmlMemBlocks();
31640         reader = gen_xmlTextReaderPtr(n_reader, 0);
31641
31642         ret_val = xmlTextReaderLocalName(reader);
31643         desret_xmlChar_ptr(ret_val);
31644         call_tests++;
31645         des_xmlTextReaderPtr(n_reader, reader, 0);
31646         xmlResetLastError();
31647         if (mem_base != xmlMemBlocks()) {
31648             printf("Leak of %d blocks found in xmlTextReaderLocalName",
31649                    xmlMemBlocks() - mem_base);
31650             test_ret++;
31651             printf(" %d", n_reader);
31652             printf("\n");
31653         }
31654     }
31655     function_tests++;
31656 #endif
31657
31658     return(test_ret);
31659 }
31660
31661 #ifdef LIBXML_READER_ENABLED
31662
31663 #define gen_nb_xmlTextReaderLocatorPtr 1
31664 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31665     return(NULL);
31666 }
31667 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31668 }
31669 #endif
31670
31671
31672 static int
31673 test_xmlTextReaderLocatorBaseURI(void) {
31674     int test_ret = 0;
31675
31676 #if defined(LIBXML_READER_ENABLED)
31677     int mem_base;
31678     xmlChar * ret_val;
31679     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31680     int n_locator;
31681
31682     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31683         mem_base = xmlMemBlocks();
31684         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31685
31686         ret_val = xmlTextReaderLocatorBaseURI(locator);
31687         desret_xmlChar_ptr(ret_val);
31688         call_tests++;
31689         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31690         xmlResetLastError();
31691         if (mem_base != xmlMemBlocks()) {
31692             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31693                    xmlMemBlocks() - mem_base);
31694             test_ret++;
31695             printf(" %d", n_locator);
31696             printf("\n");
31697         }
31698     }
31699     function_tests++;
31700 #endif
31701
31702     return(test_ret);
31703 }
31704
31705
31706 static int
31707 test_xmlTextReaderLocatorLineNumber(void) {
31708     int test_ret = 0;
31709
31710 #if defined(LIBXML_READER_ENABLED)
31711     int mem_base;
31712     int ret_val;
31713     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31714     int n_locator;
31715
31716     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31717         mem_base = xmlMemBlocks();
31718         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31719
31720         ret_val = xmlTextReaderLocatorLineNumber(locator);
31721         desret_int(ret_val);
31722         call_tests++;
31723         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31724         xmlResetLastError();
31725         if (mem_base != xmlMemBlocks()) {
31726             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31727                    xmlMemBlocks() - mem_base);
31728             test_ret++;
31729             printf(" %d", n_locator);
31730             printf("\n");
31731         }
31732     }
31733     function_tests++;
31734 #endif
31735
31736     return(test_ret);
31737 }
31738
31739
31740 static int
31741 test_xmlTextReaderLookupNamespace(void) {
31742     int test_ret = 0;
31743
31744 #if defined(LIBXML_READER_ENABLED)
31745     int mem_base;
31746     xmlChar * ret_val;
31747     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31748     int n_reader;
31749     xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31750     int n_prefix;
31751
31752     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31753     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31754         mem_base = xmlMemBlocks();
31755         reader = gen_xmlTextReaderPtr(n_reader, 0);
31756         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31757
31758         ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31759         desret_xmlChar_ptr(ret_val);
31760         call_tests++;
31761         des_xmlTextReaderPtr(n_reader, reader, 0);
31762         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31763         xmlResetLastError();
31764         if (mem_base != xmlMemBlocks()) {
31765             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31766                    xmlMemBlocks() - mem_base);
31767             test_ret++;
31768             printf(" %d", n_reader);
31769             printf(" %d", n_prefix);
31770             printf("\n");
31771         }
31772     }
31773     }
31774     function_tests++;
31775 #endif
31776
31777     return(test_ret);
31778 }
31779
31780
31781 static int
31782 test_xmlTextReaderMoveToAttribute(void) {
31783     int test_ret = 0;
31784
31785 #if defined(LIBXML_READER_ENABLED)
31786     int mem_base;
31787     int ret_val;
31788     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31789     int n_reader;
31790     xmlChar * name; /* the qualified name of the attribute. */
31791     int n_name;
31792
31793     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31794     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31795         mem_base = xmlMemBlocks();
31796         reader = gen_xmlTextReaderPtr(n_reader, 0);
31797         name = gen_const_xmlChar_ptr(n_name, 1);
31798
31799         ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31800         desret_int(ret_val);
31801         call_tests++;
31802         des_xmlTextReaderPtr(n_reader, reader, 0);
31803         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31804         xmlResetLastError();
31805         if (mem_base != xmlMemBlocks()) {
31806             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31807                    xmlMemBlocks() - mem_base);
31808             test_ret++;
31809             printf(" %d", n_reader);
31810             printf(" %d", n_name);
31811             printf("\n");
31812         }
31813     }
31814     }
31815     function_tests++;
31816 #endif
31817
31818     return(test_ret);
31819 }
31820
31821
31822 static int
31823 test_xmlTextReaderMoveToAttributeNo(void) {
31824     int test_ret = 0;
31825
31826 #if defined(LIBXML_READER_ENABLED)
31827     int mem_base;
31828     int ret_val;
31829     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31830     int n_reader;
31831     int no; /* the zero-based index of the attribute relative to the containing element. */
31832     int n_no;
31833
31834     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31835     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31836         mem_base = xmlMemBlocks();
31837         reader = gen_xmlTextReaderPtr(n_reader, 0);
31838         no = gen_int(n_no, 1);
31839
31840         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31841         desret_int(ret_val);
31842         call_tests++;
31843         des_xmlTextReaderPtr(n_reader, reader, 0);
31844         des_int(n_no, no, 1);
31845         xmlResetLastError();
31846         if (mem_base != xmlMemBlocks()) {
31847             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31848                    xmlMemBlocks() - mem_base);
31849             test_ret++;
31850             printf(" %d", n_reader);
31851             printf(" %d", n_no);
31852             printf("\n");
31853         }
31854     }
31855     }
31856     function_tests++;
31857 #endif
31858
31859     return(test_ret);
31860 }
31861
31862
31863 static int
31864 test_xmlTextReaderMoveToAttributeNs(void) {
31865     int test_ret = 0;
31866
31867 #if defined(LIBXML_READER_ENABLED)
31868     int mem_base;
31869     int ret_val;
31870     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31871     int n_reader;
31872     xmlChar * localName; /* the local name of the attribute. */
31873     int n_localName;
31874     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31875     int n_namespaceURI;
31876
31877     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31878     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31879     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31880         mem_base = xmlMemBlocks();
31881         reader = gen_xmlTextReaderPtr(n_reader, 0);
31882         localName = gen_const_xmlChar_ptr(n_localName, 1);
31883         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31884
31885         ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31886         desret_int(ret_val);
31887         call_tests++;
31888         des_xmlTextReaderPtr(n_reader, reader, 0);
31889         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31890         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31891         xmlResetLastError();
31892         if (mem_base != xmlMemBlocks()) {
31893             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31894                    xmlMemBlocks() - mem_base);
31895             test_ret++;
31896             printf(" %d", n_reader);
31897             printf(" %d", n_localName);
31898             printf(" %d", n_namespaceURI);
31899             printf("\n");
31900         }
31901     }
31902     }
31903     }
31904     function_tests++;
31905 #endif
31906
31907     return(test_ret);
31908 }
31909
31910
31911 static int
31912 test_xmlTextReaderMoveToElement(void) {
31913     int test_ret = 0;
31914
31915 #if defined(LIBXML_READER_ENABLED)
31916     int mem_base;
31917     int ret_val;
31918     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31919     int n_reader;
31920
31921     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31922         mem_base = xmlMemBlocks();
31923         reader = gen_xmlTextReaderPtr(n_reader, 0);
31924
31925         ret_val = xmlTextReaderMoveToElement(reader);
31926         desret_int(ret_val);
31927         call_tests++;
31928         des_xmlTextReaderPtr(n_reader, reader, 0);
31929         xmlResetLastError();
31930         if (mem_base != xmlMemBlocks()) {
31931             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31932                    xmlMemBlocks() - mem_base);
31933             test_ret++;
31934             printf(" %d", n_reader);
31935             printf("\n");
31936         }
31937     }
31938     function_tests++;
31939 #endif
31940
31941     return(test_ret);
31942 }
31943
31944
31945 static int
31946 test_xmlTextReaderMoveToFirstAttribute(void) {
31947     int test_ret = 0;
31948
31949 #if defined(LIBXML_READER_ENABLED)
31950     int mem_base;
31951     int ret_val;
31952     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31953     int n_reader;
31954
31955     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31956         mem_base = xmlMemBlocks();
31957         reader = gen_xmlTextReaderPtr(n_reader, 0);
31958
31959         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31960         desret_int(ret_val);
31961         call_tests++;
31962         des_xmlTextReaderPtr(n_reader, reader, 0);
31963         xmlResetLastError();
31964         if (mem_base != xmlMemBlocks()) {
31965             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31966                    xmlMemBlocks() - mem_base);
31967             test_ret++;
31968             printf(" %d", n_reader);
31969             printf("\n");
31970         }
31971     }
31972     function_tests++;
31973 #endif
31974
31975     return(test_ret);
31976 }
31977
31978
31979 static int
31980 test_xmlTextReaderMoveToNextAttribute(void) {
31981     int test_ret = 0;
31982
31983 #if defined(LIBXML_READER_ENABLED)
31984     int mem_base;
31985     int ret_val;
31986     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31987     int n_reader;
31988
31989     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31990         mem_base = xmlMemBlocks();
31991         reader = gen_xmlTextReaderPtr(n_reader, 0);
31992
31993         ret_val = xmlTextReaderMoveToNextAttribute(reader);
31994         desret_int(ret_val);
31995         call_tests++;
31996         des_xmlTextReaderPtr(n_reader, reader, 0);
31997         xmlResetLastError();
31998         if (mem_base != xmlMemBlocks()) {
31999             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
32000                    xmlMemBlocks() - mem_base);
32001             test_ret++;
32002             printf(" %d", n_reader);
32003             printf("\n");
32004         }
32005     }
32006     function_tests++;
32007 #endif
32008
32009     return(test_ret);
32010 }
32011
32012
32013 static int
32014 test_xmlTextReaderName(void) {
32015     int test_ret = 0;
32016
32017 #if defined(LIBXML_READER_ENABLED)
32018     int mem_base;
32019     xmlChar * ret_val;
32020     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32021     int n_reader;
32022
32023     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32024         mem_base = xmlMemBlocks();
32025         reader = gen_xmlTextReaderPtr(n_reader, 0);
32026
32027         ret_val = xmlTextReaderName(reader);
32028         desret_xmlChar_ptr(ret_val);
32029         call_tests++;
32030         des_xmlTextReaderPtr(n_reader, reader, 0);
32031         xmlResetLastError();
32032         if (mem_base != xmlMemBlocks()) {
32033             printf("Leak of %d blocks found in xmlTextReaderName",
32034                    xmlMemBlocks() - mem_base);
32035             test_ret++;
32036             printf(" %d", n_reader);
32037             printf("\n");
32038         }
32039     }
32040     function_tests++;
32041 #endif
32042
32043     return(test_ret);
32044 }
32045
32046
32047 static int
32048 test_xmlTextReaderNamespaceUri(void) {
32049     int test_ret = 0;
32050
32051 #if defined(LIBXML_READER_ENABLED)
32052     int mem_base;
32053     xmlChar * ret_val;
32054     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32055     int n_reader;
32056
32057     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32058         mem_base = xmlMemBlocks();
32059         reader = gen_xmlTextReaderPtr(n_reader, 0);
32060
32061         ret_val = xmlTextReaderNamespaceUri(reader);
32062         desret_xmlChar_ptr(ret_val);
32063         call_tests++;
32064         des_xmlTextReaderPtr(n_reader, reader, 0);
32065         xmlResetLastError();
32066         if (mem_base != xmlMemBlocks()) {
32067             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
32068                    xmlMemBlocks() - mem_base);
32069             test_ret++;
32070             printf(" %d", n_reader);
32071             printf("\n");
32072         }
32073     }
32074     function_tests++;
32075 #endif
32076
32077     return(test_ret);
32078 }
32079
32080
32081 static int
32082 test_xmlTextReaderNext(void) {
32083     int test_ret = 0;
32084
32085 #if defined(LIBXML_READER_ENABLED)
32086     int mem_base;
32087     int ret_val;
32088     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32089     int n_reader;
32090
32091     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32092         mem_base = xmlMemBlocks();
32093         reader = gen_xmlTextReaderPtr(n_reader, 0);
32094
32095         ret_val = xmlTextReaderNext(reader);
32096         desret_int(ret_val);
32097         call_tests++;
32098         des_xmlTextReaderPtr(n_reader, reader, 0);
32099         xmlResetLastError();
32100         if (mem_base != xmlMemBlocks()) {
32101             printf("Leak of %d blocks found in xmlTextReaderNext",
32102                    xmlMemBlocks() - mem_base);
32103             test_ret++;
32104             printf(" %d", n_reader);
32105             printf("\n");
32106         }
32107     }
32108     function_tests++;
32109 #endif
32110
32111     return(test_ret);
32112 }
32113
32114
32115 static int
32116 test_xmlTextReaderNextSibling(void) {
32117     int test_ret = 0;
32118
32119 #if defined(LIBXML_READER_ENABLED)
32120     int mem_base;
32121     int ret_val;
32122     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32123     int n_reader;
32124
32125     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32126         mem_base = xmlMemBlocks();
32127         reader = gen_xmlTextReaderPtr(n_reader, 0);
32128
32129         ret_val = xmlTextReaderNextSibling(reader);
32130         desret_int(ret_val);
32131         call_tests++;
32132         des_xmlTextReaderPtr(n_reader, reader, 0);
32133         xmlResetLastError();
32134         if (mem_base != xmlMemBlocks()) {
32135             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
32136                    xmlMemBlocks() - mem_base);
32137             test_ret++;
32138             printf(" %d", n_reader);
32139             printf("\n");
32140         }
32141     }
32142     function_tests++;
32143 #endif
32144
32145     return(test_ret);
32146 }
32147
32148
32149 static int
32150 test_xmlTextReaderNodeType(void) {
32151     int test_ret = 0;
32152
32153 #if defined(LIBXML_READER_ENABLED)
32154     int mem_base;
32155     int ret_val;
32156     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32157     int n_reader;
32158
32159     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32160         mem_base = xmlMemBlocks();
32161         reader = gen_xmlTextReaderPtr(n_reader, 0);
32162
32163         ret_val = xmlTextReaderNodeType(reader);
32164         desret_int(ret_val);
32165         call_tests++;
32166         des_xmlTextReaderPtr(n_reader, reader, 0);
32167         xmlResetLastError();
32168         if (mem_base != xmlMemBlocks()) {
32169             printf("Leak of %d blocks found in xmlTextReaderNodeType",
32170                    xmlMemBlocks() - mem_base);
32171             test_ret++;
32172             printf(" %d", n_reader);
32173             printf("\n");
32174         }
32175     }
32176     function_tests++;
32177 #endif
32178
32179     return(test_ret);
32180 }
32181
32182
32183 static int
32184 test_xmlTextReaderNormalization(void) {
32185     int test_ret = 0;
32186
32187 #if defined(LIBXML_READER_ENABLED)
32188     int mem_base;
32189     int ret_val;
32190     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32191     int n_reader;
32192
32193     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32194         mem_base = xmlMemBlocks();
32195         reader = gen_xmlTextReaderPtr(n_reader, 0);
32196
32197         ret_val = xmlTextReaderNormalization(reader);
32198         desret_int(ret_val);
32199         call_tests++;
32200         des_xmlTextReaderPtr(n_reader, reader, 0);
32201         xmlResetLastError();
32202         if (mem_base != xmlMemBlocks()) {
32203             printf("Leak of %d blocks found in xmlTextReaderNormalization",
32204                    xmlMemBlocks() - mem_base);
32205             test_ret++;
32206             printf(" %d", n_reader);
32207             printf("\n");
32208         }
32209     }
32210     function_tests++;
32211 #endif
32212
32213     return(test_ret);
32214 }
32215
32216
32217 static int
32218 test_xmlTextReaderPrefix(void) {
32219     int test_ret = 0;
32220
32221 #if defined(LIBXML_READER_ENABLED)
32222     int mem_base;
32223     xmlChar * ret_val;
32224     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32225     int n_reader;
32226
32227     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32228         mem_base = xmlMemBlocks();
32229         reader = gen_xmlTextReaderPtr(n_reader, 0);
32230
32231         ret_val = xmlTextReaderPrefix(reader);
32232         desret_xmlChar_ptr(ret_val);
32233         call_tests++;
32234         des_xmlTextReaderPtr(n_reader, reader, 0);
32235         xmlResetLastError();
32236         if (mem_base != xmlMemBlocks()) {
32237             printf("Leak of %d blocks found in xmlTextReaderPrefix",
32238                    xmlMemBlocks() - mem_base);
32239             test_ret++;
32240             printf(" %d", n_reader);
32241             printf("\n");
32242         }
32243     }
32244     function_tests++;
32245 #endif
32246
32247     return(test_ret);
32248 }
32249
32250
32251 static int
32252 test_xmlTextReaderPreserve(void) {
32253     int test_ret = 0;
32254
32255 #if defined(LIBXML_READER_ENABLED)
32256     int mem_base;
32257     xmlNodePtr ret_val;
32258     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32259     int n_reader;
32260
32261     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32262         mem_base = xmlMemBlocks();
32263         reader = gen_xmlTextReaderPtr(n_reader, 0);
32264
32265         ret_val = xmlTextReaderPreserve(reader);
32266         desret_xmlNodePtr(ret_val);
32267         call_tests++;
32268         des_xmlTextReaderPtr(n_reader, reader, 0);
32269         xmlResetLastError();
32270         if (mem_base != xmlMemBlocks()) {
32271             printf("Leak of %d blocks found in xmlTextReaderPreserve",
32272                    xmlMemBlocks() - mem_base);
32273             test_ret++;
32274             printf(" %d", n_reader);
32275             printf("\n");
32276         }
32277     }
32278     function_tests++;
32279 #endif
32280
32281     return(test_ret);
32282 }
32283
32284
32285 static int
32286 test_xmlTextReaderPreservePattern(void) {
32287     int test_ret = 0;
32288
32289 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32290 #ifdef LIBXML_PATTERN_ENABLED
32291     int mem_base;
32292     int ret_val;
32293     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32294     int n_reader;
32295     xmlChar * pattern; /* an XPath subset pattern */
32296     int n_pattern;
32297     xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32298     int n_namespaces;
32299
32300     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32301     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32302     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32303         mem_base = xmlMemBlocks();
32304         reader = gen_xmlTextReaderPtr(n_reader, 0);
32305         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32306         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32307
32308         ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32309         desret_int(ret_val);
32310         call_tests++;
32311         des_xmlTextReaderPtr(n_reader, reader, 0);
32312         des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32313         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32314         xmlResetLastError();
32315         if (mem_base != xmlMemBlocks()) {
32316             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32317                    xmlMemBlocks() - mem_base);
32318             test_ret++;
32319             printf(" %d", n_reader);
32320             printf(" %d", n_pattern);
32321             printf(" %d", n_namespaces);
32322             printf("\n");
32323         }
32324     }
32325     }
32326     }
32327     function_tests++;
32328 #endif
32329 #endif
32330
32331     return(test_ret);
32332 }
32333
32334
32335 static int
32336 test_xmlTextReaderQuoteChar(void) {
32337     int test_ret = 0;
32338
32339 #if defined(LIBXML_READER_ENABLED)
32340     int mem_base;
32341     int ret_val;
32342     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32343     int n_reader;
32344
32345     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32346         mem_base = xmlMemBlocks();
32347         reader = gen_xmlTextReaderPtr(n_reader, 0);
32348
32349         ret_val = xmlTextReaderQuoteChar(reader);
32350         desret_int(ret_val);
32351         call_tests++;
32352         des_xmlTextReaderPtr(n_reader, reader, 0);
32353         xmlResetLastError();
32354         if (mem_base != xmlMemBlocks()) {
32355             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32356                    xmlMemBlocks() - mem_base);
32357             test_ret++;
32358             printf(" %d", n_reader);
32359             printf("\n");
32360         }
32361     }
32362     function_tests++;
32363 #endif
32364
32365     return(test_ret);
32366 }
32367
32368
32369 static int
32370 test_xmlTextReaderRead(void) {
32371     int test_ret = 0;
32372
32373 #if defined(LIBXML_READER_ENABLED)
32374     int mem_base;
32375     int ret_val;
32376     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32377     int n_reader;
32378
32379     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32380         mem_base = xmlMemBlocks();
32381         reader = gen_xmlTextReaderPtr(n_reader, 0);
32382
32383         ret_val = xmlTextReaderRead(reader);
32384         desret_int(ret_val);
32385         call_tests++;
32386         des_xmlTextReaderPtr(n_reader, reader, 0);
32387         xmlResetLastError();
32388         if (mem_base != xmlMemBlocks()) {
32389             printf("Leak of %d blocks found in xmlTextReaderRead",
32390                    xmlMemBlocks() - mem_base);
32391             test_ret++;
32392             printf(" %d", n_reader);
32393             printf("\n");
32394         }
32395     }
32396     function_tests++;
32397 #endif
32398
32399     return(test_ret);
32400 }
32401
32402
32403 static int
32404 test_xmlTextReaderReadAttributeValue(void) {
32405     int test_ret = 0;
32406
32407 #if defined(LIBXML_READER_ENABLED)
32408     int mem_base;
32409     int ret_val;
32410     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32411     int n_reader;
32412
32413     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32414         mem_base = xmlMemBlocks();
32415         reader = gen_xmlTextReaderPtr(n_reader, 0);
32416
32417         ret_val = xmlTextReaderReadAttributeValue(reader);
32418         desret_int(ret_val);
32419         call_tests++;
32420         des_xmlTextReaderPtr(n_reader, reader, 0);
32421         xmlResetLastError();
32422         if (mem_base != xmlMemBlocks()) {
32423             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32424                    xmlMemBlocks() - mem_base);
32425             test_ret++;
32426             printf(" %d", n_reader);
32427             printf("\n");
32428         }
32429     }
32430     function_tests++;
32431 #endif
32432
32433     return(test_ret);
32434 }
32435
32436
32437 static int
32438 test_xmlTextReaderReadState(void) {
32439     int test_ret = 0;
32440
32441 #if defined(LIBXML_READER_ENABLED)
32442     int mem_base;
32443     int ret_val;
32444     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32445     int n_reader;
32446
32447     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32448         mem_base = xmlMemBlocks();
32449         reader = gen_xmlTextReaderPtr(n_reader, 0);
32450
32451         ret_val = xmlTextReaderReadState(reader);
32452         desret_int(ret_val);
32453         call_tests++;
32454         des_xmlTextReaderPtr(n_reader, reader, 0);
32455         xmlResetLastError();
32456         if (mem_base != xmlMemBlocks()) {
32457             printf("Leak of %d blocks found in xmlTextReaderReadState",
32458                    xmlMemBlocks() - mem_base);
32459             test_ret++;
32460             printf(" %d", n_reader);
32461             printf("\n");
32462         }
32463     }
32464     function_tests++;
32465 #endif
32466
32467     return(test_ret);
32468 }
32469
32470
32471 static int
32472 test_xmlTextReaderRelaxNGSetSchema(void) {
32473     int test_ret = 0;
32474
32475 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32476     int mem_base;
32477     int ret_val;
32478     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32479     int n_reader;
32480     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32481     int n_schema;
32482
32483     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32484     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32485         mem_base = xmlMemBlocks();
32486         reader = gen_xmlTextReaderPtr(n_reader, 0);
32487         schema = gen_xmlRelaxNGPtr(n_schema, 1);
32488
32489         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32490         desret_int(ret_val);
32491         call_tests++;
32492         des_xmlTextReaderPtr(n_reader, reader, 0);
32493         des_xmlRelaxNGPtr(n_schema, schema, 1);
32494         xmlResetLastError();
32495         if (mem_base != xmlMemBlocks()) {
32496             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32497                    xmlMemBlocks() - mem_base);
32498             test_ret++;
32499             printf(" %d", n_reader);
32500             printf(" %d", n_schema);
32501             printf("\n");
32502         }
32503     }
32504     }
32505     function_tests++;
32506 #endif
32507
32508     return(test_ret);
32509 }
32510
32511
32512 static int
32513 test_xmlTextReaderRelaxNGValidate(void) {
32514     int test_ret = 0;
32515
32516 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32517     int mem_base;
32518     int ret_val;
32519     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32520     int n_reader;
32521     char * rng; /* the path to a RelaxNG schema or NULL */
32522     int n_rng;
32523
32524     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32525     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32526         mem_base = xmlMemBlocks();
32527         reader = gen_xmlTextReaderPtr(n_reader, 0);
32528         rng = gen_const_char_ptr(n_rng, 1);
32529
32530         ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32531         desret_int(ret_val);
32532         call_tests++;
32533         des_xmlTextReaderPtr(n_reader, reader, 0);
32534         des_const_char_ptr(n_rng, (const char *)rng, 1);
32535         xmlResetLastError();
32536         if (mem_base != xmlMemBlocks()) {
32537             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32538                    xmlMemBlocks() - mem_base);
32539             test_ret++;
32540             printf(" %d", n_reader);
32541             printf(" %d", n_rng);
32542             printf("\n");
32543         }
32544     }
32545     }
32546     function_tests++;
32547 #endif
32548
32549     return(test_ret);
32550 }
32551
32552
32553 static int
32554 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32555     int test_ret = 0;
32556
32557 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32558     int mem_base;
32559     int ret_val;
32560     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32561     int n_reader;
32562     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32563     int n_ctxt;
32564     int options; /* options (not used yet) */
32565     int n_options;
32566
32567     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32568     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32569     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32570         mem_base = xmlMemBlocks();
32571         reader = gen_xmlTextReaderPtr(n_reader, 0);
32572         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32573         options = gen_parseroptions(n_options, 2);
32574
32575         ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32576         desret_int(ret_val);
32577         call_tests++;
32578         des_xmlTextReaderPtr(n_reader, reader, 0);
32579         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32580         des_parseroptions(n_options, options, 2);
32581         xmlResetLastError();
32582         if (mem_base != xmlMemBlocks()) {
32583             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32584                    xmlMemBlocks() - mem_base);
32585             test_ret++;
32586             printf(" %d", n_reader);
32587             printf(" %d", n_ctxt);
32588             printf(" %d", n_options);
32589             printf("\n");
32590         }
32591     }
32592     }
32593     }
32594     function_tests++;
32595 #endif
32596
32597     return(test_ret);
32598 }
32599
32600
32601 static int
32602 test_xmlTextReaderSchemaValidate(void) {
32603     int test_ret = 0;
32604
32605 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32606     int ret_val;
32607     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32608     int n_reader;
32609     char * xsd; /* the path to a W3C XSD schema or NULL */
32610     int n_xsd;
32611
32612     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32613     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32614         reader = gen_xmlTextReaderPtr(n_reader, 0);
32615         xsd = gen_const_char_ptr(n_xsd, 1);
32616
32617         ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32618         desret_int(ret_val);
32619         call_tests++;
32620         des_xmlTextReaderPtr(n_reader, reader, 0);
32621         des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32622         xmlResetLastError();
32623     }
32624     }
32625     function_tests++;
32626 #endif
32627
32628     return(test_ret);
32629 }
32630
32631
32632 static int
32633 test_xmlTextReaderSchemaValidateCtxt(void) {
32634     int test_ret = 0;
32635
32636 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32637     int mem_base;
32638     int ret_val;
32639     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32640     int n_reader;
32641     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32642     int n_ctxt;
32643     int options; /* options (not used yet) */
32644     int n_options;
32645
32646     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32647     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32648     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32649         mem_base = xmlMemBlocks();
32650         reader = gen_xmlTextReaderPtr(n_reader, 0);
32651         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32652         options = gen_parseroptions(n_options, 2);
32653
32654         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32655         desret_int(ret_val);
32656         call_tests++;
32657         des_xmlTextReaderPtr(n_reader, reader, 0);
32658         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32659         des_parseroptions(n_options, options, 2);
32660         xmlResetLastError();
32661         if (mem_base != xmlMemBlocks()) {
32662             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32663                    xmlMemBlocks() - mem_base);
32664             test_ret++;
32665             printf(" %d", n_reader);
32666             printf(" %d", n_ctxt);
32667             printf(" %d", n_options);
32668             printf("\n");
32669         }
32670     }
32671     }
32672     }
32673     function_tests++;
32674 #endif
32675
32676     return(test_ret);
32677 }
32678
32679
32680 static int
32681 test_xmlTextReaderSetErrorHandler(void) {
32682     int test_ret = 0;
32683
32684
32685     /* missing type support */
32686     return(test_ret);
32687 }
32688
32689
32690 static int
32691 test_xmlTextReaderSetParserProp(void) {
32692     int test_ret = 0;
32693
32694 #if defined(LIBXML_READER_ENABLED)
32695     int mem_base;
32696     int ret_val;
32697     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32698     int n_reader;
32699     int prop; /* the xmlParserProperties to set */
32700     int n_prop;
32701     int value; /* usually 0 or 1 to (de)activate it */
32702     int n_value;
32703
32704     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32705     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32706     for (n_value = 0;n_value < gen_nb_int;n_value++) {
32707         mem_base = xmlMemBlocks();
32708         reader = gen_xmlTextReaderPtr(n_reader, 0);
32709         prop = gen_int(n_prop, 1);
32710         value = gen_int(n_value, 2);
32711
32712         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32713         desret_int(ret_val);
32714         call_tests++;
32715         des_xmlTextReaderPtr(n_reader, reader, 0);
32716         des_int(n_prop, prop, 1);
32717         des_int(n_value, value, 2);
32718         xmlResetLastError();
32719         if (mem_base != xmlMemBlocks()) {
32720             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32721                    xmlMemBlocks() - mem_base);
32722             test_ret++;
32723             printf(" %d", n_reader);
32724             printf(" %d", n_prop);
32725             printf(" %d", n_value);
32726             printf("\n");
32727         }
32728     }
32729     }
32730     }
32731     function_tests++;
32732 #endif
32733
32734     return(test_ret);
32735 }
32736
32737
32738 static int
32739 test_xmlTextReaderSetSchema(void) {
32740     int test_ret = 0;
32741
32742 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32743     int mem_base;
32744     int ret_val;
32745     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32746     int n_reader;
32747     xmlSchemaPtr schema; /* a precompiled Schema schema */
32748     int n_schema;
32749
32750     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32751     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32752         mem_base = xmlMemBlocks();
32753         reader = gen_xmlTextReaderPtr(n_reader, 0);
32754         schema = gen_xmlSchemaPtr(n_schema, 1);
32755
32756         ret_val = xmlTextReaderSetSchema(reader, schema);
32757         desret_int(ret_val);
32758         call_tests++;
32759         des_xmlTextReaderPtr(n_reader, reader, 0);
32760         des_xmlSchemaPtr(n_schema, schema, 1);
32761         xmlResetLastError();
32762         if (mem_base != xmlMemBlocks()) {
32763             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32764                    xmlMemBlocks() - mem_base);
32765             test_ret++;
32766             printf(" %d", n_reader);
32767             printf(" %d", n_schema);
32768             printf("\n");
32769         }
32770     }
32771     }
32772     function_tests++;
32773 #endif
32774
32775     return(test_ret);
32776 }
32777
32778
32779 static int
32780 test_xmlTextReaderSetStructuredErrorHandler(void) {
32781     int test_ret = 0;
32782
32783
32784     /* missing type support */
32785     return(test_ret);
32786 }
32787
32788
32789 static int
32790 test_xmlTextReaderSetup(void) {
32791     int test_ret = 0;
32792
32793 #if defined(LIBXML_READER_ENABLED)
32794     int mem_base;
32795     int ret_val;
32796     xmlTextReaderPtr reader; /* an XML reader */
32797     int n_reader;
32798     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32799     int n_input;
32800     const char * URL; /* the base URL to use for the document */
32801     int n_URL;
32802     char * encoding; /* the document encoding, or NULL */
32803     int n_encoding;
32804     int options; /* a combination of xmlParserOption */
32805     int n_options;
32806
32807     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32808     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32809     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32810     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32811     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32812         mem_base = xmlMemBlocks();
32813         reader = gen_xmlTextReaderPtr(n_reader, 0);
32814         input = gen_xmlParserInputBufferPtr(n_input, 1);
32815         URL = gen_filepath(n_URL, 2);
32816         encoding = gen_const_char_ptr(n_encoding, 3);
32817         options = gen_parseroptions(n_options, 4);
32818
32819         ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32820         desret_int(ret_val);
32821         call_tests++;
32822         des_xmlTextReaderPtr(n_reader, reader, 0);
32823         des_filepath(n_URL, URL, 2);
32824         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32825         des_parseroptions(n_options, options, 4);
32826         xmlResetLastError();
32827         if (mem_base != xmlMemBlocks()) {
32828             printf("Leak of %d blocks found in xmlTextReaderSetup",
32829                    xmlMemBlocks() - mem_base);
32830             test_ret++;
32831             printf(" %d", n_reader);
32832             printf(" %d", n_input);
32833             printf(" %d", n_URL);
32834             printf(" %d", n_encoding);
32835             printf(" %d", n_options);
32836             printf("\n");
32837         }
32838     }
32839     }
32840     }
32841     }
32842     }
32843     function_tests++;
32844 #endif
32845
32846     return(test_ret);
32847 }
32848
32849
32850 static int
32851 test_xmlTextReaderStandalone(void) {
32852     int test_ret = 0;
32853
32854 #if defined(LIBXML_READER_ENABLED)
32855     int mem_base;
32856     int ret_val;
32857     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32858     int n_reader;
32859
32860     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32861         mem_base = xmlMemBlocks();
32862         reader = gen_xmlTextReaderPtr(n_reader, 0);
32863
32864         ret_val = xmlTextReaderStandalone(reader);
32865         desret_int(ret_val);
32866         call_tests++;
32867         des_xmlTextReaderPtr(n_reader, reader, 0);
32868         xmlResetLastError();
32869         if (mem_base != xmlMemBlocks()) {
32870             printf("Leak of %d blocks found in xmlTextReaderStandalone",
32871                    xmlMemBlocks() - mem_base);
32872             test_ret++;
32873             printf(" %d", n_reader);
32874             printf("\n");
32875         }
32876     }
32877     function_tests++;
32878 #endif
32879
32880     return(test_ret);
32881 }
32882
32883
32884 static int
32885 test_xmlTextReaderValue(void) {
32886     int test_ret = 0;
32887
32888 #if defined(LIBXML_READER_ENABLED)
32889     int mem_base;
32890     xmlChar * ret_val;
32891     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32892     int n_reader;
32893
32894     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32895         mem_base = xmlMemBlocks();
32896         reader = gen_xmlTextReaderPtr(n_reader, 0);
32897
32898         ret_val = xmlTextReaderValue(reader);
32899         desret_xmlChar_ptr(ret_val);
32900         call_tests++;
32901         des_xmlTextReaderPtr(n_reader, reader, 0);
32902         xmlResetLastError();
32903         if (mem_base != xmlMemBlocks()) {
32904             printf("Leak of %d blocks found in xmlTextReaderValue",
32905                    xmlMemBlocks() - mem_base);
32906             test_ret++;
32907             printf(" %d", n_reader);
32908             printf("\n");
32909         }
32910     }
32911     function_tests++;
32912 #endif
32913
32914     return(test_ret);
32915 }
32916
32917
32918 static int
32919 test_xmlTextReaderXmlLang(void) {
32920     int test_ret = 0;
32921
32922 #if defined(LIBXML_READER_ENABLED)
32923     int mem_base;
32924     xmlChar * ret_val;
32925     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32926     int n_reader;
32927
32928     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32929         mem_base = xmlMemBlocks();
32930         reader = gen_xmlTextReaderPtr(n_reader, 0);
32931
32932         ret_val = xmlTextReaderXmlLang(reader);
32933         desret_xmlChar_ptr(ret_val);
32934         call_tests++;
32935         des_xmlTextReaderPtr(n_reader, reader, 0);
32936         xmlResetLastError();
32937         if (mem_base != xmlMemBlocks()) {
32938             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32939                    xmlMemBlocks() - mem_base);
32940             test_ret++;
32941             printf(" %d", n_reader);
32942             printf("\n");
32943         }
32944     }
32945     function_tests++;
32946 #endif
32947
32948     return(test_ret);
32949 }
32950
32951 static int
32952 test_xmlreader(void) {
32953     int test_ret = 0;
32954
32955     if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
32956     test_ret += test_xmlNewTextReader();
32957     test_ret += test_xmlNewTextReaderFilename();
32958     test_ret += test_xmlReaderForDoc();
32959     test_ret += test_xmlReaderForFile();
32960     test_ret += test_xmlReaderForMemory();
32961     test_ret += test_xmlReaderNewDoc();
32962     test_ret += test_xmlReaderNewFile();
32963     test_ret += test_xmlReaderNewMemory();
32964     test_ret += test_xmlReaderNewWalker();
32965     test_ret += test_xmlReaderWalker();
32966     test_ret += test_xmlTextReaderAttributeCount();
32967     test_ret += test_xmlTextReaderBaseUri();
32968     test_ret += test_xmlTextReaderByteConsumed();
32969     test_ret += test_xmlTextReaderClose();
32970     test_ret += test_xmlTextReaderConstBaseUri();
32971     test_ret += test_xmlTextReaderConstEncoding();
32972     test_ret += test_xmlTextReaderConstLocalName();
32973     test_ret += test_xmlTextReaderConstName();
32974     test_ret += test_xmlTextReaderConstNamespaceUri();
32975     test_ret += test_xmlTextReaderConstPrefix();
32976     test_ret += test_xmlTextReaderConstString();
32977     test_ret += test_xmlTextReaderConstValue();
32978     test_ret += test_xmlTextReaderConstXmlLang();
32979     test_ret += test_xmlTextReaderConstXmlVersion();
32980     test_ret += test_xmlTextReaderCurrentDoc();
32981     test_ret += test_xmlTextReaderCurrentNode();
32982     test_ret += test_xmlTextReaderDepth();
32983     test_ret += test_xmlTextReaderExpand();
32984     test_ret += test_xmlTextReaderGetAttribute();
32985     test_ret += test_xmlTextReaderGetAttributeNo();
32986     test_ret += test_xmlTextReaderGetAttributeNs();
32987     test_ret += test_xmlTextReaderGetErrorHandler();
32988     test_ret += test_xmlTextReaderGetParserColumnNumber();
32989     test_ret += test_xmlTextReaderGetParserLineNumber();
32990     test_ret += test_xmlTextReaderGetParserProp();
32991     test_ret += test_xmlTextReaderGetRemainder();
32992     test_ret += test_xmlTextReaderHasAttributes();
32993     test_ret += test_xmlTextReaderHasValue();
32994     test_ret += test_xmlTextReaderIsDefault();
32995     test_ret += test_xmlTextReaderIsEmptyElement();
32996     test_ret += test_xmlTextReaderIsNamespaceDecl();
32997     test_ret += test_xmlTextReaderIsValid();
32998     test_ret += test_xmlTextReaderLocalName();
32999     test_ret += test_xmlTextReaderLocatorBaseURI();
33000     test_ret += test_xmlTextReaderLocatorLineNumber();
33001     test_ret += test_xmlTextReaderLookupNamespace();
33002     test_ret += test_xmlTextReaderMoveToAttribute();
33003     test_ret += test_xmlTextReaderMoveToAttributeNo();
33004     test_ret += test_xmlTextReaderMoveToAttributeNs();
33005     test_ret += test_xmlTextReaderMoveToElement();
33006     test_ret += test_xmlTextReaderMoveToFirstAttribute();
33007     test_ret += test_xmlTextReaderMoveToNextAttribute();
33008     test_ret += test_xmlTextReaderName();
33009     test_ret += test_xmlTextReaderNamespaceUri();
33010     test_ret += test_xmlTextReaderNext();
33011     test_ret += test_xmlTextReaderNextSibling();
33012     test_ret += test_xmlTextReaderNodeType();
33013     test_ret += test_xmlTextReaderNormalization();
33014     test_ret += test_xmlTextReaderPrefix();
33015     test_ret += test_xmlTextReaderPreserve();
33016     test_ret += test_xmlTextReaderPreservePattern();
33017     test_ret += test_xmlTextReaderQuoteChar();
33018     test_ret += test_xmlTextReaderRead();
33019     test_ret += test_xmlTextReaderReadAttributeValue();
33020     test_ret += test_xmlTextReaderReadState();
33021     test_ret += test_xmlTextReaderRelaxNGSetSchema();
33022     test_ret += test_xmlTextReaderRelaxNGValidate();
33023     test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
33024     test_ret += test_xmlTextReaderSchemaValidate();
33025     test_ret += test_xmlTextReaderSchemaValidateCtxt();
33026     test_ret += test_xmlTextReaderSetErrorHandler();
33027     test_ret += test_xmlTextReaderSetParserProp();
33028     test_ret += test_xmlTextReaderSetSchema();
33029     test_ret += test_xmlTextReaderSetStructuredErrorHandler();
33030     test_ret += test_xmlTextReaderSetup();
33031     test_ret += test_xmlTextReaderStandalone();
33032     test_ret += test_xmlTextReaderValue();
33033     test_ret += test_xmlTextReaderXmlLang();
33034
33035     if (test_ret != 0)
33036         printf("Module xmlreader: %d errors\n", test_ret);
33037     return(test_ret);
33038 }
33039
33040 static int
33041 test_xmlExpCtxtNbCons(void) {
33042     int test_ret = 0;
33043
33044 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33045     int mem_base;
33046     int ret_val;
33047     xmlExpCtxtPtr ctxt; /* an expression context */
33048     int n_ctxt;
33049
33050     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33051         mem_base = xmlMemBlocks();
33052         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33053
33054         ret_val = xmlExpCtxtNbCons(ctxt);
33055         desret_int(ret_val);
33056         call_tests++;
33057         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33058         xmlResetLastError();
33059         if (mem_base != xmlMemBlocks()) {
33060             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
33061                    xmlMemBlocks() - mem_base);
33062             test_ret++;
33063             printf(" %d", n_ctxt);
33064             printf("\n");
33065         }
33066     }
33067     function_tests++;
33068 #endif
33069
33070     return(test_ret);
33071 }
33072
33073
33074 static int
33075 test_xmlExpCtxtNbNodes(void) {
33076     int test_ret = 0;
33077
33078 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33079     int mem_base;
33080     int ret_val;
33081     xmlExpCtxtPtr ctxt; /* an expression context */
33082     int n_ctxt;
33083
33084     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33085         mem_base = xmlMemBlocks();
33086         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33087
33088         ret_val = xmlExpCtxtNbNodes(ctxt);
33089         desret_int(ret_val);
33090         call_tests++;
33091         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33092         xmlResetLastError();
33093         if (mem_base != xmlMemBlocks()) {
33094             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
33095                    xmlMemBlocks() - mem_base);
33096             test_ret++;
33097             printf(" %d", n_ctxt);
33098             printf("\n");
33099         }
33100     }
33101     function_tests++;
33102 #endif
33103
33104     return(test_ret);
33105 }
33106
33107
33108 static int
33109 test_xmlExpDump(void) {
33110     int test_ret = 0;
33111
33112 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33113     int mem_base;
33114     xmlBufferPtr buf; /* a buffer to receive the output */
33115     int n_buf;
33116     xmlExpNodePtr expr; /* the compiled expression */
33117     int n_expr;
33118
33119     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
33120     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33121         mem_base = xmlMemBlocks();
33122         buf = gen_xmlBufferPtr(n_buf, 0);
33123         expr = gen_xmlExpNodePtr(n_expr, 1);
33124
33125         xmlExpDump(buf, expr);
33126         call_tests++;
33127         des_xmlBufferPtr(n_buf, buf, 0);
33128         des_xmlExpNodePtr(n_expr, expr, 1);
33129         xmlResetLastError();
33130         if (mem_base != xmlMemBlocks()) {
33131             printf("Leak of %d blocks found in xmlExpDump",
33132                    xmlMemBlocks() - mem_base);
33133             test_ret++;
33134             printf(" %d", n_buf);
33135             printf(" %d", n_expr);
33136             printf("\n");
33137         }
33138     }
33139     }
33140     function_tests++;
33141 #endif
33142
33143     return(test_ret);
33144 }
33145
33146
33147 static int
33148 test_xmlExpExpDerive(void) {
33149     int test_ret = 0;
33150
33151
33152     /* missing type support */
33153     return(test_ret);
33154 }
33155
33156
33157 static int
33158 test_xmlExpGetLanguage(void) {
33159     int test_ret = 0;
33160
33161 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33162     int mem_base;
33163     int ret_val;
33164     xmlExpCtxtPtr ctxt; /* the expression context */
33165     int n_ctxt;
33166     xmlExpNodePtr exp; /* the expression */
33167     int n_exp;
33168     xmlChar ** langList; /* where to store the tokens */
33169     int n_langList;
33170     int len; /* the allocated length of @list */
33171     int n_len;
33172
33173     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33174     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33175     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
33176     for (n_len = 0;n_len < gen_nb_int;n_len++) {
33177         mem_base = xmlMemBlocks();
33178         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33179         exp = gen_xmlExpNodePtr(n_exp, 1);
33180         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
33181         len = gen_int(n_len, 3);
33182
33183         ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
33184         desret_int(ret_val);
33185         call_tests++;
33186         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33187         des_xmlExpNodePtr(n_exp, exp, 1);
33188         des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
33189         des_int(n_len, len, 3);
33190         xmlResetLastError();
33191         if (mem_base != xmlMemBlocks()) {
33192             printf("Leak of %d blocks found in xmlExpGetLanguage",
33193                    xmlMemBlocks() - mem_base);
33194             test_ret++;
33195             printf(" %d", n_ctxt);
33196             printf(" %d", n_exp);
33197             printf(" %d", n_langList);
33198             printf(" %d", n_len);
33199             printf("\n");
33200         }
33201     }
33202     }
33203     }
33204     }
33205     function_tests++;
33206 #endif
33207
33208     return(test_ret);
33209 }
33210
33211
33212 static int
33213 test_xmlExpGetStart(void) {
33214     int test_ret = 0;
33215
33216 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33217     int mem_base;
33218     int ret_val;
33219     xmlExpCtxtPtr ctxt; /* the expression context */
33220     int n_ctxt;
33221     xmlExpNodePtr exp; /* the expression */
33222     int n_exp;
33223     xmlChar ** tokList; /* where to store the tokens */
33224     int n_tokList;
33225     int len; /* the allocated length of @list */
33226     int n_len;
33227
33228     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33229     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33230     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
33231     for (n_len = 0;n_len < gen_nb_int;n_len++) {
33232         mem_base = xmlMemBlocks();
33233         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33234         exp = gen_xmlExpNodePtr(n_exp, 1);
33235         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
33236         len = gen_int(n_len, 3);
33237
33238         ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
33239         desret_int(ret_val);
33240         call_tests++;
33241         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33242         des_xmlExpNodePtr(n_exp, exp, 1);
33243         des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
33244         des_int(n_len, len, 3);
33245         xmlResetLastError();
33246         if (mem_base != xmlMemBlocks()) {
33247             printf("Leak of %d blocks found in xmlExpGetStart",
33248                    xmlMemBlocks() - mem_base);
33249             test_ret++;
33250             printf(" %d", n_ctxt);
33251             printf(" %d", n_exp);
33252             printf(" %d", n_tokList);
33253             printf(" %d", n_len);
33254             printf("\n");
33255         }
33256     }
33257     }
33258     }
33259     }
33260     function_tests++;
33261 #endif
33262
33263     return(test_ret);
33264 }
33265
33266
33267 static int
33268 test_xmlExpIsNillable(void) {
33269     int test_ret = 0;
33270
33271 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33272     int mem_base;
33273     int ret_val;
33274     xmlExpNodePtr exp; /* the expression */
33275     int n_exp;
33276
33277     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33278         mem_base = xmlMemBlocks();
33279         exp = gen_xmlExpNodePtr(n_exp, 0);
33280
33281         ret_val = xmlExpIsNillable(exp);
33282         desret_int(ret_val);
33283         call_tests++;
33284         des_xmlExpNodePtr(n_exp, exp, 0);
33285         xmlResetLastError();
33286         if (mem_base != xmlMemBlocks()) {
33287             printf("Leak of %d blocks found in xmlExpIsNillable",
33288                    xmlMemBlocks() - mem_base);
33289             test_ret++;
33290             printf(" %d", n_exp);
33291             printf("\n");
33292         }
33293     }
33294     function_tests++;
33295 #endif
33296
33297     return(test_ret);
33298 }
33299
33300
33301 static int
33302 test_xmlExpMaxToken(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     xmlExpNodePtr expr; /* a compiled expression */
33309     int n_expr;
33310
33311     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33312         mem_base = xmlMemBlocks();
33313         expr = gen_xmlExpNodePtr(n_expr, 0);
33314
33315         ret_val = xmlExpMaxToken(expr);
33316         desret_int(ret_val);
33317         call_tests++;
33318         des_xmlExpNodePtr(n_expr, expr, 0);
33319         xmlResetLastError();
33320         if (mem_base != xmlMemBlocks()) {
33321             printf("Leak of %d blocks found in xmlExpMaxToken",
33322                    xmlMemBlocks() - mem_base);
33323             test_ret++;
33324             printf(" %d", n_expr);
33325             printf("\n");
33326         }
33327     }
33328     function_tests++;
33329 #endif
33330
33331     return(test_ret);
33332 }
33333
33334
33335 static int
33336 test_xmlExpNewAtom(void) {
33337     int test_ret = 0;
33338
33339
33340     /* missing type support */
33341     return(test_ret);
33342 }
33343
33344
33345 static int
33346 test_xmlExpNewCtxt(void) {
33347     int test_ret = 0;
33348
33349
33350     /* missing type support */
33351     return(test_ret);
33352 }
33353
33354
33355 static int
33356 test_xmlExpNewOr(void) {
33357     int test_ret = 0;
33358
33359
33360     /* missing type support */
33361     return(test_ret);
33362 }
33363
33364
33365 static int
33366 test_xmlExpNewRange(void) {
33367     int test_ret = 0;
33368
33369
33370     /* missing type support */
33371     return(test_ret);
33372 }
33373
33374
33375 static int
33376 test_xmlExpNewSeq(void) {
33377     int test_ret = 0;
33378
33379
33380     /* missing type support */
33381     return(test_ret);
33382 }
33383
33384
33385 static int
33386 test_xmlExpParse(void) {
33387     int test_ret = 0;
33388
33389
33390     /* missing type support */
33391     return(test_ret);
33392 }
33393
33394
33395 static int
33396 test_xmlExpRef(void) {
33397     int test_ret = 0;
33398
33399 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33400     int mem_base;
33401     xmlExpNodePtr exp; /* the expression */
33402     int n_exp;
33403
33404     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33405         mem_base = xmlMemBlocks();
33406         exp = gen_xmlExpNodePtr(n_exp, 0);
33407
33408         xmlExpRef(exp);
33409         call_tests++;
33410         des_xmlExpNodePtr(n_exp, exp, 0);
33411         xmlResetLastError();
33412         if (mem_base != xmlMemBlocks()) {
33413             printf("Leak of %d blocks found in xmlExpRef",
33414                    xmlMemBlocks() - mem_base);
33415             test_ret++;
33416             printf(" %d", n_exp);
33417             printf("\n");
33418         }
33419     }
33420     function_tests++;
33421 #endif
33422
33423     return(test_ret);
33424 }
33425
33426
33427 static int
33428 test_xmlExpStringDerive(void) {
33429     int test_ret = 0;
33430
33431
33432     /* missing type support */
33433     return(test_ret);
33434 }
33435
33436
33437 static int
33438 test_xmlExpSubsume(void) {
33439     int test_ret = 0;
33440
33441 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33442     int mem_base;
33443     int ret_val;
33444     xmlExpCtxtPtr ctxt; /* the expressions context */
33445     int n_ctxt;
33446     xmlExpNodePtr exp; /* the englobing expression */
33447     int n_exp;
33448     xmlExpNodePtr sub; /* the subexpression */
33449     int n_sub;
33450
33451     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33452     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33453     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33454         mem_base = xmlMemBlocks();
33455         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33456         exp = gen_xmlExpNodePtr(n_exp, 1);
33457         sub = gen_xmlExpNodePtr(n_sub, 2);
33458
33459         ret_val = xmlExpSubsume(ctxt, exp, sub);
33460         desret_int(ret_val);
33461         call_tests++;
33462         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33463         des_xmlExpNodePtr(n_exp, exp, 1);
33464         des_xmlExpNodePtr(n_sub, sub, 2);
33465         xmlResetLastError();
33466         if (mem_base != xmlMemBlocks()) {
33467             printf("Leak of %d blocks found in xmlExpSubsume",
33468                    xmlMemBlocks() - mem_base);
33469             test_ret++;
33470             printf(" %d", n_ctxt);
33471             printf(" %d", n_exp);
33472             printf(" %d", n_sub);
33473             printf("\n");
33474         }
33475     }
33476     }
33477     }
33478     function_tests++;
33479 #endif
33480
33481     return(test_ret);
33482 }
33483
33484 #ifdef LIBXML_REGEXP_ENABLED
33485
33486 #define gen_nb_xmlRegExecCtxtPtr 1
33487 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33488     return(NULL);
33489 }
33490 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33491 }
33492 #endif
33493
33494
33495 static int
33496 test_xmlRegExecErrInfo(void) {
33497     int test_ret = 0;
33498
33499 #if defined(LIBXML_REGEXP_ENABLED)
33500     int mem_base;
33501     int ret_val;
33502     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33503     int n_exec;
33504     xmlChar ** string; /* return value for the error string */
33505     int n_string;
33506     int * nbval; /* pointer to the number of accepted values IN/OUT */
33507     int n_nbval;
33508     int * nbneg; /* return number of negative transitions */
33509     int n_nbneg;
33510     xmlChar ** values; /* pointer to the array of acceptable values */
33511     int n_values;
33512     int * terminal; /* return value if this was a terminal state */
33513     int n_terminal;
33514
33515     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33516     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33517     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33518     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33519     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33520     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33521         mem_base = xmlMemBlocks();
33522         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33523         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33524         nbval = gen_int_ptr(n_nbval, 2);
33525         nbneg = gen_int_ptr(n_nbneg, 3);
33526         values = gen_xmlChar_ptr_ptr(n_values, 4);
33527         terminal = gen_int_ptr(n_terminal, 5);
33528
33529         ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33530         desret_int(ret_val);
33531         call_tests++;
33532         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33533         des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33534         des_int_ptr(n_nbval, nbval, 2);
33535         des_int_ptr(n_nbneg, nbneg, 3);
33536         des_xmlChar_ptr_ptr(n_values, values, 4);
33537         des_int_ptr(n_terminal, terminal, 5);
33538         xmlResetLastError();
33539         if (mem_base != xmlMemBlocks()) {
33540             printf("Leak of %d blocks found in xmlRegExecErrInfo",
33541                    xmlMemBlocks() - mem_base);
33542             test_ret++;
33543             printf(" %d", n_exec);
33544             printf(" %d", n_string);
33545             printf(" %d", n_nbval);
33546             printf(" %d", n_nbneg);
33547             printf(" %d", n_values);
33548             printf(" %d", n_terminal);
33549             printf("\n");
33550         }
33551     }
33552     }
33553     }
33554     }
33555     }
33556     }
33557     function_tests++;
33558 #endif
33559
33560     return(test_ret);
33561 }
33562
33563
33564 static int
33565 test_xmlRegExecNextValues(void) {
33566     int test_ret = 0;
33567
33568 #if defined(LIBXML_REGEXP_ENABLED)
33569     int mem_base;
33570     int ret_val;
33571     xmlRegExecCtxtPtr exec; /* a regexp execution context */
33572     int n_exec;
33573     int * nbval; /* pointer to the number of accepted values IN/OUT */
33574     int n_nbval;
33575     int * nbneg; /* return number of negative transitions */
33576     int n_nbneg;
33577     xmlChar ** values; /* pointer to the array of acceptable values */
33578     int n_values;
33579     int * terminal; /* return value if this was a terminal state */
33580     int n_terminal;
33581
33582     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33583     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33584     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33585     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33586     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33587         mem_base = xmlMemBlocks();
33588         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33589         nbval = gen_int_ptr(n_nbval, 1);
33590         nbneg = gen_int_ptr(n_nbneg, 2);
33591         values = gen_xmlChar_ptr_ptr(n_values, 3);
33592         terminal = gen_int_ptr(n_terminal, 4);
33593
33594         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33595         desret_int(ret_val);
33596         call_tests++;
33597         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33598         des_int_ptr(n_nbval, nbval, 1);
33599         des_int_ptr(n_nbneg, nbneg, 2);
33600         des_xmlChar_ptr_ptr(n_values, values, 3);
33601         des_int_ptr(n_terminal, terminal, 4);
33602         xmlResetLastError();
33603         if (mem_base != xmlMemBlocks()) {
33604             printf("Leak of %d blocks found in xmlRegExecNextValues",
33605                    xmlMemBlocks() - mem_base);
33606             test_ret++;
33607             printf(" %d", n_exec);
33608             printf(" %d", n_nbval);
33609             printf(" %d", n_nbneg);
33610             printf(" %d", n_values);
33611             printf(" %d", n_terminal);
33612             printf("\n");
33613         }
33614     }
33615     }
33616     }
33617     }
33618     }
33619     function_tests++;
33620 #endif
33621
33622     return(test_ret);
33623 }
33624
33625
33626 static int
33627 test_xmlRegExecPushString(void) {
33628     int test_ret = 0;
33629
33630 #if defined(LIBXML_REGEXP_ENABLED)
33631     int mem_base;
33632     int ret_val;
33633     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33634     int n_exec;
33635     xmlChar * value; /* a string token input */
33636     int n_value;
33637     void * data; /* data associated to the token to reuse in callbacks */
33638     int n_data;
33639
33640     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33641     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33642     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33643         mem_base = xmlMemBlocks();
33644         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33645         value = gen_const_xmlChar_ptr(n_value, 1);
33646         data = gen_userdata(n_data, 2);
33647
33648         ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33649         desret_int(ret_val);
33650         call_tests++;
33651         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33652         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33653         des_userdata(n_data, data, 2);
33654         xmlResetLastError();
33655         if (mem_base != xmlMemBlocks()) {
33656             printf("Leak of %d blocks found in xmlRegExecPushString",
33657                    xmlMemBlocks() - mem_base);
33658             test_ret++;
33659             printf(" %d", n_exec);
33660             printf(" %d", n_value);
33661             printf(" %d", n_data);
33662             printf("\n");
33663         }
33664     }
33665     }
33666     }
33667     function_tests++;
33668 #endif
33669
33670     return(test_ret);
33671 }
33672
33673
33674 static int
33675 test_xmlRegExecPushString2(void) {
33676     int test_ret = 0;
33677
33678 #if defined(LIBXML_REGEXP_ENABLED)
33679     int mem_base;
33680     int ret_val;
33681     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33682     int n_exec;
33683     xmlChar * value; /* the first string token input */
33684     int n_value;
33685     xmlChar * value2; /* the second string token input */
33686     int n_value2;
33687     void * data; /* data associated to the token to reuse in callbacks */
33688     int n_data;
33689
33690     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33691     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33692     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33693     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33694         mem_base = xmlMemBlocks();
33695         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33696         value = gen_const_xmlChar_ptr(n_value, 1);
33697         value2 = gen_const_xmlChar_ptr(n_value2, 2);
33698         data = gen_userdata(n_data, 3);
33699
33700         ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33701         desret_int(ret_val);
33702         call_tests++;
33703         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33704         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33705         des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33706         des_userdata(n_data, data, 3);
33707         xmlResetLastError();
33708         if (mem_base != xmlMemBlocks()) {
33709             printf("Leak of %d blocks found in xmlRegExecPushString2",
33710                    xmlMemBlocks() - mem_base);
33711             test_ret++;
33712             printf(" %d", n_exec);
33713             printf(" %d", n_value);
33714             printf(" %d", n_value2);
33715             printf(" %d", n_data);
33716             printf("\n");
33717         }
33718     }
33719     }
33720     }
33721     }
33722     function_tests++;
33723 #endif
33724
33725     return(test_ret);
33726 }
33727
33728 #ifdef LIBXML_REGEXP_ENABLED
33729
33730 #define gen_nb_xmlRegexpPtr 1
33731 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33732     return(NULL);
33733 }
33734 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33735 }
33736 #endif
33737
33738
33739 static int
33740 test_xmlRegNewExecCtxt(void) {
33741     int test_ret = 0;
33742
33743
33744     /* missing type support */
33745     return(test_ret);
33746 }
33747
33748
33749 static int
33750 test_xmlRegexpCompile(void) {
33751     int test_ret = 0;
33752
33753
33754     /* missing type support */
33755     return(test_ret);
33756 }
33757
33758
33759 static int
33760 test_xmlRegexpExec(void) {
33761     int test_ret = 0;
33762
33763 #if defined(LIBXML_REGEXP_ENABLED)
33764     int mem_base;
33765     int ret_val;
33766     xmlRegexpPtr comp; /* the compiled regular expression */
33767     int n_comp;
33768     xmlChar * content; /* the value to check against the regular expression */
33769     int n_content;
33770
33771     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33772     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33773         mem_base = xmlMemBlocks();
33774         comp = gen_xmlRegexpPtr(n_comp, 0);
33775         content = gen_const_xmlChar_ptr(n_content, 1);
33776
33777         ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33778         desret_int(ret_val);
33779         call_tests++;
33780         des_xmlRegexpPtr(n_comp, comp, 0);
33781         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33782         xmlResetLastError();
33783         if (mem_base != xmlMemBlocks()) {
33784             printf("Leak of %d blocks found in xmlRegexpExec",
33785                    xmlMemBlocks() - mem_base);
33786             test_ret++;
33787             printf(" %d", n_comp);
33788             printf(" %d", n_content);
33789             printf("\n");
33790         }
33791     }
33792     }
33793     function_tests++;
33794 #endif
33795
33796     return(test_ret);
33797 }
33798
33799
33800 static int
33801 test_xmlRegexpIsDeterminist(void) {
33802     int test_ret = 0;
33803
33804 #if defined(LIBXML_REGEXP_ENABLED)
33805     int mem_base;
33806     int ret_val;
33807     xmlRegexpPtr comp; /* the compiled regular expression */
33808     int n_comp;
33809
33810     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33811         mem_base = xmlMemBlocks();
33812         comp = gen_xmlRegexpPtr(n_comp, 0);
33813
33814         ret_val = xmlRegexpIsDeterminist(comp);
33815         desret_int(ret_val);
33816         call_tests++;
33817         des_xmlRegexpPtr(n_comp, comp, 0);
33818         xmlResetLastError();
33819         if (mem_base != xmlMemBlocks()) {
33820             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33821                    xmlMemBlocks() - mem_base);
33822             test_ret++;
33823             printf(" %d", n_comp);
33824             printf("\n");
33825         }
33826     }
33827     function_tests++;
33828 #endif
33829
33830     return(test_ret);
33831 }
33832
33833
33834 static int
33835 test_xmlRegexpPrint(void) {
33836     int test_ret = 0;
33837
33838 #if defined(LIBXML_REGEXP_ENABLED)
33839     int mem_base;
33840     FILE * output; /* the file for the output debug */
33841     int n_output;
33842     xmlRegexpPtr regexp; /* the compiled regexp */
33843     int n_regexp;
33844
33845     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33846     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33847         mem_base = xmlMemBlocks();
33848         output = gen_FILE_ptr(n_output, 0);
33849         regexp = gen_xmlRegexpPtr(n_regexp, 1);
33850
33851         xmlRegexpPrint(output, regexp);
33852         call_tests++;
33853         des_FILE_ptr(n_output, output, 0);
33854         des_xmlRegexpPtr(n_regexp, regexp, 1);
33855         xmlResetLastError();
33856         if (mem_base != xmlMemBlocks()) {
33857             printf("Leak of %d blocks found in xmlRegexpPrint",
33858                    xmlMemBlocks() - mem_base);
33859             test_ret++;
33860             printf(" %d", n_output);
33861             printf(" %d", n_regexp);
33862             printf("\n");
33863         }
33864     }
33865     }
33866     function_tests++;
33867 #endif
33868
33869     return(test_ret);
33870 }
33871
33872 static int
33873 test_xmlregexp(void) {
33874     int test_ret = 0;
33875
33876     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33877     test_ret += test_xmlExpCtxtNbCons();
33878     test_ret += test_xmlExpCtxtNbNodes();
33879     test_ret += test_xmlExpDump();
33880     test_ret += test_xmlExpExpDerive();
33881     test_ret += test_xmlExpGetLanguage();
33882     test_ret += test_xmlExpGetStart();
33883     test_ret += test_xmlExpIsNillable();
33884     test_ret += test_xmlExpMaxToken();
33885     test_ret += test_xmlExpNewAtom();
33886     test_ret += test_xmlExpNewCtxt();
33887     test_ret += test_xmlExpNewOr();
33888     test_ret += test_xmlExpNewRange();
33889     test_ret += test_xmlExpNewSeq();
33890     test_ret += test_xmlExpParse();
33891     test_ret += test_xmlExpRef();
33892     test_ret += test_xmlExpStringDerive();
33893     test_ret += test_xmlExpSubsume();
33894     test_ret += test_xmlRegExecErrInfo();
33895     test_ret += test_xmlRegExecNextValues();
33896     test_ret += test_xmlRegExecPushString();
33897     test_ret += test_xmlRegExecPushString2();
33898     test_ret += test_xmlRegNewExecCtxt();
33899     test_ret += test_xmlRegexpCompile();
33900     test_ret += test_xmlRegexpExec();
33901     test_ret += test_xmlRegexpIsDeterminist();
33902     test_ret += test_xmlRegexpPrint();
33903
33904     if (test_ret != 0)
33905         printf("Module xmlregexp: %d errors\n", test_ret);
33906     return(test_ret);
33907 }
33908 #ifdef LIBXML_OUTPUT_ENABLED
33909
33910 #define gen_nb_xmlSaveCtxtPtr 1
33911 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33912     return(NULL);
33913 }
33914 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33915 }
33916 #endif
33917
33918
33919 static int
33920 test_xmlSaveClose(void) {
33921     int test_ret = 0;
33922
33923 #if defined(LIBXML_OUTPUT_ENABLED)
33924     int mem_base;
33925     int ret_val;
33926     xmlSaveCtxtPtr ctxt; /* a document saving context */
33927     int n_ctxt;
33928
33929     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33930         mem_base = xmlMemBlocks();
33931         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33932
33933         ret_val = xmlSaveClose(ctxt);
33934         desret_int(ret_val);
33935         call_tests++;
33936         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33937         xmlResetLastError();
33938         if (mem_base != xmlMemBlocks()) {
33939             printf("Leak of %d blocks found in xmlSaveClose",
33940                    xmlMemBlocks() - mem_base);
33941             test_ret++;
33942             printf(" %d", n_ctxt);
33943             printf("\n");
33944         }
33945     }
33946     function_tests++;
33947 #endif
33948
33949     return(test_ret);
33950 }
33951
33952
33953 static int
33954 test_xmlSaveDoc(void) {
33955     int test_ret = 0;
33956
33957 #if defined(LIBXML_OUTPUT_ENABLED)
33958     int mem_base;
33959     long ret_val;
33960     xmlSaveCtxtPtr ctxt; /* a document saving context */
33961     int n_ctxt;
33962     xmlDocPtr doc; /* a document */
33963     int n_doc;
33964
33965     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33966     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33967         mem_base = xmlMemBlocks();
33968         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33969         doc = gen_xmlDocPtr(n_doc, 1);
33970
33971         ret_val = xmlSaveDoc(ctxt, doc);
33972         desret_long(ret_val);
33973         call_tests++;
33974         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33975         des_xmlDocPtr(n_doc, doc, 1);
33976         xmlResetLastError();
33977         if (mem_base != xmlMemBlocks()) {
33978             printf("Leak of %d blocks found in xmlSaveDoc",
33979                    xmlMemBlocks() - mem_base);
33980             test_ret++;
33981             printf(" %d", n_ctxt);
33982             printf(" %d", n_doc);
33983             printf("\n");
33984         }
33985     }
33986     }
33987     function_tests++;
33988 #endif
33989
33990     return(test_ret);
33991 }
33992
33993
33994 static int
33995 test_xmlSaveFlush(void) {
33996     int test_ret = 0;
33997
33998 #if defined(LIBXML_OUTPUT_ENABLED)
33999     int mem_base;
34000     int ret_val;
34001     xmlSaveCtxtPtr ctxt; /* a document saving context */
34002     int n_ctxt;
34003
34004     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34005         mem_base = xmlMemBlocks();
34006         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34007
34008         ret_val = xmlSaveFlush(ctxt);
34009         desret_int(ret_val);
34010         call_tests++;
34011         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34012         xmlResetLastError();
34013         if (mem_base != xmlMemBlocks()) {
34014             printf("Leak of %d blocks found in xmlSaveFlush",
34015                    xmlMemBlocks() - mem_base);
34016             test_ret++;
34017             printf(" %d", n_ctxt);
34018             printf("\n");
34019         }
34020     }
34021     function_tests++;
34022 #endif
34023
34024     return(test_ret);
34025 }
34026
34027
34028 static int
34029 test_xmlSaveSetAttrEscape(void) {
34030     int test_ret = 0;
34031
34032
34033     /* missing type support */
34034     return(test_ret);
34035 }
34036
34037
34038 static int
34039 test_xmlSaveSetEscape(void) {
34040     int test_ret = 0;
34041
34042
34043     /* missing type support */
34044     return(test_ret);
34045 }
34046
34047
34048 static int
34049 test_xmlSaveToBuffer(void) {
34050     int test_ret = 0;
34051
34052
34053     /* missing type support */
34054     return(test_ret);
34055 }
34056
34057
34058 static int
34059 test_xmlSaveToFd(void) {
34060     int test_ret = 0;
34061
34062
34063     /* missing type support */
34064     return(test_ret);
34065 }
34066
34067
34068 static int
34069 test_xmlSaveToFilename(void) {
34070     int test_ret = 0;
34071
34072
34073     /* missing type support */
34074     return(test_ret);
34075 }
34076
34077
34078 static int
34079 test_xmlSaveTree(void) {
34080     int test_ret = 0;
34081
34082 #if defined(LIBXML_OUTPUT_ENABLED)
34083     int mem_base;
34084     long ret_val;
34085     xmlSaveCtxtPtr ctxt; /* a document saving context */
34086     int n_ctxt;
34087     xmlNodePtr node; /* the top node of the subtree to save */
34088     int n_node;
34089
34090     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34091     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34092         mem_base = xmlMemBlocks();
34093         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34094         node = gen_xmlNodePtr(n_node, 1);
34095
34096         ret_val = xmlSaveTree(ctxt, node);
34097         desret_long(ret_val);
34098         call_tests++;
34099         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34100         des_xmlNodePtr(n_node, node, 1);
34101         xmlResetLastError();
34102         if (mem_base != xmlMemBlocks()) {
34103             printf("Leak of %d blocks found in xmlSaveTree",
34104                    xmlMemBlocks() - mem_base);
34105             test_ret++;
34106             printf(" %d", n_ctxt);
34107             printf(" %d", n_node);
34108             printf("\n");
34109         }
34110     }
34111     }
34112     function_tests++;
34113 #endif
34114
34115     return(test_ret);
34116 }
34117
34118 static int
34119 test_xmlsave(void) {
34120     int test_ret = 0;
34121
34122     if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
34123     test_ret += test_xmlSaveClose();
34124     test_ret += test_xmlSaveDoc();
34125     test_ret += test_xmlSaveFlush();
34126     test_ret += test_xmlSaveSetAttrEscape();
34127     test_ret += test_xmlSaveSetEscape();
34128     test_ret += test_xmlSaveToBuffer();
34129     test_ret += test_xmlSaveToFd();
34130     test_ret += test_xmlSaveToFilename();
34131     test_ret += test_xmlSaveTree();
34132
34133     if (test_ret != 0)
34134         printf("Module xmlsave: %d errors\n", test_ret);
34135     return(test_ret);
34136 }
34137
34138 static int
34139 test_xmlSchemaDump(void) {
34140     int test_ret = 0;
34141
34142 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
34143     int mem_base;
34144     FILE * output; /* the file output */
34145     int n_output;
34146     xmlSchemaPtr schema; /* a schema structure */
34147     int n_schema;
34148
34149     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34150     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
34151         mem_base = xmlMemBlocks();
34152         output = gen_FILE_ptr(n_output, 0);
34153         schema = gen_xmlSchemaPtr(n_schema, 1);
34154
34155         xmlSchemaDump(output, schema);
34156         call_tests++;
34157         des_FILE_ptr(n_output, output, 0);
34158         des_xmlSchemaPtr(n_schema, schema, 1);
34159         xmlResetLastError();
34160         if (mem_base != xmlMemBlocks()) {
34161             printf("Leak of %d blocks found in xmlSchemaDump",
34162                    xmlMemBlocks() - mem_base);
34163             test_ret++;
34164             printf(" %d", n_output);
34165             printf(" %d", n_schema);
34166             printf("\n");
34167         }
34168     }
34169     }
34170     function_tests++;
34171 #endif
34172
34173     return(test_ret);
34174 }
34175
34176 #ifdef LIBXML_SCHEMAS_ENABLED
34177
34178 #define gen_nb_xmlSchemaParserCtxtPtr 1
34179 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34180     return(NULL);
34181 }
34182 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34183 }
34184 #endif
34185
34186 #ifdef LIBXML_SCHEMAS_ENABLED
34187
34188 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
34189 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34190     return(NULL);
34191 }
34192 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34193 }
34194 #endif
34195
34196 #ifdef LIBXML_SCHEMAS_ENABLED
34197
34198 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
34199 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34200     return(NULL);
34201 }
34202 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34203 }
34204 #endif
34205
34206
34207 static int
34208 test_xmlSchemaGetParserErrors(void) {
34209     int test_ret = 0;
34210
34211 #if defined(LIBXML_SCHEMAS_ENABLED)
34212     int mem_base;
34213     int ret_val;
34214     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
34215     int n_ctxt;
34216     xmlSchemaValidityErrorFunc * err; /* the error callback result */
34217     int n_err;
34218     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
34219     int n_warn;
34220     void ** ctx; /* contextual data for the callbacks result */
34221     int n_ctx;
34222
34223     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34224     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34225     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34226     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34227         mem_base = xmlMemBlocks();
34228         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34229         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34230         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34231         ctx = gen_void_ptr_ptr(n_ctx, 3);
34232
34233         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34234         desret_int(ret_val);
34235         call_tests++;
34236         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34237         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34238         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34239         des_void_ptr_ptr(n_ctx, ctx, 3);
34240         xmlResetLastError();
34241         if (mem_base != xmlMemBlocks()) {
34242             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34243                    xmlMemBlocks() - mem_base);
34244             test_ret++;
34245             printf(" %d", n_ctxt);
34246             printf(" %d", n_err);
34247             printf(" %d", n_warn);
34248             printf(" %d", n_ctx);
34249             printf("\n");
34250         }
34251     }
34252     }
34253     }
34254     }
34255     function_tests++;
34256 #endif
34257
34258     return(test_ret);
34259 }
34260
34261
34262 static int
34263 test_xmlSchemaGetValidErrors(void) {
34264     int test_ret = 0;
34265
34266 #if defined(LIBXML_SCHEMAS_ENABLED)
34267     int mem_base;
34268     int ret_val;
34269     xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34270     int n_ctxt;
34271     xmlSchemaValidityErrorFunc * err; /* the error function result */
34272     int n_err;
34273     xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34274     int n_warn;
34275     void ** ctx; /* the functions context result */
34276     int n_ctx;
34277
34278     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34279     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34280     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34281     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34282         mem_base = xmlMemBlocks();
34283         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34284         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34285         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34286         ctx = gen_void_ptr_ptr(n_ctx, 3);
34287
34288         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34289         desret_int(ret_val);
34290         call_tests++;
34291         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34292         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34293         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34294         des_void_ptr_ptr(n_ctx, ctx, 3);
34295         xmlResetLastError();
34296         if (mem_base != xmlMemBlocks()) {
34297             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34298                    xmlMemBlocks() - mem_base);
34299             test_ret++;
34300             printf(" %d", n_ctxt);
34301             printf(" %d", n_err);
34302             printf(" %d", n_warn);
34303             printf(" %d", n_ctx);
34304             printf("\n");
34305         }
34306     }
34307     }
34308     }
34309     }
34310     function_tests++;
34311 #endif
34312
34313     return(test_ret);
34314 }
34315
34316
34317 static int
34318 test_xmlSchemaIsValid(void) {
34319     int test_ret = 0;
34320
34321 #if defined(LIBXML_SCHEMAS_ENABLED)
34322     int mem_base;
34323     int ret_val;
34324     xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34325     int n_ctxt;
34326
34327     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34328         mem_base = xmlMemBlocks();
34329         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34330
34331         ret_val = xmlSchemaIsValid(ctxt);
34332         desret_int(ret_val);
34333         call_tests++;
34334         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34335         xmlResetLastError();
34336         if (mem_base != xmlMemBlocks()) {
34337             printf("Leak of %d blocks found in xmlSchemaIsValid",
34338                    xmlMemBlocks() - mem_base);
34339             test_ret++;
34340             printf(" %d", n_ctxt);
34341             printf("\n");
34342         }
34343     }
34344     function_tests++;
34345 #endif
34346
34347     return(test_ret);
34348 }
34349
34350
34351 static int
34352 test_xmlSchemaNewDocParserCtxt(void) {
34353     int test_ret = 0;
34354
34355 #if defined(LIBXML_SCHEMAS_ENABLED)
34356     int mem_base;
34357     xmlSchemaParserCtxtPtr ret_val;
34358     xmlDocPtr doc; /* a preparsed document tree */
34359     int n_doc;
34360
34361     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34362         mem_base = xmlMemBlocks();
34363         doc = gen_xmlDocPtr(n_doc, 0);
34364
34365         ret_val = xmlSchemaNewDocParserCtxt(doc);
34366         desret_xmlSchemaParserCtxtPtr(ret_val);
34367         call_tests++;
34368         des_xmlDocPtr(n_doc, doc, 0);
34369         xmlResetLastError();
34370         if (mem_base != xmlMemBlocks()) {
34371             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34372                    xmlMemBlocks() - mem_base);
34373             test_ret++;
34374             printf(" %d", n_doc);
34375             printf("\n");
34376         }
34377     }
34378     function_tests++;
34379 #endif
34380
34381     return(test_ret);
34382 }
34383
34384
34385 static int
34386 test_xmlSchemaNewMemParserCtxt(void) {
34387     int test_ret = 0;
34388
34389 #if defined(LIBXML_SCHEMAS_ENABLED)
34390     int mem_base;
34391     xmlSchemaParserCtxtPtr ret_val;
34392     char * buffer; /* a pointer to a char array containing the schemas */
34393     int n_buffer;
34394     int size; /* the size of the array */
34395     int n_size;
34396
34397     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34398     for (n_size = 0;n_size < gen_nb_int;n_size++) {
34399         mem_base = xmlMemBlocks();
34400         buffer = gen_const_char_ptr(n_buffer, 0);
34401         size = gen_int(n_size, 1);
34402
34403         ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34404         desret_xmlSchemaParserCtxtPtr(ret_val);
34405         call_tests++;
34406         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34407         des_int(n_size, size, 1);
34408         xmlResetLastError();
34409         if (mem_base != xmlMemBlocks()) {
34410             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34411                    xmlMemBlocks() - mem_base);
34412             test_ret++;
34413             printf(" %d", n_buffer);
34414             printf(" %d", n_size);
34415             printf("\n");
34416         }
34417     }
34418     }
34419     function_tests++;
34420 #endif
34421
34422     return(test_ret);
34423 }
34424
34425
34426 static int
34427 test_xmlSchemaNewParserCtxt(void) {
34428     int test_ret = 0;
34429
34430 #if defined(LIBXML_SCHEMAS_ENABLED)
34431     int mem_base;
34432     xmlSchemaParserCtxtPtr ret_val;
34433     char * URL; /* the location of the schema */
34434     int n_URL;
34435
34436     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34437         mem_base = xmlMemBlocks();
34438         URL = gen_const_char_ptr(n_URL, 0);
34439
34440         ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34441         desret_xmlSchemaParserCtxtPtr(ret_val);
34442         call_tests++;
34443         des_const_char_ptr(n_URL, (const char *)URL, 0);
34444         xmlResetLastError();
34445         if (mem_base != xmlMemBlocks()) {
34446             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34447                    xmlMemBlocks() - mem_base);
34448             test_ret++;
34449             printf(" %d", n_URL);
34450             printf("\n");
34451         }
34452     }
34453     function_tests++;
34454 #endif
34455
34456     return(test_ret);
34457 }
34458
34459
34460 static int
34461 test_xmlSchemaNewValidCtxt(void) {
34462     int test_ret = 0;
34463
34464
34465     /* missing type support */
34466     return(test_ret);
34467 }
34468
34469
34470 static int
34471 test_xmlSchemaParse(void) {
34472     int test_ret = 0;
34473
34474
34475     /* missing type support */
34476     return(test_ret);
34477 }
34478
34479 #ifdef LIBXML_SCHEMAS_ENABLED
34480
34481 #define gen_nb_xmlSAXHandlerPtr_ptr 1
34482 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34483     return(NULL);
34484 }
34485 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34486 }
34487 #endif
34488
34489
34490 static int
34491 test_xmlSchemaSAXPlug(void) {
34492     int test_ret = 0;
34493
34494
34495     /* missing type support */
34496     return(test_ret);
34497 }
34498
34499 #ifdef LIBXML_SCHEMAS_ENABLED
34500
34501 #define gen_nb_xmlSchemaSAXPlugPtr 1
34502 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34503     return(NULL);
34504 }
34505 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34506 }
34507 #endif
34508
34509
34510 static int
34511 test_xmlSchemaSAXUnplug(void) {
34512     int test_ret = 0;
34513
34514 #if defined(LIBXML_SCHEMAS_ENABLED)
34515     int mem_base;
34516     int ret_val;
34517     xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34518     int n_plug;
34519
34520     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34521         mem_base = xmlMemBlocks();
34522         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34523
34524         ret_val = xmlSchemaSAXUnplug(plug);
34525         desret_int(ret_val);
34526         call_tests++;
34527         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34528         xmlResetLastError();
34529         if (mem_base != xmlMemBlocks()) {
34530             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34531                    xmlMemBlocks() - mem_base);
34532             test_ret++;
34533             printf(" %d", n_plug);
34534             printf("\n");
34535         }
34536     }
34537     function_tests++;
34538 #endif
34539
34540     return(test_ret);
34541 }
34542
34543
34544 static int
34545 test_xmlSchemaSetParserErrors(void) {
34546     int test_ret = 0;
34547
34548
34549     /* missing type support */
34550     return(test_ret);
34551 }
34552
34553
34554 static int
34555 test_xmlSchemaSetParserStructuredErrors(void) {
34556     int test_ret = 0;
34557
34558
34559     /* missing type support */
34560     return(test_ret);
34561 }
34562
34563
34564 static int
34565 test_xmlSchemaSetValidErrors(void) {
34566     int test_ret = 0;
34567
34568
34569     /* missing type support */
34570     return(test_ret);
34571 }
34572
34573
34574 static int
34575 test_xmlSchemaSetValidOptions(void) {
34576     int test_ret = 0;
34577
34578 #if defined(LIBXML_SCHEMAS_ENABLED)
34579     int mem_base;
34580     int ret_val;
34581     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34582     int n_ctxt;
34583     int options; /* a combination of xmlSchemaValidOption */
34584     int n_options;
34585
34586     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34587     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34588         mem_base = xmlMemBlocks();
34589         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34590         options = gen_int(n_options, 1);
34591
34592         ret_val = xmlSchemaSetValidOptions(ctxt, options);
34593         desret_int(ret_val);
34594         call_tests++;
34595         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34596         des_int(n_options, options, 1);
34597         xmlResetLastError();
34598         if (mem_base != xmlMemBlocks()) {
34599             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34600                    xmlMemBlocks() - mem_base);
34601             test_ret++;
34602             printf(" %d", n_ctxt);
34603             printf(" %d", n_options);
34604             printf("\n");
34605         }
34606     }
34607     }
34608     function_tests++;
34609 #endif
34610
34611     return(test_ret);
34612 }
34613
34614
34615 static int
34616 test_xmlSchemaSetValidStructuredErrors(void) {
34617     int test_ret = 0;
34618
34619
34620     /* missing type support */
34621     return(test_ret);
34622 }
34623
34624
34625 static int
34626 test_xmlSchemaValidCtxtGetOptions(void) {
34627     int test_ret = 0;
34628
34629 #if defined(LIBXML_SCHEMAS_ENABLED)
34630     int mem_base;
34631     int ret_val;
34632     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34633     int n_ctxt;
34634
34635     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34636         mem_base = xmlMemBlocks();
34637         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34638
34639         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34640         desret_int(ret_val);
34641         call_tests++;
34642         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34643         xmlResetLastError();
34644         if (mem_base != xmlMemBlocks()) {
34645             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34646                    xmlMemBlocks() - mem_base);
34647             test_ret++;
34648             printf(" %d", n_ctxt);
34649             printf("\n");
34650         }
34651     }
34652     function_tests++;
34653 #endif
34654
34655     return(test_ret);
34656 }
34657
34658
34659 static int
34660 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34661     int test_ret = 0;
34662
34663 #if defined(LIBXML_SCHEMAS_ENABLED)
34664     int mem_base;
34665     xmlParserCtxtPtr ret_val;
34666     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34667     int n_ctxt;
34668
34669     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34670         mem_base = xmlMemBlocks();
34671         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34672
34673         ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34674         desret_xmlParserCtxtPtr(ret_val);
34675         call_tests++;
34676         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34677         xmlResetLastError();
34678         if (mem_base != xmlMemBlocks()) {
34679             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34680                    xmlMemBlocks() - mem_base);
34681             test_ret++;
34682             printf(" %d", n_ctxt);
34683             printf("\n");
34684         }
34685     }
34686     function_tests++;
34687 #endif
34688
34689     return(test_ret);
34690 }
34691
34692
34693 static int
34694 test_xmlSchemaValidateDoc(void) {
34695     int test_ret = 0;
34696
34697 #if defined(LIBXML_SCHEMAS_ENABLED)
34698     int mem_base;
34699     int ret_val;
34700     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34701     int n_ctxt;
34702     xmlDocPtr doc; /* a parsed document tree */
34703     int n_doc;
34704
34705     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34706     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34707         mem_base = xmlMemBlocks();
34708         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34709         doc = gen_xmlDocPtr(n_doc, 1);
34710
34711         ret_val = xmlSchemaValidateDoc(ctxt, doc);
34712         desret_int(ret_val);
34713         call_tests++;
34714         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34715         des_xmlDocPtr(n_doc, doc, 1);
34716         xmlResetLastError();
34717         if (mem_base != xmlMemBlocks()) {
34718             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34719                    xmlMemBlocks() - mem_base);
34720             test_ret++;
34721             printf(" %d", n_ctxt);
34722             printf(" %d", n_doc);
34723             printf("\n");
34724         }
34725     }
34726     }
34727     function_tests++;
34728 #endif
34729
34730     return(test_ret);
34731 }
34732
34733
34734 static int
34735 test_xmlSchemaValidateFile(void) {
34736     int test_ret = 0;
34737
34738 #if defined(LIBXML_SCHEMAS_ENABLED)
34739     int mem_base;
34740     int ret_val;
34741     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34742     int n_ctxt;
34743     const char * filename; /* the URI of the instance */
34744     int n_filename;
34745     int options; /* a future set of options, currently unused */
34746     int n_options;
34747
34748     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34749     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34750     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34751         mem_base = xmlMemBlocks();
34752         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34753         filename = gen_filepath(n_filename, 1);
34754         options = gen_int(n_options, 2);
34755
34756         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34757         desret_int(ret_val);
34758         call_tests++;
34759         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34760         des_filepath(n_filename, filename, 1);
34761         des_int(n_options, options, 2);
34762         xmlResetLastError();
34763         if (mem_base != xmlMemBlocks()) {
34764             printf("Leak of %d blocks found in xmlSchemaValidateFile",
34765                    xmlMemBlocks() - mem_base);
34766             test_ret++;
34767             printf(" %d", n_ctxt);
34768             printf(" %d", n_filename);
34769             printf(" %d", n_options);
34770             printf("\n");
34771         }
34772     }
34773     }
34774     }
34775     function_tests++;
34776 #endif
34777
34778     return(test_ret);
34779 }
34780
34781
34782 static int
34783 test_xmlSchemaValidateOneElement(void) {
34784     int test_ret = 0;
34785
34786 #if defined(LIBXML_SCHEMAS_ENABLED)
34787     int mem_base;
34788     int ret_val;
34789     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34790     int n_ctxt;
34791     xmlNodePtr elem; /* an element node */
34792     int n_elem;
34793
34794     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34795     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34796         mem_base = xmlMemBlocks();
34797         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34798         elem = gen_xmlNodePtr(n_elem, 1);
34799
34800         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34801         desret_int(ret_val);
34802         call_tests++;
34803         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34804         des_xmlNodePtr(n_elem, elem, 1);
34805         xmlResetLastError();
34806         if (mem_base != xmlMemBlocks()) {
34807             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34808                    xmlMemBlocks() - mem_base);
34809             test_ret++;
34810             printf(" %d", n_ctxt);
34811             printf(" %d", n_elem);
34812             printf("\n");
34813         }
34814     }
34815     }
34816     function_tests++;
34817 #endif
34818
34819     return(test_ret);
34820 }
34821
34822
34823 static int
34824 test_xmlSchemaValidateSetFilename(void) {
34825     int test_ret = 0;
34826
34827 #if defined(LIBXML_SCHEMAS_ENABLED)
34828     int mem_base;
34829     xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
34830     int n_vctxt;
34831     const char * filename; /* the file name */
34832     int n_filename;
34833
34834     for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
34835     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34836         mem_base = xmlMemBlocks();
34837         vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
34838         filename = gen_filepath(n_filename, 1);
34839
34840         xmlSchemaValidateSetFilename(vctxt, filename);
34841         call_tests++;
34842         des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
34843         des_filepath(n_filename, filename, 1);
34844         xmlResetLastError();
34845         if (mem_base != xmlMemBlocks()) {
34846             printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
34847                    xmlMemBlocks() - mem_base);
34848             test_ret++;
34849             printf(" %d", n_vctxt);
34850             printf(" %d", n_filename);
34851             printf("\n");
34852         }
34853     }
34854     }
34855     function_tests++;
34856 #endif
34857
34858     return(test_ret);
34859 }
34860
34861
34862 static int
34863 test_xmlSchemaValidateSetLocator(void) {
34864     int test_ret = 0;
34865
34866
34867     /* missing type support */
34868     return(test_ret);
34869 }
34870
34871
34872 static int
34873 test_xmlSchemaValidateStream(void) {
34874     int test_ret = 0;
34875
34876 #if defined(LIBXML_SCHEMAS_ENABLED)
34877     int mem_base;
34878     int ret_val;
34879     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34880     int n_ctxt;
34881     xmlParserInputBufferPtr input; /* the input to use for reading the data */
34882     int n_input;
34883     xmlCharEncoding enc; /* an optional encoding information */
34884     int n_enc;
34885     xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34886     int n_sax;
34887     void * user_data; /* the context to provide to the SAX handler. */
34888     int n_user_data;
34889
34890     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34891     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34892     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34893     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34894     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34895         mem_base = xmlMemBlocks();
34896         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34897         input = gen_xmlParserInputBufferPtr(n_input, 1);
34898         enc = gen_xmlCharEncoding(n_enc, 2);
34899         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34900         user_data = gen_userdata(n_user_data, 4);
34901
34902         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34903         desret_int(ret_val);
34904         call_tests++;
34905         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34906         des_xmlParserInputBufferPtr(n_input, input, 1);
34907         des_xmlCharEncoding(n_enc, enc, 2);
34908         des_xmlSAXHandlerPtr(n_sax, sax, 3);
34909         des_userdata(n_user_data, user_data, 4);
34910         xmlResetLastError();
34911         if (mem_base != xmlMemBlocks()) {
34912             printf("Leak of %d blocks found in xmlSchemaValidateStream",
34913                    xmlMemBlocks() - mem_base);
34914             test_ret++;
34915             printf(" %d", n_ctxt);
34916             printf(" %d", n_input);
34917             printf(" %d", n_enc);
34918             printf(" %d", n_sax);
34919             printf(" %d", n_user_data);
34920             printf("\n");
34921         }
34922     }
34923     }
34924     }
34925     }
34926     }
34927     function_tests++;
34928 #endif
34929
34930     return(test_ret);
34931 }
34932
34933 static int
34934 test_xmlschemas(void) {
34935     int test_ret = 0;
34936
34937     if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
34938     test_ret += test_xmlSchemaDump();
34939     test_ret += test_xmlSchemaGetParserErrors();
34940     test_ret += test_xmlSchemaGetValidErrors();
34941     test_ret += test_xmlSchemaIsValid();
34942     test_ret += test_xmlSchemaNewDocParserCtxt();
34943     test_ret += test_xmlSchemaNewMemParserCtxt();
34944     test_ret += test_xmlSchemaNewParserCtxt();
34945     test_ret += test_xmlSchemaNewValidCtxt();
34946     test_ret += test_xmlSchemaParse();
34947     test_ret += test_xmlSchemaSAXPlug();
34948     test_ret += test_xmlSchemaSAXUnplug();
34949     test_ret += test_xmlSchemaSetParserErrors();
34950     test_ret += test_xmlSchemaSetParserStructuredErrors();
34951     test_ret += test_xmlSchemaSetValidErrors();
34952     test_ret += test_xmlSchemaSetValidOptions();
34953     test_ret += test_xmlSchemaSetValidStructuredErrors();
34954     test_ret += test_xmlSchemaValidCtxtGetOptions();
34955     test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34956     test_ret += test_xmlSchemaValidateDoc();
34957     test_ret += test_xmlSchemaValidateFile();
34958     test_ret += test_xmlSchemaValidateOneElement();
34959     test_ret += test_xmlSchemaValidateSetFilename();
34960     test_ret += test_xmlSchemaValidateSetLocator();
34961     test_ret += test_xmlSchemaValidateStream();
34962
34963     if (test_ret != 0)
34964         printf("Module xmlschemas: %d errors\n", test_ret);
34965     return(test_ret);
34966 }
34967 #ifdef LIBXML_SCHEMAS_ENABLED
34968
34969 #define gen_nb_xmlSchemaFacetPtr 1
34970 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34971     return(NULL);
34972 }
34973 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34974 }
34975 #endif
34976
34977 #ifdef LIBXML_SCHEMAS_ENABLED
34978
34979 #define gen_nb_xmlSchemaTypePtr 1
34980 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34981     return(NULL);
34982 }
34983 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34984 }
34985 #endif
34986
34987
34988 static int
34989 test_xmlSchemaCheckFacet(void) {
34990     int test_ret = 0;
34991
34992 #if defined(LIBXML_SCHEMAS_ENABLED)
34993     int mem_base;
34994     int ret_val;
34995     xmlSchemaFacetPtr facet; /* the facet */
34996     int n_facet;
34997     xmlSchemaTypePtr typeDecl; /* the schema type definition */
34998     int n_typeDecl;
34999     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
35000     int n_pctxt;
35001     xmlChar * name; /* the optional name of the type */
35002     int n_name;
35003
35004     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35005     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
35006     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
35007     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35008         mem_base = xmlMemBlocks();
35009         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35010         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
35011         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
35012         name = gen_const_xmlChar_ptr(n_name, 3);
35013
35014         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
35015         desret_int(ret_val);
35016         call_tests++;
35017         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35018         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
35019         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
35020         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
35021         xmlResetLastError();
35022         if (mem_base != xmlMemBlocks()) {
35023             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
35024                    xmlMemBlocks() - mem_base);
35025             test_ret++;
35026             printf(" %d", n_facet);
35027             printf(" %d", n_typeDecl);
35028             printf(" %d", n_pctxt);
35029             printf(" %d", n_name);
35030             printf("\n");
35031         }
35032     }
35033     }
35034     }
35035     }
35036     function_tests++;
35037 #endif
35038
35039     return(test_ret);
35040 }
35041
35042
35043 static int
35044 test_xmlSchemaCleanupTypes(void) {
35045     int test_ret = 0;
35046
35047 #if defined(LIBXML_SCHEMAS_ENABLED)
35048
35049
35050         xmlSchemaCleanupTypes();
35051         call_tests++;
35052         xmlResetLastError();
35053     function_tests++;
35054 #endif
35055
35056     return(test_ret);
35057 }
35058
35059
35060 static int
35061 test_xmlSchemaCollapseString(void) {
35062     int test_ret = 0;
35063
35064 #if defined(LIBXML_SCHEMAS_ENABLED)
35065     int mem_base;
35066     xmlChar * ret_val;
35067     xmlChar * value; /* a value */
35068     int n_value;
35069
35070     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35071         mem_base = xmlMemBlocks();
35072         value = gen_const_xmlChar_ptr(n_value, 0);
35073
35074         ret_val = xmlSchemaCollapseString((const xmlChar *)value);
35075         desret_xmlChar_ptr(ret_val);
35076         call_tests++;
35077         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35078         xmlResetLastError();
35079         if (mem_base != xmlMemBlocks()) {
35080             printf("Leak of %d blocks found in xmlSchemaCollapseString",
35081                    xmlMemBlocks() - mem_base);
35082             test_ret++;
35083             printf(" %d", n_value);
35084             printf("\n");
35085         }
35086     }
35087     function_tests++;
35088 #endif
35089
35090     return(test_ret);
35091 }
35092
35093 #ifdef LIBXML_SCHEMAS_ENABLED
35094
35095 #define gen_nb_xmlSchemaValPtr 1
35096 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35097     return(NULL);
35098 }
35099 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35100 }
35101 #endif
35102
35103
35104 static int
35105 test_xmlSchemaCompareValues(void) {
35106     int test_ret = 0;
35107
35108 #if defined(LIBXML_SCHEMAS_ENABLED)
35109     int mem_base;
35110     int ret_val;
35111     xmlSchemaValPtr x; /* a first value */
35112     int n_x;
35113     xmlSchemaValPtr y; /* a second value */
35114     int n_y;
35115
35116     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35117     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35118         mem_base = xmlMemBlocks();
35119         x = gen_xmlSchemaValPtr(n_x, 0);
35120         y = gen_xmlSchemaValPtr(n_y, 1);
35121
35122         ret_val = xmlSchemaCompareValues(x, y);
35123         desret_int(ret_val);
35124         call_tests++;
35125         des_xmlSchemaValPtr(n_x, x, 0);
35126         des_xmlSchemaValPtr(n_y, y, 1);
35127         xmlResetLastError();
35128         if (mem_base != xmlMemBlocks()) {
35129             printf("Leak of %d blocks found in xmlSchemaCompareValues",
35130                    xmlMemBlocks() - mem_base);
35131             test_ret++;
35132             printf(" %d", n_x);
35133             printf(" %d", n_y);
35134             printf("\n");
35135         }
35136     }
35137     }
35138     function_tests++;
35139 #endif
35140
35141     return(test_ret);
35142 }
35143
35144
35145 static int
35146 test_xmlSchemaCompareValuesWhtsp(void) {
35147     int test_ret = 0;
35148
35149 #if defined(LIBXML_SCHEMAS_ENABLED)
35150     int mem_base;
35151     int ret_val;
35152     xmlSchemaValPtr x; /* a first value */
35153     int n_x;
35154     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
35155     int n_xws;
35156     xmlSchemaValPtr y; /* a second value */
35157     int n_y;
35158     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
35159     int n_yws;
35160
35161     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
35162     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
35163     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
35164     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
35165         mem_base = xmlMemBlocks();
35166         x = gen_xmlSchemaValPtr(n_x, 0);
35167         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
35168         y = gen_xmlSchemaValPtr(n_y, 2);
35169         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
35170
35171         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
35172         desret_int(ret_val);
35173         call_tests++;
35174         des_xmlSchemaValPtr(n_x, x, 0);
35175         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
35176         des_xmlSchemaValPtr(n_y, y, 2);
35177         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
35178         xmlResetLastError();
35179         if (mem_base != xmlMemBlocks()) {
35180             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
35181                    xmlMemBlocks() - mem_base);
35182             test_ret++;
35183             printf(" %d", n_x);
35184             printf(" %d", n_xws);
35185             printf(" %d", n_y);
35186             printf(" %d", n_yws);
35187             printf("\n");
35188         }
35189     }
35190     }
35191     }
35192     }
35193     function_tests++;
35194 #endif
35195
35196     return(test_ret);
35197 }
35198
35199
35200 static int
35201 test_xmlSchemaCopyValue(void) {
35202     int test_ret = 0;
35203
35204
35205     /* missing type support */
35206     return(test_ret);
35207 }
35208
35209
35210 static int
35211 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
35212     int test_ret = 0;
35213
35214 #if defined(LIBXML_SCHEMAS_ENABLED)
35215     int mem_base;
35216     xmlSchemaTypePtr ret_val;
35217     xmlSchemaTypePtr type; /* the built-in simple type. */
35218     int n_type;
35219
35220     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35221         mem_base = xmlMemBlocks();
35222         type = gen_xmlSchemaTypePtr(n_type, 0);
35223
35224         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
35225         desret_xmlSchemaTypePtr(ret_val);
35226         call_tests++;
35227         des_xmlSchemaTypePtr(n_type, type, 0);
35228         xmlResetLastError();
35229         if (mem_base != xmlMemBlocks()) {
35230             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
35231                    xmlMemBlocks() - mem_base);
35232             test_ret++;
35233             printf(" %d", n_type);
35234             printf("\n");
35235         }
35236     }
35237     function_tests++;
35238 #endif
35239
35240     return(test_ret);
35241 }
35242
35243
35244 static int
35245 test_xmlSchemaGetBuiltInType(void) {
35246     int test_ret = 0;
35247
35248 #if defined(LIBXML_SCHEMAS_ENABLED)
35249     xmlSchemaTypePtr ret_val;
35250     xmlSchemaValType type; /* the type of the built in type */
35251     int n_type;
35252
35253     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
35254         type = gen_xmlSchemaValType(n_type, 0);
35255
35256         ret_val = xmlSchemaGetBuiltInType(type);
35257         desret_xmlSchemaTypePtr(ret_val);
35258         call_tests++;
35259         des_xmlSchemaValType(n_type, type, 0);
35260         xmlResetLastError();
35261     }
35262     function_tests++;
35263 #endif
35264
35265     return(test_ret);
35266 }
35267
35268
35269 static int
35270 test_xmlSchemaGetCanonValue(void) {
35271     int test_ret = 0;
35272
35273 #if defined(LIBXML_SCHEMAS_ENABLED)
35274     int mem_base;
35275     int ret_val;
35276     xmlSchemaValPtr val; /* the precomputed value */
35277     int n_val;
35278     xmlChar ** retValue; /* the returned value */
35279     int n_retValue;
35280
35281     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35282     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35283         mem_base = xmlMemBlocks();
35284         val = gen_xmlSchemaValPtr(n_val, 0);
35285         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35286
35287         ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
35288         desret_int(ret_val);
35289         call_tests++;
35290         des_xmlSchemaValPtr(n_val, val, 0);
35291         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35292         xmlResetLastError();
35293         if (mem_base != xmlMemBlocks()) {
35294             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35295                    xmlMemBlocks() - mem_base);
35296             test_ret++;
35297             printf(" %d", n_val);
35298             printf(" %d", n_retValue);
35299             printf("\n");
35300         }
35301     }
35302     }
35303     function_tests++;
35304 #endif
35305
35306     return(test_ret);
35307 }
35308
35309
35310 static int
35311 test_xmlSchemaGetCanonValueWhtsp(void) {
35312     int test_ret = 0;
35313
35314 #if defined(LIBXML_SCHEMAS_ENABLED)
35315     int mem_base;
35316     int ret_val;
35317     xmlSchemaValPtr val; /* the precomputed value */
35318     int n_val;
35319     xmlChar ** retValue; /* the returned value */
35320     int n_retValue;
35321     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35322     int n_ws;
35323
35324     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35325     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35326     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35327         mem_base = xmlMemBlocks();
35328         val = gen_xmlSchemaValPtr(n_val, 0);
35329         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35330         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35331
35332         ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35333         desret_int(ret_val);
35334         call_tests++;
35335         des_xmlSchemaValPtr(n_val, val, 0);
35336         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35337         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35338         xmlResetLastError();
35339         if (mem_base != xmlMemBlocks()) {
35340             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35341                    xmlMemBlocks() - mem_base);
35342             test_ret++;
35343             printf(" %d", n_val);
35344             printf(" %d", n_retValue);
35345             printf(" %d", n_ws);
35346             printf("\n");
35347         }
35348     }
35349     }
35350     }
35351     function_tests++;
35352 #endif
35353
35354     return(test_ret);
35355 }
35356
35357
35358 static int
35359 test_xmlSchemaGetFacetValueAsULong(void) {
35360     int test_ret = 0;
35361
35362 #if defined(LIBXML_SCHEMAS_ENABLED)
35363     int mem_base;
35364     unsigned long ret_val;
35365     xmlSchemaFacetPtr facet; /* an schemas type facet */
35366     int n_facet;
35367
35368     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35369         mem_base = xmlMemBlocks();
35370         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35371
35372         ret_val = xmlSchemaGetFacetValueAsULong(facet);
35373         desret_unsigned_long(ret_val);
35374         call_tests++;
35375         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35376         xmlResetLastError();
35377         if (mem_base != xmlMemBlocks()) {
35378             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35379                    xmlMemBlocks() - mem_base);
35380             test_ret++;
35381             printf(" %d", n_facet);
35382             printf("\n");
35383         }
35384     }
35385     function_tests++;
35386 #endif
35387
35388     return(test_ret);
35389 }
35390
35391
35392 static int
35393 test_xmlSchemaGetPredefinedType(void) {
35394     int test_ret = 0;
35395
35396 #if defined(LIBXML_SCHEMAS_ENABLED)
35397     int mem_base;
35398     xmlSchemaTypePtr ret_val;
35399     xmlChar * name; /* the type name */
35400     int n_name;
35401     xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35402     int n_ns;
35403
35404     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35405     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35406         mem_base = xmlMemBlocks();
35407         name = gen_const_xmlChar_ptr(n_name, 0);
35408         ns = gen_const_xmlChar_ptr(n_ns, 1);
35409
35410         ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35411         desret_xmlSchemaTypePtr(ret_val);
35412         call_tests++;
35413         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35414         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35415         xmlResetLastError();
35416         if (mem_base != xmlMemBlocks()) {
35417             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35418                    xmlMemBlocks() - mem_base);
35419             test_ret++;
35420             printf(" %d", n_name);
35421             printf(" %d", n_ns);
35422             printf("\n");
35423         }
35424     }
35425     }
35426     function_tests++;
35427 #endif
35428
35429     return(test_ret);
35430 }
35431
35432
35433 static int
35434 test_xmlSchemaGetValType(void) {
35435     int test_ret = 0;
35436
35437 #if defined(LIBXML_SCHEMAS_ENABLED)
35438     int mem_base;
35439     xmlSchemaValType ret_val;
35440     xmlSchemaValPtr val; /* a schemas value */
35441     int n_val;
35442
35443     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35444         mem_base = xmlMemBlocks();
35445         val = gen_xmlSchemaValPtr(n_val, 0);
35446
35447         ret_val = xmlSchemaGetValType(val);
35448         desret_xmlSchemaValType(ret_val);
35449         call_tests++;
35450         des_xmlSchemaValPtr(n_val, val, 0);
35451         xmlResetLastError();
35452         if (mem_base != xmlMemBlocks()) {
35453             printf("Leak of %d blocks found in xmlSchemaGetValType",
35454                    xmlMemBlocks() - mem_base);
35455             test_ret++;
35456             printf(" %d", n_val);
35457             printf("\n");
35458         }
35459     }
35460     function_tests++;
35461 #endif
35462
35463     return(test_ret);
35464 }
35465
35466
35467 static int
35468 test_xmlSchemaInitTypes(void) {
35469     int test_ret = 0;
35470
35471 #if defined(LIBXML_SCHEMAS_ENABLED)
35472
35473
35474         xmlSchemaInitTypes();
35475         call_tests++;
35476         xmlResetLastError();
35477     function_tests++;
35478 #endif
35479
35480     return(test_ret);
35481 }
35482
35483
35484 static int
35485 test_xmlSchemaIsBuiltInTypeFacet(void) {
35486     int test_ret = 0;
35487
35488 #if defined(LIBXML_SCHEMAS_ENABLED)
35489     int mem_base;
35490     int ret_val;
35491     xmlSchemaTypePtr type; /* the built-in type */
35492     int n_type;
35493     int facetType; /* the facet type */
35494     int n_facetType;
35495
35496     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35497     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35498         mem_base = xmlMemBlocks();
35499         type = gen_xmlSchemaTypePtr(n_type, 0);
35500         facetType = gen_int(n_facetType, 1);
35501
35502         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35503         desret_int(ret_val);
35504         call_tests++;
35505         des_xmlSchemaTypePtr(n_type, type, 0);
35506         des_int(n_facetType, facetType, 1);
35507         xmlResetLastError();
35508         if (mem_base != xmlMemBlocks()) {
35509             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35510                    xmlMemBlocks() - mem_base);
35511             test_ret++;
35512             printf(" %d", n_type);
35513             printf(" %d", n_facetType);
35514             printf("\n");
35515         }
35516     }
35517     }
35518     function_tests++;
35519 #endif
35520
35521     return(test_ret);
35522 }
35523
35524
35525 static int
35526 test_xmlSchemaNewFacet(void) {
35527     int test_ret = 0;
35528
35529
35530     /* missing type support */
35531     return(test_ret);
35532 }
35533
35534
35535 static int
35536 test_xmlSchemaNewNOTATIONValue(void) {
35537     int test_ret = 0;
35538
35539
35540     /* missing type support */
35541     return(test_ret);
35542 }
35543
35544
35545 static int
35546 test_xmlSchemaNewQNameValue(void) {
35547     int test_ret = 0;
35548
35549
35550     /* missing type support */
35551     return(test_ret);
35552 }
35553
35554
35555 static int
35556 test_xmlSchemaNewStringValue(void) {
35557     int test_ret = 0;
35558
35559
35560     /* missing type support */
35561     return(test_ret);
35562 }
35563
35564 #ifdef LIBXML_SCHEMAS_ENABLED
35565
35566 #define gen_nb_xmlSchemaValPtr_ptr 1
35567 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35568     return(NULL);
35569 }
35570 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35571 }
35572 #endif
35573
35574
35575 static int
35576 test_xmlSchemaValPredefTypeNode(void) {
35577     int test_ret = 0;
35578
35579 #if defined(LIBXML_SCHEMAS_ENABLED)
35580     int mem_base;
35581     int ret_val;
35582     xmlSchemaTypePtr type; /* the predefined type */
35583     int n_type;
35584     xmlChar * value; /* the value to check */
35585     int n_value;
35586     xmlSchemaValPtr * val; /* the return computed value */
35587     int n_val;
35588     xmlNodePtr node; /* the node containing the value */
35589     int n_node;
35590
35591     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35592     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35593     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35594     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35595         mem_base = xmlMemBlocks();
35596         type = gen_xmlSchemaTypePtr(n_type, 0);
35597         value = gen_const_xmlChar_ptr(n_value, 1);
35598         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35599         node = gen_xmlNodePtr(n_node, 3);
35600
35601         ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35602         desret_int(ret_val);
35603         call_tests++;
35604         des_xmlSchemaTypePtr(n_type, type, 0);
35605         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35606         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35607         des_xmlNodePtr(n_node, node, 3);
35608         xmlResetLastError();
35609         if (mem_base != xmlMemBlocks()) {
35610             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35611                    xmlMemBlocks() - mem_base);
35612             test_ret++;
35613             printf(" %d", n_type);
35614             printf(" %d", n_value);
35615             printf(" %d", n_val);
35616             printf(" %d", n_node);
35617             printf("\n");
35618         }
35619     }
35620     }
35621     }
35622     }
35623     function_tests++;
35624 #endif
35625
35626     return(test_ret);
35627 }
35628
35629
35630 static int
35631 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35632     int test_ret = 0;
35633
35634 #if defined(LIBXML_SCHEMAS_ENABLED)
35635     int mem_base;
35636     int ret_val;
35637     xmlSchemaTypePtr type; /* the predefined type */
35638     int n_type;
35639     xmlChar * value; /* the value to check */
35640     int n_value;
35641     xmlSchemaValPtr * val; /* the return computed value */
35642     int n_val;
35643     xmlNodePtr node; /* the node containing the value */
35644     int n_node;
35645
35646     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35647     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35648     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35649     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35650         mem_base = xmlMemBlocks();
35651         type = gen_xmlSchemaTypePtr(n_type, 0);
35652         value = gen_const_xmlChar_ptr(n_value, 1);
35653         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35654         node = gen_xmlNodePtr(n_node, 3);
35655
35656         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35657         desret_int(ret_val);
35658         call_tests++;
35659         des_xmlSchemaTypePtr(n_type, type, 0);
35660         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35661         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35662         des_xmlNodePtr(n_node, node, 3);
35663         xmlResetLastError();
35664         if (mem_base != xmlMemBlocks()) {
35665             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35666                    xmlMemBlocks() - mem_base);
35667             test_ret++;
35668             printf(" %d", n_type);
35669             printf(" %d", n_value);
35670             printf(" %d", n_val);
35671             printf(" %d", n_node);
35672             printf("\n");
35673         }
35674     }
35675     }
35676     }
35677     }
35678     function_tests++;
35679 #endif
35680
35681     return(test_ret);
35682 }
35683
35684
35685 static int
35686 test_xmlSchemaValidateFacet(void) {
35687     int test_ret = 0;
35688
35689 #if defined(LIBXML_SCHEMAS_ENABLED)
35690     int mem_base;
35691     int ret_val;
35692     xmlSchemaTypePtr base; /* the base type */
35693     int n_base;
35694     xmlSchemaFacetPtr facet; /* the facet to check */
35695     int n_facet;
35696     xmlChar * value; /* the lexical repr of the value to validate */
35697     int n_value;
35698     xmlSchemaValPtr val; /* the precomputed value */
35699     int n_val;
35700
35701     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35702     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35703     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35704     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35705         mem_base = xmlMemBlocks();
35706         base = gen_xmlSchemaTypePtr(n_base, 0);
35707         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35708         value = gen_const_xmlChar_ptr(n_value, 2);
35709         val = gen_xmlSchemaValPtr(n_val, 3);
35710
35711         ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35712         desret_int(ret_val);
35713         call_tests++;
35714         des_xmlSchemaTypePtr(n_base, base, 0);
35715         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35716         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35717         des_xmlSchemaValPtr(n_val, val, 3);
35718         xmlResetLastError();
35719         if (mem_base != xmlMemBlocks()) {
35720             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35721                    xmlMemBlocks() - mem_base);
35722             test_ret++;
35723             printf(" %d", n_base);
35724             printf(" %d", n_facet);
35725             printf(" %d", n_value);
35726             printf(" %d", n_val);
35727             printf("\n");
35728         }
35729     }
35730     }
35731     }
35732     }
35733     function_tests++;
35734 #endif
35735
35736     return(test_ret);
35737 }
35738
35739
35740 static int
35741 test_xmlSchemaValidateFacetWhtsp(void) {
35742     int test_ret = 0;
35743
35744 #if defined(LIBXML_SCHEMAS_ENABLED)
35745     int mem_base;
35746     int ret_val;
35747     xmlSchemaFacetPtr facet; /* the facet to check */
35748     int n_facet;
35749     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35750     int n_fws;
35751     xmlSchemaValType valType; /* the built-in type of the value */
35752     int n_valType;
35753     xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35754     int n_value;
35755     xmlSchemaValPtr val; /* the precomputed value */
35756     int n_val;
35757     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35758     int n_ws;
35759
35760     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35761     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35762     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35763     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35764     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35765     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35766         mem_base = xmlMemBlocks();
35767         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35768         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35769         valType = gen_xmlSchemaValType(n_valType, 2);
35770         value = gen_const_xmlChar_ptr(n_value, 3);
35771         val = gen_xmlSchemaValPtr(n_val, 4);
35772         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35773
35774         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35775         desret_int(ret_val);
35776         call_tests++;
35777         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35778         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35779         des_xmlSchemaValType(n_valType, valType, 2);
35780         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35781         des_xmlSchemaValPtr(n_val, val, 4);
35782         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35783         xmlResetLastError();
35784         if (mem_base != xmlMemBlocks()) {
35785             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35786                    xmlMemBlocks() - mem_base);
35787             test_ret++;
35788             printf(" %d", n_facet);
35789             printf(" %d", n_fws);
35790             printf(" %d", n_valType);
35791             printf(" %d", n_value);
35792             printf(" %d", n_val);
35793             printf(" %d", n_ws);
35794             printf("\n");
35795         }
35796     }
35797     }
35798     }
35799     }
35800     }
35801     }
35802     function_tests++;
35803 #endif
35804
35805     return(test_ret);
35806 }
35807
35808
35809 static int
35810 test_xmlSchemaValidateLengthFacet(void) {
35811     int test_ret = 0;
35812
35813 #if defined(LIBXML_SCHEMAS_ENABLED)
35814     int mem_base;
35815     int ret_val;
35816     xmlSchemaTypePtr type; /* the built-in type */
35817     int n_type;
35818     xmlSchemaFacetPtr facet; /* the facet to check */
35819     int n_facet;
35820     xmlChar * value; /* the lexical repr. of the value to be validated */
35821     int n_value;
35822     xmlSchemaValPtr val; /* the precomputed value */
35823     int n_val;
35824     unsigned long * length; /* the actual length of the value */
35825     int n_length;
35826
35827     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35828     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35829     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35830     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35831     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35832         mem_base = xmlMemBlocks();
35833         type = gen_xmlSchemaTypePtr(n_type, 0);
35834         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35835         value = gen_const_xmlChar_ptr(n_value, 2);
35836         val = gen_xmlSchemaValPtr(n_val, 3);
35837         length = gen_unsigned_long_ptr(n_length, 4);
35838
35839         ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35840         desret_int(ret_val);
35841         call_tests++;
35842         des_xmlSchemaTypePtr(n_type, type, 0);
35843         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35844         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35845         des_xmlSchemaValPtr(n_val, val, 3);
35846         des_unsigned_long_ptr(n_length, length, 4);
35847         xmlResetLastError();
35848         if (mem_base != xmlMemBlocks()) {
35849             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35850                    xmlMemBlocks() - mem_base);
35851             test_ret++;
35852             printf(" %d", n_type);
35853             printf(" %d", n_facet);
35854             printf(" %d", n_value);
35855             printf(" %d", n_val);
35856             printf(" %d", n_length);
35857             printf("\n");
35858         }
35859     }
35860     }
35861     }
35862     }
35863     }
35864     function_tests++;
35865 #endif
35866
35867     return(test_ret);
35868 }
35869
35870
35871 static int
35872 test_xmlSchemaValidateLengthFacetWhtsp(void) {
35873     int test_ret = 0;
35874
35875 #if defined(LIBXML_SCHEMAS_ENABLED)
35876     int mem_base;
35877     int ret_val;
35878     xmlSchemaFacetPtr facet; /* the facet to check */
35879     int n_facet;
35880     xmlSchemaValType valType; /* the built-in type */
35881     int n_valType;
35882     xmlChar * value; /* the lexical repr. of the value to be validated */
35883     int n_value;
35884     xmlSchemaValPtr val; /* the precomputed value */
35885     int n_val;
35886     unsigned long * length; /* the actual length of the value */
35887     int n_length;
35888     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35889     int n_ws;
35890
35891     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35892     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35893     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35894     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35895     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35896     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35897         mem_base = xmlMemBlocks();
35898         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35899         valType = gen_xmlSchemaValType(n_valType, 1);
35900         value = gen_const_xmlChar_ptr(n_value, 2);
35901         val = gen_xmlSchemaValPtr(n_val, 3);
35902         length = gen_unsigned_long_ptr(n_length, 4);
35903         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35904
35905         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35906         desret_int(ret_val);
35907         call_tests++;
35908         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35909         des_xmlSchemaValType(n_valType, valType, 1);
35910         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35911         des_xmlSchemaValPtr(n_val, val, 3);
35912         des_unsigned_long_ptr(n_length, length, 4);
35913         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35914         xmlResetLastError();
35915         if (mem_base != xmlMemBlocks()) {
35916             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35917                    xmlMemBlocks() - mem_base);
35918             test_ret++;
35919             printf(" %d", n_facet);
35920             printf(" %d", n_valType);
35921             printf(" %d", n_value);
35922             printf(" %d", n_val);
35923             printf(" %d", n_length);
35924             printf(" %d", n_ws);
35925             printf("\n");
35926         }
35927     }
35928     }
35929     }
35930     }
35931     }
35932     }
35933     function_tests++;
35934 #endif
35935
35936     return(test_ret);
35937 }
35938
35939
35940 static int
35941 test_xmlSchemaValidateListSimpleTypeFacet(void) {
35942     int test_ret = 0;
35943
35944 #if defined(LIBXML_SCHEMAS_ENABLED)
35945     int mem_base;
35946     int ret_val;
35947     xmlSchemaFacetPtr facet; /* the facet to check */
35948     int n_facet;
35949     xmlChar * value; /* the lexical repr of the value to validate */
35950     int n_value;
35951     unsigned long actualLen; /* the number of list items */
35952     int n_actualLen;
35953     unsigned long * expectedLen; /* the resulting expected number of list items */
35954     int n_expectedLen;
35955
35956     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35957     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35958     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35959     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35960         mem_base = xmlMemBlocks();
35961         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35962         value = gen_const_xmlChar_ptr(n_value, 1);
35963         actualLen = gen_unsigned_long(n_actualLen, 2);
35964         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35965
35966         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35967         desret_int(ret_val);
35968         call_tests++;
35969         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35970         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35971         des_unsigned_long(n_actualLen, actualLen, 2);
35972         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35973         xmlResetLastError();
35974         if (mem_base != xmlMemBlocks()) {
35975             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35976                    xmlMemBlocks() - mem_base);
35977             test_ret++;
35978             printf(" %d", n_facet);
35979             printf(" %d", n_value);
35980             printf(" %d", n_actualLen);
35981             printf(" %d", n_expectedLen);
35982             printf("\n");
35983         }
35984     }
35985     }
35986     }
35987     }
35988     function_tests++;
35989 #endif
35990
35991     return(test_ret);
35992 }
35993
35994
35995 static int
35996 test_xmlSchemaValidatePredefinedType(void) {
35997     int test_ret = 0;
35998
35999 #if defined(LIBXML_SCHEMAS_ENABLED)
36000     int mem_base;
36001     int ret_val;
36002     xmlSchemaTypePtr type; /* the predefined type */
36003     int n_type;
36004     xmlChar * value; /* the value to check */
36005     int n_value;
36006     xmlSchemaValPtr * val; /* the return computed value */
36007     int n_val;
36008
36009     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36010     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36011     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36012         mem_base = xmlMemBlocks();
36013         type = gen_xmlSchemaTypePtr(n_type, 0);
36014         value = gen_const_xmlChar_ptr(n_value, 1);
36015         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36016
36017         ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
36018         desret_int(ret_val);
36019         call_tests++;
36020         des_xmlSchemaTypePtr(n_type, type, 0);
36021         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36022         des_xmlSchemaValPtr_ptr(n_val, val, 2);
36023         xmlResetLastError();
36024         if (mem_base != xmlMemBlocks()) {
36025             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
36026                    xmlMemBlocks() - mem_base);
36027             test_ret++;
36028             printf(" %d", n_type);
36029             printf(" %d", n_value);
36030             printf(" %d", n_val);
36031             printf("\n");
36032         }
36033     }
36034     }
36035     }
36036     function_tests++;
36037 #endif
36038
36039     return(test_ret);
36040 }
36041
36042
36043 static int
36044 test_xmlSchemaValueAppend(void) {
36045     int test_ret = 0;
36046
36047 #if defined(LIBXML_SCHEMAS_ENABLED)
36048     int mem_base;
36049     int ret_val;
36050     xmlSchemaValPtr prev; /* the value */
36051     int n_prev;
36052     xmlSchemaValPtr cur; /* the value to be appended */
36053     int n_cur;
36054
36055     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
36056     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
36057         mem_base = xmlMemBlocks();
36058         prev = gen_xmlSchemaValPtr(n_prev, 0);
36059         cur = gen_xmlSchemaValPtr(n_cur, 1);
36060
36061         ret_val = xmlSchemaValueAppend(prev, cur);
36062         desret_int(ret_val);
36063         call_tests++;
36064         des_xmlSchemaValPtr(n_prev, prev, 0);
36065         des_xmlSchemaValPtr(n_cur, cur, 1);
36066         xmlResetLastError();
36067         if (mem_base != xmlMemBlocks()) {
36068             printf("Leak of %d blocks found in xmlSchemaValueAppend",
36069                    xmlMemBlocks() - mem_base);
36070             test_ret++;
36071             printf(" %d", n_prev);
36072             printf(" %d", n_cur);
36073             printf("\n");
36074         }
36075     }
36076     }
36077     function_tests++;
36078 #endif
36079
36080     return(test_ret);
36081 }
36082
36083
36084 static int
36085 test_xmlSchemaValueGetAsBoolean(void) {
36086     int test_ret = 0;
36087
36088 #if defined(LIBXML_SCHEMAS_ENABLED)
36089     int mem_base;
36090     int ret_val;
36091     xmlSchemaValPtr val; /* the value */
36092     int n_val;
36093
36094     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36095         mem_base = xmlMemBlocks();
36096         val = gen_xmlSchemaValPtr(n_val, 0);
36097
36098         ret_val = xmlSchemaValueGetAsBoolean(val);
36099         desret_int(ret_val);
36100         call_tests++;
36101         des_xmlSchemaValPtr(n_val, val, 0);
36102         xmlResetLastError();
36103         if (mem_base != xmlMemBlocks()) {
36104             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
36105                    xmlMemBlocks() - mem_base);
36106             test_ret++;
36107             printf(" %d", n_val);
36108             printf("\n");
36109         }
36110     }
36111     function_tests++;
36112 #endif
36113
36114     return(test_ret);
36115 }
36116
36117
36118 static int
36119 test_xmlSchemaValueGetAsString(void) {
36120     int test_ret = 0;
36121
36122 #if defined(LIBXML_SCHEMAS_ENABLED)
36123     int mem_base;
36124     const xmlChar * ret_val;
36125     xmlSchemaValPtr val; /* the value */
36126     int n_val;
36127
36128     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36129         mem_base = xmlMemBlocks();
36130         val = gen_xmlSchemaValPtr(n_val, 0);
36131
36132         ret_val = xmlSchemaValueGetAsString(val);
36133         desret_const_xmlChar_ptr(ret_val);
36134         call_tests++;
36135         des_xmlSchemaValPtr(n_val, val, 0);
36136         xmlResetLastError();
36137         if (mem_base != xmlMemBlocks()) {
36138             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
36139                    xmlMemBlocks() - mem_base);
36140             test_ret++;
36141             printf(" %d", n_val);
36142             printf("\n");
36143         }
36144     }
36145     function_tests++;
36146 #endif
36147
36148     return(test_ret);
36149 }
36150
36151
36152 static int
36153 test_xmlSchemaValueGetNext(void) {
36154     int test_ret = 0;
36155
36156
36157     /* missing type support */
36158     return(test_ret);
36159 }
36160
36161
36162 static int
36163 test_xmlSchemaWhiteSpaceReplace(void) {
36164     int test_ret = 0;
36165
36166 #if defined(LIBXML_SCHEMAS_ENABLED)
36167     int mem_base;
36168     xmlChar * ret_val;
36169     xmlChar * value; /* a value */
36170     int n_value;
36171
36172     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36173         mem_base = xmlMemBlocks();
36174         value = gen_const_xmlChar_ptr(n_value, 0);
36175
36176         ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
36177         desret_xmlChar_ptr(ret_val);
36178         call_tests++;
36179         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
36180         xmlResetLastError();
36181         if (mem_base != xmlMemBlocks()) {
36182             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
36183                    xmlMemBlocks() - mem_base);
36184             test_ret++;
36185             printf(" %d", n_value);
36186             printf("\n");
36187         }
36188     }
36189     function_tests++;
36190 #endif
36191
36192     return(test_ret);
36193 }
36194
36195 static int
36196 test_xmlschemastypes(void) {
36197     int test_ret = 0;
36198
36199     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
36200     test_ret += test_xmlSchemaCheckFacet();
36201     test_ret += test_xmlSchemaCleanupTypes();
36202     test_ret += test_xmlSchemaCollapseString();
36203     test_ret += test_xmlSchemaCompareValues();
36204     test_ret += test_xmlSchemaCompareValuesWhtsp();
36205     test_ret += test_xmlSchemaCopyValue();
36206     test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
36207     test_ret += test_xmlSchemaGetBuiltInType();
36208     test_ret += test_xmlSchemaGetCanonValue();
36209     test_ret += test_xmlSchemaGetCanonValueWhtsp();
36210     test_ret += test_xmlSchemaGetFacetValueAsULong();
36211     test_ret += test_xmlSchemaGetPredefinedType();
36212     test_ret += test_xmlSchemaGetValType();
36213     test_ret += test_xmlSchemaInitTypes();
36214     test_ret += test_xmlSchemaIsBuiltInTypeFacet();
36215     test_ret += test_xmlSchemaNewFacet();
36216     test_ret += test_xmlSchemaNewNOTATIONValue();
36217     test_ret += test_xmlSchemaNewQNameValue();
36218     test_ret += test_xmlSchemaNewStringValue();
36219     test_ret += test_xmlSchemaValPredefTypeNode();
36220     test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
36221     test_ret += test_xmlSchemaValidateFacet();
36222     test_ret += test_xmlSchemaValidateFacetWhtsp();
36223     test_ret += test_xmlSchemaValidateLengthFacet();
36224     test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
36225     test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
36226     test_ret += test_xmlSchemaValidatePredefinedType();
36227     test_ret += test_xmlSchemaValueAppend();
36228     test_ret += test_xmlSchemaValueGetAsBoolean();
36229     test_ret += test_xmlSchemaValueGetAsString();
36230     test_ret += test_xmlSchemaValueGetNext();
36231     test_ret += test_xmlSchemaWhiteSpaceReplace();
36232
36233     if (test_ret != 0)
36234         printf("Module xmlschemastypes: %d errors\n", test_ret);
36235     return(test_ret);
36236 }
36237
36238 static int
36239 test_xmlCharStrdup(void) {
36240     int test_ret = 0;
36241
36242     int mem_base;
36243     xmlChar * ret_val;
36244     char * cur; /* the input char * */
36245     int n_cur;
36246
36247     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36248         mem_base = xmlMemBlocks();
36249         cur = gen_const_char_ptr(n_cur, 0);
36250
36251         ret_val = xmlCharStrdup((const char *)cur);
36252         desret_xmlChar_ptr(ret_val);
36253         call_tests++;
36254         des_const_char_ptr(n_cur, (const char *)cur, 0);
36255         xmlResetLastError();
36256         if (mem_base != xmlMemBlocks()) {
36257             printf("Leak of %d blocks found in xmlCharStrdup",
36258                    xmlMemBlocks() - mem_base);
36259             test_ret++;
36260             printf(" %d", n_cur);
36261             printf("\n");
36262         }
36263     }
36264     function_tests++;
36265
36266     return(test_ret);
36267 }
36268
36269
36270 static int
36271 test_xmlCharStrndup(void) {
36272     int test_ret = 0;
36273
36274     int mem_base;
36275     xmlChar * ret_val;
36276     char * cur; /* the input char * */
36277     int n_cur;
36278     int len; /* the len of @cur */
36279     int n_len;
36280
36281     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36282     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36283         mem_base = xmlMemBlocks();
36284         cur = gen_const_char_ptr(n_cur, 0);
36285         len = gen_int(n_len, 1);
36286
36287         ret_val = xmlCharStrndup((const char *)cur, len);
36288         desret_xmlChar_ptr(ret_val);
36289         call_tests++;
36290         des_const_char_ptr(n_cur, (const char *)cur, 0);
36291         des_int(n_len, len, 1);
36292         xmlResetLastError();
36293         if (mem_base != xmlMemBlocks()) {
36294             printf("Leak of %d blocks found in xmlCharStrndup",
36295                    xmlMemBlocks() - mem_base);
36296             test_ret++;
36297             printf(" %d", n_cur);
36298             printf(" %d", n_len);
36299             printf("\n");
36300         }
36301     }
36302     }
36303     function_tests++;
36304
36305     return(test_ret);
36306 }
36307
36308
36309 static int
36310 test_xmlCheckUTF8(void) {
36311     int test_ret = 0;
36312
36313     int mem_base;
36314     int ret_val;
36315     unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36316     int n_utf;
36317
36318     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36319         mem_base = xmlMemBlocks();
36320         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36321
36322         ret_val = xmlCheckUTF8((const unsigned char *)utf);
36323         desret_int(ret_val);
36324         call_tests++;
36325         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36326         xmlResetLastError();
36327         if (mem_base != xmlMemBlocks()) {
36328             printf("Leak of %d blocks found in xmlCheckUTF8",
36329                    xmlMemBlocks() - mem_base);
36330             test_ret++;
36331             printf(" %d", n_utf);
36332             printf("\n");
36333         }
36334     }
36335     function_tests++;
36336
36337     return(test_ret);
36338 }
36339
36340
36341 static int
36342 test_xmlGetUTF8Char(void) {
36343     int test_ret = 0;
36344
36345     int mem_base;
36346     int ret_val;
36347     unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36348     int n_utf;
36349     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. */
36350     int n_len;
36351
36352     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36353     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36354         mem_base = xmlMemBlocks();
36355         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36356         len = gen_int_ptr(n_len, 1);
36357
36358         ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36359         desret_int(ret_val);
36360         call_tests++;
36361         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36362         des_int_ptr(n_len, len, 1);
36363         xmlResetLastError();
36364         if (mem_base != xmlMemBlocks()) {
36365             printf("Leak of %d blocks found in xmlGetUTF8Char",
36366                    xmlMemBlocks() - mem_base);
36367             test_ret++;
36368             printf(" %d", n_utf);
36369             printf(" %d", n_len);
36370             printf("\n");
36371         }
36372     }
36373     }
36374     function_tests++;
36375
36376     return(test_ret);
36377 }
36378
36379
36380 static int
36381 test_xmlStrEqual(void) {
36382     int test_ret = 0;
36383
36384     int mem_base;
36385     int ret_val;
36386     xmlChar * str1; /* the first xmlChar * */
36387     int n_str1;
36388     xmlChar * str2; /* the second xmlChar * */
36389     int n_str2;
36390
36391     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36392     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36393         mem_base = xmlMemBlocks();
36394         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36395         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36396
36397         ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36398         desret_int(ret_val);
36399         call_tests++;
36400         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36401         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36402         xmlResetLastError();
36403         if (mem_base != xmlMemBlocks()) {
36404             printf("Leak of %d blocks found in xmlStrEqual",
36405                    xmlMemBlocks() - mem_base);
36406             test_ret++;
36407             printf(" %d", n_str1);
36408             printf(" %d", n_str2);
36409             printf("\n");
36410         }
36411     }
36412     }
36413     function_tests++;
36414
36415     return(test_ret);
36416 }
36417
36418
36419 static int
36420 test_xmlStrPrintf(void) {
36421     int test_ret = 0;
36422
36423
36424     /* missing type support */
36425     return(test_ret);
36426 }
36427
36428
36429 static int
36430 test_xmlStrQEqual(void) {
36431     int test_ret = 0;
36432
36433     int mem_base;
36434     int ret_val;
36435     xmlChar * pref; /* the prefix of the QName */
36436     int n_pref;
36437     xmlChar * name; /* the localname of the QName */
36438     int n_name;
36439     xmlChar * str; /* the second xmlChar * */
36440     int n_str;
36441
36442     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36443     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36444     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36445         mem_base = xmlMemBlocks();
36446         pref = gen_const_xmlChar_ptr(n_pref, 0);
36447         name = gen_const_xmlChar_ptr(n_name, 1);
36448         str = gen_const_xmlChar_ptr(n_str, 2);
36449
36450         ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36451         desret_int(ret_val);
36452         call_tests++;
36453         des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36454         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36455         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36456         xmlResetLastError();
36457         if (mem_base != xmlMemBlocks()) {
36458             printf("Leak of %d blocks found in xmlStrQEqual",
36459                    xmlMemBlocks() - mem_base);
36460             test_ret++;
36461             printf(" %d", n_pref);
36462             printf(" %d", n_name);
36463             printf(" %d", n_str);
36464             printf("\n");
36465         }
36466     }
36467     }
36468     }
36469     function_tests++;
36470
36471     return(test_ret);
36472 }
36473
36474
36475 static int
36476 test_xmlStrVPrintf(void) {
36477     int test_ret = 0;
36478
36479
36480     /* missing type support */
36481     return(test_ret);
36482 }
36483
36484
36485 static int
36486 test_xmlStrcasecmp(void) {
36487     int test_ret = 0;
36488
36489     int mem_base;
36490     int ret_val;
36491     xmlChar * str1; /* the first xmlChar * */
36492     int n_str1;
36493     xmlChar * str2; /* the second xmlChar * */
36494     int n_str2;
36495
36496     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36497     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36498         mem_base = xmlMemBlocks();
36499         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36500         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36501
36502         ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36503         desret_int(ret_val);
36504         call_tests++;
36505         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36506         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36507         xmlResetLastError();
36508         if (mem_base != xmlMemBlocks()) {
36509             printf("Leak of %d blocks found in xmlStrcasecmp",
36510                    xmlMemBlocks() - mem_base);
36511             test_ret++;
36512             printf(" %d", n_str1);
36513             printf(" %d", n_str2);
36514             printf("\n");
36515         }
36516     }
36517     }
36518     function_tests++;
36519
36520     return(test_ret);
36521 }
36522
36523
36524 static int
36525 test_xmlStrcasestr(void) {
36526     int test_ret = 0;
36527
36528     int mem_base;
36529     const xmlChar * ret_val;
36530     xmlChar * str; /* the xmlChar * array (haystack) */
36531     int n_str;
36532     xmlChar * val; /* the xmlChar to search (needle) */
36533     int n_val;
36534
36535     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36536     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36537         mem_base = xmlMemBlocks();
36538         str = gen_const_xmlChar_ptr(n_str, 0);
36539         val = gen_const_xmlChar_ptr(n_val, 1);
36540
36541         ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36542         desret_const_xmlChar_ptr(ret_val);
36543         call_tests++;
36544         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36545         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36546         xmlResetLastError();
36547         if (mem_base != xmlMemBlocks()) {
36548             printf("Leak of %d blocks found in xmlStrcasestr",
36549                    xmlMemBlocks() - mem_base);
36550             test_ret++;
36551             printf(" %d", n_str);
36552             printf(" %d", n_val);
36553             printf("\n");
36554         }
36555     }
36556     }
36557     function_tests++;
36558
36559     return(test_ret);
36560 }
36561
36562
36563 static int
36564 test_xmlStrchr(void) {
36565     int test_ret = 0;
36566
36567     int mem_base;
36568     const xmlChar * ret_val;
36569     xmlChar * str; /* the xmlChar * array */
36570     int n_str;
36571     xmlChar val; /* the xmlChar to search */
36572     int n_val;
36573
36574     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36575     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36576         mem_base = xmlMemBlocks();
36577         str = gen_const_xmlChar_ptr(n_str, 0);
36578         val = gen_xmlChar(n_val, 1);
36579
36580         ret_val = xmlStrchr((const xmlChar *)str, val);
36581         desret_const_xmlChar_ptr(ret_val);
36582         call_tests++;
36583         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36584         des_xmlChar(n_val, val, 1);
36585         xmlResetLastError();
36586         if (mem_base != xmlMemBlocks()) {
36587             printf("Leak of %d blocks found in xmlStrchr",
36588                    xmlMemBlocks() - mem_base);
36589             test_ret++;
36590             printf(" %d", n_str);
36591             printf(" %d", n_val);
36592             printf("\n");
36593         }
36594     }
36595     }
36596     function_tests++;
36597
36598     return(test_ret);
36599 }
36600
36601
36602 static int
36603 test_xmlStrcmp(void) {
36604     int test_ret = 0;
36605
36606     int mem_base;
36607     int ret_val;
36608     xmlChar * str1; /* the first xmlChar * */
36609     int n_str1;
36610     xmlChar * str2; /* the second xmlChar * */
36611     int n_str2;
36612
36613     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36614     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36615         mem_base = xmlMemBlocks();
36616         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36617         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36618
36619         ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36620         desret_int(ret_val);
36621         call_tests++;
36622         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36623         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36624         xmlResetLastError();
36625         if (mem_base != xmlMemBlocks()) {
36626             printf("Leak of %d blocks found in xmlStrcmp",
36627                    xmlMemBlocks() - mem_base);
36628             test_ret++;
36629             printf(" %d", n_str1);
36630             printf(" %d", n_str2);
36631             printf("\n");
36632         }
36633     }
36634     }
36635     function_tests++;
36636
36637     return(test_ret);
36638 }
36639
36640
36641 static int
36642 test_xmlStrdup(void) {
36643     int test_ret = 0;
36644
36645     int mem_base;
36646     xmlChar * ret_val;
36647     xmlChar * cur; /* the input xmlChar * */
36648     int n_cur;
36649
36650     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36651         mem_base = xmlMemBlocks();
36652         cur = gen_const_xmlChar_ptr(n_cur, 0);
36653
36654         ret_val = xmlStrdup((const xmlChar *)cur);
36655         desret_xmlChar_ptr(ret_val);
36656         call_tests++;
36657         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36658         xmlResetLastError();
36659         if (mem_base != xmlMemBlocks()) {
36660             printf("Leak of %d blocks found in xmlStrdup",
36661                    xmlMemBlocks() - mem_base);
36662             test_ret++;
36663             printf(" %d", n_cur);
36664             printf("\n");
36665         }
36666     }
36667     function_tests++;
36668
36669     return(test_ret);
36670 }
36671
36672
36673 static int
36674 test_xmlStrlen(void) {
36675     int test_ret = 0;
36676
36677     int mem_base;
36678     int ret_val;
36679     xmlChar * str; /* the xmlChar * array */
36680     int n_str;
36681
36682     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36683         mem_base = xmlMemBlocks();
36684         str = gen_const_xmlChar_ptr(n_str, 0);
36685
36686         ret_val = xmlStrlen((const xmlChar *)str);
36687         desret_int(ret_val);
36688         call_tests++;
36689         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36690         xmlResetLastError();
36691         if (mem_base != xmlMemBlocks()) {
36692             printf("Leak of %d blocks found in xmlStrlen",
36693                    xmlMemBlocks() - mem_base);
36694             test_ret++;
36695             printf(" %d", n_str);
36696             printf("\n");
36697         }
36698     }
36699     function_tests++;
36700
36701     return(test_ret);
36702 }
36703
36704
36705 static int
36706 test_xmlStrncasecmp(void) {
36707     int test_ret = 0;
36708
36709     int mem_base;
36710     int ret_val;
36711     xmlChar * str1; /* the first xmlChar * */
36712     int n_str1;
36713     xmlChar * str2; /* the second xmlChar * */
36714     int n_str2;
36715     int len; /* the max comparison length */
36716     int n_len;
36717
36718     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36719     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36720     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36721         mem_base = xmlMemBlocks();
36722         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36723         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36724         len = gen_int(n_len, 2);
36725
36726         ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36727         desret_int(ret_val);
36728         call_tests++;
36729         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36730         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36731         des_int(n_len, len, 2);
36732         xmlResetLastError();
36733         if (mem_base != xmlMemBlocks()) {
36734             printf("Leak of %d blocks found in xmlStrncasecmp",
36735                    xmlMemBlocks() - mem_base);
36736             test_ret++;
36737             printf(" %d", n_str1);
36738             printf(" %d", n_str2);
36739             printf(" %d", n_len);
36740             printf("\n");
36741         }
36742     }
36743     }
36744     }
36745     function_tests++;
36746
36747     return(test_ret);
36748 }
36749
36750
36751 static int
36752 test_xmlStrncatNew(void) {
36753     int test_ret = 0;
36754
36755     int mem_base;
36756     xmlChar * ret_val;
36757     xmlChar * str1; /* first xmlChar string */
36758     int n_str1;
36759     xmlChar * str2; /* second xmlChar string */
36760     int n_str2;
36761     int len; /* the len of @str2 or < 0 */
36762     int n_len;
36763
36764     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36765     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36766     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36767         mem_base = xmlMemBlocks();
36768         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36769         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36770         len = gen_int(n_len, 2);
36771
36772         ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36773         desret_xmlChar_ptr(ret_val);
36774         call_tests++;
36775         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36776         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36777         des_int(n_len, len, 2);
36778         xmlResetLastError();
36779         if (mem_base != xmlMemBlocks()) {
36780             printf("Leak of %d blocks found in xmlStrncatNew",
36781                    xmlMemBlocks() - mem_base);
36782             test_ret++;
36783             printf(" %d", n_str1);
36784             printf(" %d", n_str2);
36785             printf(" %d", n_len);
36786             printf("\n");
36787         }
36788     }
36789     }
36790     }
36791     function_tests++;
36792
36793     return(test_ret);
36794 }
36795
36796
36797 static int
36798 test_xmlStrncmp(void) {
36799     int test_ret = 0;
36800
36801     int mem_base;
36802     int ret_val;
36803     xmlChar * str1; /* the first xmlChar * */
36804     int n_str1;
36805     xmlChar * str2; /* the second xmlChar * */
36806     int n_str2;
36807     int len; /* the max comparison length */
36808     int n_len;
36809
36810     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36811     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36812     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36813         mem_base = xmlMemBlocks();
36814         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36815         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36816         len = gen_int(n_len, 2);
36817
36818         ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36819         desret_int(ret_val);
36820         call_tests++;
36821         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36822         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36823         des_int(n_len, len, 2);
36824         xmlResetLastError();
36825         if (mem_base != xmlMemBlocks()) {
36826             printf("Leak of %d blocks found in xmlStrncmp",
36827                    xmlMemBlocks() - mem_base);
36828             test_ret++;
36829             printf(" %d", n_str1);
36830             printf(" %d", n_str2);
36831             printf(" %d", n_len);
36832             printf("\n");
36833         }
36834     }
36835     }
36836     }
36837     function_tests++;
36838
36839     return(test_ret);
36840 }
36841
36842
36843 static int
36844 test_xmlStrndup(void) {
36845     int test_ret = 0;
36846
36847     int mem_base;
36848     xmlChar * ret_val;
36849     xmlChar * cur; /* the input xmlChar * */
36850     int n_cur;
36851     int len; /* the len of @cur */
36852     int n_len;
36853
36854     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36855     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36856         mem_base = xmlMemBlocks();
36857         cur = gen_const_xmlChar_ptr(n_cur, 0);
36858         len = gen_int(n_len, 1);
36859
36860         ret_val = xmlStrndup((const xmlChar *)cur, len);
36861         desret_xmlChar_ptr(ret_val);
36862         call_tests++;
36863         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36864         des_int(n_len, len, 1);
36865         xmlResetLastError();
36866         if (mem_base != xmlMemBlocks()) {
36867             printf("Leak of %d blocks found in xmlStrndup",
36868                    xmlMemBlocks() - mem_base);
36869             test_ret++;
36870             printf(" %d", n_cur);
36871             printf(" %d", n_len);
36872             printf("\n");
36873         }
36874     }
36875     }
36876     function_tests++;
36877
36878     return(test_ret);
36879 }
36880
36881
36882 static int
36883 test_xmlStrstr(void) {
36884     int test_ret = 0;
36885
36886     int mem_base;
36887     const xmlChar * ret_val;
36888     xmlChar * str; /* the xmlChar * array (haystack) */
36889     int n_str;
36890     xmlChar * val; /* the xmlChar to search (needle) */
36891     int n_val;
36892
36893     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36894     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36895         mem_base = xmlMemBlocks();
36896         str = gen_const_xmlChar_ptr(n_str, 0);
36897         val = gen_const_xmlChar_ptr(n_val, 1);
36898
36899         ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36900         desret_const_xmlChar_ptr(ret_val);
36901         call_tests++;
36902         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36903         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36904         xmlResetLastError();
36905         if (mem_base != xmlMemBlocks()) {
36906             printf("Leak of %d blocks found in xmlStrstr",
36907                    xmlMemBlocks() - mem_base);
36908             test_ret++;
36909             printf(" %d", n_str);
36910             printf(" %d", n_val);
36911             printf("\n");
36912         }
36913     }
36914     }
36915     function_tests++;
36916
36917     return(test_ret);
36918 }
36919
36920
36921 static int
36922 test_xmlStrsub(void) {
36923     int test_ret = 0;
36924
36925     int mem_base;
36926     xmlChar * ret_val;
36927     xmlChar * str; /* the xmlChar * array (haystack) */
36928     int n_str;
36929     int start; /* the index of the first char (zero based) */
36930     int n_start;
36931     int len; /* the length of the substring */
36932     int n_len;
36933
36934     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36935     for (n_start = 0;n_start < gen_nb_int;n_start++) {
36936     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36937         mem_base = xmlMemBlocks();
36938         str = gen_const_xmlChar_ptr(n_str, 0);
36939         start = gen_int(n_start, 1);
36940         len = gen_int(n_len, 2);
36941
36942         ret_val = xmlStrsub((const xmlChar *)str, start, len);
36943         desret_xmlChar_ptr(ret_val);
36944         call_tests++;
36945         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36946         des_int(n_start, start, 1);
36947         des_int(n_len, len, 2);
36948         xmlResetLastError();
36949         if (mem_base != xmlMemBlocks()) {
36950             printf("Leak of %d blocks found in xmlStrsub",
36951                    xmlMemBlocks() - mem_base);
36952             test_ret++;
36953             printf(" %d", n_str);
36954             printf(" %d", n_start);
36955             printf(" %d", n_len);
36956             printf("\n");
36957         }
36958     }
36959     }
36960     }
36961     function_tests++;
36962
36963     return(test_ret);
36964 }
36965
36966
36967 static int
36968 test_xmlUTF8Charcmp(void) {
36969     int test_ret = 0;
36970
36971     int mem_base;
36972     int ret_val;
36973     xmlChar * utf1; /* pointer to first UTF8 char */
36974     int n_utf1;
36975     xmlChar * utf2; /* pointer to second UTF8 char */
36976     int n_utf2;
36977
36978     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36979     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36980         mem_base = xmlMemBlocks();
36981         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36982         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36983
36984         ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36985         desret_int(ret_val);
36986         call_tests++;
36987         des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36988         des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36989         xmlResetLastError();
36990         if (mem_base != xmlMemBlocks()) {
36991             printf("Leak of %d blocks found in xmlUTF8Charcmp",
36992                    xmlMemBlocks() - mem_base);
36993             test_ret++;
36994             printf(" %d", n_utf1);
36995             printf(" %d", n_utf2);
36996             printf("\n");
36997         }
36998     }
36999     }
37000     function_tests++;
37001
37002     return(test_ret);
37003 }
37004
37005
37006 static int
37007 test_xmlUTF8Size(void) {
37008     int test_ret = 0;
37009
37010     int mem_base;
37011     int ret_val;
37012     xmlChar * utf; /* pointer to the UTF8 character */
37013     int n_utf;
37014
37015     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37016         mem_base = xmlMemBlocks();
37017         utf = gen_const_xmlChar_ptr(n_utf, 0);
37018
37019         ret_val = xmlUTF8Size((const xmlChar *)utf);
37020         desret_int(ret_val);
37021         call_tests++;
37022         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37023         xmlResetLastError();
37024         if (mem_base != xmlMemBlocks()) {
37025             printf("Leak of %d blocks found in xmlUTF8Size",
37026                    xmlMemBlocks() - mem_base);
37027             test_ret++;
37028             printf(" %d", n_utf);
37029             printf("\n");
37030         }
37031     }
37032     function_tests++;
37033
37034     return(test_ret);
37035 }
37036
37037
37038 static int
37039 test_xmlUTF8Strlen(void) {
37040     int test_ret = 0;
37041
37042     int mem_base;
37043     int ret_val;
37044     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37045     int n_utf;
37046
37047     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37048         mem_base = xmlMemBlocks();
37049         utf = gen_const_xmlChar_ptr(n_utf, 0);
37050
37051         ret_val = xmlUTF8Strlen((const xmlChar *)utf);
37052         desret_int(ret_val);
37053         call_tests++;
37054         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37055         xmlResetLastError();
37056         if (mem_base != xmlMemBlocks()) {
37057             printf("Leak of %d blocks found in xmlUTF8Strlen",
37058                    xmlMemBlocks() - mem_base);
37059             test_ret++;
37060             printf(" %d", n_utf);
37061             printf("\n");
37062         }
37063     }
37064     function_tests++;
37065
37066     return(test_ret);
37067 }
37068
37069
37070 static int
37071 test_xmlUTF8Strloc(void) {
37072     int test_ret = 0;
37073
37074     int mem_base;
37075     int ret_val;
37076     xmlChar * utf; /* the input UTF8 * */
37077     int n_utf;
37078     xmlChar * utfchar; /* the UTF8 character to be found */
37079     int n_utfchar;
37080
37081     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37082     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
37083         mem_base = xmlMemBlocks();
37084         utf = gen_const_xmlChar_ptr(n_utf, 0);
37085         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
37086
37087         ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
37088         desret_int(ret_val);
37089         call_tests++;
37090         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37091         des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
37092         xmlResetLastError();
37093         if (mem_base != xmlMemBlocks()) {
37094             printf("Leak of %d blocks found in xmlUTF8Strloc",
37095                    xmlMemBlocks() - mem_base);
37096             test_ret++;
37097             printf(" %d", n_utf);
37098             printf(" %d", n_utfchar);
37099             printf("\n");
37100         }
37101     }
37102     }
37103     function_tests++;
37104
37105     return(test_ret);
37106 }
37107
37108
37109 static int
37110 test_xmlUTF8Strndup(void) {
37111     int test_ret = 0;
37112
37113     int mem_base;
37114     xmlChar * ret_val;
37115     xmlChar * utf; /* the input UTF8 * */
37116     int n_utf;
37117     int len; /* the len of @utf (in chars) */
37118     int n_len;
37119
37120     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37121     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37122         mem_base = xmlMemBlocks();
37123         utf = gen_const_xmlChar_ptr(n_utf, 0);
37124         len = gen_int(n_len, 1);
37125
37126         ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
37127         desret_xmlChar_ptr(ret_val);
37128         call_tests++;
37129         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37130         des_int(n_len, len, 1);
37131         xmlResetLastError();
37132         if (mem_base != xmlMemBlocks()) {
37133             printf("Leak of %d blocks found in xmlUTF8Strndup",
37134                    xmlMemBlocks() - mem_base);
37135             test_ret++;
37136             printf(" %d", n_utf);
37137             printf(" %d", n_len);
37138             printf("\n");
37139         }
37140     }
37141     }
37142     function_tests++;
37143
37144     return(test_ret);
37145 }
37146
37147
37148 static int
37149 test_xmlUTF8Strpos(void) {
37150     int test_ret = 0;
37151
37152     int mem_base;
37153     const xmlChar * ret_val;
37154     xmlChar * utf; /* the input UTF8 * */
37155     int n_utf;
37156     int pos; /* the position of the desired UTF8 char (in chars) */
37157     int n_pos;
37158
37159     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37160     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
37161         mem_base = xmlMemBlocks();
37162         utf = gen_const_xmlChar_ptr(n_utf, 0);
37163         pos = gen_int(n_pos, 1);
37164
37165         ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
37166         desret_const_xmlChar_ptr(ret_val);
37167         call_tests++;
37168         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37169         des_int(n_pos, pos, 1);
37170         xmlResetLastError();
37171         if (mem_base != xmlMemBlocks()) {
37172             printf("Leak of %d blocks found in xmlUTF8Strpos",
37173                    xmlMemBlocks() - mem_base);
37174             test_ret++;
37175             printf(" %d", n_utf);
37176             printf(" %d", n_pos);
37177             printf("\n");
37178         }
37179     }
37180     }
37181     function_tests++;
37182
37183     return(test_ret);
37184 }
37185
37186
37187 static int
37188 test_xmlUTF8Strsize(void) {
37189     int test_ret = 0;
37190
37191     int mem_base;
37192     int ret_val;
37193     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37194     int n_utf;
37195     int len; /* the number of characters in the array */
37196     int n_len;
37197
37198     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37199     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37200         mem_base = xmlMemBlocks();
37201         utf = gen_const_xmlChar_ptr(n_utf, 0);
37202         len = gen_int(n_len, 1);
37203
37204         ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
37205         desret_int(ret_val);
37206         call_tests++;
37207         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37208         des_int(n_len, len, 1);
37209         xmlResetLastError();
37210         if (mem_base != xmlMemBlocks()) {
37211             printf("Leak of %d blocks found in xmlUTF8Strsize",
37212                    xmlMemBlocks() - mem_base);
37213             test_ret++;
37214             printf(" %d", n_utf);
37215             printf(" %d", n_len);
37216             printf("\n");
37217         }
37218     }
37219     }
37220     function_tests++;
37221
37222     return(test_ret);
37223 }
37224
37225
37226 static int
37227 test_xmlUTF8Strsub(void) {
37228     int test_ret = 0;
37229
37230     int mem_base;
37231     xmlChar * ret_val;
37232     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37233     int n_utf;
37234     int start; /* relative pos of first char */
37235     int n_start;
37236     int len; /* total number to copy */
37237     int n_len;
37238
37239     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37240     for (n_start = 0;n_start < gen_nb_int;n_start++) {
37241     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37242         mem_base = xmlMemBlocks();
37243         utf = gen_const_xmlChar_ptr(n_utf, 0);
37244         start = gen_int(n_start, 1);
37245         len = gen_int(n_len, 2);
37246
37247         ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
37248         desret_xmlChar_ptr(ret_val);
37249         call_tests++;
37250         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37251         des_int(n_start, start, 1);
37252         des_int(n_len, len, 2);
37253         xmlResetLastError();
37254         if (mem_base != xmlMemBlocks()) {
37255             printf("Leak of %d blocks found in xmlUTF8Strsub",
37256                    xmlMemBlocks() - mem_base);
37257             test_ret++;
37258             printf(" %d", n_utf);
37259             printf(" %d", n_start);
37260             printf(" %d", n_len);
37261             printf("\n");
37262         }
37263     }
37264     }
37265     }
37266     function_tests++;
37267
37268     return(test_ret);
37269 }
37270
37271 static int
37272 test_xmlstring(void) {
37273     int test_ret = 0;
37274
37275     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37276     test_ret += test_xmlCharStrdup();
37277     test_ret += test_xmlCharStrndup();
37278     test_ret += test_xmlCheckUTF8();
37279     test_ret += test_xmlGetUTF8Char();
37280     test_ret += test_xmlStrEqual();
37281     test_ret += test_xmlStrPrintf();
37282     test_ret += test_xmlStrQEqual();
37283     test_ret += test_xmlStrVPrintf();
37284     test_ret += test_xmlStrcasecmp();
37285     test_ret += test_xmlStrcasestr();
37286     test_ret += test_xmlStrchr();
37287     test_ret += test_xmlStrcmp();
37288     test_ret += test_xmlStrdup();
37289     test_ret += test_xmlStrlen();
37290     test_ret += test_xmlStrncasecmp();
37291     test_ret += test_xmlStrncatNew();
37292     test_ret += test_xmlStrncmp();
37293     test_ret += test_xmlStrndup();
37294     test_ret += test_xmlStrstr();
37295     test_ret += test_xmlStrsub();
37296     test_ret += test_xmlUTF8Charcmp();
37297     test_ret += test_xmlUTF8Size();
37298     test_ret += test_xmlUTF8Strlen();
37299     test_ret += test_xmlUTF8Strloc();
37300     test_ret += test_xmlUTF8Strndup();
37301     test_ret += test_xmlUTF8Strpos();
37302     test_ret += test_xmlUTF8Strsize();
37303     test_ret += test_xmlUTF8Strsub();
37304
37305     if (test_ret != 0)
37306         printf("Module xmlstring: %d errors\n", test_ret);
37307     return(test_ret);
37308 }
37309
37310 static int
37311 test_xmlUCSIsAegeanNumbers(void) {
37312     int test_ret = 0;
37313
37314 #if defined(LIBXML_UNICODE_ENABLED)
37315     int mem_base;
37316     int ret_val;
37317     int code; /* UCS code point */
37318     int n_code;
37319
37320     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37321         mem_base = xmlMemBlocks();
37322         code = gen_int(n_code, 0);
37323
37324         ret_val = xmlUCSIsAegeanNumbers(code);
37325         desret_int(ret_val);
37326         call_tests++;
37327         des_int(n_code, code, 0);
37328         xmlResetLastError();
37329         if (mem_base != xmlMemBlocks()) {
37330             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37331                    xmlMemBlocks() - mem_base);
37332             test_ret++;
37333             printf(" %d", n_code);
37334             printf("\n");
37335         }
37336     }
37337     function_tests++;
37338 #endif
37339
37340     return(test_ret);
37341 }
37342
37343
37344 static int
37345 test_xmlUCSIsAlphabeticPresentationForms(void) {
37346     int test_ret = 0;
37347
37348 #if defined(LIBXML_UNICODE_ENABLED)
37349     int mem_base;
37350     int ret_val;
37351     int code; /* UCS code point */
37352     int n_code;
37353
37354     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37355         mem_base = xmlMemBlocks();
37356         code = gen_int(n_code, 0);
37357
37358         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37359         desret_int(ret_val);
37360         call_tests++;
37361         des_int(n_code, code, 0);
37362         xmlResetLastError();
37363         if (mem_base != xmlMemBlocks()) {
37364             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37365                    xmlMemBlocks() - mem_base);
37366             test_ret++;
37367             printf(" %d", n_code);
37368             printf("\n");
37369         }
37370     }
37371     function_tests++;
37372 #endif
37373
37374     return(test_ret);
37375 }
37376
37377
37378 static int
37379 test_xmlUCSIsArabic(void) {
37380     int test_ret = 0;
37381
37382 #if defined(LIBXML_UNICODE_ENABLED)
37383     int mem_base;
37384     int ret_val;
37385     int code; /* UCS code point */
37386     int n_code;
37387
37388     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37389         mem_base = xmlMemBlocks();
37390         code = gen_int(n_code, 0);
37391
37392         ret_val = xmlUCSIsArabic(code);
37393         desret_int(ret_val);
37394         call_tests++;
37395         des_int(n_code, code, 0);
37396         xmlResetLastError();
37397         if (mem_base != xmlMemBlocks()) {
37398             printf("Leak of %d blocks found in xmlUCSIsArabic",
37399                    xmlMemBlocks() - mem_base);
37400             test_ret++;
37401             printf(" %d", n_code);
37402             printf("\n");
37403         }
37404     }
37405     function_tests++;
37406 #endif
37407
37408     return(test_ret);
37409 }
37410
37411
37412 static int
37413 test_xmlUCSIsArabicPresentationFormsA(void) {
37414     int test_ret = 0;
37415
37416 #if defined(LIBXML_UNICODE_ENABLED)
37417     int mem_base;
37418     int ret_val;
37419     int code; /* UCS code point */
37420     int n_code;
37421
37422     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37423         mem_base = xmlMemBlocks();
37424         code = gen_int(n_code, 0);
37425
37426         ret_val = xmlUCSIsArabicPresentationFormsA(code);
37427         desret_int(ret_val);
37428         call_tests++;
37429         des_int(n_code, code, 0);
37430         xmlResetLastError();
37431         if (mem_base != xmlMemBlocks()) {
37432             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37433                    xmlMemBlocks() - mem_base);
37434             test_ret++;
37435             printf(" %d", n_code);
37436             printf("\n");
37437         }
37438     }
37439     function_tests++;
37440 #endif
37441
37442     return(test_ret);
37443 }
37444
37445
37446 static int
37447 test_xmlUCSIsArabicPresentationFormsB(void) {
37448     int test_ret = 0;
37449
37450 #if defined(LIBXML_UNICODE_ENABLED)
37451     int mem_base;
37452     int ret_val;
37453     int code; /* UCS code point */
37454     int n_code;
37455
37456     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37457         mem_base = xmlMemBlocks();
37458         code = gen_int(n_code, 0);
37459
37460         ret_val = xmlUCSIsArabicPresentationFormsB(code);
37461         desret_int(ret_val);
37462         call_tests++;
37463         des_int(n_code, code, 0);
37464         xmlResetLastError();
37465         if (mem_base != xmlMemBlocks()) {
37466             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37467                    xmlMemBlocks() - mem_base);
37468             test_ret++;
37469             printf(" %d", n_code);
37470             printf("\n");
37471         }
37472     }
37473     function_tests++;
37474 #endif
37475
37476     return(test_ret);
37477 }
37478
37479
37480 static int
37481 test_xmlUCSIsArmenian(void) {
37482     int test_ret = 0;
37483
37484 #if defined(LIBXML_UNICODE_ENABLED)
37485     int mem_base;
37486     int ret_val;
37487     int code; /* UCS code point */
37488     int n_code;
37489
37490     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37491         mem_base = xmlMemBlocks();
37492         code = gen_int(n_code, 0);
37493
37494         ret_val = xmlUCSIsArmenian(code);
37495         desret_int(ret_val);
37496         call_tests++;
37497         des_int(n_code, code, 0);
37498         xmlResetLastError();
37499         if (mem_base != xmlMemBlocks()) {
37500             printf("Leak of %d blocks found in xmlUCSIsArmenian",
37501                    xmlMemBlocks() - mem_base);
37502             test_ret++;
37503             printf(" %d", n_code);
37504             printf("\n");
37505         }
37506     }
37507     function_tests++;
37508 #endif
37509
37510     return(test_ret);
37511 }
37512
37513
37514 static int
37515 test_xmlUCSIsArrows(void) {
37516     int test_ret = 0;
37517
37518 #if defined(LIBXML_UNICODE_ENABLED)
37519     int mem_base;
37520     int ret_val;
37521     int code; /* UCS code point */
37522     int n_code;
37523
37524     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37525         mem_base = xmlMemBlocks();
37526         code = gen_int(n_code, 0);
37527
37528         ret_val = xmlUCSIsArrows(code);
37529         desret_int(ret_val);
37530         call_tests++;
37531         des_int(n_code, code, 0);
37532         xmlResetLastError();
37533         if (mem_base != xmlMemBlocks()) {
37534             printf("Leak of %d blocks found in xmlUCSIsArrows",
37535                    xmlMemBlocks() - mem_base);
37536             test_ret++;
37537             printf(" %d", n_code);
37538             printf("\n");
37539         }
37540     }
37541     function_tests++;
37542 #endif
37543
37544     return(test_ret);
37545 }
37546
37547
37548 static int
37549 test_xmlUCSIsBasicLatin(void) {
37550     int test_ret = 0;
37551
37552 #if defined(LIBXML_UNICODE_ENABLED)
37553     int mem_base;
37554     int ret_val;
37555     int code; /* UCS code point */
37556     int n_code;
37557
37558     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37559         mem_base = xmlMemBlocks();
37560         code = gen_int(n_code, 0);
37561
37562         ret_val = xmlUCSIsBasicLatin(code);
37563         desret_int(ret_val);
37564         call_tests++;
37565         des_int(n_code, code, 0);
37566         xmlResetLastError();
37567         if (mem_base != xmlMemBlocks()) {
37568             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37569                    xmlMemBlocks() - mem_base);
37570             test_ret++;
37571             printf(" %d", n_code);
37572             printf("\n");
37573         }
37574     }
37575     function_tests++;
37576 #endif
37577
37578     return(test_ret);
37579 }
37580
37581
37582 static int
37583 test_xmlUCSIsBengali(void) {
37584     int test_ret = 0;
37585
37586 #if defined(LIBXML_UNICODE_ENABLED)
37587     int mem_base;
37588     int ret_val;
37589     int code; /* UCS code point */
37590     int n_code;
37591
37592     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37593         mem_base = xmlMemBlocks();
37594         code = gen_int(n_code, 0);
37595
37596         ret_val = xmlUCSIsBengali(code);
37597         desret_int(ret_val);
37598         call_tests++;
37599         des_int(n_code, code, 0);
37600         xmlResetLastError();
37601         if (mem_base != xmlMemBlocks()) {
37602             printf("Leak of %d blocks found in xmlUCSIsBengali",
37603                    xmlMemBlocks() - mem_base);
37604             test_ret++;
37605             printf(" %d", n_code);
37606             printf("\n");
37607         }
37608     }
37609     function_tests++;
37610 #endif
37611
37612     return(test_ret);
37613 }
37614
37615
37616 static int
37617 test_xmlUCSIsBlock(void) {
37618     int test_ret = 0;
37619
37620 #if defined(LIBXML_UNICODE_ENABLED)
37621     int mem_base;
37622     int ret_val;
37623     int code; /* UCS code point */
37624     int n_code;
37625     char * block; /* UCS block name */
37626     int n_block;
37627
37628     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37629     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37630         mem_base = xmlMemBlocks();
37631         code = gen_int(n_code, 0);
37632         block = gen_const_char_ptr(n_block, 1);
37633
37634         ret_val = xmlUCSIsBlock(code, (const char *)block);
37635         desret_int(ret_val);
37636         call_tests++;
37637         des_int(n_code, code, 0);
37638         des_const_char_ptr(n_block, (const char *)block, 1);
37639         xmlResetLastError();
37640         if (mem_base != xmlMemBlocks()) {
37641             printf("Leak of %d blocks found in xmlUCSIsBlock",
37642                    xmlMemBlocks() - mem_base);
37643             test_ret++;
37644             printf(" %d", n_code);
37645             printf(" %d", n_block);
37646             printf("\n");
37647         }
37648     }
37649     }
37650     function_tests++;
37651 #endif
37652
37653     return(test_ret);
37654 }
37655
37656
37657 static int
37658 test_xmlUCSIsBlockElements(void) {
37659     int test_ret = 0;
37660
37661 #if defined(LIBXML_UNICODE_ENABLED)
37662     int mem_base;
37663     int ret_val;
37664     int code; /* UCS code point */
37665     int n_code;
37666
37667     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37668         mem_base = xmlMemBlocks();
37669         code = gen_int(n_code, 0);
37670
37671         ret_val = xmlUCSIsBlockElements(code);
37672         desret_int(ret_val);
37673         call_tests++;
37674         des_int(n_code, code, 0);
37675         xmlResetLastError();
37676         if (mem_base != xmlMemBlocks()) {
37677             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37678                    xmlMemBlocks() - mem_base);
37679             test_ret++;
37680             printf(" %d", n_code);
37681             printf("\n");
37682         }
37683     }
37684     function_tests++;
37685 #endif
37686
37687     return(test_ret);
37688 }
37689
37690
37691 static int
37692 test_xmlUCSIsBopomofo(void) {
37693     int test_ret = 0;
37694
37695 #if defined(LIBXML_UNICODE_ENABLED)
37696     int mem_base;
37697     int ret_val;
37698     int code; /* UCS code point */
37699     int n_code;
37700
37701     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37702         mem_base = xmlMemBlocks();
37703         code = gen_int(n_code, 0);
37704
37705         ret_val = xmlUCSIsBopomofo(code);
37706         desret_int(ret_val);
37707         call_tests++;
37708         des_int(n_code, code, 0);
37709         xmlResetLastError();
37710         if (mem_base != xmlMemBlocks()) {
37711             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37712                    xmlMemBlocks() - mem_base);
37713             test_ret++;
37714             printf(" %d", n_code);
37715             printf("\n");
37716         }
37717     }
37718     function_tests++;
37719 #endif
37720
37721     return(test_ret);
37722 }
37723
37724
37725 static int
37726 test_xmlUCSIsBopomofoExtended(void) {
37727     int test_ret = 0;
37728
37729 #if defined(LIBXML_UNICODE_ENABLED)
37730     int mem_base;
37731     int ret_val;
37732     int code; /* UCS code point */
37733     int n_code;
37734
37735     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37736         mem_base = xmlMemBlocks();
37737         code = gen_int(n_code, 0);
37738
37739         ret_val = xmlUCSIsBopomofoExtended(code);
37740         desret_int(ret_val);
37741         call_tests++;
37742         des_int(n_code, code, 0);
37743         xmlResetLastError();
37744         if (mem_base != xmlMemBlocks()) {
37745             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37746                    xmlMemBlocks() - mem_base);
37747             test_ret++;
37748             printf(" %d", n_code);
37749             printf("\n");
37750         }
37751     }
37752     function_tests++;
37753 #endif
37754
37755     return(test_ret);
37756 }
37757
37758
37759 static int
37760 test_xmlUCSIsBoxDrawing(void) {
37761     int test_ret = 0;
37762
37763 #if defined(LIBXML_UNICODE_ENABLED)
37764     int mem_base;
37765     int ret_val;
37766     int code; /* UCS code point */
37767     int n_code;
37768
37769     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37770         mem_base = xmlMemBlocks();
37771         code = gen_int(n_code, 0);
37772
37773         ret_val = xmlUCSIsBoxDrawing(code);
37774         desret_int(ret_val);
37775         call_tests++;
37776         des_int(n_code, code, 0);
37777         xmlResetLastError();
37778         if (mem_base != xmlMemBlocks()) {
37779             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37780                    xmlMemBlocks() - mem_base);
37781             test_ret++;
37782             printf(" %d", n_code);
37783             printf("\n");
37784         }
37785     }
37786     function_tests++;
37787 #endif
37788
37789     return(test_ret);
37790 }
37791
37792
37793 static int
37794 test_xmlUCSIsBraillePatterns(void) {
37795     int test_ret = 0;
37796
37797 #if defined(LIBXML_UNICODE_ENABLED)
37798     int mem_base;
37799     int ret_val;
37800     int code; /* UCS code point */
37801     int n_code;
37802
37803     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37804         mem_base = xmlMemBlocks();
37805         code = gen_int(n_code, 0);
37806
37807         ret_val = xmlUCSIsBraillePatterns(code);
37808         desret_int(ret_val);
37809         call_tests++;
37810         des_int(n_code, code, 0);
37811         xmlResetLastError();
37812         if (mem_base != xmlMemBlocks()) {
37813             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37814                    xmlMemBlocks() - mem_base);
37815             test_ret++;
37816             printf(" %d", n_code);
37817             printf("\n");
37818         }
37819     }
37820     function_tests++;
37821 #endif
37822
37823     return(test_ret);
37824 }
37825
37826
37827 static int
37828 test_xmlUCSIsBuhid(void) {
37829     int test_ret = 0;
37830
37831 #if defined(LIBXML_UNICODE_ENABLED)
37832     int mem_base;
37833     int ret_val;
37834     int code; /* UCS code point */
37835     int n_code;
37836
37837     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37838         mem_base = xmlMemBlocks();
37839         code = gen_int(n_code, 0);
37840
37841         ret_val = xmlUCSIsBuhid(code);
37842         desret_int(ret_val);
37843         call_tests++;
37844         des_int(n_code, code, 0);
37845         xmlResetLastError();
37846         if (mem_base != xmlMemBlocks()) {
37847             printf("Leak of %d blocks found in xmlUCSIsBuhid",
37848                    xmlMemBlocks() - mem_base);
37849             test_ret++;
37850             printf(" %d", n_code);
37851             printf("\n");
37852         }
37853     }
37854     function_tests++;
37855 #endif
37856
37857     return(test_ret);
37858 }
37859
37860
37861 static int
37862 test_xmlUCSIsByzantineMusicalSymbols(void) {
37863     int test_ret = 0;
37864
37865 #if defined(LIBXML_UNICODE_ENABLED)
37866     int mem_base;
37867     int ret_val;
37868     int code; /* UCS code point */
37869     int n_code;
37870
37871     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37872         mem_base = xmlMemBlocks();
37873         code = gen_int(n_code, 0);
37874
37875         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37876         desret_int(ret_val);
37877         call_tests++;
37878         des_int(n_code, code, 0);
37879         xmlResetLastError();
37880         if (mem_base != xmlMemBlocks()) {
37881             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37882                    xmlMemBlocks() - mem_base);
37883             test_ret++;
37884             printf(" %d", n_code);
37885             printf("\n");
37886         }
37887     }
37888     function_tests++;
37889 #endif
37890
37891     return(test_ret);
37892 }
37893
37894
37895 static int
37896 test_xmlUCSIsCJKCompatibility(void) {
37897     int test_ret = 0;
37898
37899 #if defined(LIBXML_UNICODE_ENABLED)
37900     int mem_base;
37901     int ret_val;
37902     int code; /* UCS code point */
37903     int n_code;
37904
37905     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37906         mem_base = xmlMemBlocks();
37907         code = gen_int(n_code, 0);
37908
37909         ret_val = xmlUCSIsCJKCompatibility(code);
37910         desret_int(ret_val);
37911         call_tests++;
37912         des_int(n_code, code, 0);
37913         xmlResetLastError();
37914         if (mem_base != xmlMemBlocks()) {
37915             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37916                    xmlMemBlocks() - mem_base);
37917             test_ret++;
37918             printf(" %d", n_code);
37919             printf("\n");
37920         }
37921     }
37922     function_tests++;
37923 #endif
37924
37925     return(test_ret);
37926 }
37927
37928
37929 static int
37930 test_xmlUCSIsCJKCompatibilityForms(void) {
37931     int test_ret = 0;
37932
37933 #if defined(LIBXML_UNICODE_ENABLED)
37934     int mem_base;
37935     int ret_val;
37936     int code; /* UCS code point */
37937     int n_code;
37938
37939     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37940         mem_base = xmlMemBlocks();
37941         code = gen_int(n_code, 0);
37942
37943         ret_val = xmlUCSIsCJKCompatibilityForms(code);
37944         desret_int(ret_val);
37945         call_tests++;
37946         des_int(n_code, code, 0);
37947         xmlResetLastError();
37948         if (mem_base != xmlMemBlocks()) {
37949             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37950                    xmlMemBlocks() - mem_base);
37951             test_ret++;
37952             printf(" %d", n_code);
37953             printf("\n");
37954         }
37955     }
37956     function_tests++;
37957 #endif
37958
37959     return(test_ret);
37960 }
37961
37962
37963 static int
37964 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37965     int test_ret = 0;
37966
37967 #if defined(LIBXML_UNICODE_ENABLED)
37968     int mem_base;
37969     int ret_val;
37970     int code; /* UCS code point */
37971     int n_code;
37972
37973     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37974         mem_base = xmlMemBlocks();
37975         code = gen_int(n_code, 0);
37976
37977         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37978         desret_int(ret_val);
37979         call_tests++;
37980         des_int(n_code, code, 0);
37981         xmlResetLastError();
37982         if (mem_base != xmlMemBlocks()) {
37983             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37984                    xmlMemBlocks() - mem_base);
37985             test_ret++;
37986             printf(" %d", n_code);
37987             printf("\n");
37988         }
37989     }
37990     function_tests++;
37991 #endif
37992
37993     return(test_ret);
37994 }
37995
37996
37997 static int
37998 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37999     int test_ret = 0;
38000
38001 #if defined(LIBXML_UNICODE_ENABLED)
38002     int mem_base;
38003     int ret_val;
38004     int code; /* UCS code point */
38005     int n_code;
38006
38007     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38008         mem_base = xmlMemBlocks();
38009         code = gen_int(n_code, 0);
38010
38011         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
38012         desret_int(ret_val);
38013         call_tests++;
38014         des_int(n_code, code, 0);
38015         xmlResetLastError();
38016         if (mem_base != xmlMemBlocks()) {
38017             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
38018                    xmlMemBlocks() - mem_base);
38019             test_ret++;
38020             printf(" %d", n_code);
38021             printf("\n");
38022         }
38023     }
38024     function_tests++;
38025 #endif
38026
38027     return(test_ret);
38028 }
38029
38030
38031 static int
38032 test_xmlUCSIsCJKRadicalsSupplement(void) {
38033     int test_ret = 0;
38034
38035 #if defined(LIBXML_UNICODE_ENABLED)
38036     int mem_base;
38037     int ret_val;
38038     int code; /* UCS code point */
38039     int n_code;
38040
38041     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38042         mem_base = xmlMemBlocks();
38043         code = gen_int(n_code, 0);
38044
38045         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
38046         desret_int(ret_val);
38047         call_tests++;
38048         des_int(n_code, code, 0);
38049         xmlResetLastError();
38050         if (mem_base != xmlMemBlocks()) {
38051             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
38052                    xmlMemBlocks() - mem_base);
38053             test_ret++;
38054             printf(" %d", n_code);
38055             printf("\n");
38056         }
38057     }
38058     function_tests++;
38059 #endif
38060
38061     return(test_ret);
38062 }
38063
38064
38065 static int
38066 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
38067     int test_ret = 0;
38068
38069 #if defined(LIBXML_UNICODE_ENABLED)
38070     int mem_base;
38071     int ret_val;
38072     int code; /* UCS code point */
38073     int n_code;
38074
38075     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38076         mem_base = xmlMemBlocks();
38077         code = gen_int(n_code, 0);
38078
38079         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
38080         desret_int(ret_val);
38081         call_tests++;
38082         des_int(n_code, code, 0);
38083         xmlResetLastError();
38084         if (mem_base != xmlMemBlocks()) {
38085             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
38086                    xmlMemBlocks() - mem_base);
38087             test_ret++;
38088             printf(" %d", n_code);
38089             printf("\n");
38090         }
38091     }
38092     function_tests++;
38093 #endif
38094
38095     return(test_ret);
38096 }
38097
38098
38099 static int
38100 test_xmlUCSIsCJKUnifiedIdeographs(void) {
38101     int test_ret = 0;
38102
38103 #if defined(LIBXML_UNICODE_ENABLED)
38104     int mem_base;
38105     int ret_val;
38106     int code; /* UCS code point */
38107     int n_code;
38108
38109     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38110         mem_base = xmlMemBlocks();
38111         code = gen_int(n_code, 0);
38112
38113         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
38114         desret_int(ret_val);
38115         call_tests++;
38116         des_int(n_code, code, 0);
38117         xmlResetLastError();
38118         if (mem_base != xmlMemBlocks()) {
38119             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
38120                    xmlMemBlocks() - mem_base);
38121             test_ret++;
38122             printf(" %d", n_code);
38123             printf("\n");
38124         }
38125     }
38126     function_tests++;
38127 #endif
38128
38129     return(test_ret);
38130 }
38131
38132
38133 static int
38134 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
38135     int test_ret = 0;
38136
38137 #if defined(LIBXML_UNICODE_ENABLED)
38138     int mem_base;
38139     int ret_val;
38140     int code; /* UCS code point */
38141     int n_code;
38142
38143     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38144         mem_base = xmlMemBlocks();
38145         code = gen_int(n_code, 0);
38146
38147         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
38148         desret_int(ret_val);
38149         call_tests++;
38150         des_int(n_code, code, 0);
38151         xmlResetLastError();
38152         if (mem_base != xmlMemBlocks()) {
38153             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
38154                    xmlMemBlocks() - mem_base);
38155             test_ret++;
38156             printf(" %d", n_code);
38157             printf("\n");
38158         }
38159     }
38160     function_tests++;
38161 #endif
38162
38163     return(test_ret);
38164 }
38165
38166
38167 static int
38168 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
38169     int test_ret = 0;
38170
38171 #if defined(LIBXML_UNICODE_ENABLED)
38172     int mem_base;
38173     int ret_val;
38174     int code; /* UCS code point */
38175     int n_code;
38176
38177     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38178         mem_base = xmlMemBlocks();
38179         code = gen_int(n_code, 0);
38180
38181         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
38182         desret_int(ret_val);
38183         call_tests++;
38184         des_int(n_code, code, 0);
38185         xmlResetLastError();
38186         if (mem_base != xmlMemBlocks()) {
38187             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
38188                    xmlMemBlocks() - mem_base);
38189             test_ret++;
38190             printf(" %d", n_code);
38191             printf("\n");
38192         }
38193     }
38194     function_tests++;
38195 #endif
38196
38197     return(test_ret);
38198 }
38199
38200
38201 static int
38202 test_xmlUCSIsCat(void) {
38203     int test_ret = 0;
38204
38205 #if defined(LIBXML_UNICODE_ENABLED)
38206     int mem_base;
38207     int ret_val;
38208     int code; /* UCS code point */
38209     int n_code;
38210     char * cat; /* UCS Category name */
38211     int n_cat;
38212
38213     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38214     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
38215         mem_base = xmlMemBlocks();
38216         code = gen_int(n_code, 0);
38217         cat = gen_const_char_ptr(n_cat, 1);
38218
38219         ret_val = xmlUCSIsCat(code, (const char *)cat);
38220         desret_int(ret_val);
38221         call_tests++;
38222         des_int(n_code, code, 0);
38223         des_const_char_ptr(n_cat, (const char *)cat, 1);
38224         xmlResetLastError();
38225         if (mem_base != xmlMemBlocks()) {
38226             printf("Leak of %d blocks found in xmlUCSIsCat",
38227                    xmlMemBlocks() - mem_base);
38228             test_ret++;
38229             printf(" %d", n_code);
38230             printf(" %d", n_cat);
38231             printf("\n");
38232         }
38233     }
38234     }
38235     function_tests++;
38236 #endif
38237
38238     return(test_ret);
38239 }
38240
38241
38242 static int
38243 test_xmlUCSIsCatC(void) {
38244     int test_ret = 0;
38245
38246 #if defined(LIBXML_UNICODE_ENABLED)
38247     int mem_base;
38248     int ret_val;
38249     int code; /* UCS code point */
38250     int n_code;
38251
38252     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38253         mem_base = xmlMemBlocks();
38254         code = gen_int(n_code, 0);
38255
38256         ret_val = xmlUCSIsCatC(code);
38257         desret_int(ret_val);
38258         call_tests++;
38259         des_int(n_code, code, 0);
38260         xmlResetLastError();
38261         if (mem_base != xmlMemBlocks()) {
38262             printf("Leak of %d blocks found in xmlUCSIsCatC",
38263                    xmlMemBlocks() - mem_base);
38264             test_ret++;
38265             printf(" %d", n_code);
38266             printf("\n");
38267         }
38268     }
38269     function_tests++;
38270 #endif
38271
38272     return(test_ret);
38273 }
38274
38275
38276 static int
38277 test_xmlUCSIsCatCc(void) {
38278     int test_ret = 0;
38279
38280 #if defined(LIBXML_UNICODE_ENABLED)
38281     int mem_base;
38282     int ret_val;
38283     int code; /* UCS code point */
38284     int n_code;
38285
38286     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38287         mem_base = xmlMemBlocks();
38288         code = gen_int(n_code, 0);
38289
38290         ret_val = xmlUCSIsCatCc(code);
38291         desret_int(ret_val);
38292         call_tests++;
38293         des_int(n_code, code, 0);
38294         xmlResetLastError();
38295         if (mem_base != xmlMemBlocks()) {
38296             printf("Leak of %d blocks found in xmlUCSIsCatCc",
38297                    xmlMemBlocks() - mem_base);
38298             test_ret++;
38299             printf(" %d", n_code);
38300             printf("\n");
38301         }
38302     }
38303     function_tests++;
38304 #endif
38305
38306     return(test_ret);
38307 }
38308
38309
38310 static int
38311 test_xmlUCSIsCatCf(void) {
38312     int test_ret = 0;
38313
38314 #if defined(LIBXML_UNICODE_ENABLED)
38315     int mem_base;
38316     int ret_val;
38317     int code; /* UCS code point */
38318     int n_code;
38319
38320     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38321         mem_base = xmlMemBlocks();
38322         code = gen_int(n_code, 0);
38323
38324         ret_val = xmlUCSIsCatCf(code);
38325         desret_int(ret_val);
38326         call_tests++;
38327         des_int(n_code, code, 0);
38328         xmlResetLastError();
38329         if (mem_base != xmlMemBlocks()) {
38330             printf("Leak of %d blocks found in xmlUCSIsCatCf",
38331                    xmlMemBlocks() - mem_base);
38332             test_ret++;
38333             printf(" %d", n_code);
38334             printf("\n");
38335         }
38336     }
38337     function_tests++;
38338 #endif
38339
38340     return(test_ret);
38341 }
38342
38343
38344 static int
38345 test_xmlUCSIsCatCo(void) {
38346     int test_ret = 0;
38347
38348 #if defined(LIBXML_UNICODE_ENABLED)
38349     int mem_base;
38350     int ret_val;
38351     int code; /* UCS code point */
38352     int n_code;
38353
38354     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38355         mem_base = xmlMemBlocks();
38356         code = gen_int(n_code, 0);
38357
38358         ret_val = xmlUCSIsCatCo(code);
38359         desret_int(ret_val);
38360         call_tests++;
38361         des_int(n_code, code, 0);
38362         xmlResetLastError();
38363         if (mem_base != xmlMemBlocks()) {
38364             printf("Leak of %d blocks found in xmlUCSIsCatCo",
38365                    xmlMemBlocks() - mem_base);
38366             test_ret++;
38367             printf(" %d", n_code);
38368             printf("\n");
38369         }
38370     }
38371     function_tests++;
38372 #endif
38373
38374     return(test_ret);
38375 }
38376
38377
38378 static int
38379 test_xmlUCSIsCatCs(void) {
38380     int test_ret = 0;
38381
38382 #if defined(LIBXML_UNICODE_ENABLED)
38383     int mem_base;
38384     int ret_val;
38385     int code; /* UCS code point */
38386     int n_code;
38387
38388     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38389         mem_base = xmlMemBlocks();
38390         code = gen_int(n_code, 0);
38391
38392         ret_val = xmlUCSIsCatCs(code);
38393         desret_int(ret_val);
38394         call_tests++;
38395         des_int(n_code, code, 0);
38396         xmlResetLastError();
38397         if (mem_base != xmlMemBlocks()) {
38398             printf("Leak of %d blocks found in xmlUCSIsCatCs",
38399                    xmlMemBlocks() - mem_base);
38400             test_ret++;
38401             printf(" %d", n_code);
38402             printf("\n");
38403         }
38404     }
38405     function_tests++;
38406 #endif
38407
38408     return(test_ret);
38409 }
38410
38411
38412 static int
38413 test_xmlUCSIsCatL(void) {
38414     int test_ret = 0;
38415
38416 #if defined(LIBXML_UNICODE_ENABLED)
38417     int mem_base;
38418     int ret_val;
38419     int code; /* UCS code point */
38420     int n_code;
38421
38422     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38423         mem_base = xmlMemBlocks();
38424         code = gen_int(n_code, 0);
38425
38426         ret_val = xmlUCSIsCatL(code);
38427         desret_int(ret_val);
38428         call_tests++;
38429         des_int(n_code, code, 0);
38430         xmlResetLastError();
38431         if (mem_base != xmlMemBlocks()) {
38432             printf("Leak of %d blocks found in xmlUCSIsCatL",
38433                    xmlMemBlocks() - mem_base);
38434             test_ret++;
38435             printf(" %d", n_code);
38436             printf("\n");
38437         }
38438     }
38439     function_tests++;
38440 #endif
38441
38442     return(test_ret);
38443 }
38444
38445
38446 static int
38447 test_xmlUCSIsCatLl(void) {
38448     int test_ret = 0;
38449
38450 #if defined(LIBXML_UNICODE_ENABLED)
38451     int mem_base;
38452     int ret_val;
38453     int code; /* UCS code point */
38454     int n_code;
38455
38456     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38457         mem_base = xmlMemBlocks();
38458         code = gen_int(n_code, 0);
38459
38460         ret_val = xmlUCSIsCatLl(code);
38461         desret_int(ret_val);
38462         call_tests++;
38463         des_int(n_code, code, 0);
38464         xmlResetLastError();
38465         if (mem_base != xmlMemBlocks()) {
38466             printf("Leak of %d blocks found in xmlUCSIsCatLl",
38467                    xmlMemBlocks() - mem_base);
38468             test_ret++;
38469             printf(" %d", n_code);
38470             printf("\n");
38471         }
38472     }
38473     function_tests++;
38474 #endif
38475
38476     return(test_ret);
38477 }
38478
38479
38480 static int
38481 test_xmlUCSIsCatLm(void) {
38482     int test_ret = 0;
38483
38484 #if defined(LIBXML_UNICODE_ENABLED)
38485     int mem_base;
38486     int ret_val;
38487     int code; /* UCS code point */
38488     int n_code;
38489
38490     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38491         mem_base = xmlMemBlocks();
38492         code = gen_int(n_code, 0);
38493
38494         ret_val = xmlUCSIsCatLm(code);
38495         desret_int(ret_val);
38496         call_tests++;
38497         des_int(n_code, code, 0);
38498         xmlResetLastError();
38499         if (mem_base != xmlMemBlocks()) {
38500             printf("Leak of %d blocks found in xmlUCSIsCatLm",
38501                    xmlMemBlocks() - mem_base);
38502             test_ret++;
38503             printf(" %d", n_code);
38504             printf("\n");
38505         }
38506     }
38507     function_tests++;
38508 #endif
38509
38510     return(test_ret);
38511 }
38512
38513
38514 static int
38515 test_xmlUCSIsCatLo(void) {
38516     int test_ret = 0;
38517
38518 #if defined(LIBXML_UNICODE_ENABLED)
38519     int mem_base;
38520     int ret_val;
38521     int code; /* UCS code point */
38522     int n_code;
38523
38524     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38525         mem_base = xmlMemBlocks();
38526         code = gen_int(n_code, 0);
38527
38528         ret_val = xmlUCSIsCatLo(code);
38529         desret_int(ret_val);
38530         call_tests++;
38531         des_int(n_code, code, 0);
38532         xmlResetLastError();
38533         if (mem_base != xmlMemBlocks()) {
38534             printf("Leak of %d blocks found in xmlUCSIsCatLo",
38535                    xmlMemBlocks() - mem_base);
38536             test_ret++;
38537             printf(" %d", n_code);
38538             printf("\n");
38539         }
38540     }
38541     function_tests++;
38542 #endif
38543
38544     return(test_ret);
38545 }
38546
38547
38548 static int
38549 test_xmlUCSIsCatLt(void) {
38550     int test_ret = 0;
38551
38552 #if defined(LIBXML_UNICODE_ENABLED)
38553     int mem_base;
38554     int ret_val;
38555     int code; /* UCS code point */
38556     int n_code;
38557
38558     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38559         mem_base = xmlMemBlocks();
38560         code = gen_int(n_code, 0);
38561
38562         ret_val = xmlUCSIsCatLt(code);
38563         desret_int(ret_val);
38564         call_tests++;
38565         des_int(n_code, code, 0);
38566         xmlResetLastError();
38567         if (mem_base != xmlMemBlocks()) {
38568             printf("Leak of %d blocks found in xmlUCSIsCatLt",
38569                    xmlMemBlocks() - mem_base);
38570             test_ret++;
38571             printf(" %d", n_code);
38572             printf("\n");
38573         }
38574     }
38575     function_tests++;
38576 #endif
38577
38578     return(test_ret);
38579 }
38580
38581
38582 static int
38583 test_xmlUCSIsCatLu(void) {
38584     int test_ret = 0;
38585
38586 #if defined(LIBXML_UNICODE_ENABLED)
38587     int mem_base;
38588     int ret_val;
38589     int code; /* UCS code point */
38590     int n_code;
38591
38592     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38593         mem_base = xmlMemBlocks();
38594         code = gen_int(n_code, 0);
38595
38596         ret_val = xmlUCSIsCatLu(code);
38597         desret_int(ret_val);
38598         call_tests++;
38599         des_int(n_code, code, 0);
38600         xmlResetLastError();
38601         if (mem_base != xmlMemBlocks()) {
38602             printf("Leak of %d blocks found in xmlUCSIsCatLu",
38603                    xmlMemBlocks() - mem_base);
38604             test_ret++;
38605             printf(" %d", n_code);
38606             printf("\n");
38607         }
38608     }
38609     function_tests++;
38610 #endif
38611
38612     return(test_ret);
38613 }
38614
38615
38616 static int
38617 test_xmlUCSIsCatM(void) {
38618     int test_ret = 0;
38619
38620 #if defined(LIBXML_UNICODE_ENABLED)
38621     int mem_base;
38622     int ret_val;
38623     int code; /* UCS code point */
38624     int n_code;
38625
38626     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38627         mem_base = xmlMemBlocks();
38628         code = gen_int(n_code, 0);
38629
38630         ret_val = xmlUCSIsCatM(code);
38631         desret_int(ret_val);
38632         call_tests++;
38633         des_int(n_code, code, 0);
38634         xmlResetLastError();
38635         if (mem_base != xmlMemBlocks()) {
38636             printf("Leak of %d blocks found in xmlUCSIsCatM",
38637                    xmlMemBlocks() - mem_base);
38638             test_ret++;
38639             printf(" %d", n_code);
38640             printf("\n");
38641         }
38642     }
38643     function_tests++;
38644 #endif
38645
38646     return(test_ret);
38647 }
38648
38649
38650 static int
38651 test_xmlUCSIsCatMc(void) {
38652     int test_ret = 0;
38653
38654 #if defined(LIBXML_UNICODE_ENABLED)
38655     int mem_base;
38656     int ret_val;
38657     int code; /* UCS code point */
38658     int n_code;
38659
38660     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38661         mem_base = xmlMemBlocks();
38662         code = gen_int(n_code, 0);
38663
38664         ret_val = xmlUCSIsCatMc(code);
38665         desret_int(ret_val);
38666         call_tests++;
38667         des_int(n_code, code, 0);
38668         xmlResetLastError();
38669         if (mem_base != xmlMemBlocks()) {
38670             printf("Leak of %d blocks found in xmlUCSIsCatMc",
38671                    xmlMemBlocks() - mem_base);
38672             test_ret++;
38673             printf(" %d", n_code);
38674             printf("\n");
38675         }
38676     }
38677     function_tests++;
38678 #endif
38679
38680     return(test_ret);
38681 }
38682
38683
38684 static int
38685 test_xmlUCSIsCatMe(void) {
38686     int test_ret = 0;
38687
38688 #if defined(LIBXML_UNICODE_ENABLED)
38689     int mem_base;
38690     int ret_val;
38691     int code; /* UCS code point */
38692     int n_code;
38693
38694     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38695         mem_base = xmlMemBlocks();
38696         code = gen_int(n_code, 0);
38697
38698         ret_val = xmlUCSIsCatMe(code);
38699         desret_int(ret_val);
38700         call_tests++;
38701         des_int(n_code, code, 0);
38702         xmlResetLastError();
38703         if (mem_base != xmlMemBlocks()) {
38704             printf("Leak of %d blocks found in xmlUCSIsCatMe",
38705                    xmlMemBlocks() - mem_base);
38706             test_ret++;
38707             printf(" %d", n_code);
38708             printf("\n");
38709         }
38710     }
38711     function_tests++;
38712 #endif
38713
38714     return(test_ret);
38715 }
38716
38717
38718 static int
38719 test_xmlUCSIsCatMn(void) {
38720     int test_ret = 0;
38721
38722 #if defined(LIBXML_UNICODE_ENABLED)
38723     int mem_base;
38724     int ret_val;
38725     int code; /* UCS code point */
38726     int n_code;
38727
38728     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38729         mem_base = xmlMemBlocks();
38730         code = gen_int(n_code, 0);
38731
38732         ret_val = xmlUCSIsCatMn(code);
38733         desret_int(ret_val);
38734         call_tests++;
38735         des_int(n_code, code, 0);
38736         xmlResetLastError();
38737         if (mem_base != xmlMemBlocks()) {
38738             printf("Leak of %d blocks found in xmlUCSIsCatMn",
38739                    xmlMemBlocks() - mem_base);
38740             test_ret++;
38741             printf(" %d", n_code);
38742             printf("\n");
38743         }
38744     }
38745     function_tests++;
38746 #endif
38747
38748     return(test_ret);
38749 }
38750
38751
38752 static int
38753 test_xmlUCSIsCatN(void) {
38754     int test_ret = 0;
38755
38756 #if defined(LIBXML_UNICODE_ENABLED)
38757     int mem_base;
38758     int ret_val;
38759     int code; /* UCS code point */
38760     int n_code;
38761
38762     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38763         mem_base = xmlMemBlocks();
38764         code = gen_int(n_code, 0);
38765
38766         ret_val = xmlUCSIsCatN(code);
38767         desret_int(ret_val);
38768         call_tests++;
38769         des_int(n_code, code, 0);
38770         xmlResetLastError();
38771         if (mem_base != xmlMemBlocks()) {
38772             printf("Leak of %d blocks found in xmlUCSIsCatN",
38773                    xmlMemBlocks() - mem_base);
38774             test_ret++;
38775             printf(" %d", n_code);
38776             printf("\n");
38777         }
38778     }
38779     function_tests++;
38780 #endif
38781
38782     return(test_ret);
38783 }
38784
38785
38786 static int
38787 test_xmlUCSIsCatNd(void) {
38788     int test_ret = 0;
38789
38790 #if defined(LIBXML_UNICODE_ENABLED)
38791     int mem_base;
38792     int ret_val;
38793     int code; /* UCS code point */
38794     int n_code;
38795
38796     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38797         mem_base = xmlMemBlocks();
38798         code = gen_int(n_code, 0);
38799
38800         ret_val = xmlUCSIsCatNd(code);
38801         desret_int(ret_val);
38802         call_tests++;
38803         des_int(n_code, code, 0);
38804         xmlResetLastError();
38805         if (mem_base != xmlMemBlocks()) {
38806             printf("Leak of %d blocks found in xmlUCSIsCatNd",
38807                    xmlMemBlocks() - mem_base);
38808             test_ret++;
38809             printf(" %d", n_code);
38810             printf("\n");
38811         }
38812     }
38813     function_tests++;
38814 #endif
38815
38816     return(test_ret);
38817 }
38818
38819
38820 static int
38821 test_xmlUCSIsCatNl(void) {
38822     int test_ret = 0;
38823
38824 #if defined(LIBXML_UNICODE_ENABLED)
38825     int mem_base;
38826     int ret_val;
38827     int code; /* UCS code point */
38828     int n_code;
38829
38830     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38831         mem_base = xmlMemBlocks();
38832         code = gen_int(n_code, 0);
38833
38834         ret_val = xmlUCSIsCatNl(code);
38835         desret_int(ret_val);
38836         call_tests++;
38837         des_int(n_code, code, 0);
38838         xmlResetLastError();
38839         if (mem_base != xmlMemBlocks()) {
38840             printf("Leak of %d blocks found in xmlUCSIsCatNl",
38841                    xmlMemBlocks() - mem_base);
38842             test_ret++;
38843             printf(" %d", n_code);
38844             printf("\n");
38845         }
38846     }
38847     function_tests++;
38848 #endif
38849
38850     return(test_ret);
38851 }
38852
38853
38854 static int
38855 test_xmlUCSIsCatNo(void) {
38856     int test_ret = 0;
38857
38858 #if defined(LIBXML_UNICODE_ENABLED)
38859     int mem_base;
38860     int ret_val;
38861     int code; /* UCS code point */
38862     int n_code;
38863
38864     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38865         mem_base = xmlMemBlocks();
38866         code = gen_int(n_code, 0);
38867
38868         ret_val = xmlUCSIsCatNo(code);
38869         desret_int(ret_val);
38870         call_tests++;
38871         des_int(n_code, code, 0);
38872         xmlResetLastError();
38873         if (mem_base != xmlMemBlocks()) {
38874             printf("Leak of %d blocks found in xmlUCSIsCatNo",
38875                    xmlMemBlocks() - mem_base);
38876             test_ret++;
38877             printf(" %d", n_code);
38878             printf("\n");
38879         }
38880     }
38881     function_tests++;
38882 #endif
38883
38884     return(test_ret);
38885 }
38886
38887
38888 static int
38889 test_xmlUCSIsCatP(void) {
38890     int test_ret = 0;
38891
38892 #if defined(LIBXML_UNICODE_ENABLED)
38893     int mem_base;
38894     int ret_val;
38895     int code; /* UCS code point */
38896     int n_code;
38897
38898     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38899         mem_base = xmlMemBlocks();
38900         code = gen_int(n_code, 0);
38901
38902         ret_val = xmlUCSIsCatP(code);
38903         desret_int(ret_val);
38904         call_tests++;
38905         des_int(n_code, code, 0);
38906         xmlResetLastError();
38907         if (mem_base != xmlMemBlocks()) {
38908             printf("Leak of %d blocks found in xmlUCSIsCatP",
38909                    xmlMemBlocks() - mem_base);
38910             test_ret++;
38911             printf(" %d", n_code);
38912             printf("\n");
38913         }
38914     }
38915     function_tests++;
38916 #endif
38917
38918     return(test_ret);
38919 }
38920
38921
38922 static int
38923 test_xmlUCSIsCatPc(void) {
38924     int test_ret = 0;
38925
38926 #if defined(LIBXML_UNICODE_ENABLED)
38927     int mem_base;
38928     int ret_val;
38929     int code; /* UCS code point */
38930     int n_code;
38931
38932     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38933         mem_base = xmlMemBlocks();
38934         code = gen_int(n_code, 0);
38935
38936         ret_val = xmlUCSIsCatPc(code);
38937         desret_int(ret_val);
38938         call_tests++;
38939         des_int(n_code, code, 0);
38940         xmlResetLastError();
38941         if (mem_base != xmlMemBlocks()) {
38942             printf("Leak of %d blocks found in xmlUCSIsCatPc",
38943                    xmlMemBlocks() - mem_base);
38944             test_ret++;
38945             printf(" %d", n_code);
38946             printf("\n");
38947         }
38948     }
38949     function_tests++;
38950 #endif
38951
38952     return(test_ret);
38953 }
38954
38955
38956 static int
38957 test_xmlUCSIsCatPd(void) {
38958     int test_ret = 0;
38959
38960 #if defined(LIBXML_UNICODE_ENABLED)
38961     int mem_base;
38962     int ret_val;
38963     int code; /* UCS code point */
38964     int n_code;
38965
38966     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38967         mem_base = xmlMemBlocks();
38968         code = gen_int(n_code, 0);
38969
38970         ret_val = xmlUCSIsCatPd(code);
38971         desret_int(ret_val);
38972         call_tests++;
38973         des_int(n_code, code, 0);
38974         xmlResetLastError();
38975         if (mem_base != xmlMemBlocks()) {
38976             printf("Leak of %d blocks found in xmlUCSIsCatPd",
38977                    xmlMemBlocks() - mem_base);
38978             test_ret++;
38979             printf(" %d", n_code);
38980             printf("\n");
38981         }
38982     }
38983     function_tests++;
38984 #endif
38985
38986     return(test_ret);
38987 }
38988
38989
38990 static int
38991 test_xmlUCSIsCatPe(void) {
38992     int test_ret = 0;
38993
38994 #if defined(LIBXML_UNICODE_ENABLED)
38995     int mem_base;
38996     int ret_val;
38997     int code; /* UCS code point */
38998     int n_code;
38999
39000     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39001         mem_base = xmlMemBlocks();
39002         code = gen_int(n_code, 0);
39003
39004         ret_val = xmlUCSIsCatPe(code);
39005         desret_int(ret_val);
39006         call_tests++;
39007         des_int(n_code, code, 0);
39008         xmlResetLastError();
39009         if (mem_base != xmlMemBlocks()) {
39010             printf("Leak of %d blocks found in xmlUCSIsCatPe",
39011                    xmlMemBlocks() - mem_base);
39012             test_ret++;
39013             printf(" %d", n_code);
39014             printf("\n");
39015         }
39016     }
39017     function_tests++;
39018 #endif
39019
39020     return(test_ret);
39021 }
39022
39023
39024 static int
39025 test_xmlUCSIsCatPf(void) {
39026     int test_ret = 0;
39027
39028 #if defined(LIBXML_UNICODE_ENABLED)
39029     int mem_base;
39030     int ret_val;
39031     int code; /* UCS code point */
39032     int n_code;
39033
39034     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39035         mem_base = xmlMemBlocks();
39036         code = gen_int(n_code, 0);
39037
39038         ret_val = xmlUCSIsCatPf(code);
39039         desret_int(ret_val);
39040         call_tests++;
39041         des_int(n_code, code, 0);
39042         xmlResetLastError();
39043         if (mem_base != xmlMemBlocks()) {
39044             printf("Leak of %d blocks found in xmlUCSIsCatPf",
39045                    xmlMemBlocks() - mem_base);
39046             test_ret++;
39047             printf(" %d", n_code);
39048             printf("\n");
39049         }
39050     }
39051     function_tests++;
39052 #endif
39053
39054     return(test_ret);
39055 }
39056
39057
39058 static int
39059 test_xmlUCSIsCatPi(void) {
39060     int test_ret = 0;
39061
39062 #if defined(LIBXML_UNICODE_ENABLED)
39063     int mem_base;
39064     int ret_val;
39065     int code; /* UCS code point */
39066     int n_code;
39067
39068     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39069         mem_base = xmlMemBlocks();
39070         code = gen_int(n_code, 0);
39071
39072         ret_val = xmlUCSIsCatPi(code);
39073         desret_int(ret_val);
39074         call_tests++;
39075         des_int(n_code, code, 0);
39076         xmlResetLastError();
39077         if (mem_base != xmlMemBlocks()) {
39078             printf("Leak of %d blocks found in xmlUCSIsCatPi",
39079                    xmlMemBlocks() - mem_base);
39080             test_ret++;
39081             printf(" %d", n_code);
39082             printf("\n");
39083         }
39084     }
39085     function_tests++;
39086 #endif
39087
39088     return(test_ret);
39089 }
39090
39091
39092 static int
39093 test_xmlUCSIsCatPo(void) {
39094     int test_ret = 0;
39095
39096 #if defined(LIBXML_UNICODE_ENABLED)
39097     int mem_base;
39098     int ret_val;
39099     int code; /* UCS code point */
39100     int n_code;
39101
39102     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39103         mem_base = xmlMemBlocks();
39104         code = gen_int(n_code, 0);
39105
39106         ret_val = xmlUCSIsCatPo(code);
39107         desret_int(ret_val);
39108         call_tests++;
39109         des_int(n_code, code, 0);
39110         xmlResetLastError();
39111         if (mem_base != xmlMemBlocks()) {
39112             printf("Leak of %d blocks found in xmlUCSIsCatPo",
39113                    xmlMemBlocks() - mem_base);
39114             test_ret++;
39115             printf(" %d", n_code);
39116             printf("\n");
39117         }
39118     }
39119     function_tests++;
39120 #endif
39121
39122     return(test_ret);
39123 }
39124
39125
39126 static int
39127 test_xmlUCSIsCatPs(void) {
39128     int test_ret = 0;
39129
39130 #if defined(LIBXML_UNICODE_ENABLED)
39131     int mem_base;
39132     int ret_val;
39133     int code; /* UCS code point */
39134     int n_code;
39135
39136     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39137         mem_base = xmlMemBlocks();
39138         code = gen_int(n_code, 0);
39139
39140         ret_val = xmlUCSIsCatPs(code);
39141         desret_int(ret_val);
39142         call_tests++;
39143         des_int(n_code, code, 0);
39144         xmlResetLastError();
39145         if (mem_base != xmlMemBlocks()) {
39146             printf("Leak of %d blocks found in xmlUCSIsCatPs",
39147                    xmlMemBlocks() - mem_base);
39148             test_ret++;
39149             printf(" %d", n_code);
39150             printf("\n");
39151         }
39152     }
39153     function_tests++;
39154 #endif
39155
39156     return(test_ret);
39157 }
39158
39159
39160 static int
39161 test_xmlUCSIsCatS(void) {
39162     int test_ret = 0;
39163
39164 #if defined(LIBXML_UNICODE_ENABLED)
39165     int mem_base;
39166     int ret_val;
39167     int code; /* UCS code point */
39168     int n_code;
39169
39170     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39171         mem_base = xmlMemBlocks();
39172         code = gen_int(n_code, 0);
39173
39174         ret_val = xmlUCSIsCatS(code);
39175         desret_int(ret_val);
39176         call_tests++;
39177         des_int(n_code, code, 0);
39178         xmlResetLastError();
39179         if (mem_base != xmlMemBlocks()) {
39180             printf("Leak of %d blocks found in xmlUCSIsCatS",
39181                    xmlMemBlocks() - mem_base);
39182             test_ret++;
39183             printf(" %d", n_code);
39184             printf("\n");
39185         }
39186     }
39187     function_tests++;
39188 #endif
39189
39190     return(test_ret);
39191 }
39192
39193
39194 static int
39195 test_xmlUCSIsCatSc(void) {
39196     int test_ret = 0;
39197
39198 #if defined(LIBXML_UNICODE_ENABLED)
39199     int mem_base;
39200     int ret_val;
39201     int code; /* UCS code point */
39202     int n_code;
39203
39204     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39205         mem_base = xmlMemBlocks();
39206         code = gen_int(n_code, 0);
39207
39208         ret_val = xmlUCSIsCatSc(code);
39209         desret_int(ret_val);
39210         call_tests++;
39211         des_int(n_code, code, 0);
39212         xmlResetLastError();
39213         if (mem_base != xmlMemBlocks()) {
39214             printf("Leak of %d blocks found in xmlUCSIsCatSc",
39215                    xmlMemBlocks() - mem_base);
39216             test_ret++;
39217             printf(" %d", n_code);
39218             printf("\n");
39219         }
39220     }
39221     function_tests++;
39222 #endif
39223
39224     return(test_ret);
39225 }
39226
39227
39228 static int
39229 test_xmlUCSIsCatSk(void) {
39230     int test_ret = 0;
39231
39232 #if defined(LIBXML_UNICODE_ENABLED)
39233     int mem_base;
39234     int ret_val;
39235     int code; /* UCS code point */
39236     int n_code;
39237
39238     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39239         mem_base = xmlMemBlocks();
39240         code = gen_int(n_code, 0);
39241
39242         ret_val = xmlUCSIsCatSk(code);
39243         desret_int(ret_val);
39244         call_tests++;
39245         des_int(n_code, code, 0);
39246         xmlResetLastError();
39247         if (mem_base != xmlMemBlocks()) {
39248             printf("Leak of %d blocks found in xmlUCSIsCatSk",
39249                    xmlMemBlocks() - mem_base);
39250             test_ret++;
39251             printf(" %d", n_code);
39252             printf("\n");
39253         }
39254     }
39255     function_tests++;
39256 #endif
39257
39258     return(test_ret);
39259 }
39260
39261
39262 static int
39263 test_xmlUCSIsCatSm(void) {
39264     int test_ret = 0;
39265
39266 #if defined(LIBXML_UNICODE_ENABLED)
39267     int mem_base;
39268     int ret_val;
39269     int code; /* UCS code point */
39270     int n_code;
39271
39272     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39273         mem_base = xmlMemBlocks();
39274         code = gen_int(n_code, 0);
39275
39276         ret_val = xmlUCSIsCatSm(code);
39277         desret_int(ret_val);
39278         call_tests++;
39279         des_int(n_code, code, 0);
39280         xmlResetLastError();
39281         if (mem_base != xmlMemBlocks()) {
39282             printf("Leak of %d blocks found in xmlUCSIsCatSm",
39283                    xmlMemBlocks() - mem_base);
39284             test_ret++;
39285             printf(" %d", n_code);
39286             printf("\n");
39287         }
39288     }
39289     function_tests++;
39290 #endif
39291
39292     return(test_ret);
39293 }
39294
39295
39296 static int
39297 test_xmlUCSIsCatSo(void) {
39298     int test_ret = 0;
39299
39300 #if defined(LIBXML_UNICODE_ENABLED)
39301     int mem_base;
39302     int ret_val;
39303     int code; /* UCS code point */
39304     int n_code;
39305
39306     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39307         mem_base = xmlMemBlocks();
39308         code = gen_int(n_code, 0);
39309
39310         ret_val = xmlUCSIsCatSo(code);
39311         desret_int(ret_val);
39312         call_tests++;
39313         des_int(n_code, code, 0);
39314         xmlResetLastError();
39315         if (mem_base != xmlMemBlocks()) {
39316             printf("Leak of %d blocks found in xmlUCSIsCatSo",
39317                    xmlMemBlocks() - mem_base);
39318             test_ret++;
39319             printf(" %d", n_code);
39320             printf("\n");
39321         }
39322     }
39323     function_tests++;
39324 #endif
39325
39326     return(test_ret);
39327 }
39328
39329
39330 static int
39331 test_xmlUCSIsCatZ(void) {
39332     int test_ret = 0;
39333
39334 #if defined(LIBXML_UNICODE_ENABLED)
39335     int mem_base;
39336     int ret_val;
39337     int code; /* UCS code point */
39338     int n_code;
39339
39340     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39341         mem_base = xmlMemBlocks();
39342         code = gen_int(n_code, 0);
39343
39344         ret_val = xmlUCSIsCatZ(code);
39345         desret_int(ret_val);
39346         call_tests++;
39347         des_int(n_code, code, 0);
39348         xmlResetLastError();
39349         if (mem_base != xmlMemBlocks()) {
39350             printf("Leak of %d blocks found in xmlUCSIsCatZ",
39351                    xmlMemBlocks() - mem_base);
39352             test_ret++;
39353             printf(" %d", n_code);
39354             printf("\n");
39355         }
39356     }
39357     function_tests++;
39358 #endif
39359
39360     return(test_ret);
39361 }
39362
39363
39364 static int
39365 test_xmlUCSIsCatZl(void) {
39366     int test_ret = 0;
39367
39368 #if defined(LIBXML_UNICODE_ENABLED)
39369     int mem_base;
39370     int ret_val;
39371     int code; /* UCS code point */
39372     int n_code;
39373
39374     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39375         mem_base = xmlMemBlocks();
39376         code = gen_int(n_code, 0);
39377
39378         ret_val = xmlUCSIsCatZl(code);
39379         desret_int(ret_val);
39380         call_tests++;
39381         des_int(n_code, code, 0);
39382         xmlResetLastError();
39383         if (mem_base != xmlMemBlocks()) {
39384             printf("Leak of %d blocks found in xmlUCSIsCatZl",
39385                    xmlMemBlocks() - mem_base);
39386             test_ret++;
39387             printf(" %d", n_code);
39388             printf("\n");
39389         }
39390     }
39391     function_tests++;
39392 #endif
39393
39394     return(test_ret);
39395 }
39396
39397
39398 static int
39399 test_xmlUCSIsCatZp(void) {
39400     int test_ret = 0;
39401
39402 #if defined(LIBXML_UNICODE_ENABLED)
39403     int mem_base;
39404     int ret_val;
39405     int code; /* UCS code point */
39406     int n_code;
39407
39408     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39409         mem_base = xmlMemBlocks();
39410         code = gen_int(n_code, 0);
39411
39412         ret_val = xmlUCSIsCatZp(code);
39413         desret_int(ret_val);
39414         call_tests++;
39415         des_int(n_code, code, 0);
39416         xmlResetLastError();
39417         if (mem_base != xmlMemBlocks()) {
39418             printf("Leak of %d blocks found in xmlUCSIsCatZp",
39419                    xmlMemBlocks() - mem_base);
39420             test_ret++;
39421             printf(" %d", n_code);
39422             printf("\n");
39423         }
39424     }
39425     function_tests++;
39426 #endif
39427
39428     return(test_ret);
39429 }
39430
39431
39432 static int
39433 test_xmlUCSIsCatZs(void) {
39434     int test_ret = 0;
39435
39436 #if defined(LIBXML_UNICODE_ENABLED)
39437     int mem_base;
39438     int ret_val;
39439     int code; /* UCS code point */
39440     int n_code;
39441
39442     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39443         mem_base = xmlMemBlocks();
39444         code = gen_int(n_code, 0);
39445
39446         ret_val = xmlUCSIsCatZs(code);
39447         desret_int(ret_val);
39448         call_tests++;
39449         des_int(n_code, code, 0);
39450         xmlResetLastError();
39451         if (mem_base != xmlMemBlocks()) {
39452             printf("Leak of %d blocks found in xmlUCSIsCatZs",
39453                    xmlMemBlocks() - mem_base);
39454             test_ret++;
39455             printf(" %d", n_code);
39456             printf("\n");
39457         }
39458     }
39459     function_tests++;
39460 #endif
39461
39462     return(test_ret);
39463 }
39464
39465
39466 static int
39467 test_xmlUCSIsCherokee(void) {
39468     int test_ret = 0;
39469
39470 #if defined(LIBXML_UNICODE_ENABLED)
39471     int mem_base;
39472     int ret_val;
39473     int code; /* UCS code point */
39474     int n_code;
39475
39476     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39477         mem_base = xmlMemBlocks();
39478         code = gen_int(n_code, 0);
39479
39480         ret_val = xmlUCSIsCherokee(code);
39481         desret_int(ret_val);
39482         call_tests++;
39483         des_int(n_code, code, 0);
39484         xmlResetLastError();
39485         if (mem_base != xmlMemBlocks()) {
39486             printf("Leak of %d blocks found in xmlUCSIsCherokee",
39487                    xmlMemBlocks() - mem_base);
39488             test_ret++;
39489             printf(" %d", n_code);
39490             printf("\n");
39491         }
39492     }
39493     function_tests++;
39494 #endif
39495
39496     return(test_ret);
39497 }
39498
39499
39500 static int
39501 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39502     int test_ret = 0;
39503
39504 #if defined(LIBXML_UNICODE_ENABLED)
39505     int mem_base;
39506     int ret_val;
39507     int code; /* UCS code point */
39508     int n_code;
39509
39510     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39511         mem_base = xmlMemBlocks();
39512         code = gen_int(n_code, 0);
39513
39514         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39515         desret_int(ret_val);
39516         call_tests++;
39517         des_int(n_code, code, 0);
39518         xmlResetLastError();
39519         if (mem_base != xmlMemBlocks()) {
39520             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39521                    xmlMemBlocks() - mem_base);
39522             test_ret++;
39523             printf(" %d", n_code);
39524             printf("\n");
39525         }
39526     }
39527     function_tests++;
39528 #endif
39529
39530     return(test_ret);
39531 }
39532
39533
39534 static int
39535 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39536     int test_ret = 0;
39537
39538 #if defined(LIBXML_UNICODE_ENABLED)
39539     int mem_base;
39540     int ret_val;
39541     int code; /* UCS code point */
39542     int n_code;
39543
39544     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39545         mem_base = xmlMemBlocks();
39546         code = gen_int(n_code, 0);
39547
39548         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39549         desret_int(ret_val);
39550         call_tests++;
39551         des_int(n_code, code, 0);
39552         xmlResetLastError();
39553         if (mem_base != xmlMemBlocks()) {
39554             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39555                    xmlMemBlocks() - mem_base);
39556             test_ret++;
39557             printf(" %d", n_code);
39558             printf("\n");
39559         }
39560     }
39561     function_tests++;
39562 #endif
39563
39564     return(test_ret);
39565 }
39566
39567
39568 static int
39569 test_xmlUCSIsCombiningHalfMarks(void) {
39570     int test_ret = 0;
39571
39572 #if defined(LIBXML_UNICODE_ENABLED)
39573     int mem_base;
39574     int ret_val;
39575     int code; /* UCS code point */
39576     int n_code;
39577
39578     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39579         mem_base = xmlMemBlocks();
39580         code = gen_int(n_code, 0);
39581
39582         ret_val = xmlUCSIsCombiningHalfMarks(code);
39583         desret_int(ret_val);
39584         call_tests++;
39585         des_int(n_code, code, 0);
39586         xmlResetLastError();
39587         if (mem_base != xmlMemBlocks()) {
39588             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39589                    xmlMemBlocks() - mem_base);
39590             test_ret++;
39591             printf(" %d", n_code);
39592             printf("\n");
39593         }
39594     }
39595     function_tests++;
39596 #endif
39597
39598     return(test_ret);
39599 }
39600
39601
39602 static int
39603 test_xmlUCSIsCombiningMarksforSymbols(void) {
39604     int test_ret = 0;
39605
39606 #if defined(LIBXML_UNICODE_ENABLED)
39607     int mem_base;
39608     int ret_val;
39609     int code; /* UCS code point */
39610     int n_code;
39611
39612     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39613         mem_base = xmlMemBlocks();
39614         code = gen_int(n_code, 0);
39615
39616         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39617         desret_int(ret_val);
39618         call_tests++;
39619         des_int(n_code, code, 0);
39620         xmlResetLastError();
39621         if (mem_base != xmlMemBlocks()) {
39622             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39623                    xmlMemBlocks() - mem_base);
39624             test_ret++;
39625             printf(" %d", n_code);
39626             printf("\n");
39627         }
39628     }
39629     function_tests++;
39630 #endif
39631
39632     return(test_ret);
39633 }
39634
39635
39636 static int
39637 test_xmlUCSIsControlPictures(void) {
39638     int test_ret = 0;
39639
39640 #if defined(LIBXML_UNICODE_ENABLED)
39641     int mem_base;
39642     int ret_val;
39643     int code; /* UCS code point */
39644     int n_code;
39645
39646     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39647         mem_base = xmlMemBlocks();
39648         code = gen_int(n_code, 0);
39649
39650         ret_val = xmlUCSIsControlPictures(code);
39651         desret_int(ret_val);
39652         call_tests++;
39653         des_int(n_code, code, 0);
39654         xmlResetLastError();
39655         if (mem_base != xmlMemBlocks()) {
39656             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39657                    xmlMemBlocks() - mem_base);
39658             test_ret++;
39659             printf(" %d", n_code);
39660             printf("\n");
39661         }
39662     }
39663     function_tests++;
39664 #endif
39665
39666     return(test_ret);
39667 }
39668
39669
39670 static int
39671 test_xmlUCSIsCurrencySymbols(void) {
39672     int test_ret = 0;
39673
39674 #if defined(LIBXML_UNICODE_ENABLED)
39675     int mem_base;
39676     int ret_val;
39677     int code; /* UCS code point */
39678     int n_code;
39679
39680     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39681         mem_base = xmlMemBlocks();
39682         code = gen_int(n_code, 0);
39683
39684         ret_val = xmlUCSIsCurrencySymbols(code);
39685         desret_int(ret_val);
39686         call_tests++;
39687         des_int(n_code, code, 0);
39688         xmlResetLastError();
39689         if (mem_base != xmlMemBlocks()) {
39690             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39691                    xmlMemBlocks() - mem_base);
39692             test_ret++;
39693             printf(" %d", n_code);
39694             printf("\n");
39695         }
39696     }
39697     function_tests++;
39698 #endif
39699
39700     return(test_ret);
39701 }
39702
39703
39704 static int
39705 test_xmlUCSIsCypriotSyllabary(void) {
39706     int test_ret = 0;
39707
39708 #if defined(LIBXML_UNICODE_ENABLED)
39709     int mem_base;
39710     int ret_val;
39711     int code; /* UCS code point */
39712     int n_code;
39713
39714     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39715         mem_base = xmlMemBlocks();
39716         code = gen_int(n_code, 0);
39717
39718         ret_val = xmlUCSIsCypriotSyllabary(code);
39719         desret_int(ret_val);
39720         call_tests++;
39721         des_int(n_code, code, 0);
39722         xmlResetLastError();
39723         if (mem_base != xmlMemBlocks()) {
39724             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39725                    xmlMemBlocks() - mem_base);
39726             test_ret++;
39727             printf(" %d", n_code);
39728             printf("\n");
39729         }
39730     }
39731     function_tests++;
39732 #endif
39733
39734     return(test_ret);
39735 }
39736
39737
39738 static int
39739 test_xmlUCSIsCyrillic(void) {
39740     int test_ret = 0;
39741
39742 #if defined(LIBXML_UNICODE_ENABLED)
39743     int mem_base;
39744     int ret_val;
39745     int code; /* UCS code point */
39746     int n_code;
39747
39748     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39749         mem_base = xmlMemBlocks();
39750         code = gen_int(n_code, 0);
39751
39752         ret_val = xmlUCSIsCyrillic(code);
39753         desret_int(ret_val);
39754         call_tests++;
39755         des_int(n_code, code, 0);
39756         xmlResetLastError();
39757         if (mem_base != xmlMemBlocks()) {
39758             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39759                    xmlMemBlocks() - mem_base);
39760             test_ret++;
39761             printf(" %d", n_code);
39762             printf("\n");
39763         }
39764     }
39765     function_tests++;
39766 #endif
39767
39768     return(test_ret);
39769 }
39770
39771
39772 static int
39773 test_xmlUCSIsCyrillicSupplement(void) {
39774     int test_ret = 0;
39775
39776 #if defined(LIBXML_UNICODE_ENABLED)
39777     int mem_base;
39778     int ret_val;
39779     int code; /* UCS code point */
39780     int n_code;
39781
39782     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39783         mem_base = xmlMemBlocks();
39784         code = gen_int(n_code, 0);
39785
39786         ret_val = xmlUCSIsCyrillicSupplement(code);
39787         desret_int(ret_val);
39788         call_tests++;
39789         des_int(n_code, code, 0);
39790         xmlResetLastError();
39791         if (mem_base != xmlMemBlocks()) {
39792             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39793                    xmlMemBlocks() - mem_base);
39794             test_ret++;
39795             printf(" %d", n_code);
39796             printf("\n");
39797         }
39798     }
39799     function_tests++;
39800 #endif
39801
39802     return(test_ret);
39803 }
39804
39805
39806 static int
39807 test_xmlUCSIsDeseret(void) {
39808     int test_ret = 0;
39809
39810 #if defined(LIBXML_UNICODE_ENABLED)
39811     int mem_base;
39812     int ret_val;
39813     int code; /* UCS code point */
39814     int n_code;
39815
39816     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39817         mem_base = xmlMemBlocks();
39818         code = gen_int(n_code, 0);
39819
39820         ret_val = xmlUCSIsDeseret(code);
39821         desret_int(ret_val);
39822         call_tests++;
39823         des_int(n_code, code, 0);
39824         xmlResetLastError();
39825         if (mem_base != xmlMemBlocks()) {
39826             printf("Leak of %d blocks found in xmlUCSIsDeseret",
39827                    xmlMemBlocks() - mem_base);
39828             test_ret++;
39829             printf(" %d", n_code);
39830             printf("\n");
39831         }
39832     }
39833     function_tests++;
39834 #endif
39835
39836     return(test_ret);
39837 }
39838
39839
39840 static int
39841 test_xmlUCSIsDevanagari(void) {
39842     int test_ret = 0;
39843
39844 #if defined(LIBXML_UNICODE_ENABLED)
39845     int mem_base;
39846     int ret_val;
39847     int code; /* UCS code point */
39848     int n_code;
39849
39850     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39851         mem_base = xmlMemBlocks();
39852         code = gen_int(n_code, 0);
39853
39854         ret_val = xmlUCSIsDevanagari(code);
39855         desret_int(ret_val);
39856         call_tests++;
39857         des_int(n_code, code, 0);
39858         xmlResetLastError();
39859         if (mem_base != xmlMemBlocks()) {
39860             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39861                    xmlMemBlocks() - mem_base);
39862             test_ret++;
39863             printf(" %d", n_code);
39864             printf("\n");
39865         }
39866     }
39867     function_tests++;
39868 #endif
39869
39870     return(test_ret);
39871 }
39872
39873
39874 static int
39875 test_xmlUCSIsDingbats(void) {
39876     int test_ret = 0;
39877
39878 #if defined(LIBXML_UNICODE_ENABLED)
39879     int mem_base;
39880     int ret_val;
39881     int code; /* UCS code point */
39882     int n_code;
39883
39884     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39885         mem_base = xmlMemBlocks();
39886         code = gen_int(n_code, 0);
39887
39888         ret_val = xmlUCSIsDingbats(code);
39889         desret_int(ret_val);
39890         call_tests++;
39891         des_int(n_code, code, 0);
39892         xmlResetLastError();
39893         if (mem_base != xmlMemBlocks()) {
39894             printf("Leak of %d blocks found in xmlUCSIsDingbats",
39895                    xmlMemBlocks() - mem_base);
39896             test_ret++;
39897             printf(" %d", n_code);
39898             printf("\n");
39899         }
39900     }
39901     function_tests++;
39902 #endif
39903
39904     return(test_ret);
39905 }
39906
39907
39908 static int
39909 test_xmlUCSIsEnclosedAlphanumerics(void) {
39910     int test_ret = 0;
39911
39912 #if defined(LIBXML_UNICODE_ENABLED)
39913     int mem_base;
39914     int ret_val;
39915     int code; /* UCS code point */
39916     int n_code;
39917
39918     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39919         mem_base = xmlMemBlocks();
39920         code = gen_int(n_code, 0);
39921
39922         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39923         desret_int(ret_val);
39924         call_tests++;
39925         des_int(n_code, code, 0);
39926         xmlResetLastError();
39927         if (mem_base != xmlMemBlocks()) {
39928             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39929                    xmlMemBlocks() - mem_base);
39930             test_ret++;
39931             printf(" %d", n_code);
39932             printf("\n");
39933         }
39934     }
39935     function_tests++;
39936 #endif
39937
39938     return(test_ret);
39939 }
39940
39941
39942 static int
39943 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39944     int test_ret = 0;
39945
39946 #if defined(LIBXML_UNICODE_ENABLED)
39947     int mem_base;
39948     int ret_val;
39949     int code; /* UCS code point */
39950     int n_code;
39951
39952     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39953         mem_base = xmlMemBlocks();
39954         code = gen_int(n_code, 0);
39955
39956         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39957         desret_int(ret_val);
39958         call_tests++;
39959         des_int(n_code, code, 0);
39960         xmlResetLastError();
39961         if (mem_base != xmlMemBlocks()) {
39962             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39963                    xmlMemBlocks() - mem_base);
39964             test_ret++;
39965             printf(" %d", n_code);
39966             printf("\n");
39967         }
39968     }
39969     function_tests++;
39970 #endif
39971
39972     return(test_ret);
39973 }
39974
39975
39976 static int
39977 test_xmlUCSIsEthiopic(void) {
39978     int test_ret = 0;
39979
39980 #if defined(LIBXML_UNICODE_ENABLED)
39981     int mem_base;
39982     int ret_val;
39983     int code; /* UCS code point */
39984     int n_code;
39985
39986     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39987         mem_base = xmlMemBlocks();
39988         code = gen_int(n_code, 0);
39989
39990         ret_val = xmlUCSIsEthiopic(code);
39991         desret_int(ret_val);
39992         call_tests++;
39993         des_int(n_code, code, 0);
39994         xmlResetLastError();
39995         if (mem_base != xmlMemBlocks()) {
39996             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39997                    xmlMemBlocks() - mem_base);
39998             test_ret++;
39999             printf(" %d", n_code);
40000             printf("\n");
40001         }
40002     }
40003     function_tests++;
40004 #endif
40005
40006     return(test_ret);
40007 }
40008
40009
40010 static int
40011 test_xmlUCSIsGeneralPunctuation(void) {
40012     int test_ret = 0;
40013
40014 #if defined(LIBXML_UNICODE_ENABLED)
40015     int mem_base;
40016     int ret_val;
40017     int code; /* UCS code point */
40018     int n_code;
40019
40020     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40021         mem_base = xmlMemBlocks();
40022         code = gen_int(n_code, 0);
40023
40024         ret_val = xmlUCSIsGeneralPunctuation(code);
40025         desret_int(ret_val);
40026         call_tests++;
40027         des_int(n_code, code, 0);
40028         xmlResetLastError();
40029         if (mem_base != xmlMemBlocks()) {
40030             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
40031                    xmlMemBlocks() - mem_base);
40032             test_ret++;
40033             printf(" %d", n_code);
40034             printf("\n");
40035         }
40036     }
40037     function_tests++;
40038 #endif
40039
40040     return(test_ret);
40041 }
40042
40043
40044 static int
40045 test_xmlUCSIsGeometricShapes(void) {
40046     int test_ret = 0;
40047
40048 #if defined(LIBXML_UNICODE_ENABLED)
40049     int mem_base;
40050     int ret_val;
40051     int code; /* UCS code point */
40052     int n_code;
40053
40054     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40055         mem_base = xmlMemBlocks();
40056         code = gen_int(n_code, 0);
40057
40058         ret_val = xmlUCSIsGeometricShapes(code);
40059         desret_int(ret_val);
40060         call_tests++;
40061         des_int(n_code, code, 0);
40062         xmlResetLastError();
40063         if (mem_base != xmlMemBlocks()) {
40064             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
40065                    xmlMemBlocks() - mem_base);
40066             test_ret++;
40067             printf(" %d", n_code);
40068             printf("\n");
40069         }
40070     }
40071     function_tests++;
40072 #endif
40073
40074     return(test_ret);
40075 }
40076
40077
40078 static int
40079 test_xmlUCSIsGeorgian(void) {
40080     int test_ret = 0;
40081
40082 #if defined(LIBXML_UNICODE_ENABLED)
40083     int mem_base;
40084     int ret_val;
40085     int code; /* UCS code point */
40086     int n_code;
40087
40088     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40089         mem_base = xmlMemBlocks();
40090         code = gen_int(n_code, 0);
40091
40092         ret_val = xmlUCSIsGeorgian(code);
40093         desret_int(ret_val);
40094         call_tests++;
40095         des_int(n_code, code, 0);
40096         xmlResetLastError();
40097         if (mem_base != xmlMemBlocks()) {
40098             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
40099                    xmlMemBlocks() - mem_base);
40100             test_ret++;
40101             printf(" %d", n_code);
40102             printf("\n");
40103         }
40104     }
40105     function_tests++;
40106 #endif
40107
40108     return(test_ret);
40109 }
40110
40111
40112 static int
40113 test_xmlUCSIsGothic(void) {
40114     int test_ret = 0;
40115
40116 #if defined(LIBXML_UNICODE_ENABLED)
40117     int mem_base;
40118     int ret_val;
40119     int code; /* UCS code point */
40120     int n_code;
40121
40122     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40123         mem_base = xmlMemBlocks();
40124         code = gen_int(n_code, 0);
40125
40126         ret_val = xmlUCSIsGothic(code);
40127         desret_int(ret_val);
40128         call_tests++;
40129         des_int(n_code, code, 0);
40130         xmlResetLastError();
40131         if (mem_base != xmlMemBlocks()) {
40132             printf("Leak of %d blocks found in xmlUCSIsGothic",
40133                    xmlMemBlocks() - mem_base);
40134             test_ret++;
40135             printf(" %d", n_code);
40136             printf("\n");
40137         }
40138     }
40139     function_tests++;
40140 #endif
40141
40142     return(test_ret);
40143 }
40144
40145
40146 static int
40147 test_xmlUCSIsGreek(void) {
40148     int test_ret = 0;
40149
40150 #if defined(LIBXML_UNICODE_ENABLED)
40151     int mem_base;
40152     int ret_val;
40153     int code; /* UCS code point */
40154     int n_code;
40155
40156     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40157         mem_base = xmlMemBlocks();
40158         code = gen_int(n_code, 0);
40159
40160         ret_val = xmlUCSIsGreek(code);
40161         desret_int(ret_val);
40162         call_tests++;
40163         des_int(n_code, code, 0);
40164         xmlResetLastError();
40165         if (mem_base != xmlMemBlocks()) {
40166             printf("Leak of %d blocks found in xmlUCSIsGreek",
40167                    xmlMemBlocks() - mem_base);
40168             test_ret++;
40169             printf(" %d", n_code);
40170             printf("\n");
40171         }
40172     }
40173     function_tests++;
40174 #endif
40175
40176     return(test_ret);
40177 }
40178
40179
40180 static int
40181 test_xmlUCSIsGreekExtended(void) {
40182     int test_ret = 0;
40183
40184 #if defined(LIBXML_UNICODE_ENABLED)
40185     int mem_base;
40186     int ret_val;
40187     int code; /* UCS code point */
40188     int n_code;
40189
40190     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40191         mem_base = xmlMemBlocks();
40192         code = gen_int(n_code, 0);
40193
40194         ret_val = xmlUCSIsGreekExtended(code);
40195         desret_int(ret_val);
40196         call_tests++;
40197         des_int(n_code, code, 0);
40198         xmlResetLastError();
40199         if (mem_base != xmlMemBlocks()) {
40200             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
40201                    xmlMemBlocks() - mem_base);
40202             test_ret++;
40203             printf(" %d", n_code);
40204             printf("\n");
40205         }
40206     }
40207     function_tests++;
40208 #endif
40209
40210     return(test_ret);
40211 }
40212
40213
40214 static int
40215 test_xmlUCSIsGreekandCoptic(void) {
40216     int test_ret = 0;
40217
40218 #if defined(LIBXML_UNICODE_ENABLED)
40219     int mem_base;
40220     int ret_val;
40221     int code; /* UCS code point */
40222     int n_code;
40223
40224     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40225         mem_base = xmlMemBlocks();
40226         code = gen_int(n_code, 0);
40227
40228         ret_val = xmlUCSIsGreekandCoptic(code);
40229         desret_int(ret_val);
40230         call_tests++;
40231         des_int(n_code, code, 0);
40232         xmlResetLastError();
40233         if (mem_base != xmlMemBlocks()) {
40234             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
40235                    xmlMemBlocks() - mem_base);
40236             test_ret++;
40237             printf(" %d", n_code);
40238             printf("\n");
40239         }
40240     }
40241     function_tests++;
40242 #endif
40243
40244     return(test_ret);
40245 }
40246
40247
40248 static int
40249 test_xmlUCSIsGujarati(void) {
40250     int test_ret = 0;
40251
40252 #if defined(LIBXML_UNICODE_ENABLED)
40253     int mem_base;
40254     int ret_val;
40255     int code; /* UCS code point */
40256     int n_code;
40257
40258     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40259         mem_base = xmlMemBlocks();
40260         code = gen_int(n_code, 0);
40261
40262         ret_val = xmlUCSIsGujarati(code);
40263         desret_int(ret_val);
40264         call_tests++;
40265         des_int(n_code, code, 0);
40266         xmlResetLastError();
40267         if (mem_base != xmlMemBlocks()) {
40268             printf("Leak of %d blocks found in xmlUCSIsGujarati",
40269                    xmlMemBlocks() - mem_base);
40270             test_ret++;
40271             printf(" %d", n_code);
40272             printf("\n");
40273         }
40274     }
40275     function_tests++;
40276 #endif
40277
40278     return(test_ret);
40279 }
40280
40281
40282 static int
40283 test_xmlUCSIsGurmukhi(void) {
40284     int test_ret = 0;
40285
40286 #if defined(LIBXML_UNICODE_ENABLED)
40287     int mem_base;
40288     int ret_val;
40289     int code; /* UCS code point */
40290     int n_code;
40291
40292     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40293         mem_base = xmlMemBlocks();
40294         code = gen_int(n_code, 0);
40295
40296         ret_val = xmlUCSIsGurmukhi(code);
40297         desret_int(ret_val);
40298         call_tests++;
40299         des_int(n_code, code, 0);
40300         xmlResetLastError();
40301         if (mem_base != xmlMemBlocks()) {
40302             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40303                    xmlMemBlocks() - mem_base);
40304             test_ret++;
40305             printf(" %d", n_code);
40306             printf("\n");
40307         }
40308     }
40309     function_tests++;
40310 #endif
40311
40312     return(test_ret);
40313 }
40314
40315
40316 static int
40317 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40318     int test_ret = 0;
40319
40320 #if defined(LIBXML_UNICODE_ENABLED)
40321     int mem_base;
40322     int ret_val;
40323     int code; /* UCS code point */
40324     int n_code;
40325
40326     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40327         mem_base = xmlMemBlocks();
40328         code = gen_int(n_code, 0);
40329
40330         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40331         desret_int(ret_val);
40332         call_tests++;
40333         des_int(n_code, code, 0);
40334         xmlResetLastError();
40335         if (mem_base != xmlMemBlocks()) {
40336             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40337                    xmlMemBlocks() - mem_base);
40338             test_ret++;
40339             printf(" %d", n_code);
40340             printf("\n");
40341         }
40342     }
40343     function_tests++;
40344 #endif
40345
40346     return(test_ret);
40347 }
40348
40349
40350 static int
40351 test_xmlUCSIsHangulCompatibilityJamo(void) {
40352     int test_ret = 0;
40353
40354 #if defined(LIBXML_UNICODE_ENABLED)
40355     int mem_base;
40356     int ret_val;
40357     int code; /* UCS code point */
40358     int n_code;
40359
40360     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40361         mem_base = xmlMemBlocks();
40362         code = gen_int(n_code, 0);
40363
40364         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40365         desret_int(ret_val);
40366         call_tests++;
40367         des_int(n_code, code, 0);
40368         xmlResetLastError();
40369         if (mem_base != xmlMemBlocks()) {
40370             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40371                    xmlMemBlocks() - mem_base);
40372             test_ret++;
40373             printf(" %d", n_code);
40374             printf("\n");
40375         }
40376     }
40377     function_tests++;
40378 #endif
40379
40380     return(test_ret);
40381 }
40382
40383
40384 static int
40385 test_xmlUCSIsHangulJamo(void) {
40386     int test_ret = 0;
40387
40388 #if defined(LIBXML_UNICODE_ENABLED)
40389     int mem_base;
40390     int ret_val;
40391     int code; /* UCS code point */
40392     int n_code;
40393
40394     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40395         mem_base = xmlMemBlocks();
40396         code = gen_int(n_code, 0);
40397
40398         ret_val = xmlUCSIsHangulJamo(code);
40399         desret_int(ret_val);
40400         call_tests++;
40401         des_int(n_code, code, 0);
40402         xmlResetLastError();
40403         if (mem_base != xmlMemBlocks()) {
40404             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40405                    xmlMemBlocks() - mem_base);
40406             test_ret++;
40407             printf(" %d", n_code);
40408             printf("\n");
40409         }
40410     }
40411     function_tests++;
40412 #endif
40413
40414     return(test_ret);
40415 }
40416
40417
40418 static int
40419 test_xmlUCSIsHangulSyllables(void) {
40420     int test_ret = 0;
40421
40422 #if defined(LIBXML_UNICODE_ENABLED)
40423     int mem_base;
40424     int ret_val;
40425     int code; /* UCS code point */
40426     int n_code;
40427
40428     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40429         mem_base = xmlMemBlocks();
40430         code = gen_int(n_code, 0);
40431
40432         ret_val = xmlUCSIsHangulSyllables(code);
40433         desret_int(ret_val);
40434         call_tests++;
40435         des_int(n_code, code, 0);
40436         xmlResetLastError();
40437         if (mem_base != xmlMemBlocks()) {
40438             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40439                    xmlMemBlocks() - mem_base);
40440             test_ret++;
40441             printf(" %d", n_code);
40442             printf("\n");
40443         }
40444     }
40445     function_tests++;
40446 #endif
40447
40448     return(test_ret);
40449 }
40450
40451
40452 static int
40453 test_xmlUCSIsHanunoo(void) {
40454     int test_ret = 0;
40455
40456 #if defined(LIBXML_UNICODE_ENABLED)
40457     int mem_base;
40458     int ret_val;
40459     int code; /* UCS code point */
40460     int n_code;
40461
40462     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40463         mem_base = xmlMemBlocks();
40464         code = gen_int(n_code, 0);
40465
40466         ret_val = xmlUCSIsHanunoo(code);
40467         desret_int(ret_val);
40468         call_tests++;
40469         des_int(n_code, code, 0);
40470         xmlResetLastError();
40471         if (mem_base != xmlMemBlocks()) {
40472             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40473                    xmlMemBlocks() - mem_base);
40474             test_ret++;
40475             printf(" %d", n_code);
40476             printf("\n");
40477         }
40478     }
40479     function_tests++;
40480 #endif
40481
40482     return(test_ret);
40483 }
40484
40485
40486 static int
40487 test_xmlUCSIsHebrew(void) {
40488     int test_ret = 0;
40489
40490 #if defined(LIBXML_UNICODE_ENABLED)
40491     int mem_base;
40492     int ret_val;
40493     int code; /* UCS code point */
40494     int n_code;
40495
40496     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40497         mem_base = xmlMemBlocks();
40498         code = gen_int(n_code, 0);
40499
40500         ret_val = xmlUCSIsHebrew(code);
40501         desret_int(ret_val);
40502         call_tests++;
40503         des_int(n_code, code, 0);
40504         xmlResetLastError();
40505         if (mem_base != xmlMemBlocks()) {
40506             printf("Leak of %d blocks found in xmlUCSIsHebrew",
40507                    xmlMemBlocks() - mem_base);
40508             test_ret++;
40509             printf(" %d", n_code);
40510             printf("\n");
40511         }
40512     }
40513     function_tests++;
40514 #endif
40515
40516     return(test_ret);
40517 }
40518
40519
40520 static int
40521 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40522     int test_ret = 0;
40523
40524 #if defined(LIBXML_UNICODE_ENABLED)
40525     int mem_base;
40526     int ret_val;
40527     int code; /* UCS code point */
40528     int n_code;
40529
40530     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40531         mem_base = xmlMemBlocks();
40532         code = gen_int(n_code, 0);
40533
40534         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40535         desret_int(ret_val);
40536         call_tests++;
40537         des_int(n_code, code, 0);
40538         xmlResetLastError();
40539         if (mem_base != xmlMemBlocks()) {
40540             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40541                    xmlMemBlocks() - mem_base);
40542             test_ret++;
40543             printf(" %d", n_code);
40544             printf("\n");
40545         }
40546     }
40547     function_tests++;
40548 #endif
40549
40550     return(test_ret);
40551 }
40552
40553
40554 static int
40555 test_xmlUCSIsHighSurrogates(void) {
40556     int test_ret = 0;
40557
40558 #if defined(LIBXML_UNICODE_ENABLED)
40559     int mem_base;
40560     int ret_val;
40561     int code; /* UCS code point */
40562     int n_code;
40563
40564     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40565         mem_base = xmlMemBlocks();
40566         code = gen_int(n_code, 0);
40567
40568         ret_val = xmlUCSIsHighSurrogates(code);
40569         desret_int(ret_val);
40570         call_tests++;
40571         des_int(n_code, code, 0);
40572         xmlResetLastError();
40573         if (mem_base != xmlMemBlocks()) {
40574             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40575                    xmlMemBlocks() - mem_base);
40576             test_ret++;
40577             printf(" %d", n_code);
40578             printf("\n");
40579         }
40580     }
40581     function_tests++;
40582 #endif
40583
40584     return(test_ret);
40585 }
40586
40587
40588 static int
40589 test_xmlUCSIsHiragana(void) {
40590     int test_ret = 0;
40591
40592 #if defined(LIBXML_UNICODE_ENABLED)
40593     int mem_base;
40594     int ret_val;
40595     int code; /* UCS code point */
40596     int n_code;
40597
40598     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40599         mem_base = xmlMemBlocks();
40600         code = gen_int(n_code, 0);
40601
40602         ret_val = xmlUCSIsHiragana(code);
40603         desret_int(ret_val);
40604         call_tests++;
40605         des_int(n_code, code, 0);
40606         xmlResetLastError();
40607         if (mem_base != xmlMemBlocks()) {
40608             printf("Leak of %d blocks found in xmlUCSIsHiragana",
40609                    xmlMemBlocks() - mem_base);
40610             test_ret++;
40611             printf(" %d", n_code);
40612             printf("\n");
40613         }
40614     }
40615     function_tests++;
40616 #endif
40617
40618     return(test_ret);
40619 }
40620
40621
40622 static int
40623 test_xmlUCSIsIPAExtensions(void) {
40624     int test_ret = 0;
40625
40626 #if defined(LIBXML_UNICODE_ENABLED)
40627     int mem_base;
40628     int ret_val;
40629     int code; /* UCS code point */
40630     int n_code;
40631
40632     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40633         mem_base = xmlMemBlocks();
40634         code = gen_int(n_code, 0);
40635
40636         ret_val = xmlUCSIsIPAExtensions(code);
40637         desret_int(ret_val);
40638         call_tests++;
40639         des_int(n_code, code, 0);
40640         xmlResetLastError();
40641         if (mem_base != xmlMemBlocks()) {
40642             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40643                    xmlMemBlocks() - mem_base);
40644             test_ret++;
40645             printf(" %d", n_code);
40646             printf("\n");
40647         }
40648     }
40649     function_tests++;
40650 #endif
40651
40652     return(test_ret);
40653 }
40654
40655
40656 static int
40657 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40658     int test_ret = 0;
40659
40660 #if defined(LIBXML_UNICODE_ENABLED)
40661     int mem_base;
40662     int ret_val;
40663     int code; /* UCS code point */
40664     int n_code;
40665
40666     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40667         mem_base = xmlMemBlocks();
40668         code = gen_int(n_code, 0);
40669
40670         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40671         desret_int(ret_val);
40672         call_tests++;
40673         des_int(n_code, code, 0);
40674         xmlResetLastError();
40675         if (mem_base != xmlMemBlocks()) {
40676             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40677                    xmlMemBlocks() - mem_base);
40678             test_ret++;
40679             printf(" %d", n_code);
40680             printf("\n");
40681         }
40682     }
40683     function_tests++;
40684 #endif
40685
40686     return(test_ret);
40687 }
40688
40689
40690 static int
40691 test_xmlUCSIsKanbun(void) {
40692     int test_ret = 0;
40693
40694 #if defined(LIBXML_UNICODE_ENABLED)
40695     int mem_base;
40696     int ret_val;
40697     int code; /* UCS code point */
40698     int n_code;
40699
40700     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40701         mem_base = xmlMemBlocks();
40702         code = gen_int(n_code, 0);
40703
40704         ret_val = xmlUCSIsKanbun(code);
40705         desret_int(ret_val);
40706         call_tests++;
40707         des_int(n_code, code, 0);
40708         xmlResetLastError();
40709         if (mem_base != xmlMemBlocks()) {
40710             printf("Leak of %d blocks found in xmlUCSIsKanbun",
40711                    xmlMemBlocks() - mem_base);
40712             test_ret++;
40713             printf(" %d", n_code);
40714             printf("\n");
40715         }
40716     }
40717     function_tests++;
40718 #endif
40719
40720     return(test_ret);
40721 }
40722
40723
40724 static int
40725 test_xmlUCSIsKangxiRadicals(void) {
40726     int test_ret = 0;
40727
40728 #if defined(LIBXML_UNICODE_ENABLED)
40729     int mem_base;
40730     int ret_val;
40731     int code; /* UCS code point */
40732     int n_code;
40733
40734     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40735         mem_base = xmlMemBlocks();
40736         code = gen_int(n_code, 0);
40737
40738         ret_val = xmlUCSIsKangxiRadicals(code);
40739         desret_int(ret_val);
40740         call_tests++;
40741         des_int(n_code, code, 0);
40742         xmlResetLastError();
40743         if (mem_base != xmlMemBlocks()) {
40744             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40745                    xmlMemBlocks() - mem_base);
40746             test_ret++;
40747             printf(" %d", n_code);
40748             printf("\n");
40749         }
40750     }
40751     function_tests++;
40752 #endif
40753
40754     return(test_ret);
40755 }
40756
40757
40758 static int
40759 test_xmlUCSIsKannada(void) {
40760     int test_ret = 0;
40761
40762 #if defined(LIBXML_UNICODE_ENABLED)
40763     int mem_base;
40764     int ret_val;
40765     int code; /* UCS code point */
40766     int n_code;
40767
40768     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40769         mem_base = xmlMemBlocks();
40770         code = gen_int(n_code, 0);
40771
40772         ret_val = xmlUCSIsKannada(code);
40773         desret_int(ret_val);
40774         call_tests++;
40775         des_int(n_code, code, 0);
40776         xmlResetLastError();
40777         if (mem_base != xmlMemBlocks()) {
40778             printf("Leak of %d blocks found in xmlUCSIsKannada",
40779                    xmlMemBlocks() - mem_base);
40780             test_ret++;
40781             printf(" %d", n_code);
40782             printf("\n");
40783         }
40784     }
40785     function_tests++;
40786 #endif
40787
40788     return(test_ret);
40789 }
40790
40791
40792 static int
40793 test_xmlUCSIsKatakana(void) {
40794     int test_ret = 0;
40795
40796 #if defined(LIBXML_UNICODE_ENABLED)
40797     int mem_base;
40798     int ret_val;
40799     int code; /* UCS code point */
40800     int n_code;
40801
40802     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40803         mem_base = xmlMemBlocks();
40804         code = gen_int(n_code, 0);
40805
40806         ret_val = xmlUCSIsKatakana(code);
40807         desret_int(ret_val);
40808         call_tests++;
40809         des_int(n_code, code, 0);
40810         xmlResetLastError();
40811         if (mem_base != xmlMemBlocks()) {
40812             printf("Leak of %d blocks found in xmlUCSIsKatakana",
40813                    xmlMemBlocks() - mem_base);
40814             test_ret++;
40815             printf(" %d", n_code);
40816             printf("\n");
40817         }
40818     }
40819     function_tests++;
40820 #endif
40821
40822     return(test_ret);
40823 }
40824
40825
40826 static int
40827 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40828     int test_ret = 0;
40829
40830 #if defined(LIBXML_UNICODE_ENABLED)
40831     int mem_base;
40832     int ret_val;
40833     int code; /* UCS code point */
40834     int n_code;
40835
40836     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40837         mem_base = xmlMemBlocks();
40838         code = gen_int(n_code, 0);
40839
40840         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40841         desret_int(ret_val);
40842         call_tests++;
40843         des_int(n_code, code, 0);
40844         xmlResetLastError();
40845         if (mem_base != xmlMemBlocks()) {
40846             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40847                    xmlMemBlocks() - mem_base);
40848             test_ret++;
40849             printf(" %d", n_code);
40850             printf("\n");
40851         }
40852     }
40853     function_tests++;
40854 #endif
40855
40856     return(test_ret);
40857 }
40858
40859
40860 static int
40861 test_xmlUCSIsKhmer(void) {
40862     int test_ret = 0;
40863
40864 #if defined(LIBXML_UNICODE_ENABLED)
40865     int mem_base;
40866     int ret_val;
40867     int code; /* UCS code point */
40868     int n_code;
40869
40870     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40871         mem_base = xmlMemBlocks();
40872         code = gen_int(n_code, 0);
40873
40874         ret_val = xmlUCSIsKhmer(code);
40875         desret_int(ret_val);
40876         call_tests++;
40877         des_int(n_code, code, 0);
40878         xmlResetLastError();
40879         if (mem_base != xmlMemBlocks()) {
40880             printf("Leak of %d blocks found in xmlUCSIsKhmer",
40881                    xmlMemBlocks() - mem_base);
40882             test_ret++;
40883             printf(" %d", n_code);
40884             printf("\n");
40885         }
40886     }
40887     function_tests++;
40888 #endif
40889
40890     return(test_ret);
40891 }
40892
40893
40894 static int
40895 test_xmlUCSIsKhmerSymbols(void) {
40896     int test_ret = 0;
40897
40898 #if defined(LIBXML_UNICODE_ENABLED)
40899     int mem_base;
40900     int ret_val;
40901     int code; /* UCS code point */
40902     int n_code;
40903
40904     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40905         mem_base = xmlMemBlocks();
40906         code = gen_int(n_code, 0);
40907
40908         ret_val = xmlUCSIsKhmerSymbols(code);
40909         desret_int(ret_val);
40910         call_tests++;
40911         des_int(n_code, code, 0);
40912         xmlResetLastError();
40913         if (mem_base != xmlMemBlocks()) {
40914             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40915                    xmlMemBlocks() - mem_base);
40916             test_ret++;
40917             printf(" %d", n_code);
40918             printf("\n");
40919         }
40920     }
40921     function_tests++;
40922 #endif
40923
40924     return(test_ret);
40925 }
40926
40927
40928 static int
40929 test_xmlUCSIsLao(void) {
40930     int test_ret = 0;
40931
40932 #if defined(LIBXML_UNICODE_ENABLED)
40933     int mem_base;
40934     int ret_val;
40935     int code; /* UCS code point */
40936     int n_code;
40937
40938     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40939         mem_base = xmlMemBlocks();
40940         code = gen_int(n_code, 0);
40941
40942         ret_val = xmlUCSIsLao(code);
40943         desret_int(ret_val);
40944         call_tests++;
40945         des_int(n_code, code, 0);
40946         xmlResetLastError();
40947         if (mem_base != xmlMemBlocks()) {
40948             printf("Leak of %d blocks found in xmlUCSIsLao",
40949                    xmlMemBlocks() - mem_base);
40950             test_ret++;
40951             printf(" %d", n_code);
40952             printf("\n");
40953         }
40954     }
40955     function_tests++;
40956 #endif
40957
40958     return(test_ret);
40959 }
40960
40961
40962 static int
40963 test_xmlUCSIsLatin1Supplement(void) {
40964     int test_ret = 0;
40965
40966 #if defined(LIBXML_UNICODE_ENABLED)
40967     int mem_base;
40968     int ret_val;
40969     int code; /* UCS code point */
40970     int n_code;
40971
40972     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40973         mem_base = xmlMemBlocks();
40974         code = gen_int(n_code, 0);
40975
40976         ret_val = xmlUCSIsLatin1Supplement(code);
40977         desret_int(ret_val);
40978         call_tests++;
40979         des_int(n_code, code, 0);
40980         xmlResetLastError();
40981         if (mem_base != xmlMemBlocks()) {
40982             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40983                    xmlMemBlocks() - mem_base);
40984             test_ret++;
40985             printf(" %d", n_code);
40986             printf("\n");
40987         }
40988     }
40989     function_tests++;
40990 #endif
40991
40992     return(test_ret);
40993 }
40994
40995
40996 static int
40997 test_xmlUCSIsLatinExtendedA(void) {
40998     int test_ret = 0;
40999
41000 #if defined(LIBXML_UNICODE_ENABLED)
41001     int mem_base;
41002     int ret_val;
41003     int code; /* UCS code point */
41004     int n_code;
41005
41006     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41007         mem_base = xmlMemBlocks();
41008         code = gen_int(n_code, 0);
41009
41010         ret_val = xmlUCSIsLatinExtendedA(code);
41011         desret_int(ret_val);
41012         call_tests++;
41013         des_int(n_code, code, 0);
41014         xmlResetLastError();
41015         if (mem_base != xmlMemBlocks()) {
41016             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
41017                    xmlMemBlocks() - mem_base);
41018             test_ret++;
41019             printf(" %d", n_code);
41020             printf("\n");
41021         }
41022     }
41023     function_tests++;
41024 #endif
41025
41026     return(test_ret);
41027 }
41028
41029
41030 static int
41031 test_xmlUCSIsLatinExtendedAdditional(void) {
41032     int test_ret = 0;
41033
41034 #if defined(LIBXML_UNICODE_ENABLED)
41035     int mem_base;
41036     int ret_val;
41037     int code; /* UCS code point */
41038     int n_code;
41039
41040     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41041         mem_base = xmlMemBlocks();
41042         code = gen_int(n_code, 0);
41043
41044         ret_val = xmlUCSIsLatinExtendedAdditional(code);
41045         desret_int(ret_val);
41046         call_tests++;
41047         des_int(n_code, code, 0);
41048         xmlResetLastError();
41049         if (mem_base != xmlMemBlocks()) {
41050             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
41051                    xmlMemBlocks() - mem_base);
41052             test_ret++;
41053             printf(" %d", n_code);
41054             printf("\n");
41055         }
41056     }
41057     function_tests++;
41058 #endif
41059
41060     return(test_ret);
41061 }
41062
41063
41064 static int
41065 test_xmlUCSIsLatinExtendedB(void) {
41066     int test_ret = 0;
41067
41068 #if defined(LIBXML_UNICODE_ENABLED)
41069     int mem_base;
41070     int ret_val;
41071     int code; /* UCS code point */
41072     int n_code;
41073
41074     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41075         mem_base = xmlMemBlocks();
41076         code = gen_int(n_code, 0);
41077
41078         ret_val = xmlUCSIsLatinExtendedB(code);
41079         desret_int(ret_val);
41080         call_tests++;
41081         des_int(n_code, code, 0);
41082         xmlResetLastError();
41083         if (mem_base != xmlMemBlocks()) {
41084             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
41085                    xmlMemBlocks() - mem_base);
41086             test_ret++;
41087             printf(" %d", n_code);
41088             printf("\n");
41089         }
41090     }
41091     function_tests++;
41092 #endif
41093
41094     return(test_ret);
41095 }
41096
41097
41098 static int
41099 test_xmlUCSIsLetterlikeSymbols(void) {
41100     int test_ret = 0;
41101
41102 #if defined(LIBXML_UNICODE_ENABLED)
41103     int mem_base;
41104     int ret_val;
41105     int code; /* UCS code point */
41106     int n_code;
41107
41108     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41109         mem_base = xmlMemBlocks();
41110         code = gen_int(n_code, 0);
41111
41112         ret_val = xmlUCSIsLetterlikeSymbols(code);
41113         desret_int(ret_val);
41114         call_tests++;
41115         des_int(n_code, code, 0);
41116         xmlResetLastError();
41117         if (mem_base != xmlMemBlocks()) {
41118             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
41119                    xmlMemBlocks() - mem_base);
41120             test_ret++;
41121             printf(" %d", n_code);
41122             printf("\n");
41123         }
41124     }
41125     function_tests++;
41126 #endif
41127
41128     return(test_ret);
41129 }
41130
41131
41132 static int
41133 test_xmlUCSIsLimbu(void) {
41134     int test_ret = 0;
41135
41136 #if defined(LIBXML_UNICODE_ENABLED)
41137     int mem_base;
41138     int ret_val;
41139     int code; /* UCS code point */
41140     int n_code;
41141
41142     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41143         mem_base = xmlMemBlocks();
41144         code = gen_int(n_code, 0);
41145
41146         ret_val = xmlUCSIsLimbu(code);
41147         desret_int(ret_val);
41148         call_tests++;
41149         des_int(n_code, code, 0);
41150         xmlResetLastError();
41151         if (mem_base != xmlMemBlocks()) {
41152             printf("Leak of %d blocks found in xmlUCSIsLimbu",
41153                    xmlMemBlocks() - mem_base);
41154             test_ret++;
41155             printf(" %d", n_code);
41156             printf("\n");
41157         }
41158     }
41159     function_tests++;
41160 #endif
41161
41162     return(test_ret);
41163 }
41164
41165
41166 static int
41167 test_xmlUCSIsLinearBIdeograms(void) {
41168     int test_ret = 0;
41169
41170 #if defined(LIBXML_UNICODE_ENABLED)
41171     int mem_base;
41172     int ret_val;
41173     int code; /* UCS code point */
41174     int n_code;
41175
41176     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41177         mem_base = xmlMemBlocks();
41178         code = gen_int(n_code, 0);
41179
41180         ret_val = xmlUCSIsLinearBIdeograms(code);
41181         desret_int(ret_val);
41182         call_tests++;
41183         des_int(n_code, code, 0);
41184         xmlResetLastError();
41185         if (mem_base != xmlMemBlocks()) {
41186             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
41187                    xmlMemBlocks() - mem_base);
41188             test_ret++;
41189             printf(" %d", n_code);
41190             printf("\n");
41191         }
41192     }
41193     function_tests++;
41194 #endif
41195
41196     return(test_ret);
41197 }
41198
41199
41200 static int
41201 test_xmlUCSIsLinearBSyllabary(void) {
41202     int test_ret = 0;
41203
41204 #if defined(LIBXML_UNICODE_ENABLED)
41205     int mem_base;
41206     int ret_val;
41207     int code; /* UCS code point */
41208     int n_code;
41209
41210     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41211         mem_base = xmlMemBlocks();
41212         code = gen_int(n_code, 0);
41213
41214         ret_val = xmlUCSIsLinearBSyllabary(code);
41215         desret_int(ret_val);
41216         call_tests++;
41217         des_int(n_code, code, 0);
41218         xmlResetLastError();
41219         if (mem_base != xmlMemBlocks()) {
41220             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
41221                    xmlMemBlocks() - mem_base);
41222             test_ret++;
41223             printf(" %d", n_code);
41224             printf("\n");
41225         }
41226     }
41227     function_tests++;
41228 #endif
41229
41230     return(test_ret);
41231 }
41232
41233
41234 static int
41235 test_xmlUCSIsLowSurrogates(void) {
41236     int test_ret = 0;
41237
41238 #if defined(LIBXML_UNICODE_ENABLED)
41239     int mem_base;
41240     int ret_val;
41241     int code; /* UCS code point */
41242     int n_code;
41243
41244     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41245         mem_base = xmlMemBlocks();
41246         code = gen_int(n_code, 0);
41247
41248         ret_val = xmlUCSIsLowSurrogates(code);
41249         desret_int(ret_val);
41250         call_tests++;
41251         des_int(n_code, code, 0);
41252         xmlResetLastError();
41253         if (mem_base != xmlMemBlocks()) {
41254             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
41255                    xmlMemBlocks() - mem_base);
41256             test_ret++;
41257             printf(" %d", n_code);
41258             printf("\n");
41259         }
41260     }
41261     function_tests++;
41262 #endif
41263
41264     return(test_ret);
41265 }
41266
41267
41268 static int
41269 test_xmlUCSIsMalayalam(void) {
41270     int test_ret = 0;
41271
41272 #if defined(LIBXML_UNICODE_ENABLED)
41273     int mem_base;
41274     int ret_val;
41275     int code; /* UCS code point */
41276     int n_code;
41277
41278     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41279         mem_base = xmlMemBlocks();
41280         code = gen_int(n_code, 0);
41281
41282         ret_val = xmlUCSIsMalayalam(code);
41283         desret_int(ret_val);
41284         call_tests++;
41285         des_int(n_code, code, 0);
41286         xmlResetLastError();
41287         if (mem_base != xmlMemBlocks()) {
41288             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41289                    xmlMemBlocks() - mem_base);
41290             test_ret++;
41291             printf(" %d", n_code);
41292             printf("\n");
41293         }
41294     }
41295     function_tests++;
41296 #endif
41297
41298     return(test_ret);
41299 }
41300
41301
41302 static int
41303 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41304     int test_ret = 0;
41305
41306 #if defined(LIBXML_UNICODE_ENABLED)
41307     int mem_base;
41308     int ret_val;
41309     int code; /* UCS code point */
41310     int n_code;
41311
41312     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41313         mem_base = xmlMemBlocks();
41314         code = gen_int(n_code, 0);
41315
41316         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41317         desret_int(ret_val);
41318         call_tests++;
41319         des_int(n_code, code, 0);
41320         xmlResetLastError();
41321         if (mem_base != xmlMemBlocks()) {
41322             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41323                    xmlMemBlocks() - mem_base);
41324             test_ret++;
41325             printf(" %d", n_code);
41326             printf("\n");
41327         }
41328     }
41329     function_tests++;
41330 #endif
41331
41332     return(test_ret);
41333 }
41334
41335
41336 static int
41337 test_xmlUCSIsMathematicalOperators(void) {
41338     int test_ret = 0;
41339
41340 #if defined(LIBXML_UNICODE_ENABLED)
41341     int mem_base;
41342     int ret_val;
41343     int code; /* UCS code point */
41344     int n_code;
41345
41346     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41347         mem_base = xmlMemBlocks();
41348         code = gen_int(n_code, 0);
41349
41350         ret_val = xmlUCSIsMathematicalOperators(code);
41351         desret_int(ret_val);
41352         call_tests++;
41353         des_int(n_code, code, 0);
41354         xmlResetLastError();
41355         if (mem_base != xmlMemBlocks()) {
41356             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41357                    xmlMemBlocks() - mem_base);
41358             test_ret++;
41359             printf(" %d", n_code);
41360             printf("\n");
41361         }
41362     }
41363     function_tests++;
41364 #endif
41365
41366     return(test_ret);
41367 }
41368
41369
41370 static int
41371 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41372     int test_ret = 0;
41373
41374 #if defined(LIBXML_UNICODE_ENABLED)
41375     int mem_base;
41376     int ret_val;
41377     int code; /* UCS code point */
41378     int n_code;
41379
41380     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41381         mem_base = xmlMemBlocks();
41382         code = gen_int(n_code, 0);
41383
41384         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41385         desret_int(ret_val);
41386         call_tests++;
41387         des_int(n_code, code, 0);
41388         xmlResetLastError();
41389         if (mem_base != xmlMemBlocks()) {
41390             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41391                    xmlMemBlocks() - mem_base);
41392             test_ret++;
41393             printf(" %d", n_code);
41394             printf("\n");
41395         }
41396     }
41397     function_tests++;
41398 #endif
41399
41400     return(test_ret);
41401 }
41402
41403
41404 static int
41405 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41406     int test_ret = 0;
41407
41408 #if defined(LIBXML_UNICODE_ENABLED)
41409     int mem_base;
41410     int ret_val;
41411     int code; /* UCS code point */
41412     int n_code;
41413
41414     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41415         mem_base = xmlMemBlocks();
41416         code = gen_int(n_code, 0);
41417
41418         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41419         desret_int(ret_val);
41420         call_tests++;
41421         des_int(n_code, code, 0);
41422         xmlResetLastError();
41423         if (mem_base != xmlMemBlocks()) {
41424             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41425                    xmlMemBlocks() - mem_base);
41426             test_ret++;
41427             printf(" %d", n_code);
41428             printf("\n");
41429         }
41430     }
41431     function_tests++;
41432 #endif
41433
41434     return(test_ret);
41435 }
41436
41437
41438 static int
41439 test_xmlUCSIsMiscellaneousSymbols(void) {
41440     int test_ret = 0;
41441
41442 #if defined(LIBXML_UNICODE_ENABLED)
41443     int mem_base;
41444     int ret_val;
41445     int code; /* UCS code point */
41446     int n_code;
41447
41448     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41449         mem_base = xmlMemBlocks();
41450         code = gen_int(n_code, 0);
41451
41452         ret_val = xmlUCSIsMiscellaneousSymbols(code);
41453         desret_int(ret_val);
41454         call_tests++;
41455         des_int(n_code, code, 0);
41456         xmlResetLastError();
41457         if (mem_base != xmlMemBlocks()) {
41458             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41459                    xmlMemBlocks() - mem_base);
41460             test_ret++;
41461             printf(" %d", n_code);
41462             printf("\n");
41463         }
41464     }
41465     function_tests++;
41466 #endif
41467
41468     return(test_ret);
41469 }
41470
41471
41472 static int
41473 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41474     int test_ret = 0;
41475
41476 #if defined(LIBXML_UNICODE_ENABLED)
41477     int mem_base;
41478     int ret_val;
41479     int code; /* UCS code point */
41480     int n_code;
41481
41482     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41483         mem_base = xmlMemBlocks();
41484         code = gen_int(n_code, 0);
41485
41486         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41487         desret_int(ret_val);
41488         call_tests++;
41489         des_int(n_code, code, 0);
41490         xmlResetLastError();
41491         if (mem_base != xmlMemBlocks()) {
41492             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41493                    xmlMemBlocks() - mem_base);
41494             test_ret++;
41495             printf(" %d", n_code);
41496             printf("\n");
41497         }
41498     }
41499     function_tests++;
41500 #endif
41501
41502     return(test_ret);
41503 }
41504
41505
41506 static int
41507 test_xmlUCSIsMiscellaneousTechnical(void) {
41508     int test_ret = 0;
41509
41510 #if defined(LIBXML_UNICODE_ENABLED)
41511     int mem_base;
41512     int ret_val;
41513     int code; /* UCS code point */
41514     int n_code;
41515
41516     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41517         mem_base = xmlMemBlocks();
41518         code = gen_int(n_code, 0);
41519
41520         ret_val = xmlUCSIsMiscellaneousTechnical(code);
41521         desret_int(ret_val);
41522         call_tests++;
41523         des_int(n_code, code, 0);
41524         xmlResetLastError();
41525         if (mem_base != xmlMemBlocks()) {
41526             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41527                    xmlMemBlocks() - mem_base);
41528             test_ret++;
41529             printf(" %d", n_code);
41530             printf("\n");
41531         }
41532     }
41533     function_tests++;
41534 #endif
41535
41536     return(test_ret);
41537 }
41538
41539
41540 static int
41541 test_xmlUCSIsMongolian(void) {
41542     int test_ret = 0;
41543
41544 #if defined(LIBXML_UNICODE_ENABLED)
41545     int mem_base;
41546     int ret_val;
41547     int code; /* UCS code point */
41548     int n_code;
41549
41550     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41551         mem_base = xmlMemBlocks();
41552         code = gen_int(n_code, 0);
41553
41554         ret_val = xmlUCSIsMongolian(code);
41555         desret_int(ret_val);
41556         call_tests++;
41557         des_int(n_code, code, 0);
41558         xmlResetLastError();
41559         if (mem_base != xmlMemBlocks()) {
41560             printf("Leak of %d blocks found in xmlUCSIsMongolian",
41561                    xmlMemBlocks() - mem_base);
41562             test_ret++;
41563             printf(" %d", n_code);
41564             printf("\n");
41565         }
41566     }
41567     function_tests++;
41568 #endif
41569
41570     return(test_ret);
41571 }
41572
41573
41574 static int
41575 test_xmlUCSIsMusicalSymbols(void) {
41576     int test_ret = 0;
41577
41578 #if defined(LIBXML_UNICODE_ENABLED)
41579     int mem_base;
41580     int ret_val;
41581     int code; /* UCS code point */
41582     int n_code;
41583
41584     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41585         mem_base = xmlMemBlocks();
41586         code = gen_int(n_code, 0);
41587
41588         ret_val = xmlUCSIsMusicalSymbols(code);
41589         desret_int(ret_val);
41590         call_tests++;
41591         des_int(n_code, code, 0);
41592         xmlResetLastError();
41593         if (mem_base != xmlMemBlocks()) {
41594             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41595                    xmlMemBlocks() - mem_base);
41596             test_ret++;
41597             printf(" %d", n_code);
41598             printf("\n");
41599         }
41600     }
41601     function_tests++;
41602 #endif
41603
41604     return(test_ret);
41605 }
41606
41607
41608 static int
41609 test_xmlUCSIsMyanmar(void) {
41610     int test_ret = 0;
41611
41612 #if defined(LIBXML_UNICODE_ENABLED)
41613     int mem_base;
41614     int ret_val;
41615     int code; /* UCS code point */
41616     int n_code;
41617
41618     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41619         mem_base = xmlMemBlocks();
41620         code = gen_int(n_code, 0);
41621
41622         ret_val = xmlUCSIsMyanmar(code);
41623         desret_int(ret_val);
41624         call_tests++;
41625         des_int(n_code, code, 0);
41626         xmlResetLastError();
41627         if (mem_base != xmlMemBlocks()) {
41628             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41629                    xmlMemBlocks() - mem_base);
41630             test_ret++;
41631             printf(" %d", n_code);
41632             printf("\n");
41633         }
41634     }
41635     function_tests++;
41636 #endif
41637
41638     return(test_ret);
41639 }
41640
41641
41642 static int
41643 test_xmlUCSIsNumberForms(void) {
41644     int test_ret = 0;
41645
41646 #if defined(LIBXML_UNICODE_ENABLED)
41647     int mem_base;
41648     int ret_val;
41649     int code; /* UCS code point */
41650     int n_code;
41651
41652     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41653         mem_base = xmlMemBlocks();
41654         code = gen_int(n_code, 0);
41655
41656         ret_val = xmlUCSIsNumberForms(code);
41657         desret_int(ret_val);
41658         call_tests++;
41659         des_int(n_code, code, 0);
41660         xmlResetLastError();
41661         if (mem_base != xmlMemBlocks()) {
41662             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41663                    xmlMemBlocks() - mem_base);
41664             test_ret++;
41665             printf(" %d", n_code);
41666             printf("\n");
41667         }
41668     }
41669     function_tests++;
41670 #endif
41671
41672     return(test_ret);
41673 }
41674
41675
41676 static int
41677 test_xmlUCSIsOgham(void) {
41678     int test_ret = 0;
41679
41680 #if defined(LIBXML_UNICODE_ENABLED)
41681     int mem_base;
41682     int ret_val;
41683     int code; /* UCS code point */
41684     int n_code;
41685
41686     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41687         mem_base = xmlMemBlocks();
41688         code = gen_int(n_code, 0);
41689
41690         ret_val = xmlUCSIsOgham(code);
41691         desret_int(ret_val);
41692         call_tests++;
41693         des_int(n_code, code, 0);
41694         xmlResetLastError();
41695         if (mem_base != xmlMemBlocks()) {
41696             printf("Leak of %d blocks found in xmlUCSIsOgham",
41697                    xmlMemBlocks() - mem_base);
41698             test_ret++;
41699             printf(" %d", n_code);
41700             printf("\n");
41701         }
41702     }
41703     function_tests++;
41704 #endif
41705
41706     return(test_ret);
41707 }
41708
41709
41710 static int
41711 test_xmlUCSIsOldItalic(void) {
41712     int test_ret = 0;
41713
41714 #if defined(LIBXML_UNICODE_ENABLED)
41715     int mem_base;
41716     int ret_val;
41717     int code; /* UCS code point */
41718     int n_code;
41719
41720     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41721         mem_base = xmlMemBlocks();
41722         code = gen_int(n_code, 0);
41723
41724         ret_val = xmlUCSIsOldItalic(code);
41725         desret_int(ret_val);
41726         call_tests++;
41727         des_int(n_code, code, 0);
41728         xmlResetLastError();
41729         if (mem_base != xmlMemBlocks()) {
41730             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41731                    xmlMemBlocks() - mem_base);
41732             test_ret++;
41733             printf(" %d", n_code);
41734             printf("\n");
41735         }
41736     }
41737     function_tests++;
41738 #endif
41739
41740     return(test_ret);
41741 }
41742
41743
41744 static int
41745 test_xmlUCSIsOpticalCharacterRecognition(void) {
41746     int test_ret = 0;
41747
41748 #if defined(LIBXML_UNICODE_ENABLED)
41749     int mem_base;
41750     int ret_val;
41751     int code; /* UCS code point */
41752     int n_code;
41753
41754     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41755         mem_base = xmlMemBlocks();
41756         code = gen_int(n_code, 0);
41757
41758         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41759         desret_int(ret_val);
41760         call_tests++;
41761         des_int(n_code, code, 0);
41762         xmlResetLastError();
41763         if (mem_base != xmlMemBlocks()) {
41764             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41765                    xmlMemBlocks() - mem_base);
41766             test_ret++;
41767             printf(" %d", n_code);
41768             printf("\n");
41769         }
41770     }
41771     function_tests++;
41772 #endif
41773
41774     return(test_ret);
41775 }
41776
41777
41778 static int
41779 test_xmlUCSIsOriya(void) {
41780     int test_ret = 0;
41781
41782 #if defined(LIBXML_UNICODE_ENABLED)
41783     int mem_base;
41784     int ret_val;
41785     int code; /* UCS code point */
41786     int n_code;
41787
41788     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41789         mem_base = xmlMemBlocks();
41790         code = gen_int(n_code, 0);
41791
41792         ret_val = xmlUCSIsOriya(code);
41793         desret_int(ret_val);
41794         call_tests++;
41795         des_int(n_code, code, 0);
41796         xmlResetLastError();
41797         if (mem_base != xmlMemBlocks()) {
41798             printf("Leak of %d blocks found in xmlUCSIsOriya",
41799                    xmlMemBlocks() - mem_base);
41800             test_ret++;
41801             printf(" %d", n_code);
41802             printf("\n");
41803         }
41804     }
41805     function_tests++;
41806 #endif
41807
41808     return(test_ret);
41809 }
41810
41811
41812 static int
41813 test_xmlUCSIsOsmanya(void) {
41814     int test_ret = 0;
41815
41816 #if defined(LIBXML_UNICODE_ENABLED)
41817     int mem_base;
41818     int ret_val;
41819     int code; /* UCS code point */
41820     int n_code;
41821
41822     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41823         mem_base = xmlMemBlocks();
41824         code = gen_int(n_code, 0);
41825
41826         ret_val = xmlUCSIsOsmanya(code);
41827         desret_int(ret_val);
41828         call_tests++;
41829         des_int(n_code, code, 0);
41830         xmlResetLastError();
41831         if (mem_base != xmlMemBlocks()) {
41832             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41833                    xmlMemBlocks() - mem_base);
41834             test_ret++;
41835             printf(" %d", n_code);
41836             printf("\n");
41837         }
41838     }
41839     function_tests++;
41840 #endif
41841
41842     return(test_ret);
41843 }
41844
41845
41846 static int
41847 test_xmlUCSIsPhoneticExtensions(void) {
41848     int test_ret = 0;
41849
41850 #if defined(LIBXML_UNICODE_ENABLED)
41851     int mem_base;
41852     int ret_val;
41853     int code; /* UCS code point */
41854     int n_code;
41855
41856     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41857         mem_base = xmlMemBlocks();
41858         code = gen_int(n_code, 0);
41859
41860         ret_val = xmlUCSIsPhoneticExtensions(code);
41861         desret_int(ret_val);
41862         call_tests++;
41863         des_int(n_code, code, 0);
41864         xmlResetLastError();
41865         if (mem_base != xmlMemBlocks()) {
41866             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41867                    xmlMemBlocks() - mem_base);
41868             test_ret++;
41869             printf(" %d", n_code);
41870             printf("\n");
41871         }
41872     }
41873     function_tests++;
41874 #endif
41875
41876     return(test_ret);
41877 }
41878
41879
41880 static int
41881 test_xmlUCSIsPrivateUse(void) {
41882     int test_ret = 0;
41883
41884 #if defined(LIBXML_UNICODE_ENABLED)
41885     int mem_base;
41886     int ret_val;
41887     int code; /* UCS code point */
41888     int n_code;
41889
41890     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41891         mem_base = xmlMemBlocks();
41892         code = gen_int(n_code, 0);
41893
41894         ret_val = xmlUCSIsPrivateUse(code);
41895         desret_int(ret_val);
41896         call_tests++;
41897         des_int(n_code, code, 0);
41898         xmlResetLastError();
41899         if (mem_base != xmlMemBlocks()) {
41900             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41901                    xmlMemBlocks() - mem_base);
41902             test_ret++;
41903             printf(" %d", n_code);
41904             printf("\n");
41905         }
41906     }
41907     function_tests++;
41908 #endif
41909
41910     return(test_ret);
41911 }
41912
41913
41914 static int
41915 test_xmlUCSIsPrivateUseArea(void) {
41916     int test_ret = 0;
41917
41918 #if defined(LIBXML_UNICODE_ENABLED)
41919     int mem_base;
41920     int ret_val;
41921     int code; /* UCS code point */
41922     int n_code;
41923
41924     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41925         mem_base = xmlMemBlocks();
41926         code = gen_int(n_code, 0);
41927
41928         ret_val = xmlUCSIsPrivateUseArea(code);
41929         desret_int(ret_val);
41930         call_tests++;
41931         des_int(n_code, code, 0);
41932         xmlResetLastError();
41933         if (mem_base != xmlMemBlocks()) {
41934             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41935                    xmlMemBlocks() - mem_base);
41936             test_ret++;
41937             printf(" %d", n_code);
41938             printf("\n");
41939         }
41940     }
41941     function_tests++;
41942 #endif
41943
41944     return(test_ret);
41945 }
41946
41947
41948 static int
41949 test_xmlUCSIsRunic(void) {
41950     int test_ret = 0;
41951
41952 #if defined(LIBXML_UNICODE_ENABLED)
41953     int mem_base;
41954     int ret_val;
41955     int code; /* UCS code point */
41956     int n_code;
41957
41958     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41959         mem_base = xmlMemBlocks();
41960         code = gen_int(n_code, 0);
41961
41962         ret_val = xmlUCSIsRunic(code);
41963         desret_int(ret_val);
41964         call_tests++;
41965         des_int(n_code, code, 0);
41966         xmlResetLastError();
41967         if (mem_base != xmlMemBlocks()) {
41968             printf("Leak of %d blocks found in xmlUCSIsRunic",
41969                    xmlMemBlocks() - mem_base);
41970             test_ret++;
41971             printf(" %d", n_code);
41972             printf("\n");
41973         }
41974     }
41975     function_tests++;
41976 #endif
41977
41978     return(test_ret);
41979 }
41980
41981
41982 static int
41983 test_xmlUCSIsShavian(void) {
41984     int test_ret = 0;
41985
41986 #if defined(LIBXML_UNICODE_ENABLED)
41987     int mem_base;
41988     int ret_val;
41989     int code; /* UCS code point */
41990     int n_code;
41991
41992     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41993         mem_base = xmlMemBlocks();
41994         code = gen_int(n_code, 0);
41995
41996         ret_val = xmlUCSIsShavian(code);
41997         desret_int(ret_val);
41998         call_tests++;
41999         des_int(n_code, code, 0);
42000         xmlResetLastError();
42001         if (mem_base != xmlMemBlocks()) {
42002             printf("Leak of %d blocks found in xmlUCSIsShavian",
42003                    xmlMemBlocks() - mem_base);
42004             test_ret++;
42005             printf(" %d", n_code);
42006             printf("\n");
42007         }
42008     }
42009     function_tests++;
42010 #endif
42011
42012     return(test_ret);
42013 }
42014
42015
42016 static int
42017 test_xmlUCSIsSinhala(void) {
42018     int test_ret = 0;
42019
42020 #if defined(LIBXML_UNICODE_ENABLED)
42021     int mem_base;
42022     int ret_val;
42023     int code; /* UCS code point */
42024     int n_code;
42025
42026     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42027         mem_base = xmlMemBlocks();
42028         code = gen_int(n_code, 0);
42029
42030         ret_val = xmlUCSIsSinhala(code);
42031         desret_int(ret_val);
42032         call_tests++;
42033         des_int(n_code, code, 0);
42034         xmlResetLastError();
42035         if (mem_base != xmlMemBlocks()) {
42036             printf("Leak of %d blocks found in xmlUCSIsSinhala",
42037                    xmlMemBlocks() - mem_base);
42038             test_ret++;
42039             printf(" %d", n_code);
42040             printf("\n");
42041         }
42042     }
42043     function_tests++;
42044 #endif
42045
42046     return(test_ret);
42047 }
42048
42049
42050 static int
42051 test_xmlUCSIsSmallFormVariants(void) {
42052     int test_ret = 0;
42053
42054 #if defined(LIBXML_UNICODE_ENABLED)
42055     int mem_base;
42056     int ret_val;
42057     int code; /* UCS code point */
42058     int n_code;
42059
42060     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42061         mem_base = xmlMemBlocks();
42062         code = gen_int(n_code, 0);
42063
42064         ret_val = xmlUCSIsSmallFormVariants(code);
42065         desret_int(ret_val);
42066         call_tests++;
42067         des_int(n_code, code, 0);
42068         xmlResetLastError();
42069         if (mem_base != xmlMemBlocks()) {
42070             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
42071                    xmlMemBlocks() - mem_base);
42072             test_ret++;
42073             printf(" %d", n_code);
42074             printf("\n");
42075         }
42076     }
42077     function_tests++;
42078 #endif
42079
42080     return(test_ret);
42081 }
42082
42083
42084 static int
42085 test_xmlUCSIsSpacingModifierLetters(void) {
42086     int test_ret = 0;
42087
42088 #if defined(LIBXML_UNICODE_ENABLED)
42089     int mem_base;
42090     int ret_val;
42091     int code; /* UCS code point */
42092     int n_code;
42093
42094     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42095         mem_base = xmlMemBlocks();
42096         code = gen_int(n_code, 0);
42097
42098         ret_val = xmlUCSIsSpacingModifierLetters(code);
42099         desret_int(ret_val);
42100         call_tests++;
42101         des_int(n_code, code, 0);
42102         xmlResetLastError();
42103         if (mem_base != xmlMemBlocks()) {
42104             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
42105                    xmlMemBlocks() - mem_base);
42106             test_ret++;
42107             printf(" %d", n_code);
42108             printf("\n");
42109         }
42110     }
42111     function_tests++;
42112 #endif
42113
42114     return(test_ret);
42115 }
42116
42117
42118 static int
42119 test_xmlUCSIsSpecials(void) {
42120     int test_ret = 0;
42121
42122 #if defined(LIBXML_UNICODE_ENABLED)
42123     int mem_base;
42124     int ret_val;
42125     int code; /* UCS code point */
42126     int n_code;
42127
42128     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42129         mem_base = xmlMemBlocks();
42130         code = gen_int(n_code, 0);
42131
42132         ret_val = xmlUCSIsSpecials(code);
42133         desret_int(ret_val);
42134         call_tests++;
42135         des_int(n_code, code, 0);
42136         xmlResetLastError();
42137         if (mem_base != xmlMemBlocks()) {
42138             printf("Leak of %d blocks found in xmlUCSIsSpecials",
42139                    xmlMemBlocks() - mem_base);
42140             test_ret++;
42141             printf(" %d", n_code);
42142             printf("\n");
42143         }
42144     }
42145     function_tests++;
42146 #endif
42147
42148     return(test_ret);
42149 }
42150
42151
42152 static int
42153 test_xmlUCSIsSuperscriptsandSubscripts(void) {
42154     int test_ret = 0;
42155
42156 #if defined(LIBXML_UNICODE_ENABLED)
42157     int mem_base;
42158     int ret_val;
42159     int code; /* UCS code point */
42160     int n_code;
42161
42162     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42163         mem_base = xmlMemBlocks();
42164         code = gen_int(n_code, 0);
42165
42166         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
42167         desret_int(ret_val);
42168         call_tests++;
42169         des_int(n_code, code, 0);
42170         xmlResetLastError();
42171         if (mem_base != xmlMemBlocks()) {
42172             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
42173                    xmlMemBlocks() - mem_base);
42174             test_ret++;
42175             printf(" %d", n_code);
42176             printf("\n");
42177         }
42178     }
42179     function_tests++;
42180 #endif
42181
42182     return(test_ret);
42183 }
42184
42185
42186 static int
42187 test_xmlUCSIsSupplementalArrowsA(void) {
42188     int test_ret = 0;
42189
42190 #if defined(LIBXML_UNICODE_ENABLED)
42191     int mem_base;
42192     int ret_val;
42193     int code; /* UCS code point */
42194     int n_code;
42195
42196     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42197         mem_base = xmlMemBlocks();
42198         code = gen_int(n_code, 0);
42199
42200         ret_val = xmlUCSIsSupplementalArrowsA(code);
42201         desret_int(ret_val);
42202         call_tests++;
42203         des_int(n_code, code, 0);
42204         xmlResetLastError();
42205         if (mem_base != xmlMemBlocks()) {
42206             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
42207                    xmlMemBlocks() - mem_base);
42208             test_ret++;
42209             printf(" %d", n_code);
42210             printf("\n");
42211         }
42212     }
42213     function_tests++;
42214 #endif
42215
42216     return(test_ret);
42217 }
42218
42219
42220 static int
42221 test_xmlUCSIsSupplementalArrowsB(void) {
42222     int test_ret = 0;
42223
42224 #if defined(LIBXML_UNICODE_ENABLED)
42225     int mem_base;
42226     int ret_val;
42227     int code; /* UCS code point */
42228     int n_code;
42229
42230     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42231         mem_base = xmlMemBlocks();
42232         code = gen_int(n_code, 0);
42233
42234         ret_val = xmlUCSIsSupplementalArrowsB(code);
42235         desret_int(ret_val);
42236         call_tests++;
42237         des_int(n_code, code, 0);
42238         xmlResetLastError();
42239         if (mem_base != xmlMemBlocks()) {
42240             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
42241                    xmlMemBlocks() - mem_base);
42242             test_ret++;
42243             printf(" %d", n_code);
42244             printf("\n");
42245         }
42246     }
42247     function_tests++;
42248 #endif
42249
42250     return(test_ret);
42251 }
42252
42253
42254 static int
42255 test_xmlUCSIsSupplementalMathematicalOperators(void) {
42256     int test_ret = 0;
42257
42258 #if defined(LIBXML_UNICODE_ENABLED)
42259     int mem_base;
42260     int ret_val;
42261     int code; /* UCS code point */
42262     int n_code;
42263
42264     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42265         mem_base = xmlMemBlocks();
42266         code = gen_int(n_code, 0);
42267
42268         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42269         desret_int(ret_val);
42270         call_tests++;
42271         des_int(n_code, code, 0);
42272         xmlResetLastError();
42273         if (mem_base != xmlMemBlocks()) {
42274             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42275                    xmlMemBlocks() - mem_base);
42276             test_ret++;
42277             printf(" %d", n_code);
42278             printf("\n");
42279         }
42280     }
42281     function_tests++;
42282 #endif
42283
42284     return(test_ret);
42285 }
42286
42287
42288 static int
42289 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42290     int test_ret = 0;
42291
42292 #if defined(LIBXML_UNICODE_ENABLED)
42293     int mem_base;
42294     int ret_val;
42295     int code; /* UCS code point */
42296     int n_code;
42297
42298     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42299         mem_base = xmlMemBlocks();
42300         code = gen_int(n_code, 0);
42301
42302         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42303         desret_int(ret_val);
42304         call_tests++;
42305         des_int(n_code, code, 0);
42306         xmlResetLastError();
42307         if (mem_base != xmlMemBlocks()) {
42308             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42309                    xmlMemBlocks() - mem_base);
42310             test_ret++;
42311             printf(" %d", n_code);
42312             printf("\n");
42313         }
42314     }
42315     function_tests++;
42316 #endif
42317
42318     return(test_ret);
42319 }
42320
42321
42322 static int
42323 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42324     int test_ret = 0;
42325
42326 #if defined(LIBXML_UNICODE_ENABLED)
42327     int mem_base;
42328     int ret_val;
42329     int code; /* UCS code point */
42330     int n_code;
42331
42332     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42333         mem_base = xmlMemBlocks();
42334         code = gen_int(n_code, 0);
42335
42336         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42337         desret_int(ret_val);
42338         call_tests++;
42339         des_int(n_code, code, 0);
42340         xmlResetLastError();
42341         if (mem_base != xmlMemBlocks()) {
42342             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42343                    xmlMemBlocks() - mem_base);
42344             test_ret++;
42345             printf(" %d", n_code);
42346             printf("\n");
42347         }
42348     }
42349     function_tests++;
42350 #endif
42351
42352     return(test_ret);
42353 }
42354
42355
42356 static int
42357 test_xmlUCSIsSyriac(void) {
42358     int test_ret = 0;
42359
42360 #if defined(LIBXML_UNICODE_ENABLED)
42361     int mem_base;
42362     int ret_val;
42363     int code; /* UCS code point */
42364     int n_code;
42365
42366     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42367         mem_base = xmlMemBlocks();
42368         code = gen_int(n_code, 0);
42369
42370         ret_val = xmlUCSIsSyriac(code);
42371         desret_int(ret_val);
42372         call_tests++;
42373         des_int(n_code, code, 0);
42374         xmlResetLastError();
42375         if (mem_base != xmlMemBlocks()) {
42376             printf("Leak of %d blocks found in xmlUCSIsSyriac",
42377                    xmlMemBlocks() - mem_base);
42378             test_ret++;
42379             printf(" %d", n_code);
42380             printf("\n");
42381         }
42382     }
42383     function_tests++;
42384 #endif
42385
42386     return(test_ret);
42387 }
42388
42389
42390 static int
42391 test_xmlUCSIsTagalog(void) {
42392     int test_ret = 0;
42393
42394 #if defined(LIBXML_UNICODE_ENABLED)
42395     int mem_base;
42396     int ret_val;
42397     int code; /* UCS code point */
42398     int n_code;
42399
42400     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42401         mem_base = xmlMemBlocks();
42402         code = gen_int(n_code, 0);
42403
42404         ret_val = xmlUCSIsTagalog(code);
42405         desret_int(ret_val);
42406         call_tests++;
42407         des_int(n_code, code, 0);
42408         xmlResetLastError();
42409         if (mem_base != xmlMemBlocks()) {
42410             printf("Leak of %d blocks found in xmlUCSIsTagalog",
42411                    xmlMemBlocks() - mem_base);
42412             test_ret++;
42413             printf(" %d", n_code);
42414             printf("\n");
42415         }
42416     }
42417     function_tests++;
42418 #endif
42419
42420     return(test_ret);
42421 }
42422
42423
42424 static int
42425 test_xmlUCSIsTagbanwa(void) {
42426     int test_ret = 0;
42427
42428 #if defined(LIBXML_UNICODE_ENABLED)
42429     int mem_base;
42430     int ret_val;
42431     int code; /* UCS code point */
42432     int n_code;
42433
42434     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42435         mem_base = xmlMemBlocks();
42436         code = gen_int(n_code, 0);
42437
42438         ret_val = xmlUCSIsTagbanwa(code);
42439         desret_int(ret_val);
42440         call_tests++;
42441         des_int(n_code, code, 0);
42442         xmlResetLastError();
42443         if (mem_base != xmlMemBlocks()) {
42444             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42445                    xmlMemBlocks() - mem_base);
42446             test_ret++;
42447             printf(" %d", n_code);
42448             printf("\n");
42449         }
42450     }
42451     function_tests++;
42452 #endif
42453
42454     return(test_ret);
42455 }
42456
42457
42458 static int
42459 test_xmlUCSIsTags(void) {
42460     int test_ret = 0;
42461
42462 #if defined(LIBXML_UNICODE_ENABLED)
42463     int mem_base;
42464     int ret_val;
42465     int code; /* UCS code point */
42466     int n_code;
42467
42468     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42469         mem_base = xmlMemBlocks();
42470         code = gen_int(n_code, 0);
42471
42472         ret_val = xmlUCSIsTags(code);
42473         desret_int(ret_val);
42474         call_tests++;
42475         des_int(n_code, code, 0);
42476         xmlResetLastError();
42477         if (mem_base != xmlMemBlocks()) {
42478             printf("Leak of %d blocks found in xmlUCSIsTags",
42479                    xmlMemBlocks() - mem_base);
42480             test_ret++;
42481             printf(" %d", n_code);
42482             printf("\n");
42483         }
42484     }
42485     function_tests++;
42486 #endif
42487
42488     return(test_ret);
42489 }
42490
42491
42492 static int
42493 test_xmlUCSIsTaiLe(void) {
42494     int test_ret = 0;
42495
42496 #if defined(LIBXML_UNICODE_ENABLED)
42497     int mem_base;
42498     int ret_val;
42499     int code; /* UCS code point */
42500     int n_code;
42501
42502     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42503         mem_base = xmlMemBlocks();
42504         code = gen_int(n_code, 0);
42505
42506         ret_val = xmlUCSIsTaiLe(code);
42507         desret_int(ret_val);
42508         call_tests++;
42509         des_int(n_code, code, 0);
42510         xmlResetLastError();
42511         if (mem_base != xmlMemBlocks()) {
42512             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42513                    xmlMemBlocks() - mem_base);
42514             test_ret++;
42515             printf(" %d", n_code);
42516             printf("\n");
42517         }
42518     }
42519     function_tests++;
42520 #endif
42521
42522     return(test_ret);
42523 }
42524
42525
42526 static int
42527 test_xmlUCSIsTaiXuanJingSymbols(void) {
42528     int test_ret = 0;
42529
42530 #if defined(LIBXML_UNICODE_ENABLED)
42531     int mem_base;
42532     int ret_val;
42533     int code; /* UCS code point */
42534     int n_code;
42535
42536     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42537         mem_base = xmlMemBlocks();
42538         code = gen_int(n_code, 0);
42539
42540         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42541         desret_int(ret_val);
42542         call_tests++;
42543         des_int(n_code, code, 0);
42544         xmlResetLastError();
42545         if (mem_base != xmlMemBlocks()) {
42546             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42547                    xmlMemBlocks() - mem_base);
42548             test_ret++;
42549             printf(" %d", n_code);
42550             printf("\n");
42551         }
42552     }
42553     function_tests++;
42554 #endif
42555
42556     return(test_ret);
42557 }
42558
42559
42560 static int
42561 test_xmlUCSIsTamil(void) {
42562     int test_ret = 0;
42563
42564 #if defined(LIBXML_UNICODE_ENABLED)
42565     int mem_base;
42566     int ret_val;
42567     int code; /* UCS code point */
42568     int n_code;
42569
42570     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42571         mem_base = xmlMemBlocks();
42572         code = gen_int(n_code, 0);
42573
42574         ret_val = xmlUCSIsTamil(code);
42575         desret_int(ret_val);
42576         call_tests++;
42577         des_int(n_code, code, 0);
42578         xmlResetLastError();
42579         if (mem_base != xmlMemBlocks()) {
42580             printf("Leak of %d blocks found in xmlUCSIsTamil",
42581                    xmlMemBlocks() - mem_base);
42582             test_ret++;
42583             printf(" %d", n_code);
42584             printf("\n");
42585         }
42586     }
42587     function_tests++;
42588 #endif
42589
42590     return(test_ret);
42591 }
42592
42593
42594 static int
42595 test_xmlUCSIsTelugu(void) {
42596     int test_ret = 0;
42597
42598 #if defined(LIBXML_UNICODE_ENABLED)
42599     int mem_base;
42600     int ret_val;
42601     int code; /* UCS code point */
42602     int n_code;
42603
42604     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42605         mem_base = xmlMemBlocks();
42606         code = gen_int(n_code, 0);
42607
42608         ret_val = xmlUCSIsTelugu(code);
42609         desret_int(ret_val);
42610         call_tests++;
42611         des_int(n_code, code, 0);
42612         xmlResetLastError();
42613         if (mem_base != xmlMemBlocks()) {
42614             printf("Leak of %d blocks found in xmlUCSIsTelugu",
42615                    xmlMemBlocks() - mem_base);
42616             test_ret++;
42617             printf(" %d", n_code);
42618             printf("\n");
42619         }
42620     }
42621     function_tests++;
42622 #endif
42623
42624     return(test_ret);
42625 }
42626
42627
42628 static int
42629 test_xmlUCSIsThaana(void) {
42630     int test_ret = 0;
42631
42632 #if defined(LIBXML_UNICODE_ENABLED)
42633     int mem_base;
42634     int ret_val;
42635     int code; /* UCS code point */
42636     int n_code;
42637
42638     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42639         mem_base = xmlMemBlocks();
42640         code = gen_int(n_code, 0);
42641
42642         ret_val = xmlUCSIsThaana(code);
42643         desret_int(ret_val);
42644         call_tests++;
42645         des_int(n_code, code, 0);
42646         xmlResetLastError();
42647         if (mem_base != xmlMemBlocks()) {
42648             printf("Leak of %d blocks found in xmlUCSIsThaana",
42649                    xmlMemBlocks() - mem_base);
42650             test_ret++;
42651             printf(" %d", n_code);
42652             printf("\n");
42653         }
42654     }
42655     function_tests++;
42656 #endif
42657
42658     return(test_ret);
42659 }
42660
42661
42662 static int
42663 test_xmlUCSIsThai(void) {
42664     int test_ret = 0;
42665
42666 #if defined(LIBXML_UNICODE_ENABLED)
42667     int mem_base;
42668     int ret_val;
42669     int code; /* UCS code point */
42670     int n_code;
42671
42672     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42673         mem_base = xmlMemBlocks();
42674         code = gen_int(n_code, 0);
42675
42676         ret_val = xmlUCSIsThai(code);
42677         desret_int(ret_val);
42678         call_tests++;
42679         des_int(n_code, code, 0);
42680         xmlResetLastError();
42681         if (mem_base != xmlMemBlocks()) {
42682             printf("Leak of %d blocks found in xmlUCSIsThai",
42683                    xmlMemBlocks() - mem_base);
42684             test_ret++;
42685             printf(" %d", n_code);
42686             printf("\n");
42687         }
42688     }
42689     function_tests++;
42690 #endif
42691
42692     return(test_ret);
42693 }
42694
42695
42696 static int
42697 test_xmlUCSIsTibetan(void) {
42698     int test_ret = 0;
42699
42700 #if defined(LIBXML_UNICODE_ENABLED)
42701     int mem_base;
42702     int ret_val;
42703     int code; /* UCS code point */
42704     int n_code;
42705
42706     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42707         mem_base = xmlMemBlocks();
42708         code = gen_int(n_code, 0);
42709
42710         ret_val = xmlUCSIsTibetan(code);
42711         desret_int(ret_val);
42712         call_tests++;
42713         des_int(n_code, code, 0);
42714         xmlResetLastError();
42715         if (mem_base != xmlMemBlocks()) {
42716             printf("Leak of %d blocks found in xmlUCSIsTibetan",
42717                    xmlMemBlocks() - mem_base);
42718             test_ret++;
42719             printf(" %d", n_code);
42720             printf("\n");
42721         }
42722     }
42723     function_tests++;
42724 #endif
42725
42726     return(test_ret);
42727 }
42728
42729
42730 static int
42731 test_xmlUCSIsUgaritic(void) {
42732     int test_ret = 0;
42733
42734 #if defined(LIBXML_UNICODE_ENABLED)
42735     int mem_base;
42736     int ret_val;
42737     int code; /* UCS code point */
42738     int n_code;
42739
42740     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42741         mem_base = xmlMemBlocks();
42742         code = gen_int(n_code, 0);
42743
42744         ret_val = xmlUCSIsUgaritic(code);
42745         desret_int(ret_val);
42746         call_tests++;
42747         des_int(n_code, code, 0);
42748         xmlResetLastError();
42749         if (mem_base != xmlMemBlocks()) {
42750             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42751                    xmlMemBlocks() - mem_base);
42752             test_ret++;
42753             printf(" %d", n_code);
42754             printf("\n");
42755         }
42756     }
42757     function_tests++;
42758 #endif
42759
42760     return(test_ret);
42761 }
42762
42763
42764 static int
42765 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42766     int test_ret = 0;
42767
42768 #if defined(LIBXML_UNICODE_ENABLED)
42769     int mem_base;
42770     int ret_val;
42771     int code; /* UCS code point */
42772     int n_code;
42773
42774     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42775         mem_base = xmlMemBlocks();
42776         code = gen_int(n_code, 0);
42777
42778         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42779         desret_int(ret_val);
42780         call_tests++;
42781         des_int(n_code, code, 0);
42782         xmlResetLastError();
42783         if (mem_base != xmlMemBlocks()) {
42784             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42785                    xmlMemBlocks() - mem_base);
42786             test_ret++;
42787             printf(" %d", n_code);
42788             printf("\n");
42789         }
42790     }
42791     function_tests++;
42792 #endif
42793
42794     return(test_ret);
42795 }
42796
42797
42798 static int
42799 test_xmlUCSIsVariationSelectors(void) {
42800     int test_ret = 0;
42801
42802 #if defined(LIBXML_UNICODE_ENABLED)
42803     int mem_base;
42804     int ret_val;
42805     int code; /* UCS code point */
42806     int n_code;
42807
42808     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42809         mem_base = xmlMemBlocks();
42810         code = gen_int(n_code, 0);
42811
42812         ret_val = xmlUCSIsVariationSelectors(code);
42813         desret_int(ret_val);
42814         call_tests++;
42815         des_int(n_code, code, 0);
42816         xmlResetLastError();
42817         if (mem_base != xmlMemBlocks()) {
42818             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42819                    xmlMemBlocks() - mem_base);
42820             test_ret++;
42821             printf(" %d", n_code);
42822             printf("\n");
42823         }
42824     }
42825     function_tests++;
42826 #endif
42827
42828     return(test_ret);
42829 }
42830
42831
42832 static int
42833 test_xmlUCSIsVariationSelectorsSupplement(void) {
42834     int test_ret = 0;
42835
42836 #if defined(LIBXML_UNICODE_ENABLED)
42837     int mem_base;
42838     int ret_val;
42839     int code; /* UCS code point */
42840     int n_code;
42841
42842     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42843         mem_base = xmlMemBlocks();
42844         code = gen_int(n_code, 0);
42845
42846         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42847         desret_int(ret_val);
42848         call_tests++;
42849         des_int(n_code, code, 0);
42850         xmlResetLastError();
42851         if (mem_base != xmlMemBlocks()) {
42852             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42853                    xmlMemBlocks() - mem_base);
42854             test_ret++;
42855             printf(" %d", n_code);
42856             printf("\n");
42857         }
42858     }
42859     function_tests++;
42860 #endif
42861
42862     return(test_ret);
42863 }
42864
42865
42866 static int
42867 test_xmlUCSIsYiRadicals(void) {
42868     int test_ret = 0;
42869
42870 #if defined(LIBXML_UNICODE_ENABLED)
42871     int mem_base;
42872     int ret_val;
42873     int code; /* UCS code point */
42874     int n_code;
42875
42876     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42877         mem_base = xmlMemBlocks();
42878         code = gen_int(n_code, 0);
42879
42880         ret_val = xmlUCSIsYiRadicals(code);
42881         desret_int(ret_val);
42882         call_tests++;
42883         des_int(n_code, code, 0);
42884         xmlResetLastError();
42885         if (mem_base != xmlMemBlocks()) {
42886             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42887                    xmlMemBlocks() - mem_base);
42888             test_ret++;
42889             printf(" %d", n_code);
42890             printf("\n");
42891         }
42892     }
42893     function_tests++;
42894 #endif
42895
42896     return(test_ret);
42897 }
42898
42899
42900 static int
42901 test_xmlUCSIsYiSyllables(void) {
42902     int test_ret = 0;
42903
42904 #if defined(LIBXML_UNICODE_ENABLED)
42905     int mem_base;
42906     int ret_val;
42907     int code; /* UCS code point */
42908     int n_code;
42909
42910     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42911         mem_base = xmlMemBlocks();
42912         code = gen_int(n_code, 0);
42913
42914         ret_val = xmlUCSIsYiSyllables(code);
42915         desret_int(ret_val);
42916         call_tests++;
42917         des_int(n_code, code, 0);
42918         xmlResetLastError();
42919         if (mem_base != xmlMemBlocks()) {
42920             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42921                    xmlMemBlocks() - mem_base);
42922             test_ret++;
42923             printf(" %d", n_code);
42924             printf("\n");
42925         }
42926     }
42927     function_tests++;
42928 #endif
42929
42930     return(test_ret);
42931 }
42932
42933
42934 static int
42935 test_xmlUCSIsYijingHexagramSymbols(void) {
42936     int test_ret = 0;
42937
42938 #if defined(LIBXML_UNICODE_ENABLED)
42939     int mem_base;
42940     int ret_val;
42941     int code; /* UCS code point */
42942     int n_code;
42943
42944     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42945         mem_base = xmlMemBlocks();
42946         code = gen_int(n_code, 0);
42947
42948         ret_val = xmlUCSIsYijingHexagramSymbols(code);
42949         desret_int(ret_val);
42950         call_tests++;
42951         des_int(n_code, code, 0);
42952         xmlResetLastError();
42953         if (mem_base != xmlMemBlocks()) {
42954             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42955                    xmlMemBlocks() - mem_base);
42956             test_ret++;
42957             printf(" %d", n_code);
42958             printf("\n");
42959         }
42960     }
42961     function_tests++;
42962 #endif
42963
42964     return(test_ret);
42965 }
42966
42967 static int
42968 test_xmlunicode(void) {
42969     int test_ret = 0;
42970
42971     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42972     test_ret += test_xmlUCSIsAegeanNumbers();
42973     test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42974     test_ret += test_xmlUCSIsArabic();
42975     test_ret += test_xmlUCSIsArabicPresentationFormsA();
42976     test_ret += test_xmlUCSIsArabicPresentationFormsB();
42977     test_ret += test_xmlUCSIsArmenian();
42978     test_ret += test_xmlUCSIsArrows();
42979     test_ret += test_xmlUCSIsBasicLatin();
42980     test_ret += test_xmlUCSIsBengali();
42981     test_ret += test_xmlUCSIsBlock();
42982     test_ret += test_xmlUCSIsBlockElements();
42983     test_ret += test_xmlUCSIsBopomofo();
42984     test_ret += test_xmlUCSIsBopomofoExtended();
42985     test_ret += test_xmlUCSIsBoxDrawing();
42986     test_ret += test_xmlUCSIsBraillePatterns();
42987     test_ret += test_xmlUCSIsBuhid();
42988     test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42989     test_ret += test_xmlUCSIsCJKCompatibility();
42990     test_ret += test_xmlUCSIsCJKCompatibilityForms();
42991     test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42992     test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42993     test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42994     test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42995     test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42996     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42997     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42998     test_ret += test_xmlUCSIsCat();
42999     test_ret += test_xmlUCSIsCatC();
43000     test_ret += test_xmlUCSIsCatCc();
43001     test_ret += test_xmlUCSIsCatCf();
43002     test_ret += test_xmlUCSIsCatCo();
43003     test_ret += test_xmlUCSIsCatCs();
43004     test_ret += test_xmlUCSIsCatL();
43005     test_ret += test_xmlUCSIsCatLl();
43006     test_ret += test_xmlUCSIsCatLm();
43007     test_ret += test_xmlUCSIsCatLo();
43008     test_ret += test_xmlUCSIsCatLt();
43009     test_ret += test_xmlUCSIsCatLu();
43010     test_ret += test_xmlUCSIsCatM();
43011     test_ret += test_xmlUCSIsCatMc();
43012     test_ret += test_xmlUCSIsCatMe();
43013     test_ret += test_xmlUCSIsCatMn();
43014     test_ret += test_xmlUCSIsCatN();
43015     test_ret += test_xmlUCSIsCatNd();
43016     test_ret += test_xmlUCSIsCatNl();
43017     test_ret += test_xmlUCSIsCatNo();
43018     test_ret += test_xmlUCSIsCatP();
43019     test_ret += test_xmlUCSIsCatPc();
43020     test_ret += test_xmlUCSIsCatPd();
43021     test_ret += test_xmlUCSIsCatPe();
43022     test_ret += test_xmlUCSIsCatPf();
43023     test_ret += test_xmlUCSIsCatPi();
43024     test_ret += test_xmlUCSIsCatPo();
43025     test_ret += test_xmlUCSIsCatPs();
43026     test_ret += test_xmlUCSIsCatS();
43027     test_ret += test_xmlUCSIsCatSc();
43028     test_ret += test_xmlUCSIsCatSk();
43029     test_ret += test_xmlUCSIsCatSm();
43030     test_ret += test_xmlUCSIsCatSo();
43031     test_ret += test_xmlUCSIsCatZ();
43032     test_ret += test_xmlUCSIsCatZl();
43033     test_ret += test_xmlUCSIsCatZp();
43034     test_ret += test_xmlUCSIsCatZs();
43035     test_ret += test_xmlUCSIsCherokee();
43036     test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
43037     test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
43038     test_ret += test_xmlUCSIsCombiningHalfMarks();
43039     test_ret += test_xmlUCSIsCombiningMarksforSymbols();
43040     test_ret += test_xmlUCSIsControlPictures();
43041     test_ret += test_xmlUCSIsCurrencySymbols();
43042     test_ret += test_xmlUCSIsCypriotSyllabary();
43043     test_ret += test_xmlUCSIsCyrillic();
43044     test_ret += test_xmlUCSIsCyrillicSupplement();
43045     test_ret += test_xmlUCSIsDeseret();
43046     test_ret += test_xmlUCSIsDevanagari();
43047     test_ret += test_xmlUCSIsDingbats();
43048     test_ret += test_xmlUCSIsEnclosedAlphanumerics();
43049     test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
43050     test_ret += test_xmlUCSIsEthiopic();
43051     test_ret += test_xmlUCSIsGeneralPunctuation();
43052     test_ret += test_xmlUCSIsGeometricShapes();
43053     test_ret += test_xmlUCSIsGeorgian();
43054     test_ret += test_xmlUCSIsGothic();
43055     test_ret += test_xmlUCSIsGreek();
43056     test_ret += test_xmlUCSIsGreekExtended();
43057     test_ret += test_xmlUCSIsGreekandCoptic();
43058     test_ret += test_xmlUCSIsGujarati();
43059     test_ret += test_xmlUCSIsGurmukhi();
43060     test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
43061     test_ret += test_xmlUCSIsHangulCompatibilityJamo();
43062     test_ret += test_xmlUCSIsHangulJamo();
43063     test_ret += test_xmlUCSIsHangulSyllables();
43064     test_ret += test_xmlUCSIsHanunoo();
43065     test_ret += test_xmlUCSIsHebrew();
43066     test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
43067     test_ret += test_xmlUCSIsHighSurrogates();
43068     test_ret += test_xmlUCSIsHiragana();
43069     test_ret += test_xmlUCSIsIPAExtensions();
43070     test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
43071     test_ret += test_xmlUCSIsKanbun();
43072     test_ret += test_xmlUCSIsKangxiRadicals();
43073     test_ret += test_xmlUCSIsKannada();
43074     test_ret += test_xmlUCSIsKatakana();
43075     test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
43076     test_ret += test_xmlUCSIsKhmer();
43077     test_ret += test_xmlUCSIsKhmerSymbols();
43078     test_ret += test_xmlUCSIsLao();
43079     test_ret += test_xmlUCSIsLatin1Supplement();
43080     test_ret += test_xmlUCSIsLatinExtendedA();
43081     test_ret += test_xmlUCSIsLatinExtendedAdditional();
43082     test_ret += test_xmlUCSIsLatinExtendedB();
43083     test_ret += test_xmlUCSIsLetterlikeSymbols();
43084     test_ret += test_xmlUCSIsLimbu();
43085     test_ret += test_xmlUCSIsLinearBIdeograms();
43086     test_ret += test_xmlUCSIsLinearBSyllabary();
43087     test_ret += test_xmlUCSIsLowSurrogates();
43088     test_ret += test_xmlUCSIsMalayalam();
43089     test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
43090     test_ret += test_xmlUCSIsMathematicalOperators();
43091     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
43092     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
43093     test_ret += test_xmlUCSIsMiscellaneousSymbols();
43094     test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
43095     test_ret += test_xmlUCSIsMiscellaneousTechnical();
43096     test_ret += test_xmlUCSIsMongolian();
43097     test_ret += test_xmlUCSIsMusicalSymbols();
43098     test_ret += test_xmlUCSIsMyanmar();
43099     test_ret += test_xmlUCSIsNumberForms();
43100     test_ret += test_xmlUCSIsOgham();
43101     test_ret += test_xmlUCSIsOldItalic();
43102     test_ret += test_xmlUCSIsOpticalCharacterRecognition();
43103     test_ret += test_xmlUCSIsOriya();
43104     test_ret += test_xmlUCSIsOsmanya();
43105     test_ret += test_xmlUCSIsPhoneticExtensions();
43106     test_ret += test_xmlUCSIsPrivateUse();
43107     test_ret += test_xmlUCSIsPrivateUseArea();
43108     test_ret += test_xmlUCSIsRunic();
43109     test_ret += test_xmlUCSIsShavian();
43110     test_ret += test_xmlUCSIsSinhala();
43111     test_ret += test_xmlUCSIsSmallFormVariants();
43112     test_ret += test_xmlUCSIsSpacingModifierLetters();
43113     test_ret += test_xmlUCSIsSpecials();
43114     test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
43115     test_ret += test_xmlUCSIsSupplementalArrowsA();
43116     test_ret += test_xmlUCSIsSupplementalArrowsB();
43117     test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
43118     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
43119     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
43120     test_ret += test_xmlUCSIsSyriac();
43121     test_ret += test_xmlUCSIsTagalog();
43122     test_ret += test_xmlUCSIsTagbanwa();
43123     test_ret += test_xmlUCSIsTags();
43124     test_ret += test_xmlUCSIsTaiLe();
43125     test_ret += test_xmlUCSIsTaiXuanJingSymbols();
43126     test_ret += test_xmlUCSIsTamil();
43127     test_ret += test_xmlUCSIsTelugu();
43128     test_ret += test_xmlUCSIsThaana();
43129     test_ret += test_xmlUCSIsThai();
43130     test_ret += test_xmlUCSIsTibetan();
43131     test_ret += test_xmlUCSIsUgaritic();
43132     test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
43133     test_ret += test_xmlUCSIsVariationSelectors();
43134     test_ret += test_xmlUCSIsVariationSelectorsSupplement();
43135     test_ret += test_xmlUCSIsYiRadicals();
43136     test_ret += test_xmlUCSIsYiSyllables();
43137     test_ret += test_xmlUCSIsYijingHexagramSymbols();
43138
43139     if (test_ret != 0)
43140         printf("Module xmlunicode: %d errors\n", test_ret);
43141     return(test_ret);
43142 }
43143
43144 static int
43145 test_xmlNewTextWriter(void) {
43146     int test_ret = 0;
43147
43148 #if defined(LIBXML_WRITER_ENABLED)
43149     int mem_base;
43150     xmlTextWriterPtr ret_val;
43151     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
43152     int n_out;
43153
43154     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
43155         mem_base = xmlMemBlocks();
43156         out = gen_xmlOutputBufferPtr(n_out, 0);
43157
43158         ret_val = xmlNewTextWriter(out);
43159         if (ret_val != NULL) out = NULL;
43160         desret_xmlTextWriterPtr(ret_val);
43161         call_tests++;
43162         des_xmlOutputBufferPtr(n_out, out, 0);
43163         xmlResetLastError();
43164         if (mem_base != xmlMemBlocks()) {
43165             printf("Leak of %d blocks found in xmlNewTextWriter",
43166                    xmlMemBlocks() - mem_base);
43167             test_ret++;
43168             printf(" %d", n_out);
43169             printf("\n");
43170         }
43171     }
43172     function_tests++;
43173 #endif
43174
43175     return(test_ret);
43176 }
43177
43178
43179 static int
43180 test_xmlNewTextWriterFilename(void) {
43181     int test_ret = 0;
43182
43183 #if defined(LIBXML_WRITER_ENABLED)
43184     int mem_base;
43185     xmlTextWriterPtr ret_val;
43186     const char * uri; /* the URI of the resource for the output */
43187     int n_uri;
43188     int compression; /* compress the output? */
43189     int n_compression;
43190
43191     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
43192     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43193         mem_base = xmlMemBlocks();
43194         uri = gen_fileoutput(n_uri, 0);
43195         compression = gen_int(n_compression, 1);
43196
43197         ret_val = xmlNewTextWriterFilename(uri, compression);
43198         desret_xmlTextWriterPtr(ret_val);
43199         call_tests++;
43200         des_fileoutput(n_uri, uri, 0);
43201         des_int(n_compression, compression, 1);
43202         xmlResetLastError();
43203         if (mem_base != xmlMemBlocks()) {
43204             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
43205                    xmlMemBlocks() - mem_base);
43206             test_ret++;
43207             printf(" %d", n_uri);
43208             printf(" %d", n_compression);
43209             printf("\n");
43210         }
43211     }
43212     }
43213     function_tests++;
43214 #endif
43215
43216     return(test_ret);
43217 }
43218
43219
43220 static int
43221 test_xmlNewTextWriterMemory(void) {
43222     int test_ret = 0;
43223
43224 #if defined(LIBXML_WRITER_ENABLED)
43225     int mem_base;
43226     xmlTextWriterPtr ret_val;
43227     xmlBufferPtr buf; /* xmlBufferPtr */
43228     int n_buf;
43229     int compression; /* compress the output? */
43230     int n_compression;
43231
43232     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
43233     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43234         mem_base = xmlMemBlocks();
43235         buf = gen_xmlBufferPtr(n_buf, 0);
43236         compression = gen_int(n_compression, 1);
43237
43238         ret_val = xmlNewTextWriterMemory(buf, compression);
43239         desret_xmlTextWriterPtr(ret_val);
43240         call_tests++;
43241         des_xmlBufferPtr(n_buf, buf, 0);
43242         des_int(n_compression, compression, 1);
43243         xmlResetLastError();
43244         if (mem_base != xmlMemBlocks()) {
43245             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
43246                    xmlMemBlocks() - mem_base);
43247             test_ret++;
43248             printf(" %d", n_buf);
43249             printf(" %d", n_compression);
43250             printf("\n");
43251         }
43252     }
43253     }
43254     function_tests++;
43255 #endif
43256
43257     return(test_ret);
43258 }
43259
43260
43261 static int
43262 test_xmlNewTextWriterPushParser(void) {
43263     int test_ret = 0;
43264
43265 #if defined(LIBXML_WRITER_ENABLED)
43266     int mem_base;
43267     xmlTextWriterPtr ret_val;
43268     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43269     int n_ctxt;
43270     int compression; /* compress the output? */
43271     int n_compression;
43272
43273     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43274     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43275         mem_base = xmlMemBlocks();
43276         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43277         compression = gen_int(n_compression, 1);
43278
43279         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43280         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43281         desret_xmlTextWriterPtr(ret_val);
43282         call_tests++;
43283         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43284         des_int(n_compression, compression, 1);
43285         xmlResetLastError();
43286         if (mem_base != xmlMemBlocks()) {
43287             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43288                    xmlMemBlocks() - mem_base);
43289             test_ret++;
43290             printf(" %d", n_ctxt);
43291             printf(" %d", n_compression);
43292             printf("\n");
43293         }
43294     }
43295     }
43296     function_tests++;
43297 #endif
43298
43299     return(test_ret);
43300 }
43301
43302
43303 static int
43304 test_xmlNewTextWriterTree(void) {
43305     int test_ret = 0;
43306
43307 #if defined(LIBXML_WRITER_ENABLED)
43308     int mem_base;
43309     xmlTextWriterPtr ret_val;
43310     xmlDocPtr doc; /* xmlDocPtr */
43311     int n_doc;
43312     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43313     int n_node;
43314     int compression; /* compress the output? */
43315     int n_compression;
43316
43317     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43318     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43319     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43320         mem_base = xmlMemBlocks();
43321         doc = gen_xmlDocPtr(n_doc, 0);
43322         node = gen_xmlNodePtr(n_node, 1);
43323         compression = gen_int(n_compression, 2);
43324
43325         ret_val = xmlNewTextWriterTree(doc, node, compression);
43326         desret_xmlTextWriterPtr(ret_val);
43327         call_tests++;
43328         des_xmlDocPtr(n_doc, doc, 0);
43329         des_xmlNodePtr(n_node, node, 1);
43330         des_int(n_compression, compression, 2);
43331         xmlResetLastError();
43332         if (mem_base != xmlMemBlocks()) {
43333             printf("Leak of %d blocks found in xmlNewTextWriterTree",
43334                    xmlMemBlocks() - mem_base);
43335             test_ret++;
43336             printf(" %d", n_doc);
43337             printf(" %d", n_node);
43338             printf(" %d", n_compression);
43339             printf("\n");
43340         }
43341     }
43342     }
43343     }
43344     function_tests++;
43345 #endif
43346
43347     return(test_ret);
43348 }
43349
43350
43351 static int
43352 test_xmlTextWriterEndAttribute(void) {
43353     int test_ret = 0;
43354
43355 #if defined(LIBXML_WRITER_ENABLED)
43356     int mem_base;
43357     int ret_val;
43358     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43359     int n_writer;
43360
43361     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43362         mem_base = xmlMemBlocks();
43363         writer = gen_xmlTextWriterPtr(n_writer, 0);
43364
43365         ret_val = xmlTextWriterEndAttribute(writer);
43366         desret_int(ret_val);
43367         call_tests++;
43368         des_xmlTextWriterPtr(n_writer, writer, 0);
43369         xmlResetLastError();
43370         if (mem_base != xmlMemBlocks()) {
43371             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43372                    xmlMemBlocks() - mem_base);
43373             test_ret++;
43374             printf(" %d", n_writer);
43375             printf("\n");
43376         }
43377     }
43378     function_tests++;
43379 #endif
43380
43381     return(test_ret);
43382 }
43383
43384
43385 static int
43386 test_xmlTextWriterEndCDATA(void) {
43387     int test_ret = 0;
43388
43389 #if defined(LIBXML_WRITER_ENABLED)
43390     int mem_base;
43391     int ret_val;
43392     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43393     int n_writer;
43394
43395     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43396         mem_base = xmlMemBlocks();
43397         writer = gen_xmlTextWriterPtr(n_writer, 0);
43398
43399         ret_val = xmlTextWriterEndCDATA(writer);
43400         desret_int(ret_val);
43401         call_tests++;
43402         des_xmlTextWriterPtr(n_writer, writer, 0);
43403         xmlResetLastError();
43404         if (mem_base != xmlMemBlocks()) {
43405             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43406                    xmlMemBlocks() - mem_base);
43407             test_ret++;
43408             printf(" %d", n_writer);
43409             printf("\n");
43410         }
43411     }
43412     function_tests++;
43413 #endif
43414
43415     return(test_ret);
43416 }
43417
43418
43419 static int
43420 test_xmlTextWriterEndComment(void) {
43421     int test_ret = 0;
43422
43423 #if defined(LIBXML_WRITER_ENABLED)
43424     int mem_base;
43425     int ret_val;
43426     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43427     int n_writer;
43428
43429     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43430         mem_base = xmlMemBlocks();
43431         writer = gen_xmlTextWriterPtr(n_writer, 0);
43432
43433         ret_val = xmlTextWriterEndComment(writer);
43434         desret_int(ret_val);
43435         call_tests++;
43436         des_xmlTextWriterPtr(n_writer, writer, 0);
43437         xmlResetLastError();
43438         if (mem_base != xmlMemBlocks()) {
43439             printf("Leak of %d blocks found in xmlTextWriterEndComment",
43440                    xmlMemBlocks() - mem_base);
43441             test_ret++;
43442             printf(" %d", n_writer);
43443             printf("\n");
43444         }
43445     }
43446     function_tests++;
43447 #endif
43448
43449     return(test_ret);
43450 }
43451
43452
43453 static int
43454 test_xmlTextWriterEndDTD(void) {
43455     int test_ret = 0;
43456
43457 #if defined(LIBXML_WRITER_ENABLED)
43458     int mem_base;
43459     int ret_val;
43460     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43461     int n_writer;
43462
43463     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43464         mem_base = xmlMemBlocks();
43465         writer = gen_xmlTextWriterPtr(n_writer, 0);
43466
43467         ret_val = xmlTextWriterEndDTD(writer);
43468         desret_int(ret_val);
43469         call_tests++;
43470         des_xmlTextWriterPtr(n_writer, writer, 0);
43471         xmlResetLastError();
43472         if (mem_base != xmlMemBlocks()) {
43473             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43474                    xmlMemBlocks() - mem_base);
43475             test_ret++;
43476             printf(" %d", n_writer);
43477             printf("\n");
43478         }
43479     }
43480     function_tests++;
43481 #endif
43482
43483     return(test_ret);
43484 }
43485
43486
43487 static int
43488 test_xmlTextWriterEndDTDAttlist(void) {
43489     int test_ret = 0;
43490
43491 #if defined(LIBXML_WRITER_ENABLED)
43492     int mem_base;
43493     int ret_val;
43494     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43495     int n_writer;
43496
43497     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43498         mem_base = xmlMemBlocks();
43499         writer = gen_xmlTextWriterPtr(n_writer, 0);
43500
43501         ret_val = xmlTextWriterEndDTDAttlist(writer);
43502         desret_int(ret_val);
43503         call_tests++;
43504         des_xmlTextWriterPtr(n_writer, writer, 0);
43505         xmlResetLastError();
43506         if (mem_base != xmlMemBlocks()) {
43507             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43508                    xmlMemBlocks() - mem_base);
43509             test_ret++;
43510             printf(" %d", n_writer);
43511             printf("\n");
43512         }
43513     }
43514     function_tests++;
43515 #endif
43516
43517     return(test_ret);
43518 }
43519
43520
43521 static int
43522 test_xmlTextWriterEndDTDElement(void) {
43523     int test_ret = 0;
43524
43525 #if defined(LIBXML_WRITER_ENABLED)
43526     int mem_base;
43527     int ret_val;
43528     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43529     int n_writer;
43530
43531     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43532         mem_base = xmlMemBlocks();
43533         writer = gen_xmlTextWriterPtr(n_writer, 0);
43534
43535         ret_val = xmlTextWriterEndDTDElement(writer);
43536         desret_int(ret_val);
43537         call_tests++;
43538         des_xmlTextWriterPtr(n_writer, writer, 0);
43539         xmlResetLastError();
43540         if (mem_base != xmlMemBlocks()) {
43541             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43542                    xmlMemBlocks() - mem_base);
43543             test_ret++;
43544             printf(" %d", n_writer);
43545             printf("\n");
43546         }
43547     }
43548     function_tests++;
43549 #endif
43550
43551     return(test_ret);
43552 }
43553
43554
43555 static int
43556 test_xmlTextWriterEndDTDEntity(void) {
43557     int test_ret = 0;
43558
43559 #if defined(LIBXML_WRITER_ENABLED)
43560     int mem_base;
43561     int ret_val;
43562     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43563     int n_writer;
43564
43565     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43566         mem_base = xmlMemBlocks();
43567         writer = gen_xmlTextWriterPtr(n_writer, 0);
43568
43569         ret_val = xmlTextWriterEndDTDEntity(writer);
43570         desret_int(ret_val);
43571         call_tests++;
43572         des_xmlTextWriterPtr(n_writer, writer, 0);
43573         xmlResetLastError();
43574         if (mem_base != xmlMemBlocks()) {
43575             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43576                    xmlMemBlocks() - mem_base);
43577             test_ret++;
43578             printf(" %d", n_writer);
43579             printf("\n");
43580         }
43581     }
43582     function_tests++;
43583 #endif
43584
43585     return(test_ret);
43586 }
43587
43588
43589 static int
43590 test_xmlTextWriterEndDocument(void) {
43591     int test_ret = 0;
43592
43593 #if defined(LIBXML_WRITER_ENABLED)
43594     int mem_base;
43595     int ret_val;
43596     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43597     int n_writer;
43598
43599     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43600         mem_base = xmlMemBlocks();
43601         writer = gen_xmlTextWriterPtr(n_writer, 0);
43602
43603         ret_val = xmlTextWriterEndDocument(writer);
43604         desret_int(ret_val);
43605         call_tests++;
43606         des_xmlTextWriterPtr(n_writer, writer, 0);
43607         xmlResetLastError();
43608         if (mem_base != xmlMemBlocks()) {
43609             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43610                    xmlMemBlocks() - mem_base);
43611             test_ret++;
43612             printf(" %d", n_writer);
43613             printf("\n");
43614         }
43615     }
43616     function_tests++;
43617 #endif
43618
43619     return(test_ret);
43620 }
43621
43622
43623 static int
43624 test_xmlTextWriterEndElement(void) {
43625     int test_ret = 0;
43626
43627 #if defined(LIBXML_WRITER_ENABLED)
43628     int mem_base;
43629     int ret_val;
43630     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43631     int n_writer;
43632
43633     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43634         mem_base = xmlMemBlocks();
43635         writer = gen_xmlTextWriterPtr(n_writer, 0);
43636
43637         ret_val = xmlTextWriterEndElement(writer);
43638         desret_int(ret_val);
43639         call_tests++;
43640         des_xmlTextWriterPtr(n_writer, writer, 0);
43641         xmlResetLastError();
43642         if (mem_base != xmlMemBlocks()) {
43643             printf("Leak of %d blocks found in xmlTextWriterEndElement",
43644                    xmlMemBlocks() - mem_base);
43645             test_ret++;
43646             printf(" %d", n_writer);
43647             printf("\n");
43648         }
43649     }
43650     function_tests++;
43651 #endif
43652
43653     return(test_ret);
43654 }
43655
43656
43657 static int
43658 test_xmlTextWriterEndPI(void) {
43659     int test_ret = 0;
43660
43661 #if defined(LIBXML_WRITER_ENABLED)
43662     int mem_base;
43663     int ret_val;
43664     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43665     int n_writer;
43666
43667     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43668         mem_base = xmlMemBlocks();
43669         writer = gen_xmlTextWriterPtr(n_writer, 0);
43670
43671         ret_val = xmlTextWriterEndPI(writer);
43672         desret_int(ret_val);
43673         call_tests++;
43674         des_xmlTextWriterPtr(n_writer, writer, 0);
43675         xmlResetLastError();
43676         if (mem_base != xmlMemBlocks()) {
43677             printf("Leak of %d blocks found in xmlTextWriterEndPI",
43678                    xmlMemBlocks() - mem_base);
43679             test_ret++;
43680             printf(" %d", n_writer);
43681             printf("\n");
43682         }
43683     }
43684     function_tests++;
43685 #endif
43686
43687     return(test_ret);
43688 }
43689
43690
43691 static int
43692 test_xmlTextWriterFlush(void) {
43693     int test_ret = 0;
43694
43695 #if defined(LIBXML_WRITER_ENABLED)
43696     int mem_base;
43697     int ret_val;
43698     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43699     int n_writer;
43700
43701     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43702         mem_base = xmlMemBlocks();
43703         writer = gen_xmlTextWriterPtr(n_writer, 0);
43704
43705         ret_val = xmlTextWriterFlush(writer);
43706         desret_int(ret_val);
43707         call_tests++;
43708         des_xmlTextWriterPtr(n_writer, writer, 0);
43709         xmlResetLastError();
43710         if (mem_base != xmlMemBlocks()) {
43711             printf("Leak of %d blocks found in xmlTextWriterFlush",
43712                    xmlMemBlocks() - mem_base);
43713             test_ret++;
43714             printf(" %d", n_writer);
43715             printf("\n");
43716         }
43717     }
43718     function_tests++;
43719 #endif
43720
43721     return(test_ret);
43722 }
43723
43724
43725 static int
43726 test_xmlTextWriterFullEndElement(void) {
43727     int test_ret = 0;
43728
43729 #if defined(LIBXML_WRITER_ENABLED)
43730     int mem_base;
43731     int ret_val;
43732     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43733     int n_writer;
43734
43735     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43736         mem_base = xmlMemBlocks();
43737         writer = gen_xmlTextWriterPtr(n_writer, 0);
43738
43739         ret_val = xmlTextWriterFullEndElement(writer);
43740         desret_int(ret_val);
43741         call_tests++;
43742         des_xmlTextWriterPtr(n_writer, writer, 0);
43743         xmlResetLastError();
43744         if (mem_base != xmlMemBlocks()) {
43745             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43746                    xmlMemBlocks() - mem_base);
43747             test_ret++;
43748             printf(" %d", n_writer);
43749             printf("\n");
43750         }
43751     }
43752     function_tests++;
43753 #endif
43754
43755     return(test_ret);
43756 }
43757
43758
43759 static int
43760 test_xmlTextWriterSetIndent(void) {
43761     int test_ret = 0;
43762
43763 #if defined(LIBXML_WRITER_ENABLED)
43764     int mem_base;
43765     int ret_val;
43766     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43767     int n_writer;
43768     int indent; /* do indentation? */
43769     int n_indent;
43770
43771     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43772     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43773         mem_base = xmlMemBlocks();
43774         writer = gen_xmlTextWriterPtr(n_writer, 0);
43775         indent = gen_int(n_indent, 1);
43776
43777         ret_val = xmlTextWriterSetIndent(writer, indent);
43778         desret_int(ret_val);
43779         call_tests++;
43780         des_xmlTextWriterPtr(n_writer, writer, 0);
43781         des_int(n_indent, indent, 1);
43782         xmlResetLastError();
43783         if (mem_base != xmlMemBlocks()) {
43784             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43785                    xmlMemBlocks() - mem_base);
43786             test_ret++;
43787             printf(" %d", n_writer);
43788             printf(" %d", n_indent);
43789             printf("\n");
43790         }
43791     }
43792     }
43793     function_tests++;
43794 #endif
43795
43796     return(test_ret);
43797 }
43798
43799
43800 static int
43801 test_xmlTextWriterSetIndentString(void) {
43802     int test_ret = 0;
43803
43804 #if defined(LIBXML_WRITER_ENABLED)
43805     int mem_base;
43806     int ret_val;
43807     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43808     int n_writer;
43809     xmlChar * str; /* the xmlChar string */
43810     int n_str;
43811
43812     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43813     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43814         mem_base = xmlMemBlocks();
43815         writer = gen_xmlTextWriterPtr(n_writer, 0);
43816         str = gen_const_xmlChar_ptr(n_str, 1);
43817
43818         ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43819         desret_int(ret_val);
43820         call_tests++;
43821         des_xmlTextWriterPtr(n_writer, writer, 0);
43822         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43823         xmlResetLastError();
43824         if (mem_base != xmlMemBlocks()) {
43825             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43826                    xmlMemBlocks() - mem_base);
43827             test_ret++;
43828             printf(" %d", n_writer);
43829             printf(" %d", n_str);
43830             printf("\n");
43831         }
43832     }
43833     }
43834     function_tests++;
43835 #endif
43836
43837     return(test_ret);
43838 }
43839
43840
43841 static int
43842 test_xmlTextWriterSetQuoteChar(void) {
43843     int test_ret = 0;
43844
43845 #if defined(LIBXML_WRITER_ENABLED)
43846     int mem_base;
43847     int ret_val;
43848     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43849     int n_writer;
43850     xmlChar quotechar; /* the quote character */
43851     int n_quotechar;
43852
43853     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43854     for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
43855         mem_base = xmlMemBlocks();
43856         writer = gen_xmlTextWriterPtr(n_writer, 0);
43857         quotechar = gen_xmlChar(n_quotechar, 1);
43858
43859         ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
43860         desret_int(ret_val);
43861         call_tests++;
43862         des_xmlTextWriterPtr(n_writer, writer, 0);
43863         des_xmlChar(n_quotechar, quotechar, 1);
43864         xmlResetLastError();
43865         if (mem_base != xmlMemBlocks()) {
43866             printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
43867                    xmlMemBlocks() - mem_base);
43868             test_ret++;
43869             printf(" %d", n_writer);
43870             printf(" %d", n_quotechar);
43871             printf("\n");
43872         }
43873     }
43874     }
43875     function_tests++;
43876 #endif
43877
43878     return(test_ret);
43879 }
43880
43881
43882 static int
43883 test_xmlTextWriterStartAttribute(void) {
43884     int test_ret = 0;
43885
43886 #if defined(LIBXML_WRITER_ENABLED)
43887     int mem_base;
43888     int ret_val;
43889     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43890     int n_writer;
43891     xmlChar * name; /* element name */
43892     int n_name;
43893
43894     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43895     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43896         mem_base = xmlMemBlocks();
43897         writer = gen_xmlTextWriterPtr(n_writer, 0);
43898         name = gen_const_xmlChar_ptr(n_name, 1);
43899
43900         ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43901         desret_int(ret_val);
43902         call_tests++;
43903         des_xmlTextWriterPtr(n_writer, writer, 0);
43904         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43905         xmlResetLastError();
43906         if (mem_base != xmlMemBlocks()) {
43907             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43908                    xmlMemBlocks() - mem_base);
43909             test_ret++;
43910             printf(" %d", n_writer);
43911             printf(" %d", n_name);
43912             printf("\n");
43913         }
43914     }
43915     }
43916     function_tests++;
43917 #endif
43918
43919     return(test_ret);
43920 }
43921
43922
43923 static int
43924 test_xmlTextWriterStartAttributeNS(void) {
43925     int test_ret = 0;
43926
43927 #if defined(LIBXML_WRITER_ENABLED)
43928     int mem_base;
43929     int ret_val;
43930     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43931     int n_writer;
43932     xmlChar * prefix; /* namespace prefix or NULL */
43933     int n_prefix;
43934     xmlChar * name; /* element local name */
43935     int n_name;
43936     xmlChar * namespaceURI; /* namespace URI or NULL */
43937     int n_namespaceURI;
43938
43939     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43940     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43941     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43942     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43943         mem_base = xmlMemBlocks();
43944         writer = gen_xmlTextWriterPtr(n_writer, 0);
43945         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43946         name = gen_const_xmlChar_ptr(n_name, 2);
43947         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43948
43949         ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43950         desret_int(ret_val);
43951         call_tests++;
43952         des_xmlTextWriterPtr(n_writer, writer, 0);
43953         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43954         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43955         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43956         xmlResetLastError();
43957         if (mem_base != xmlMemBlocks()) {
43958             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43959                    xmlMemBlocks() - mem_base);
43960             test_ret++;
43961             printf(" %d", n_writer);
43962             printf(" %d", n_prefix);
43963             printf(" %d", n_name);
43964             printf(" %d", n_namespaceURI);
43965             printf("\n");
43966         }
43967     }
43968     }
43969     }
43970     }
43971     function_tests++;
43972 #endif
43973
43974     return(test_ret);
43975 }
43976
43977
43978 static int
43979 test_xmlTextWriterStartCDATA(void) {
43980     int test_ret = 0;
43981
43982 #if defined(LIBXML_WRITER_ENABLED)
43983     int mem_base;
43984     int ret_val;
43985     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43986     int n_writer;
43987
43988     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43989         mem_base = xmlMemBlocks();
43990         writer = gen_xmlTextWriterPtr(n_writer, 0);
43991
43992         ret_val = xmlTextWriterStartCDATA(writer);
43993         desret_int(ret_val);
43994         call_tests++;
43995         des_xmlTextWriterPtr(n_writer, writer, 0);
43996         xmlResetLastError();
43997         if (mem_base != xmlMemBlocks()) {
43998             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43999                    xmlMemBlocks() - mem_base);
44000             test_ret++;
44001             printf(" %d", n_writer);
44002             printf("\n");
44003         }
44004     }
44005     function_tests++;
44006 #endif
44007
44008     return(test_ret);
44009 }
44010
44011
44012 static int
44013 test_xmlTextWriterStartComment(void) {
44014     int test_ret = 0;
44015
44016 #if defined(LIBXML_WRITER_ENABLED)
44017     int mem_base;
44018     int ret_val;
44019     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44020     int n_writer;
44021
44022     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44023         mem_base = xmlMemBlocks();
44024         writer = gen_xmlTextWriterPtr(n_writer, 0);
44025
44026         ret_val = xmlTextWriterStartComment(writer);
44027         desret_int(ret_val);
44028         call_tests++;
44029         des_xmlTextWriterPtr(n_writer, writer, 0);
44030         xmlResetLastError();
44031         if (mem_base != xmlMemBlocks()) {
44032             printf("Leak of %d blocks found in xmlTextWriterStartComment",
44033                    xmlMemBlocks() - mem_base);
44034             test_ret++;
44035             printf(" %d", n_writer);
44036             printf("\n");
44037         }
44038     }
44039     function_tests++;
44040 #endif
44041
44042     return(test_ret);
44043 }
44044
44045
44046 static int
44047 test_xmlTextWriterStartDTD(void) {
44048     int test_ret = 0;
44049
44050 #if defined(LIBXML_WRITER_ENABLED)
44051     int mem_base;
44052     int ret_val;
44053     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44054     int n_writer;
44055     xmlChar * name; /* the name of the DTD */
44056     int n_name;
44057     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44058     int n_pubid;
44059     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44060     int n_sysid;
44061
44062     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44063     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44064     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44065     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44066         mem_base = xmlMemBlocks();
44067         writer = gen_xmlTextWriterPtr(n_writer, 0);
44068         name = gen_const_xmlChar_ptr(n_name, 1);
44069         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44070         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44071
44072         ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44073         desret_int(ret_val);
44074         call_tests++;
44075         des_xmlTextWriterPtr(n_writer, writer, 0);
44076         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44077         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44078         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44079         xmlResetLastError();
44080         if (mem_base != xmlMemBlocks()) {
44081             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
44082                    xmlMemBlocks() - mem_base);
44083             test_ret++;
44084             printf(" %d", n_writer);
44085             printf(" %d", n_name);
44086             printf(" %d", n_pubid);
44087             printf(" %d", n_sysid);
44088             printf("\n");
44089         }
44090     }
44091     }
44092     }
44093     }
44094     function_tests++;
44095 #endif
44096
44097     return(test_ret);
44098 }
44099
44100
44101 static int
44102 test_xmlTextWriterStartDTDAttlist(void) {
44103     int test_ret = 0;
44104
44105 #if defined(LIBXML_WRITER_ENABLED)
44106     int mem_base;
44107     int ret_val;
44108     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44109     int n_writer;
44110     xmlChar * name; /* the name of the DTD ATTLIST */
44111     int n_name;
44112
44113     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44114     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44115         mem_base = xmlMemBlocks();
44116         writer = gen_xmlTextWriterPtr(n_writer, 0);
44117         name = gen_const_xmlChar_ptr(n_name, 1);
44118
44119         ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
44120         desret_int(ret_val);
44121         call_tests++;
44122         des_xmlTextWriterPtr(n_writer, writer, 0);
44123         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44124         xmlResetLastError();
44125         if (mem_base != xmlMemBlocks()) {
44126             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
44127                    xmlMemBlocks() - mem_base);
44128             test_ret++;
44129             printf(" %d", n_writer);
44130             printf(" %d", n_name);
44131             printf("\n");
44132         }
44133     }
44134     }
44135     function_tests++;
44136 #endif
44137
44138     return(test_ret);
44139 }
44140
44141
44142 static int
44143 test_xmlTextWriterStartDTDElement(void) {
44144     int test_ret = 0;
44145
44146 #if defined(LIBXML_WRITER_ENABLED)
44147     int mem_base;
44148     int ret_val;
44149     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44150     int n_writer;
44151     xmlChar * name; /* the name of the DTD element */
44152     int n_name;
44153
44154     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44155     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44156         mem_base = xmlMemBlocks();
44157         writer = gen_xmlTextWriterPtr(n_writer, 0);
44158         name = gen_const_xmlChar_ptr(n_name, 1);
44159
44160         ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
44161         desret_int(ret_val);
44162         call_tests++;
44163         des_xmlTextWriterPtr(n_writer, writer, 0);
44164         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44165         xmlResetLastError();
44166         if (mem_base != xmlMemBlocks()) {
44167             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
44168                    xmlMemBlocks() - mem_base);
44169             test_ret++;
44170             printf(" %d", n_writer);
44171             printf(" %d", n_name);
44172             printf("\n");
44173         }
44174     }
44175     }
44176     function_tests++;
44177 #endif
44178
44179     return(test_ret);
44180 }
44181
44182
44183 static int
44184 test_xmlTextWriterStartDTDEntity(void) {
44185     int test_ret = 0;
44186
44187 #if defined(LIBXML_WRITER_ENABLED)
44188     int mem_base;
44189     int ret_val;
44190     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44191     int n_writer;
44192     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44193     int n_pe;
44194     xmlChar * name; /* the name of the DTD ATTLIST */
44195     int n_name;
44196
44197     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44198     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44199     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44200         mem_base = xmlMemBlocks();
44201         writer = gen_xmlTextWriterPtr(n_writer, 0);
44202         pe = gen_int(n_pe, 1);
44203         name = gen_const_xmlChar_ptr(n_name, 2);
44204
44205         ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
44206         desret_int(ret_val);
44207         call_tests++;
44208         des_xmlTextWriterPtr(n_writer, writer, 0);
44209         des_int(n_pe, pe, 1);
44210         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44211         xmlResetLastError();
44212         if (mem_base != xmlMemBlocks()) {
44213             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
44214                    xmlMemBlocks() - mem_base);
44215             test_ret++;
44216             printf(" %d", n_writer);
44217             printf(" %d", n_pe);
44218             printf(" %d", n_name);
44219             printf("\n");
44220         }
44221     }
44222     }
44223     }
44224     function_tests++;
44225 #endif
44226
44227     return(test_ret);
44228 }
44229
44230
44231 static int
44232 test_xmlTextWriterStartDocument(void) {
44233     int test_ret = 0;
44234
44235 #if defined(LIBXML_WRITER_ENABLED)
44236     int mem_base;
44237     int ret_val;
44238     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44239     int n_writer;
44240     char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
44241     int n_version;
44242     char * encoding; /* the encoding or NULL for default */
44243     int n_encoding;
44244     char * standalone; /* "yes" or "no" or NULL for default */
44245     int n_standalone;
44246
44247     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44248     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
44249     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
44250     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
44251         mem_base = xmlMemBlocks();
44252         writer = gen_xmlTextWriterPtr(n_writer, 0);
44253         version = gen_const_char_ptr(n_version, 1);
44254         encoding = gen_const_char_ptr(n_encoding, 2);
44255         standalone = gen_const_char_ptr(n_standalone, 3);
44256
44257         ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
44258         desret_int(ret_val);
44259         call_tests++;
44260         des_xmlTextWriterPtr(n_writer, writer, 0);
44261         des_const_char_ptr(n_version, (const char *)version, 1);
44262         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
44263         des_const_char_ptr(n_standalone, (const char *)standalone, 3);
44264         xmlResetLastError();
44265         if (mem_base != xmlMemBlocks()) {
44266             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
44267                    xmlMemBlocks() - mem_base);
44268             test_ret++;
44269             printf(" %d", n_writer);
44270             printf(" %d", n_version);
44271             printf(" %d", n_encoding);
44272             printf(" %d", n_standalone);
44273             printf("\n");
44274         }
44275     }
44276     }
44277     }
44278     }
44279     function_tests++;
44280 #endif
44281
44282     return(test_ret);
44283 }
44284
44285
44286 static int
44287 test_xmlTextWriterStartElement(void) {
44288     int test_ret = 0;
44289
44290 #if defined(LIBXML_WRITER_ENABLED)
44291     int mem_base;
44292     int ret_val;
44293     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44294     int n_writer;
44295     xmlChar * name; /* element name */
44296     int n_name;
44297
44298     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44299     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44300         mem_base = xmlMemBlocks();
44301         writer = gen_xmlTextWriterPtr(n_writer, 0);
44302         name = gen_const_xmlChar_ptr(n_name, 1);
44303
44304         ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
44305         desret_int(ret_val);
44306         call_tests++;
44307         des_xmlTextWriterPtr(n_writer, writer, 0);
44308         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44309         xmlResetLastError();
44310         if (mem_base != xmlMemBlocks()) {
44311             printf("Leak of %d blocks found in xmlTextWriterStartElement",
44312                    xmlMemBlocks() - mem_base);
44313             test_ret++;
44314             printf(" %d", n_writer);
44315             printf(" %d", n_name);
44316             printf("\n");
44317         }
44318     }
44319     }
44320     function_tests++;
44321 #endif
44322
44323     return(test_ret);
44324 }
44325
44326
44327 static int
44328 test_xmlTextWriterStartElementNS(void) {
44329     int test_ret = 0;
44330
44331 #if defined(LIBXML_WRITER_ENABLED)
44332     int mem_base;
44333     int ret_val;
44334     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44335     int n_writer;
44336     xmlChar * prefix; /* namespace prefix or NULL */
44337     int n_prefix;
44338     xmlChar * name; /* element local name */
44339     int n_name;
44340     xmlChar * namespaceURI; /* namespace URI or NULL */
44341     int n_namespaceURI;
44342
44343     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44344     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44345     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44346     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44347         mem_base = xmlMemBlocks();
44348         writer = gen_xmlTextWriterPtr(n_writer, 0);
44349         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44350         name = gen_const_xmlChar_ptr(n_name, 2);
44351         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44352
44353         ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44354         desret_int(ret_val);
44355         call_tests++;
44356         des_xmlTextWriterPtr(n_writer, writer, 0);
44357         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44358         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44359         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44360         xmlResetLastError();
44361         if (mem_base != xmlMemBlocks()) {
44362             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44363                    xmlMemBlocks() - mem_base);
44364             test_ret++;
44365             printf(" %d", n_writer);
44366             printf(" %d", n_prefix);
44367             printf(" %d", n_name);
44368             printf(" %d", n_namespaceURI);
44369             printf("\n");
44370         }
44371     }
44372     }
44373     }
44374     }
44375     function_tests++;
44376 #endif
44377
44378     return(test_ret);
44379 }
44380
44381
44382 static int
44383 test_xmlTextWriterStartPI(void) {
44384     int test_ret = 0;
44385
44386 #if defined(LIBXML_WRITER_ENABLED)
44387     int mem_base;
44388     int ret_val;
44389     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44390     int n_writer;
44391     xmlChar * target; /* PI target */
44392     int n_target;
44393
44394     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44395     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44396         mem_base = xmlMemBlocks();
44397         writer = gen_xmlTextWriterPtr(n_writer, 0);
44398         target = gen_const_xmlChar_ptr(n_target, 1);
44399
44400         ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44401         desret_int(ret_val);
44402         call_tests++;
44403         des_xmlTextWriterPtr(n_writer, writer, 0);
44404         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44405         xmlResetLastError();
44406         if (mem_base != xmlMemBlocks()) {
44407             printf("Leak of %d blocks found in xmlTextWriterStartPI",
44408                    xmlMemBlocks() - mem_base);
44409             test_ret++;
44410             printf(" %d", n_writer);
44411             printf(" %d", n_target);
44412             printf("\n");
44413         }
44414     }
44415     }
44416     function_tests++;
44417 #endif
44418
44419     return(test_ret);
44420 }
44421
44422
44423 static int
44424 test_xmlTextWriterWriteAttribute(void) {
44425     int test_ret = 0;
44426
44427 #if defined(LIBXML_WRITER_ENABLED)
44428     int mem_base;
44429     int ret_val;
44430     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44431     int n_writer;
44432     xmlChar * name; /* attribute name */
44433     int n_name;
44434     xmlChar * content; /* attribute content */
44435     int n_content;
44436
44437     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44438     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44439     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44440         mem_base = xmlMemBlocks();
44441         writer = gen_xmlTextWriterPtr(n_writer, 0);
44442         name = gen_const_xmlChar_ptr(n_name, 1);
44443         content = gen_const_xmlChar_ptr(n_content, 2);
44444
44445         ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44446         desret_int(ret_val);
44447         call_tests++;
44448         des_xmlTextWriterPtr(n_writer, writer, 0);
44449         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44450         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44451         xmlResetLastError();
44452         if (mem_base != xmlMemBlocks()) {
44453             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44454                    xmlMemBlocks() - mem_base);
44455             test_ret++;
44456             printf(" %d", n_writer);
44457             printf(" %d", n_name);
44458             printf(" %d", n_content);
44459             printf("\n");
44460         }
44461     }
44462     }
44463     }
44464     function_tests++;
44465 #endif
44466
44467     return(test_ret);
44468 }
44469
44470
44471 static int
44472 test_xmlTextWriterWriteAttributeNS(void) {
44473     int test_ret = 0;
44474
44475 #if defined(LIBXML_WRITER_ENABLED)
44476     int mem_base;
44477     int ret_val;
44478     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44479     int n_writer;
44480     xmlChar * prefix; /* namespace prefix */
44481     int n_prefix;
44482     xmlChar * name; /* attribute local name */
44483     int n_name;
44484     xmlChar * namespaceURI; /* namespace URI */
44485     int n_namespaceURI;
44486     xmlChar * content; /* attribute content */
44487     int n_content;
44488
44489     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44490     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44491     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44492     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44493     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44494         mem_base = xmlMemBlocks();
44495         writer = gen_xmlTextWriterPtr(n_writer, 0);
44496         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44497         name = gen_const_xmlChar_ptr(n_name, 2);
44498         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44499         content = gen_const_xmlChar_ptr(n_content, 4);
44500
44501         ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44502         desret_int(ret_val);
44503         call_tests++;
44504         des_xmlTextWriterPtr(n_writer, writer, 0);
44505         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44506         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44507         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44508         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44509         xmlResetLastError();
44510         if (mem_base != xmlMemBlocks()) {
44511             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44512                    xmlMemBlocks() - mem_base);
44513             test_ret++;
44514             printf(" %d", n_writer);
44515             printf(" %d", n_prefix);
44516             printf(" %d", n_name);
44517             printf(" %d", n_namespaceURI);
44518             printf(" %d", n_content);
44519             printf("\n");
44520         }
44521     }
44522     }
44523     }
44524     }
44525     }
44526     function_tests++;
44527 #endif
44528
44529     return(test_ret);
44530 }
44531
44532
44533 static int
44534 test_xmlTextWriterWriteBase64(void) {
44535     int test_ret = 0;
44536
44537 #if defined(LIBXML_WRITER_ENABLED)
44538     int mem_base;
44539     int ret_val;
44540     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44541     int n_writer;
44542     char * data; /* binary data */
44543     int n_data;
44544     int start; /* the position within the data of the first byte to encode */
44545     int n_start;
44546     int len; /* the number of bytes to encode */
44547     int n_len;
44548
44549     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44550     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44551     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44552     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44553         mem_base = xmlMemBlocks();
44554         writer = gen_xmlTextWriterPtr(n_writer, 0);
44555         data = gen_const_char_ptr(n_data, 1);
44556         start = gen_int(n_start, 2);
44557         len = gen_int(n_len, 3);
44558
44559         ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44560         desret_int(ret_val);
44561         call_tests++;
44562         des_xmlTextWriterPtr(n_writer, writer, 0);
44563         des_const_char_ptr(n_data, (const char *)data, 1);
44564         des_int(n_start, start, 2);
44565         des_int(n_len, len, 3);
44566         xmlResetLastError();
44567         if (mem_base != xmlMemBlocks()) {
44568             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44569                    xmlMemBlocks() - mem_base);
44570             test_ret++;
44571             printf(" %d", n_writer);
44572             printf(" %d", n_data);
44573             printf(" %d", n_start);
44574             printf(" %d", n_len);
44575             printf("\n");
44576         }
44577     }
44578     }
44579     }
44580     }
44581     function_tests++;
44582 #endif
44583
44584     return(test_ret);
44585 }
44586
44587
44588 static int
44589 test_xmlTextWriterWriteBinHex(void) {
44590     int test_ret = 0;
44591
44592 #if defined(LIBXML_WRITER_ENABLED)
44593     int mem_base;
44594     int ret_val;
44595     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44596     int n_writer;
44597     char * data; /* binary data */
44598     int n_data;
44599     int start; /* the position within the data of the first byte to encode */
44600     int n_start;
44601     int len; /* the number of bytes to encode */
44602     int n_len;
44603
44604     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44605     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44606     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44607     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44608         mem_base = xmlMemBlocks();
44609         writer = gen_xmlTextWriterPtr(n_writer, 0);
44610         data = gen_const_char_ptr(n_data, 1);
44611         start = gen_int(n_start, 2);
44612         len = gen_int(n_len, 3);
44613
44614         ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44615         desret_int(ret_val);
44616         call_tests++;
44617         des_xmlTextWriterPtr(n_writer, writer, 0);
44618         des_const_char_ptr(n_data, (const char *)data, 1);
44619         des_int(n_start, start, 2);
44620         des_int(n_len, len, 3);
44621         xmlResetLastError();
44622         if (mem_base != xmlMemBlocks()) {
44623             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44624                    xmlMemBlocks() - mem_base);
44625             test_ret++;
44626             printf(" %d", n_writer);
44627             printf(" %d", n_data);
44628             printf(" %d", n_start);
44629             printf(" %d", n_len);
44630             printf("\n");
44631         }
44632     }
44633     }
44634     }
44635     }
44636     function_tests++;
44637 #endif
44638
44639     return(test_ret);
44640 }
44641
44642
44643 static int
44644 test_xmlTextWriterWriteCDATA(void) {
44645     int test_ret = 0;
44646
44647 #if defined(LIBXML_WRITER_ENABLED)
44648     int mem_base;
44649     int ret_val;
44650     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44651     int n_writer;
44652     xmlChar * content; /* CDATA content */
44653     int n_content;
44654
44655     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44656     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44657         mem_base = xmlMemBlocks();
44658         writer = gen_xmlTextWriterPtr(n_writer, 0);
44659         content = gen_const_xmlChar_ptr(n_content, 1);
44660
44661         ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44662         desret_int(ret_val);
44663         call_tests++;
44664         des_xmlTextWriterPtr(n_writer, writer, 0);
44665         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44666         xmlResetLastError();
44667         if (mem_base != xmlMemBlocks()) {
44668             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44669                    xmlMemBlocks() - mem_base);
44670             test_ret++;
44671             printf(" %d", n_writer);
44672             printf(" %d", n_content);
44673             printf("\n");
44674         }
44675     }
44676     }
44677     function_tests++;
44678 #endif
44679
44680     return(test_ret);
44681 }
44682
44683
44684 static int
44685 test_xmlTextWriterWriteComment(void) {
44686     int test_ret = 0;
44687
44688 #if defined(LIBXML_WRITER_ENABLED)
44689     int mem_base;
44690     int ret_val;
44691     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44692     int n_writer;
44693     xmlChar * content; /* comment string */
44694     int n_content;
44695
44696     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44697     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44698         mem_base = xmlMemBlocks();
44699         writer = gen_xmlTextWriterPtr(n_writer, 0);
44700         content = gen_const_xmlChar_ptr(n_content, 1);
44701
44702         ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44703         desret_int(ret_val);
44704         call_tests++;
44705         des_xmlTextWriterPtr(n_writer, writer, 0);
44706         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44707         xmlResetLastError();
44708         if (mem_base != xmlMemBlocks()) {
44709             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44710                    xmlMemBlocks() - mem_base);
44711             test_ret++;
44712             printf(" %d", n_writer);
44713             printf(" %d", n_content);
44714             printf("\n");
44715         }
44716     }
44717     }
44718     function_tests++;
44719 #endif
44720
44721     return(test_ret);
44722 }
44723
44724
44725 static int
44726 test_xmlTextWriterWriteDTD(void) {
44727     int test_ret = 0;
44728
44729 #if defined(LIBXML_WRITER_ENABLED)
44730     int mem_base;
44731     int ret_val;
44732     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44733     int n_writer;
44734     xmlChar * name; /* the name of the DTD */
44735     int n_name;
44736     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44737     int n_pubid;
44738     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44739     int n_sysid;
44740     xmlChar * subset; /* string content of the DTD */
44741     int n_subset;
44742
44743     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44744     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44745     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44746     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44747     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44748         mem_base = xmlMemBlocks();
44749         writer = gen_xmlTextWriterPtr(n_writer, 0);
44750         name = gen_const_xmlChar_ptr(n_name, 1);
44751         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44752         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44753         subset = gen_const_xmlChar_ptr(n_subset, 4);
44754
44755         ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44756         desret_int(ret_val);
44757         call_tests++;
44758         des_xmlTextWriterPtr(n_writer, writer, 0);
44759         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44760         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44761         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44762         des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44763         xmlResetLastError();
44764         if (mem_base != xmlMemBlocks()) {
44765             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44766                    xmlMemBlocks() - mem_base);
44767             test_ret++;
44768             printf(" %d", n_writer);
44769             printf(" %d", n_name);
44770             printf(" %d", n_pubid);
44771             printf(" %d", n_sysid);
44772             printf(" %d", n_subset);
44773             printf("\n");
44774         }
44775     }
44776     }
44777     }
44778     }
44779     }
44780     function_tests++;
44781 #endif
44782
44783     return(test_ret);
44784 }
44785
44786
44787 static int
44788 test_xmlTextWriterWriteDTDAttlist(void) {
44789     int test_ret = 0;
44790
44791 #if defined(LIBXML_WRITER_ENABLED)
44792     int mem_base;
44793     int ret_val;
44794     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44795     int n_writer;
44796     xmlChar * name; /* the name of the DTD ATTLIST */
44797     int n_name;
44798     xmlChar * content; /* content of the ATTLIST */
44799     int n_content;
44800
44801     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44802     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44803     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44804         mem_base = xmlMemBlocks();
44805         writer = gen_xmlTextWriterPtr(n_writer, 0);
44806         name = gen_const_xmlChar_ptr(n_name, 1);
44807         content = gen_const_xmlChar_ptr(n_content, 2);
44808
44809         ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44810         desret_int(ret_val);
44811         call_tests++;
44812         des_xmlTextWriterPtr(n_writer, writer, 0);
44813         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44814         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44815         xmlResetLastError();
44816         if (mem_base != xmlMemBlocks()) {
44817             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44818                    xmlMemBlocks() - mem_base);
44819             test_ret++;
44820             printf(" %d", n_writer);
44821             printf(" %d", n_name);
44822             printf(" %d", n_content);
44823             printf("\n");
44824         }
44825     }
44826     }
44827     }
44828     function_tests++;
44829 #endif
44830
44831     return(test_ret);
44832 }
44833
44834
44835 static int
44836 test_xmlTextWriterWriteDTDElement(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 * name; /* the name of the DTD element */
44845     int n_name;
44846     xmlChar * content; /* content of the element */
44847     int n_content;
44848
44849     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44850     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44851     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44852         mem_base = xmlMemBlocks();
44853         writer = gen_xmlTextWriterPtr(n_writer, 0);
44854         name = gen_const_xmlChar_ptr(n_name, 1);
44855         content = gen_const_xmlChar_ptr(n_content, 2);
44856
44857         ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44858         desret_int(ret_val);
44859         call_tests++;
44860         des_xmlTextWriterPtr(n_writer, writer, 0);
44861         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44862         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44863         xmlResetLastError();
44864         if (mem_base != xmlMemBlocks()) {
44865             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44866                    xmlMemBlocks() - mem_base);
44867             test_ret++;
44868             printf(" %d", n_writer);
44869             printf(" %d", n_name);
44870             printf(" %d", n_content);
44871             printf("\n");
44872         }
44873     }
44874     }
44875     }
44876     function_tests++;
44877 #endif
44878
44879     return(test_ret);
44880 }
44881
44882
44883 static int
44884 test_xmlTextWriterWriteDTDEntity(void) {
44885     int test_ret = 0;
44886
44887 #if defined(LIBXML_WRITER_ENABLED)
44888     int mem_base;
44889     int ret_val;
44890     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44891     int n_writer;
44892     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44893     int n_pe;
44894     xmlChar * name; /* the name of the DTD entity */
44895     int n_name;
44896     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44897     int n_pubid;
44898     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44899     int n_sysid;
44900     xmlChar * ndataid; /* the xml notation name. */
44901     int n_ndataid;
44902     xmlChar * content; /* content of the entity */
44903     int n_content;
44904
44905     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44906     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44907     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44908     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44909     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44910     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44911     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44912         mem_base = xmlMemBlocks();
44913         writer = gen_xmlTextWriterPtr(n_writer, 0);
44914         pe = gen_int(n_pe, 1);
44915         name = gen_const_xmlChar_ptr(n_name, 2);
44916         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44917         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44918         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44919         content = gen_const_xmlChar_ptr(n_content, 6);
44920
44921         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44922         desret_int(ret_val);
44923         call_tests++;
44924         des_xmlTextWriterPtr(n_writer, writer, 0);
44925         des_int(n_pe, pe, 1);
44926         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44927         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44928         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44929         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44930         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44931         xmlResetLastError();
44932         if (mem_base != xmlMemBlocks()) {
44933             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44934                    xmlMemBlocks() - mem_base);
44935             test_ret++;
44936             printf(" %d", n_writer);
44937             printf(" %d", n_pe);
44938             printf(" %d", n_name);
44939             printf(" %d", n_pubid);
44940             printf(" %d", n_sysid);
44941             printf(" %d", n_ndataid);
44942             printf(" %d", n_content);
44943             printf("\n");
44944         }
44945     }
44946     }
44947     }
44948     }
44949     }
44950     }
44951     }
44952     function_tests++;
44953 #endif
44954
44955     return(test_ret);
44956 }
44957
44958
44959 static int
44960 test_xmlTextWriterWriteDTDExternalEntity(void) {
44961     int test_ret = 0;
44962
44963 #if defined(LIBXML_WRITER_ENABLED)
44964     int mem_base;
44965     int ret_val;
44966     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44967     int n_writer;
44968     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44969     int n_pe;
44970     xmlChar * name; /* the name of the DTD entity */
44971     int n_name;
44972     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44973     int n_pubid;
44974     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44975     int n_sysid;
44976     xmlChar * ndataid; /* the xml notation name. */
44977     int n_ndataid;
44978
44979     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44980     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44981     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44982     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44983     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44984     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44985         mem_base = xmlMemBlocks();
44986         writer = gen_xmlTextWriterPtr(n_writer, 0);
44987         pe = gen_int(n_pe, 1);
44988         name = gen_const_xmlChar_ptr(n_name, 2);
44989         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44990         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44991         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44992
44993         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44994         desret_int(ret_val);
44995         call_tests++;
44996         des_xmlTextWriterPtr(n_writer, writer, 0);
44997         des_int(n_pe, pe, 1);
44998         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44999         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
45000         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
45001         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
45002         xmlResetLastError();
45003         if (mem_base != xmlMemBlocks()) {
45004             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
45005                    xmlMemBlocks() - mem_base);
45006             test_ret++;
45007             printf(" %d", n_writer);
45008             printf(" %d", n_pe);
45009             printf(" %d", n_name);
45010             printf(" %d", n_pubid);
45011             printf(" %d", n_sysid);
45012             printf(" %d", n_ndataid);
45013             printf("\n");
45014         }
45015     }
45016     }
45017     }
45018     }
45019     }
45020     }
45021     function_tests++;
45022 #endif
45023
45024     return(test_ret);
45025 }
45026
45027
45028 static int
45029 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
45030     int test_ret = 0;
45031
45032 #if defined(LIBXML_WRITER_ENABLED)
45033     int mem_base;
45034     int ret_val;
45035     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45036     int n_writer;
45037     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45038     int n_pubid;
45039     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45040     int n_sysid;
45041     xmlChar * ndataid; /* the xml notation name. */
45042     int n_ndataid;
45043
45044     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45045     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45046     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45047     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
45048         mem_base = xmlMemBlocks();
45049         writer = gen_xmlTextWriterPtr(n_writer, 0);
45050         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
45051         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
45052         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
45053
45054         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
45055         desret_int(ret_val);
45056         call_tests++;
45057         des_xmlTextWriterPtr(n_writer, writer, 0);
45058         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
45059         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
45060         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
45061         xmlResetLastError();
45062         if (mem_base != xmlMemBlocks()) {
45063             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
45064                    xmlMemBlocks() - mem_base);
45065             test_ret++;
45066             printf(" %d", n_writer);
45067             printf(" %d", n_pubid);
45068             printf(" %d", n_sysid);
45069             printf(" %d", n_ndataid);
45070             printf("\n");
45071         }
45072     }
45073     }
45074     }
45075     }
45076     function_tests++;
45077 #endif
45078
45079     return(test_ret);
45080 }
45081
45082
45083 static int
45084 test_xmlTextWriterWriteDTDInternalEntity(void) {
45085     int test_ret = 0;
45086
45087 #if defined(LIBXML_WRITER_ENABLED)
45088     int mem_base;
45089     int ret_val;
45090     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45091     int n_writer;
45092     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45093     int n_pe;
45094     xmlChar * name; /* the name of the DTD entity */
45095     int n_name;
45096     xmlChar * content; /* content of the entity */
45097     int n_content;
45098
45099     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45100     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45101     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45102     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45103         mem_base = xmlMemBlocks();
45104         writer = gen_xmlTextWriterPtr(n_writer, 0);
45105         pe = gen_int(n_pe, 1);
45106         name = gen_const_xmlChar_ptr(n_name, 2);
45107         content = gen_const_xmlChar_ptr(n_content, 3);
45108
45109         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
45110         desret_int(ret_val);
45111         call_tests++;
45112         des_xmlTextWriterPtr(n_writer, writer, 0);
45113         des_int(n_pe, pe, 1);
45114         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45115         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
45116         xmlResetLastError();
45117         if (mem_base != xmlMemBlocks()) {
45118             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
45119                    xmlMemBlocks() - mem_base);
45120             test_ret++;
45121             printf(" %d", n_writer);
45122             printf(" %d", n_pe);
45123             printf(" %d", n_name);
45124             printf(" %d", n_content);
45125             printf("\n");
45126         }
45127     }
45128     }
45129     }
45130     }
45131     function_tests++;
45132 #endif
45133
45134     return(test_ret);
45135 }
45136
45137
45138 static int
45139 test_xmlTextWriterWriteDTDNotation(void) {
45140     int test_ret = 0;
45141
45142 #if defined(LIBXML_WRITER_ENABLED)
45143     int mem_base;
45144     int ret_val;
45145     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45146     int n_writer;
45147     xmlChar * name; /* the name of the xml notation */
45148     int n_name;
45149     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45150     int n_pubid;
45151     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45152     int n_sysid;
45153
45154     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45155     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45156     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45157     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45158         mem_base = xmlMemBlocks();
45159         writer = gen_xmlTextWriterPtr(n_writer, 0);
45160         name = gen_const_xmlChar_ptr(n_name, 1);
45161         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45162         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45163
45164         ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
45165         desret_int(ret_val);
45166         call_tests++;
45167         des_xmlTextWriterPtr(n_writer, writer, 0);
45168         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45169         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45170         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45171         xmlResetLastError();
45172         if (mem_base != xmlMemBlocks()) {
45173             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
45174                    xmlMemBlocks() - mem_base);
45175             test_ret++;
45176             printf(" %d", n_writer);
45177             printf(" %d", n_name);
45178             printf(" %d", n_pubid);
45179             printf(" %d", n_sysid);
45180             printf("\n");
45181         }
45182     }
45183     }
45184     }
45185     }
45186     function_tests++;
45187 #endif
45188
45189     return(test_ret);
45190 }
45191
45192
45193 static int
45194 test_xmlTextWriterWriteElement(void) {
45195     int test_ret = 0;
45196
45197 #if defined(LIBXML_WRITER_ENABLED)
45198     int mem_base;
45199     int ret_val;
45200     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45201     int n_writer;
45202     xmlChar * name; /* element name */
45203     int n_name;
45204     xmlChar * content; /* element content */
45205     int n_content;
45206
45207     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45208     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45209     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45210         mem_base = xmlMemBlocks();
45211         writer = gen_xmlTextWriterPtr(n_writer, 0);
45212         name = gen_const_xmlChar_ptr(n_name, 1);
45213         content = gen_const_xmlChar_ptr(n_content, 2);
45214
45215         ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
45216         desret_int(ret_val);
45217         call_tests++;
45218         des_xmlTextWriterPtr(n_writer, writer, 0);
45219         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45220         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45221         xmlResetLastError();
45222         if (mem_base != xmlMemBlocks()) {
45223             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
45224                    xmlMemBlocks() - mem_base);
45225             test_ret++;
45226             printf(" %d", n_writer);
45227             printf(" %d", n_name);
45228             printf(" %d", n_content);
45229             printf("\n");
45230         }
45231     }
45232     }
45233     }
45234     function_tests++;
45235 #endif
45236
45237     return(test_ret);
45238 }
45239
45240
45241 static int
45242 test_xmlTextWriterWriteElementNS(void) {
45243     int test_ret = 0;
45244
45245 #if defined(LIBXML_WRITER_ENABLED)
45246     int mem_base;
45247     int ret_val;
45248     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45249     int n_writer;
45250     xmlChar * prefix; /* namespace prefix */
45251     int n_prefix;
45252     xmlChar * name; /* element local name */
45253     int n_name;
45254     xmlChar * namespaceURI; /* namespace URI */
45255     int n_namespaceURI;
45256     xmlChar * content; /* element content */
45257     int n_content;
45258
45259     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45260     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45261     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45262     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45263     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45264         mem_base = xmlMemBlocks();
45265         writer = gen_xmlTextWriterPtr(n_writer, 0);
45266         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45267         name = gen_const_xmlChar_ptr(n_name, 2);
45268         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45269         content = gen_const_xmlChar_ptr(n_content, 4);
45270
45271         ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
45272         desret_int(ret_val);
45273         call_tests++;
45274         des_xmlTextWriterPtr(n_writer, writer, 0);
45275         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45276         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45277         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45278         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
45279         xmlResetLastError();
45280         if (mem_base != xmlMemBlocks()) {
45281             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
45282                    xmlMemBlocks() - mem_base);
45283             test_ret++;
45284             printf(" %d", n_writer);
45285             printf(" %d", n_prefix);
45286             printf(" %d", n_name);
45287             printf(" %d", n_namespaceURI);
45288             printf(" %d", n_content);
45289             printf("\n");
45290         }
45291     }
45292     }
45293     }
45294     }
45295     }
45296     function_tests++;
45297 #endif
45298
45299     return(test_ret);
45300 }
45301
45302
45303 static int
45304 test_xmlTextWriterWriteFormatAttribute(void) {
45305     int test_ret = 0;
45306
45307
45308     /* missing type support */
45309     return(test_ret);
45310 }
45311
45312
45313 static int
45314 test_xmlTextWriterWriteFormatAttributeNS(void) {
45315     int test_ret = 0;
45316
45317
45318     /* missing type support */
45319     return(test_ret);
45320 }
45321
45322
45323 static int
45324 test_xmlTextWriterWriteFormatCDATA(void) {
45325     int test_ret = 0;
45326
45327
45328     /* missing type support */
45329     return(test_ret);
45330 }
45331
45332
45333 static int
45334 test_xmlTextWriterWriteFormatComment(void) {
45335     int test_ret = 0;
45336
45337
45338     /* missing type support */
45339     return(test_ret);
45340 }
45341
45342
45343 static int
45344 test_xmlTextWriterWriteFormatDTD(void) {
45345     int test_ret = 0;
45346
45347
45348     /* missing type support */
45349     return(test_ret);
45350 }
45351
45352
45353 static int
45354 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45355     int test_ret = 0;
45356
45357
45358     /* missing type support */
45359     return(test_ret);
45360 }
45361
45362
45363 static int
45364 test_xmlTextWriterWriteFormatDTDElement(void) {
45365     int test_ret = 0;
45366
45367
45368     /* missing type support */
45369     return(test_ret);
45370 }
45371
45372
45373 static int
45374 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45375     int test_ret = 0;
45376
45377
45378     /* missing type support */
45379     return(test_ret);
45380 }
45381
45382
45383 static int
45384 test_xmlTextWriterWriteFormatElement(void) {
45385     int test_ret = 0;
45386
45387
45388     /* missing type support */
45389     return(test_ret);
45390 }
45391
45392
45393 static int
45394 test_xmlTextWriterWriteFormatElementNS(void) {
45395     int test_ret = 0;
45396
45397
45398     /* missing type support */
45399     return(test_ret);
45400 }
45401
45402
45403 static int
45404 test_xmlTextWriterWriteFormatPI(void) {
45405     int test_ret = 0;
45406
45407
45408     /* missing type support */
45409     return(test_ret);
45410 }
45411
45412
45413 static int
45414 test_xmlTextWriterWriteFormatRaw(void) {
45415     int test_ret = 0;
45416
45417
45418     /* missing type support */
45419     return(test_ret);
45420 }
45421
45422
45423 static int
45424 test_xmlTextWriterWriteFormatString(void) {
45425     int test_ret = 0;
45426
45427
45428     /* missing type support */
45429     return(test_ret);
45430 }
45431
45432
45433 static int
45434 test_xmlTextWriterWritePI(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 * target; /* PI target */
45443     int n_target;
45444     xmlChar * content; /* PI content */
45445     int n_content;
45446
45447     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45448     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45449     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45450         mem_base = xmlMemBlocks();
45451         writer = gen_xmlTextWriterPtr(n_writer, 0);
45452         target = gen_const_xmlChar_ptr(n_target, 1);
45453         content = gen_const_xmlChar_ptr(n_content, 2);
45454
45455         ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45456         desret_int(ret_val);
45457         call_tests++;
45458         des_xmlTextWriterPtr(n_writer, writer, 0);
45459         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45460         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45461         xmlResetLastError();
45462         if (mem_base != xmlMemBlocks()) {
45463             printf("Leak of %d blocks found in xmlTextWriterWritePI",
45464                    xmlMemBlocks() - mem_base);
45465             test_ret++;
45466             printf(" %d", n_writer);
45467             printf(" %d", n_target);
45468             printf(" %d", n_content);
45469             printf("\n");
45470         }
45471     }
45472     }
45473     }
45474     function_tests++;
45475 #endif
45476
45477     return(test_ret);
45478 }
45479
45480
45481 static int
45482 test_xmlTextWriterWriteRaw(void) {
45483     int test_ret = 0;
45484
45485 #if defined(LIBXML_WRITER_ENABLED)
45486     int mem_base;
45487     int ret_val;
45488     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45489     int n_writer;
45490     xmlChar * content; /* text string */
45491     int n_content;
45492
45493     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45494     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45495         mem_base = xmlMemBlocks();
45496         writer = gen_xmlTextWriterPtr(n_writer, 0);
45497         content = gen_const_xmlChar_ptr(n_content, 1);
45498
45499         ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45500         desret_int(ret_val);
45501         call_tests++;
45502         des_xmlTextWriterPtr(n_writer, writer, 0);
45503         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45504         xmlResetLastError();
45505         if (mem_base != xmlMemBlocks()) {
45506             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45507                    xmlMemBlocks() - mem_base);
45508             test_ret++;
45509             printf(" %d", n_writer);
45510             printf(" %d", n_content);
45511             printf("\n");
45512         }
45513     }
45514     }
45515     function_tests++;
45516 #endif
45517
45518     return(test_ret);
45519 }
45520
45521
45522 static int
45523 test_xmlTextWriterWriteRawLen(void) {
45524     int test_ret = 0;
45525
45526 #if defined(LIBXML_WRITER_ENABLED)
45527     int mem_base;
45528     int ret_val;
45529     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45530     int n_writer;
45531     xmlChar * content; /* text string */
45532     int n_content;
45533     int len; /* length of the text string */
45534     int n_len;
45535
45536     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45537     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45538     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45539         mem_base = xmlMemBlocks();
45540         writer = gen_xmlTextWriterPtr(n_writer, 0);
45541         content = gen_const_xmlChar_ptr(n_content, 1);
45542         len = gen_int(n_len, 2);
45543
45544         ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45545         desret_int(ret_val);
45546         call_tests++;
45547         des_xmlTextWriterPtr(n_writer, writer, 0);
45548         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45549         des_int(n_len, len, 2);
45550         xmlResetLastError();
45551         if (mem_base != xmlMemBlocks()) {
45552             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45553                    xmlMemBlocks() - mem_base);
45554             test_ret++;
45555             printf(" %d", n_writer);
45556             printf(" %d", n_content);
45557             printf(" %d", n_len);
45558             printf("\n");
45559         }
45560     }
45561     }
45562     }
45563     function_tests++;
45564 #endif
45565
45566     return(test_ret);
45567 }
45568
45569
45570 static int
45571 test_xmlTextWriterWriteString(void) {
45572     int test_ret = 0;
45573
45574 #if defined(LIBXML_WRITER_ENABLED)
45575     int mem_base;
45576     int ret_val;
45577     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45578     int n_writer;
45579     xmlChar * content; /* text string */
45580     int n_content;
45581
45582     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45583     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45584         mem_base = xmlMemBlocks();
45585         writer = gen_xmlTextWriterPtr(n_writer, 0);
45586         content = gen_const_xmlChar_ptr(n_content, 1);
45587
45588         ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45589         desret_int(ret_val);
45590         call_tests++;
45591         des_xmlTextWriterPtr(n_writer, writer, 0);
45592         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45593         xmlResetLastError();
45594         if (mem_base != xmlMemBlocks()) {
45595             printf("Leak of %d blocks found in xmlTextWriterWriteString",
45596                    xmlMemBlocks() - mem_base);
45597             test_ret++;
45598             printf(" %d", n_writer);
45599             printf(" %d", n_content);
45600             printf("\n");
45601         }
45602     }
45603     }
45604     function_tests++;
45605 #endif
45606
45607     return(test_ret);
45608 }
45609
45610
45611 static int
45612 test_xmlTextWriterWriteVFormatAttribute(void) {
45613     int test_ret = 0;
45614
45615
45616     /* missing type support */
45617     return(test_ret);
45618 }
45619
45620
45621 static int
45622 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45623     int test_ret = 0;
45624
45625
45626     /* missing type support */
45627     return(test_ret);
45628 }
45629
45630
45631 static int
45632 test_xmlTextWriterWriteVFormatCDATA(void) {
45633     int test_ret = 0;
45634
45635
45636     /* missing type support */
45637     return(test_ret);
45638 }
45639
45640
45641 static int
45642 test_xmlTextWriterWriteVFormatComment(void) {
45643     int test_ret = 0;
45644
45645
45646     /* missing type support */
45647     return(test_ret);
45648 }
45649
45650
45651 static int
45652 test_xmlTextWriterWriteVFormatDTD(void) {
45653     int test_ret = 0;
45654
45655
45656     /* missing type support */
45657     return(test_ret);
45658 }
45659
45660
45661 static int
45662 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45663     int test_ret = 0;
45664
45665
45666     /* missing type support */
45667     return(test_ret);
45668 }
45669
45670
45671 static int
45672 test_xmlTextWriterWriteVFormatDTDElement(void) {
45673     int test_ret = 0;
45674
45675
45676     /* missing type support */
45677     return(test_ret);
45678 }
45679
45680
45681 static int
45682 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45683     int test_ret = 0;
45684
45685
45686     /* missing type support */
45687     return(test_ret);
45688 }
45689
45690
45691 static int
45692 test_xmlTextWriterWriteVFormatElement(void) {
45693     int test_ret = 0;
45694
45695
45696     /* missing type support */
45697     return(test_ret);
45698 }
45699
45700
45701 static int
45702 test_xmlTextWriterWriteVFormatElementNS(void) {
45703     int test_ret = 0;
45704
45705
45706     /* missing type support */
45707     return(test_ret);
45708 }
45709
45710
45711 static int
45712 test_xmlTextWriterWriteVFormatPI(void) {
45713     int test_ret = 0;
45714
45715
45716     /* missing type support */
45717     return(test_ret);
45718 }
45719
45720
45721 static int
45722 test_xmlTextWriterWriteVFormatRaw(void) {
45723     int test_ret = 0;
45724
45725
45726     /* missing type support */
45727     return(test_ret);
45728 }
45729
45730
45731 static int
45732 test_xmlTextWriterWriteVFormatString(void) {
45733     int test_ret = 0;
45734
45735
45736     /* missing type support */
45737     return(test_ret);
45738 }
45739
45740 static int
45741 test_xmlwriter(void) {
45742     int test_ret = 0;
45743
45744     if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
45745     test_ret += test_xmlNewTextWriter();
45746     test_ret += test_xmlNewTextWriterFilename();
45747     test_ret += test_xmlNewTextWriterMemory();
45748     test_ret += test_xmlNewTextWriterPushParser();
45749     test_ret += test_xmlNewTextWriterTree();
45750     test_ret += test_xmlTextWriterEndAttribute();
45751     test_ret += test_xmlTextWriterEndCDATA();
45752     test_ret += test_xmlTextWriterEndComment();
45753     test_ret += test_xmlTextWriterEndDTD();
45754     test_ret += test_xmlTextWriterEndDTDAttlist();
45755     test_ret += test_xmlTextWriterEndDTDElement();
45756     test_ret += test_xmlTextWriterEndDTDEntity();
45757     test_ret += test_xmlTextWriterEndDocument();
45758     test_ret += test_xmlTextWriterEndElement();
45759     test_ret += test_xmlTextWriterEndPI();
45760     test_ret += test_xmlTextWriterFlush();
45761     test_ret += test_xmlTextWriterFullEndElement();
45762     test_ret += test_xmlTextWriterSetIndent();
45763     test_ret += test_xmlTextWriterSetIndentString();
45764     test_ret += test_xmlTextWriterSetQuoteChar();
45765     test_ret += test_xmlTextWriterStartAttribute();
45766     test_ret += test_xmlTextWriterStartAttributeNS();
45767     test_ret += test_xmlTextWriterStartCDATA();
45768     test_ret += test_xmlTextWriterStartComment();
45769     test_ret += test_xmlTextWriterStartDTD();
45770     test_ret += test_xmlTextWriterStartDTDAttlist();
45771     test_ret += test_xmlTextWriterStartDTDElement();
45772     test_ret += test_xmlTextWriterStartDTDEntity();
45773     test_ret += test_xmlTextWriterStartDocument();
45774     test_ret += test_xmlTextWriterStartElement();
45775     test_ret += test_xmlTextWriterStartElementNS();
45776     test_ret += test_xmlTextWriterStartPI();
45777     test_ret += test_xmlTextWriterWriteAttribute();
45778     test_ret += test_xmlTextWriterWriteAttributeNS();
45779     test_ret += test_xmlTextWriterWriteBase64();
45780     test_ret += test_xmlTextWriterWriteBinHex();
45781     test_ret += test_xmlTextWriterWriteCDATA();
45782     test_ret += test_xmlTextWriterWriteComment();
45783     test_ret += test_xmlTextWriterWriteDTD();
45784     test_ret += test_xmlTextWriterWriteDTDAttlist();
45785     test_ret += test_xmlTextWriterWriteDTDElement();
45786     test_ret += test_xmlTextWriterWriteDTDEntity();
45787     test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45788     test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45789     test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45790     test_ret += test_xmlTextWriterWriteDTDNotation();
45791     test_ret += test_xmlTextWriterWriteElement();
45792     test_ret += test_xmlTextWriterWriteElementNS();
45793     test_ret += test_xmlTextWriterWriteFormatAttribute();
45794     test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45795     test_ret += test_xmlTextWriterWriteFormatCDATA();
45796     test_ret += test_xmlTextWriterWriteFormatComment();
45797     test_ret += test_xmlTextWriterWriteFormatDTD();
45798     test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45799     test_ret += test_xmlTextWriterWriteFormatDTDElement();
45800     test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45801     test_ret += test_xmlTextWriterWriteFormatElement();
45802     test_ret += test_xmlTextWriterWriteFormatElementNS();
45803     test_ret += test_xmlTextWriterWriteFormatPI();
45804     test_ret += test_xmlTextWriterWriteFormatRaw();
45805     test_ret += test_xmlTextWriterWriteFormatString();
45806     test_ret += test_xmlTextWriterWritePI();
45807     test_ret += test_xmlTextWriterWriteRaw();
45808     test_ret += test_xmlTextWriterWriteRawLen();
45809     test_ret += test_xmlTextWriterWriteString();
45810     test_ret += test_xmlTextWriterWriteVFormatAttribute();
45811     test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45812     test_ret += test_xmlTextWriterWriteVFormatCDATA();
45813     test_ret += test_xmlTextWriterWriteVFormatComment();
45814     test_ret += test_xmlTextWriterWriteVFormatDTD();
45815     test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45816     test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45817     test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45818     test_ret += test_xmlTextWriterWriteVFormatElement();
45819     test_ret += test_xmlTextWriterWriteVFormatElementNS();
45820     test_ret += test_xmlTextWriterWriteVFormatPI();
45821     test_ret += test_xmlTextWriterWriteVFormatRaw();
45822     test_ret += test_xmlTextWriterWriteVFormatString();
45823
45824     if (test_ret != 0)
45825         printf("Module xmlwriter: %d errors\n", test_ret);
45826     return(test_ret);
45827 }
45828
45829 static int
45830 test_xmlXPathCastBooleanToNumber(void) {
45831     int test_ret = 0;
45832
45833 #if defined(LIBXML_XPATH_ENABLED)
45834     int mem_base;
45835     double ret_val;
45836     int val; /* a boolean */
45837     int n_val;
45838
45839     for (n_val = 0;n_val < gen_nb_int;n_val++) {
45840         mem_base = xmlMemBlocks();
45841         val = gen_int(n_val, 0);
45842
45843         ret_val = xmlXPathCastBooleanToNumber(val);
45844         desret_double(ret_val);
45845         call_tests++;
45846         des_int(n_val, val, 0);
45847         xmlResetLastError();
45848         if (mem_base != xmlMemBlocks()) {
45849             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45850                    xmlMemBlocks() - mem_base);
45851             test_ret++;
45852             printf(" %d", n_val);
45853             printf("\n");
45854         }
45855     }
45856     function_tests++;
45857 #endif
45858
45859     return(test_ret);
45860 }
45861
45862
45863 static int
45864 test_xmlXPathCastBooleanToString(void) {
45865     int test_ret = 0;
45866
45867 #if defined(LIBXML_XPATH_ENABLED)
45868     int mem_base;
45869     xmlChar * ret_val;
45870     int val; /* a boolean */
45871     int n_val;
45872
45873     for (n_val = 0;n_val < gen_nb_int;n_val++) {
45874         mem_base = xmlMemBlocks();
45875         val = gen_int(n_val, 0);
45876
45877         ret_val = xmlXPathCastBooleanToString(val);
45878         desret_xmlChar_ptr(ret_val);
45879         call_tests++;
45880         des_int(n_val, val, 0);
45881         xmlResetLastError();
45882         if (mem_base != xmlMemBlocks()) {
45883             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45884                    xmlMemBlocks() - mem_base);
45885             test_ret++;
45886             printf(" %d", n_val);
45887             printf("\n");
45888         }
45889     }
45890     function_tests++;
45891 #endif
45892
45893     return(test_ret);
45894 }
45895
45896
45897 static int
45898 test_xmlXPathCastNodeSetToBoolean(void) {
45899     int test_ret = 0;
45900
45901 #if defined(LIBXML_XPATH_ENABLED)
45902     int mem_base;
45903     int ret_val;
45904     xmlNodeSetPtr ns; /* a node-set */
45905     int n_ns;
45906
45907     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45908         mem_base = xmlMemBlocks();
45909         ns = gen_xmlNodeSetPtr(n_ns, 0);
45910
45911         ret_val = xmlXPathCastNodeSetToBoolean(ns);
45912         desret_int(ret_val);
45913         call_tests++;
45914         des_xmlNodeSetPtr(n_ns, ns, 0);
45915         xmlResetLastError();
45916         if (mem_base != xmlMemBlocks()) {
45917             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45918                    xmlMemBlocks() - mem_base);
45919             test_ret++;
45920             printf(" %d", n_ns);
45921             printf("\n");
45922         }
45923     }
45924     function_tests++;
45925 #endif
45926
45927     return(test_ret);
45928 }
45929
45930
45931 static int
45932 test_xmlXPathCastNodeSetToNumber(void) {
45933     int test_ret = 0;
45934
45935 #if defined(LIBXML_XPATH_ENABLED)
45936     int mem_base;
45937     double ret_val;
45938     xmlNodeSetPtr ns; /* a node-set */
45939     int n_ns;
45940
45941     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45942         mem_base = xmlMemBlocks();
45943         ns = gen_xmlNodeSetPtr(n_ns, 0);
45944
45945         ret_val = xmlXPathCastNodeSetToNumber(ns);
45946         desret_double(ret_val);
45947         call_tests++;
45948         des_xmlNodeSetPtr(n_ns, ns, 0);
45949         xmlResetLastError();
45950         if (mem_base != xmlMemBlocks()) {
45951             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45952                    xmlMemBlocks() - mem_base);
45953             test_ret++;
45954             printf(" %d", n_ns);
45955             printf("\n");
45956         }
45957     }
45958     function_tests++;
45959 #endif
45960
45961     return(test_ret);
45962 }
45963
45964
45965 static int
45966 test_xmlXPathCastNodeSetToString(void) {
45967     int test_ret = 0;
45968
45969 #if defined(LIBXML_XPATH_ENABLED)
45970     int mem_base;
45971     xmlChar * ret_val;
45972     xmlNodeSetPtr ns; /* a node-set */
45973     int n_ns;
45974
45975     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45976         mem_base = xmlMemBlocks();
45977         ns = gen_xmlNodeSetPtr(n_ns, 0);
45978
45979         ret_val = xmlXPathCastNodeSetToString(ns);
45980         desret_xmlChar_ptr(ret_val);
45981         call_tests++;
45982         des_xmlNodeSetPtr(n_ns, ns, 0);
45983         xmlResetLastError();
45984         if (mem_base != xmlMemBlocks()) {
45985             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45986                    xmlMemBlocks() - mem_base);
45987             test_ret++;
45988             printf(" %d", n_ns);
45989             printf("\n");
45990         }
45991     }
45992     function_tests++;
45993 #endif
45994
45995     return(test_ret);
45996 }
45997
45998
45999 static int
46000 test_xmlXPathCastNodeToNumber(void) {
46001     int test_ret = 0;
46002
46003 #if defined(LIBXML_XPATH_ENABLED)
46004     int mem_base;
46005     double ret_val;
46006     xmlNodePtr node; /* a node */
46007     int n_node;
46008
46009     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46010         mem_base = xmlMemBlocks();
46011         node = gen_xmlNodePtr(n_node, 0);
46012
46013         ret_val = xmlXPathCastNodeToNumber(node);
46014         desret_double(ret_val);
46015         call_tests++;
46016         des_xmlNodePtr(n_node, node, 0);
46017         xmlResetLastError();
46018         if (mem_base != xmlMemBlocks()) {
46019             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
46020                    xmlMemBlocks() - mem_base);
46021             test_ret++;
46022             printf(" %d", n_node);
46023             printf("\n");
46024         }
46025     }
46026     function_tests++;
46027 #endif
46028
46029     return(test_ret);
46030 }
46031
46032
46033 static int
46034 test_xmlXPathCastNodeToString(void) {
46035     int test_ret = 0;
46036
46037 #if defined(LIBXML_XPATH_ENABLED)
46038     int mem_base;
46039     xmlChar * ret_val;
46040     xmlNodePtr node; /* a node */
46041     int n_node;
46042
46043     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46044         mem_base = xmlMemBlocks();
46045         node = gen_xmlNodePtr(n_node, 0);
46046
46047         ret_val = xmlXPathCastNodeToString(node);
46048         desret_xmlChar_ptr(ret_val);
46049         call_tests++;
46050         des_xmlNodePtr(n_node, node, 0);
46051         xmlResetLastError();
46052         if (mem_base != xmlMemBlocks()) {
46053             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
46054                    xmlMemBlocks() - mem_base);
46055             test_ret++;
46056             printf(" %d", n_node);
46057             printf("\n");
46058         }
46059     }
46060     function_tests++;
46061 #endif
46062
46063     return(test_ret);
46064 }
46065
46066
46067 static int
46068 test_xmlXPathCastNumberToBoolean(void) {
46069     int test_ret = 0;
46070
46071 #if defined(LIBXML_XPATH_ENABLED)
46072     int mem_base;
46073     int ret_val;
46074     double val; /* a number */
46075     int n_val;
46076
46077     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46078         mem_base = xmlMemBlocks();
46079         val = gen_double(n_val, 0);
46080
46081         ret_val = xmlXPathCastNumberToBoolean(val);
46082         desret_int(ret_val);
46083         call_tests++;
46084         des_double(n_val, val, 0);
46085         xmlResetLastError();
46086         if (mem_base != xmlMemBlocks()) {
46087             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
46088                    xmlMemBlocks() - mem_base);
46089             test_ret++;
46090             printf(" %d", n_val);
46091             printf("\n");
46092         }
46093     }
46094     function_tests++;
46095 #endif
46096
46097     return(test_ret);
46098 }
46099
46100
46101 static int
46102 test_xmlXPathCastNumberToString(void) {
46103     int test_ret = 0;
46104
46105 #if defined(LIBXML_XPATH_ENABLED)
46106     int mem_base;
46107     xmlChar * ret_val;
46108     double val; /* a number */
46109     int n_val;
46110
46111     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46112         mem_base = xmlMemBlocks();
46113         val = gen_double(n_val, 0);
46114
46115         ret_val = xmlXPathCastNumberToString(val);
46116         desret_xmlChar_ptr(ret_val);
46117         call_tests++;
46118         des_double(n_val, val, 0);
46119         xmlResetLastError();
46120         if (mem_base != xmlMemBlocks()) {
46121             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
46122                    xmlMemBlocks() - mem_base);
46123             test_ret++;
46124             printf(" %d", n_val);
46125             printf("\n");
46126         }
46127     }
46128     function_tests++;
46129 #endif
46130
46131     return(test_ret);
46132 }
46133
46134
46135 static int
46136 test_xmlXPathCastStringToBoolean(void) {
46137     int test_ret = 0;
46138
46139 #if defined(LIBXML_XPATH_ENABLED)
46140     int mem_base;
46141     int ret_val;
46142     xmlChar * val; /* a string */
46143     int n_val;
46144
46145     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46146         mem_base = xmlMemBlocks();
46147         val = gen_const_xmlChar_ptr(n_val, 0);
46148
46149         ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
46150         desret_int(ret_val);
46151         call_tests++;
46152         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46153         xmlResetLastError();
46154         if (mem_base != xmlMemBlocks()) {
46155             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
46156                    xmlMemBlocks() - mem_base);
46157             test_ret++;
46158             printf(" %d", n_val);
46159             printf("\n");
46160         }
46161     }
46162     function_tests++;
46163 #endif
46164
46165     return(test_ret);
46166 }
46167
46168
46169 static int
46170 test_xmlXPathCastStringToNumber(void) {
46171     int test_ret = 0;
46172
46173 #if defined(LIBXML_XPATH_ENABLED)
46174     int mem_base;
46175     double ret_val;
46176     xmlChar * val; /* a string */
46177     int n_val;
46178
46179     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
46180         mem_base = xmlMemBlocks();
46181         val = gen_const_xmlChar_ptr(n_val, 0);
46182
46183         ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
46184         desret_double(ret_val);
46185         call_tests++;
46186         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
46187         xmlResetLastError();
46188         if (mem_base != xmlMemBlocks()) {
46189             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
46190                    xmlMemBlocks() - mem_base);
46191             test_ret++;
46192             printf(" %d", n_val);
46193             printf("\n");
46194         }
46195     }
46196     function_tests++;
46197 #endif
46198
46199     return(test_ret);
46200 }
46201
46202
46203 static int
46204 test_xmlXPathCastToBoolean(void) {
46205     int test_ret = 0;
46206
46207 #if defined(LIBXML_XPATH_ENABLED)
46208     int mem_base;
46209     int ret_val;
46210     xmlXPathObjectPtr val; /* an XPath object */
46211     int n_val;
46212
46213     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46214         mem_base = xmlMemBlocks();
46215         val = gen_xmlXPathObjectPtr(n_val, 0);
46216
46217         ret_val = xmlXPathCastToBoolean(val);
46218         desret_int(ret_val);
46219         call_tests++;
46220         des_xmlXPathObjectPtr(n_val, val, 0);
46221         xmlResetLastError();
46222         if (mem_base != xmlMemBlocks()) {
46223             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
46224                    xmlMemBlocks() - mem_base);
46225             test_ret++;
46226             printf(" %d", n_val);
46227             printf("\n");
46228         }
46229     }
46230     function_tests++;
46231 #endif
46232
46233     return(test_ret);
46234 }
46235
46236
46237 static int
46238 test_xmlXPathCastToNumber(void) {
46239     int test_ret = 0;
46240
46241 #if defined(LIBXML_XPATH_ENABLED)
46242     int mem_base;
46243     double ret_val;
46244     xmlXPathObjectPtr val; /* an XPath object */
46245     int n_val;
46246
46247     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46248         mem_base = xmlMemBlocks();
46249         val = gen_xmlXPathObjectPtr(n_val, 0);
46250
46251         ret_val = xmlXPathCastToNumber(val);
46252         desret_double(ret_val);
46253         call_tests++;
46254         des_xmlXPathObjectPtr(n_val, val, 0);
46255         xmlResetLastError();
46256         if (mem_base != xmlMemBlocks()) {
46257             printf("Leak of %d blocks found in xmlXPathCastToNumber",
46258                    xmlMemBlocks() - mem_base);
46259             test_ret++;
46260             printf(" %d", n_val);
46261             printf("\n");
46262         }
46263     }
46264     function_tests++;
46265 #endif
46266
46267     return(test_ret);
46268 }
46269
46270
46271 static int
46272 test_xmlXPathCastToString(void) {
46273     int test_ret = 0;
46274
46275 #if defined(LIBXML_XPATH_ENABLED)
46276     int mem_base;
46277     xmlChar * ret_val;
46278     xmlXPathObjectPtr val; /* an XPath object */
46279     int n_val;
46280
46281     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46282         mem_base = xmlMemBlocks();
46283         val = gen_xmlXPathObjectPtr(n_val, 0);
46284
46285         ret_val = xmlXPathCastToString(val);
46286         desret_xmlChar_ptr(ret_val);
46287         call_tests++;
46288         des_xmlXPathObjectPtr(n_val, val, 0);
46289         xmlResetLastError();
46290         if (mem_base != xmlMemBlocks()) {
46291             printf("Leak of %d blocks found in xmlXPathCastToString",
46292                    xmlMemBlocks() - mem_base);
46293             test_ret++;
46294             printf(" %d", n_val);
46295             printf("\n");
46296         }
46297     }
46298     function_tests++;
46299 #endif
46300
46301     return(test_ret);
46302 }
46303
46304
46305 static int
46306 test_xmlXPathCmpNodes(void) {
46307     int test_ret = 0;
46308
46309 #if defined(LIBXML_XPATH_ENABLED)
46310     int mem_base;
46311     int ret_val;
46312     xmlNodePtr node1; /* the first node */
46313     int n_node1;
46314     xmlNodePtr node2; /* the second node */
46315     int n_node2;
46316
46317     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46318     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46319         mem_base = xmlMemBlocks();
46320         node1 = gen_xmlNodePtr(n_node1, 0);
46321         node2 = gen_xmlNodePtr(n_node2, 1);
46322
46323         ret_val = xmlXPathCmpNodes(node1, node2);
46324         desret_int(ret_val);
46325         call_tests++;
46326         des_xmlNodePtr(n_node1, node1, 0);
46327         des_xmlNodePtr(n_node2, node2, 1);
46328         xmlResetLastError();
46329         if (mem_base != xmlMemBlocks()) {
46330             printf("Leak of %d blocks found in xmlXPathCmpNodes",
46331                    xmlMemBlocks() - mem_base);
46332             test_ret++;
46333             printf(" %d", n_node1);
46334             printf(" %d", n_node2);
46335             printf("\n");
46336         }
46337     }
46338     }
46339     function_tests++;
46340 #endif
46341
46342     return(test_ret);
46343 }
46344
46345
46346 static int
46347 test_xmlXPathCompile(void) {
46348     int test_ret = 0;
46349
46350
46351     /* missing type support */
46352     return(test_ret);
46353 }
46354
46355 #ifdef LIBXML_XPATH_ENABLED
46356
46357 #define gen_nb_xmlXPathCompExprPtr 1
46358 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46359     return(NULL);
46360 }
46361 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46362 }
46363 #endif
46364
46365 #ifdef LIBXML_XPATH_ENABLED
46366
46367 #define gen_nb_xmlXPathContextPtr 1
46368 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46369     return(NULL);
46370 }
46371 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46372 }
46373 #endif
46374
46375
46376 static int
46377 test_xmlXPathCompiledEval(void) {
46378     int test_ret = 0;
46379
46380 #if defined(LIBXML_XPATH_ENABLED)
46381     int mem_base;
46382     xmlXPathObjectPtr ret_val;
46383     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46384     int n_comp;
46385     xmlXPathContextPtr ctx; /* the XPath context */
46386     int n_ctx;
46387
46388     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46389     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46390         mem_base = xmlMemBlocks();
46391         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46392         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46393
46394         ret_val = xmlXPathCompiledEval(comp, ctx);
46395         desret_xmlXPathObjectPtr(ret_val);
46396         call_tests++;
46397         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46398         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46399         xmlResetLastError();
46400         if (mem_base != xmlMemBlocks()) {
46401             printf("Leak of %d blocks found in xmlXPathCompiledEval",
46402                    xmlMemBlocks() - mem_base);
46403             test_ret++;
46404             printf(" %d", n_comp);
46405             printf(" %d", n_ctx);
46406             printf("\n");
46407         }
46408     }
46409     }
46410     function_tests++;
46411 #endif
46412
46413     return(test_ret);
46414 }
46415
46416
46417 static int
46418 test_xmlXPathCompiledEvalToBoolean(void) {
46419     int test_ret = 0;
46420
46421 #if defined(LIBXML_XPATH_ENABLED)
46422     int mem_base;
46423     int ret_val;
46424     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46425     int n_comp;
46426     xmlXPathContextPtr ctxt; /* the XPath context */
46427     int n_ctxt;
46428
46429     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46430     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46431         mem_base = xmlMemBlocks();
46432         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46433         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46434
46435         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46436         desret_int(ret_val);
46437         call_tests++;
46438         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46439         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46440         xmlResetLastError();
46441         if (mem_base != xmlMemBlocks()) {
46442             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46443                    xmlMemBlocks() - mem_base);
46444             test_ret++;
46445             printf(" %d", n_comp);
46446             printf(" %d", n_ctxt);
46447             printf("\n");
46448         }
46449     }
46450     }
46451     function_tests++;
46452 #endif
46453
46454     return(test_ret);
46455 }
46456
46457
46458 static int
46459 test_xmlXPathContextSetCache(void) {
46460     int test_ret = 0;
46461
46462 #if defined(LIBXML_XPATH_ENABLED)
46463     int mem_base;
46464     int ret_val;
46465     xmlXPathContextPtr ctxt; /* the XPath context */
46466     int n_ctxt;
46467     int active; /* enables/disables (creates/frees) the cache */
46468     int n_active;
46469     int value; /* a value with semantics dependant on @options */
46470     int n_value;
46471     int options; /* options (currently only the value 0 is used) */
46472     int n_options;
46473
46474     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46475     for (n_active = 0;n_active < gen_nb_int;n_active++) {
46476     for (n_value = 0;n_value < gen_nb_int;n_value++) {
46477     for (n_options = 0;n_options < gen_nb_int;n_options++) {
46478         mem_base = xmlMemBlocks();
46479         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46480         active = gen_int(n_active, 1);
46481         value = gen_int(n_value, 2);
46482         options = gen_int(n_options, 3);
46483
46484         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46485         desret_int(ret_val);
46486         call_tests++;
46487         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46488         des_int(n_active, active, 1);
46489         des_int(n_value, value, 2);
46490         des_int(n_options, options, 3);
46491         xmlResetLastError();
46492         if (mem_base != xmlMemBlocks()) {
46493             printf("Leak of %d blocks found in xmlXPathContextSetCache",
46494                    xmlMemBlocks() - mem_base);
46495             test_ret++;
46496             printf(" %d", n_ctxt);
46497             printf(" %d", n_active);
46498             printf(" %d", n_value);
46499             printf(" %d", n_options);
46500             printf("\n");
46501         }
46502     }
46503     }
46504     }
46505     }
46506     function_tests++;
46507 #endif
46508
46509     return(test_ret);
46510 }
46511
46512
46513 static int
46514 test_xmlXPathConvertBoolean(void) {
46515     int test_ret = 0;
46516
46517 #if defined(LIBXML_XPATH_ENABLED)
46518     int mem_base;
46519     xmlXPathObjectPtr ret_val;
46520     xmlXPathObjectPtr val; /* an XPath object */
46521     int n_val;
46522
46523     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46524         mem_base = xmlMemBlocks();
46525         val = gen_xmlXPathObjectPtr(n_val, 0);
46526
46527         ret_val = xmlXPathConvertBoolean(val);
46528         val = NULL;
46529         desret_xmlXPathObjectPtr(ret_val);
46530         call_tests++;
46531         des_xmlXPathObjectPtr(n_val, val, 0);
46532         xmlResetLastError();
46533         if (mem_base != xmlMemBlocks()) {
46534             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46535                    xmlMemBlocks() - mem_base);
46536             test_ret++;
46537             printf(" %d", n_val);
46538             printf("\n");
46539         }
46540     }
46541     function_tests++;
46542 #endif
46543
46544     return(test_ret);
46545 }
46546
46547
46548 static int
46549 test_xmlXPathConvertNumber(void) {
46550     int test_ret = 0;
46551
46552 #if defined(LIBXML_XPATH_ENABLED)
46553     int mem_base;
46554     xmlXPathObjectPtr ret_val;
46555     xmlXPathObjectPtr val; /* an XPath object */
46556     int n_val;
46557
46558     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46559         mem_base = xmlMemBlocks();
46560         val = gen_xmlXPathObjectPtr(n_val, 0);
46561
46562         ret_val = xmlXPathConvertNumber(val);
46563         val = NULL;
46564         desret_xmlXPathObjectPtr(ret_val);
46565         call_tests++;
46566         des_xmlXPathObjectPtr(n_val, val, 0);
46567         xmlResetLastError();
46568         if (mem_base != xmlMemBlocks()) {
46569             printf("Leak of %d blocks found in xmlXPathConvertNumber",
46570                    xmlMemBlocks() - mem_base);
46571             test_ret++;
46572             printf(" %d", n_val);
46573             printf("\n");
46574         }
46575     }
46576     function_tests++;
46577 #endif
46578
46579     return(test_ret);
46580 }
46581
46582
46583 static int
46584 test_xmlXPathConvertString(void) {
46585     int test_ret = 0;
46586
46587 #if defined(LIBXML_XPATH_ENABLED)
46588     int mem_base;
46589     xmlXPathObjectPtr ret_val;
46590     xmlXPathObjectPtr val; /* an XPath object */
46591     int n_val;
46592
46593     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46594         mem_base = xmlMemBlocks();
46595         val = gen_xmlXPathObjectPtr(n_val, 0);
46596
46597         ret_val = xmlXPathConvertString(val);
46598         val = NULL;
46599         desret_xmlXPathObjectPtr(ret_val);
46600         call_tests++;
46601         des_xmlXPathObjectPtr(n_val, val, 0);
46602         xmlResetLastError();
46603         if (mem_base != xmlMemBlocks()) {
46604             printf("Leak of %d blocks found in xmlXPathConvertString",
46605                    xmlMemBlocks() - mem_base);
46606             test_ret++;
46607             printf(" %d", n_val);
46608             printf("\n");
46609         }
46610     }
46611     function_tests++;
46612 #endif
46613
46614     return(test_ret);
46615 }
46616
46617
46618 static int
46619 test_xmlXPathCtxtCompile(void) {
46620     int test_ret = 0;
46621
46622
46623     /* missing type support */
46624     return(test_ret);
46625 }
46626
46627
46628 static int
46629 test_xmlXPathEval(void) {
46630     int test_ret = 0;
46631
46632 #if defined(LIBXML_XPATH_ENABLED)
46633     int mem_base;
46634     xmlXPathObjectPtr ret_val;
46635     xmlChar * str; /* the XPath expression */
46636     int n_str;
46637     xmlXPathContextPtr ctx; /* the XPath context */
46638     int n_ctx;
46639
46640     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46641     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46642         mem_base = xmlMemBlocks();
46643         str = gen_const_xmlChar_ptr(n_str, 0);
46644         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46645
46646         ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46647         desret_xmlXPathObjectPtr(ret_val);
46648         call_tests++;
46649         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46650         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46651         xmlResetLastError();
46652         if (mem_base != xmlMemBlocks()) {
46653             printf("Leak of %d blocks found in xmlXPathEval",
46654                    xmlMemBlocks() - mem_base);
46655             test_ret++;
46656             printf(" %d", n_str);
46657             printf(" %d", n_ctx);
46658             printf("\n");
46659         }
46660     }
46661     }
46662     function_tests++;
46663 #endif
46664
46665     return(test_ret);
46666 }
46667
46668
46669 static int
46670 test_xmlXPathEvalExpression(void) {
46671     int test_ret = 0;
46672
46673 #if defined(LIBXML_XPATH_ENABLED)
46674     int mem_base;
46675     xmlXPathObjectPtr ret_val;
46676     xmlChar * str; /* the XPath expression */
46677     int n_str;
46678     xmlXPathContextPtr ctxt; /* the XPath context */
46679     int n_ctxt;
46680
46681     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46682     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46683         mem_base = xmlMemBlocks();
46684         str = gen_const_xmlChar_ptr(n_str, 0);
46685         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46686
46687         ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46688         desret_xmlXPathObjectPtr(ret_val);
46689         call_tests++;
46690         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46691         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46692         xmlResetLastError();
46693         if (mem_base != xmlMemBlocks()) {
46694             printf("Leak of %d blocks found in xmlXPathEvalExpression",
46695                    xmlMemBlocks() - mem_base);
46696             test_ret++;
46697             printf(" %d", n_str);
46698             printf(" %d", n_ctxt);
46699             printf("\n");
46700         }
46701     }
46702     }
46703     function_tests++;
46704 #endif
46705
46706     return(test_ret);
46707 }
46708
46709
46710 static int
46711 test_xmlXPathEvalPredicate(void) {
46712     int test_ret = 0;
46713
46714 #if defined(LIBXML_XPATH_ENABLED)
46715     int mem_base;
46716     int ret_val;
46717     xmlXPathContextPtr ctxt; /* the XPath context */
46718     int n_ctxt;
46719     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46720     int n_res;
46721
46722     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46723     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46724         mem_base = xmlMemBlocks();
46725         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46726         res = gen_xmlXPathObjectPtr(n_res, 1);
46727
46728         ret_val = xmlXPathEvalPredicate(ctxt, res);
46729         desret_int(ret_val);
46730         call_tests++;
46731         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46732         des_xmlXPathObjectPtr(n_res, res, 1);
46733         xmlResetLastError();
46734         if (mem_base != xmlMemBlocks()) {
46735             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46736                    xmlMemBlocks() - mem_base);
46737             test_ret++;
46738             printf(" %d", n_ctxt);
46739             printf(" %d", n_res);
46740             printf("\n");
46741         }
46742     }
46743     }
46744     function_tests++;
46745 #endif
46746
46747     return(test_ret);
46748 }
46749
46750
46751 static int
46752 test_xmlXPathInit(void) {
46753     int test_ret = 0;
46754
46755 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46756     int mem_base;
46757
46758         mem_base = xmlMemBlocks();
46759
46760         xmlXPathInit();
46761         call_tests++;
46762         xmlResetLastError();
46763         if (mem_base != xmlMemBlocks()) {
46764             printf("Leak of %d blocks found in xmlXPathInit",
46765                    xmlMemBlocks() - mem_base);
46766             test_ret++;
46767             printf("\n");
46768         }
46769     function_tests++;
46770 #endif
46771
46772     return(test_ret);
46773 }
46774
46775
46776 static int
46777 test_xmlXPathIsInf(void) {
46778     int test_ret = 0;
46779
46780 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46781     int mem_base;
46782     int ret_val;
46783     double val; /* a double value */
46784     int n_val;
46785
46786     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46787         mem_base = xmlMemBlocks();
46788         val = gen_double(n_val, 0);
46789
46790         ret_val = xmlXPathIsInf(val);
46791         desret_int(ret_val);
46792         call_tests++;
46793         des_double(n_val, val, 0);
46794         xmlResetLastError();
46795         if (mem_base != xmlMemBlocks()) {
46796             printf("Leak of %d blocks found in xmlXPathIsInf",
46797                    xmlMemBlocks() - mem_base);
46798             test_ret++;
46799             printf(" %d", n_val);
46800             printf("\n");
46801         }
46802     }
46803     function_tests++;
46804 #endif
46805
46806     return(test_ret);
46807 }
46808
46809
46810 static int
46811 test_xmlXPathIsNaN(void) {
46812     int test_ret = 0;
46813
46814 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46815     int mem_base;
46816     int ret_val;
46817     double val; /* a double value */
46818     int n_val;
46819
46820     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46821         mem_base = xmlMemBlocks();
46822         val = gen_double(n_val, 0);
46823
46824         ret_val = xmlXPathIsNaN(val);
46825         desret_int(ret_val);
46826         call_tests++;
46827         des_double(n_val, val, 0);
46828         xmlResetLastError();
46829         if (mem_base != xmlMemBlocks()) {
46830             printf("Leak of %d blocks found in xmlXPathIsNaN",
46831                    xmlMemBlocks() - mem_base);
46832             test_ret++;
46833             printf(" %d", n_val);
46834             printf("\n");
46835         }
46836     }
46837     function_tests++;
46838 #endif
46839
46840     return(test_ret);
46841 }
46842
46843
46844 static int
46845 test_xmlXPathNewContext(void) {
46846     int test_ret = 0;
46847
46848
46849     /* missing type support */
46850     return(test_ret);
46851 }
46852
46853
46854 static int
46855 test_xmlXPathNodeEval(void) {
46856     int test_ret = 0;
46857
46858 #if defined(LIBXML_XPATH_ENABLED)
46859     int mem_base;
46860     xmlXPathObjectPtr ret_val;
46861     xmlNodePtr node; /* the node to to use as the context node */
46862     int n_node;
46863     xmlChar * str; /* the XPath expression */
46864     int n_str;
46865     xmlXPathContextPtr ctx; /* the XPath context */
46866     int n_ctx;
46867
46868     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46869     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46870     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46871         mem_base = xmlMemBlocks();
46872         node = gen_xmlNodePtr(n_node, 0);
46873         str = gen_const_xmlChar_ptr(n_str, 1);
46874         ctx = gen_xmlXPathContextPtr(n_ctx, 2);
46875
46876         ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
46877         desret_xmlXPathObjectPtr(ret_val);
46878         call_tests++;
46879         des_xmlNodePtr(n_node, node, 0);
46880         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
46881         des_xmlXPathContextPtr(n_ctx, ctx, 2);
46882         xmlResetLastError();
46883         if (mem_base != xmlMemBlocks()) {
46884             printf("Leak of %d blocks found in xmlXPathNodeEval",
46885                    xmlMemBlocks() - mem_base);
46886             test_ret++;
46887             printf(" %d", n_node);
46888             printf(" %d", n_str);
46889             printf(" %d", n_ctx);
46890             printf("\n");
46891         }
46892     }
46893     }
46894     }
46895     function_tests++;
46896 #endif
46897
46898     return(test_ret);
46899 }
46900
46901
46902 static int
46903 test_xmlXPathNodeSetCreate(void) {
46904     int test_ret = 0;
46905
46906 #if defined(LIBXML_XPATH_ENABLED)
46907     int mem_base;
46908     xmlNodeSetPtr ret_val;
46909     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46910     int n_val;
46911
46912     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46913         mem_base = xmlMemBlocks();
46914         val = gen_xmlNodePtr(n_val, 0);
46915
46916         ret_val = xmlXPathNodeSetCreate(val);
46917         desret_xmlNodeSetPtr(ret_val);
46918         call_tests++;
46919         des_xmlNodePtr(n_val, val, 0);
46920         xmlResetLastError();
46921         if (mem_base != xmlMemBlocks()) {
46922             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46923                    xmlMemBlocks() - mem_base);
46924             test_ret++;
46925             printf(" %d", n_val);
46926             printf("\n");
46927         }
46928     }
46929     function_tests++;
46930 #endif
46931
46932     return(test_ret);
46933 }
46934
46935
46936 static int
46937 test_xmlXPathObjectCopy(void) {
46938     int test_ret = 0;
46939
46940 #if defined(LIBXML_XPATH_ENABLED)
46941     int mem_base;
46942     xmlXPathObjectPtr ret_val;
46943     xmlXPathObjectPtr val; /* the original object */
46944     int n_val;
46945
46946     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46947         mem_base = xmlMemBlocks();
46948         val = gen_xmlXPathObjectPtr(n_val, 0);
46949
46950         ret_val = xmlXPathObjectCopy(val);
46951         desret_xmlXPathObjectPtr(ret_val);
46952         call_tests++;
46953         des_xmlXPathObjectPtr(n_val, val, 0);
46954         xmlResetLastError();
46955         if (mem_base != xmlMemBlocks()) {
46956             printf("Leak of %d blocks found in xmlXPathObjectCopy",
46957                    xmlMemBlocks() - mem_base);
46958             test_ret++;
46959             printf(" %d", n_val);
46960             printf("\n");
46961         }
46962     }
46963     function_tests++;
46964 #endif
46965
46966     return(test_ret);
46967 }
46968
46969
46970 static int
46971 test_xmlXPathOrderDocElems(void) {
46972     int test_ret = 0;
46973
46974 #if defined(LIBXML_XPATH_ENABLED)
46975     int mem_base;
46976     long ret_val;
46977     xmlDocPtr doc; /* an input document */
46978     int n_doc;
46979
46980     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46981         mem_base = xmlMemBlocks();
46982         doc = gen_xmlDocPtr(n_doc, 0);
46983
46984         ret_val = xmlXPathOrderDocElems(doc);
46985         desret_long(ret_val);
46986         call_tests++;
46987         des_xmlDocPtr(n_doc, doc, 0);
46988         xmlResetLastError();
46989         if (mem_base != xmlMemBlocks()) {
46990             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46991                    xmlMemBlocks() - mem_base);
46992             test_ret++;
46993             printf(" %d", n_doc);
46994             printf("\n");
46995         }
46996     }
46997     function_tests++;
46998 #endif
46999
47000     return(test_ret);
47001 }
47002
47003
47004 static int
47005 test_xmlXPathSetContextNode(void) {
47006     int test_ret = 0;
47007
47008 #if defined(LIBXML_XPATH_ENABLED)
47009     int mem_base;
47010     int ret_val;
47011     xmlNodePtr node; /* the node to to use as the context node */
47012     int n_node;
47013     xmlXPathContextPtr ctx; /* the XPath context */
47014     int n_ctx;
47015
47016     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47017     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47018         mem_base = xmlMemBlocks();
47019         node = gen_xmlNodePtr(n_node, 0);
47020         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47021
47022         ret_val = xmlXPathSetContextNode(node, ctx);
47023         desret_int(ret_val);
47024         call_tests++;
47025         des_xmlNodePtr(n_node, node, 0);
47026         des_xmlXPathContextPtr(n_ctx, ctx, 1);
47027         xmlResetLastError();
47028         if (mem_base != xmlMemBlocks()) {
47029             printf("Leak of %d blocks found in xmlXPathSetContextNode",
47030                    xmlMemBlocks() - mem_base);
47031             test_ret++;
47032             printf(" %d", n_node);
47033             printf(" %d", n_ctx);
47034             printf("\n");
47035         }
47036     }
47037     }
47038     function_tests++;
47039 #endif
47040
47041     return(test_ret);
47042 }
47043
47044 static int
47045 test_xpath(void) {
47046     int test_ret = 0;
47047
47048     if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
47049     test_ret += test_xmlXPathCastBooleanToNumber();
47050     test_ret += test_xmlXPathCastBooleanToString();
47051     test_ret += test_xmlXPathCastNodeSetToBoolean();
47052     test_ret += test_xmlXPathCastNodeSetToNumber();
47053     test_ret += test_xmlXPathCastNodeSetToString();
47054     test_ret += test_xmlXPathCastNodeToNumber();
47055     test_ret += test_xmlXPathCastNodeToString();
47056     test_ret += test_xmlXPathCastNumberToBoolean();
47057     test_ret += test_xmlXPathCastNumberToString();
47058     test_ret += test_xmlXPathCastStringToBoolean();
47059     test_ret += test_xmlXPathCastStringToNumber();
47060     test_ret += test_xmlXPathCastToBoolean();
47061     test_ret += test_xmlXPathCastToNumber();
47062     test_ret += test_xmlXPathCastToString();
47063     test_ret += test_xmlXPathCmpNodes();
47064     test_ret += test_xmlXPathCompile();
47065     test_ret += test_xmlXPathCompiledEval();
47066     test_ret += test_xmlXPathCompiledEvalToBoolean();
47067     test_ret += test_xmlXPathContextSetCache();
47068     test_ret += test_xmlXPathConvertBoolean();
47069     test_ret += test_xmlXPathConvertNumber();
47070     test_ret += test_xmlXPathConvertString();
47071     test_ret += test_xmlXPathCtxtCompile();
47072     test_ret += test_xmlXPathEval();
47073     test_ret += test_xmlXPathEvalExpression();
47074     test_ret += test_xmlXPathEvalPredicate();
47075     test_ret += test_xmlXPathInit();
47076     test_ret += test_xmlXPathIsInf();
47077     test_ret += test_xmlXPathIsNaN();
47078     test_ret += test_xmlXPathNewContext();
47079     test_ret += test_xmlXPathNodeEval();
47080     test_ret += test_xmlXPathNodeSetCreate();
47081     test_ret += test_xmlXPathObjectCopy();
47082     test_ret += test_xmlXPathOrderDocElems();
47083     test_ret += test_xmlXPathSetContextNode();
47084
47085     if (test_ret != 0)
47086         printf("Module xpath: %d errors\n", test_ret);
47087     return(test_ret);
47088 }
47089 #ifdef LIBXML_XPATH_ENABLED
47090
47091 #define gen_nb_xmlXPathParserContextPtr 1
47092 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47093     return(NULL);
47094 }
47095 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47096 }
47097 #endif
47098
47099
47100 static int
47101 test_valuePop(void) {
47102     int test_ret = 0;
47103
47104 #if defined(LIBXML_XPATH_ENABLED)
47105     int mem_base;
47106     xmlXPathObjectPtr ret_val;
47107     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47108     int n_ctxt;
47109
47110     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47111         mem_base = xmlMemBlocks();
47112         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47113
47114         ret_val = valuePop(ctxt);
47115         desret_xmlXPathObjectPtr(ret_val);
47116         call_tests++;
47117         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47118         xmlResetLastError();
47119         if (mem_base != xmlMemBlocks()) {
47120             printf("Leak of %d blocks found in valuePop",
47121                    xmlMemBlocks() - mem_base);
47122             test_ret++;
47123             printf(" %d", n_ctxt);
47124             printf("\n");
47125         }
47126     }
47127     function_tests++;
47128 #endif
47129
47130     return(test_ret);
47131 }
47132
47133
47134 static int
47135 test_valuePush(void) {
47136     int test_ret = 0;
47137
47138 #if defined(LIBXML_XPATH_ENABLED)
47139     int mem_base;
47140     int ret_val;
47141     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
47142     int n_ctxt;
47143     xmlXPathObjectPtr value; /* the XPath object */
47144     int n_value;
47145
47146     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47147     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47148         mem_base = xmlMemBlocks();
47149         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47150         value = gen_xmlXPathObjectPtr(n_value, 1);
47151
47152         ret_val = valuePush(ctxt, value);
47153         desret_int(ret_val);
47154         call_tests++;
47155         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47156         des_xmlXPathObjectPtr(n_value, value, 1);
47157         xmlResetLastError();
47158         if (mem_base != xmlMemBlocks()) {
47159             printf("Leak of %d blocks found in valuePush",
47160                    xmlMemBlocks() - mem_base);
47161             test_ret++;
47162             printf(" %d", n_ctxt);
47163             printf(" %d", n_value);
47164             printf("\n");
47165         }
47166     }
47167     }
47168     function_tests++;
47169 #endif
47170
47171     return(test_ret);
47172 }
47173
47174
47175 static int
47176 test_xmlXPathAddValues(void) {
47177     int test_ret = 0;
47178
47179 #if defined(LIBXML_XPATH_ENABLED)
47180     int mem_base;
47181     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47182     int n_ctxt;
47183
47184     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47185         mem_base = xmlMemBlocks();
47186         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47187
47188         xmlXPathAddValues(ctxt);
47189         call_tests++;
47190         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47191         xmlResetLastError();
47192         if (mem_base != xmlMemBlocks()) {
47193             printf("Leak of %d blocks found in xmlXPathAddValues",
47194                    xmlMemBlocks() - mem_base);
47195             test_ret++;
47196             printf(" %d", n_ctxt);
47197             printf("\n");
47198         }
47199     }
47200     function_tests++;
47201 #endif
47202
47203     return(test_ret);
47204 }
47205
47206
47207 static int
47208 test_xmlXPathBooleanFunction(void) {
47209     int test_ret = 0;
47210
47211 #if defined(LIBXML_XPATH_ENABLED)
47212     int mem_base;
47213     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47214     int n_ctxt;
47215     int nargs; /* the number of arguments */
47216     int n_nargs;
47217
47218     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47219     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47220         mem_base = xmlMemBlocks();
47221         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47222         nargs = gen_int(n_nargs, 1);
47223
47224         xmlXPathBooleanFunction(ctxt, nargs);
47225         call_tests++;
47226         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47227         des_int(n_nargs, nargs, 1);
47228         xmlResetLastError();
47229         if (mem_base != xmlMemBlocks()) {
47230             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
47231                    xmlMemBlocks() - mem_base);
47232             test_ret++;
47233             printf(" %d", n_ctxt);
47234             printf(" %d", n_nargs);
47235             printf("\n");
47236         }
47237     }
47238     }
47239     function_tests++;
47240 #endif
47241
47242     return(test_ret);
47243 }
47244
47245
47246 static int
47247 test_xmlXPathCeilingFunction(void) {
47248     int test_ret = 0;
47249
47250 #if defined(LIBXML_XPATH_ENABLED)
47251     int mem_base;
47252     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47253     int n_ctxt;
47254     int nargs; /* the number of arguments */
47255     int n_nargs;
47256
47257     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47258     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47259         mem_base = xmlMemBlocks();
47260         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47261         nargs = gen_int(n_nargs, 1);
47262
47263         xmlXPathCeilingFunction(ctxt, nargs);
47264         call_tests++;
47265         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47266         des_int(n_nargs, nargs, 1);
47267         xmlResetLastError();
47268         if (mem_base != xmlMemBlocks()) {
47269             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
47270                    xmlMemBlocks() - mem_base);
47271             test_ret++;
47272             printf(" %d", n_ctxt);
47273             printf(" %d", n_nargs);
47274             printf("\n");
47275         }
47276     }
47277     }
47278     function_tests++;
47279 #endif
47280
47281     return(test_ret);
47282 }
47283
47284
47285 static int
47286 test_xmlXPathCompareValues(void) {
47287     int test_ret = 0;
47288
47289 #if defined(LIBXML_XPATH_ENABLED)
47290     int mem_base;
47291     int ret_val;
47292     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47293     int n_ctxt;
47294     int inf; /* less than (1) or greater than (0) */
47295     int n_inf;
47296     int strict; /* is the comparison strict */
47297     int n_strict;
47298
47299     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47300     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
47301     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
47302         mem_base = xmlMemBlocks();
47303         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47304         inf = gen_int(n_inf, 1);
47305         strict = gen_int(n_strict, 2);
47306
47307         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
47308         desret_int(ret_val);
47309         call_tests++;
47310         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47311         des_int(n_inf, inf, 1);
47312         des_int(n_strict, strict, 2);
47313         xmlResetLastError();
47314         if (mem_base != xmlMemBlocks()) {
47315             printf("Leak of %d blocks found in xmlXPathCompareValues",
47316                    xmlMemBlocks() - mem_base);
47317             test_ret++;
47318             printf(" %d", n_ctxt);
47319             printf(" %d", n_inf);
47320             printf(" %d", n_strict);
47321             printf("\n");
47322         }
47323     }
47324     }
47325     }
47326     function_tests++;
47327 #endif
47328
47329     return(test_ret);
47330 }
47331
47332
47333 static int
47334 test_xmlXPathConcatFunction(void) {
47335     int test_ret = 0;
47336
47337 #if defined(LIBXML_XPATH_ENABLED)
47338     int mem_base;
47339     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47340     int n_ctxt;
47341     int nargs; /* the number of arguments */
47342     int n_nargs;
47343
47344     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47345     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47346         mem_base = xmlMemBlocks();
47347         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47348         nargs = gen_int(n_nargs, 1);
47349
47350         xmlXPathConcatFunction(ctxt, nargs);
47351         call_tests++;
47352         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47353         des_int(n_nargs, nargs, 1);
47354         xmlResetLastError();
47355         if (mem_base != xmlMemBlocks()) {
47356             printf("Leak of %d blocks found in xmlXPathConcatFunction",
47357                    xmlMemBlocks() - mem_base);
47358             test_ret++;
47359             printf(" %d", n_ctxt);
47360             printf(" %d", n_nargs);
47361             printf("\n");
47362         }
47363     }
47364     }
47365     function_tests++;
47366 #endif
47367
47368     return(test_ret);
47369 }
47370
47371
47372 static int
47373 test_xmlXPathContainsFunction(void) {
47374     int test_ret = 0;
47375
47376 #if defined(LIBXML_XPATH_ENABLED)
47377     int mem_base;
47378     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47379     int n_ctxt;
47380     int nargs; /* the number of arguments */
47381     int n_nargs;
47382
47383     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47384     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47385         mem_base = xmlMemBlocks();
47386         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47387         nargs = gen_int(n_nargs, 1);
47388
47389         xmlXPathContainsFunction(ctxt, nargs);
47390         call_tests++;
47391         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47392         des_int(n_nargs, nargs, 1);
47393         xmlResetLastError();
47394         if (mem_base != xmlMemBlocks()) {
47395             printf("Leak of %d blocks found in xmlXPathContainsFunction",
47396                    xmlMemBlocks() - mem_base);
47397             test_ret++;
47398             printf(" %d", n_ctxt);
47399             printf(" %d", n_nargs);
47400             printf("\n");
47401         }
47402     }
47403     }
47404     function_tests++;
47405 #endif
47406
47407     return(test_ret);
47408 }
47409
47410
47411 static int
47412 test_xmlXPathCountFunction(void) {
47413     int test_ret = 0;
47414
47415 #if defined(LIBXML_XPATH_ENABLED)
47416     int mem_base;
47417     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47418     int n_ctxt;
47419     int nargs; /* the number of arguments */
47420     int n_nargs;
47421
47422     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47423     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47424         mem_base = xmlMemBlocks();
47425         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47426         nargs = gen_int(n_nargs, 1);
47427
47428         xmlXPathCountFunction(ctxt, nargs);
47429         call_tests++;
47430         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47431         des_int(n_nargs, nargs, 1);
47432         xmlResetLastError();
47433         if (mem_base != xmlMemBlocks()) {
47434             printf("Leak of %d blocks found in xmlXPathCountFunction",
47435                    xmlMemBlocks() - mem_base);
47436             test_ret++;
47437             printf(" %d", n_ctxt);
47438             printf(" %d", n_nargs);
47439             printf("\n");
47440         }
47441     }
47442     }
47443     function_tests++;
47444 #endif
47445
47446     return(test_ret);
47447 }
47448
47449
47450 static int
47451 test_xmlXPathDebugDumpCompExpr(void) {
47452     int test_ret = 0;
47453
47454 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47455     int mem_base;
47456     FILE * output; /* the FILE * for the output */
47457     int n_output;
47458     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47459     int n_comp;
47460     int depth; /* the indentation level. */
47461     int n_depth;
47462
47463     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47464     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47465     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47466         mem_base = xmlMemBlocks();
47467         output = gen_FILE_ptr(n_output, 0);
47468         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47469         depth = gen_int(n_depth, 2);
47470
47471         xmlXPathDebugDumpCompExpr(output, comp, depth);
47472         call_tests++;
47473         des_FILE_ptr(n_output, output, 0);
47474         des_xmlXPathCompExprPtr(n_comp, comp, 1);
47475         des_int(n_depth, depth, 2);
47476         xmlResetLastError();
47477         if (mem_base != xmlMemBlocks()) {
47478             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47479                    xmlMemBlocks() - mem_base);
47480             test_ret++;
47481             printf(" %d", n_output);
47482             printf(" %d", n_comp);
47483             printf(" %d", n_depth);
47484             printf("\n");
47485         }
47486     }
47487     }
47488     }
47489     function_tests++;
47490 #endif
47491
47492     return(test_ret);
47493 }
47494
47495
47496 static int
47497 test_xmlXPathDebugDumpObject(void) {
47498     int test_ret = 0;
47499
47500 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47501     int mem_base;
47502     FILE * output; /* the FILE * to dump the output */
47503     int n_output;
47504     xmlXPathObjectPtr cur; /* the object to inspect */
47505     int n_cur;
47506     int depth; /* indentation level */
47507     int n_depth;
47508
47509     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47510     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47511     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47512         mem_base = xmlMemBlocks();
47513         output = gen_FILE_ptr(n_output, 0);
47514         cur = gen_xmlXPathObjectPtr(n_cur, 1);
47515         depth = gen_int(n_depth, 2);
47516
47517         xmlXPathDebugDumpObject(output, cur, depth);
47518         call_tests++;
47519         des_FILE_ptr(n_output, output, 0);
47520         des_xmlXPathObjectPtr(n_cur, cur, 1);
47521         des_int(n_depth, depth, 2);
47522         xmlResetLastError();
47523         if (mem_base != xmlMemBlocks()) {
47524             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47525                    xmlMemBlocks() - mem_base);
47526             test_ret++;
47527             printf(" %d", n_output);
47528             printf(" %d", n_cur);
47529             printf(" %d", n_depth);
47530             printf("\n");
47531         }
47532     }
47533     }
47534     }
47535     function_tests++;
47536 #endif
47537
47538     return(test_ret);
47539 }
47540
47541
47542 static int
47543 test_xmlXPathDifference(void) {
47544     int test_ret = 0;
47545
47546 #if defined(LIBXML_XPATH_ENABLED)
47547     int mem_base;
47548     xmlNodeSetPtr ret_val;
47549     xmlNodeSetPtr nodes1; /* a node-set */
47550     int n_nodes1;
47551     xmlNodeSetPtr nodes2; /* a node-set */
47552     int n_nodes2;
47553
47554     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47555     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47556         mem_base = xmlMemBlocks();
47557         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47558         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47559
47560         ret_val = xmlXPathDifference(nodes1, nodes2);
47561         desret_xmlNodeSetPtr(ret_val);
47562         call_tests++;
47563         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47564         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47565         xmlResetLastError();
47566         if (mem_base != xmlMemBlocks()) {
47567             printf("Leak of %d blocks found in xmlXPathDifference",
47568                    xmlMemBlocks() - mem_base);
47569             test_ret++;
47570             printf(" %d", n_nodes1);
47571             printf(" %d", n_nodes2);
47572             printf("\n");
47573         }
47574     }
47575     }
47576     function_tests++;
47577 #endif
47578
47579     return(test_ret);
47580 }
47581
47582
47583 static int
47584 test_xmlXPathDistinct(void) {
47585     int test_ret = 0;
47586
47587 #if defined(LIBXML_XPATH_ENABLED)
47588     int mem_base;
47589     xmlNodeSetPtr ret_val;
47590     xmlNodeSetPtr nodes; /* a node-set */
47591     int n_nodes;
47592
47593     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47594         mem_base = xmlMemBlocks();
47595         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47596
47597         ret_val = xmlXPathDistinct(nodes);
47598         desret_xmlNodeSetPtr(ret_val);
47599         call_tests++;
47600         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47601         xmlResetLastError();
47602         if (mem_base != xmlMemBlocks()) {
47603             printf("Leak of %d blocks found in xmlXPathDistinct",
47604                    xmlMemBlocks() - mem_base);
47605             test_ret++;
47606             printf(" %d", n_nodes);
47607             printf("\n");
47608         }
47609     }
47610     function_tests++;
47611 #endif
47612
47613     return(test_ret);
47614 }
47615
47616
47617 static int
47618 test_xmlXPathDistinctSorted(void) {
47619     int test_ret = 0;
47620
47621 #if defined(LIBXML_XPATH_ENABLED)
47622     int mem_base;
47623     xmlNodeSetPtr ret_val;
47624     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47625     int n_nodes;
47626
47627     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47628         mem_base = xmlMemBlocks();
47629         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47630
47631         ret_val = xmlXPathDistinctSorted(nodes);
47632         desret_xmlNodeSetPtr(ret_val);
47633         call_tests++;
47634         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47635         xmlResetLastError();
47636         if (mem_base != xmlMemBlocks()) {
47637             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47638                    xmlMemBlocks() - mem_base);
47639             test_ret++;
47640             printf(" %d", n_nodes);
47641             printf("\n");
47642         }
47643     }
47644     function_tests++;
47645 #endif
47646
47647     return(test_ret);
47648 }
47649
47650
47651 static int
47652 test_xmlXPathDivValues(void) {
47653     int test_ret = 0;
47654
47655 #if defined(LIBXML_XPATH_ENABLED)
47656     int mem_base;
47657     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47658     int n_ctxt;
47659
47660     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47661         mem_base = xmlMemBlocks();
47662         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47663
47664         xmlXPathDivValues(ctxt);
47665         call_tests++;
47666         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47667         xmlResetLastError();
47668         if (mem_base != xmlMemBlocks()) {
47669             printf("Leak of %d blocks found in xmlXPathDivValues",
47670                    xmlMemBlocks() - mem_base);
47671             test_ret++;
47672             printf(" %d", n_ctxt);
47673             printf("\n");
47674         }
47675     }
47676     function_tests++;
47677 #endif
47678
47679     return(test_ret);
47680 }
47681
47682
47683 static int
47684 test_xmlXPathEqualValues(void) {
47685     int test_ret = 0;
47686
47687 #if defined(LIBXML_XPATH_ENABLED)
47688     int mem_base;
47689     int ret_val;
47690     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47691     int n_ctxt;
47692
47693     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47694         mem_base = xmlMemBlocks();
47695         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47696
47697         ret_val = xmlXPathEqualValues(ctxt);
47698         desret_int(ret_val);
47699         call_tests++;
47700         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47701         xmlResetLastError();
47702         if (mem_base != xmlMemBlocks()) {
47703             printf("Leak of %d blocks found in xmlXPathEqualValues",
47704                    xmlMemBlocks() - mem_base);
47705             test_ret++;
47706             printf(" %d", n_ctxt);
47707             printf("\n");
47708         }
47709     }
47710     function_tests++;
47711 #endif
47712
47713     return(test_ret);
47714 }
47715
47716
47717 static int
47718 test_xmlXPathErr(void) {
47719     int test_ret = 0;
47720
47721 #if defined(LIBXML_XPATH_ENABLED)
47722     int mem_base;
47723     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47724     int n_ctxt;
47725     int error; /* the error code */
47726     int n_error;
47727
47728     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47729     for (n_error = 0;n_error < gen_nb_int;n_error++) {
47730         mem_base = xmlMemBlocks();
47731         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47732         error = gen_int(n_error, 1);
47733
47734         xmlXPathErr(ctxt, error);
47735         call_tests++;
47736         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47737         des_int(n_error, error, 1);
47738         xmlResetLastError();
47739         if (mem_base != xmlMemBlocks()) {
47740             printf("Leak of %d blocks found in xmlXPathErr",
47741                    xmlMemBlocks() - mem_base);
47742             test_ret++;
47743             printf(" %d", n_ctxt);
47744             printf(" %d", n_error);
47745             printf("\n");
47746         }
47747     }
47748     }
47749     function_tests++;
47750 #endif
47751
47752     return(test_ret);
47753 }
47754
47755
47756 static int
47757 test_xmlXPathEvalExpr(void) {
47758     int test_ret = 0;
47759
47760 #if defined(LIBXML_XPATH_ENABLED)
47761     int mem_base;
47762     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47763     int n_ctxt;
47764
47765     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47766         mem_base = xmlMemBlocks();
47767         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47768
47769         xmlXPathEvalExpr(ctxt);
47770         call_tests++;
47771         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47772         xmlResetLastError();
47773         if (mem_base != xmlMemBlocks()) {
47774             printf("Leak of %d blocks found in xmlXPathEvalExpr",
47775                    xmlMemBlocks() - mem_base);
47776             test_ret++;
47777             printf(" %d", n_ctxt);
47778             printf("\n");
47779         }
47780     }
47781     function_tests++;
47782 #endif
47783
47784     return(test_ret);
47785 }
47786
47787
47788 static int
47789 test_xmlXPathEvaluatePredicateResult(void) {
47790     int test_ret = 0;
47791
47792 #if defined(LIBXML_XPATH_ENABLED)
47793     int mem_base;
47794     int ret_val;
47795     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47796     int n_ctxt;
47797     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47798     int n_res;
47799
47800     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47801     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47802         mem_base = xmlMemBlocks();
47803         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47804         res = gen_xmlXPathObjectPtr(n_res, 1);
47805
47806         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47807         desret_int(ret_val);
47808         call_tests++;
47809         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47810         des_xmlXPathObjectPtr(n_res, res, 1);
47811         xmlResetLastError();
47812         if (mem_base != xmlMemBlocks()) {
47813             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47814                    xmlMemBlocks() - mem_base);
47815             test_ret++;
47816             printf(" %d", n_ctxt);
47817             printf(" %d", n_res);
47818             printf("\n");
47819         }
47820     }
47821     }
47822     function_tests++;
47823 #endif
47824
47825     return(test_ret);
47826 }
47827
47828
47829 static int
47830 test_xmlXPathFalseFunction(void) {
47831     int test_ret = 0;
47832
47833 #if defined(LIBXML_XPATH_ENABLED)
47834     int mem_base;
47835     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47836     int n_ctxt;
47837     int nargs; /* the number of arguments */
47838     int n_nargs;
47839
47840     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47841     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47842         mem_base = xmlMemBlocks();
47843         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47844         nargs = gen_int(n_nargs, 1);
47845
47846         xmlXPathFalseFunction(ctxt, nargs);
47847         call_tests++;
47848         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47849         des_int(n_nargs, nargs, 1);
47850         xmlResetLastError();
47851         if (mem_base != xmlMemBlocks()) {
47852             printf("Leak of %d blocks found in xmlXPathFalseFunction",
47853                    xmlMemBlocks() - mem_base);
47854             test_ret++;
47855             printf(" %d", n_ctxt);
47856             printf(" %d", n_nargs);
47857             printf("\n");
47858         }
47859     }
47860     }
47861     function_tests++;
47862 #endif
47863
47864     return(test_ret);
47865 }
47866
47867
47868 static int
47869 test_xmlXPathFloorFunction(void) {
47870     int test_ret = 0;
47871
47872 #if defined(LIBXML_XPATH_ENABLED)
47873     int mem_base;
47874     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47875     int n_ctxt;
47876     int nargs; /* the number of arguments */
47877     int n_nargs;
47878
47879     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47880     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47881         mem_base = xmlMemBlocks();
47882         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47883         nargs = gen_int(n_nargs, 1);
47884
47885         xmlXPathFloorFunction(ctxt, nargs);
47886         call_tests++;
47887         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47888         des_int(n_nargs, nargs, 1);
47889         xmlResetLastError();
47890         if (mem_base != xmlMemBlocks()) {
47891             printf("Leak of %d blocks found in xmlXPathFloorFunction",
47892                    xmlMemBlocks() - mem_base);
47893             test_ret++;
47894             printf(" %d", n_ctxt);
47895             printf(" %d", n_nargs);
47896             printf("\n");
47897         }
47898     }
47899     }
47900     function_tests++;
47901 #endif
47902
47903     return(test_ret);
47904 }
47905
47906
47907 static int
47908 test_xmlXPathFunctionLookup(void) {
47909     int test_ret = 0;
47910
47911
47912     /* missing type support */
47913     return(test_ret);
47914 }
47915
47916
47917 static int
47918 test_xmlXPathFunctionLookupNS(void) {
47919     int test_ret = 0;
47920
47921
47922     /* missing type support */
47923     return(test_ret);
47924 }
47925
47926
47927 static int
47928 test_xmlXPathHasSameNodes(void) {
47929     int test_ret = 0;
47930
47931 #if defined(LIBXML_XPATH_ENABLED)
47932     int mem_base;
47933     int ret_val;
47934     xmlNodeSetPtr nodes1; /* a node-set */
47935     int n_nodes1;
47936     xmlNodeSetPtr nodes2; /* a node-set */
47937     int n_nodes2;
47938
47939     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47940     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47941         mem_base = xmlMemBlocks();
47942         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47943         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47944
47945         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47946         desret_int(ret_val);
47947         call_tests++;
47948         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47949         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47950         xmlResetLastError();
47951         if (mem_base != xmlMemBlocks()) {
47952             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47953                    xmlMemBlocks() - mem_base);
47954             test_ret++;
47955             printf(" %d", n_nodes1);
47956             printf(" %d", n_nodes2);
47957             printf("\n");
47958         }
47959     }
47960     }
47961     function_tests++;
47962 #endif
47963
47964     return(test_ret);
47965 }
47966
47967
47968 static int
47969 test_xmlXPathIdFunction(void) {
47970     int test_ret = 0;
47971
47972 #if defined(LIBXML_XPATH_ENABLED)
47973     int mem_base;
47974     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47975     int n_ctxt;
47976     int nargs; /* the number of arguments */
47977     int n_nargs;
47978
47979     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47980     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47981         mem_base = xmlMemBlocks();
47982         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47983         nargs = gen_int(n_nargs, 1);
47984
47985         xmlXPathIdFunction(ctxt, nargs);
47986         call_tests++;
47987         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47988         des_int(n_nargs, nargs, 1);
47989         xmlResetLastError();
47990         if (mem_base != xmlMemBlocks()) {
47991             printf("Leak of %d blocks found in xmlXPathIdFunction",
47992                    xmlMemBlocks() - mem_base);
47993             test_ret++;
47994             printf(" %d", n_ctxt);
47995             printf(" %d", n_nargs);
47996             printf("\n");
47997         }
47998     }
47999     }
48000     function_tests++;
48001 #endif
48002
48003     return(test_ret);
48004 }
48005
48006
48007 static int
48008 test_xmlXPathIntersection(void) {
48009     int test_ret = 0;
48010
48011 #if defined(LIBXML_XPATH_ENABLED)
48012     int mem_base;
48013     xmlNodeSetPtr ret_val;
48014     xmlNodeSetPtr nodes1; /* a node-set */
48015     int n_nodes1;
48016     xmlNodeSetPtr nodes2; /* a node-set */
48017     int n_nodes2;
48018
48019     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48020     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48021         mem_base = xmlMemBlocks();
48022         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48023         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48024
48025         ret_val = xmlXPathIntersection(nodes1, nodes2);
48026         desret_xmlNodeSetPtr(ret_val);
48027         call_tests++;
48028         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48029         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48030         xmlResetLastError();
48031         if (mem_base != xmlMemBlocks()) {
48032             printf("Leak of %d blocks found in xmlXPathIntersection",
48033                    xmlMemBlocks() - mem_base);
48034             test_ret++;
48035             printf(" %d", n_nodes1);
48036             printf(" %d", n_nodes2);
48037             printf("\n");
48038         }
48039     }
48040     }
48041     function_tests++;
48042 #endif
48043
48044     return(test_ret);
48045 }
48046
48047
48048 static int
48049 test_xmlXPathIsNodeType(void) {
48050     int test_ret = 0;
48051
48052 #if defined(LIBXML_XPATH_ENABLED)
48053     int mem_base;
48054     int ret_val;
48055     xmlChar * name; /* a name string */
48056     int n_name;
48057
48058     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48059         mem_base = xmlMemBlocks();
48060         name = gen_const_xmlChar_ptr(n_name, 0);
48061
48062         ret_val = xmlXPathIsNodeType((const xmlChar *)name);
48063         desret_int(ret_val);
48064         call_tests++;
48065         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
48066         xmlResetLastError();
48067         if (mem_base != xmlMemBlocks()) {
48068             printf("Leak of %d blocks found in xmlXPathIsNodeType",
48069                    xmlMemBlocks() - mem_base);
48070             test_ret++;
48071             printf(" %d", n_name);
48072             printf("\n");
48073         }
48074     }
48075     function_tests++;
48076 #endif
48077
48078     return(test_ret);
48079 }
48080
48081
48082 static int
48083 test_xmlXPathLangFunction(void) {
48084     int test_ret = 0;
48085
48086 #if defined(LIBXML_XPATH_ENABLED)
48087     int mem_base;
48088     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48089     int n_ctxt;
48090     int nargs; /* the number of arguments */
48091     int n_nargs;
48092
48093     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48094     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48095         mem_base = xmlMemBlocks();
48096         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48097         nargs = gen_int(n_nargs, 1);
48098
48099         xmlXPathLangFunction(ctxt, nargs);
48100         call_tests++;
48101         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48102         des_int(n_nargs, nargs, 1);
48103         xmlResetLastError();
48104         if (mem_base != xmlMemBlocks()) {
48105             printf("Leak of %d blocks found in xmlXPathLangFunction",
48106                    xmlMemBlocks() - mem_base);
48107             test_ret++;
48108             printf(" %d", n_ctxt);
48109             printf(" %d", n_nargs);
48110             printf("\n");
48111         }
48112     }
48113     }
48114     function_tests++;
48115 #endif
48116
48117     return(test_ret);
48118 }
48119
48120
48121 static int
48122 test_xmlXPathLastFunction(void) {
48123     int test_ret = 0;
48124
48125 #if defined(LIBXML_XPATH_ENABLED)
48126     int mem_base;
48127     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48128     int n_ctxt;
48129     int nargs; /* the number of arguments */
48130     int n_nargs;
48131
48132     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48133     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48134         mem_base = xmlMemBlocks();
48135         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48136         nargs = gen_int(n_nargs, 1);
48137
48138         xmlXPathLastFunction(ctxt, nargs);
48139         call_tests++;
48140         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48141         des_int(n_nargs, nargs, 1);
48142         xmlResetLastError();
48143         if (mem_base != xmlMemBlocks()) {
48144             printf("Leak of %d blocks found in xmlXPathLastFunction",
48145                    xmlMemBlocks() - mem_base);
48146             test_ret++;
48147             printf(" %d", n_ctxt);
48148             printf(" %d", n_nargs);
48149             printf("\n");
48150         }
48151     }
48152     }
48153     function_tests++;
48154 #endif
48155
48156     return(test_ret);
48157 }
48158
48159
48160 static int
48161 test_xmlXPathLeading(void) {
48162     int test_ret = 0;
48163
48164 #if defined(LIBXML_XPATH_ENABLED)
48165     int mem_base;
48166     xmlNodeSetPtr ret_val;
48167     xmlNodeSetPtr nodes1; /* a node-set */
48168     int n_nodes1;
48169     xmlNodeSetPtr nodes2; /* a node-set */
48170     int n_nodes2;
48171
48172     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48173     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48174         mem_base = xmlMemBlocks();
48175         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48176         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48177
48178         ret_val = xmlXPathLeading(nodes1, nodes2);
48179         desret_xmlNodeSetPtr(ret_val);
48180         call_tests++;
48181         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48182         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48183         xmlResetLastError();
48184         if (mem_base != xmlMemBlocks()) {
48185             printf("Leak of %d blocks found in xmlXPathLeading",
48186                    xmlMemBlocks() - mem_base);
48187             test_ret++;
48188             printf(" %d", n_nodes1);
48189             printf(" %d", n_nodes2);
48190             printf("\n");
48191         }
48192     }
48193     }
48194     function_tests++;
48195 #endif
48196
48197     return(test_ret);
48198 }
48199
48200
48201 static int
48202 test_xmlXPathLeadingSorted(void) {
48203     int test_ret = 0;
48204
48205 #if defined(LIBXML_XPATH_ENABLED)
48206     int mem_base;
48207     xmlNodeSetPtr ret_val;
48208     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48209     int n_nodes1;
48210     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48211     int n_nodes2;
48212
48213     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48214     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48215         mem_base = xmlMemBlocks();
48216         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48217         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48218
48219         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
48220         desret_xmlNodeSetPtr(ret_val);
48221         call_tests++;
48222         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48223         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48224         xmlResetLastError();
48225         if (mem_base != xmlMemBlocks()) {
48226             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
48227                    xmlMemBlocks() - mem_base);
48228             test_ret++;
48229             printf(" %d", n_nodes1);
48230             printf(" %d", n_nodes2);
48231             printf("\n");
48232         }
48233     }
48234     }
48235     function_tests++;
48236 #endif
48237
48238     return(test_ret);
48239 }
48240
48241
48242 static int
48243 test_xmlXPathLocalNameFunction(void) {
48244     int test_ret = 0;
48245
48246 #if defined(LIBXML_XPATH_ENABLED)
48247     int mem_base;
48248     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48249     int n_ctxt;
48250     int nargs; /* the number of arguments */
48251     int n_nargs;
48252
48253     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48254     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48255         mem_base = xmlMemBlocks();
48256         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48257         nargs = gen_int(n_nargs, 1);
48258
48259         xmlXPathLocalNameFunction(ctxt, nargs);
48260         call_tests++;
48261         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48262         des_int(n_nargs, nargs, 1);
48263         xmlResetLastError();
48264         if (mem_base != xmlMemBlocks()) {
48265             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
48266                    xmlMemBlocks() - mem_base);
48267             test_ret++;
48268             printf(" %d", n_ctxt);
48269             printf(" %d", n_nargs);
48270             printf("\n");
48271         }
48272     }
48273     }
48274     function_tests++;
48275 #endif
48276
48277     return(test_ret);
48278 }
48279
48280
48281 static int
48282 test_xmlXPathModValues(void) {
48283     int test_ret = 0;
48284
48285 #if defined(LIBXML_XPATH_ENABLED)
48286     int mem_base;
48287     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48288     int n_ctxt;
48289
48290     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48291         mem_base = xmlMemBlocks();
48292         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48293
48294         xmlXPathModValues(ctxt);
48295         call_tests++;
48296         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48297         xmlResetLastError();
48298         if (mem_base != xmlMemBlocks()) {
48299             printf("Leak of %d blocks found in xmlXPathModValues",
48300                    xmlMemBlocks() - mem_base);
48301             test_ret++;
48302             printf(" %d", n_ctxt);
48303             printf("\n");
48304         }
48305     }
48306     function_tests++;
48307 #endif
48308
48309     return(test_ret);
48310 }
48311
48312
48313 static int
48314 test_xmlXPathMultValues(void) {
48315     int test_ret = 0;
48316
48317 #if defined(LIBXML_XPATH_ENABLED)
48318     int mem_base;
48319     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48320     int n_ctxt;
48321
48322     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48323         mem_base = xmlMemBlocks();
48324         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48325
48326         xmlXPathMultValues(ctxt);
48327         call_tests++;
48328         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48329         xmlResetLastError();
48330         if (mem_base != xmlMemBlocks()) {
48331             printf("Leak of %d blocks found in xmlXPathMultValues",
48332                    xmlMemBlocks() - mem_base);
48333             test_ret++;
48334             printf(" %d", n_ctxt);
48335             printf("\n");
48336         }
48337     }
48338     function_tests++;
48339 #endif
48340
48341     return(test_ret);
48342 }
48343
48344
48345 static int
48346 test_xmlXPathNamespaceURIFunction(void) {
48347     int test_ret = 0;
48348
48349 #if defined(LIBXML_XPATH_ENABLED)
48350     int mem_base;
48351     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48352     int n_ctxt;
48353     int nargs; /* the number of arguments */
48354     int n_nargs;
48355
48356     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48357     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48358         mem_base = xmlMemBlocks();
48359         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48360         nargs = gen_int(n_nargs, 1);
48361
48362         xmlXPathNamespaceURIFunction(ctxt, nargs);
48363         call_tests++;
48364         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48365         des_int(n_nargs, nargs, 1);
48366         xmlResetLastError();
48367         if (mem_base != xmlMemBlocks()) {
48368             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
48369                    xmlMemBlocks() - mem_base);
48370             test_ret++;
48371             printf(" %d", n_ctxt);
48372             printf(" %d", n_nargs);
48373             printf("\n");
48374         }
48375     }
48376     }
48377     function_tests++;
48378 #endif
48379
48380     return(test_ret);
48381 }
48382
48383
48384 static int
48385 test_xmlXPathNewBoolean(void) {
48386     int test_ret = 0;
48387
48388 #if defined(LIBXML_XPATH_ENABLED)
48389     int mem_base;
48390     xmlXPathObjectPtr ret_val;
48391     int val; /* the boolean value */
48392     int n_val;
48393
48394     for (n_val = 0;n_val < gen_nb_int;n_val++) {
48395         mem_base = xmlMemBlocks();
48396         val = gen_int(n_val, 0);
48397
48398         ret_val = xmlXPathNewBoolean(val);
48399         desret_xmlXPathObjectPtr(ret_val);
48400         call_tests++;
48401         des_int(n_val, val, 0);
48402         xmlResetLastError();
48403         if (mem_base != xmlMemBlocks()) {
48404             printf("Leak of %d blocks found in xmlXPathNewBoolean",
48405                    xmlMemBlocks() - mem_base);
48406             test_ret++;
48407             printf(" %d", n_val);
48408             printf("\n");
48409         }
48410     }
48411     function_tests++;
48412 #endif
48413
48414     return(test_ret);
48415 }
48416
48417
48418 static int
48419 test_xmlXPathNewCString(void) {
48420     int test_ret = 0;
48421
48422 #if defined(LIBXML_XPATH_ENABLED)
48423     int mem_base;
48424     xmlXPathObjectPtr ret_val;
48425     char * val; /* the char * value */
48426     int n_val;
48427
48428     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48429         mem_base = xmlMemBlocks();
48430         val = gen_const_char_ptr(n_val, 0);
48431
48432         ret_val = xmlXPathNewCString((const char *)val);
48433         desret_xmlXPathObjectPtr(ret_val);
48434         call_tests++;
48435         des_const_char_ptr(n_val, (const char *)val, 0);
48436         xmlResetLastError();
48437         if (mem_base != xmlMemBlocks()) {
48438             printf("Leak of %d blocks found in xmlXPathNewCString",
48439                    xmlMemBlocks() - mem_base);
48440             test_ret++;
48441             printf(" %d", n_val);
48442             printf("\n");
48443         }
48444     }
48445     function_tests++;
48446 #endif
48447
48448     return(test_ret);
48449 }
48450
48451
48452 static int
48453 test_xmlXPathNewFloat(void) {
48454     int test_ret = 0;
48455
48456 #if defined(LIBXML_XPATH_ENABLED)
48457     int mem_base;
48458     xmlXPathObjectPtr ret_val;
48459     double val; /* the double value */
48460     int n_val;
48461
48462     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48463         mem_base = xmlMemBlocks();
48464         val = gen_double(n_val, 0);
48465
48466         ret_val = xmlXPathNewFloat(val);
48467         desret_xmlXPathObjectPtr(ret_val);
48468         call_tests++;
48469         des_double(n_val, val, 0);
48470         xmlResetLastError();
48471         if (mem_base != xmlMemBlocks()) {
48472             printf("Leak of %d blocks found in xmlXPathNewFloat",
48473                    xmlMemBlocks() - mem_base);
48474             test_ret++;
48475             printf(" %d", n_val);
48476             printf("\n");
48477         }
48478     }
48479     function_tests++;
48480 #endif
48481
48482     return(test_ret);
48483 }
48484
48485
48486 static int
48487 test_xmlXPathNewNodeSet(void) {
48488     int test_ret = 0;
48489
48490 #if defined(LIBXML_XPATH_ENABLED)
48491     int mem_base;
48492     xmlXPathObjectPtr ret_val;
48493     xmlNodePtr val; /* the NodePtr value */
48494     int n_val;
48495
48496     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48497         mem_base = xmlMemBlocks();
48498         val = gen_xmlNodePtr(n_val, 0);
48499
48500         ret_val = xmlXPathNewNodeSet(val);
48501         desret_xmlXPathObjectPtr(ret_val);
48502         call_tests++;
48503         des_xmlNodePtr(n_val, val, 0);
48504         xmlResetLastError();
48505         if (mem_base != xmlMemBlocks()) {
48506             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48507                    xmlMemBlocks() - mem_base);
48508             test_ret++;
48509             printf(" %d", n_val);
48510             printf("\n");
48511         }
48512     }
48513     function_tests++;
48514 #endif
48515
48516     return(test_ret);
48517 }
48518
48519
48520 static int
48521 test_xmlXPathNewNodeSetList(void) {
48522     int test_ret = 0;
48523
48524 #if defined(LIBXML_XPATH_ENABLED)
48525     int mem_base;
48526     xmlXPathObjectPtr ret_val;
48527     xmlNodeSetPtr val; /* an existing NodeSet */
48528     int n_val;
48529
48530     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48531         mem_base = xmlMemBlocks();
48532         val = gen_xmlNodeSetPtr(n_val, 0);
48533
48534         ret_val = xmlXPathNewNodeSetList(val);
48535         desret_xmlXPathObjectPtr(ret_val);
48536         call_tests++;
48537         des_xmlNodeSetPtr(n_val, val, 0);
48538         xmlResetLastError();
48539         if (mem_base != xmlMemBlocks()) {
48540             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48541                    xmlMemBlocks() - mem_base);
48542             test_ret++;
48543             printf(" %d", n_val);
48544             printf("\n");
48545         }
48546     }
48547     function_tests++;
48548 #endif
48549
48550     return(test_ret);
48551 }
48552
48553
48554 static int
48555 test_xmlXPathNewParserContext(void) {
48556     int test_ret = 0;
48557
48558
48559     /* missing type support */
48560     return(test_ret);
48561 }
48562
48563
48564 static int
48565 test_xmlXPathNewString(void) {
48566     int test_ret = 0;
48567
48568 #if defined(LIBXML_XPATH_ENABLED)
48569     int mem_base;
48570     xmlXPathObjectPtr ret_val;
48571     xmlChar * val; /* the xmlChar * value */
48572     int n_val;
48573
48574     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48575         mem_base = xmlMemBlocks();
48576         val = gen_const_xmlChar_ptr(n_val, 0);
48577
48578         ret_val = xmlXPathNewString((const xmlChar *)val);
48579         desret_xmlXPathObjectPtr(ret_val);
48580         call_tests++;
48581         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48582         xmlResetLastError();
48583         if (mem_base != xmlMemBlocks()) {
48584             printf("Leak of %d blocks found in xmlXPathNewString",
48585                    xmlMemBlocks() - mem_base);
48586             test_ret++;
48587             printf(" %d", n_val);
48588             printf("\n");
48589         }
48590     }
48591     function_tests++;
48592 #endif
48593
48594     return(test_ret);
48595 }
48596
48597
48598 static int
48599 test_xmlXPathNextAncestor(void) {
48600     int test_ret = 0;
48601
48602 #if defined(LIBXML_XPATH_ENABLED)
48603     int mem_base;
48604     xmlNodePtr ret_val;
48605     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48606     int n_ctxt;
48607     xmlNodePtr cur; /* the current node in the traversal */
48608     int n_cur;
48609
48610     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48611     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48612         mem_base = xmlMemBlocks();
48613         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48614         cur = gen_xmlNodePtr(n_cur, 1);
48615
48616         ret_val = xmlXPathNextAncestor(ctxt, cur);
48617         desret_xmlNodePtr(ret_val);
48618         call_tests++;
48619         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48620         des_xmlNodePtr(n_cur, cur, 1);
48621         xmlResetLastError();
48622         if (mem_base != xmlMemBlocks()) {
48623             printf("Leak of %d blocks found in xmlXPathNextAncestor",
48624                    xmlMemBlocks() - mem_base);
48625             test_ret++;
48626             printf(" %d", n_ctxt);
48627             printf(" %d", n_cur);
48628             printf("\n");
48629         }
48630     }
48631     }
48632     function_tests++;
48633 #endif
48634
48635     return(test_ret);
48636 }
48637
48638
48639 static int
48640 test_xmlXPathNextAncestorOrSelf(void) {
48641     int test_ret = 0;
48642
48643 #if defined(LIBXML_XPATH_ENABLED)
48644     int mem_base;
48645     xmlNodePtr ret_val;
48646     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48647     int n_ctxt;
48648     xmlNodePtr cur; /* the current node in the traversal */
48649     int n_cur;
48650
48651     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48652     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48653         mem_base = xmlMemBlocks();
48654         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48655         cur = gen_xmlNodePtr(n_cur, 1);
48656
48657         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48658         desret_xmlNodePtr(ret_val);
48659         call_tests++;
48660         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48661         des_xmlNodePtr(n_cur, cur, 1);
48662         xmlResetLastError();
48663         if (mem_base != xmlMemBlocks()) {
48664             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48665                    xmlMemBlocks() - mem_base);
48666             test_ret++;
48667             printf(" %d", n_ctxt);
48668             printf(" %d", n_cur);
48669             printf("\n");
48670         }
48671     }
48672     }
48673     function_tests++;
48674 #endif
48675
48676     return(test_ret);
48677 }
48678
48679
48680 static int
48681 test_xmlXPathNextAttribute(void) {
48682     int test_ret = 0;
48683
48684 #if defined(LIBXML_XPATH_ENABLED)
48685     int mem_base;
48686     xmlNodePtr ret_val;
48687     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48688     int n_ctxt;
48689     xmlNodePtr cur; /* the current attribute in the traversal */
48690     int n_cur;
48691
48692     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48693     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48694         mem_base = xmlMemBlocks();
48695         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48696         cur = gen_xmlNodePtr(n_cur, 1);
48697
48698         ret_val = xmlXPathNextAttribute(ctxt, cur);
48699         desret_xmlNodePtr(ret_val);
48700         call_tests++;
48701         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48702         des_xmlNodePtr(n_cur, cur, 1);
48703         xmlResetLastError();
48704         if (mem_base != xmlMemBlocks()) {
48705             printf("Leak of %d blocks found in xmlXPathNextAttribute",
48706                    xmlMemBlocks() - mem_base);
48707             test_ret++;
48708             printf(" %d", n_ctxt);
48709             printf(" %d", n_cur);
48710             printf("\n");
48711         }
48712     }
48713     }
48714     function_tests++;
48715 #endif
48716
48717     return(test_ret);
48718 }
48719
48720
48721 static int
48722 test_xmlXPathNextChild(void) {
48723     int test_ret = 0;
48724
48725 #if defined(LIBXML_XPATH_ENABLED)
48726     int mem_base;
48727     xmlNodePtr ret_val;
48728     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48729     int n_ctxt;
48730     xmlNodePtr cur; /* the current node in the traversal */
48731     int n_cur;
48732
48733     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48734     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48735         mem_base = xmlMemBlocks();
48736         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48737         cur = gen_xmlNodePtr(n_cur, 1);
48738
48739         ret_val = xmlXPathNextChild(ctxt, cur);
48740         desret_xmlNodePtr(ret_val);
48741         call_tests++;
48742         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48743         des_xmlNodePtr(n_cur, cur, 1);
48744         xmlResetLastError();
48745         if (mem_base != xmlMemBlocks()) {
48746             printf("Leak of %d blocks found in xmlXPathNextChild",
48747                    xmlMemBlocks() - mem_base);
48748             test_ret++;
48749             printf(" %d", n_ctxt);
48750             printf(" %d", n_cur);
48751             printf("\n");
48752         }
48753     }
48754     }
48755     function_tests++;
48756 #endif
48757
48758     return(test_ret);
48759 }
48760
48761
48762 static int
48763 test_xmlXPathNextDescendant(void) {
48764     int test_ret = 0;
48765
48766 #if defined(LIBXML_XPATH_ENABLED)
48767     int mem_base;
48768     xmlNodePtr ret_val;
48769     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48770     int n_ctxt;
48771     xmlNodePtr cur; /* the current node in the traversal */
48772     int n_cur;
48773
48774     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48775     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48776         mem_base = xmlMemBlocks();
48777         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48778         cur = gen_xmlNodePtr(n_cur, 1);
48779
48780         ret_val = xmlXPathNextDescendant(ctxt, cur);
48781         desret_xmlNodePtr(ret_val);
48782         call_tests++;
48783         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48784         des_xmlNodePtr(n_cur, cur, 1);
48785         xmlResetLastError();
48786         if (mem_base != xmlMemBlocks()) {
48787             printf("Leak of %d blocks found in xmlXPathNextDescendant",
48788                    xmlMemBlocks() - mem_base);
48789             test_ret++;
48790             printf(" %d", n_ctxt);
48791             printf(" %d", n_cur);
48792             printf("\n");
48793         }
48794     }
48795     }
48796     function_tests++;
48797 #endif
48798
48799     return(test_ret);
48800 }
48801
48802
48803 static int
48804 test_xmlXPathNextDescendantOrSelf(void) {
48805     int test_ret = 0;
48806
48807 #if defined(LIBXML_XPATH_ENABLED)
48808     int mem_base;
48809     xmlNodePtr ret_val;
48810     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48811     int n_ctxt;
48812     xmlNodePtr cur; /* the current node in the traversal */
48813     int n_cur;
48814
48815     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48816     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48817         mem_base = xmlMemBlocks();
48818         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48819         cur = gen_xmlNodePtr(n_cur, 1);
48820
48821         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48822         desret_xmlNodePtr(ret_val);
48823         call_tests++;
48824         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48825         des_xmlNodePtr(n_cur, cur, 1);
48826         xmlResetLastError();
48827         if (mem_base != xmlMemBlocks()) {
48828             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48829                    xmlMemBlocks() - mem_base);
48830             test_ret++;
48831             printf(" %d", n_ctxt);
48832             printf(" %d", n_cur);
48833             printf("\n");
48834         }
48835     }
48836     }
48837     function_tests++;
48838 #endif
48839
48840     return(test_ret);
48841 }
48842
48843
48844 static int
48845 test_xmlXPathNextFollowing(void) {
48846     int test_ret = 0;
48847
48848 #if defined(LIBXML_XPATH_ENABLED)
48849     int mem_base;
48850     xmlNodePtr ret_val;
48851     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48852     int n_ctxt;
48853     xmlNodePtr cur; /* the current node in the traversal */
48854     int n_cur;
48855
48856     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48857     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48858         mem_base = xmlMemBlocks();
48859         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48860         cur = gen_xmlNodePtr(n_cur, 1);
48861
48862         ret_val = xmlXPathNextFollowing(ctxt, cur);
48863         desret_xmlNodePtr(ret_val);
48864         call_tests++;
48865         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48866         des_xmlNodePtr(n_cur, cur, 1);
48867         xmlResetLastError();
48868         if (mem_base != xmlMemBlocks()) {
48869             printf("Leak of %d blocks found in xmlXPathNextFollowing",
48870                    xmlMemBlocks() - mem_base);
48871             test_ret++;
48872             printf(" %d", n_ctxt);
48873             printf(" %d", n_cur);
48874             printf("\n");
48875         }
48876     }
48877     }
48878     function_tests++;
48879 #endif
48880
48881     return(test_ret);
48882 }
48883
48884
48885 static int
48886 test_xmlXPathNextFollowingSibling(void) {
48887     int test_ret = 0;
48888
48889 #if defined(LIBXML_XPATH_ENABLED)
48890     int mem_base;
48891     xmlNodePtr ret_val;
48892     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48893     int n_ctxt;
48894     xmlNodePtr cur; /* the current node in the traversal */
48895     int n_cur;
48896
48897     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48898     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48899         mem_base = xmlMemBlocks();
48900         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48901         cur = gen_xmlNodePtr(n_cur, 1);
48902
48903         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48904         desret_xmlNodePtr(ret_val);
48905         call_tests++;
48906         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48907         des_xmlNodePtr(n_cur, cur, 1);
48908         xmlResetLastError();
48909         if (mem_base != xmlMemBlocks()) {
48910             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48911                    xmlMemBlocks() - mem_base);
48912             test_ret++;
48913             printf(" %d", n_ctxt);
48914             printf(" %d", n_cur);
48915             printf("\n");
48916         }
48917     }
48918     }
48919     function_tests++;
48920 #endif
48921
48922     return(test_ret);
48923 }
48924
48925
48926 static int
48927 test_xmlXPathNextNamespace(void) {
48928     int test_ret = 0;
48929
48930 #if defined(LIBXML_XPATH_ENABLED)
48931     int mem_base;
48932     xmlNodePtr ret_val;
48933     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48934     int n_ctxt;
48935     xmlNodePtr cur; /* the current attribute in the traversal */
48936     int n_cur;
48937
48938     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48939     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48940         mem_base = xmlMemBlocks();
48941         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48942         cur = gen_xmlNodePtr(n_cur, 1);
48943
48944         ret_val = xmlXPathNextNamespace(ctxt, cur);
48945         desret_xmlNodePtr(ret_val);
48946         call_tests++;
48947         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48948         des_xmlNodePtr(n_cur, cur, 1);
48949         xmlResetLastError();
48950         if (mem_base != xmlMemBlocks()) {
48951             printf("Leak of %d blocks found in xmlXPathNextNamespace",
48952                    xmlMemBlocks() - mem_base);
48953             test_ret++;
48954             printf(" %d", n_ctxt);
48955             printf(" %d", n_cur);
48956             printf("\n");
48957         }
48958     }
48959     }
48960     function_tests++;
48961 #endif
48962
48963     return(test_ret);
48964 }
48965
48966
48967 static int
48968 test_xmlXPathNextParent(void) {
48969     int test_ret = 0;
48970
48971 #if defined(LIBXML_XPATH_ENABLED)
48972     int mem_base;
48973     xmlNodePtr ret_val;
48974     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48975     int n_ctxt;
48976     xmlNodePtr cur; /* the current node in the traversal */
48977     int n_cur;
48978
48979     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48980     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48981         mem_base = xmlMemBlocks();
48982         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48983         cur = gen_xmlNodePtr(n_cur, 1);
48984
48985         ret_val = xmlXPathNextParent(ctxt, cur);
48986         desret_xmlNodePtr(ret_val);
48987         call_tests++;
48988         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48989         des_xmlNodePtr(n_cur, cur, 1);
48990         xmlResetLastError();
48991         if (mem_base != xmlMemBlocks()) {
48992             printf("Leak of %d blocks found in xmlXPathNextParent",
48993                    xmlMemBlocks() - mem_base);
48994             test_ret++;
48995             printf(" %d", n_ctxt);
48996             printf(" %d", n_cur);
48997             printf("\n");
48998         }
48999     }
49000     }
49001     function_tests++;
49002 #endif
49003
49004     return(test_ret);
49005 }
49006
49007
49008 static int
49009 test_xmlXPathNextPreceding(void) {
49010     int test_ret = 0;
49011
49012 #if defined(LIBXML_XPATH_ENABLED)
49013     int mem_base;
49014     xmlNodePtr ret_val;
49015     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49016     int n_ctxt;
49017     xmlNodePtr cur; /* the current node in the traversal */
49018     int n_cur;
49019
49020     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49021     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49022         mem_base = xmlMemBlocks();
49023         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49024         cur = gen_xmlNodePtr(n_cur, 1);
49025
49026         ret_val = xmlXPathNextPreceding(ctxt, cur);
49027         desret_xmlNodePtr(ret_val);
49028         call_tests++;
49029         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49030         des_xmlNodePtr(n_cur, cur, 1);
49031         xmlResetLastError();
49032         if (mem_base != xmlMemBlocks()) {
49033             printf("Leak of %d blocks found in xmlXPathNextPreceding",
49034                    xmlMemBlocks() - mem_base);
49035             test_ret++;
49036             printf(" %d", n_ctxt);
49037             printf(" %d", n_cur);
49038             printf("\n");
49039         }
49040     }
49041     }
49042     function_tests++;
49043 #endif
49044
49045     return(test_ret);
49046 }
49047
49048
49049 static int
49050 test_xmlXPathNextPrecedingSibling(void) {
49051     int test_ret = 0;
49052
49053 #if defined(LIBXML_XPATH_ENABLED)
49054     int mem_base;
49055     xmlNodePtr ret_val;
49056     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49057     int n_ctxt;
49058     xmlNodePtr cur; /* the current node in the traversal */
49059     int n_cur;
49060
49061     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49062     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49063         mem_base = xmlMemBlocks();
49064         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49065         cur = gen_xmlNodePtr(n_cur, 1);
49066
49067         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
49068         desret_xmlNodePtr(ret_val);
49069         call_tests++;
49070         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49071         des_xmlNodePtr(n_cur, cur, 1);
49072         xmlResetLastError();
49073         if (mem_base != xmlMemBlocks()) {
49074             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
49075                    xmlMemBlocks() - mem_base);
49076             test_ret++;
49077             printf(" %d", n_ctxt);
49078             printf(" %d", n_cur);
49079             printf("\n");
49080         }
49081     }
49082     }
49083     function_tests++;
49084 #endif
49085
49086     return(test_ret);
49087 }
49088
49089
49090 static int
49091 test_xmlXPathNextSelf(void) {
49092     int test_ret = 0;
49093
49094 #if defined(LIBXML_XPATH_ENABLED)
49095     int mem_base;
49096     xmlNodePtr ret_val;
49097     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49098     int n_ctxt;
49099     xmlNodePtr cur; /* the current node in the traversal */
49100     int n_cur;
49101
49102     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49103     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49104         mem_base = xmlMemBlocks();
49105         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49106         cur = gen_xmlNodePtr(n_cur, 1);
49107
49108         ret_val = xmlXPathNextSelf(ctxt, cur);
49109         desret_xmlNodePtr(ret_val);
49110         call_tests++;
49111         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49112         des_xmlNodePtr(n_cur, cur, 1);
49113         xmlResetLastError();
49114         if (mem_base != xmlMemBlocks()) {
49115             printf("Leak of %d blocks found in xmlXPathNextSelf",
49116                    xmlMemBlocks() - mem_base);
49117             test_ret++;
49118             printf(" %d", n_ctxt);
49119             printf(" %d", n_cur);
49120             printf("\n");
49121         }
49122     }
49123     }
49124     function_tests++;
49125 #endif
49126
49127     return(test_ret);
49128 }
49129
49130
49131 static int
49132 test_xmlXPathNodeLeading(void) {
49133     int test_ret = 0;
49134
49135 #if defined(LIBXML_XPATH_ENABLED)
49136     int mem_base;
49137     xmlNodeSetPtr ret_val;
49138     xmlNodeSetPtr nodes; /* a node-set */
49139     int n_nodes;
49140     xmlNodePtr node; /* a node */
49141     int n_node;
49142
49143     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49144     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49145         mem_base = xmlMemBlocks();
49146         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49147         node = gen_xmlNodePtr(n_node, 1);
49148
49149         ret_val = xmlXPathNodeLeading(nodes, node);
49150         desret_xmlNodeSetPtr(ret_val);
49151         call_tests++;
49152         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49153         des_xmlNodePtr(n_node, node, 1);
49154         xmlResetLastError();
49155         if (mem_base != xmlMemBlocks()) {
49156             printf("Leak of %d blocks found in xmlXPathNodeLeading",
49157                    xmlMemBlocks() - mem_base);
49158             test_ret++;
49159             printf(" %d", n_nodes);
49160             printf(" %d", n_node);
49161             printf("\n");
49162         }
49163     }
49164     }
49165     function_tests++;
49166 #endif
49167
49168     return(test_ret);
49169 }
49170
49171
49172 static int
49173 test_xmlXPathNodeLeadingSorted(void) {
49174     int test_ret = 0;
49175
49176 #if defined(LIBXML_XPATH_ENABLED)
49177     int mem_base;
49178     xmlNodeSetPtr ret_val;
49179     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49180     int n_nodes;
49181     xmlNodePtr node; /* a node */
49182     int n_node;
49183
49184     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49185     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49186         mem_base = xmlMemBlocks();
49187         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49188         node = gen_xmlNodePtr(n_node, 1);
49189
49190         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
49191         desret_xmlNodeSetPtr(ret_val);
49192         call_tests++;
49193         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49194         des_xmlNodePtr(n_node, node, 1);
49195         xmlResetLastError();
49196         if (mem_base != xmlMemBlocks()) {
49197             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
49198                    xmlMemBlocks() - mem_base);
49199             test_ret++;
49200             printf(" %d", n_nodes);
49201             printf(" %d", n_node);
49202             printf("\n");
49203         }
49204     }
49205     }
49206     function_tests++;
49207 #endif
49208
49209     return(test_ret);
49210 }
49211
49212
49213 static int
49214 test_xmlXPathNodeSetAdd(void) {
49215     int test_ret = 0;
49216
49217 #if defined(LIBXML_XPATH_ENABLED)
49218     int mem_base;
49219     int ret_val;
49220     xmlNodeSetPtr cur; /* the initial node set */
49221     int n_cur;
49222     xmlNodePtr val; /* a new xmlNodePtr */
49223     int n_val;
49224
49225     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49226     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49227         mem_base = xmlMemBlocks();
49228         cur = gen_xmlNodeSetPtr(n_cur, 0);
49229         val = gen_xmlNodePtr(n_val, 1);
49230
49231         ret_val = xmlXPathNodeSetAdd(cur, val);
49232         desret_int(ret_val);
49233         call_tests++;
49234         des_xmlNodeSetPtr(n_cur, cur, 0);
49235         des_xmlNodePtr(n_val, val, 1);
49236         xmlResetLastError();
49237         if (mem_base != xmlMemBlocks()) {
49238             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
49239                    xmlMemBlocks() - mem_base);
49240             test_ret++;
49241             printf(" %d", n_cur);
49242             printf(" %d", n_val);
49243             printf("\n");
49244         }
49245     }
49246     }
49247     function_tests++;
49248 #endif
49249
49250     return(test_ret);
49251 }
49252
49253
49254 static int
49255 test_xmlXPathNodeSetAddNs(void) {
49256     int test_ret = 0;
49257
49258 #if defined(LIBXML_XPATH_ENABLED)
49259     int mem_base;
49260     int ret_val;
49261     xmlNodeSetPtr cur; /* the initial node set */
49262     int n_cur;
49263     xmlNodePtr node; /* the hosting node */
49264     int n_node;
49265     xmlNsPtr ns; /* a the namespace node */
49266     int n_ns;
49267
49268     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49269     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49270     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
49271         mem_base = xmlMemBlocks();
49272         cur = gen_xmlNodeSetPtr(n_cur, 0);
49273         node = gen_xmlNodePtr(n_node, 1);
49274         ns = gen_xmlNsPtr(n_ns, 2);
49275
49276         ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
49277         desret_int(ret_val);
49278         call_tests++;
49279         des_xmlNodeSetPtr(n_cur, cur, 0);
49280         des_xmlNodePtr(n_node, node, 1);
49281         des_xmlNsPtr(n_ns, ns, 2);
49282         xmlResetLastError();
49283         if (mem_base != xmlMemBlocks()) {
49284             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
49285                    xmlMemBlocks() - mem_base);
49286             test_ret++;
49287             printf(" %d", n_cur);
49288             printf(" %d", n_node);
49289             printf(" %d", n_ns);
49290             printf("\n");
49291         }
49292     }
49293     }
49294     }
49295     function_tests++;
49296 #endif
49297
49298     return(test_ret);
49299 }
49300
49301
49302 static int
49303 test_xmlXPathNodeSetAddUnique(void) {
49304     int test_ret = 0;
49305
49306 #if defined(LIBXML_XPATH_ENABLED)
49307     int mem_base;
49308     int ret_val;
49309     xmlNodeSetPtr cur; /* the initial node set */
49310     int n_cur;
49311     xmlNodePtr val; /* a new xmlNodePtr */
49312     int n_val;
49313
49314     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49315     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49316         mem_base = xmlMemBlocks();
49317         cur = gen_xmlNodeSetPtr(n_cur, 0);
49318         val = gen_xmlNodePtr(n_val, 1);
49319
49320         ret_val = xmlXPathNodeSetAddUnique(cur, val);
49321         desret_int(ret_val);
49322         call_tests++;
49323         des_xmlNodeSetPtr(n_cur, cur, 0);
49324         des_xmlNodePtr(n_val, val, 1);
49325         xmlResetLastError();
49326         if (mem_base != xmlMemBlocks()) {
49327             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
49328                    xmlMemBlocks() - mem_base);
49329             test_ret++;
49330             printf(" %d", n_cur);
49331             printf(" %d", n_val);
49332             printf("\n");
49333         }
49334     }
49335     }
49336     function_tests++;
49337 #endif
49338
49339     return(test_ret);
49340 }
49341
49342
49343 static int
49344 test_xmlXPathNodeSetContains(void) {
49345     int test_ret = 0;
49346
49347 #if defined(LIBXML_XPATH_ENABLED)
49348     int mem_base;
49349     int ret_val;
49350     xmlNodeSetPtr cur; /* the node-set */
49351     int n_cur;
49352     xmlNodePtr val; /* the node */
49353     int n_val;
49354
49355     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49356     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49357         mem_base = xmlMemBlocks();
49358         cur = gen_xmlNodeSetPtr(n_cur, 0);
49359         val = gen_xmlNodePtr(n_val, 1);
49360
49361         ret_val = xmlXPathNodeSetContains(cur, val);
49362         desret_int(ret_val);
49363         call_tests++;
49364         des_xmlNodeSetPtr(n_cur, cur, 0);
49365         des_xmlNodePtr(n_val, val, 1);
49366         xmlResetLastError();
49367         if (mem_base != xmlMemBlocks()) {
49368             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
49369                    xmlMemBlocks() - mem_base);
49370             test_ret++;
49371             printf(" %d", n_cur);
49372             printf(" %d", n_val);
49373             printf("\n");
49374         }
49375     }
49376     }
49377     function_tests++;
49378 #endif
49379
49380     return(test_ret);
49381 }
49382
49383
49384 static int
49385 test_xmlXPathNodeSetDel(void) {
49386     int test_ret = 0;
49387
49388 #if defined(LIBXML_XPATH_ENABLED)
49389     int mem_base;
49390     xmlNodeSetPtr cur; /* the initial node set */
49391     int n_cur;
49392     xmlNodePtr val; /* an xmlNodePtr */
49393     int n_val;
49394
49395     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49396     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49397         mem_base = xmlMemBlocks();
49398         cur = gen_xmlNodeSetPtr(n_cur, 0);
49399         val = gen_xmlNodePtr(n_val, 1);
49400
49401         xmlXPathNodeSetDel(cur, val);
49402         call_tests++;
49403         des_xmlNodeSetPtr(n_cur, cur, 0);
49404         des_xmlNodePtr(n_val, val, 1);
49405         xmlResetLastError();
49406         if (mem_base != xmlMemBlocks()) {
49407             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49408                    xmlMemBlocks() - mem_base);
49409             test_ret++;
49410             printf(" %d", n_cur);
49411             printf(" %d", n_val);
49412             printf("\n");
49413         }
49414     }
49415     }
49416     function_tests++;
49417 #endif
49418
49419     return(test_ret);
49420 }
49421
49422
49423 static int
49424 test_xmlXPathNodeSetMerge(void) {
49425     int test_ret = 0;
49426
49427 #if defined(LIBXML_XPATH_ENABLED)
49428     int mem_base;
49429     xmlNodeSetPtr ret_val;
49430     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49431     int n_val1;
49432     xmlNodeSetPtr val2; /* the second NodeSet */
49433     int n_val2;
49434
49435     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49436     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49437         mem_base = xmlMemBlocks();
49438         val1 = gen_xmlNodeSetPtr(n_val1, 0);
49439         val2 = gen_xmlNodeSetPtr(n_val2, 1);
49440
49441         ret_val = xmlXPathNodeSetMerge(val1, val2);
49442         desret_xmlNodeSetPtr(ret_val);
49443         call_tests++;
49444         des_xmlNodeSetPtr(n_val1, val1, 0);
49445         des_xmlNodeSetPtr(n_val2, val2, 1);
49446         xmlResetLastError();
49447         if (mem_base != xmlMemBlocks()) {
49448             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49449                    xmlMemBlocks() - mem_base);
49450             test_ret++;
49451             printf(" %d", n_val1);
49452             printf(" %d", n_val2);
49453             printf("\n");
49454         }
49455     }
49456     }
49457     function_tests++;
49458 #endif
49459
49460     return(test_ret);
49461 }
49462
49463
49464 static int
49465 test_xmlXPathNodeSetRemove(void) {
49466     int test_ret = 0;
49467
49468 #if defined(LIBXML_XPATH_ENABLED)
49469     int mem_base;
49470     xmlNodeSetPtr cur; /* the initial node set */
49471     int n_cur;
49472     int val; /* the index to remove */
49473     int n_val;
49474
49475     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49476     for (n_val = 0;n_val < gen_nb_int;n_val++) {
49477         mem_base = xmlMemBlocks();
49478         cur = gen_xmlNodeSetPtr(n_cur, 0);
49479         val = gen_int(n_val, 1);
49480
49481         xmlXPathNodeSetRemove(cur, val);
49482         call_tests++;
49483         des_xmlNodeSetPtr(n_cur, cur, 0);
49484         des_int(n_val, val, 1);
49485         xmlResetLastError();
49486         if (mem_base != xmlMemBlocks()) {
49487             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49488                    xmlMemBlocks() - mem_base);
49489             test_ret++;
49490             printf(" %d", n_cur);
49491             printf(" %d", n_val);
49492             printf("\n");
49493         }
49494     }
49495     }
49496     function_tests++;
49497 #endif
49498
49499     return(test_ret);
49500 }
49501
49502
49503 static int
49504 test_xmlXPathNodeSetSort(void) {
49505     int test_ret = 0;
49506
49507 #if defined(LIBXML_XPATH_ENABLED)
49508     int mem_base;
49509     xmlNodeSetPtr set; /* the node set */
49510     int n_set;
49511
49512     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49513         mem_base = xmlMemBlocks();
49514         set = gen_xmlNodeSetPtr(n_set, 0);
49515
49516         xmlXPathNodeSetSort(set);
49517         call_tests++;
49518         des_xmlNodeSetPtr(n_set, set, 0);
49519         xmlResetLastError();
49520         if (mem_base != xmlMemBlocks()) {
49521             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49522                    xmlMemBlocks() - mem_base);
49523             test_ret++;
49524             printf(" %d", n_set);
49525             printf("\n");
49526         }
49527     }
49528     function_tests++;
49529 #endif
49530
49531     return(test_ret);
49532 }
49533
49534
49535 static int
49536 test_xmlXPathNodeTrailing(void) {
49537     int test_ret = 0;
49538
49539 #if defined(LIBXML_XPATH_ENABLED)
49540     int mem_base;
49541     xmlNodeSetPtr ret_val;
49542     xmlNodeSetPtr nodes; /* a node-set */
49543     int n_nodes;
49544     xmlNodePtr node; /* a node */
49545     int n_node;
49546
49547     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49548     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49549         mem_base = xmlMemBlocks();
49550         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49551         node = gen_xmlNodePtr(n_node, 1);
49552
49553         ret_val = xmlXPathNodeTrailing(nodes, node);
49554         desret_xmlNodeSetPtr(ret_val);
49555         call_tests++;
49556         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49557         des_xmlNodePtr(n_node, node, 1);
49558         xmlResetLastError();
49559         if (mem_base != xmlMemBlocks()) {
49560             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49561                    xmlMemBlocks() - mem_base);
49562             test_ret++;
49563             printf(" %d", n_nodes);
49564             printf(" %d", n_node);
49565             printf("\n");
49566         }
49567     }
49568     }
49569     function_tests++;
49570 #endif
49571
49572     return(test_ret);
49573 }
49574
49575
49576 static int
49577 test_xmlXPathNodeTrailingSorted(void) {
49578     int test_ret = 0;
49579
49580 #if defined(LIBXML_XPATH_ENABLED)
49581     int mem_base;
49582     xmlNodeSetPtr ret_val;
49583     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49584     int n_nodes;
49585     xmlNodePtr node; /* a node */
49586     int n_node;
49587
49588     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49589     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49590         mem_base = xmlMemBlocks();
49591         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49592         node = gen_xmlNodePtr(n_node, 1);
49593
49594         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49595         desret_xmlNodeSetPtr(ret_val);
49596         call_tests++;
49597         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49598         des_xmlNodePtr(n_node, node, 1);
49599         xmlResetLastError();
49600         if (mem_base != xmlMemBlocks()) {
49601             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49602                    xmlMemBlocks() - mem_base);
49603             test_ret++;
49604             printf(" %d", n_nodes);
49605             printf(" %d", n_node);
49606             printf("\n");
49607         }
49608     }
49609     }
49610     function_tests++;
49611 #endif
49612
49613     return(test_ret);
49614 }
49615
49616
49617 static int
49618 test_xmlXPathNormalizeFunction(void) {
49619     int test_ret = 0;
49620
49621 #if defined(LIBXML_XPATH_ENABLED)
49622     int mem_base;
49623     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49624     int n_ctxt;
49625     int nargs; /* the number of arguments */
49626     int n_nargs;
49627
49628     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49629     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49630         mem_base = xmlMemBlocks();
49631         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49632         nargs = gen_int(n_nargs, 1);
49633
49634         xmlXPathNormalizeFunction(ctxt, nargs);
49635         call_tests++;
49636         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49637         des_int(n_nargs, nargs, 1);
49638         xmlResetLastError();
49639         if (mem_base != xmlMemBlocks()) {
49640             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49641                    xmlMemBlocks() - mem_base);
49642             test_ret++;
49643             printf(" %d", n_ctxt);
49644             printf(" %d", n_nargs);
49645             printf("\n");
49646         }
49647     }
49648     }
49649     function_tests++;
49650 #endif
49651
49652     return(test_ret);
49653 }
49654
49655
49656 static int
49657 test_xmlXPathNotEqualValues(void) {
49658     int test_ret = 0;
49659
49660 #if defined(LIBXML_XPATH_ENABLED)
49661     int mem_base;
49662     int ret_val;
49663     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49664     int n_ctxt;
49665
49666     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49667         mem_base = xmlMemBlocks();
49668         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49669
49670         ret_val = xmlXPathNotEqualValues(ctxt);
49671         desret_int(ret_val);
49672         call_tests++;
49673         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49674         xmlResetLastError();
49675         if (mem_base != xmlMemBlocks()) {
49676             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49677                    xmlMemBlocks() - mem_base);
49678             test_ret++;
49679             printf(" %d", n_ctxt);
49680             printf("\n");
49681         }
49682     }
49683     function_tests++;
49684 #endif
49685
49686     return(test_ret);
49687 }
49688
49689
49690 static int
49691 test_xmlXPathNotFunction(void) {
49692     int test_ret = 0;
49693
49694 #if defined(LIBXML_XPATH_ENABLED)
49695     int mem_base;
49696     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49697     int n_ctxt;
49698     int nargs; /* the number of arguments */
49699     int n_nargs;
49700
49701     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49702     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49703         mem_base = xmlMemBlocks();
49704         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49705         nargs = gen_int(n_nargs, 1);
49706
49707         xmlXPathNotFunction(ctxt, nargs);
49708         call_tests++;
49709         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49710         des_int(n_nargs, nargs, 1);
49711         xmlResetLastError();
49712         if (mem_base != xmlMemBlocks()) {
49713             printf("Leak of %d blocks found in xmlXPathNotFunction",
49714                    xmlMemBlocks() - mem_base);
49715             test_ret++;
49716             printf(" %d", n_ctxt);
49717             printf(" %d", n_nargs);
49718             printf("\n");
49719         }
49720     }
49721     }
49722     function_tests++;
49723 #endif
49724
49725     return(test_ret);
49726 }
49727
49728
49729 static int
49730 test_xmlXPathNsLookup(void) {
49731     int test_ret = 0;
49732
49733 #if defined(LIBXML_XPATH_ENABLED)
49734     int mem_base;
49735     const xmlChar * ret_val;
49736     xmlXPathContextPtr ctxt; /* the XPath context */
49737     int n_ctxt;
49738     xmlChar * prefix; /* the namespace prefix value */
49739     int n_prefix;
49740
49741     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49742     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49743         mem_base = xmlMemBlocks();
49744         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49745         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49746
49747         ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49748         desret_const_xmlChar_ptr(ret_val);
49749         call_tests++;
49750         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49751         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49752         xmlResetLastError();
49753         if (mem_base != xmlMemBlocks()) {
49754             printf("Leak of %d blocks found in xmlXPathNsLookup",
49755                    xmlMemBlocks() - mem_base);
49756             test_ret++;
49757             printf(" %d", n_ctxt);
49758             printf(" %d", n_prefix);
49759             printf("\n");
49760         }
49761     }
49762     }
49763     function_tests++;
49764 #endif
49765
49766     return(test_ret);
49767 }
49768
49769
49770 static int
49771 test_xmlXPathNumberFunction(void) {
49772     int test_ret = 0;
49773
49774 #if defined(LIBXML_XPATH_ENABLED)
49775     int mem_base;
49776     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49777     int n_ctxt;
49778     int nargs; /* the number of arguments */
49779     int n_nargs;
49780
49781     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49782     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49783         mem_base = xmlMemBlocks();
49784         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49785         nargs = gen_int(n_nargs, 1);
49786
49787         xmlXPathNumberFunction(ctxt, nargs);
49788         call_tests++;
49789         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49790         des_int(n_nargs, nargs, 1);
49791         xmlResetLastError();
49792         if (mem_base != xmlMemBlocks()) {
49793             printf("Leak of %d blocks found in xmlXPathNumberFunction",
49794                    xmlMemBlocks() - mem_base);
49795             test_ret++;
49796             printf(" %d", n_ctxt);
49797             printf(" %d", n_nargs);
49798             printf("\n");
49799         }
49800     }
49801     }
49802     function_tests++;
49803 #endif
49804
49805     return(test_ret);
49806 }
49807
49808
49809 static int
49810 test_xmlXPathParseNCName(void) {
49811     int test_ret = 0;
49812
49813 #if defined(LIBXML_XPATH_ENABLED)
49814     int mem_base;
49815     xmlChar * ret_val;
49816     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49817     int n_ctxt;
49818
49819     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49820         mem_base = xmlMemBlocks();
49821         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49822
49823         ret_val = xmlXPathParseNCName(ctxt);
49824         desret_xmlChar_ptr(ret_val);
49825         call_tests++;
49826         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49827         xmlResetLastError();
49828         if (mem_base != xmlMemBlocks()) {
49829             printf("Leak of %d blocks found in xmlXPathParseNCName",
49830                    xmlMemBlocks() - mem_base);
49831             test_ret++;
49832             printf(" %d", n_ctxt);
49833             printf("\n");
49834         }
49835     }
49836     function_tests++;
49837 #endif
49838
49839     return(test_ret);
49840 }
49841
49842
49843 static int
49844 test_xmlXPathParseName(void) {
49845     int test_ret = 0;
49846
49847 #if defined(LIBXML_XPATH_ENABLED)
49848     int mem_base;
49849     xmlChar * ret_val;
49850     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49851     int n_ctxt;
49852
49853     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49854         mem_base = xmlMemBlocks();
49855         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49856
49857         ret_val = xmlXPathParseName(ctxt);
49858         desret_xmlChar_ptr(ret_val);
49859         call_tests++;
49860         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49861         xmlResetLastError();
49862         if (mem_base != xmlMemBlocks()) {
49863             printf("Leak of %d blocks found in xmlXPathParseName",
49864                    xmlMemBlocks() - mem_base);
49865             test_ret++;
49866             printf(" %d", n_ctxt);
49867             printf("\n");
49868         }
49869     }
49870     function_tests++;
49871 #endif
49872
49873     return(test_ret);
49874 }
49875
49876
49877 static int
49878 test_xmlXPathPopBoolean(void) {
49879     int test_ret = 0;
49880
49881 #if defined(LIBXML_XPATH_ENABLED)
49882     int mem_base;
49883     int ret_val;
49884     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49885     int n_ctxt;
49886
49887     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49888         mem_base = xmlMemBlocks();
49889         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49890
49891         ret_val = xmlXPathPopBoolean(ctxt);
49892         desret_int(ret_val);
49893         call_tests++;
49894         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49895         xmlResetLastError();
49896         if (mem_base != xmlMemBlocks()) {
49897             printf("Leak of %d blocks found in xmlXPathPopBoolean",
49898                    xmlMemBlocks() - mem_base);
49899             test_ret++;
49900             printf(" %d", n_ctxt);
49901             printf("\n");
49902         }
49903     }
49904     function_tests++;
49905 #endif
49906
49907     return(test_ret);
49908 }
49909
49910
49911 static int
49912 test_xmlXPathPopExternal(void) {
49913     int test_ret = 0;
49914
49915 #if defined(LIBXML_XPATH_ENABLED)
49916     int mem_base;
49917     void * ret_val;
49918     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49919     int n_ctxt;
49920
49921     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49922         mem_base = xmlMemBlocks();
49923         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49924
49925         ret_val = xmlXPathPopExternal(ctxt);
49926         desret_void_ptr(ret_val);
49927         call_tests++;
49928         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49929         xmlResetLastError();
49930         if (mem_base != xmlMemBlocks()) {
49931             printf("Leak of %d blocks found in xmlXPathPopExternal",
49932                    xmlMemBlocks() - mem_base);
49933             test_ret++;
49934             printf(" %d", n_ctxt);
49935             printf("\n");
49936         }
49937     }
49938     function_tests++;
49939 #endif
49940
49941     return(test_ret);
49942 }
49943
49944
49945 static int
49946 test_xmlXPathPopNodeSet(void) {
49947     int test_ret = 0;
49948
49949 #if defined(LIBXML_XPATH_ENABLED)
49950     int mem_base;
49951     xmlNodeSetPtr ret_val;
49952     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49953     int n_ctxt;
49954
49955     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49956         mem_base = xmlMemBlocks();
49957         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49958
49959         ret_val = xmlXPathPopNodeSet(ctxt);
49960         desret_xmlNodeSetPtr(ret_val);
49961         call_tests++;
49962         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49963         xmlResetLastError();
49964         if (mem_base != xmlMemBlocks()) {
49965             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49966                    xmlMemBlocks() - mem_base);
49967             test_ret++;
49968             printf(" %d", n_ctxt);
49969             printf("\n");
49970         }
49971     }
49972     function_tests++;
49973 #endif
49974
49975     return(test_ret);
49976 }
49977
49978
49979 static int
49980 test_xmlXPathPopNumber(void) {
49981     int test_ret = 0;
49982
49983 #if defined(LIBXML_XPATH_ENABLED)
49984     int mem_base;
49985     double ret_val;
49986     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49987     int n_ctxt;
49988
49989     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49990         mem_base = xmlMemBlocks();
49991         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49992
49993         ret_val = xmlXPathPopNumber(ctxt);
49994         desret_double(ret_val);
49995         call_tests++;
49996         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49997         xmlResetLastError();
49998         if (mem_base != xmlMemBlocks()) {
49999             printf("Leak of %d blocks found in xmlXPathPopNumber",
50000                    xmlMemBlocks() - mem_base);
50001             test_ret++;
50002             printf(" %d", n_ctxt);
50003             printf("\n");
50004         }
50005     }
50006     function_tests++;
50007 #endif
50008
50009     return(test_ret);
50010 }
50011
50012
50013 static int
50014 test_xmlXPathPopString(void) {
50015     int test_ret = 0;
50016
50017 #if defined(LIBXML_XPATH_ENABLED)
50018     int mem_base;
50019     xmlChar * ret_val;
50020     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
50021     int n_ctxt;
50022
50023     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50024         mem_base = xmlMemBlocks();
50025         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50026
50027         ret_val = xmlXPathPopString(ctxt);
50028         desret_xmlChar_ptr(ret_val);
50029         call_tests++;
50030         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50031         xmlResetLastError();
50032         if (mem_base != xmlMemBlocks()) {
50033             printf("Leak of %d blocks found in xmlXPathPopString",
50034                    xmlMemBlocks() - mem_base);
50035             test_ret++;
50036             printf(" %d", n_ctxt);
50037             printf("\n");
50038         }
50039     }
50040     function_tests++;
50041 #endif
50042
50043     return(test_ret);
50044 }
50045
50046
50047 static int
50048 test_xmlXPathPositionFunction(void) {
50049     int test_ret = 0;
50050
50051 #if defined(LIBXML_XPATH_ENABLED)
50052     int mem_base;
50053     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50054     int n_ctxt;
50055     int nargs; /* the number of arguments */
50056     int n_nargs;
50057
50058     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50059     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50060         mem_base = xmlMemBlocks();
50061         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50062         nargs = gen_int(n_nargs, 1);
50063
50064         xmlXPathPositionFunction(ctxt, nargs);
50065         call_tests++;
50066         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50067         des_int(n_nargs, nargs, 1);
50068         xmlResetLastError();
50069         if (mem_base != xmlMemBlocks()) {
50070             printf("Leak of %d blocks found in xmlXPathPositionFunction",
50071                    xmlMemBlocks() - mem_base);
50072             test_ret++;
50073             printf(" %d", n_ctxt);
50074             printf(" %d", n_nargs);
50075             printf("\n");
50076         }
50077     }
50078     }
50079     function_tests++;
50080 #endif
50081
50082     return(test_ret);
50083 }
50084
50085
50086 static int
50087 test_xmlXPathRegisterAllFunctions(void) {
50088     int test_ret = 0;
50089
50090 #if defined(LIBXML_XPATH_ENABLED)
50091     int mem_base;
50092     xmlXPathContextPtr ctxt; /* the XPath context */
50093     int n_ctxt;
50094
50095     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50096         mem_base = xmlMemBlocks();
50097         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50098
50099         xmlXPathRegisterAllFunctions(ctxt);
50100         call_tests++;
50101         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50102         xmlResetLastError();
50103         if (mem_base != xmlMemBlocks()) {
50104             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
50105                    xmlMemBlocks() - mem_base);
50106             test_ret++;
50107             printf(" %d", n_ctxt);
50108             printf("\n");
50109         }
50110     }
50111     function_tests++;
50112 #endif
50113
50114     return(test_ret);
50115 }
50116
50117
50118 static int
50119 test_xmlXPathRegisterFunc(void) {
50120     int test_ret = 0;
50121
50122
50123     /* missing type support */
50124     return(test_ret);
50125 }
50126
50127
50128 static int
50129 test_xmlXPathRegisterFuncLookup(void) {
50130     int test_ret = 0;
50131
50132
50133     /* missing type support */
50134     return(test_ret);
50135 }
50136
50137
50138 static int
50139 test_xmlXPathRegisterFuncNS(void) {
50140     int test_ret = 0;
50141
50142
50143     /* missing type support */
50144     return(test_ret);
50145 }
50146
50147
50148 static int
50149 test_xmlXPathRegisterNs(void) {
50150     int test_ret = 0;
50151
50152 #if defined(LIBXML_XPATH_ENABLED)
50153     int mem_base;
50154     int ret_val;
50155     xmlXPathContextPtr ctxt; /* the XPath context */
50156     int n_ctxt;
50157     xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
50158     int n_prefix;
50159     xmlChar * ns_uri; /* the namespace name */
50160     int n_ns_uri;
50161
50162     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50163     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
50164     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50165         mem_base = xmlMemBlocks();
50166         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50167         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
50168         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50169
50170         ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
50171         desret_int(ret_val);
50172         call_tests++;
50173         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50174         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
50175         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50176         xmlResetLastError();
50177         if (mem_base != xmlMemBlocks()) {
50178             printf("Leak of %d blocks found in xmlXPathRegisterNs",
50179                    xmlMemBlocks() - mem_base);
50180             test_ret++;
50181             printf(" %d", n_ctxt);
50182             printf(" %d", n_prefix);
50183             printf(" %d", n_ns_uri);
50184             printf("\n");
50185         }
50186     }
50187     }
50188     }
50189     function_tests++;
50190 #endif
50191
50192     return(test_ret);
50193 }
50194
50195
50196 static int
50197 test_xmlXPathRegisterVariable(void) {
50198     int test_ret = 0;
50199
50200 #if defined(LIBXML_XPATH_ENABLED)
50201     int mem_base;
50202     int ret_val;
50203     xmlXPathContextPtr ctxt; /* the XPath context */
50204     int n_ctxt;
50205     xmlChar * name; /* the variable name */
50206     int n_name;
50207     xmlXPathObjectPtr value; /* the variable value or NULL */
50208     int n_value;
50209
50210     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50211     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50212     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50213         mem_base = xmlMemBlocks();
50214         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50215         name = gen_const_xmlChar_ptr(n_name, 1);
50216         value = gen_xmlXPathObjectPtr(n_value, 2);
50217
50218         ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
50219         desret_int(ret_val);
50220         call_tests++;
50221         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50222         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50223         des_xmlXPathObjectPtr(n_value, value, 2);
50224         xmlResetLastError();
50225         if (mem_base != xmlMemBlocks()) {
50226             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
50227                    xmlMemBlocks() - mem_base);
50228             test_ret++;
50229             printf(" %d", n_ctxt);
50230             printf(" %d", n_name);
50231             printf(" %d", n_value);
50232             printf("\n");
50233         }
50234     }
50235     }
50236     }
50237     function_tests++;
50238 #endif
50239
50240     return(test_ret);
50241 }
50242
50243
50244 static int
50245 test_xmlXPathRegisterVariableLookup(void) {
50246     int test_ret = 0;
50247
50248
50249     /* missing type support */
50250     return(test_ret);
50251 }
50252
50253
50254 static int
50255 test_xmlXPathRegisterVariableNS(void) {
50256     int test_ret = 0;
50257
50258 #if defined(LIBXML_XPATH_ENABLED)
50259     int mem_base;
50260     int ret_val;
50261     xmlXPathContextPtr ctxt; /* the XPath context */
50262     int n_ctxt;
50263     xmlChar * name; /* the variable name */
50264     int n_name;
50265     xmlChar * ns_uri; /* the variable namespace URI */
50266     int n_ns_uri;
50267     xmlXPathObjectPtr value; /* the variable value or NULL */
50268     int n_value;
50269
50270     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50271     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50272     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50273     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
50274         mem_base = xmlMemBlocks();
50275         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50276         name = gen_const_xmlChar_ptr(n_name, 1);
50277         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50278         value = gen_xmlXPathObjectPtr(n_value, 3);
50279
50280         ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
50281         desret_int(ret_val);
50282         call_tests++;
50283         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50284         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50285         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50286         des_xmlXPathObjectPtr(n_value, value, 3);
50287         xmlResetLastError();
50288         if (mem_base != xmlMemBlocks()) {
50289             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
50290                    xmlMemBlocks() - mem_base);
50291             test_ret++;
50292             printf(" %d", n_ctxt);
50293             printf(" %d", n_name);
50294             printf(" %d", n_ns_uri);
50295             printf(" %d", n_value);
50296             printf("\n");
50297         }
50298     }
50299     }
50300     }
50301     }
50302     function_tests++;
50303 #endif
50304
50305     return(test_ret);
50306 }
50307
50308
50309 static int
50310 test_xmlXPathRegisteredFuncsCleanup(void) {
50311     int test_ret = 0;
50312
50313 #if defined(LIBXML_XPATH_ENABLED)
50314     int mem_base;
50315     xmlXPathContextPtr ctxt; /* the XPath context */
50316     int n_ctxt;
50317
50318     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50319         mem_base = xmlMemBlocks();
50320         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50321
50322         xmlXPathRegisteredFuncsCleanup(ctxt);
50323         call_tests++;
50324         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50325         xmlResetLastError();
50326         if (mem_base != xmlMemBlocks()) {
50327             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
50328                    xmlMemBlocks() - mem_base);
50329             test_ret++;
50330             printf(" %d", n_ctxt);
50331             printf("\n");
50332         }
50333     }
50334     function_tests++;
50335 #endif
50336
50337     return(test_ret);
50338 }
50339
50340
50341 static int
50342 test_xmlXPathRegisteredNsCleanup(void) {
50343     int test_ret = 0;
50344
50345 #if defined(LIBXML_XPATH_ENABLED)
50346     int mem_base;
50347     xmlXPathContextPtr ctxt; /* the XPath context */
50348     int n_ctxt;
50349
50350     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50351         mem_base = xmlMemBlocks();
50352         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50353
50354         xmlXPathRegisteredNsCleanup(ctxt);
50355         call_tests++;
50356         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50357         xmlResetLastError();
50358         if (mem_base != xmlMemBlocks()) {
50359             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
50360                    xmlMemBlocks() - mem_base);
50361             test_ret++;
50362             printf(" %d", n_ctxt);
50363             printf("\n");
50364         }
50365     }
50366     function_tests++;
50367 #endif
50368
50369     return(test_ret);
50370 }
50371
50372
50373 static int
50374 test_xmlXPathRegisteredVariablesCleanup(void) {
50375     int test_ret = 0;
50376
50377 #if defined(LIBXML_XPATH_ENABLED)
50378     int mem_base;
50379     xmlXPathContextPtr ctxt; /* the XPath context */
50380     int n_ctxt;
50381
50382     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50383         mem_base = xmlMemBlocks();
50384         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50385
50386         xmlXPathRegisteredVariablesCleanup(ctxt);
50387         call_tests++;
50388         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50389         xmlResetLastError();
50390         if (mem_base != xmlMemBlocks()) {
50391             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
50392                    xmlMemBlocks() - mem_base);
50393             test_ret++;
50394             printf(" %d", n_ctxt);
50395             printf("\n");
50396         }
50397     }
50398     function_tests++;
50399 #endif
50400
50401     return(test_ret);
50402 }
50403
50404
50405 static int
50406 test_xmlXPathRoot(void) {
50407     int test_ret = 0;
50408
50409 #if defined(LIBXML_XPATH_ENABLED)
50410     int mem_base;
50411     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50412     int n_ctxt;
50413
50414     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50415         mem_base = xmlMemBlocks();
50416         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50417
50418         xmlXPathRoot(ctxt);
50419         call_tests++;
50420         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50421         xmlResetLastError();
50422         if (mem_base != xmlMemBlocks()) {
50423             printf("Leak of %d blocks found in xmlXPathRoot",
50424                    xmlMemBlocks() - mem_base);
50425             test_ret++;
50426             printf(" %d", n_ctxt);
50427             printf("\n");
50428         }
50429     }
50430     function_tests++;
50431 #endif
50432
50433     return(test_ret);
50434 }
50435
50436
50437 static int
50438 test_xmlXPathRoundFunction(void) {
50439     int test_ret = 0;
50440
50441 #if defined(LIBXML_XPATH_ENABLED)
50442     int mem_base;
50443     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50444     int n_ctxt;
50445     int nargs; /* the number of arguments */
50446     int n_nargs;
50447
50448     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50449     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50450         mem_base = xmlMemBlocks();
50451         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50452         nargs = gen_int(n_nargs, 1);
50453
50454         xmlXPathRoundFunction(ctxt, nargs);
50455         call_tests++;
50456         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50457         des_int(n_nargs, nargs, 1);
50458         xmlResetLastError();
50459         if (mem_base != xmlMemBlocks()) {
50460             printf("Leak of %d blocks found in xmlXPathRoundFunction",
50461                    xmlMemBlocks() - mem_base);
50462             test_ret++;
50463             printf(" %d", n_ctxt);
50464             printf(" %d", n_nargs);
50465             printf("\n");
50466         }
50467     }
50468     }
50469     function_tests++;
50470 #endif
50471
50472     return(test_ret);
50473 }
50474
50475
50476 static int
50477 test_xmlXPathStartsWithFunction(void) {
50478     int test_ret = 0;
50479
50480 #if defined(LIBXML_XPATH_ENABLED)
50481     int mem_base;
50482     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50483     int n_ctxt;
50484     int nargs; /* the number of arguments */
50485     int n_nargs;
50486
50487     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50488     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50489         mem_base = xmlMemBlocks();
50490         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50491         nargs = gen_int(n_nargs, 1);
50492
50493         xmlXPathStartsWithFunction(ctxt, nargs);
50494         call_tests++;
50495         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50496         des_int(n_nargs, nargs, 1);
50497         xmlResetLastError();
50498         if (mem_base != xmlMemBlocks()) {
50499             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50500                    xmlMemBlocks() - mem_base);
50501             test_ret++;
50502             printf(" %d", n_ctxt);
50503             printf(" %d", n_nargs);
50504             printf("\n");
50505         }
50506     }
50507     }
50508     function_tests++;
50509 #endif
50510
50511     return(test_ret);
50512 }
50513
50514
50515 static int
50516 test_xmlXPathStringEvalNumber(void) {
50517     int test_ret = 0;
50518
50519 #if defined(LIBXML_XPATH_ENABLED)
50520     int mem_base;
50521     double ret_val;
50522     xmlChar * str; /* A string to scan */
50523     int n_str;
50524
50525     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50526         mem_base = xmlMemBlocks();
50527         str = gen_const_xmlChar_ptr(n_str, 0);
50528
50529         ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50530         desret_double(ret_val);
50531         call_tests++;
50532         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50533         xmlResetLastError();
50534         if (mem_base != xmlMemBlocks()) {
50535             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50536                    xmlMemBlocks() - mem_base);
50537             test_ret++;
50538             printf(" %d", n_str);
50539             printf("\n");
50540         }
50541     }
50542     function_tests++;
50543 #endif
50544
50545     return(test_ret);
50546 }
50547
50548
50549 static int
50550 test_xmlXPathStringFunction(void) {
50551     int test_ret = 0;
50552
50553 #if defined(LIBXML_XPATH_ENABLED)
50554     int mem_base;
50555     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50556     int n_ctxt;
50557     int nargs; /* the number of arguments */
50558     int n_nargs;
50559
50560     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50561     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50562         mem_base = xmlMemBlocks();
50563         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50564         nargs = gen_int(n_nargs, 1);
50565
50566         xmlXPathStringFunction(ctxt, nargs);
50567         call_tests++;
50568         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50569         des_int(n_nargs, nargs, 1);
50570         xmlResetLastError();
50571         if (mem_base != xmlMemBlocks()) {
50572             printf("Leak of %d blocks found in xmlXPathStringFunction",
50573                    xmlMemBlocks() - mem_base);
50574             test_ret++;
50575             printf(" %d", n_ctxt);
50576             printf(" %d", n_nargs);
50577             printf("\n");
50578         }
50579     }
50580     }
50581     function_tests++;
50582 #endif
50583
50584     return(test_ret);
50585 }
50586
50587
50588 static int
50589 test_xmlXPathStringLengthFunction(void) {
50590     int test_ret = 0;
50591
50592 #if defined(LIBXML_XPATH_ENABLED)
50593     int mem_base;
50594     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50595     int n_ctxt;
50596     int nargs; /* the number of arguments */
50597     int n_nargs;
50598
50599     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50600     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50601         mem_base = xmlMemBlocks();
50602         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50603         nargs = gen_int(n_nargs, 1);
50604
50605         xmlXPathStringLengthFunction(ctxt, nargs);
50606         call_tests++;
50607         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50608         des_int(n_nargs, nargs, 1);
50609         xmlResetLastError();
50610         if (mem_base != xmlMemBlocks()) {
50611             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50612                    xmlMemBlocks() - mem_base);
50613             test_ret++;
50614             printf(" %d", n_ctxt);
50615             printf(" %d", n_nargs);
50616             printf("\n");
50617         }
50618     }
50619     }
50620     function_tests++;
50621 #endif
50622
50623     return(test_ret);
50624 }
50625
50626
50627 static int
50628 test_xmlXPathSubValues(void) {
50629     int test_ret = 0;
50630
50631 #if defined(LIBXML_XPATH_ENABLED)
50632     int mem_base;
50633     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50634     int n_ctxt;
50635
50636     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50637         mem_base = xmlMemBlocks();
50638         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50639
50640         xmlXPathSubValues(ctxt);
50641         call_tests++;
50642         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50643         xmlResetLastError();
50644         if (mem_base != xmlMemBlocks()) {
50645             printf("Leak of %d blocks found in xmlXPathSubValues",
50646                    xmlMemBlocks() - mem_base);
50647             test_ret++;
50648             printf(" %d", n_ctxt);
50649             printf("\n");
50650         }
50651     }
50652     function_tests++;
50653 #endif
50654
50655     return(test_ret);
50656 }
50657
50658
50659 static int
50660 test_xmlXPathSubstringAfterFunction(void) {
50661     int test_ret = 0;
50662
50663 #if defined(LIBXML_XPATH_ENABLED)
50664     int mem_base;
50665     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50666     int n_ctxt;
50667     int nargs; /* the number of arguments */
50668     int n_nargs;
50669
50670     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50671     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50672         mem_base = xmlMemBlocks();
50673         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50674         nargs = gen_int(n_nargs, 1);
50675
50676         xmlXPathSubstringAfterFunction(ctxt, nargs);
50677         call_tests++;
50678         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50679         des_int(n_nargs, nargs, 1);
50680         xmlResetLastError();
50681         if (mem_base != xmlMemBlocks()) {
50682             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50683                    xmlMemBlocks() - mem_base);
50684             test_ret++;
50685             printf(" %d", n_ctxt);
50686             printf(" %d", n_nargs);
50687             printf("\n");
50688         }
50689     }
50690     }
50691     function_tests++;
50692 #endif
50693
50694     return(test_ret);
50695 }
50696
50697
50698 static int
50699 test_xmlXPathSubstringBeforeFunction(void) {
50700     int test_ret = 0;
50701
50702 #if defined(LIBXML_XPATH_ENABLED)
50703     int mem_base;
50704     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50705     int n_ctxt;
50706     int nargs; /* the number of arguments */
50707     int n_nargs;
50708
50709     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50710     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50711         mem_base = xmlMemBlocks();
50712         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50713         nargs = gen_int(n_nargs, 1);
50714
50715         xmlXPathSubstringBeforeFunction(ctxt, nargs);
50716         call_tests++;
50717         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50718         des_int(n_nargs, nargs, 1);
50719         xmlResetLastError();
50720         if (mem_base != xmlMemBlocks()) {
50721             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50722                    xmlMemBlocks() - mem_base);
50723             test_ret++;
50724             printf(" %d", n_ctxt);
50725             printf(" %d", n_nargs);
50726             printf("\n");
50727         }
50728     }
50729     }
50730     function_tests++;
50731 #endif
50732
50733     return(test_ret);
50734 }
50735
50736
50737 static int
50738 test_xmlXPathSubstringFunction(void) {
50739     int test_ret = 0;
50740
50741 #if defined(LIBXML_XPATH_ENABLED)
50742     int mem_base;
50743     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50744     int n_ctxt;
50745     int nargs; /* the number of arguments */
50746     int n_nargs;
50747
50748     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50749     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50750         mem_base = xmlMemBlocks();
50751         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50752         nargs = gen_int(n_nargs, 1);
50753
50754         xmlXPathSubstringFunction(ctxt, nargs);
50755         call_tests++;
50756         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50757         des_int(n_nargs, nargs, 1);
50758         xmlResetLastError();
50759         if (mem_base != xmlMemBlocks()) {
50760             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50761                    xmlMemBlocks() - mem_base);
50762             test_ret++;
50763             printf(" %d", n_ctxt);
50764             printf(" %d", n_nargs);
50765             printf("\n");
50766         }
50767     }
50768     }
50769     function_tests++;
50770 #endif
50771
50772     return(test_ret);
50773 }
50774
50775
50776 static int
50777 test_xmlXPathSumFunction(void) {
50778     int test_ret = 0;
50779
50780 #if defined(LIBXML_XPATH_ENABLED)
50781     int mem_base;
50782     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50783     int n_ctxt;
50784     int nargs; /* the number of arguments */
50785     int n_nargs;
50786
50787     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50788     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50789         mem_base = xmlMemBlocks();
50790         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50791         nargs = gen_int(n_nargs, 1);
50792
50793         xmlXPathSumFunction(ctxt, nargs);
50794         call_tests++;
50795         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50796         des_int(n_nargs, nargs, 1);
50797         xmlResetLastError();
50798         if (mem_base != xmlMemBlocks()) {
50799             printf("Leak of %d blocks found in xmlXPathSumFunction",
50800                    xmlMemBlocks() - mem_base);
50801             test_ret++;
50802             printf(" %d", n_ctxt);
50803             printf(" %d", n_nargs);
50804             printf("\n");
50805         }
50806     }
50807     }
50808     function_tests++;
50809 #endif
50810
50811     return(test_ret);
50812 }
50813
50814
50815 static int
50816 test_xmlXPathTrailing(void) {
50817     int test_ret = 0;
50818
50819 #if defined(LIBXML_XPATH_ENABLED)
50820     int mem_base;
50821     xmlNodeSetPtr ret_val;
50822     xmlNodeSetPtr nodes1; /* a node-set */
50823     int n_nodes1;
50824     xmlNodeSetPtr nodes2; /* a node-set */
50825     int n_nodes2;
50826
50827     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50828     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50829         mem_base = xmlMemBlocks();
50830         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50831         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50832
50833         ret_val = xmlXPathTrailing(nodes1, nodes2);
50834         desret_xmlNodeSetPtr(ret_val);
50835         call_tests++;
50836         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50837         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50838         xmlResetLastError();
50839         if (mem_base != xmlMemBlocks()) {
50840             printf("Leak of %d blocks found in xmlXPathTrailing",
50841                    xmlMemBlocks() - mem_base);
50842             test_ret++;
50843             printf(" %d", n_nodes1);
50844             printf(" %d", n_nodes2);
50845             printf("\n");
50846         }
50847     }
50848     }
50849     function_tests++;
50850 #endif
50851
50852     return(test_ret);
50853 }
50854
50855
50856 static int
50857 test_xmlXPathTrailingSorted(void) {
50858     int test_ret = 0;
50859
50860 #if defined(LIBXML_XPATH_ENABLED)
50861     int mem_base;
50862     xmlNodeSetPtr ret_val;
50863     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50864     int n_nodes1;
50865     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50866     int n_nodes2;
50867
50868     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50869     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50870         mem_base = xmlMemBlocks();
50871         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50872         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50873
50874         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50875         desret_xmlNodeSetPtr(ret_val);
50876         call_tests++;
50877         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50878         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50879         xmlResetLastError();
50880         if (mem_base != xmlMemBlocks()) {
50881             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50882                    xmlMemBlocks() - mem_base);
50883             test_ret++;
50884             printf(" %d", n_nodes1);
50885             printf(" %d", n_nodes2);
50886             printf("\n");
50887         }
50888     }
50889     }
50890     function_tests++;
50891 #endif
50892
50893     return(test_ret);
50894 }
50895
50896
50897 static int
50898 test_xmlXPathTranslateFunction(void) {
50899     int test_ret = 0;
50900
50901 #if defined(LIBXML_XPATH_ENABLED)
50902     int mem_base;
50903     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50904     int n_ctxt;
50905     int nargs; /* the number of arguments */
50906     int n_nargs;
50907
50908     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50909     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50910         mem_base = xmlMemBlocks();
50911         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50912         nargs = gen_int(n_nargs, 1);
50913
50914         xmlXPathTranslateFunction(ctxt, nargs);
50915         call_tests++;
50916         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50917         des_int(n_nargs, nargs, 1);
50918         xmlResetLastError();
50919         if (mem_base != xmlMemBlocks()) {
50920             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50921                    xmlMemBlocks() - mem_base);
50922             test_ret++;
50923             printf(" %d", n_ctxt);
50924             printf(" %d", n_nargs);
50925             printf("\n");
50926         }
50927     }
50928     }
50929     function_tests++;
50930 #endif
50931
50932     return(test_ret);
50933 }
50934
50935
50936 static int
50937 test_xmlXPathTrueFunction(void) {
50938     int test_ret = 0;
50939
50940 #if defined(LIBXML_XPATH_ENABLED)
50941     int mem_base;
50942     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50943     int n_ctxt;
50944     int nargs; /* the number of arguments */
50945     int n_nargs;
50946
50947     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50948     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50949         mem_base = xmlMemBlocks();
50950         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50951         nargs = gen_int(n_nargs, 1);
50952
50953         xmlXPathTrueFunction(ctxt, nargs);
50954         call_tests++;
50955         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50956         des_int(n_nargs, nargs, 1);
50957         xmlResetLastError();
50958         if (mem_base != xmlMemBlocks()) {
50959             printf("Leak of %d blocks found in xmlXPathTrueFunction",
50960                    xmlMemBlocks() - mem_base);
50961             test_ret++;
50962             printf(" %d", n_ctxt);
50963             printf(" %d", n_nargs);
50964             printf("\n");
50965         }
50966     }
50967     }
50968     function_tests++;
50969 #endif
50970
50971     return(test_ret);
50972 }
50973
50974
50975 static int
50976 test_xmlXPathValueFlipSign(void) {
50977     int test_ret = 0;
50978
50979 #if defined(LIBXML_XPATH_ENABLED)
50980     int mem_base;
50981     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50982     int n_ctxt;
50983
50984     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50985         mem_base = xmlMemBlocks();
50986         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50987
50988         xmlXPathValueFlipSign(ctxt);
50989         call_tests++;
50990         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50991         xmlResetLastError();
50992         if (mem_base != xmlMemBlocks()) {
50993             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50994                    xmlMemBlocks() - mem_base);
50995             test_ret++;
50996             printf(" %d", n_ctxt);
50997             printf("\n");
50998         }
50999     }
51000     function_tests++;
51001 #endif
51002
51003     return(test_ret);
51004 }
51005
51006
51007 static int
51008 test_xmlXPathVariableLookup(void) {
51009     int test_ret = 0;
51010
51011 #if defined(LIBXML_XPATH_ENABLED)
51012     int mem_base;
51013     xmlXPathObjectPtr ret_val;
51014     xmlXPathContextPtr ctxt; /* the XPath context */
51015     int n_ctxt;
51016     xmlChar * name; /* the variable name */
51017     int n_name;
51018
51019     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51020     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51021         mem_base = xmlMemBlocks();
51022         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51023         name = gen_const_xmlChar_ptr(n_name, 1);
51024
51025         ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
51026         desret_xmlXPathObjectPtr(ret_val);
51027         call_tests++;
51028         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51029         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51030         xmlResetLastError();
51031         if (mem_base != xmlMemBlocks()) {
51032             printf("Leak of %d blocks found in xmlXPathVariableLookup",
51033                    xmlMemBlocks() - mem_base);
51034             test_ret++;
51035             printf(" %d", n_ctxt);
51036             printf(" %d", n_name);
51037             printf("\n");
51038         }
51039     }
51040     }
51041     function_tests++;
51042 #endif
51043
51044     return(test_ret);
51045 }
51046
51047
51048 static int
51049 test_xmlXPathVariableLookupNS(void) {
51050     int test_ret = 0;
51051
51052 #if defined(LIBXML_XPATH_ENABLED)
51053     int mem_base;
51054     xmlXPathObjectPtr ret_val;
51055     xmlXPathContextPtr ctxt; /* the XPath context */
51056     int n_ctxt;
51057     xmlChar * name; /* the variable name */
51058     int n_name;
51059     xmlChar * ns_uri; /* the variable namespace URI */
51060     int n_ns_uri;
51061
51062     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51063     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51064     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51065         mem_base = xmlMemBlocks();
51066         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51067         name = gen_const_xmlChar_ptr(n_name, 1);
51068         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51069
51070         ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
51071         desret_xmlXPathObjectPtr(ret_val);
51072         call_tests++;
51073         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51074         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51075         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51076         xmlResetLastError();
51077         if (mem_base != xmlMemBlocks()) {
51078             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
51079                    xmlMemBlocks() - mem_base);
51080             test_ret++;
51081             printf(" %d", n_ctxt);
51082             printf(" %d", n_name);
51083             printf(" %d", n_ns_uri);
51084             printf("\n");
51085         }
51086     }
51087     }
51088     }
51089     function_tests++;
51090 #endif
51091
51092     return(test_ret);
51093 }
51094
51095
51096 static int
51097 test_xmlXPathWrapCString(void) {
51098     int test_ret = 0;
51099
51100 #if defined(LIBXML_XPATH_ENABLED)
51101     int mem_base;
51102     xmlXPathObjectPtr ret_val;
51103     char * val; /* the char * value */
51104     int n_val;
51105
51106     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
51107         mem_base = xmlMemBlocks();
51108         val = gen_char_ptr(n_val, 0);
51109
51110         ret_val = xmlXPathWrapCString(val);
51111         desret_xmlXPathObjectPtr(ret_val);
51112         call_tests++;
51113         des_char_ptr(n_val, val, 0);
51114         xmlResetLastError();
51115         if (mem_base != xmlMemBlocks()) {
51116             printf("Leak of %d blocks found in xmlXPathWrapCString",
51117                    xmlMemBlocks() - mem_base);
51118             test_ret++;
51119             printf(" %d", n_val);
51120             printf("\n");
51121         }
51122     }
51123     function_tests++;
51124 #endif
51125
51126     return(test_ret);
51127 }
51128
51129
51130 static int
51131 test_xmlXPathWrapExternal(void) {
51132     int test_ret = 0;
51133
51134 #if defined(LIBXML_XPATH_ENABLED)
51135     int mem_base;
51136     xmlXPathObjectPtr ret_val;
51137     void * val; /* the user data */
51138     int n_val;
51139
51140     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
51141         mem_base = xmlMemBlocks();
51142         val = gen_void_ptr(n_val, 0);
51143
51144         ret_val = xmlXPathWrapExternal(val);
51145         desret_xmlXPathObjectPtr(ret_val);
51146         call_tests++;
51147         des_void_ptr(n_val, val, 0);
51148         xmlResetLastError();
51149         if (mem_base != xmlMemBlocks()) {
51150             printf("Leak of %d blocks found in xmlXPathWrapExternal",
51151                    xmlMemBlocks() - mem_base);
51152             test_ret++;
51153             printf(" %d", n_val);
51154             printf("\n");
51155         }
51156     }
51157     function_tests++;
51158 #endif
51159
51160     return(test_ret);
51161 }
51162
51163
51164 static int
51165 test_xmlXPathWrapNodeSet(void) {
51166     int test_ret = 0;
51167
51168 #if defined(LIBXML_XPATH_ENABLED)
51169     int mem_base;
51170     xmlXPathObjectPtr ret_val;
51171     xmlNodeSetPtr val; /* the NodePtr value */
51172     int n_val;
51173
51174     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
51175         mem_base = xmlMemBlocks();
51176         val = gen_xmlNodeSetPtr(n_val, 0);
51177
51178         ret_val = xmlXPathWrapNodeSet(val);
51179         desret_xmlXPathObjectPtr(ret_val);
51180         call_tests++;
51181         des_xmlNodeSetPtr(n_val, val, 0);
51182         xmlResetLastError();
51183         if (mem_base != xmlMemBlocks()) {
51184             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
51185                    xmlMemBlocks() - mem_base);
51186             test_ret++;
51187             printf(" %d", n_val);
51188             printf("\n");
51189         }
51190     }
51191     function_tests++;
51192 #endif
51193
51194     return(test_ret);
51195 }
51196
51197
51198 static int
51199 test_xmlXPatherror(void) {
51200     int test_ret = 0;
51201
51202 #if defined(LIBXML_XPATH_ENABLED)
51203     int mem_base;
51204     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51205     int n_ctxt;
51206     const char * file; /* the file name */
51207     int n_file;
51208     int line; /* the line number */
51209     int n_line;
51210     int no; /* the error number */
51211     int n_no;
51212
51213     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51214     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
51215     for (n_line = 0;n_line < gen_nb_int;n_line++) {
51216     for (n_no = 0;n_no < gen_nb_int;n_no++) {
51217         mem_base = xmlMemBlocks();
51218         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51219         file = gen_filepath(n_file, 1);
51220         line = gen_int(n_line, 2);
51221         no = gen_int(n_no, 3);
51222
51223         xmlXPatherror(ctxt, file, line, no);
51224         call_tests++;
51225         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51226         des_filepath(n_file, file, 1);
51227         des_int(n_line, line, 2);
51228         des_int(n_no, no, 3);
51229         xmlResetLastError();
51230         if (mem_base != xmlMemBlocks()) {
51231             printf("Leak of %d blocks found in xmlXPatherror",
51232                    xmlMemBlocks() - mem_base);
51233             test_ret++;
51234             printf(" %d", n_ctxt);
51235             printf(" %d", n_file);
51236             printf(" %d", n_line);
51237             printf(" %d", n_no);
51238             printf("\n");
51239         }
51240     }
51241     }
51242     }
51243     }
51244     function_tests++;
51245 #endif
51246
51247     return(test_ret);
51248 }
51249
51250 static int
51251 test_xpathInternals(void) {
51252     int test_ret = 0;
51253
51254     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
51255     test_ret += test_valuePop();
51256     test_ret += test_valuePush();
51257     test_ret += test_xmlXPathAddValues();
51258     test_ret += test_xmlXPathBooleanFunction();
51259     test_ret += test_xmlXPathCeilingFunction();
51260     test_ret += test_xmlXPathCompareValues();
51261     test_ret += test_xmlXPathConcatFunction();
51262     test_ret += test_xmlXPathContainsFunction();
51263     test_ret += test_xmlXPathCountFunction();
51264     test_ret += test_xmlXPathDebugDumpCompExpr();
51265     test_ret += test_xmlXPathDebugDumpObject();
51266     test_ret += test_xmlXPathDifference();
51267     test_ret += test_xmlXPathDistinct();
51268     test_ret += test_xmlXPathDistinctSorted();
51269     test_ret += test_xmlXPathDivValues();
51270     test_ret += test_xmlXPathEqualValues();
51271     test_ret += test_xmlXPathErr();
51272     test_ret += test_xmlXPathEvalExpr();
51273     test_ret += test_xmlXPathEvaluatePredicateResult();
51274     test_ret += test_xmlXPathFalseFunction();
51275     test_ret += test_xmlXPathFloorFunction();
51276     test_ret += test_xmlXPathFunctionLookup();
51277     test_ret += test_xmlXPathFunctionLookupNS();
51278     test_ret += test_xmlXPathHasSameNodes();
51279     test_ret += test_xmlXPathIdFunction();
51280     test_ret += test_xmlXPathIntersection();
51281     test_ret += test_xmlXPathIsNodeType();
51282     test_ret += test_xmlXPathLangFunction();
51283     test_ret += test_xmlXPathLastFunction();
51284     test_ret += test_xmlXPathLeading();
51285     test_ret += test_xmlXPathLeadingSorted();
51286     test_ret += test_xmlXPathLocalNameFunction();
51287     test_ret += test_xmlXPathModValues();
51288     test_ret += test_xmlXPathMultValues();
51289     test_ret += test_xmlXPathNamespaceURIFunction();
51290     test_ret += test_xmlXPathNewBoolean();
51291     test_ret += test_xmlXPathNewCString();
51292     test_ret += test_xmlXPathNewFloat();
51293     test_ret += test_xmlXPathNewNodeSet();
51294     test_ret += test_xmlXPathNewNodeSetList();
51295     test_ret += test_xmlXPathNewParserContext();
51296     test_ret += test_xmlXPathNewString();
51297     test_ret += test_xmlXPathNextAncestor();
51298     test_ret += test_xmlXPathNextAncestorOrSelf();
51299     test_ret += test_xmlXPathNextAttribute();
51300     test_ret += test_xmlXPathNextChild();
51301     test_ret += test_xmlXPathNextDescendant();
51302     test_ret += test_xmlXPathNextDescendantOrSelf();
51303     test_ret += test_xmlXPathNextFollowing();
51304     test_ret += test_xmlXPathNextFollowingSibling();
51305     test_ret += test_xmlXPathNextNamespace();
51306     test_ret += test_xmlXPathNextParent();
51307     test_ret += test_xmlXPathNextPreceding();
51308     test_ret += test_xmlXPathNextPrecedingSibling();
51309     test_ret += test_xmlXPathNextSelf();
51310     test_ret += test_xmlXPathNodeLeading();
51311     test_ret += test_xmlXPathNodeLeadingSorted();
51312     test_ret += test_xmlXPathNodeSetAdd();
51313     test_ret += test_xmlXPathNodeSetAddNs();
51314     test_ret += test_xmlXPathNodeSetAddUnique();
51315     test_ret += test_xmlXPathNodeSetContains();
51316     test_ret += test_xmlXPathNodeSetDel();
51317     test_ret += test_xmlXPathNodeSetMerge();
51318     test_ret += test_xmlXPathNodeSetRemove();
51319     test_ret += test_xmlXPathNodeSetSort();
51320     test_ret += test_xmlXPathNodeTrailing();
51321     test_ret += test_xmlXPathNodeTrailingSorted();
51322     test_ret += test_xmlXPathNormalizeFunction();
51323     test_ret += test_xmlXPathNotEqualValues();
51324     test_ret += test_xmlXPathNotFunction();
51325     test_ret += test_xmlXPathNsLookup();
51326     test_ret += test_xmlXPathNumberFunction();
51327     test_ret += test_xmlXPathParseNCName();
51328     test_ret += test_xmlXPathParseName();
51329     test_ret += test_xmlXPathPopBoolean();
51330     test_ret += test_xmlXPathPopExternal();
51331     test_ret += test_xmlXPathPopNodeSet();
51332     test_ret += test_xmlXPathPopNumber();
51333     test_ret += test_xmlXPathPopString();
51334     test_ret += test_xmlXPathPositionFunction();
51335     test_ret += test_xmlXPathRegisterAllFunctions();
51336     test_ret += test_xmlXPathRegisterFunc();
51337     test_ret += test_xmlXPathRegisterFuncLookup();
51338     test_ret += test_xmlXPathRegisterFuncNS();
51339     test_ret += test_xmlXPathRegisterNs();
51340     test_ret += test_xmlXPathRegisterVariable();
51341     test_ret += test_xmlXPathRegisterVariableLookup();
51342     test_ret += test_xmlXPathRegisterVariableNS();
51343     test_ret += test_xmlXPathRegisteredFuncsCleanup();
51344     test_ret += test_xmlXPathRegisteredNsCleanup();
51345     test_ret += test_xmlXPathRegisteredVariablesCleanup();
51346     test_ret += test_xmlXPathRoot();
51347     test_ret += test_xmlXPathRoundFunction();
51348     test_ret += test_xmlXPathStartsWithFunction();
51349     test_ret += test_xmlXPathStringEvalNumber();
51350     test_ret += test_xmlXPathStringFunction();
51351     test_ret += test_xmlXPathStringLengthFunction();
51352     test_ret += test_xmlXPathSubValues();
51353     test_ret += test_xmlXPathSubstringAfterFunction();
51354     test_ret += test_xmlXPathSubstringBeforeFunction();
51355     test_ret += test_xmlXPathSubstringFunction();
51356     test_ret += test_xmlXPathSumFunction();
51357     test_ret += test_xmlXPathTrailing();
51358     test_ret += test_xmlXPathTrailingSorted();
51359     test_ret += test_xmlXPathTranslateFunction();
51360     test_ret += test_xmlXPathTrueFunction();
51361     test_ret += test_xmlXPathValueFlipSign();
51362     test_ret += test_xmlXPathVariableLookup();
51363     test_ret += test_xmlXPathVariableLookupNS();
51364     test_ret += test_xmlXPathWrapCString();
51365     test_ret += test_xmlXPathWrapExternal();
51366     test_ret += test_xmlXPathWrapNodeSet();
51367     test_ret += test_xmlXPatherror();
51368
51369     if (test_ret != 0)
51370         printf("Module xpathInternals: %d errors\n", test_ret);
51371     return(test_ret);
51372 }
51373
51374 static int
51375 test_xmlXPtrBuildNodeList(void) {
51376     int test_ret = 0;
51377
51378 #if defined(LIBXML_XPTR_ENABLED)
51379     int mem_base;
51380     xmlNodePtr ret_val;
51381     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
51382     int n_obj;
51383
51384     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
51385         mem_base = xmlMemBlocks();
51386         obj = gen_xmlXPathObjectPtr(n_obj, 0);
51387
51388         ret_val = xmlXPtrBuildNodeList(obj);
51389         desret_xmlNodePtr(ret_val);
51390         call_tests++;
51391         des_xmlXPathObjectPtr(n_obj, obj, 0);
51392         xmlResetLastError();
51393         if (mem_base != xmlMemBlocks()) {
51394             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
51395                    xmlMemBlocks() - mem_base);
51396             test_ret++;
51397             printf(" %d", n_obj);
51398             printf("\n");
51399         }
51400     }
51401     function_tests++;
51402 #endif
51403
51404     return(test_ret);
51405 }
51406
51407
51408 static int
51409 test_xmlXPtrEval(void) {
51410     int test_ret = 0;
51411
51412 #if defined(LIBXML_XPTR_ENABLED)
51413     int mem_base;
51414     xmlXPathObjectPtr ret_val;
51415     xmlChar * str; /* the XPointer expression */
51416     int n_str;
51417     xmlXPathContextPtr ctx; /* the XPointer context */
51418     int n_ctx;
51419
51420     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51421     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51422         mem_base = xmlMemBlocks();
51423         str = gen_const_xmlChar_ptr(n_str, 0);
51424         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51425
51426         ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
51427         desret_xmlXPathObjectPtr(ret_val);
51428         call_tests++;
51429         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51430         des_xmlXPathContextPtr(n_ctx, ctx, 1);
51431         xmlResetLastError();
51432         if (mem_base != xmlMemBlocks()) {
51433             printf("Leak of %d blocks found in xmlXPtrEval",
51434                    xmlMemBlocks() - mem_base);
51435             test_ret++;
51436             printf(" %d", n_str);
51437             printf(" %d", n_ctx);
51438             printf("\n");
51439         }
51440     }
51441     }
51442     function_tests++;
51443 #endif
51444
51445     return(test_ret);
51446 }
51447
51448
51449 static int
51450 test_xmlXPtrEvalRangePredicate(void) {
51451     int test_ret = 0;
51452
51453 #if defined(LIBXML_XPTR_ENABLED)
51454     int mem_base;
51455     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51456     int n_ctxt;
51457
51458     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51459         mem_base = xmlMemBlocks();
51460         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51461
51462         xmlXPtrEvalRangePredicate(ctxt);
51463         call_tests++;
51464         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51465         xmlResetLastError();
51466         if (mem_base != xmlMemBlocks()) {
51467             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51468                    xmlMemBlocks() - mem_base);
51469             test_ret++;
51470             printf(" %d", n_ctxt);
51471             printf("\n");
51472         }
51473     }
51474     function_tests++;
51475 #endif
51476
51477     return(test_ret);
51478 }
51479
51480 #ifdef LIBXML_XPTR_ENABLED
51481
51482 #define gen_nb_xmlLocationSetPtr 1
51483 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51484     return(NULL);
51485 }
51486 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51487 }
51488 #endif
51489
51490
51491 static int
51492 test_xmlXPtrLocationSetAdd(void) {
51493     int test_ret = 0;
51494
51495 #if defined(LIBXML_XPTR_ENABLED)
51496     int mem_base;
51497     xmlLocationSetPtr cur; /* the initial range set */
51498     int n_cur;
51499     xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51500     int n_val;
51501
51502     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51503     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51504         mem_base = xmlMemBlocks();
51505         cur = gen_xmlLocationSetPtr(n_cur, 0);
51506         val = gen_xmlXPathObjectPtr(n_val, 1);
51507
51508         xmlXPtrLocationSetAdd(cur, val);
51509         call_tests++;
51510         des_xmlLocationSetPtr(n_cur, cur, 0);
51511         des_xmlXPathObjectPtr(n_val, val, 1);
51512         xmlResetLastError();
51513         if (mem_base != xmlMemBlocks()) {
51514             printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51515                    xmlMemBlocks() - mem_base);
51516             test_ret++;
51517             printf(" %d", n_cur);
51518             printf(" %d", n_val);
51519             printf("\n");
51520         }
51521     }
51522     }
51523     function_tests++;
51524 #endif
51525
51526     return(test_ret);
51527 }
51528
51529
51530 static int
51531 test_xmlXPtrLocationSetCreate(void) {
51532     int test_ret = 0;
51533
51534
51535     /* missing type support */
51536     return(test_ret);
51537 }
51538
51539
51540 static int
51541 test_xmlXPtrLocationSetDel(void) {
51542     int test_ret = 0;
51543
51544 #if defined(LIBXML_XPTR_ENABLED)
51545     int mem_base;
51546     xmlLocationSetPtr cur; /* the initial range set */
51547     int n_cur;
51548     xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51549     int n_val;
51550
51551     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51552     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51553         mem_base = xmlMemBlocks();
51554         cur = gen_xmlLocationSetPtr(n_cur, 0);
51555         val = gen_xmlXPathObjectPtr(n_val, 1);
51556
51557         xmlXPtrLocationSetDel(cur, val);
51558         call_tests++;
51559         des_xmlLocationSetPtr(n_cur, cur, 0);
51560         des_xmlXPathObjectPtr(n_val, val, 1);
51561         xmlResetLastError();
51562         if (mem_base != xmlMemBlocks()) {
51563             printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51564                    xmlMemBlocks() - mem_base);
51565             test_ret++;
51566             printf(" %d", n_cur);
51567             printf(" %d", n_val);
51568             printf("\n");
51569         }
51570     }
51571     }
51572     function_tests++;
51573 #endif
51574
51575     return(test_ret);
51576 }
51577
51578
51579 static int
51580 test_xmlXPtrLocationSetMerge(void) {
51581     int test_ret = 0;
51582
51583
51584     /* missing type support */
51585     return(test_ret);
51586 }
51587
51588
51589 static int
51590 test_xmlXPtrLocationSetRemove(void) {
51591     int test_ret = 0;
51592
51593 #if defined(LIBXML_XPTR_ENABLED)
51594     int mem_base;
51595     xmlLocationSetPtr cur; /* the initial range set */
51596     int n_cur;
51597     int val; /* the index to remove */
51598     int n_val;
51599
51600     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51601     for (n_val = 0;n_val < gen_nb_int;n_val++) {
51602         mem_base = xmlMemBlocks();
51603         cur = gen_xmlLocationSetPtr(n_cur, 0);
51604         val = gen_int(n_val, 1);
51605
51606         xmlXPtrLocationSetRemove(cur, val);
51607         call_tests++;
51608         des_xmlLocationSetPtr(n_cur, cur, 0);
51609         des_int(n_val, val, 1);
51610         xmlResetLastError();
51611         if (mem_base != xmlMemBlocks()) {
51612             printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51613                    xmlMemBlocks() - mem_base);
51614             test_ret++;
51615             printf(" %d", n_cur);
51616             printf(" %d", n_val);
51617             printf("\n");
51618         }
51619     }
51620     }
51621     function_tests++;
51622 #endif
51623
51624     return(test_ret);
51625 }
51626
51627
51628 static int
51629 test_xmlXPtrNewCollapsedRange(void) {
51630     int test_ret = 0;
51631
51632 #if defined(LIBXML_XPTR_ENABLED)
51633     int mem_base;
51634     xmlXPathObjectPtr ret_val;
51635     xmlNodePtr start; /* the starting and ending node */
51636     int n_start;
51637
51638     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51639         mem_base = xmlMemBlocks();
51640         start = gen_xmlNodePtr(n_start, 0);
51641
51642         ret_val = xmlXPtrNewCollapsedRange(start);
51643         desret_xmlXPathObjectPtr(ret_val);
51644         call_tests++;
51645         des_xmlNodePtr(n_start, start, 0);
51646         xmlResetLastError();
51647         if (mem_base != xmlMemBlocks()) {
51648             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51649                    xmlMemBlocks() - mem_base);
51650             test_ret++;
51651             printf(" %d", n_start);
51652             printf("\n");
51653         }
51654     }
51655     function_tests++;
51656 #endif
51657
51658     return(test_ret);
51659 }
51660
51661
51662 static int
51663 test_xmlXPtrNewContext(void) {
51664     int test_ret = 0;
51665
51666
51667     /* missing type support */
51668     return(test_ret);
51669 }
51670
51671
51672 static int
51673 test_xmlXPtrNewLocationSetNodeSet(void) {
51674     int test_ret = 0;
51675
51676 #if defined(LIBXML_XPTR_ENABLED)
51677     int mem_base;
51678     xmlXPathObjectPtr ret_val;
51679     xmlNodeSetPtr set; /* a node set */
51680     int n_set;
51681
51682     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51683         mem_base = xmlMemBlocks();
51684         set = gen_xmlNodeSetPtr(n_set, 0);
51685
51686         ret_val = xmlXPtrNewLocationSetNodeSet(set);
51687         desret_xmlXPathObjectPtr(ret_val);
51688         call_tests++;
51689         des_xmlNodeSetPtr(n_set, set, 0);
51690         xmlResetLastError();
51691         if (mem_base != xmlMemBlocks()) {
51692             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51693                    xmlMemBlocks() - mem_base);
51694             test_ret++;
51695             printf(" %d", n_set);
51696             printf("\n");
51697         }
51698     }
51699     function_tests++;
51700 #endif
51701
51702     return(test_ret);
51703 }
51704
51705
51706 static int
51707 test_xmlXPtrNewLocationSetNodes(void) {
51708     int test_ret = 0;
51709
51710 #if defined(LIBXML_XPTR_ENABLED)
51711     int mem_base;
51712     xmlXPathObjectPtr ret_val;
51713     xmlNodePtr start; /* the start NodePtr value */
51714     int n_start;
51715     xmlNodePtr end; /* the end NodePtr value or NULL */
51716     int n_end;
51717
51718     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51719     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51720         mem_base = xmlMemBlocks();
51721         start = gen_xmlNodePtr(n_start, 0);
51722         end = gen_xmlNodePtr(n_end, 1);
51723
51724         ret_val = xmlXPtrNewLocationSetNodes(start, end);
51725         desret_xmlXPathObjectPtr(ret_val);
51726         call_tests++;
51727         des_xmlNodePtr(n_start, start, 0);
51728         des_xmlNodePtr(n_end, end, 1);
51729         xmlResetLastError();
51730         if (mem_base != xmlMemBlocks()) {
51731             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51732                    xmlMemBlocks() - mem_base);
51733             test_ret++;
51734             printf(" %d", n_start);
51735             printf(" %d", n_end);
51736             printf("\n");
51737         }
51738     }
51739     }
51740     function_tests++;
51741 #endif
51742
51743     return(test_ret);
51744 }
51745
51746
51747 static int
51748 test_xmlXPtrNewRange(void) {
51749     int test_ret = 0;
51750
51751 #if defined(LIBXML_XPTR_ENABLED)
51752     int mem_base;
51753     xmlXPathObjectPtr ret_val;
51754     xmlNodePtr start; /* the starting node */
51755     int n_start;
51756     int startindex; /* the start index */
51757     int n_startindex;
51758     xmlNodePtr end; /* the ending point */
51759     int n_end;
51760     int endindex; /* the ending index */
51761     int n_endindex;
51762
51763     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51764     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51765     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51766     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51767         mem_base = xmlMemBlocks();
51768         start = gen_xmlNodePtr(n_start, 0);
51769         startindex = gen_int(n_startindex, 1);
51770         end = gen_xmlNodePtr(n_end, 2);
51771         endindex = gen_int(n_endindex, 3);
51772
51773         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51774         desret_xmlXPathObjectPtr(ret_val);
51775         call_tests++;
51776         des_xmlNodePtr(n_start, start, 0);
51777         des_int(n_startindex, startindex, 1);
51778         des_xmlNodePtr(n_end, end, 2);
51779         des_int(n_endindex, endindex, 3);
51780         xmlResetLastError();
51781         if (mem_base != xmlMemBlocks()) {
51782             printf("Leak of %d blocks found in xmlXPtrNewRange",
51783                    xmlMemBlocks() - mem_base);
51784             test_ret++;
51785             printf(" %d", n_start);
51786             printf(" %d", n_startindex);
51787             printf(" %d", n_end);
51788             printf(" %d", n_endindex);
51789             printf("\n");
51790         }
51791     }
51792     }
51793     }
51794     }
51795     function_tests++;
51796 #endif
51797
51798     return(test_ret);
51799 }
51800
51801
51802 static int
51803 test_xmlXPtrNewRangeNodeObject(void) {
51804     int test_ret = 0;
51805
51806 #if defined(LIBXML_XPTR_ENABLED)
51807     int mem_base;
51808     xmlXPathObjectPtr ret_val;
51809     xmlNodePtr start; /* the starting node */
51810     int n_start;
51811     xmlXPathObjectPtr end; /* the ending object */
51812     int n_end;
51813
51814     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51815     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51816         mem_base = xmlMemBlocks();
51817         start = gen_xmlNodePtr(n_start, 0);
51818         end = gen_xmlXPathObjectPtr(n_end, 1);
51819
51820         ret_val = xmlXPtrNewRangeNodeObject(start, end);
51821         desret_xmlXPathObjectPtr(ret_val);
51822         call_tests++;
51823         des_xmlNodePtr(n_start, start, 0);
51824         des_xmlXPathObjectPtr(n_end, end, 1);
51825         xmlResetLastError();
51826         if (mem_base != xmlMemBlocks()) {
51827             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51828                    xmlMemBlocks() - mem_base);
51829             test_ret++;
51830             printf(" %d", n_start);
51831             printf(" %d", n_end);
51832             printf("\n");
51833         }
51834     }
51835     }
51836     function_tests++;
51837 #endif
51838
51839     return(test_ret);
51840 }
51841
51842
51843 static int
51844 test_xmlXPtrNewRangeNodePoint(void) {
51845     int test_ret = 0;
51846
51847 #if defined(LIBXML_XPTR_ENABLED)
51848     int mem_base;
51849     xmlXPathObjectPtr ret_val;
51850     xmlNodePtr start; /* the starting node */
51851     int n_start;
51852     xmlXPathObjectPtr end; /* the ending point */
51853     int n_end;
51854
51855     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51856     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51857         mem_base = xmlMemBlocks();
51858         start = gen_xmlNodePtr(n_start, 0);
51859         end = gen_xmlXPathObjectPtr(n_end, 1);
51860
51861         ret_val = xmlXPtrNewRangeNodePoint(start, end);
51862         desret_xmlXPathObjectPtr(ret_val);
51863         call_tests++;
51864         des_xmlNodePtr(n_start, start, 0);
51865         des_xmlXPathObjectPtr(n_end, end, 1);
51866         xmlResetLastError();
51867         if (mem_base != xmlMemBlocks()) {
51868             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51869                    xmlMemBlocks() - mem_base);
51870             test_ret++;
51871             printf(" %d", n_start);
51872             printf(" %d", n_end);
51873             printf("\n");
51874         }
51875     }
51876     }
51877     function_tests++;
51878 #endif
51879
51880     return(test_ret);
51881 }
51882
51883
51884 static int
51885 test_xmlXPtrNewRangeNodes(void) {
51886     int test_ret = 0;
51887
51888 #if defined(LIBXML_XPTR_ENABLED)
51889     int mem_base;
51890     xmlXPathObjectPtr ret_val;
51891     xmlNodePtr start; /* the starting node */
51892     int n_start;
51893     xmlNodePtr end; /* the ending node */
51894     int n_end;
51895
51896     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51897     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51898         mem_base = xmlMemBlocks();
51899         start = gen_xmlNodePtr(n_start, 0);
51900         end = gen_xmlNodePtr(n_end, 1);
51901
51902         ret_val = xmlXPtrNewRangeNodes(start, end);
51903         desret_xmlXPathObjectPtr(ret_val);
51904         call_tests++;
51905         des_xmlNodePtr(n_start, start, 0);
51906         des_xmlNodePtr(n_end, end, 1);
51907         xmlResetLastError();
51908         if (mem_base != xmlMemBlocks()) {
51909             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51910                    xmlMemBlocks() - mem_base);
51911             test_ret++;
51912             printf(" %d", n_start);
51913             printf(" %d", n_end);
51914             printf("\n");
51915         }
51916     }
51917     }
51918     function_tests++;
51919 #endif
51920
51921     return(test_ret);
51922 }
51923
51924
51925 static int
51926 test_xmlXPtrNewRangePointNode(void) {
51927     int test_ret = 0;
51928
51929 #if defined(LIBXML_XPTR_ENABLED)
51930     int mem_base;
51931     xmlXPathObjectPtr ret_val;
51932     xmlXPathObjectPtr start; /* the starting point */
51933     int n_start;
51934     xmlNodePtr end; /* the ending node */
51935     int n_end;
51936
51937     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51938     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51939         mem_base = xmlMemBlocks();
51940         start = gen_xmlXPathObjectPtr(n_start, 0);
51941         end = gen_xmlNodePtr(n_end, 1);
51942
51943         ret_val = xmlXPtrNewRangePointNode(start, end);
51944         desret_xmlXPathObjectPtr(ret_val);
51945         call_tests++;
51946         des_xmlXPathObjectPtr(n_start, start, 0);
51947         des_xmlNodePtr(n_end, end, 1);
51948         xmlResetLastError();
51949         if (mem_base != xmlMemBlocks()) {
51950             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51951                    xmlMemBlocks() - mem_base);
51952             test_ret++;
51953             printf(" %d", n_start);
51954             printf(" %d", n_end);
51955             printf("\n");
51956         }
51957     }
51958     }
51959     function_tests++;
51960 #endif
51961
51962     return(test_ret);
51963 }
51964
51965
51966 static int
51967 test_xmlXPtrNewRangePoints(void) {
51968     int test_ret = 0;
51969
51970 #if defined(LIBXML_XPTR_ENABLED)
51971     int mem_base;
51972     xmlXPathObjectPtr ret_val;
51973     xmlXPathObjectPtr start; /* the starting point */
51974     int n_start;
51975     xmlXPathObjectPtr end; /* the ending point */
51976     int n_end;
51977
51978     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51979     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51980         mem_base = xmlMemBlocks();
51981         start = gen_xmlXPathObjectPtr(n_start, 0);
51982         end = gen_xmlXPathObjectPtr(n_end, 1);
51983
51984         ret_val = xmlXPtrNewRangePoints(start, end);
51985         desret_xmlXPathObjectPtr(ret_val);
51986         call_tests++;
51987         des_xmlXPathObjectPtr(n_start, start, 0);
51988         des_xmlXPathObjectPtr(n_end, end, 1);
51989         xmlResetLastError();
51990         if (mem_base != xmlMemBlocks()) {
51991             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51992                    xmlMemBlocks() - mem_base);
51993             test_ret++;
51994             printf(" %d", n_start);
51995             printf(" %d", n_end);
51996             printf("\n");
51997         }
51998     }
51999     }
52000     function_tests++;
52001 #endif
52002
52003     return(test_ret);
52004 }
52005
52006
52007 static int
52008 test_xmlXPtrRangeToFunction(void) {
52009     int test_ret = 0;
52010
52011 #if defined(LIBXML_XPTR_ENABLED)
52012     int mem_base;
52013     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
52014     int n_ctxt;
52015     int nargs; /* the number of args */
52016     int n_nargs;
52017
52018     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52019     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52020         mem_base = xmlMemBlocks();
52021         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52022         nargs = gen_int(n_nargs, 1);
52023
52024         xmlXPtrRangeToFunction(ctxt, nargs);
52025         call_tests++;
52026         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52027         des_int(n_nargs, nargs, 1);
52028         xmlResetLastError();
52029         if (mem_base != xmlMemBlocks()) {
52030             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
52031                    xmlMemBlocks() - mem_base);
52032             test_ret++;
52033             printf(" %d", n_ctxt);
52034             printf(" %d", n_nargs);
52035             printf("\n");
52036         }
52037     }
52038     }
52039     function_tests++;
52040 #endif
52041
52042     return(test_ret);
52043 }
52044
52045
52046 static int
52047 test_xmlXPtrWrapLocationSet(void) {
52048     int test_ret = 0;
52049
52050 #if defined(LIBXML_XPTR_ENABLED)
52051     int mem_base;
52052     xmlXPathObjectPtr ret_val;
52053     xmlLocationSetPtr val; /* the LocationSet value */
52054     int n_val;
52055
52056     for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
52057         mem_base = xmlMemBlocks();
52058         val = gen_xmlLocationSetPtr(n_val, 0);
52059
52060         ret_val = xmlXPtrWrapLocationSet(val);
52061         desret_xmlXPathObjectPtr(ret_val);
52062         call_tests++;
52063         des_xmlLocationSetPtr(n_val, val, 0);
52064         xmlResetLastError();
52065         if (mem_base != xmlMemBlocks()) {
52066             printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
52067                    xmlMemBlocks() - mem_base);
52068             test_ret++;
52069             printf(" %d", n_val);
52070             printf("\n");
52071         }
52072     }
52073     function_tests++;
52074 #endif
52075
52076     return(test_ret);
52077 }
52078
52079 static int
52080 test_xpointer(void) {
52081     int test_ret = 0;
52082
52083     if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
52084     test_ret += test_xmlXPtrBuildNodeList();
52085     test_ret += test_xmlXPtrEval();
52086     test_ret += test_xmlXPtrEvalRangePredicate();
52087     test_ret += test_xmlXPtrLocationSetAdd();
52088     test_ret += test_xmlXPtrLocationSetCreate();
52089     test_ret += test_xmlXPtrLocationSetDel();
52090     test_ret += test_xmlXPtrLocationSetMerge();
52091     test_ret += test_xmlXPtrLocationSetRemove();
52092     test_ret += test_xmlXPtrNewCollapsedRange();
52093     test_ret += test_xmlXPtrNewContext();
52094     test_ret += test_xmlXPtrNewLocationSetNodeSet();
52095     test_ret += test_xmlXPtrNewLocationSetNodes();
52096     test_ret += test_xmlXPtrNewRange();
52097     test_ret += test_xmlXPtrNewRangeNodeObject();
52098     test_ret += test_xmlXPtrNewRangeNodePoint();
52099     test_ret += test_xmlXPtrNewRangeNodes();
52100     test_ret += test_xmlXPtrNewRangePointNode();
52101     test_ret += test_xmlXPtrNewRangePoints();
52102     test_ret += test_xmlXPtrRangeToFunction();
52103     test_ret += test_xmlXPtrWrapLocationSet();
52104
52105     if (test_ret != 0)
52106         printf("Module xpointer: %d errors\n", test_ret);
52107     return(test_ret);
52108 }
52109 static int
52110 test_module(const char *module) {
52111     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
52112     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
52113     if (!strcmp(module, "SAX2")) return(test_SAX2());
52114     if (!strcmp(module, "c14n")) return(test_c14n());
52115     if (!strcmp(module, "catalog")) return(test_catalog());
52116     if (!strcmp(module, "chvalid")) return(test_chvalid());
52117     if (!strcmp(module, "debugXML")) return(test_debugXML());
52118     if (!strcmp(module, "dict")) return(test_dict());
52119     if (!strcmp(module, "encoding")) return(test_encoding());
52120     if (!strcmp(module, "entities")) return(test_entities());
52121     if (!strcmp(module, "hash")) return(test_hash());
52122     if (!strcmp(module, "list")) return(test_list());
52123     if (!strcmp(module, "nanoftp")) return(test_nanoftp());
52124     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
52125     if (!strcmp(module, "parser")) return(test_parser());
52126     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
52127     if (!strcmp(module, "pattern")) return(test_pattern());
52128     if (!strcmp(module, "relaxng")) return(test_relaxng());
52129     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
52130     if (!strcmp(module, "schematron")) return(test_schematron());
52131     if (!strcmp(module, "tree")) return(test_tree());
52132     if (!strcmp(module, "uri")) return(test_uri());
52133     if (!strcmp(module, "valid")) return(test_valid());
52134     if (!strcmp(module, "xinclude")) return(test_xinclude());
52135     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
52136     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
52137     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
52138     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
52139     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
52140     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
52141     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
52142     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
52143     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
52144     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
52145     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
52146     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
52147     if (!strcmp(module, "xpath")) return(test_xpath());
52148     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
52149     if (!strcmp(module, "xpointer")) return(test_xpointer());
52150     return(0);
52151 }