Unit Test
[platform/upstream/libxml2.git] / testapi.c
1 /*
2  * testapi.c: libxml2 API tester program.
3  *
4  * Automatically generated by gentest.py from libxml2-api.xml
5  *
6  * See Copyright for the status of this software.
7  *
8  * daniel@veillard.com
9  */
10
11 #include "libxml.h"
12 #include <stdio.h>
13
14 #include <stdlib.h> /* for putenv() */
15 #include <string.h>
16 #include <libxml/xmlerror.h>
17 #include <libxml/relaxng.h>
18
19
20 static int testlibxml2(void);
21 static int test_module(const char *module);
22
23 static int generic_errors = 0;
24 static int call_tests = 0;
25 static int function_tests = 0;
26
27 static xmlChar chartab[1024];
28 static int inttab[1024];
29 static unsigned long longtab[1024];
30
31 static xmlDocPtr api_doc = NULL;
32 static xmlDtdPtr api_dtd = NULL;
33 static xmlNodePtr api_root = NULL;
34 static xmlAttrPtr api_attr = NULL;
35 static xmlNsPtr api_ns = NULL;
36
37 static void
38 structured_errors(void *userData ATTRIBUTE_UNUSED,
39                   xmlErrorPtr error ATTRIBUTE_UNUSED) {
40     generic_errors++;
41 }
42
43 static void
44 free_api_doc(void) {
45     xmlFreeDoc(api_doc);
46     api_doc = NULL;
47     api_dtd = NULL;
48     api_root = NULL;
49     api_attr = NULL;
50     api_ns = NULL;
51 }
52
53 static xmlDocPtr
54 get_api_doc(void) {
55     if (api_doc == NULL) {
56         api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
57         api_root = NULL;
58         api_attr = NULL;
59     }
60     return(api_doc);
61 }
62
63 static xmlDtdPtr
64 get_api_dtd(void) {
65     if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
66         get_api_doc();
67         if ((api_doc != NULL) && (api_doc->children != NULL) &&
68             (api_doc->children->type == XML_DTD_NODE))
69             api_dtd = (xmlDtdPtr) api_doc->children;
70     }
71     return(api_dtd);
72 }
73
74 static xmlNodePtr
75 get_api_root(void) {
76     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
77         get_api_doc();
78         if ((api_doc != NULL) && (api_doc->children != NULL) &&
79             (api_doc->children->next != NULL) &&
80             (api_doc->children->next->type == XML_ELEMENT_NODE))
81             api_root = api_doc->children->next;
82     }
83     return(api_root);
84 }
85
86 static xmlNsPtr
87 get_api_ns(void) {
88     get_api_root();
89     if (api_root != NULL)
90         api_ns = api_root->nsDef;
91     return(api_ns);
92 }
93
94 static xmlAttrPtr
95 get_api_attr(void) {
96 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
97     static int nr = 0;
98     xmlChar name[20];
99 #endif
100
101     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
102         get_api_root();
103     }
104     if (api_root == NULL)
105         return(NULL);
106     if (api_root->properties != NULL) {
107         api_attr = api_root->properties;
108         return(api_root->properties);
109     }
110     api_attr = NULL;
111 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
112     snprintf((char *) name, 20, "foo%d", nr++);
113     api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
114 #endif
115     return(api_attr);
116 }
117
118 static int quiet = 0;
119
120 int main(int argc, char **argv) {
121     int ret;
122     int blocks, mem;
123
124 #ifdef HAVE_PUTENV
125     /* access to the proxy can slow up regression tests a lot */
126     putenv((char *) "http_proxy=");
127 #endif
128
129     memset(chartab, 0, sizeof(chartab));
130     strncpy((char *) chartab, "  chartab\n", 20);
131     memset(inttab, 0, sizeof(inttab));
132     memset(longtab, 0, sizeof(longtab));
133
134     xmlInitParser();
135 #ifdef LIBXML_SCHEMAS_ENABLED
136     xmlRelaxNGInitTypes();
137 #endif
138
139     LIBXML_TEST_VERSION
140
141     xmlSetStructuredErrorFunc(NULL, structured_errors);
142
143     if (argc >= 2) {
144         if (!strcmp(argv[1], "-q")) {
145             quiet = 1;
146             if (argc >= 3)
147                 ret = test_module(argv[2]);
148             else
149                 ret = testlibxml2();
150         } else {
151            ret = test_module(argv[1]);
152         }
153     } else
154         ret = testlibxml2();
155
156     xmlCleanupParser();
157     blocks = xmlMemBlocks();
158     mem = xmlMemUsed();
159     if ((blocks != 0) || (mem != 0)) {
160         printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
161     }
162     xmlMemoryDump();
163
164     return (ret != 0);
165 }
166
167 #include <libxml/HTMLparser.h>
168 #include <libxml/HTMLtree.h>
169 #include <libxml/catalog.h>
170 #include <libxml/chvalid.h>
171 #include <libxml/dict.h>
172 #include <libxml/encoding.h>
173 #include <libxml/entities.h>
174 #include <libxml/hash.h>
175 #include <libxml/list.h>
176 #include <libxml/nanoftp.h>
177 #include <libxml/nanohttp.h>
178 #include <libxml/parser.h>
179 #include <libxml/parserInternals.h>
180 #include <libxml/pattern.h>
181 #include <libxml/relaxng.h>
182 #include <libxml/schemasInternals.h>
183 #include <libxml/schematron.h>
184 #include <libxml/tree.h>
185 #include <libxml/uri.h>
186 #include <libxml/valid.h>
187 #include <libxml/xinclude.h>
188 #include <libxml/xmlIO.h>
189 #include <libxml/xmlerror.h>
190 #include <libxml/xmlreader.h>
191 #include <libxml/xmlsave.h>
192 #include <libxml/xmlschemas.h>
193 #include <libxml/xmlschemastypes.h>
194 #include <libxml/xmlstring.h>
195 #include <libxml/xmlwriter.h>
196 #include <libxml/xpath.h>
197 #include <libxml/xpointer.h>
198 #include <libxml/debugXML.h>
199
200 /*
201   We manually define xmlErrMemory because it's normal declaration
202   is "hidden" by #ifdef IN_LIBXML
203 */
204 void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
205
206 /*
207  We need some "remote" addresses, but want to avoid getting into
208  name resolution delays, so we use these
209 */
210 #define REMOTE1GOOD     "http://localhost/"
211 #define REMOTE1BAD      "http:http://http"
212 #define REMOTE2GOOD     "ftp://localhost/foo"
213
214 #define gen_nb_void_ptr 2
215
216 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
217     return(NULL);
218 }
219 static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
220 }
221
222 #if 0
223 #define gen_nb_const_void_ptr 2
224
225 static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
226     if (no == 0) return((const void *) "immutable string");
227     return(NULL);
228 }
229 static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
230 }
231 #endif
232
233 #define gen_nb_userdata 3
234
235 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
236     if (no == 0) return((void *) &call_tests);
237     if (no == 1) return((void *) -1);
238     return(NULL);
239 }
240 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
241 }
242
243
244 #define gen_nb_int 4
245
246 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
247     if (no == 0) return(0);
248     if (no == 1) return(1);
249     if (no == 2) return(-1);
250     if (no == 3) return(122);
251     return(-1);
252 }
253
254 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
255 }
256
257 #define gen_nb_parseroptions 5
258
259 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
260     if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
261     if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
262     if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
263     if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
264     return(XML_PARSE_SAX1);
265 }
266
267 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
268 }
269
270 #if 0
271 #define gen_nb_long 5
272
273 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
274     if (no == 0) return(0);
275     if (no == 1) return(1);
276     if (no == 2) return(-1);
277     if (no == 3) return(122);
278     return(-1);
279 }
280
281 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
282 }
283 #endif
284
285 #define gen_nb_xmlChar 4
286
287 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
288     if (no == 0) return('a');
289     if (no == 1) return(' ');
290     if (no == 2) return((xmlChar) '\xf8');
291     return(0);
292 }
293
294 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
295 }
296
297 #define gen_nb_unsigned_int 3
298
299 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
300     if (no == 0) return(0);
301     if (no == 1) return(1);
302     if (no == 2) return(122);
303     return((unsigned int) -1);
304 }
305
306 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
307 }
308
309 #define gen_nb_unsigned_long 4
310
311 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
312     if (no == 0) return(0);
313     if (no == 1) return(1);
314     if (no == 2) return(122);
315     return((unsigned long) -1);
316 }
317
318 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
319 }
320
321 #define gen_nb_double 4
322
323 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
324     if (no == 0) return(0);
325     if (no == 1) return(-1.1);
326 #if defined(LIBXML_XPATH_ENABLED)
327     if (no == 2) return(xmlXPathNAN);
328 #endif
329     return(-1);
330 }
331
332 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
333 }
334
335 #define gen_nb_unsigned_long_ptr 2
336
337 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
338     if (no == 0) return(&longtab[nr]);
339     return(NULL);
340 }
341
342 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
343 }
344
345 #define gen_nb_int_ptr 2
346
347 static int *gen_int_ptr(int no, int nr) {
348     if (no == 0) return(&inttab[nr]);
349     return(NULL);
350 }
351
352 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
353 }
354
355 #define gen_nb_const_char_ptr 4
356
357 static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
358     if (no == 0) return((char *) "foo");
359     if (no == 1) return((char *) "<foo/>");
360     if (no == 2) return((char *) "test/ent2");
361     return(NULL);
362 }
363 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
364 }
365
366 #define gen_nb_xmlChar_ptr 2
367
368 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
369     if (no == 0) return(&chartab[0]);
370     return(NULL);
371 }
372 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
373 }
374
375 #define gen_nb_FILE_ptr 2
376
377 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
378     if (no == 0) return(fopen("test.out", "a+"));
379     return(NULL);
380 }
381 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
382     if (val != NULL) fclose(val);
383 }
384
385 #define gen_nb_debug_FILE_ptr 2
386 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
387     return(fopen("test.out", "a+"));
388 }
389 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
390     if (val != NULL) fclose(val);
391 }
392
393 #define gen_nb_const_xmlChar_ptr 5
394
395 static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
396     if (no == 0) return((xmlChar *) "foo");
397     if (no == 1) return((xmlChar *) "<foo/>");
398     if (no == 2) return((xmlChar *) "n" "\xf8" "ne");
399     if (no == 3) return((xmlChar *) " 2ab ");
400     return(NULL);
401 }
402 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
403 }
404
405 #define gen_nb_filepath 8
406
407 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
408     if (no == 0) return("missing.xml");
409     if (no == 1) return("<foo/>");
410     if (no == 2) return("test/ent2");
411     if (no == 3) return("test/valid/REC-xml-19980210.xml");
412     if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
413     if (no == 5) return(REMOTE1GOOD);
414     if (no == 6) return(REMOTE1BAD);
415     return(NULL);
416 }
417 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
418 }
419
420 #define gen_nb_eaten_name 2
421
422 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
423     if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
424     return(NULL);
425 }
426 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
427 }
428
429 #define gen_nb_fileoutput 6
430
431 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
432     if (no == 0) return("/missing.xml");
433     if (no == 1) return("<foo/>");
434     if (no == 2) return(REMOTE2GOOD);
435     if (no == 3) return(REMOTE1GOOD);
436     if (no == 4) return(REMOTE1BAD);
437     return(NULL);
438 }
439 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
440 }
441
442 #define gen_nb_xmlParserCtxtPtr 3
443 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
444     if (no == 0) return(xmlNewParserCtxt());
445     if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
446     return(NULL);
447 }
448 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
449     if (val != NULL)
450         xmlFreeParserCtxt(val);
451 }
452
453 #define gen_nb_xmlSAXHandlerPtr 2
454 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
455 #ifdef LIBXML_SAX1_ENABLED
456     if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
457 #endif
458     return(NULL);
459 }
460 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
461 }
462
463 #define gen_nb_xmlValidCtxtPtr 2
464 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
465 #ifdef LIBXML_VALID_ENABLED
466     if (no == 0) return(xmlNewValidCtxt());
467 #endif
468     return(NULL);
469 }
470 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
471 #ifdef LIBXML_VALID_ENABLED
472     if (val != NULL)
473         xmlFreeValidCtxt(val);
474 #endif
475 }
476
477 #define gen_nb_xmlParserInputBufferPtr 8
478
479 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
480     if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
481     if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
482     if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
483     if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
484     if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
485     if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
486     if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
487     return(NULL);
488 }
489 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
490     xmlFreeParserInputBuffer(val);
491 }
492
493 #define gen_nb_xmlDocPtr 4
494 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
495     if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
496     if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
497     if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
498     return(NULL);
499 }
500 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
501     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
502         xmlFreeDoc(val);
503 }
504
505 #define gen_nb_xmlAttrPtr 2
506 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
507     if (no == 0) return(get_api_attr());
508     return(NULL);
509 }
510 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
511     if (no == 0) free_api_doc();
512 }
513
514 #define gen_nb_xmlDictPtr 2
515 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
516     if (no == 0) return(xmlDictCreate());
517     return(NULL);
518 }
519 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
520     if (val != NULL)
521         xmlDictFree(val);
522 }
523
524 #define gen_nb_xmlNodePtr 3
525 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
526     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
527     if (no == 1) return(get_api_root());
528     return(NULL);
529 /*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
530 }
531 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
532     if (no == 1) {
533         free_api_doc();
534     } else if (val != NULL) {
535         xmlUnlinkNode(val);
536         xmlFreeNode(val);
537     }
538 }
539
540 #define gen_nb_xmlDtdPtr 3
541 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
542     if (no == 0)
543         return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
544     if (no == 1) return(get_api_dtd());
545     return(NULL);
546 }
547 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
548     if (no == 1) free_api_doc();
549     else if (val != NULL) {
550         xmlUnlinkNode((xmlNodePtr) val);
551         xmlFreeNode((xmlNodePtr) val);
552     }
553 }
554
555 #define gen_nb_xmlNsPtr 2
556 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
557     if (no == 0) return(get_api_ns());
558     return(NULL);
559 }
560 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
561     if (no == 0) free_api_doc();
562 }
563
564 #define gen_nb_xmlNodePtr_in 3
565 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
566     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
567     if (no == 0) return(xmlNewText(BAD_CAST "text"));
568     return(NULL);
569 }
570 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
571 }
572
573 #ifdef LIBXML_WRITER_ENABLED
574 #define gen_nb_xmlTextWriterPtr 2
575 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
576     if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
577     return(NULL);
578 }
579 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
580     if (val != NULL) xmlFreeTextWriter(val);
581 }
582 #endif
583
584 #ifdef LIBXML_READER_ENABLED
585 #define gen_nb_xmlTextReaderPtr 4
586 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
587     if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
588     if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
589     if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
590     return(NULL);
591 }
592 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
593     if (val != NULL) xmlFreeTextReader(val);
594 }
595 #endif
596
597 #define gen_nb_xmlBufferPtr 3
598 static const xmlChar *static_buf_content = (xmlChar *)"a static buffer";
599 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
600     if (no == 0) return(xmlBufferCreate());
601     if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
602     return(NULL);
603 }
604 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
605     if (val != NULL) {
606         xmlBufferFree(val);
607     }
608 }
609
610 #define gen_nb_xmlListPtr 2
611 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
612     if (no == 0) return(xmlListCreate(NULL, NULL));
613     return(NULL);
614 }
615 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
616     if (val != NULL) {
617         xmlListDelete(val);
618     }
619 }
620
621 #define gen_nb_xmlHashTablePtr 2
622 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
623     if (no == 0) return(xmlHashCreate(10));
624     return(NULL);
625 }
626 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
627     if (val != NULL) {
628         xmlHashFree(val, NULL);
629     }
630 }
631
632 #include <libxml/xpathInternals.h>
633
634 #ifdef LIBXML_XPATH_ENABLED
635 #define gen_nb_xmlXPathObjectPtr 5
636 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
637     if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
638     if (no == 1) return(xmlXPathNewFloat(1.1));
639     if (no == 2) return(xmlXPathNewBoolean(1));
640     if (no == 3) return(xmlXPathNewNodeSet(NULL));
641     return(NULL);
642 }
643 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
644     if (val != NULL) {
645         xmlXPathFreeObject(val);
646     }
647 }
648 #endif
649
650 #ifdef LIBXML_OUTPUT_ENABLED
651 #define gen_nb_xmlOutputBufferPtr 2
652 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
653     if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
654     return(NULL);
655 }
656 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
657     if (val != NULL) {
658         xmlOutputBufferClose(val);
659     }
660 }
661 #endif
662
663 #ifdef LIBXML_FTP_ENABLED
664 #define gen_nb_xmlNanoFTPCtxtPtr 4
665 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
666     if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
667     if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
668     if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
669     return(NULL);
670 }
671 static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
672     if (val != NULL) {
673         xmlNanoFTPFreeCtxt(val);
674     }
675 }
676 #endif
677
678 #ifdef LIBXML_HTTP_ENABLED
679 #define gen_nb_xmlNanoHTTPCtxtPtr 1
680 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
681     if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
682     if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
683     if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
684     return(NULL);
685 }
686 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
687     if (val != NULL) {
688         xmlNanoHTTPClose(val);
689     }
690 }
691 #endif
692
693 #define gen_nb_xmlCharEncoding 4
694 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
695     if (no == 0) return(XML_CHAR_ENCODING_UTF8);
696     if (no == 1) return(XML_CHAR_ENCODING_NONE);
697     if (no == 2) return(XML_CHAR_ENCODING_8859_1);
698     return(XML_CHAR_ENCODING_ERROR);
699 }
700 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
701 }
702
703 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
704
705 #define gen_nb_xmlExpCtxtPtr 1
706 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
707     return(NULL);
708 }
709 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
710 }
711
712 #define gen_nb_xmlExpNodePtr 1
713 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
714     return(NULL);
715 }
716 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
717 }
718
719 #endif
720
721 #if defined(LIBXML_SCHEMAS_ENABLED)
722 #define gen_nb_xmlSchemaPtr 1
723 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
724     return(NULL);
725 }
726 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
727 }
728
729 #define gen_nb_xmlSchemaValidCtxtPtr 1
730 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
731     return(NULL);
732 }
733 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
734 }
735
736 #endif /* LIBXML_SCHEMAS_ENABLED */
737
738 #define gen_nb_xmlHashDeallocator 2
739 static void
740 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
741 }
742
743 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
744     if (no == 0) return(test_xmlHashDeallocator);
745     return(NULL);
746 }
747 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
748 }
749
750
751 static void desret_int(int val ATTRIBUTE_UNUSED) {
752 }
753 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
754 }
755 static void desret_long(long val ATTRIBUTE_UNUSED) {
756 }
757 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
758 }
759 static void desret_double(double val ATTRIBUTE_UNUSED) {
760 }
761 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
762 }
763 #if 0
764 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
765 }
766 #endif
767 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
768 }
769 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
770 }
771 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
772 }
773 static void desret_xmlChar_ptr(xmlChar *val) {
774     if (val != NULL)
775         xmlFree(val);
776 }
777 static void desret_xmlDocPtr(xmlDocPtr val) {
778     if (val != api_doc)
779         xmlFreeDoc(val);
780 }
781 static void desret_xmlDictPtr(xmlDictPtr val) {
782     xmlDictFree(val);
783 }
784 #ifdef LIBXML_OUTPUT_ENABLED
785 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
786     xmlOutputBufferClose(val);
787 }
788 #endif
789 #ifdef LIBXML_READER_ENABLED
790 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
791     xmlFreeTextReader(val);
792 }
793 #endif
794 static void desret_xmlNodePtr(xmlNodePtr val) {
795     if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
796         xmlUnlinkNode(val);
797         xmlFreeNode(val);
798     }
799 }
800 static void desret_xmlAttrPtr(xmlAttrPtr val) {
801     if (val != NULL) {
802         xmlUnlinkNode((xmlNodePtr) val);
803         xmlFreeNode((xmlNodePtr) val);
804     }
805 }
806 static void desret_xmlEntityPtr(xmlEntityPtr val) {
807     if (val != NULL) {
808         xmlUnlinkNode((xmlNodePtr) val);
809         xmlFreeNode((xmlNodePtr) val);
810     }
811 }
812 static void desret_xmlElementPtr(xmlElementPtr val) {
813     if (val != NULL) {
814         xmlUnlinkNode((xmlNodePtr) val);
815     }
816 }
817 static void desret_xmlAttributePtr(xmlAttributePtr val) {
818     if (val != NULL) {
819         xmlUnlinkNode((xmlNodePtr) val);
820     }
821 }
822 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
823 }
824 static void desret_xmlDtdPtr(xmlDtdPtr val) {
825     desret_xmlNodePtr((xmlNodePtr)val);
826 }
827 #ifdef LIBXML_XPATH_ENABLED
828 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
829     xmlXPathFreeObject(val);
830 }
831 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
832     xmlXPathFreeNodeSet(val);
833 }
834 #endif
835 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
836     xmlFreeParserCtxt(val);
837 }
838 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
839     xmlFreeParserInputBuffer(val);
840 }
841 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
842     xmlFreeInputStream(val);
843 }
844 #ifdef LIBXML_WRITER_ENABLED
845 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
846     xmlFreeTextWriter(val);
847 }
848 #endif
849 static void desret_xmlBufferPtr(xmlBufferPtr val) {
850     xmlBufferFree(val);
851 }
852 #ifdef LIBXML_SCHEMAS_ENABLED
853 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
854     xmlSchemaFreeParserCtxt(val);
855 }
856 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
857 }
858 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
859     xmlRelaxNGFreeParserCtxt(val);
860 }
861 #endif
862 #ifdef LIBXML_HTML_ENABLED
863 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
864 }
865 #endif
866 #ifdef LIBXML_HTTP_ENABLED
867 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
868     xmlNanoHTTPClose(val);
869 }
870 #endif
871 #ifdef LIBXML_FTP_ENABLED
872 static void desret_xmlNanoFTPCtxtPtr(void *val) {
873     xmlNanoFTPClose(val);
874 }
875 #endif
876 /* cut and pasted from autogenerated to avoid troubles */
877 #define gen_nb_const_xmlChar_ptr_ptr 1
878 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
879     return(NULL);
880 }
881 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
882 }
883
884 #define gen_nb_unsigned_char_ptr 1
885 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
886     return(NULL);
887 }
888 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
889 }
890
891 #define gen_nb_const_unsigned_char_ptr 1
892 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
893     return(NULL);
894 }
895 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
896 }
897
898 #ifdef LIBXML_HTML_ENABLED
899 #define gen_nb_const_htmlNodePtr 1
900 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
901     return(NULL);
902 }
903 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
904 }
905 #endif
906
907 #ifdef LIBXML_HTML_ENABLED
908 #define gen_nb_htmlDocPtr 3
909 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
910     if (no == 0) return(htmlNewDoc(NULL, NULL));
911     if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
912     return(NULL);
913 }
914 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
915     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
916         xmlFreeDoc(val);
917 }
918 static void desret_htmlDocPtr(htmlDocPtr val) {
919     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
920         xmlFreeDoc(val);
921 }
922 #define gen_nb_htmlParserCtxtPtr 3
923 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
924     if (no == 0) return(xmlNewParserCtxt());
925     if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
926     return(NULL);
927 }
928 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
929     if (val != NULL)
930         htmlFreeParserCtxt(val);
931 }
932 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
933     if (val != NULL)
934         htmlFreeParserCtxt(val);
935 }
936 #endif
937
938 #ifdef LIBXML_XPATH_ENABLED
939 #define gen_nb_xmlNodeSetPtr 1
940 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
941     return(NULL);
942 }
943 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
944 }
945 #endif
946
947 #ifdef LIBXML_DEBUG_ENABLED
948 #ifdef LIBXML_XPATH_ENABLED
949 #define gen_nb_xmlShellCtxtPtr 1
950 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
951     return(NULL);
952 }
953 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
954 }
955 #endif
956 #endif
957
958 #ifdef LIBXML_PATTERN_ENABLED
959 #define gen_nb_xmlPatternPtr 1
960 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
961     return(NULL);
962 }
963 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
964 }
965 #endif
966
967 #define gen_nb_xmlElementContentPtr 1
968 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
969     return(NULL);
970 }
971 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
972     if (val != NULL)
973         xmlFreeElementContent(val);
974 }
975 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
976     if (val != NULL)
977         xmlFreeElementContent(val);
978 }
979
980 #define gen_nb_xmlParserNodeInfoSeqPtr 1
981 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
982     return(NULL);
983 }
984 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
985 }
986
987 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
988 }
989
990 #define gen_nb_void_ptr_ptr 1
991 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
992     return(NULL);
993 }
994 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
995 }
996
997 /************************************************************************
998  *                                                                      *
999  *   WARNING: end of the manually maintained part of the test code      *
1000  *            do not remove or alter the CUT HERE line                  *
1001  *                                                                      *
1002  ************************************************************************/
1003
1004 /* CUT HERE: everything below that line is generated */
1005 #ifdef LIBXML_HTML_ENABLED
1006 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1007 }
1008
1009 #endif
1010
1011 #define gen_nb_xmlAttributeDefault 4
1012 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1013     if (no == 1) return(XML_ATTRIBUTE_FIXED);
1014     if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1015     if (no == 3) return(XML_ATTRIBUTE_NONE);
1016     if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1017     return(0);
1018 }
1019
1020 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1021 }
1022
1023 #define gen_nb_xmlAttributeType 4
1024 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1025     if (no == 1) return(XML_ATTRIBUTE_CDATA);
1026     if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1027     if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1028     if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1029     return(0);
1030 }
1031
1032 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1033 }
1034
1035 #define gen_nb_xmlBufferAllocationScheme 4
1036 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1037     if (no == 1) return(XML_BUFFER_ALLOC_BOUNDED);
1038     if (no == 2) return(XML_BUFFER_ALLOC_DOUBLEIT);
1039     if (no == 3) return(XML_BUFFER_ALLOC_EXACT);
1040     if (no == 4) return(XML_BUFFER_ALLOC_HYBRID);
1041     return(0);
1042 }
1043
1044 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1045 }
1046
1047 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1048 }
1049
1050 #ifdef LIBXML_CATALOG_ENABLED
1051 #define gen_nb_xmlCatalogAllow 4
1052 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1053     if (no == 1) return(XML_CATA_ALLOW_ALL);
1054     if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1055     if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1056     if (no == 4) return(XML_CATA_ALLOW_NONE);
1057     return(0);
1058 }
1059
1060 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1061 }
1062
1063 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1064 }
1065
1066 #endif
1067
1068 #ifdef LIBXML_CATALOG_ENABLED
1069 #define gen_nb_xmlCatalogPrefer 3
1070 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1071     if (no == 1) return(XML_CATA_PREFER_NONE);
1072     if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1073     if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1074     return(0);
1075 }
1076
1077 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1078 }
1079
1080 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1081 }
1082
1083 #endif
1084
1085 #define gen_nb_xmlElementContentType 4
1086 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1087     if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1088     if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1089     if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1090     if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1091     return(0);
1092 }
1093
1094 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1095 }
1096
1097 #define gen_nb_xmlElementTypeVal 4
1098 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1099     if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1100     if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1101     if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1102     if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1103     return(0);
1104 }
1105
1106 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1107 }
1108
1109 #define gen_nb_xmlFeature 4
1110 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1111     if (no == 1) return(XML_WITH_AUTOMATA);
1112     if (no == 2) return(XML_WITH_C14N);
1113     if (no == 3) return(XML_WITH_CATALOG);
1114     if (no == 4) return(XML_WITH_DEBUG);
1115     return(0);
1116 }
1117
1118 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1119 }
1120
1121 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1122 }
1123
1124 #ifdef LIBXML_SCHEMAS_ENABLED
1125 #define gen_nb_xmlSchemaValType 4
1126 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1127     if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1128     if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1129     if (no == 3) return(XML_SCHEMAS_ANYURI);
1130     if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1131     return(0);
1132 }
1133
1134 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1135 }
1136
1137 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1138 }
1139
1140 #endif
1141
1142 #ifdef LIBXML_SCHEMAS_ENABLED
1143 #define gen_nb_xmlSchemaWhitespaceValueType 4
1144 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1145     if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1146     if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1147     if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1148     if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1149     return(0);
1150 }
1151
1152 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1153 }
1154
1155 #endif
1156
1157 #include <libxml/HTMLparser.h>
1158 #include <libxml/HTMLtree.h>
1159 #include <libxml/SAX2.h>
1160 #include <libxml/c14n.h>
1161 #include <libxml/catalog.h>
1162 #include <libxml/chvalid.h>
1163 #include <libxml/debugXML.h>
1164 #include <libxml/dict.h>
1165 #include <libxml/encoding.h>
1166 #include <libxml/entities.h>
1167 #include <libxml/hash.h>
1168 #include <libxml/list.h>
1169 #include <libxml/nanoftp.h>
1170 #include <libxml/nanohttp.h>
1171 #include <libxml/parser.h>
1172 #include <libxml/parserInternals.h>
1173 #include <libxml/pattern.h>
1174 #include <libxml/relaxng.h>
1175 #include <libxml/schemasInternals.h>
1176 #include <libxml/schematron.h>
1177 #include <libxml/tree.h>
1178 #include <libxml/uri.h>
1179 #include <libxml/valid.h>
1180 #include <libxml/xinclude.h>
1181 #include <libxml/xmlIO.h>
1182 #include <libxml/xmlautomata.h>
1183 #include <libxml/xmlerror.h>
1184 #include <libxml/xmlmodule.h>
1185 #include <libxml/xmlreader.h>
1186 #include <libxml/xmlregexp.h>
1187 #include <libxml/xmlsave.h>
1188 #include <libxml/xmlschemas.h>
1189 #include <libxml/xmlschemastypes.h>
1190 #include <libxml/xmlstring.h>
1191 #include <libxml/xmlunicode.h>
1192 #include <libxml/xmlwriter.h>
1193 #include <libxml/xpath.h>
1194 #include <libxml/xpathInternals.h>
1195 #include <libxml/xpointer.h>
1196 static int test_HTMLparser(void);
1197 static int test_HTMLtree(void);
1198 static int test_SAX2(void);
1199 static int test_c14n(void);
1200 static int test_catalog(void);
1201 static int test_chvalid(void);
1202 static int test_debugXML(void);
1203 static int test_dict(void);
1204 static int test_encoding(void);
1205 static int test_entities(void);
1206 static int test_hash(void);
1207 static int test_list(void);
1208 static int test_nanoftp(void);
1209 static int test_nanohttp(void);
1210 static int test_parser(void);
1211 static int test_parserInternals(void);
1212 static int test_pattern(void);
1213 static int test_relaxng(void);
1214 static int test_schemasInternals(void);
1215 static int test_schematron(void);
1216 static int test_tree(void);
1217 static int test_uri(void);
1218 static int test_valid(void);
1219 static int test_xinclude(void);
1220 static int test_xmlIO(void);
1221 static int test_xmlautomata(void);
1222 static int test_xmlerror(void);
1223 static int test_xmlmodule(void);
1224 static int test_xmlreader(void);
1225 static int test_xmlregexp(void);
1226 static int test_xmlsave(void);
1227 static int test_xmlschemas(void);
1228 static int test_xmlschemastypes(void);
1229 static int test_xmlstring(void);
1230 static int test_xmlunicode(void);
1231 static int test_xmlwriter(void);
1232 static int test_xpath(void);
1233 static int test_xpathInternals(void);
1234 static int test_xpointer(void);
1235
1236 /**
1237  * testlibxml2:
1238  *
1239  * Main entry point of the tester for the full libxml2 module,
1240  * it calls all the tester entry point for each module.
1241  *
1242  * Returns the number of error found
1243  */
1244 static int
1245 testlibxml2(void)
1246 {
1247     int test_ret = 0;
1248
1249
1250     test_ret += test_HTMLparser();
1251     test_ret += test_HTMLtree();
1252     test_ret += test_SAX2();
1253     test_ret += test_c14n();
1254     test_ret += test_catalog();
1255     test_ret += test_chvalid();
1256     test_ret += test_debugXML();
1257     test_ret += test_dict();
1258     test_ret += test_encoding();
1259     test_ret += test_entities();
1260     test_ret += test_hash();
1261     test_ret += test_list();
1262     test_ret += test_nanoftp();
1263     test_ret += test_nanohttp();
1264     test_ret += test_parser();
1265     test_ret += test_parserInternals();
1266     test_ret += test_pattern();
1267     test_ret += test_relaxng();
1268     test_ret += test_schemasInternals();
1269     test_ret += test_schematron();
1270     test_ret += test_tree();
1271     test_ret += test_uri();
1272     test_ret += test_valid();
1273     test_ret += test_xinclude();
1274     test_ret += test_xmlIO();
1275     test_ret += test_xmlautomata();
1276     test_ret += test_xmlerror();
1277     test_ret += test_xmlmodule();
1278     test_ret += test_xmlreader();
1279     test_ret += test_xmlregexp();
1280     test_ret += test_xmlsave();
1281     test_ret += test_xmlschemas();
1282     test_ret += test_xmlschemastypes();
1283     test_ret += test_xmlstring();
1284     test_ret += test_xmlunicode();
1285     test_ret += test_xmlwriter();
1286     test_ret += test_xpath();
1287     test_ret += test_xpathInternals();
1288     test_ret += test_xpointer();
1289
1290     printf("Total: %d functions, %d tests, %d errors\n",
1291            function_tests, call_tests, test_ret);
1292     return(test_ret);
1293 }
1294
1295
1296 static int
1297 test_UTF8ToHtml(void) {
1298     int test_ret = 0;
1299
1300 #if defined(LIBXML_HTML_ENABLED)
1301     int mem_base;
1302     int ret_val;
1303     unsigned char * out; /* a pointer to an array of bytes to store the result */
1304     int n_out;
1305     int * outlen; /* the length of @out */
1306     int n_outlen;
1307     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1308     int n_in;
1309     int * inlen; /* the length of @in */
1310     int n_inlen;
1311
1312     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1313     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1314     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1315     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1316         mem_base = xmlMemBlocks();
1317         out = gen_unsigned_char_ptr(n_out, 0);
1318         outlen = gen_int_ptr(n_outlen, 1);
1319         in = gen_const_unsigned_char_ptr(n_in, 2);
1320         inlen = gen_int_ptr(n_inlen, 3);
1321
1322         ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1323         desret_int(ret_val);
1324         call_tests++;
1325         des_unsigned_char_ptr(n_out, out, 0);
1326         des_int_ptr(n_outlen, outlen, 1);
1327         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1328         des_int_ptr(n_inlen, inlen, 3);
1329         xmlResetLastError();
1330         if (mem_base != xmlMemBlocks()) {
1331             printf("Leak of %d blocks found in UTF8ToHtml",
1332                    xmlMemBlocks() - mem_base);
1333             test_ret++;
1334             printf(" %d", n_out);
1335             printf(" %d", n_outlen);
1336             printf(" %d", n_in);
1337             printf(" %d", n_inlen);
1338             printf("\n");
1339         }
1340     }
1341     }
1342     }
1343     }
1344     function_tests++;
1345 #endif
1346
1347     return(test_ret);
1348 }
1349
1350 #ifdef LIBXML_HTML_ENABLED
1351
1352 #define gen_nb_const_htmlElemDesc_ptr 1
1353 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1354     return(NULL);
1355 }
1356 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1357 }
1358 #endif
1359
1360
1361 static int
1362 test_htmlAttrAllowed(void) {
1363     int test_ret = 0;
1364
1365 #if defined(LIBXML_HTML_ENABLED)
1366     int mem_base;
1367     htmlStatus ret_val;
1368     htmlElemDesc * elt; /* HTML element */
1369     int n_elt;
1370     xmlChar * attr; /* HTML attribute */
1371     int n_attr;
1372     int legacy; /* whether to allow deprecated attributes */
1373     int n_legacy;
1374
1375     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1376     for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1377     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1378         mem_base = xmlMemBlocks();
1379         elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1380         attr = gen_const_xmlChar_ptr(n_attr, 1);
1381         legacy = gen_int(n_legacy, 2);
1382
1383         ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1384         desret_htmlStatus(ret_val);
1385         call_tests++;
1386         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1387         des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1388         des_int(n_legacy, legacy, 2);
1389         xmlResetLastError();
1390         if (mem_base != xmlMemBlocks()) {
1391             printf("Leak of %d blocks found in htmlAttrAllowed",
1392                    xmlMemBlocks() - mem_base);
1393             test_ret++;
1394             printf(" %d", n_elt);
1395             printf(" %d", n_attr);
1396             printf(" %d", n_legacy);
1397             printf("\n");
1398         }
1399     }
1400     }
1401     }
1402     function_tests++;
1403 #endif
1404
1405     return(test_ret);
1406 }
1407
1408 #ifdef LIBXML_HTML_ENABLED
1409
1410 #define gen_nb_htmlNodePtr 1
1411 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1412     return(NULL);
1413 }
1414 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1415 }
1416 #endif
1417
1418
1419 static int
1420 test_htmlAutoCloseTag(void) {
1421     int test_ret = 0;
1422
1423 #if defined(LIBXML_HTML_ENABLED)
1424     int mem_base;
1425     int ret_val;
1426     htmlDocPtr doc; /* the HTML document */
1427     int n_doc;
1428     xmlChar * name; /* The tag name */
1429     int n_name;
1430     htmlNodePtr elem; /* the HTML element */
1431     int n_elem;
1432
1433     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1434     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1435     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1436         mem_base = xmlMemBlocks();
1437         doc = gen_htmlDocPtr(n_doc, 0);
1438         name = gen_const_xmlChar_ptr(n_name, 1);
1439         elem = gen_htmlNodePtr(n_elem, 2);
1440
1441         ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1442         desret_int(ret_val);
1443         call_tests++;
1444         des_htmlDocPtr(n_doc, doc, 0);
1445         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1446         des_htmlNodePtr(n_elem, elem, 2);
1447         xmlResetLastError();
1448         if (mem_base != xmlMemBlocks()) {
1449             printf("Leak of %d blocks found in htmlAutoCloseTag",
1450                    xmlMemBlocks() - mem_base);
1451             test_ret++;
1452             printf(" %d", n_doc);
1453             printf(" %d", n_name);
1454             printf(" %d", n_elem);
1455             printf("\n");
1456         }
1457     }
1458     }
1459     }
1460     function_tests++;
1461 #endif
1462
1463     return(test_ret);
1464 }
1465
1466
1467 static int
1468 test_htmlCreateMemoryParserCtxt(void) {
1469     int test_ret = 0;
1470
1471 #if defined(LIBXML_HTML_ENABLED)
1472     int mem_base;
1473     htmlParserCtxtPtr ret_val;
1474     char * buffer; /* a pointer to a char array */
1475     int n_buffer;
1476     int size; /* the size of the array */
1477     int n_size;
1478
1479     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1480     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1481         mem_base = xmlMemBlocks();
1482         buffer = gen_const_char_ptr(n_buffer, 0);
1483         size = gen_int(n_size, 1);
1484
1485         ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1486         desret_htmlParserCtxtPtr(ret_val);
1487         call_tests++;
1488         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1489         des_int(n_size, size, 1);
1490         xmlResetLastError();
1491         if (mem_base != xmlMemBlocks()) {
1492             printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1493                    xmlMemBlocks() - mem_base);
1494             test_ret++;
1495             printf(" %d", n_buffer);
1496             printf(" %d", n_size);
1497             printf("\n");
1498         }
1499     }
1500     }
1501     function_tests++;
1502 #endif
1503
1504     return(test_ret);
1505 }
1506
1507 #ifdef LIBXML_HTML_ENABLED
1508
1509 #define gen_nb_htmlSAXHandlerPtr 1
1510 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1511     return(NULL);
1512 }
1513 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1514 }
1515 #endif
1516
1517
1518 static int
1519 test_htmlCreatePushParserCtxt(void) {
1520     int test_ret = 0;
1521
1522 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1523     int mem_base;
1524     htmlParserCtxtPtr ret_val;
1525     htmlSAXHandlerPtr sax; /* a SAX handler */
1526     int n_sax;
1527     void * user_data; /* The user data returned on SAX callbacks */
1528     int n_user_data;
1529     char * chunk; /* a pointer to an array of chars */
1530     int n_chunk;
1531     int size; /* number of chars in the array */
1532     int n_size;
1533     const char * filename; /* an optional file name or URI */
1534     int n_filename;
1535     xmlCharEncoding enc; /* an optional encoding */
1536     int n_enc;
1537
1538     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1539     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1540     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1541     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1542     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1543     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1544         mem_base = xmlMemBlocks();
1545         sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1546         user_data = gen_userdata(n_user_data, 1);
1547         chunk = gen_const_char_ptr(n_chunk, 2);
1548         size = gen_int(n_size, 3);
1549         filename = gen_fileoutput(n_filename, 4);
1550         enc = gen_xmlCharEncoding(n_enc, 5);
1551
1552         ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1553         desret_htmlParserCtxtPtr(ret_val);
1554         call_tests++;
1555         des_htmlSAXHandlerPtr(n_sax, sax, 0);
1556         des_userdata(n_user_data, user_data, 1);
1557         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1558         des_int(n_size, size, 3);
1559         des_fileoutput(n_filename, filename, 4);
1560         des_xmlCharEncoding(n_enc, enc, 5);
1561         xmlResetLastError();
1562         if (mem_base != xmlMemBlocks()) {
1563             printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1564                    xmlMemBlocks() - mem_base);
1565             test_ret++;
1566             printf(" %d", n_sax);
1567             printf(" %d", n_user_data);
1568             printf(" %d", n_chunk);
1569             printf(" %d", n_size);
1570             printf(" %d", n_filename);
1571             printf(" %d", n_enc);
1572             printf("\n");
1573         }
1574     }
1575     }
1576     }
1577     }
1578     }
1579     }
1580     function_tests++;
1581 #endif
1582
1583     return(test_ret);
1584 }
1585
1586
1587 static int
1588 test_htmlCtxtReadDoc(void) {
1589     int test_ret = 0;
1590
1591 #if defined(LIBXML_HTML_ENABLED)
1592     int mem_base;
1593     htmlDocPtr ret_val;
1594     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1595     int n_ctxt;
1596     xmlChar * cur; /* a pointer to a zero terminated string */
1597     int n_cur;
1598     const char * URL; /* the base URL to use for the document */
1599     int n_URL;
1600     char * encoding; /* the document encoding, or NULL */
1601     int n_encoding;
1602     int options; /* a combination of htmlParserOption(s) */
1603     int n_options;
1604
1605     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1606     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1607     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1608     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1609     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1610         mem_base = xmlMemBlocks();
1611         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1612         cur = gen_const_xmlChar_ptr(n_cur, 1);
1613         URL = gen_filepath(n_URL, 2);
1614         encoding = gen_const_char_ptr(n_encoding, 3);
1615         options = gen_int(n_options, 4);
1616
1617         ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1618         desret_htmlDocPtr(ret_val);
1619         call_tests++;
1620         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1621         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1622         des_filepath(n_URL, URL, 2);
1623         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1624         des_int(n_options, options, 4);
1625         xmlResetLastError();
1626         if (mem_base != xmlMemBlocks()) {
1627             printf("Leak of %d blocks found in htmlCtxtReadDoc",
1628                    xmlMemBlocks() - mem_base);
1629             test_ret++;
1630             printf(" %d", n_ctxt);
1631             printf(" %d", n_cur);
1632             printf(" %d", n_URL);
1633             printf(" %d", n_encoding);
1634             printf(" %d", n_options);
1635             printf("\n");
1636         }
1637     }
1638     }
1639     }
1640     }
1641     }
1642     function_tests++;
1643 #endif
1644
1645     return(test_ret);
1646 }
1647
1648
1649 static int
1650 test_htmlCtxtReadFile(void) {
1651     int test_ret = 0;
1652
1653 #if defined(LIBXML_HTML_ENABLED)
1654     htmlDocPtr ret_val;
1655     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1656     int n_ctxt;
1657     const char * filename; /* a file or URL */
1658     int n_filename;
1659     char * encoding; /* the document encoding, or NULL */
1660     int n_encoding;
1661     int options; /* a combination of htmlParserOption(s) */
1662     int n_options;
1663
1664     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1665     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1666     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1667     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1668         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1669         filename = gen_filepath(n_filename, 1);
1670         encoding = gen_const_char_ptr(n_encoding, 2);
1671         options = gen_int(n_options, 3);
1672
1673         ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1674         desret_htmlDocPtr(ret_val);
1675         call_tests++;
1676         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1677         des_filepath(n_filename, filename, 1);
1678         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1679         des_int(n_options, options, 3);
1680         xmlResetLastError();
1681     }
1682     }
1683     }
1684     }
1685     function_tests++;
1686 #endif
1687
1688     return(test_ret);
1689 }
1690
1691
1692 static int
1693 test_htmlCtxtReadMemory(void) {
1694     int test_ret = 0;
1695
1696 #if defined(LIBXML_HTML_ENABLED)
1697     int mem_base;
1698     htmlDocPtr ret_val;
1699     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1700     int n_ctxt;
1701     char * buffer; /* a pointer to a char array */
1702     int n_buffer;
1703     int size; /* the size of the array */
1704     int n_size;
1705     const char * URL; /* the base URL to use for the document */
1706     int n_URL;
1707     char * encoding; /* the document encoding, or NULL */
1708     int n_encoding;
1709     int options; /* a combination of htmlParserOption(s) */
1710     int n_options;
1711
1712     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1713     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1714     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1715     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1716     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1717     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1718         mem_base = xmlMemBlocks();
1719         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1720         buffer = gen_const_char_ptr(n_buffer, 1);
1721         size = gen_int(n_size, 2);
1722         URL = gen_filepath(n_URL, 3);
1723         encoding = gen_const_char_ptr(n_encoding, 4);
1724         options = gen_int(n_options, 5);
1725
1726         ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1727         desret_htmlDocPtr(ret_val);
1728         call_tests++;
1729         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1730         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1731         des_int(n_size, size, 2);
1732         des_filepath(n_URL, URL, 3);
1733         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1734         des_int(n_options, options, 5);
1735         xmlResetLastError();
1736         if (mem_base != xmlMemBlocks()) {
1737             printf("Leak of %d blocks found in htmlCtxtReadMemory",
1738                    xmlMemBlocks() - mem_base);
1739             test_ret++;
1740             printf(" %d", n_ctxt);
1741             printf(" %d", n_buffer);
1742             printf(" %d", n_size);
1743             printf(" %d", n_URL);
1744             printf(" %d", n_encoding);
1745             printf(" %d", n_options);
1746             printf("\n");
1747         }
1748     }
1749     }
1750     }
1751     }
1752     }
1753     }
1754     function_tests++;
1755 #endif
1756
1757     return(test_ret);
1758 }
1759
1760
1761 static int
1762 test_htmlCtxtReset(void) {
1763     int test_ret = 0;
1764
1765 #if defined(LIBXML_HTML_ENABLED)
1766     int mem_base;
1767     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1768     int n_ctxt;
1769
1770     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1771         mem_base = xmlMemBlocks();
1772         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1773
1774         htmlCtxtReset(ctxt);
1775         call_tests++;
1776         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1777         xmlResetLastError();
1778         if (mem_base != xmlMemBlocks()) {
1779             printf("Leak of %d blocks found in htmlCtxtReset",
1780                    xmlMemBlocks() - mem_base);
1781             test_ret++;
1782             printf(" %d", n_ctxt);
1783             printf("\n");
1784         }
1785     }
1786     function_tests++;
1787 #endif
1788
1789     return(test_ret);
1790 }
1791
1792
1793 static int
1794 test_htmlCtxtUseOptions(void) {
1795     int test_ret = 0;
1796
1797 #if defined(LIBXML_HTML_ENABLED)
1798     int mem_base;
1799     int ret_val;
1800     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1801     int n_ctxt;
1802     int options; /* a combination of htmlParserOption(s) */
1803     int n_options;
1804
1805     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1806     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1807         mem_base = xmlMemBlocks();
1808         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1809         options = gen_int(n_options, 1);
1810
1811         ret_val = htmlCtxtUseOptions(ctxt, options);
1812         desret_int(ret_val);
1813         call_tests++;
1814         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1815         des_int(n_options, options, 1);
1816         xmlResetLastError();
1817         if (mem_base != xmlMemBlocks()) {
1818             printf("Leak of %d blocks found in htmlCtxtUseOptions",
1819                    xmlMemBlocks() - mem_base);
1820             test_ret++;
1821             printf(" %d", n_ctxt);
1822             printf(" %d", n_options);
1823             printf("\n");
1824         }
1825     }
1826     }
1827     function_tests++;
1828 #endif
1829
1830     return(test_ret);
1831 }
1832
1833
1834 static int
1835 test_htmlElementAllowedHere(void) {
1836     int test_ret = 0;
1837
1838 #if defined(LIBXML_HTML_ENABLED)
1839     int mem_base;
1840     int ret_val;
1841     htmlElemDesc * parent; /* HTML parent element */
1842     int n_parent;
1843     xmlChar * elt; /* HTML element */
1844     int n_elt;
1845
1846     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1847     for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1848         mem_base = xmlMemBlocks();
1849         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1850         elt = gen_const_xmlChar_ptr(n_elt, 1);
1851
1852         ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1853         desret_int(ret_val);
1854         call_tests++;
1855         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1856         des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1857         xmlResetLastError();
1858         if (mem_base != xmlMemBlocks()) {
1859             printf("Leak of %d blocks found in htmlElementAllowedHere",
1860                    xmlMemBlocks() - mem_base);
1861             test_ret++;
1862             printf(" %d", n_parent);
1863             printf(" %d", n_elt);
1864             printf("\n");
1865         }
1866     }
1867     }
1868     function_tests++;
1869 #endif
1870
1871     return(test_ret);
1872 }
1873
1874
1875 static int
1876 test_htmlElementStatusHere(void) {
1877     int test_ret = 0;
1878
1879 #if defined(LIBXML_HTML_ENABLED)
1880     int mem_base;
1881     htmlStatus ret_val;
1882     htmlElemDesc * parent; /* HTML parent element */
1883     int n_parent;
1884     htmlElemDesc * elt; /* HTML element */
1885     int n_elt;
1886
1887     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1888     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1889         mem_base = xmlMemBlocks();
1890         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1891         elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1892
1893         ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1894         desret_htmlStatus(ret_val);
1895         call_tests++;
1896         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1897         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1898         xmlResetLastError();
1899         if (mem_base != xmlMemBlocks()) {
1900             printf("Leak of %d blocks found in htmlElementStatusHere",
1901                    xmlMemBlocks() - mem_base);
1902             test_ret++;
1903             printf(" %d", n_parent);
1904             printf(" %d", n_elt);
1905             printf("\n");
1906         }
1907     }
1908     }
1909     function_tests++;
1910 #endif
1911
1912     return(test_ret);
1913 }
1914
1915
1916 static int
1917 test_htmlEncodeEntities(void) {
1918     int test_ret = 0;
1919
1920 #if defined(LIBXML_HTML_ENABLED)
1921     int mem_base;
1922     int ret_val;
1923     unsigned char * out; /* a pointer to an array of bytes to store the result */
1924     int n_out;
1925     int * outlen; /* the length of @out */
1926     int n_outlen;
1927     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1928     int n_in;
1929     int * inlen; /* the length of @in */
1930     int n_inlen;
1931     int quoteChar; /* the quote character to escape (' or ") or zero. */
1932     int n_quoteChar;
1933
1934     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1935     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1936     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1937     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1938     for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1939         mem_base = xmlMemBlocks();
1940         out = gen_unsigned_char_ptr(n_out, 0);
1941         outlen = gen_int_ptr(n_outlen, 1);
1942         in = gen_const_unsigned_char_ptr(n_in, 2);
1943         inlen = gen_int_ptr(n_inlen, 3);
1944         quoteChar = gen_int(n_quoteChar, 4);
1945
1946         ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1947         desret_int(ret_val);
1948         call_tests++;
1949         des_unsigned_char_ptr(n_out, out, 0);
1950         des_int_ptr(n_outlen, outlen, 1);
1951         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1952         des_int_ptr(n_inlen, inlen, 3);
1953         des_int(n_quoteChar, quoteChar, 4);
1954         xmlResetLastError();
1955         if (mem_base != xmlMemBlocks()) {
1956             printf("Leak of %d blocks found in htmlEncodeEntities",
1957                    xmlMemBlocks() - mem_base);
1958             test_ret++;
1959             printf(" %d", n_out);
1960             printf(" %d", n_outlen);
1961             printf(" %d", n_in);
1962             printf(" %d", n_inlen);
1963             printf(" %d", n_quoteChar);
1964             printf("\n");
1965         }
1966     }
1967     }
1968     }
1969     }
1970     }
1971     function_tests++;
1972 #endif
1973
1974     return(test_ret);
1975 }
1976
1977
1978 static int
1979 test_htmlEntityLookup(void) {
1980     int test_ret = 0;
1981
1982 #if defined(LIBXML_HTML_ENABLED)
1983     int mem_base;
1984     const htmlEntityDesc * ret_val;
1985     xmlChar * name; /* the entity name */
1986     int n_name;
1987
1988     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1989         mem_base = xmlMemBlocks();
1990         name = gen_const_xmlChar_ptr(n_name, 0);
1991
1992         ret_val = htmlEntityLookup((const xmlChar *)name);
1993         desret_const_htmlEntityDesc_ptr(ret_val);
1994         call_tests++;
1995         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1996         xmlResetLastError();
1997         if (mem_base != xmlMemBlocks()) {
1998             printf("Leak of %d blocks found in htmlEntityLookup",
1999                    xmlMemBlocks() - mem_base);
2000             test_ret++;
2001             printf(" %d", n_name);
2002             printf("\n");
2003         }
2004     }
2005     function_tests++;
2006 #endif
2007
2008     return(test_ret);
2009 }
2010
2011
2012 static int
2013 test_htmlEntityValueLookup(void) {
2014     int test_ret = 0;
2015
2016 #if defined(LIBXML_HTML_ENABLED)
2017     int mem_base;
2018     const htmlEntityDesc * ret_val;
2019     unsigned int value; /* the entity's unicode value */
2020     int n_value;
2021
2022     for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2023         mem_base = xmlMemBlocks();
2024         value = gen_unsigned_int(n_value, 0);
2025
2026         ret_val = htmlEntityValueLookup(value);
2027         desret_const_htmlEntityDesc_ptr(ret_val);
2028         call_tests++;
2029         des_unsigned_int(n_value, value, 0);
2030         xmlResetLastError();
2031         if (mem_base != xmlMemBlocks()) {
2032             printf("Leak of %d blocks found in htmlEntityValueLookup",
2033                    xmlMemBlocks() - mem_base);
2034             test_ret++;
2035             printf(" %d", n_value);
2036             printf("\n");
2037         }
2038     }
2039     function_tests++;
2040 #endif
2041
2042     return(test_ret);
2043 }
2044
2045
2046 static int
2047 test_htmlHandleOmittedElem(void) {
2048     int test_ret = 0;
2049
2050 #if defined(LIBXML_HTML_ENABLED)
2051     int mem_base;
2052     int ret_val;
2053     int val; /* int 0 or 1 */
2054     int n_val;
2055
2056     for (n_val = 0;n_val < gen_nb_int;n_val++) {
2057         mem_base = xmlMemBlocks();
2058         val = gen_int(n_val, 0);
2059
2060         ret_val = htmlHandleOmittedElem(val);
2061         desret_int(ret_val);
2062         call_tests++;
2063         des_int(n_val, val, 0);
2064         xmlResetLastError();
2065         if (mem_base != xmlMemBlocks()) {
2066             printf("Leak of %d blocks found in htmlHandleOmittedElem",
2067                    xmlMemBlocks() - mem_base);
2068             test_ret++;
2069             printf(" %d", n_val);
2070             printf("\n");
2071         }
2072     }
2073     function_tests++;
2074 #endif
2075
2076     return(test_ret);
2077 }
2078
2079
2080 static int
2081 test_htmlIsAutoClosed(void) {
2082     int test_ret = 0;
2083
2084 #if defined(LIBXML_HTML_ENABLED)
2085     int mem_base;
2086     int ret_val;
2087     htmlDocPtr doc; /* the HTML document */
2088     int n_doc;
2089     htmlNodePtr elem; /* the HTML element */
2090     int n_elem;
2091
2092     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2093     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2094         mem_base = xmlMemBlocks();
2095         doc = gen_htmlDocPtr(n_doc, 0);
2096         elem = gen_htmlNodePtr(n_elem, 1);
2097
2098         ret_val = htmlIsAutoClosed(doc, elem);
2099         desret_int(ret_val);
2100         call_tests++;
2101         des_htmlDocPtr(n_doc, doc, 0);
2102         des_htmlNodePtr(n_elem, elem, 1);
2103         xmlResetLastError();
2104         if (mem_base != xmlMemBlocks()) {
2105             printf("Leak of %d blocks found in htmlIsAutoClosed",
2106                    xmlMemBlocks() - mem_base);
2107             test_ret++;
2108             printf(" %d", n_doc);
2109             printf(" %d", n_elem);
2110             printf("\n");
2111         }
2112     }
2113     }
2114     function_tests++;
2115 #endif
2116
2117     return(test_ret);
2118 }
2119
2120
2121 static int
2122 test_htmlIsScriptAttribute(void) {
2123     int test_ret = 0;
2124
2125 #if defined(LIBXML_HTML_ENABLED)
2126     int mem_base;
2127     int ret_val;
2128     xmlChar * name; /* an attribute name */
2129     int n_name;
2130
2131     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2132         mem_base = xmlMemBlocks();
2133         name = gen_const_xmlChar_ptr(n_name, 0);
2134
2135         ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2136         desret_int(ret_val);
2137         call_tests++;
2138         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2139         xmlResetLastError();
2140         if (mem_base != xmlMemBlocks()) {
2141             printf("Leak of %d blocks found in htmlIsScriptAttribute",
2142                    xmlMemBlocks() - mem_base);
2143             test_ret++;
2144             printf(" %d", n_name);
2145             printf("\n");
2146         }
2147     }
2148     function_tests++;
2149 #endif
2150
2151     return(test_ret);
2152 }
2153
2154
2155 static int
2156 test_htmlNewParserCtxt(void) {
2157     int test_ret = 0;
2158
2159 #if defined(LIBXML_HTML_ENABLED)
2160     int mem_base;
2161     htmlParserCtxtPtr ret_val;
2162
2163         mem_base = xmlMemBlocks();
2164
2165         ret_val = htmlNewParserCtxt();
2166         desret_htmlParserCtxtPtr(ret_val);
2167         call_tests++;
2168         xmlResetLastError();
2169         if (mem_base != xmlMemBlocks()) {
2170             printf("Leak of %d blocks found in htmlNewParserCtxt",
2171                    xmlMemBlocks() - mem_base);
2172             test_ret++;
2173             printf("\n");
2174         }
2175     function_tests++;
2176 #endif
2177
2178     return(test_ret);
2179 }
2180
2181
2182 static int
2183 test_htmlNodeStatus(void) {
2184     int test_ret = 0;
2185
2186 #if defined(LIBXML_HTML_ENABLED)
2187     int mem_base;
2188     htmlStatus ret_val;
2189     htmlNodePtr node; /* an htmlNodePtr in a tree */
2190     int n_node;
2191     int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2192     int n_legacy;
2193
2194     for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2195     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2196         mem_base = xmlMemBlocks();
2197         node = gen_const_htmlNodePtr(n_node, 0);
2198         legacy = gen_int(n_legacy, 1);
2199
2200         ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2201         desret_htmlStatus(ret_val);
2202         call_tests++;
2203         des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2204         des_int(n_legacy, legacy, 1);
2205         xmlResetLastError();
2206         if (mem_base != xmlMemBlocks()) {
2207             printf("Leak of %d blocks found in htmlNodeStatus",
2208                    xmlMemBlocks() - mem_base);
2209             test_ret++;
2210             printf(" %d", n_node);
2211             printf(" %d", n_legacy);
2212             printf("\n");
2213         }
2214     }
2215     }
2216     function_tests++;
2217 #endif
2218
2219     return(test_ret);
2220 }
2221
2222
2223 static int
2224 test_htmlParseCharRef(void) {
2225     int test_ret = 0;
2226
2227 #if defined(LIBXML_HTML_ENABLED)
2228     int mem_base;
2229     int ret_val;
2230     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2231     int n_ctxt;
2232
2233     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2234         mem_base = xmlMemBlocks();
2235         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2236
2237         ret_val = htmlParseCharRef(ctxt);
2238         desret_int(ret_val);
2239         call_tests++;
2240         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2241         xmlResetLastError();
2242         if (mem_base != xmlMemBlocks()) {
2243             printf("Leak of %d blocks found in htmlParseCharRef",
2244                    xmlMemBlocks() - mem_base);
2245             test_ret++;
2246             printf(" %d", n_ctxt);
2247             printf("\n");
2248         }
2249     }
2250     function_tests++;
2251 #endif
2252
2253     return(test_ret);
2254 }
2255
2256
2257 static int
2258 test_htmlParseChunk(void) {
2259     int test_ret = 0;
2260
2261 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2262     int mem_base;
2263     int ret_val;
2264     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2265     int n_ctxt;
2266     char * chunk; /* an char array */
2267     int n_chunk;
2268     int size; /* the size in byte of the chunk */
2269     int n_size;
2270     int terminate; /* last chunk indicator */
2271     int n_terminate;
2272
2273     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2274     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2275     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2276     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2277         mem_base = xmlMemBlocks();
2278         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2279         chunk = gen_const_char_ptr(n_chunk, 1);
2280         size = gen_int(n_size, 2);
2281         terminate = gen_int(n_terminate, 3);
2282
2283         ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2284         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2285         desret_int(ret_val);
2286         call_tests++;
2287         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2288         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2289         des_int(n_size, size, 2);
2290         des_int(n_terminate, terminate, 3);
2291         xmlResetLastError();
2292         if (mem_base != xmlMemBlocks()) {
2293             printf("Leak of %d blocks found in htmlParseChunk",
2294                    xmlMemBlocks() - mem_base);
2295             test_ret++;
2296             printf(" %d", n_ctxt);
2297             printf(" %d", n_chunk);
2298             printf(" %d", n_size);
2299             printf(" %d", n_terminate);
2300             printf("\n");
2301         }
2302     }
2303     }
2304     }
2305     }
2306     function_tests++;
2307 #endif
2308
2309     return(test_ret);
2310 }
2311
2312
2313 static int
2314 test_htmlParseDoc(void) {
2315     int test_ret = 0;
2316
2317 #if defined(LIBXML_HTML_ENABLED)
2318     int mem_base;
2319     htmlDocPtr ret_val;
2320     xmlChar * cur; /* a pointer to an array of xmlChar */
2321     int n_cur;
2322     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2323     int n_encoding;
2324
2325     for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2326     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2327         mem_base = xmlMemBlocks();
2328         cur = gen_xmlChar_ptr(n_cur, 0);
2329         encoding = gen_const_char_ptr(n_encoding, 1);
2330
2331         ret_val = htmlParseDoc(cur, (const char *)encoding);
2332         desret_htmlDocPtr(ret_val);
2333         call_tests++;
2334         des_xmlChar_ptr(n_cur, cur, 0);
2335         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2336         xmlResetLastError();
2337         if (mem_base != xmlMemBlocks()) {
2338             printf("Leak of %d blocks found in htmlParseDoc",
2339                    xmlMemBlocks() - mem_base);
2340             test_ret++;
2341             printf(" %d", n_cur);
2342             printf(" %d", n_encoding);
2343             printf("\n");
2344         }
2345     }
2346     }
2347     function_tests++;
2348 #endif
2349
2350     return(test_ret);
2351 }
2352
2353
2354 static int
2355 test_htmlParseDocument(void) {
2356     int test_ret = 0;
2357
2358 #if defined(LIBXML_HTML_ENABLED)
2359     int mem_base;
2360     int ret_val;
2361     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2362     int n_ctxt;
2363
2364     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2365         mem_base = xmlMemBlocks();
2366         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2367
2368         ret_val = htmlParseDocument(ctxt);
2369         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2370         desret_int(ret_val);
2371         call_tests++;
2372         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2373         xmlResetLastError();
2374         if (mem_base != xmlMemBlocks()) {
2375             printf("Leak of %d blocks found in htmlParseDocument",
2376                    xmlMemBlocks() - mem_base);
2377             test_ret++;
2378             printf(" %d", n_ctxt);
2379             printf("\n");
2380         }
2381     }
2382     function_tests++;
2383 #endif
2384
2385     return(test_ret);
2386 }
2387
2388
2389 static int
2390 test_htmlParseElement(void) {
2391     int test_ret = 0;
2392
2393 #if defined(LIBXML_HTML_ENABLED)
2394     int mem_base;
2395     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2396     int n_ctxt;
2397
2398     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2399         mem_base = xmlMemBlocks();
2400         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2401
2402         htmlParseElement(ctxt);
2403         call_tests++;
2404         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2405         xmlResetLastError();
2406         if (mem_base != xmlMemBlocks()) {
2407             printf("Leak of %d blocks found in htmlParseElement",
2408                    xmlMemBlocks() - mem_base);
2409             test_ret++;
2410             printf(" %d", n_ctxt);
2411             printf("\n");
2412         }
2413     }
2414     function_tests++;
2415 #endif
2416
2417     return(test_ret);
2418 }
2419
2420
2421 static int
2422 test_htmlParseEntityRef(void) {
2423     int test_ret = 0;
2424
2425 #if defined(LIBXML_HTML_ENABLED)
2426     int mem_base;
2427     const htmlEntityDesc * ret_val;
2428     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2429     int n_ctxt;
2430     xmlChar ** str; /* location to store the entity name */
2431     int n_str;
2432
2433     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2434     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2435         mem_base = xmlMemBlocks();
2436         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2437         str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2438
2439         ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2440         desret_const_htmlEntityDesc_ptr(ret_val);
2441         call_tests++;
2442         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2443         des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2444         xmlResetLastError();
2445         if (mem_base != xmlMemBlocks()) {
2446             printf("Leak of %d blocks found in htmlParseEntityRef",
2447                    xmlMemBlocks() - mem_base);
2448             test_ret++;
2449             printf(" %d", n_ctxt);
2450             printf(" %d", n_str);
2451             printf("\n");
2452         }
2453     }
2454     }
2455     function_tests++;
2456 #endif
2457
2458     return(test_ret);
2459 }
2460
2461
2462 static int
2463 test_htmlParseFile(void) {
2464     int test_ret = 0;
2465
2466 #if defined(LIBXML_HTML_ENABLED)
2467     htmlDocPtr ret_val;
2468     const char * filename; /* the filename */
2469     int n_filename;
2470     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2471     int n_encoding;
2472
2473     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2474     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2475         filename = gen_filepath(n_filename, 0);
2476         encoding = gen_const_char_ptr(n_encoding, 1);
2477
2478         ret_val = htmlParseFile(filename, (const char *)encoding);
2479         desret_htmlDocPtr(ret_val);
2480         call_tests++;
2481         des_filepath(n_filename, filename, 0);
2482         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2483         xmlResetLastError();
2484     }
2485     }
2486     function_tests++;
2487 #endif
2488
2489     return(test_ret);
2490 }
2491
2492
2493 static int
2494 test_htmlReadDoc(void) {
2495     int test_ret = 0;
2496
2497 #if defined(LIBXML_HTML_ENABLED)
2498     int mem_base;
2499     htmlDocPtr ret_val;
2500     xmlChar * cur; /* a pointer to a zero terminated string */
2501     int n_cur;
2502     const char * URL; /* the base URL to use for the document */
2503     int n_URL;
2504     char * encoding; /* the document encoding, or NULL */
2505     int n_encoding;
2506     int options; /* a combination of htmlParserOption(s) */
2507     int n_options;
2508
2509     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2510     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2511     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2512     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2513         mem_base = xmlMemBlocks();
2514         cur = gen_const_xmlChar_ptr(n_cur, 0);
2515         URL = gen_filepath(n_URL, 1);
2516         encoding = gen_const_char_ptr(n_encoding, 2);
2517         options = gen_int(n_options, 3);
2518
2519         ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2520         desret_htmlDocPtr(ret_val);
2521         call_tests++;
2522         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2523         des_filepath(n_URL, URL, 1);
2524         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2525         des_int(n_options, options, 3);
2526         xmlResetLastError();
2527         if (mem_base != xmlMemBlocks()) {
2528             printf("Leak of %d blocks found in htmlReadDoc",
2529                    xmlMemBlocks() - mem_base);
2530             test_ret++;
2531             printf(" %d", n_cur);
2532             printf(" %d", n_URL);
2533             printf(" %d", n_encoding);
2534             printf(" %d", n_options);
2535             printf("\n");
2536         }
2537     }
2538     }
2539     }
2540     }
2541     function_tests++;
2542 #endif
2543
2544     return(test_ret);
2545 }
2546
2547
2548 static int
2549 test_htmlReadFile(void) {
2550     int test_ret = 0;
2551
2552 #if defined(LIBXML_HTML_ENABLED)
2553     int mem_base;
2554     htmlDocPtr ret_val;
2555     const char * filename; /* a file or URL */
2556     int n_filename;
2557     char * encoding; /* the document encoding, or NULL */
2558     int n_encoding;
2559     int options; /* a combination of htmlParserOption(s) */
2560     int n_options;
2561
2562     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2563     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2564     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2565         mem_base = xmlMemBlocks();
2566         filename = gen_filepath(n_filename, 0);
2567         encoding = gen_const_char_ptr(n_encoding, 1);
2568         options = gen_int(n_options, 2);
2569
2570         ret_val = htmlReadFile(filename, (const char *)encoding, options);
2571         desret_htmlDocPtr(ret_val);
2572         call_tests++;
2573         des_filepath(n_filename, filename, 0);
2574         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2575         des_int(n_options, options, 2);
2576         xmlResetLastError();
2577         if (mem_base != xmlMemBlocks()) {
2578             printf("Leak of %d blocks found in htmlReadFile",
2579                    xmlMemBlocks() - mem_base);
2580             test_ret++;
2581             printf(" %d", n_filename);
2582             printf(" %d", n_encoding);
2583             printf(" %d", n_options);
2584             printf("\n");
2585         }
2586     }
2587     }
2588     }
2589     function_tests++;
2590 #endif
2591
2592     return(test_ret);
2593 }
2594
2595
2596 static int
2597 test_htmlReadMemory(void) {
2598     int test_ret = 0;
2599
2600 #if defined(LIBXML_HTML_ENABLED)
2601     int mem_base;
2602     htmlDocPtr ret_val;
2603     char * buffer; /* a pointer to a char array */
2604     int n_buffer;
2605     int size; /* the size of the array */
2606     int n_size;
2607     const char * URL; /* the base URL to use for the document */
2608     int n_URL;
2609     char * encoding; /* the document encoding, or NULL */
2610     int n_encoding;
2611     int options; /* a combination of htmlParserOption(s) */
2612     int n_options;
2613
2614     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2615     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2616     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2617     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2618     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2619         mem_base = xmlMemBlocks();
2620         buffer = gen_const_char_ptr(n_buffer, 0);
2621         size = gen_int(n_size, 1);
2622         URL = gen_filepath(n_URL, 2);
2623         encoding = gen_const_char_ptr(n_encoding, 3);
2624         options = gen_int(n_options, 4);
2625
2626         ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2627         desret_htmlDocPtr(ret_val);
2628         call_tests++;
2629         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2630         des_int(n_size, size, 1);
2631         des_filepath(n_URL, URL, 2);
2632         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2633         des_int(n_options, options, 4);
2634         xmlResetLastError();
2635         if (mem_base != xmlMemBlocks()) {
2636             printf("Leak of %d blocks found in htmlReadMemory",
2637                    xmlMemBlocks() - mem_base);
2638             test_ret++;
2639             printf(" %d", n_buffer);
2640             printf(" %d", n_size);
2641             printf(" %d", n_URL);
2642             printf(" %d", n_encoding);
2643             printf(" %d", n_options);
2644             printf("\n");
2645         }
2646     }
2647     }
2648     }
2649     }
2650     }
2651     function_tests++;
2652 #endif
2653
2654     return(test_ret);
2655 }
2656
2657
2658 static int
2659 test_htmlSAXParseDoc(void) {
2660     int test_ret = 0;
2661
2662 #if defined(LIBXML_HTML_ENABLED)
2663     int mem_base;
2664     htmlDocPtr ret_val;
2665     xmlChar * cur; /* a pointer to an array of xmlChar */
2666     int n_cur;
2667     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2668     int n_encoding;
2669     htmlSAXHandlerPtr sax; /* the SAX handler block */
2670     int n_sax;
2671     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2672     int n_userData;
2673
2674     for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2675     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2676     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2677     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2678         mem_base = xmlMemBlocks();
2679         cur = gen_xmlChar_ptr(n_cur, 0);
2680         encoding = gen_const_char_ptr(n_encoding, 1);
2681         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2682         userData = gen_userdata(n_userData, 3);
2683
2684         ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2685         desret_htmlDocPtr(ret_val);
2686         call_tests++;
2687         des_xmlChar_ptr(n_cur, cur, 0);
2688         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2689         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2690         des_userdata(n_userData, userData, 3);
2691         xmlResetLastError();
2692         if (mem_base != xmlMemBlocks()) {
2693             printf("Leak of %d blocks found in htmlSAXParseDoc",
2694                    xmlMemBlocks() - mem_base);
2695             test_ret++;
2696             printf(" %d", n_cur);
2697             printf(" %d", n_encoding);
2698             printf(" %d", n_sax);
2699             printf(" %d", n_userData);
2700             printf("\n");
2701         }
2702     }
2703     }
2704     }
2705     }
2706     function_tests++;
2707 #endif
2708
2709     return(test_ret);
2710 }
2711
2712
2713 static int
2714 test_htmlSAXParseFile(void) {
2715     int test_ret = 0;
2716
2717 #if defined(LIBXML_HTML_ENABLED)
2718     int mem_base;
2719     htmlDocPtr ret_val;
2720     const char * filename; /* the filename */
2721     int n_filename;
2722     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2723     int n_encoding;
2724     htmlSAXHandlerPtr sax; /* the SAX handler block */
2725     int n_sax;
2726     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2727     int n_userData;
2728
2729     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2730     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2731     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2732     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2733         mem_base = xmlMemBlocks();
2734         filename = gen_filepath(n_filename, 0);
2735         encoding = gen_const_char_ptr(n_encoding, 1);
2736         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2737         userData = gen_userdata(n_userData, 3);
2738
2739         ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2740         desret_htmlDocPtr(ret_val);
2741         call_tests++;
2742         des_filepath(n_filename, filename, 0);
2743         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2744         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2745         des_userdata(n_userData, userData, 3);
2746         xmlResetLastError();
2747         if (mem_base != xmlMemBlocks()) {
2748             printf("Leak of %d blocks found in htmlSAXParseFile",
2749                    xmlMemBlocks() - mem_base);
2750             test_ret++;
2751             printf(" %d", n_filename);
2752             printf(" %d", n_encoding);
2753             printf(" %d", n_sax);
2754             printf(" %d", n_userData);
2755             printf("\n");
2756         }
2757     }
2758     }
2759     }
2760     }
2761     function_tests++;
2762 #endif
2763
2764     return(test_ret);
2765 }
2766
2767
2768 static int
2769 test_htmlTagLookup(void) {
2770     int test_ret = 0;
2771
2772
2773     /* missing type support */
2774     return(test_ret);
2775 }
2776
2777 static int
2778 test_HTMLparser(void) {
2779     int test_ret = 0;
2780         int rc = 0;
2781
2782     if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2783     rc = test_UTF8ToHtml();
2784         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2785     rc = test_htmlAttrAllowed();
2786         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2787     rc = test_htmlAutoCloseTag();
2788         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2789     rc = test_htmlCreateMemoryParserCtxt();
2790         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2791     rc = test_htmlCreatePushParserCtxt();
2792         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2793     rc = test_htmlCtxtReadDoc();
2794         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2795     rc = test_htmlCtxtReadFile();
2796         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2797     rc = test_htmlCtxtReadMemory();
2798         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2799     rc = test_htmlCtxtReset();
2800         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2801     rc = test_htmlCtxtUseOptions();
2802         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2803     rc = test_htmlElementAllowedHere();
2804         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2805     rc = test_htmlElementStatusHere();
2806         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2807     rc = test_htmlEncodeEntities();
2808         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2809     rc = test_htmlEntityLookup();
2810         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2811     rc = test_htmlEntityValueLookup();
2812         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2813     rc = test_htmlHandleOmittedElem();
2814         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2815     rc = test_htmlIsAutoClosed();
2816         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2817     rc = test_htmlIsScriptAttribute();
2818         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2819     rc = test_htmlNewParserCtxt();
2820         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2821     rc = test_htmlNodeStatus();
2822         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2823     rc = test_htmlParseCharRef();
2824         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2825     rc = test_htmlParseChunk();
2826         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2827     rc = test_htmlParseDoc();
2828         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2829     rc = test_htmlParseDocument();
2830         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2831     rc = test_htmlParseElement();
2832         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2833     rc = test_htmlParseEntityRef();
2834         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2835     rc = test_htmlParseFile();
2836         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2837     rc = test_htmlReadDoc();
2838         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2839     rc = test_htmlReadFile();
2840         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2841     rc = test_htmlReadMemory();
2842         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2843     rc = test_htmlSAXParseDoc();
2844         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2845     rc = test_htmlSAXParseFile();
2846         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2847     rc = test_htmlTagLookup();
2848         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2849
2850     if (test_ret != 0)
2851         printf("Module HTMLparser: %d errors\n", test_ret);
2852     return(test_ret);
2853 }
2854
2855 static int
2856 test_htmlDocContentDumpFormatOutput(void) {
2857     int test_ret = 0;
2858
2859 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2860     int mem_base;
2861     xmlOutputBufferPtr buf; /* the HTML buffer output */
2862     int n_buf;
2863     xmlDocPtr cur; /* the document */
2864     int n_cur;
2865     char * encoding; /* the encoding string */
2866     int n_encoding;
2867     int format; /* should formatting spaces been added */
2868     int n_format;
2869
2870     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2871     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2872     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2873     for (n_format = 0;n_format < gen_nb_int;n_format++) {
2874         mem_base = xmlMemBlocks();
2875         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2876         cur = gen_xmlDocPtr(n_cur, 1);
2877         encoding = gen_const_char_ptr(n_encoding, 2);
2878         format = gen_int(n_format, 3);
2879
2880         htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2881         call_tests++;
2882         des_xmlOutputBufferPtr(n_buf, buf, 0);
2883         des_xmlDocPtr(n_cur, cur, 1);
2884         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2885         des_int(n_format, format, 3);
2886         xmlResetLastError();
2887         if (mem_base != xmlMemBlocks()) {
2888             printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2889                    xmlMemBlocks() - mem_base);
2890             test_ret++;
2891             printf(" %d", n_buf);
2892             printf(" %d", n_cur);
2893             printf(" %d", n_encoding);
2894             printf(" %d", n_format);
2895             printf("\n");
2896         }
2897     }
2898     }
2899     }
2900     }
2901     function_tests++;
2902 #endif
2903
2904     return(test_ret);
2905 }
2906
2907
2908 static int
2909 test_htmlDocContentDumpOutput(void) {
2910     int test_ret = 0;
2911
2912 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2913     int mem_base;
2914     xmlOutputBufferPtr buf; /* the HTML buffer output */
2915     int n_buf;
2916     xmlDocPtr cur; /* the document */
2917     int n_cur;
2918     char * encoding; /* the encoding string */
2919     int n_encoding;
2920
2921     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2922     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2923     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2924         mem_base = xmlMemBlocks();
2925         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2926         cur = gen_xmlDocPtr(n_cur, 1);
2927         encoding = gen_const_char_ptr(n_encoding, 2);
2928
2929         htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2930         call_tests++;
2931         des_xmlOutputBufferPtr(n_buf, buf, 0);
2932         des_xmlDocPtr(n_cur, cur, 1);
2933         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2934         xmlResetLastError();
2935         if (mem_base != xmlMemBlocks()) {
2936             printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2937                    xmlMemBlocks() - mem_base);
2938             test_ret++;
2939             printf(" %d", n_buf);
2940             printf(" %d", n_cur);
2941             printf(" %d", n_encoding);
2942             printf("\n");
2943         }
2944     }
2945     }
2946     }
2947     function_tests++;
2948 #endif
2949
2950     return(test_ret);
2951 }
2952
2953
2954 static int
2955 test_htmlDocDump(void) {
2956     int test_ret = 0;
2957
2958 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2959     int mem_base;
2960     int ret_val;
2961     FILE * f; /* the FILE* */
2962     int n_f;
2963     xmlDocPtr cur; /* the document */
2964     int n_cur;
2965
2966     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2967     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2968         mem_base = xmlMemBlocks();
2969         f = gen_FILE_ptr(n_f, 0);
2970         cur = gen_xmlDocPtr(n_cur, 1);
2971
2972         ret_val = htmlDocDump(f, cur);
2973         desret_int(ret_val);
2974         call_tests++;
2975         des_FILE_ptr(n_f, f, 0);
2976         des_xmlDocPtr(n_cur, cur, 1);
2977         xmlResetLastError();
2978         if (mem_base != xmlMemBlocks()) {
2979             printf("Leak of %d blocks found in htmlDocDump",
2980                    xmlMemBlocks() - mem_base);
2981             test_ret++;
2982             printf(" %d", n_f);
2983             printf(" %d", n_cur);
2984             printf("\n");
2985         }
2986     }
2987     }
2988     function_tests++;
2989 #endif
2990
2991     return(test_ret);
2992 }
2993
2994
2995 #define gen_nb_xmlChar_ptr_ptr 1
2996 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2997     return(NULL);
2998 }
2999 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3000 }
3001
3002 static int
3003 test_htmlDocDumpMemory(void) {
3004     int test_ret = 0;
3005
3006 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3007     int mem_base;
3008     xmlDocPtr cur; /* the document */
3009     int n_cur;
3010     xmlChar ** mem; /* OUT: the memory pointer */
3011     int n_mem;
3012     int * size; /* OUT: the memory length */
3013     int n_size;
3014
3015     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3016     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3017     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3018         mem_base = xmlMemBlocks();
3019         cur = gen_xmlDocPtr(n_cur, 0);
3020         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3021         size = gen_int_ptr(n_size, 2);
3022
3023         htmlDocDumpMemory(cur, mem, size);
3024         call_tests++;
3025         des_xmlDocPtr(n_cur, cur, 0);
3026         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3027         des_int_ptr(n_size, size, 2);
3028         xmlResetLastError();
3029         if (mem_base != xmlMemBlocks()) {
3030             printf("Leak of %d blocks found in htmlDocDumpMemory",
3031                    xmlMemBlocks() - mem_base);
3032             test_ret++;
3033             printf(" %d", n_cur);
3034             printf(" %d", n_mem);
3035             printf(" %d", n_size);
3036             printf("\n");
3037         }
3038     }
3039     }
3040     }
3041     function_tests++;
3042 #endif
3043
3044     return(test_ret);
3045 }
3046
3047
3048 static int
3049 test_htmlDocDumpMemoryFormat(void) {
3050     int test_ret = 0;
3051
3052 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3053     int mem_base;
3054     xmlDocPtr cur; /* the document */
3055     int n_cur;
3056     xmlChar ** mem; /* OUT: the memory pointer */
3057     int n_mem;
3058     int * size; /* OUT: the memory length */
3059     int n_size;
3060     int format; /* should formatting spaces been added */
3061     int n_format;
3062
3063     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3064     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3065     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3066     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3067         mem_base = xmlMemBlocks();
3068         cur = gen_xmlDocPtr(n_cur, 0);
3069         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3070         size = gen_int_ptr(n_size, 2);
3071         format = gen_int(n_format, 3);
3072
3073         htmlDocDumpMemoryFormat(cur, mem, size, format);
3074         call_tests++;
3075         des_xmlDocPtr(n_cur, cur, 0);
3076         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3077         des_int_ptr(n_size, size, 2);
3078         des_int(n_format, format, 3);
3079         xmlResetLastError();
3080         if (mem_base != xmlMemBlocks()) {
3081             printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3082                    xmlMemBlocks() - mem_base);
3083             test_ret++;
3084             printf(" %d", n_cur);
3085             printf(" %d", n_mem);
3086             printf(" %d", n_size);
3087             printf(" %d", n_format);
3088             printf("\n");
3089         }
3090     }
3091     }
3092     }
3093     }
3094     function_tests++;
3095 #endif
3096
3097     return(test_ret);
3098 }
3099
3100
3101 static int
3102 test_htmlGetMetaEncoding(void) {
3103     int test_ret = 0;
3104
3105 #if defined(LIBXML_HTML_ENABLED)
3106     int mem_base;
3107     const xmlChar * ret_val;
3108     htmlDocPtr doc; /* the document */
3109     int n_doc;
3110
3111     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3112         mem_base = xmlMemBlocks();
3113         doc = gen_htmlDocPtr(n_doc, 0);
3114
3115         ret_val = htmlGetMetaEncoding(doc);
3116         desret_const_xmlChar_ptr(ret_val);
3117         call_tests++;
3118         des_htmlDocPtr(n_doc, doc, 0);
3119         xmlResetLastError();
3120         if (mem_base != xmlMemBlocks()) {
3121             printf("Leak of %d blocks found in htmlGetMetaEncoding",
3122                    xmlMemBlocks() - mem_base);
3123             test_ret++;
3124             printf(" %d", n_doc);
3125             printf("\n");
3126         }
3127     }
3128     function_tests++;
3129 #endif
3130
3131     return(test_ret);
3132 }
3133
3134
3135 static int
3136 test_htmlIsBooleanAttr(void) {
3137     int test_ret = 0;
3138
3139 #if defined(LIBXML_HTML_ENABLED)
3140     int mem_base;
3141     int ret_val;
3142     xmlChar * name; /* the name of the attribute to check */
3143     int n_name;
3144
3145     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3146         mem_base = xmlMemBlocks();
3147         name = gen_const_xmlChar_ptr(n_name, 0);
3148
3149         ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3150         desret_int(ret_val);
3151         call_tests++;
3152         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3153         xmlResetLastError();
3154         if (mem_base != xmlMemBlocks()) {
3155             printf("Leak of %d blocks found in htmlIsBooleanAttr",
3156                    xmlMemBlocks() - mem_base);
3157             test_ret++;
3158             printf(" %d", n_name);
3159             printf("\n");
3160         }
3161     }
3162     function_tests++;
3163 #endif
3164
3165     return(test_ret);
3166 }
3167
3168
3169 static int
3170 test_htmlNewDoc(void) {
3171     int test_ret = 0;
3172
3173 #if defined(LIBXML_HTML_ENABLED)
3174     int mem_base;
3175     htmlDocPtr ret_val;
3176     xmlChar * URI; /* URI for the dtd, or NULL */
3177     int n_URI;
3178     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3179     int n_ExternalID;
3180
3181     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3182     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3183         mem_base = xmlMemBlocks();
3184         URI = gen_const_xmlChar_ptr(n_URI, 0);
3185         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3186
3187         ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3188         desret_htmlDocPtr(ret_val);
3189         call_tests++;
3190         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3191         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3192         xmlResetLastError();
3193         if (mem_base != xmlMemBlocks()) {
3194             printf("Leak of %d blocks found in htmlNewDoc",
3195                    xmlMemBlocks() - mem_base);
3196             test_ret++;
3197             printf(" %d", n_URI);
3198             printf(" %d", n_ExternalID);
3199             printf("\n");
3200         }
3201     }
3202     }
3203     function_tests++;
3204 #endif
3205
3206     return(test_ret);
3207 }
3208
3209
3210 static int
3211 test_htmlNewDocNoDtD(void) {
3212     int test_ret = 0;
3213
3214 #if defined(LIBXML_HTML_ENABLED)
3215     int mem_base;
3216     htmlDocPtr ret_val;
3217     xmlChar * URI; /* URI for the dtd, or NULL */
3218     int n_URI;
3219     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3220     int n_ExternalID;
3221
3222     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3223     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3224         mem_base = xmlMemBlocks();
3225         URI = gen_const_xmlChar_ptr(n_URI, 0);
3226         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3227
3228         ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3229         desret_htmlDocPtr(ret_val);
3230         call_tests++;
3231         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3232         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3233         xmlResetLastError();
3234         if (mem_base != xmlMemBlocks()) {
3235             printf("Leak of %d blocks found in htmlNewDocNoDtD",
3236                    xmlMemBlocks() - mem_base);
3237             test_ret++;
3238             printf(" %d", n_URI);
3239             printf(" %d", n_ExternalID);
3240             printf("\n");
3241         }
3242     }
3243     }
3244     function_tests++;
3245 #endif
3246
3247     return(test_ret);
3248 }
3249
3250
3251 static int
3252 test_htmlNodeDump(void) {
3253     int test_ret = 0;
3254
3255 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3256     int mem_base;
3257     int ret_val;
3258     xmlBufferPtr buf; /* the HTML buffer output */
3259     int n_buf;
3260     xmlDocPtr doc; /* the document */
3261     int n_doc;
3262     xmlNodePtr cur; /* the current node */
3263     int n_cur;
3264
3265     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3266     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3267     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3268         mem_base = xmlMemBlocks();
3269         buf = gen_xmlBufferPtr(n_buf, 0);
3270         doc = gen_xmlDocPtr(n_doc, 1);
3271         cur = gen_xmlNodePtr(n_cur, 2);
3272
3273         ret_val = htmlNodeDump(buf, doc, cur);
3274         desret_int(ret_val);
3275         call_tests++;
3276         des_xmlBufferPtr(n_buf, buf, 0);
3277         des_xmlDocPtr(n_doc, doc, 1);
3278         des_xmlNodePtr(n_cur, cur, 2);
3279         xmlResetLastError();
3280         if (mem_base != xmlMemBlocks()) {
3281             printf("Leak of %d blocks found in htmlNodeDump",
3282                    xmlMemBlocks() - mem_base);
3283             test_ret++;
3284             printf(" %d", n_buf);
3285             printf(" %d", n_doc);
3286             printf(" %d", n_cur);
3287             printf("\n");
3288         }
3289     }
3290     }
3291     }
3292     function_tests++;
3293 #endif
3294
3295     return(test_ret);
3296 }
3297
3298
3299 static int
3300 test_htmlNodeDumpFile(void) {
3301     int test_ret = 0;
3302
3303 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3304     int mem_base;
3305     FILE * out; /* the FILE pointer */
3306     int n_out;
3307     xmlDocPtr doc; /* the document */
3308     int n_doc;
3309     xmlNodePtr cur; /* the current node */
3310     int n_cur;
3311
3312     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3313     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3314     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3315         mem_base = xmlMemBlocks();
3316         out = gen_FILE_ptr(n_out, 0);
3317         doc = gen_xmlDocPtr(n_doc, 1);
3318         cur = gen_xmlNodePtr(n_cur, 2);
3319
3320         htmlNodeDumpFile(out, doc, cur);
3321         call_tests++;
3322         des_FILE_ptr(n_out, out, 0);
3323         des_xmlDocPtr(n_doc, doc, 1);
3324         des_xmlNodePtr(n_cur, cur, 2);
3325         xmlResetLastError();
3326         if (mem_base != xmlMemBlocks()) {
3327             printf("Leak of %d blocks found in htmlNodeDumpFile",
3328                    xmlMemBlocks() - mem_base);
3329             test_ret++;
3330             printf(" %d", n_out);
3331             printf(" %d", n_doc);
3332             printf(" %d", n_cur);
3333             printf("\n");
3334         }
3335     }
3336     }
3337     }
3338     function_tests++;
3339 #endif
3340
3341     return(test_ret);
3342 }
3343
3344
3345 static int
3346 test_htmlNodeDumpFileFormat(void) {
3347     int test_ret = 0;
3348
3349 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3350     int mem_base;
3351     int ret_val;
3352     FILE * out; /* the FILE pointer */
3353     int n_out;
3354     xmlDocPtr doc; /* the document */
3355     int n_doc;
3356     xmlNodePtr cur; /* the current node */
3357     int n_cur;
3358     char * encoding; /* the document encoding */
3359     int n_encoding;
3360     int format; /* should formatting spaces been added */
3361     int n_format;
3362
3363     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3364     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3365     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3366     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3367     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3368         mem_base = xmlMemBlocks();
3369         out = gen_FILE_ptr(n_out, 0);
3370         doc = gen_xmlDocPtr(n_doc, 1);
3371         cur = gen_xmlNodePtr(n_cur, 2);
3372         encoding = gen_const_char_ptr(n_encoding, 3);
3373         format = gen_int(n_format, 4);
3374
3375         ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3376         desret_int(ret_val);
3377         call_tests++;
3378         des_FILE_ptr(n_out, out, 0);
3379         des_xmlDocPtr(n_doc, doc, 1);
3380         des_xmlNodePtr(n_cur, cur, 2);
3381         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3382         des_int(n_format, format, 4);
3383         xmlResetLastError();
3384         if (mem_base != xmlMemBlocks()) {
3385             printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3386                    xmlMemBlocks() - mem_base);
3387             test_ret++;
3388             printf(" %d", n_out);
3389             printf(" %d", n_doc);
3390             printf(" %d", n_cur);
3391             printf(" %d", n_encoding);
3392             printf(" %d", n_format);
3393             printf("\n");
3394         }
3395     }
3396     }
3397     }
3398     }
3399     }
3400     function_tests++;
3401 #endif
3402
3403     return(test_ret);
3404 }
3405
3406
3407 static int
3408 test_htmlNodeDumpFormatOutput(void) {
3409     int test_ret = 0;
3410
3411 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3412     int mem_base;
3413     xmlOutputBufferPtr buf; /* the HTML buffer output */
3414     int n_buf;
3415     xmlDocPtr doc; /* the document */
3416     int n_doc;
3417     xmlNodePtr cur; /* the current node */
3418     int n_cur;
3419     char * encoding; /* the encoding string */
3420     int n_encoding;
3421     int format; /* should formatting spaces been added */
3422     int n_format;
3423
3424     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3425     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3426     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3427     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3428     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3429         mem_base = xmlMemBlocks();
3430         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3431         doc = gen_xmlDocPtr(n_doc, 1);
3432         cur = gen_xmlNodePtr(n_cur, 2);
3433         encoding = gen_const_char_ptr(n_encoding, 3);
3434         format = gen_int(n_format, 4);
3435
3436         htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3437         call_tests++;
3438         des_xmlOutputBufferPtr(n_buf, buf, 0);
3439         des_xmlDocPtr(n_doc, doc, 1);
3440         des_xmlNodePtr(n_cur, cur, 2);
3441         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3442         des_int(n_format, format, 4);
3443         xmlResetLastError();
3444         if (mem_base != xmlMemBlocks()) {
3445             printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3446                    xmlMemBlocks() - mem_base);
3447             test_ret++;
3448             printf(" %d", n_buf);
3449             printf(" %d", n_doc);
3450             printf(" %d", n_cur);
3451             printf(" %d", n_encoding);
3452             printf(" %d", n_format);
3453             printf("\n");
3454         }
3455     }
3456     }
3457     }
3458     }
3459     }
3460     function_tests++;
3461 #endif
3462
3463     return(test_ret);
3464 }
3465
3466
3467 static int
3468 test_htmlNodeDumpOutput(void) {
3469     int test_ret = 0;
3470
3471 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3472     int mem_base;
3473     xmlOutputBufferPtr buf; /* the HTML buffer output */
3474     int n_buf;
3475     xmlDocPtr doc; /* the document */
3476     int n_doc;
3477     xmlNodePtr cur; /* the current node */
3478     int n_cur;
3479     char * encoding; /* the encoding string */
3480     int n_encoding;
3481
3482     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3483     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3484     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3485     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3486         mem_base = xmlMemBlocks();
3487         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3488         doc = gen_xmlDocPtr(n_doc, 1);
3489         cur = gen_xmlNodePtr(n_cur, 2);
3490         encoding = gen_const_char_ptr(n_encoding, 3);
3491
3492         htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3493         call_tests++;
3494         des_xmlOutputBufferPtr(n_buf, buf, 0);
3495         des_xmlDocPtr(n_doc, doc, 1);
3496         des_xmlNodePtr(n_cur, cur, 2);
3497         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3498         xmlResetLastError();
3499         if (mem_base != xmlMemBlocks()) {
3500             printf("Leak of %d blocks found in htmlNodeDumpOutput",
3501                    xmlMemBlocks() - mem_base);
3502             test_ret++;
3503             printf(" %d", n_buf);
3504             printf(" %d", n_doc);
3505             printf(" %d", n_cur);
3506             printf(" %d", n_encoding);
3507             printf("\n");
3508         }
3509     }
3510     }
3511     }
3512     }
3513     function_tests++;
3514 #endif
3515
3516     return(test_ret);
3517 }
3518
3519
3520 static int
3521 test_htmlSaveFile(void) {
3522     int test_ret = 0;
3523
3524 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3525     int mem_base;
3526     int ret_val;
3527     const char * filename; /* the filename (or URL) */
3528     int n_filename;
3529     xmlDocPtr cur; /* the document */
3530     int n_cur;
3531
3532     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3533     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3534         mem_base = xmlMemBlocks();
3535         filename = gen_fileoutput(n_filename, 0);
3536         cur = gen_xmlDocPtr(n_cur, 1);
3537
3538         ret_val = htmlSaveFile(filename, cur);
3539         desret_int(ret_val);
3540         call_tests++;
3541         des_fileoutput(n_filename, filename, 0);
3542         des_xmlDocPtr(n_cur, cur, 1);
3543         xmlResetLastError();
3544         if (mem_base != xmlMemBlocks()) {
3545             printf("Leak of %d blocks found in htmlSaveFile",
3546                    xmlMemBlocks() - mem_base);
3547             test_ret++;
3548             printf(" %d", n_filename);
3549             printf(" %d", n_cur);
3550             printf("\n");
3551         }
3552     }
3553     }
3554     function_tests++;
3555 #endif
3556
3557     return(test_ret);
3558 }
3559
3560
3561 static int
3562 test_htmlSaveFileEnc(void) {
3563     int test_ret = 0;
3564
3565 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3566     int mem_base;
3567     int ret_val;
3568     const char * filename; /* the filename */
3569     int n_filename;
3570     xmlDocPtr cur; /* the document */
3571     int n_cur;
3572     char * encoding; /* the document encoding */
3573     int n_encoding;
3574
3575     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3576     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3577     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3578         mem_base = xmlMemBlocks();
3579         filename = gen_fileoutput(n_filename, 0);
3580         cur = gen_xmlDocPtr(n_cur, 1);
3581         encoding = gen_const_char_ptr(n_encoding, 2);
3582
3583         ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3584         desret_int(ret_val);
3585         call_tests++;
3586         des_fileoutput(n_filename, filename, 0);
3587         des_xmlDocPtr(n_cur, cur, 1);
3588         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3589         xmlResetLastError();
3590         if (mem_base != xmlMemBlocks()) {
3591             printf("Leak of %d blocks found in htmlSaveFileEnc",
3592                    xmlMemBlocks() - mem_base);
3593             test_ret++;
3594             printf(" %d", n_filename);
3595             printf(" %d", n_cur);
3596             printf(" %d", n_encoding);
3597             printf("\n");
3598         }
3599     }
3600     }
3601     }
3602     function_tests++;
3603 #endif
3604
3605     return(test_ret);
3606 }
3607
3608
3609 static int
3610 test_htmlSaveFileFormat(void) {
3611     int test_ret = 0;
3612
3613 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3614     int mem_base;
3615     int ret_val;
3616     const char * filename; /* the filename */
3617     int n_filename;
3618     xmlDocPtr cur; /* the document */
3619     int n_cur;
3620     char * encoding; /* the document encoding */
3621     int n_encoding;
3622     int format; /* should formatting spaces been added */
3623     int n_format;
3624
3625     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3626     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3627     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3628     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3629         mem_base = xmlMemBlocks();
3630         filename = gen_fileoutput(n_filename, 0);
3631         cur = gen_xmlDocPtr(n_cur, 1);
3632         encoding = gen_const_char_ptr(n_encoding, 2);
3633         format = gen_int(n_format, 3);
3634
3635         ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3636         desret_int(ret_val);
3637         call_tests++;
3638         des_fileoutput(n_filename, filename, 0);
3639         des_xmlDocPtr(n_cur, cur, 1);
3640         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3641         des_int(n_format, format, 3);
3642         xmlResetLastError();
3643         if (mem_base != xmlMemBlocks()) {
3644             printf("Leak of %d blocks found in htmlSaveFileFormat",
3645                    xmlMemBlocks() - mem_base);
3646             test_ret++;
3647             printf(" %d", n_filename);
3648             printf(" %d", n_cur);
3649             printf(" %d", n_encoding);
3650             printf(" %d", n_format);
3651             printf("\n");
3652         }
3653     }
3654     }
3655     }
3656     }
3657     function_tests++;
3658 #endif
3659
3660     return(test_ret);
3661 }
3662
3663
3664 static int
3665 test_htmlSetMetaEncoding(void) {
3666     int test_ret = 0;
3667
3668 #if defined(LIBXML_HTML_ENABLED)
3669     int mem_base;
3670     int ret_val;
3671     htmlDocPtr doc; /* the document */
3672     int n_doc;
3673     xmlChar * encoding; /* the encoding string */
3674     int n_encoding;
3675
3676     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3677     for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3678         mem_base = xmlMemBlocks();
3679         doc = gen_htmlDocPtr(n_doc, 0);
3680         encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3681
3682         ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3683         desret_int(ret_val);
3684         call_tests++;
3685         des_htmlDocPtr(n_doc, doc, 0);
3686         des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3687         xmlResetLastError();
3688         if (mem_base != xmlMemBlocks()) {
3689             printf("Leak of %d blocks found in htmlSetMetaEncoding",
3690                    xmlMemBlocks() - mem_base);
3691             test_ret++;
3692             printf(" %d", n_doc);
3693             printf(" %d", n_encoding);
3694             printf("\n");
3695         }
3696     }
3697     }
3698     function_tests++;
3699 #endif
3700
3701     return(test_ret);
3702 }
3703
3704 static int
3705 test_HTMLtree(void) {
3706     int test_ret = 0;
3707         int rc = 0;
3708
3709     if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3710     rc = test_htmlDocContentDumpFormatOutput();
3711         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3712     rc = test_htmlDocContentDumpOutput();
3713         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3714     rc = test_htmlDocDump();
3715         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3716     rc = test_htmlDocDumpMemory();
3717         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3718     rc = test_htmlDocDumpMemoryFormat();
3719         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3720     rc = test_htmlGetMetaEncoding();
3721         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3722     rc = test_htmlIsBooleanAttr();
3723         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3724     rc = test_htmlNewDoc();
3725         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3726     rc = test_htmlNewDocNoDtD();
3727         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3728     rc = test_htmlNodeDump();
3729         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3730     rc = test_htmlNodeDumpFile();
3731         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3732     rc = test_htmlNodeDumpFileFormat();
3733         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3734     rc = test_htmlNodeDumpFormatOutput();
3735         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3736     rc = test_htmlNodeDumpOutput();
3737         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3738     rc = test_htmlSaveFile();
3739         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3740     rc = test_htmlSaveFileEnc();
3741         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3742     rc = test_htmlSaveFileFormat();
3743         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3744     rc = test_htmlSetMetaEncoding();
3745         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3746
3747     if (test_ret != 0)
3748         printf("Module HTMLtree: %d errors\n", test_ret);
3749     return(test_ret);
3750 }
3751
3752 static int
3753 test_docbDefaultSAXHandlerInit(void) {
3754     int test_ret = 0;
3755
3756 #if defined(LIBXML_DOCB_ENABLED)
3757 #ifdef LIBXML_DOCB_ENABLED
3758     int mem_base;
3759
3760         mem_base = xmlMemBlocks();
3761
3762         docbDefaultSAXHandlerInit();
3763         call_tests++;
3764         xmlResetLastError();
3765         if (mem_base != xmlMemBlocks()) {
3766             printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3767                    xmlMemBlocks() - mem_base);
3768             test_ret++;
3769             printf("\n");
3770         }
3771     function_tests++;
3772 #endif
3773 #endif
3774
3775     return(test_ret);
3776 }
3777
3778
3779 static int
3780 test_htmlDefaultSAXHandlerInit(void) {
3781     int test_ret = 0;
3782
3783 #if defined(LIBXML_HTML_ENABLED)
3784 #ifdef LIBXML_HTML_ENABLED
3785     int mem_base;
3786
3787         mem_base = xmlMemBlocks();
3788
3789         htmlDefaultSAXHandlerInit();
3790         call_tests++;
3791         xmlResetLastError();
3792         if (mem_base != xmlMemBlocks()) {
3793             printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3794                    xmlMemBlocks() - mem_base);
3795             test_ret++;
3796             printf("\n");
3797         }
3798     function_tests++;
3799 #endif
3800 #endif
3801
3802     return(test_ret);
3803 }
3804
3805
3806 static int
3807 test_xmlDefaultSAXHandlerInit(void) {
3808     int test_ret = 0;
3809
3810     int mem_base;
3811
3812         mem_base = xmlMemBlocks();
3813
3814         xmlDefaultSAXHandlerInit();
3815         call_tests++;
3816         xmlResetLastError();
3817         if (mem_base != xmlMemBlocks()) {
3818             printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3819                    xmlMemBlocks() - mem_base);
3820             test_ret++;
3821             printf("\n");
3822         }
3823     function_tests++;
3824
3825     return(test_ret);
3826 }
3827
3828
3829 #define gen_nb_xmlEnumerationPtr 1
3830 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3831     return(NULL);
3832 }
3833 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3834 }
3835
3836 static int
3837 test_xmlSAX2AttributeDecl(void) {
3838     int test_ret = 0;
3839
3840     int mem_base;
3841     void * ctx; /* the user data (XML parser context) */
3842     int n_ctx;
3843     xmlChar * elem; /* the name of the element */
3844     int n_elem;
3845     xmlChar * fullname; /* the attribute name */
3846     int n_fullname;
3847     int type; /* the attribute type */
3848     int n_type;
3849     int def; /* the type of default value */
3850     int n_def;
3851     xmlChar * defaultValue; /* the attribute default value */
3852     int n_defaultValue;
3853     xmlEnumerationPtr tree; /* the tree of enumerated value set */
3854     int n_tree;
3855
3856     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3857     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3858     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3859     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3860     for (n_def = 0;n_def < gen_nb_int;n_def++) {
3861     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3862     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3863         mem_base = xmlMemBlocks();
3864         ctx = gen_void_ptr(n_ctx, 0);
3865         elem = gen_const_xmlChar_ptr(n_elem, 1);
3866         fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3867         type = gen_int(n_type, 3);
3868         def = gen_int(n_def, 4);
3869         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3870         tree = gen_xmlEnumerationPtr(n_tree, 6);
3871
3872         xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3873         call_tests++;
3874         des_void_ptr(n_ctx, ctx, 0);
3875         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3876         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3877         des_int(n_type, type, 3);
3878         des_int(n_def, def, 4);
3879         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3880         des_xmlEnumerationPtr(n_tree, tree, 6);
3881         xmlResetLastError();
3882         if (mem_base != xmlMemBlocks()) {
3883             printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3884                    xmlMemBlocks() - mem_base);
3885             test_ret++;
3886             printf(" %d", n_ctx);
3887             printf(" %d", n_elem);
3888             printf(" %d", n_fullname);
3889             printf(" %d", n_type);
3890             printf(" %d", n_def);
3891             printf(" %d", n_defaultValue);
3892             printf(" %d", n_tree);
3893             printf("\n");
3894         }
3895     }
3896     }
3897     }
3898     }
3899     }
3900     }
3901     }
3902     function_tests++;
3903
3904     return(test_ret);
3905 }
3906
3907
3908 static int
3909 test_xmlSAX2CDataBlock(void) {
3910     int test_ret = 0;
3911
3912     int mem_base;
3913     void * ctx; /* the user data (XML parser context) */
3914     int n_ctx;
3915     xmlChar * value; /* The pcdata content */
3916     int n_value;
3917     int len; /* the block length */
3918     int n_len;
3919
3920     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3921     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3922     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3923         mem_base = xmlMemBlocks();
3924         ctx = gen_void_ptr(n_ctx, 0);
3925         value = gen_const_xmlChar_ptr(n_value, 1);
3926         len = gen_int(n_len, 2);
3927
3928         xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3929         call_tests++;
3930         des_void_ptr(n_ctx, ctx, 0);
3931         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3932         des_int(n_len, len, 2);
3933         xmlResetLastError();
3934         if (mem_base != xmlMemBlocks()) {
3935             printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3936                    xmlMemBlocks() - mem_base);
3937             test_ret++;
3938             printf(" %d", n_ctx);
3939             printf(" %d", n_value);
3940             printf(" %d", n_len);
3941             printf("\n");
3942         }
3943     }
3944     }
3945     }
3946     function_tests++;
3947
3948     return(test_ret);
3949 }
3950
3951
3952 static int
3953 test_xmlSAX2Characters(void) {
3954     int test_ret = 0;
3955
3956     int mem_base;
3957     void * ctx; /* the user data (XML parser context) */
3958     int n_ctx;
3959     xmlChar * ch; /* a xmlChar string */
3960     int n_ch;
3961     int len; /* the number of xmlChar */
3962     int n_len;
3963
3964     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3965     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3966     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3967         mem_base = xmlMemBlocks();
3968         ctx = gen_void_ptr(n_ctx, 0);
3969         ch = gen_const_xmlChar_ptr(n_ch, 1);
3970         len = gen_int(n_len, 2);
3971
3972         xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3973         call_tests++;
3974         des_void_ptr(n_ctx, ctx, 0);
3975         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3976         des_int(n_len, len, 2);
3977         xmlResetLastError();
3978         if (mem_base != xmlMemBlocks()) {
3979             printf("Leak of %d blocks found in xmlSAX2Characters",
3980                    xmlMemBlocks() - mem_base);
3981             test_ret++;
3982             printf(" %d", n_ctx);
3983             printf(" %d", n_ch);
3984             printf(" %d", n_len);
3985             printf("\n");
3986         }
3987     }
3988     }
3989     }
3990     function_tests++;
3991
3992     return(test_ret);
3993 }
3994
3995
3996 static int
3997 test_xmlSAX2Comment(void) {
3998     int test_ret = 0;
3999
4000     int mem_base;
4001     void * ctx; /* the user data (XML parser context) */
4002     int n_ctx;
4003     xmlChar * value; /* the xmlSAX2Comment content */
4004     int n_value;
4005
4006     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4007     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
4008         mem_base = xmlMemBlocks();
4009         ctx = gen_void_ptr(n_ctx, 0);
4010         value = gen_const_xmlChar_ptr(n_value, 1);
4011
4012         xmlSAX2Comment(ctx, (const xmlChar *)value);
4013         call_tests++;
4014         des_void_ptr(n_ctx, ctx, 0);
4015         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
4016         xmlResetLastError();
4017         if (mem_base != xmlMemBlocks()) {
4018             printf("Leak of %d blocks found in xmlSAX2Comment",
4019                    xmlMemBlocks() - mem_base);
4020             test_ret++;
4021             printf(" %d", n_ctx);
4022             printf(" %d", n_value);
4023             printf("\n");
4024         }
4025     }
4026     }
4027     function_tests++;
4028
4029     return(test_ret);
4030 }
4031
4032
4033 static int
4034 test_xmlSAX2ElementDecl(void) {
4035     int test_ret = 0;
4036
4037     int mem_base;
4038     void * ctx; /* the user data (XML parser context) */
4039     int n_ctx;
4040     xmlChar * name; /* the element name */
4041     int n_name;
4042     int type; /* the element type */
4043     int n_type;
4044     xmlElementContentPtr content; /* the element value tree */
4045     int n_content;
4046
4047     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4048     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4049     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4050     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4051         mem_base = xmlMemBlocks();
4052         ctx = gen_void_ptr(n_ctx, 0);
4053         name = gen_const_xmlChar_ptr(n_name, 1);
4054         type = gen_int(n_type, 2);
4055         content = gen_xmlElementContentPtr(n_content, 3);
4056
4057         xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4058         call_tests++;
4059         des_void_ptr(n_ctx, ctx, 0);
4060         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4061         des_int(n_type, type, 2);
4062         des_xmlElementContentPtr(n_content, content, 3);
4063         xmlResetLastError();
4064         if (mem_base != xmlMemBlocks()) {
4065             printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4066                    xmlMemBlocks() - mem_base);
4067             test_ret++;
4068             printf(" %d", n_ctx);
4069             printf(" %d", n_name);
4070             printf(" %d", n_type);
4071             printf(" %d", n_content);
4072             printf("\n");
4073         }
4074     }
4075     }
4076     }
4077     }
4078     function_tests++;
4079
4080     return(test_ret);
4081 }
4082
4083
4084 static int
4085 test_xmlSAX2EndDocument(void) {
4086     int test_ret = 0;
4087
4088     int mem_base;
4089     void * ctx; /* the user data (XML parser context) */
4090     int n_ctx;
4091
4092     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4093         mem_base = xmlMemBlocks();
4094         ctx = gen_void_ptr(n_ctx, 0);
4095
4096         xmlSAX2EndDocument(ctx);
4097         call_tests++;
4098         des_void_ptr(n_ctx, ctx, 0);
4099         xmlResetLastError();
4100         if (mem_base != xmlMemBlocks()) {
4101             printf("Leak of %d blocks found in xmlSAX2EndDocument",
4102                    xmlMemBlocks() - mem_base);
4103             test_ret++;
4104             printf(" %d", n_ctx);
4105             printf("\n");
4106         }
4107     }
4108     function_tests++;
4109
4110     return(test_ret);
4111 }
4112
4113
4114 static int
4115 test_xmlSAX2EndElement(void) {
4116     int test_ret = 0;
4117
4118 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
4119 #ifdef LIBXML_SAX1_ENABLED
4120     int mem_base;
4121     void * ctx; /* the user data (XML parser context) */
4122     int n_ctx;
4123     xmlChar * name; /* The element name */
4124     int n_name;
4125
4126     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4127     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4128         mem_base = xmlMemBlocks();
4129         ctx = gen_void_ptr(n_ctx, 0);
4130         name = gen_const_xmlChar_ptr(n_name, 1);
4131
4132         xmlSAX2EndElement(ctx, (const xmlChar *)name);
4133         call_tests++;
4134         des_void_ptr(n_ctx, ctx, 0);
4135         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4136         xmlResetLastError();
4137         if (mem_base != xmlMemBlocks()) {
4138             printf("Leak of %d blocks found in xmlSAX2EndElement",
4139                    xmlMemBlocks() - mem_base);
4140             test_ret++;
4141             printf(" %d", n_ctx);
4142             printf(" %d", n_name);
4143             printf("\n");
4144         }
4145     }
4146     }
4147     function_tests++;
4148 #endif
4149 #endif
4150
4151     return(test_ret);
4152 }
4153
4154
4155 static int
4156 test_xmlSAX2EndElementNs(void) {
4157     int test_ret = 0;
4158
4159     int mem_base;
4160     void * ctx; /* the user data (XML parser context) */
4161     int n_ctx;
4162     xmlChar * localname; /* the local name of the element */
4163     int n_localname;
4164     xmlChar * prefix; /* the element namespace prefix if available */
4165     int n_prefix;
4166     xmlChar * URI; /* the element namespace name if available */
4167     int n_URI;
4168
4169     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4170     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4171     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4172     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4173         mem_base = xmlMemBlocks();
4174         ctx = gen_void_ptr(n_ctx, 0);
4175         localname = gen_const_xmlChar_ptr(n_localname, 1);
4176         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4177         URI = gen_const_xmlChar_ptr(n_URI, 3);
4178
4179         xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4180         call_tests++;
4181         des_void_ptr(n_ctx, ctx, 0);
4182         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4183         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4184         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4185         xmlResetLastError();
4186         if (mem_base != xmlMemBlocks()) {
4187             printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4188                    xmlMemBlocks() - mem_base);
4189             test_ret++;
4190             printf(" %d", n_ctx);
4191             printf(" %d", n_localname);
4192             printf(" %d", n_prefix);
4193             printf(" %d", n_URI);
4194             printf("\n");
4195         }
4196     }
4197     }
4198     }
4199     }
4200     function_tests++;
4201
4202     return(test_ret);
4203 }
4204
4205
4206 static int
4207 test_xmlSAX2EntityDecl(void) {
4208     int test_ret = 0;
4209
4210     int mem_base;
4211     void * ctx; /* the user data (XML parser context) */
4212     int n_ctx;
4213     xmlChar * name; /* the entity name */
4214     int n_name;
4215     int type; /* the entity type */
4216     int n_type;
4217     xmlChar * publicId; /* The public ID of the entity */
4218     int n_publicId;
4219     xmlChar * systemId; /* The system ID of the entity */
4220     int n_systemId;
4221     xmlChar * content; /* the entity value (without processing). */
4222     int n_content;
4223
4224     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4225     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4226     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4227     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4228     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4229     for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4230         mem_base = xmlMemBlocks();
4231         ctx = gen_void_ptr(n_ctx, 0);
4232         name = gen_const_xmlChar_ptr(n_name, 1);
4233         type = gen_int(n_type, 2);
4234         publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4235         systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4236         content = gen_xmlChar_ptr(n_content, 5);
4237
4238         xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4239         call_tests++;
4240         des_void_ptr(n_ctx, ctx, 0);
4241         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4242         des_int(n_type, type, 2);
4243         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4244         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4245         des_xmlChar_ptr(n_content, content, 5);
4246         xmlResetLastError();
4247         if (mem_base != xmlMemBlocks()) {
4248             printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4249                    xmlMemBlocks() - mem_base);
4250             test_ret++;
4251             printf(" %d", n_ctx);
4252             printf(" %d", n_name);
4253             printf(" %d", n_type);
4254             printf(" %d", n_publicId);
4255             printf(" %d", n_systemId);
4256             printf(" %d", n_content);
4257             printf("\n");
4258         }
4259     }
4260     }
4261     }
4262     }
4263     }
4264     }
4265     function_tests++;
4266
4267     return(test_ret);
4268 }
4269
4270
4271 static int
4272 test_xmlSAX2ExternalSubset(void) {
4273     int test_ret = 0;
4274
4275     int mem_base;
4276     void * ctx; /* the user data (XML parser context) */
4277     int n_ctx;
4278     xmlChar * name; /* the root element name */
4279     int n_name;
4280     xmlChar * ExternalID; /* the external ID */
4281     int n_ExternalID;
4282     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4283     int n_SystemID;
4284
4285     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4286     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4287     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4288     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4289         mem_base = xmlMemBlocks();
4290         ctx = gen_void_ptr(n_ctx, 0);
4291         name = gen_const_xmlChar_ptr(n_name, 1);
4292         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4293         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4294
4295         xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4296         call_tests++;
4297         des_void_ptr(n_ctx, ctx, 0);
4298         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4299         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4300         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4301         xmlResetLastError();
4302         if (mem_base != xmlMemBlocks()) {
4303             printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4304                    xmlMemBlocks() - mem_base);
4305             test_ret++;
4306             printf(" %d", n_ctx);
4307             printf(" %d", n_name);
4308             printf(" %d", n_ExternalID);
4309             printf(" %d", n_SystemID);
4310             printf("\n");
4311         }
4312     }
4313     }
4314     }
4315     }
4316     function_tests++;
4317
4318     return(test_ret);
4319 }
4320
4321
4322 static int
4323 test_xmlSAX2GetColumnNumber(void) {
4324     int test_ret = 0;
4325
4326     int mem_base;
4327     int ret_val;
4328     void * ctx; /* the user data (XML parser context) */
4329     int n_ctx;
4330
4331     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4332         mem_base = xmlMemBlocks();
4333         ctx = gen_void_ptr(n_ctx, 0);
4334
4335         ret_val = xmlSAX2GetColumnNumber(ctx);
4336         desret_int(ret_val);
4337         call_tests++;
4338         des_void_ptr(n_ctx, ctx, 0);
4339         xmlResetLastError();
4340         if (mem_base != xmlMemBlocks()) {
4341             printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4342                    xmlMemBlocks() - mem_base);
4343             test_ret++;
4344             printf(" %d", n_ctx);
4345             printf("\n");
4346         }
4347     }
4348     function_tests++;
4349
4350     return(test_ret);
4351 }
4352
4353
4354 static int
4355 test_xmlSAX2GetEntity(void) {
4356     int test_ret = 0;
4357
4358     int mem_base;
4359     xmlEntityPtr ret_val;
4360     void * ctx; /* the user data (XML parser context) */
4361     int n_ctx;
4362     xmlChar * name; /* The entity name */
4363     int n_name;
4364
4365     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4366     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4367         mem_base = xmlMemBlocks();
4368         ctx = gen_void_ptr(n_ctx, 0);
4369         name = gen_const_xmlChar_ptr(n_name, 1);
4370
4371         ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4372         desret_xmlEntityPtr(ret_val);
4373         call_tests++;
4374         des_void_ptr(n_ctx, ctx, 0);
4375         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4376         xmlResetLastError();
4377         if (mem_base != xmlMemBlocks()) {
4378             printf("Leak of %d blocks found in xmlSAX2GetEntity",
4379                    xmlMemBlocks() - mem_base);
4380             test_ret++;
4381             printf(" %d", n_ctx);
4382             printf(" %d", n_name);
4383             printf("\n");
4384         }
4385     }
4386     }
4387     function_tests++;
4388
4389     return(test_ret);
4390 }
4391
4392
4393 static int
4394 test_xmlSAX2GetLineNumber(void) {
4395     int test_ret = 0;
4396
4397     int mem_base;
4398     int ret_val;
4399     void * ctx; /* the user data (XML parser context) */
4400     int n_ctx;
4401
4402     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4403         mem_base = xmlMemBlocks();
4404         ctx = gen_void_ptr(n_ctx, 0);
4405
4406         ret_val = xmlSAX2GetLineNumber(ctx);
4407         desret_int(ret_val);
4408         call_tests++;
4409         des_void_ptr(n_ctx, ctx, 0);
4410         xmlResetLastError();
4411         if (mem_base != xmlMemBlocks()) {
4412             printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4413                    xmlMemBlocks() - mem_base);
4414             test_ret++;
4415             printf(" %d", n_ctx);
4416             printf("\n");
4417         }
4418     }
4419     function_tests++;
4420
4421     return(test_ret);
4422 }
4423
4424
4425 static int
4426 test_xmlSAX2GetParameterEntity(void) {
4427     int test_ret = 0;
4428
4429     int mem_base;
4430     xmlEntityPtr ret_val;
4431     void * ctx; /* the user data (XML parser context) */
4432     int n_ctx;
4433     xmlChar * name; /* The entity name */
4434     int n_name;
4435
4436     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4437     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4438         mem_base = xmlMemBlocks();
4439         ctx = gen_void_ptr(n_ctx, 0);
4440         name = gen_const_xmlChar_ptr(n_name, 1);
4441
4442         ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4443         desret_xmlEntityPtr(ret_val);
4444         call_tests++;
4445         des_void_ptr(n_ctx, ctx, 0);
4446         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4447         xmlResetLastError();
4448         if (mem_base != xmlMemBlocks()) {
4449             printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4450                    xmlMemBlocks() - mem_base);
4451             test_ret++;
4452             printf(" %d", n_ctx);
4453             printf(" %d", n_name);
4454             printf("\n");
4455         }
4456     }
4457     }
4458     function_tests++;
4459
4460     return(test_ret);
4461 }
4462
4463
4464 static int
4465 test_xmlSAX2GetPublicId(void) {
4466     int test_ret = 0;
4467
4468     int mem_base;
4469     const xmlChar * ret_val;
4470     void * ctx; /* the user data (XML parser context) */
4471     int n_ctx;
4472
4473     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4474         mem_base = xmlMemBlocks();
4475         ctx = gen_void_ptr(n_ctx, 0);
4476
4477         ret_val = xmlSAX2GetPublicId(ctx);
4478         desret_const_xmlChar_ptr(ret_val);
4479         call_tests++;
4480         des_void_ptr(n_ctx, ctx, 0);
4481         xmlResetLastError();
4482         if (mem_base != xmlMemBlocks()) {
4483             printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4484                    xmlMemBlocks() - mem_base);
4485             test_ret++;
4486             printf(" %d", n_ctx);
4487             printf("\n");
4488         }
4489     }
4490     function_tests++;
4491
4492     return(test_ret);
4493 }
4494
4495
4496 static int
4497 test_xmlSAX2GetSystemId(void) {
4498     int test_ret = 0;
4499
4500     int mem_base;
4501     const xmlChar * ret_val;
4502     void * ctx; /* the user data (XML parser context) */
4503     int n_ctx;
4504
4505     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4506         mem_base = xmlMemBlocks();
4507         ctx = gen_void_ptr(n_ctx, 0);
4508
4509         ret_val = xmlSAX2GetSystemId(ctx);
4510         desret_const_xmlChar_ptr(ret_val);
4511         call_tests++;
4512         des_void_ptr(n_ctx, ctx, 0);
4513         xmlResetLastError();
4514         if (mem_base != xmlMemBlocks()) {
4515             printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4516                    xmlMemBlocks() - mem_base);
4517             test_ret++;
4518             printf(" %d", n_ctx);
4519             printf("\n");
4520         }
4521     }
4522     function_tests++;
4523
4524     return(test_ret);
4525 }
4526
4527
4528 static int
4529 test_xmlSAX2HasExternalSubset(void) {
4530     int test_ret = 0;
4531
4532     int mem_base;
4533     int ret_val;
4534     void * ctx; /* the user data (XML parser context) */
4535     int n_ctx;
4536
4537     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4538         mem_base = xmlMemBlocks();
4539         ctx = gen_void_ptr(n_ctx, 0);
4540
4541         ret_val = xmlSAX2HasExternalSubset(ctx);
4542         desret_int(ret_val);
4543         call_tests++;
4544         des_void_ptr(n_ctx, ctx, 0);
4545         xmlResetLastError();
4546         if (mem_base != xmlMemBlocks()) {
4547             printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4548                    xmlMemBlocks() - mem_base);
4549             test_ret++;
4550             printf(" %d", n_ctx);
4551             printf("\n");
4552         }
4553     }
4554     function_tests++;
4555
4556     return(test_ret);
4557 }
4558
4559
4560 static int
4561 test_xmlSAX2HasInternalSubset(void) {
4562     int test_ret = 0;
4563
4564     int mem_base;
4565     int ret_val;
4566     void * ctx; /* the user data (XML parser context) */
4567     int n_ctx;
4568
4569     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4570         mem_base = xmlMemBlocks();
4571         ctx = gen_void_ptr(n_ctx, 0);
4572
4573         ret_val = xmlSAX2HasInternalSubset(ctx);
4574         desret_int(ret_val);
4575         call_tests++;
4576         des_void_ptr(n_ctx, ctx, 0);
4577         xmlResetLastError();
4578         if (mem_base != xmlMemBlocks()) {
4579             printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4580                    xmlMemBlocks() - mem_base);
4581             test_ret++;
4582             printf(" %d", n_ctx);
4583             printf("\n");
4584         }
4585     }
4586     function_tests++;
4587
4588     return(test_ret);
4589 }
4590
4591
4592 static int
4593 test_xmlSAX2IgnorableWhitespace(void) {
4594     int test_ret = 0;
4595
4596     int mem_base;
4597     void * ctx; /* the user data (XML parser context) */
4598     int n_ctx;
4599     xmlChar * ch; /* a xmlChar string */
4600     int n_ch;
4601     int len; /* the number of xmlChar */
4602     int n_len;
4603
4604     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4605     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4606     for (n_len = 0;n_len < gen_nb_int;n_len++) {
4607         mem_base = xmlMemBlocks();
4608         ctx = gen_void_ptr(n_ctx, 0);
4609         ch = gen_const_xmlChar_ptr(n_ch, 1);
4610         len = gen_int(n_len, 2);
4611
4612         xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4613         call_tests++;
4614         des_void_ptr(n_ctx, ctx, 0);
4615         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4616         des_int(n_len, len, 2);
4617         xmlResetLastError();
4618         if (mem_base != xmlMemBlocks()) {
4619             printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4620                    xmlMemBlocks() - mem_base);
4621             test_ret++;
4622             printf(" %d", n_ctx);
4623             printf(" %d", n_ch);
4624             printf(" %d", n_len);
4625             printf("\n");
4626         }
4627     }
4628     }
4629     }
4630     function_tests++;
4631
4632     return(test_ret);
4633 }
4634
4635
4636 #define gen_nb_xmlSAXHandler_ptr 1
4637 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4638     return(NULL);
4639 }
4640 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4641 }
4642
4643 static int
4644 test_xmlSAX2InitDefaultSAXHandler(void) {
4645     int test_ret = 0;
4646
4647     int mem_base;
4648     xmlSAXHandler * hdlr; /* the SAX handler */
4649     int n_hdlr;
4650     int warning; /* flag if non-zero sets the handler warning procedure */
4651     int n_warning;
4652
4653     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4654     for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4655         mem_base = xmlMemBlocks();
4656         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4657         warning = gen_int(n_warning, 1);
4658
4659         xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4660         call_tests++;
4661         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4662         des_int(n_warning, warning, 1);
4663         xmlResetLastError();
4664         if (mem_base != xmlMemBlocks()) {
4665             printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4666                    xmlMemBlocks() - mem_base);
4667             test_ret++;
4668             printf(" %d", n_hdlr);
4669             printf(" %d", n_warning);
4670             printf("\n");
4671         }
4672     }
4673     }
4674     function_tests++;
4675
4676     return(test_ret);
4677 }
4678
4679
4680 static int
4681 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4682     int test_ret = 0;
4683
4684 #if defined(LIBXML_DOCB_ENABLED)
4685     int mem_base;
4686     xmlSAXHandler * hdlr; /* the SAX handler */
4687     int n_hdlr;
4688
4689     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4690         mem_base = xmlMemBlocks();
4691         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4692
4693         xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4694         call_tests++;
4695         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4696         xmlResetLastError();
4697         if (mem_base != xmlMemBlocks()) {
4698             printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4699                    xmlMemBlocks() - mem_base);
4700             test_ret++;
4701             printf(" %d", n_hdlr);
4702             printf("\n");
4703         }
4704     }
4705     function_tests++;
4706 #endif
4707
4708     return(test_ret);
4709 }
4710
4711
4712 static int
4713 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4714     int test_ret = 0;
4715
4716 #if defined(LIBXML_HTML_ENABLED)
4717     int mem_base;
4718     xmlSAXHandler * hdlr; /* the SAX handler */
4719     int n_hdlr;
4720
4721     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4722         mem_base = xmlMemBlocks();
4723         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4724
4725         xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4726         call_tests++;
4727         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4728         xmlResetLastError();
4729         if (mem_base != xmlMemBlocks()) {
4730             printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4731                    xmlMemBlocks() - mem_base);
4732             test_ret++;
4733             printf(" %d", n_hdlr);
4734             printf("\n");
4735         }
4736     }
4737     function_tests++;
4738 #endif
4739
4740     return(test_ret);
4741 }
4742
4743
4744 static int
4745 test_xmlSAX2InternalSubset(void) {
4746     int test_ret = 0;
4747
4748     int mem_base;
4749     void * ctx; /* the user data (XML parser context) */
4750     int n_ctx;
4751     xmlChar * name; /* the root element name */
4752     int n_name;
4753     xmlChar * ExternalID; /* the external ID */
4754     int n_ExternalID;
4755     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4756     int n_SystemID;
4757
4758     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4759     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4760     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4761     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4762         mem_base = xmlMemBlocks();
4763         ctx = gen_void_ptr(n_ctx, 0);
4764         name = gen_const_xmlChar_ptr(n_name, 1);
4765         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4766         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4767
4768         xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4769         call_tests++;
4770         des_void_ptr(n_ctx, ctx, 0);
4771         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4772         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4773         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4774         xmlResetLastError();
4775         if (mem_base != xmlMemBlocks()) {
4776             printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4777                    xmlMemBlocks() - mem_base);
4778             test_ret++;
4779             printf(" %d", n_ctx);
4780             printf(" %d", n_name);
4781             printf(" %d", n_ExternalID);
4782             printf(" %d", n_SystemID);
4783             printf("\n");
4784         }
4785     }
4786     }
4787     }
4788     }
4789     function_tests++;
4790
4791     return(test_ret);
4792 }
4793
4794
4795 static int
4796 test_xmlSAX2IsStandalone(void) {
4797     int test_ret = 0;
4798
4799     int mem_base;
4800     int ret_val;
4801     void * ctx; /* the user data (XML parser context) */
4802     int n_ctx;
4803
4804     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4805         mem_base = xmlMemBlocks();
4806         ctx = gen_void_ptr(n_ctx, 0);
4807
4808         ret_val = xmlSAX2IsStandalone(ctx);
4809         desret_int(ret_val);
4810         call_tests++;
4811         des_void_ptr(n_ctx, ctx, 0);
4812         xmlResetLastError();
4813         if (mem_base != xmlMemBlocks()) {
4814             printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4815                    xmlMemBlocks() - mem_base);
4816             test_ret++;
4817             printf(" %d", n_ctx);
4818             printf("\n");
4819         }
4820     }
4821     function_tests++;
4822
4823     return(test_ret);
4824 }
4825
4826
4827 static int
4828 test_xmlSAX2NotationDecl(void) {
4829     int test_ret = 0;
4830
4831     int mem_base;
4832     void * ctx; /* the user data (XML parser context) */
4833     int n_ctx;
4834     xmlChar * name; /* The name of the notation */
4835     int n_name;
4836     xmlChar * publicId; /* The public ID of the entity */
4837     int n_publicId;
4838     xmlChar * systemId; /* The system ID of the entity */
4839     int n_systemId;
4840
4841     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4842     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4843     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4844     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4845         mem_base = xmlMemBlocks();
4846         ctx = gen_void_ptr(n_ctx, 0);
4847         name = gen_const_xmlChar_ptr(n_name, 1);
4848         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4849         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4850
4851         xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4852         call_tests++;
4853         des_void_ptr(n_ctx, ctx, 0);
4854         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4855         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4856         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4857         xmlResetLastError();
4858         if (mem_base != xmlMemBlocks()) {
4859             printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4860                    xmlMemBlocks() - mem_base);
4861             test_ret++;
4862             printf(" %d", n_ctx);
4863             printf(" %d", n_name);
4864             printf(" %d", n_publicId);
4865             printf(" %d", n_systemId);
4866             printf("\n");
4867         }
4868     }
4869     }
4870     }
4871     }
4872     function_tests++;
4873
4874     return(test_ret);
4875 }
4876
4877
4878 static int
4879 test_xmlSAX2ProcessingInstruction(void) {
4880     int test_ret = 0;
4881
4882     int mem_base;
4883     void * ctx; /* the user data (XML parser context) */
4884     int n_ctx;
4885     xmlChar * target; /* the target name */
4886     int n_target;
4887     xmlChar * data; /* the PI data's */
4888     int n_data;
4889
4890     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4891     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4892     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4893         mem_base = xmlMemBlocks();
4894         ctx = gen_void_ptr(n_ctx, 0);
4895         target = gen_const_xmlChar_ptr(n_target, 1);
4896         data = gen_const_xmlChar_ptr(n_data, 2);
4897
4898         xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4899         call_tests++;
4900         des_void_ptr(n_ctx, ctx, 0);
4901         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4902         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4903         xmlResetLastError();
4904         if (mem_base != xmlMemBlocks()) {
4905             printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4906                    xmlMemBlocks() - mem_base);
4907             test_ret++;
4908             printf(" %d", n_ctx);
4909             printf(" %d", n_target);
4910             printf(" %d", n_data);
4911             printf("\n");
4912         }
4913     }
4914     }
4915     }
4916     function_tests++;
4917
4918     return(test_ret);
4919 }
4920
4921
4922 static int
4923 test_xmlSAX2Reference(void) {
4924     int test_ret = 0;
4925
4926     int mem_base;
4927     void * ctx; /* the user data (XML parser context) */
4928     int n_ctx;
4929     xmlChar * name; /* The entity name */
4930     int n_name;
4931
4932     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4933     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4934         mem_base = xmlMemBlocks();
4935         ctx = gen_void_ptr(n_ctx, 0);
4936         name = gen_const_xmlChar_ptr(n_name, 1);
4937
4938         xmlSAX2Reference(ctx, (const xmlChar *)name);
4939         call_tests++;
4940         des_void_ptr(n_ctx, ctx, 0);
4941         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4942         xmlResetLastError();
4943         if (mem_base != xmlMemBlocks()) {
4944             printf("Leak of %d blocks found in xmlSAX2Reference",
4945                    xmlMemBlocks() - mem_base);
4946             test_ret++;
4947             printf(" %d", n_ctx);
4948             printf(" %d", n_name);
4949             printf("\n");
4950         }
4951     }
4952     }
4953     function_tests++;
4954
4955     return(test_ret);
4956 }
4957
4958
4959 static int
4960 test_xmlSAX2ResolveEntity(void) {
4961     int test_ret = 0;
4962
4963     int mem_base;
4964     xmlParserInputPtr ret_val;
4965     void * ctx; /* the user data (XML parser context) */
4966     int n_ctx;
4967     xmlChar * publicId; /* The public ID of the entity */
4968     int n_publicId;
4969     xmlChar * systemId; /* The system ID of the entity */
4970     int n_systemId;
4971
4972     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4973     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4974     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4975         mem_base = xmlMemBlocks();
4976         ctx = gen_void_ptr(n_ctx, 0);
4977         publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4978         systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4979
4980         ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4981         desret_xmlParserInputPtr(ret_val);
4982         call_tests++;
4983         des_void_ptr(n_ctx, ctx, 0);
4984         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4985         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4986         xmlResetLastError();
4987         if (mem_base != xmlMemBlocks()) {
4988             printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4989                    xmlMemBlocks() - mem_base);
4990             test_ret++;
4991             printf(" %d", n_ctx);
4992             printf(" %d", n_publicId);
4993             printf(" %d", n_systemId);
4994             printf("\n");
4995         }
4996     }
4997     }
4998     }
4999     function_tests++;
5000
5001     return(test_ret);
5002 }
5003
5004
5005 #define gen_nb_xmlSAXLocatorPtr 1
5006 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5007     return(NULL);
5008 }
5009 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5010 }
5011
5012 static int
5013 test_xmlSAX2SetDocumentLocator(void) {
5014     int test_ret = 0;
5015
5016     int mem_base;
5017     void * ctx; /* the user data (XML parser context) */
5018     int n_ctx;
5019     xmlSAXLocatorPtr loc; /* A SAX Locator */
5020     int n_loc;
5021
5022     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5023     for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
5024         mem_base = xmlMemBlocks();
5025         ctx = gen_void_ptr(n_ctx, 0);
5026         loc = gen_xmlSAXLocatorPtr(n_loc, 1);
5027
5028         xmlSAX2SetDocumentLocator(ctx, loc);
5029         call_tests++;
5030         des_void_ptr(n_ctx, ctx, 0);
5031         des_xmlSAXLocatorPtr(n_loc, loc, 1);
5032         xmlResetLastError();
5033         if (mem_base != xmlMemBlocks()) {
5034             printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
5035                    xmlMemBlocks() - mem_base);
5036             test_ret++;
5037             printf(" %d", n_ctx);
5038             printf(" %d", n_loc);
5039             printf("\n");
5040         }
5041     }
5042     }
5043     function_tests++;
5044
5045     return(test_ret);
5046 }
5047
5048
5049 static int
5050 test_xmlSAX2StartDocument(void) {
5051     int test_ret = 0;
5052
5053     int mem_base;
5054     void * ctx; /* the user data (XML parser context) */
5055     int n_ctx;
5056
5057     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5058         mem_base = xmlMemBlocks();
5059         ctx = gen_void_ptr(n_ctx, 0);
5060
5061         xmlSAX2StartDocument(ctx);
5062         call_tests++;
5063         des_void_ptr(n_ctx, ctx, 0);
5064         xmlResetLastError();
5065         if (mem_base != xmlMemBlocks()) {
5066             printf("Leak of %d blocks found in xmlSAX2StartDocument",
5067                    xmlMemBlocks() - mem_base);
5068             test_ret++;
5069             printf(" %d", n_ctx);
5070             printf("\n");
5071         }
5072     }
5073     function_tests++;
5074
5075     return(test_ret);
5076 }
5077
5078
5079 static int
5080 test_xmlSAX2StartElement(void) {
5081     int test_ret = 0;
5082
5083 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
5084 #ifdef LIBXML_SAX1_ENABLED
5085     int mem_base;
5086     void * ctx; /* the user data (XML parser context) */
5087     int n_ctx;
5088     xmlChar * fullname; /* The element name, including namespace prefix */
5089     int n_fullname;
5090     xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5091     int n_atts;
5092
5093     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5094     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5095     for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5096         mem_base = xmlMemBlocks();
5097         ctx = gen_void_ptr(n_ctx, 0);
5098         fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5099         atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5100
5101         xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5102         call_tests++;
5103         des_void_ptr(n_ctx, ctx, 0);
5104         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5105         des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5106         xmlResetLastError();
5107         if (mem_base != xmlMemBlocks()) {
5108             printf("Leak of %d blocks found in xmlSAX2StartElement",
5109                    xmlMemBlocks() - mem_base);
5110             test_ret++;
5111             printf(" %d", n_ctx);
5112             printf(" %d", n_fullname);
5113             printf(" %d", n_atts);
5114             printf("\n");
5115         }
5116     }
5117     }
5118     }
5119     function_tests++;
5120 #endif
5121 #endif
5122
5123     return(test_ret);
5124 }
5125
5126
5127 static int
5128 test_xmlSAX2StartElementNs(void) {
5129     int test_ret = 0;
5130
5131     int mem_base;
5132     void * ctx; /* the user data (XML parser context) */
5133     int n_ctx;
5134     xmlChar * localname; /* the local name of the element */
5135     int n_localname;
5136     xmlChar * prefix; /* the element namespace prefix if available */
5137     int n_prefix;
5138     xmlChar * URI; /* the element namespace name if available */
5139     int n_URI;
5140     int nb_namespaces; /* number of namespace definitions on that node */
5141     int n_nb_namespaces;
5142     xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5143     int n_namespaces;
5144     int nb_attributes; /* the number of attributes on that node */
5145     int n_nb_attributes;
5146     int nb_defaulted; /* the number of defaulted attributes. */
5147     int n_nb_defaulted;
5148     xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5149     int n_attributes;
5150
5151     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5152     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5153     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5154     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5155     for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5156     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5157     for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5158     for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5159     for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5160         mem_base = xmlMemBlocks();
5161         ctx = gen_void_ptr(n_ctx, 0);
5162         localname = gen_const_xmlChar_ptr(n_localname, 1);
5163         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5164         URI = gen_const_xmlChar_ptr(n_URI, 3);
5165         nb_namespaces = gen_int(n_nb_namespaces, 4);
5166         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5167         nb_attributes = gen_int(n_nb_attributes, 6);
5168         nb_defaulted = gen_int(n_nb_defaulted, 7);
5169         attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5170
5171         xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5172         call_tests++;
5173         des_void_ptr(n_ctx, ctx, 0);
5174         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5175         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5176         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5177         des_int(n_nb_namespaces, nb_namespaces, 4);
5178         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5179         des_int(n_nb_attributes, nb_attributes, 6);
5180         des_int(n_nb_defaulted, nb_defaulted, 7);
5181         des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5182         xmlResetLastError();
5183         if (mem_base != xmlMemBlocks()) {
5184             printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5185                    xmlMemBlocks() - mem_base);
5186             test_ret++;
5187             printf(" %d", n_ctx);
5188             printf(" %d", n_localname);
5189             printf(" %d", n_prefix);
5190             printf(" %d", n_URI);
5191             printf(" %d", n_nb_namespaces);
5192             printf(" %d", n_namespaces);
5193             printf(" %d", n_nb_attributes);
5194             printf(" %d", n_nb_defaulted);
5195             printf(" %d", n_attributes);
5196             printf("\n");
5197         }
5198     }
5199     }
5200     }
5201     }
5202     }
5203     }
5204     }
5205     }
5206     }
5207     function_tests++;
5208
5209     return(test_ret);
5210 }
5211
5212
5213 static int
5214 test_xmlSAX2UnparsedEntityDecl(void) {
5215     int test_ret = 0;
5216
5217     int mem_base;
5218     void * ctx; /* the user data (XML parser context) */
5219     int n_ctx;
5220     xmlChar * name; /* The name of the entity */
5221     int n_name;
5222     xmlChar * publicId; /* The public ID of the entity */
5223     int n_publicId;
5224     xmlChar * systemId; /* The system ID of the entity */
5225     int n_systemId;
5226     xmlChar * notationName; /* the name of the notation */
5227     int n_notationName;
5228
5229     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5230     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5231     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5232     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5233     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5234         mem_base = xmlMemBlocks();
5235         ctx = gen_void_ptr(n_ctx, 0);
5236         name = gen_const_xmlChar_ptr(n_name, 1);
5237         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5238         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5239         notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5240
5241         xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5242         call_tests++;
5243         des_void_ptr(n_ctx, ctx, 0);
5244         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5245         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5246         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5247         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5248         xmlResetLastError();
5249         if (mem_base != xmlMemBlocks()) {
5250             printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5251                    xmlMemBlocks() - mem_base);
5252             test_ret++;
5253             printf(" %d", n_ctx);
5254             printf(" %d", n_name);
5255             printf(" %d", n_publicId);
5256             printf(" %d", n_systemId);
5257             printf(" %d", n_notationName);
5258             printf("\n");
5259         }
5260     }
5261     }
5262     }
5263     }
5264     }
5265     function_tests++;
5266
5267     return(test_ret);
5268 }
5269
5270
5271 static int
5272 test_xmlSAXDefaultVersion(void) {
5273     int test_ret = 0;
5274
5275 #if defined(LIBXML_SAX1_ENABLED)
5276 #ifdef LIBXML_SAX1_ENABLED
5277     int mem_base;
5278     int ret_val;
5279     int version; /* the version, 1 or 2 */
5280     int n_version;
5281
5282     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5283         mem_base = xmlMemBlocks();
5284         version = gen_int(n_version, 0);
5285
5286         ret_val = xmlSAXDefaultVersion(version);
5287         desret_int(ret_val);
5288         call_tests++;
5289         des_int(n_version, version, 0);
5290         xmlResetLastError();
5291         if (mem_base != xmlMemBlocks()) {
5292             printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5293                    xmlMemBlocks() - mem_base);
5294             test_ret++;
5295             printf(" %d", n_version);
5296             printf("\n");
5297         }
5298     }
5299     function_tests++;
5300 #endif
5301 #endif
5302
5303     return(test_ret);
5304 }
5305
5306
5307 static int
5308 test_xmlSAXVersion(void) {
5309     int test_ret = 0;
5310
5311     int mem_base;
5312     int ret_val;
5313     xmlSAXHandler * hdlr; /* the SAX handler */
5314     int n_hdlr;
5315     int version; /* the version, 1 or 2 */
5316     int n_version;
5317
5318     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5319     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5320         mem_base = xmlMemBlocks();
5321         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5322         version = gen_int(n_version, 1);
5323
5324         ret_val = xmlSAXVersion(hdlr, version);
5325         desret_int(ret_val);
5326         call_tests++;
5327         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5328         des_int(n_version, version, 1);
5329         xmlResetLastError();
5330         if (mem_base != xmlMemBlocks()) {
5331             printf("Leak of %d blocks found in xmlSAXVersion",
5332                    xmlMemBlocks() - mem_base);
5333             test_ret++;
5334             printf(" %d", n_hdlr);
5335             printf(" %d", n_version);
5336             printf("\n");
5337         }
5338     }
5339     }
5340     function_tests++;
5341
5342     return(test_ret);
5343 }
5344
5345 static int
5346 test_SAX2(void) {
5347     int test_ret = 0;
5348         int rc = 0;
5349
5350     if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5351     rc = test_docbDefaultSAXHandlerInit();
5352         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5353     rc = test_htmlDefaultSAXHandlerInit();
5354         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5355     rc = test_xmlDefaultSAXHandlerInit();
5356         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5357     rc = test_xmlSAX2AttributeDecl();
5358         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5359     rc = test_xmlSAX2CDataBlock();
5360         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5361     rc = test_xmlSAX2Characters();
5362         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5363     rc = test_xmlSAX2Comment();
5364         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5365     rc = test_xmlSAX2ElementDecl();
5366         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5367     rc = test_xmlSAX2EndDocument();
5368         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5369     rc = test_xmlSAX2EndElement();
5370         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5371     rc = test_xmlSAX2EndElementNs();
5372         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5373     rc = test_xmlSAX2EntityDecl();
5374         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5375     rc = test_xmlSAX2ExternalSubset();
5376         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5377     rc = test_xmlSAX2GetColumnNumber();
5378         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5379     rc = test_xmlSAX2GetEntity();
5380         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5381     rc = test_xmlSAX2GetLineNumber();
5382         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5383     rc = test_xmlSAX2GetParameterEntity();
5384         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5385     rc = test_xmlSAX2GetPublicId();
5386         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5387     rc = test_xmlSAX2GetSystemId();
5388         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5389     rc = test_xmlSAX2HasExternalSubset();
5390         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5391     rc = test_xmlSAX2HasInternalSubset();
5392         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5393     rc = test_xmlSAX2IgnorableWhitespace();
5394         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5395     rc = test_xmlSAX2InitDefaultSAXHandler();
5396         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5397     rc = test_xmlSAX2InitDocbDefaultSAXHandler();
5398         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5399     rc = test_xmlSAX2InitHtmlDefaultSAXHandler();
5400         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5401     rc = test_xmlSAX2InternalSubset();
5402         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5403     rc = test_xmlSAX2IsStandalone();
5404         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5405     rc = test_xmlSAX2NotationDecl();
5406         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5407     rc = test_xmlSAX2ProcessingInstruction();
5408         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5409     rc = test_xmlSAX2Reference();
5410         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5411     rc = test_xmlSAX2ResolveEntity();
5412         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5413     rc = test_xmlSAX2SetDocumentLocator();
5414         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5415     rc = test_xmlSAX2StartDocument();
5416         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5417     rc = test_xmlSAX2StartElement();
5418         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5419     rc = test_xmlSAX2StartElementNs();
5420         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5421     rc = test_xmlSAX2UnparsedEntityDecl();
5422         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5423     rc = test_xmlSAXDefaultVersion();
5424         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5425     rc = test_xmlSAXVersion();
5426
5427     if (test_ret != 0)
5428         printf("Module SAX2: %d errors\n", test_ret);
5429     return(test_ret);
5430 }
5431
5432 static int
5433 test_xmlC14NDocDumpMemory(void) {
5434     int test_ret = 0;
5435
5436 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5437     int mem_base;
5438     int ret_val;
5439     xmlDocPtr doc; /* the XML document for canonization */
5440     int n_doc;
5441     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5442     int n_nodes;
5443     int mode; /* the c14n mode (see @xmlC14NMode) */
5444     int n_mode;
5445     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) */
5446     int n_inclusive_ns_prefixes;
5447     int with_comments; /* include comments in the result (!=0) or not (==0) */
5448     int n_with_comments;
5449     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 */
5450     int n_doc_txt_ptr;
5451
5452     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5453     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5454     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5455     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5456     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5457     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5458         mem_base = xmlMemBlocks();
5459         doc = gen_xmlDocPtr(n_doc, 0);
5460         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5461         mode = gen_int(n_mode, 2);
5462         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5463         with_comments = gen_int(n_with_comments, 4);
5464         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5465
5466         ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5467         desret_int(ret_val);
5468         call_tests++;
5469         des_xmlDocPtr(n_doc, doc, 0);
5470         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5471         des_int(n_mode, mode, 2);
5472         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5473         des_int(n_with_comments, with_comments, 4);
5474         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5475         xmlResetLastError();
5476         if (mem_base != xmlMemBlocks()) {
5477             printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5478                    xmlMemBlocks() - mem_base);
5479             test_ret++;
5480             printf(" %d", n_doc);
5481             printf(" %d", n_nodes);
5482             printf(" %d", n_mode);
5483             printf(" %d", n_inclusive_ns_prefixes);
5484             printf(" %d", n_with_comments);
5485             printf(" %d", n_doc_txt_ptr);
5486             printf("\n");
5487         }
5488     }
5489     }
5490     }
5491     }
5492     }
5493     }
5494     function_tests++;
5495 #endif
5496
5497     return(test_ret);
5498 }
5499
5500
5501 static int
5502 test_xmlC14NDocSave(void) {
5503     int test_ret = 0;
5504
5505 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5506     int mem_base;
5507     int ret_val;
5508     xmlDocPtr doc; /* the XML document for canonization */
5509     int n_doc;
5510     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5511     int n_nodes;
5512     int mode; /* the c14n mode (see @xmlC14NMode) */
5513     int n_mode;
5514     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) */
5515     int n_inclusive_ns_prefixes;
5516     int with_comments; /* include comments in the result (!=0) or not (==0) */
5517     int n_with_comments;
5518     const char * filename; /* the filename to store canonical XML image */
5519     int n_filename;
5520     int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5521     int n_compression;
5522
5523     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5524     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5525     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5526     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5527     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5528     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5529     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5530         mem_base = xmlMemBlocks();
5531         doc = gen_xmlDocPtr(n_doc, 0);
5532         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5533         mode = gen_int(n_mode, 2);
5534         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5535         with_comments = gen_int(n_with_comments, 4);
5536         filename = gen_fileoutput(n_filename, 5);
5537         compression = gen_int(n_compression, 6);
5538
5539         ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5540         desret_int(ret_val);
5541         call_tests++;
5542         des_xmlDocPtr(n_doc, doc, 0);
5543         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5544         des_int(n_mode, mode, 2);
5545         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5546         des_int(n_with_comments, with_comments, 4);
5547         des_fileoutput(n_filename, filename, 5);
5548         des_int(n_compression, compression, 6);
5549         xmlResetLastError();
5550         if (mem_base != xmlMemBlocks()) {
5551             printf("Leak of %d blocks found in xmlC14NDocSave",
5552                    xmlMemBlocks() - mem_base);
5553             test_ret++;
5554             printf(" %d", n_doc);
5555             printf(" %d", n_nodes);
5556             printf(" %d", n_mode);
5557             printf(" %d", n_inclusive_ns_prefixes);
5558             printf(" %d", n_with_comments);
5559             printf(" %d", n_filename);
5560             printf(" %d", n_compression);
5561             printf("\n");
5562         }
5563     }
5564     }
5565     }
5566     }
5567     }
5568     }
5569     }
5570     function_tests++;
5571 #endif
5572
5573     return(test_ret);
5574 }
5575
5576
5577 static int
5578 test_xmlC14NDocSaveTo(void) {
5579     int test_ret = 0;
5580
5581 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5582     int mem_base;
5583     int ret_val;
5584     xmlDocPtr doc; /* the XML document for canonization */
5585     int n_doc;
5586     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5587     int n_nodes;
5588     int mode; /* the c14n mode (see @xmlC14NMode) */
5589     int n_mode;
5590     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) */
5591     int n_inclusive_ns_prefixes;
5592     int with_comments; /* include comments in the result (!=0) or not (==0) */
5593     int n_with_comments;
5594     xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5595     int n_buf;
5596
5597     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5598     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5599     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5600     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5601     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5602     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5603         mem_base = xmlMemBlocks();
5604         doc = gen_xmlDocPtr(n_doc, 0);
5605         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5606         mode = gen_int(n_mode, 2);
5607         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5608         with_comments = gen_int(n_with_comments, 4);
5609         buf = gen_xmlOutputBufferPtr(n_buf, 5);
5610
5611         ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5612         desret_int(ret_val);
5613         call_tests++;
5614         des_xmlDocPtr(n_doc, doc, 0);
5615         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5616         des_int(n_mode, mode, 2);
5617         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5618         des_int(n_with_comments, with_comments, 4);
5619         des_xmlOutputBufferPtr(n_buf, buf, 5);
5620         xmlResetLastError();
5621         if (mem_base != xmlMemBlocks()) {
5622             printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5623                    xmlMemBlocks() - mem_base);
5624             test_ret++;
5625             printf(" %d", n_doc);
5626             printf(" %d", n_nodes);
5627             printf(" %d", n_mode);
5628             printf(" %d", n_inclusive_ns_prefixes);
5629             printf(" %d", n_with_comments);
5630             printf(" %d", n_buf);
5631             printf("\n");
5632         }
5633     }
5634     }
5635     }
5636     }
5637     }
5638     }
5639     function_tests++;
5640 #endif
5641
5642     return(test_ret);
5643 }
5644
5645
5646 static int
5647 test_xmlC14NExecute(void) {
5648     int test_ret = 0;
5649
5650
5651     /* missing type support */
5652     return(test_ret);
5653 }
5654
5655 static int
5656 test_c14n(void) {
5657     int test_ret = 0;
5658         int rc = 0;
5659
5660     if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5661     rc = test_xmlC14NDocDumpMemory();
5662         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5663     rc = test_xmlC14NDocSave();
5664         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5665     rc = test_xmlC14NDocSaveTo();
5666         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5667     rc = test_xmlC14NExecute();
5668         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5669
5670     if (test_ret != 0)
5671         printf("Module c14n: %d errors\n", test_ret);
5672     return(test_ret);
5673 }
5674 #ifdef LIBXML_CATALOG_ENABLED
5675
5676 #define gen_nb_xmlCatalogPtr 1
5677 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5678     return(NULL);
5679 }
5680 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5681 }
5682 #endif
5683
5684
5685 static int
5686 test_xmlACatalogAdd(void) {
5687     int test_ret = 0;
5688
5689 #if defined(LIBXML_CATALOG_ENABLED)
5690     int mem_base;
5691     int ret_val;
5692     xmlCatalogPtr catal; /* a Catalog */
5693     int n_catal;
5694     xmlChar * type; /* the type of record to add to the catalog */
5695     int n_type;
5696     xmlChar * orig; /* the system, public or prefix to match */
5697     int n_orig;
5698     xmlChar * replace; /* the replacement value for the match */
5699     int n_replace;
5700
5701     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5702     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5703     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5704     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5705         mem_base = xmlMemBlocks();
5706         catal = gen_xmlCatalogPtr(n_catal, 0);
5707         type = gen_const_xmlChar_ptr(n_type, 1);
5708         orig = gen_const_xmlChar_ptr(n_orig, 2);
5709         replace = gen_const_xmlChar_ptr(n_replace, 3);
5710
5711         ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5712         desret_int(ret_val);
5713         call_tests++;
5714         des_xmlCatalogPtr(n_catal, catal, 0);
5715         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5716         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5717         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5718         xmlResetLastError();
5719         if (mem_base != xmlMemBlocks()) {
5720             printf("Leak of %d blocks found in xmlACatalogAdd",
5721                    xmlMemBlocks() - mem_base);
5722             test_ret++;
5723             printf(" %d", n_catal);
5724             printf(" %d", n_type);
5725             printf(" %d", n_orig);
5726             printf(" %d", n_replace);
5727             printf("\n");
5728         }
5729     }
5730     }
5731     }
5732     }
5733     function_tests++;
5734 #endif
5735
5736     return(test_ret);
5737 }
5738
5739
5740 static int
5741 test_xmlACatalogDump(void) {
5742     int test_ret = 0;
5743
5744 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5745     int mem_base;
5746     xmlCatalogPtr catal; /* a Catalog */
5747     int n_catal;
5748     FILE * out; /* the file. */
5749     int n_out;
5750
5751     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5752     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5753         mem_base = xmlMemBlocks();
5754         catal = gen_xmlCatalogPtr(n_catal, 0);
5755         out = gen_FILE_ptr(n_out, 1);
5756
5757         xmlACatalogDump(catal, out);
5758         call_tests++;
5759         des_xmlCatalogPtr(n_catal, catal, 0);
5760         des_FILE_ptr(n_out, out, 1);
5761         xmlResetLastError();
5762         if (mem_base != xmlMemBlocks()) {
5763             printf("Leak of %d blocks found in xmlACatalogDump",
5764                    xmlMemBlocks() - mem_base);
5765             test_ret++;
5766             printf(" %d", n_catal);
5767             printf(" %d", n_out);
5768             printf("\n");
5769         }
5770     }
5771     }
5772     function_tests++;
5773 #endif
5774
5775     return(test_ret);
5776 }
5777
5778
5779 static int
5780 test_xmlACatalogRemove(void) {
5781     int test_ret = 0;
5782
5783 #if defined(LIBXML_CATALOG_ENABLED)
5784     int mem_base;
5785     int ret_val;
5786     xmlCatalogPtr catal; /* a Catalog */
5787     int n_catal;
5788     xmlChar * value; /* the value to remove */
5789     int n_value;
5790
5791     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5792     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5793         mem_base = xmlMemBlocks();
5794         catal = gen_xmlCatalogPtr(n_catal, 0);
5795         value = gen_const_xmlChar_ptr(n_value, 1);
5796
5797         ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5798         desret_int(ret_val);
5799         call_tests++;
5800         des_xmlCatalogPtr(n_catal, catal, 0);
5801         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5802         xmlResetLastError();
5803         if (mem_base != xmlMemBlocks()) {
5804             printf("Leak of %d blocks found in xmlACatalogRemove",
5805                    xmlMemBlocks() - mem_base);
5806             test_ret++;
5807             printf(" %d", n_catal);
5808             printf(" %d", n_value);
5809             printf("\n");
5810         }
5811     }
5812     }
5813     function_tests++;
5814 #endif
5815
5816     return(test_ret);
5817 }
5818
5819
5820 static int
5821 test_xmlACatalogResolve(void) {
5822     int test_ret = 0;
5823
5824 #if defined(LIBXML_CATALOG_ENABLED)
5825     int mem_base;
5826     xmlChar * ret_val;
5827     xmlCatalogPtr catal; /* a Catalog */
5828     int n_catal;
5829     xmlChar * pubID; /* the public ID string */
5830     int n_pubID;
5831     xmlChar * sysID; /* the system ID string */
5832     int n_sysID;
5833
5834     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5835     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5836     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5837         mem_base = xmlMemBlocks();
5838         catal = gen_xmlCatalogPtr(n_catal, 0);
5839         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5840         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5841
5842         ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5843         desret_xmlChar_ptr(ret_val);
5844         call_tests++;
5845         des_xmlCatalogPtr(n_catal, catal, 0);
5846         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5847         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5848         xmlResetLastError();
5849         if (mem_base != xmlMemBlocks()) {
5850             printf("Leak of %d blocks found in xmlACatalogResolve",
5851                    xmlMemBlocks() - mem_base);
5852             test_ret++;
5853             printf(" %d", n_catal);
5854             printf(" %d", n_pubID);
5855             printf(" %d", n_sysID);
5856             printf("\n");
5857         }
5858     }
5859     }
5860     }
5861     function_tests++;
5862 #endif
5863
5864     return(test_ret);
5865 }
5866
5867
5868 static int
5869 test_xmlACatalogResolvePublic(void) {
5870     int test_ret = 0;
5871
5872 #if defined(LIBXML_CATALOG_ENABLED)
5873     int mem_base;
5874     xmlChar * ret_val;
5875     xmlCatalogPtr catal; /* a Catalog */
5876     int n_catal;
5877     xmlChar * pubID; /* the public ID string */
5878     int n_pubID;
5879
5880     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5881     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5882         mem_base = xmlMemBlocks();
5883         catal = gen_xmlCatalogPtr(n_catal, 0);
5884         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5885
5886         ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5887         desret_xmlChar_ptr(ret_val);
5888         call_tests++;
5889         des_xmlCatalogPtr(n_catal, catal, 0);
5890         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5891         xmlResetLastError();
5892         if (mem_base != xmlMemBlocks()) {
5893             printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5894                    xmlMemBlocks() - mem_base);
5895             test_ret++;
5896             printf(" %d", n_catal);
5897             printf(" %d", n_pubID);
5898             printf("\n");
5899         }
5900     }
5901     }
5902     function_tests++;
5903 #endif
5904
5905     return(test_ret);
5906 }
5907
5908
5909 static int
5910 test_xmlACatalogResolveSystem(void) {
5911     int test_ret = 0;
5912
5913 #if defined(LIBXML_CATALOG_ENABLED)
5914     int mem_base;
5915     xmlChar * ret_val;
5916     xmlCatalogPtr catal; /* a Catalog */
5917     int n_catal;
5918     xmlChar * sysID; /* the system ID string */
5919     int n_sysID;
5920
5921     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5922     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5923         mem_base = xmlMemBlocks();
5924         catal = gen_xmlCatalogPtr(n_catal, 0);
5925         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5926
5927         ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5928         desret_xmlChar_ptr(ret_val);
5929         call_tests++;
5930         des_xmlCatalogPtr(n_catal, catal, 0);
5931         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5932         xmlResetLastError();
5933         if (mem_base != xmlMemBlocks()) {
5934             printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5935                    xmlMemBlocks() - mem_base);
5936             test_ret++;
5937             printf(" %d", n_catal);
5938             printf(" %d", n_sysID);
5939             printf("\n");
5940         }
5941     }
5942     }
5943     function_tests++;
5944 #endif
5945
5946     return(test_ret);
5947 }
5948
5949
5950 static int
5951 test_xmlACatalogResolveURI(void) {
5952     int test_ret = 0;
5953
5954 #if defined(LIBXML_CATALOG_ENABLED)
5955     int mem_base;
5956     xmlChar * ret_val;
5957     xmlCatalogPtr catal; /* a Catalog */
5958     int n_catal;
5959     xmlChar * URI; /* the URI */
5960     int n_URI;
5961
5962     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5963     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5964         mem_base = xmlMemBlocks();
5965         catal = gen_xmlCatalogPtr(n_catal, 0);
5966         URI = gen_const_xmlChar_ptr(n_URI, 1);
5967
5968         ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5969         desret_xmlChar_ptr(ret_val);
5970         call_tests++;
5971         des_xmlCatalogPtr(n_catal, catal, 0);
5972         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5973         xmlResetLastError();
5974         if (mem_base != xmlMemBlocks()) {
5975             printf("Leak of %d blocks found in xmlACatalogResolveURI",
5976                    xmlMemBlocks() - mem_base);
5977             test_ret++;
5978             printf(" %d", n_catal);
5979             printf(" %d", n_URI);
5980             printf("\n");
5981         }
5982     }
5983     }
5984     function_tests++;
5985 #endif
5986
5987     return(test_ret);
5988 }
5989
5990
5991 static int
5992 test_xmlCatalogAdd(void) {
5993     int test_ret = 0;
5994
5995 #if defined(LIBXML_CATALOG_ENABLED)
5996     int mem_base;
5997     int ret_val;
5998     xmlChar * type; /* the type of record to add to the catalog */
5999     int n_type;
6000     xmlChar * orig; /* the system, public or prefix to match */
6001     int n_orig;
6002     xmlChar * replace; /* the replacement value for the match */
6003     int n_replace;
6004
6005     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
6006     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
6007     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
6008         mem_base = xmlMemBlocks();
6009         type = gen_const_xmlChar_ptr(n_type, 0);
6010         orig = gen_const_xmlChar_ptr(n_orig, 1);
6011         replace = gen_const_xmlChar_ptr(n_replace, 2);
6012
6013         ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
6014         desret_int(ret_val);
6015         call_tests++;
6016         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
6017         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
6018         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
6019         xmlResetLastError();
6020         if (mem_base != xmlMemBlocks()) {
6021             printf("Leak of %d blocks found in xmlCatalogAdd",
6022                    xmlMemBlocks() - mem_base);
6023             test_ret++;
6024             printf(" %d", n_type);
6025             printf(" %d", n_orig);
6026             printf(" %d", n_replace);
6027             printf("\n");
6028         }
6029     }
6030     }
6031     }
6032     function_tests++;
6033 #endif
6034
6035     return(test_ret);
6036 }
6037
6038
6039 static int
6040 test_xmlCatalogCleanup(void) {
6041     int test_ret = 0;
6042
6043 #if defined(LIBXML_CATALOG_ENABLED)
6044
6045
6046         xmlCatalogCleanup();
6047         call_tests++;
6048         xmlResetLastError();
6049     function_tests++;
6050 #endif
6051
6052     return(test_ret);
6053 }
6054
6055
6056 static int
6057 test_xmlCatalogConvert(void) {
6058     int test_ret = 0;
6059
6060 #if defined(LIBXML_CATALOG_ENABLED)
6061     int ret_val;
6062
6063
6064         ret_val = xmlCatalogConvert();
6065         desret_int(ret_val);
6066         call_tests++;
6067         xmlResetLastError();
6068     function_tests++;
6069 #endif
6070
6071     return(test_ret);
6072 }
6073
6074
6075 static int
6076 test_xmlCatalogDump(void) {
6077     int test_ret = 0;
6078
6079 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
6080     int mem_base;
6081     FILE * out; /* the file. */
6082     int n_out;
6083
6084     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
6085         mem_base = xmlMemBlocks();
6086         out = gen_FILE_ptr(n_out, 0);
6087
6088         xmlCatalogDump(out);
6089         call_tests++;
6090         des_FILE_ptr(n_out, out, 0);
6091         xmlResetLastError();
6092         if (mem_base != xmlMemBlocks()) {
6093             printf("Leak of %d blocks found in xmlCatalogDump",
6094                    xmlMemBlocks() - mem_base);
6095             test_ret++;
6096             printf(" %d", n_out);
6097             printf("\n");
6098         }
6099     }
6100     function_tests++;
6101 #endif
6102
6103     return(test_ret);
6104 }
6105
6106
6107 static int
6108 test_xmlCatalogGetDefaults(void) {
6109     int test_ret = 0;
6110
6111 #if defined(LIBXML_CATALOG_ENABLED)
6112     int mem_base;
6113     xmlCatalogAllow ret_val;
6114
6115         mem_base = xmlMemBlocks();
6116
6117         ret_val = xmlCatalogGetDefaults();
6118         desret_xmlCatalogAllow(ret_val);
6119         call_tests++;
6120         xmlResetLastError();
6121         if (mem_base != xmlMemBlocks()) {
6122             printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6123                    xmlMemBlocks() - mem_base);
6124             test_ret++;
6125             printf("\n");
6126         }
6127     function_tests++;
6128 #endif
6129
6130     return(test_ret);
6131 }
6132
6133
6134 static int
6135 test_xmlCatalogIsEmpty(void) {
6136     int test_ret = 0;
6137
6138 #if defined(LIBXML_CATALOG_ENABLED)
6139     int mem_base;
6140     int ret_val;
6141     xmlCatalogPtr catal; /* should this create an SGML catalog */
6142     int n_catal;
6143
6144     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6145         mem_base = xmlMemBlocks();
6146         catal = gen_xmlCatalogPtr(n_catal, 0);
6147
6148         ret_val = xmlCatalogIsEmpty(catal);
6149         desret_int(ret_val);
6150         call_tests++;
6151         des_xmlCatalogPtr(n_catal, catal, 0);
6152         xmlResetLastError();
6153         if (mem_base != xmlMemBlocks()) {
6154             printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6155                    xmlMemBlocks() - mem_base);
6156             test_ret++;
6157             printf(" %d", n_catal);
6158             printf("\n");
6159         }
6160     }
6161     function_tests++;
6162 #endif
6163
6164     return(test_ret);
6165 }
6166
6167
6168 static int
6169 test_xmlCatalogLocalResolve(void) {
6170     int test_ret = 0;
6171
6172 #if defined(LIBXML_CATALOG_ENABLED)
6173     int mem_base;
6174     xmlChar * ret_val;
6175     void * catalogs; /* a document's list of catalogs */
6176     int n_catalogs;
6177     xmlChar * pubID; /* the public ID string */
6178     int n_pubID;
6179     xmlChar * sysID; /* the system ID string */
6180     int n_sysID;
6181
6182     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6183     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6184     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6185         mem_base = xmlMemBlocks();
6186         catalogs = gen_void_ptr(n_catalogs, 0);
6187         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6188         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6189
6190         ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6191         desret_xmlChar_ptr(ret_val);
6192         call_tests++;
6193         des_void_ptr(n_catalogs, catalogs, 0);
6194         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6195         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6196         xmlResetLastError();
6197         if (mem_base != xmlMemBlocks()) {
6198             printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6199                    xmlMemBlocks() - mem_base);
6200             test_ret++;
6201             printf(" %d", n_catalogs);
6202             printf(" %d", n_pubID);
6203             printf(" %d", n_sysID);
6204             printf("\n");
6205         }
6206     }
6207     }
6208     }
6209     function_tests++;
6210 #endif
6211
6212     return(test_ret);
6213 }
6214
6215
6216 static int
6217 test_xmlCatalogLocalResolveURI(void) {
6218     int test_ret = 0;
6219
6220 #if defined(LIBXML_CATALOG_ENABLED)
6221     int mem_base;
6222     xmlChar * ret_val;
6223     void * catalogs; /* a document's list of catalogs */
6224     int n_catalogs;
6225     xmlChar * URI; /* the URI */
6226     int n_URI;
6227
6228     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6229     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6230         mem_base = xmlMemBlocks();
6231         catalogs = gen_void_ptr(n_catalogs, 0);
6232         URI = gen_const_xmlChar_ptr(n_URI, 1);
6233
6234         ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6235         desret_xmlChar_ptr(ret_val);
6236         call_tests++;
6237         des_void_ptr(n_catalogs, catalogs, 0);
6238         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6239         xmlResetLastError();
6240         if (mem_base != xmlMemBlocks()) {
6241             printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6242                    xmlMemBlocks() - mem_base);
6243             test_ret++;
6244             printf(" %d", n_catalogs);
6245             printf(" %d", n_URI);
6246             printf("\n");
6247         }
6248     }
6249     }
6250     function_tests++;
6251 #endif
6252
6253     return(test_ret);
6254 }
6255
6256
6257 static int
6258 test_xmlCatalogRemove(void) {
6259     int test_ret = 0;
6260
6261 #if defined(LIBXML_CATALOG_ENABLED)
6262     int ret_val;
6263     xmlChar * value; /* the value to remove */
6264     int n_value;
6265
6266     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6267         value = gen_const_xmlChar_ptr(n_value, 0);
6268
6269         ret_val = xmlCatalogRemove((const xmlChar *)value);
6270         desret_int(ret_val);
6271         call_tests++;
6272         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6273         xmlResetLastError();
6274     }
6275     function_tests++;
6276 #endif
6277
6278     return(test_ret);
6279 }
6280
6281
6282 static int
6283 test_xmlCatalogResolve(void) {
6284     int test_ret = 0;
6285
6286 #if defined(LIBXML_CATALOG_ENABLED)
6287     xmlChar * ret_val;
6288     xmlChar * pubID; /* the public ID string */
6289     int n_pubID;
6290     xmlChar * sysID; /* the system ID string */
6291     int n_sysID;
6292
6293     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6294     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6295         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6296         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6297
6298         ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6299         desret_xmlChar_ptr(ret_val);
6300         call_tests++;
6301         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6302         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6303         xmlResetLastError();
6304     }
6305     }
6306     function_tests++;
6307 #endif
6308
6309     return(test_ret);
6310 }
6311
6312
6313 static int
6314 test_xmlCatalogResolvePublic(void) {
6315     int test_ret = 0;
6316
6317 #if defined(LIBXML_CATALOG_ENABLED)
6318     int mem_base;
6319     xmlChar * ret_val;
6320     xmlChar * pubID; /* the public ID string */
6321     int n_pubID;
6322
6323     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6324         mem_base = xmlMemBlocks();
6325         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6326
6327         ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6328         desret_xmlChar_ptr(ret_val);
6329         call_tests++;
6330         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6331         xmlResetLastError();
6332         if (mem_base != xmlMemBlocks()) {
6333             printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6334                    xmlMemBlocks() - mem_base);
6335             test_ret++;
6336             printf(" %d", n_pubID);
6337             printf("\n");
6338         }
6339     }
6340     function_tests++;
6341 #endif
6342
6343     return(test_ret);
6344 }
6345
6346
6347 static int
6348 test_xmlCatalogResolveSystem(void) {
6349     int test_ret = 0;
6350
6351 #if defined(LIBXML_CATALOG_ENABLED)
6352     int mem_base;
6353     xmlChar * ret_val;
6354     xmlChar * sysID; /* the system ID string */
6355     int n_sysID;
6356
6357     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6358         mem_base = xmlMemBlocks();
6359         sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6360
6361         ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6362         desret_xmlChar_ptr(ret_val);
6363         call_tests++;
6364         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6365         xmlResetLastError();
6366         if (mem_base != xmlMemBlocks()) {
6367             printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6368                    xmlMemBlocks() - mem_base);
6369             test_ret++;
6370             printf(" %d", n_sysID);
6371             printf("\n");
6372         }
6373     }
6374     function_tests++;
6375 #endif
6376
6377     return(test_ret);
6378 }
6379
6380
6381 static int
6382 test_xmlCatalogResolveURI(void) {
6383     int test_ret = 0;
6384
6385 #if defined(LIBXML_CATALOG_ENABLED)
6386     int mem_base;
6387     xmlChar * ret_val;
6388     xmlChar * URI; /* the URI */
6389     int n_URI;
6390
6391     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6392         mem_base = xmlMemBlocks();
6393         URI = gen_const_xmlChar_ptr(n_URI, 0);
6394
6395         ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6396         desret_xmlChar_ptr(ret_val);
6397         call_tests++;
6398         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6399         xmlResetLastError();
6400         if (mem_base != xmlMemBlocks()) {
6401             printf("Leak of %d blocks found in xmlCatalogResolveURI",
6402                    xmlMemBlocks() - mem_base);
6403             test_ret++;
6404             printf(" %d", n_URI);
6405             printf("\n");
6406         }
6407     }
6408     function_tests++;
6409 #endif
6410
6411     return(test_ret);
6412 }
6413
6414
6415 static int
6416 test_xmlCatalogSetDefaultPrefer(void) {
6417     int test_ret = 0;
6418
6419 #if defined(LIBXML_CATALOG_ENABLED)
6420     int mem_base;
6421     xmlCatalogPrefer ret_val;
6422     xmlCatalogPrefer prefer; /* the default preference for delegation */
6423     int n_prefer;
6424
6425     for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6426         mem_base = xmlMemBlocks();
6427         prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6428
6429         ret_val = xmlCatalogSetDefaultPrefer(prefer);
6430         desret_xmlCatalogPrefer(ret_val);
6431         call_tests++;
6432         des_xmlCatalogPrefer(n_prefer, prefer, 0);
6433         xmlResetLastError();
6434         if (mem_base != xmlMemBlocks()) {
6435             printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6436                    xmlMemBlocks() - mem_base);
6437             test_ret++;
6438             printf(" %d", n_prefer);
6439             printf("\n");
6440         }
6441     }
6442     function_tests++;
6443 #endif
6444
6445     return(test_ret);
6446 }
6447
6448
6449 static int
6450 test_xmlCatalogSetDefaults(void) {
6451     int test_ret = 0;
6452
6453 #if defined(LIBXML_CATALOG_ENABLED)
6454     int mem_base;
6455     xmlCatalogAllow allow; /* what catalogs should be accepted */
6456     int n_allow;
6457
6458     for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6459         mem_base = xmlMemBlocks();
6460         allow = gen_xmlCatalogAllow(n_allow, 0);
6461
6462         xmlCatalogSetDefaults(allow);
6463         call_tests++;
6464         des_xmlCatalogAllow(n_allow, allow, 0);
6465         xmlResetLastError();
6466         if (mem_base != xmlMemBlocks()) {
6467             printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6468                    xmlMemBlocks() - mem_base);
6469             test_ret++;
6470             printf(" %d", n_allow);
6471             printf("\n");
6472         }
6473     }
6474     function_tests++;
6475 #endif
6476
6477     return(test_ret);
6478 }
6479
6480
6481 static int
6482 test_xmlConvertSGMLCatalog(void) {
6483     int test_ret = 0;
6484
6485 #if defined(LIBXML_CATALOG_ENABLED)
6486     int mem_base;
6487     int ret_val;
6488     xmlCatalogPtr catal; /* the catalog */
6489     int n_catal;
6490
6491     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6492         mem_base = xmlMemBlocks();
6493         catal = gen_xmlCatalogPtr(n_catal, 0);
6494
6495         ret_val = xmlConvertSGMLCatalog(catal);
6496         desret_int(ret_val);
6497         call_tests++;
6498         des_xmlCatalogPtr(n_catal, catal, 0);
6499         xmlResetLastError();
6500         if (mem_base != xmlMemBlocks()) {
6501             printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6502                    xmlMemBlocks() - mem_base);
6503             test_ret++;
6504             printf(" %d", n_catal);
6505             printf("\n");
6506         }
6507     }
6508     function_tests++;
6509 #endif
6510
6511     return(test_ret);
6512 }
6513
6514
6515 static int
6516 test_xmlInitializeCatalog(void) {
6517     int test_ret = 0;
6518
6519 #if defined(LIBXML_CATALOG_ENABLED)
6520     int mem_base;
6521
6522         mem_base = xmlMemBlocks();
6523
6524         xmlInitializeCatalog();
6525         call_tests++;
6526         xmlResetLastError();
6527         if (mem_base != xmlMemBlocks()) {
6528             printf("Leak of %d blocks found in xmlInitializeCatalog",
6529                    xmlMemBlocks() - mem_base);
6530             test_ret++;
6531             printf("\n");
6532         }
6533     function_tests++;
6534 #endif
6535
6536     return(test_ret);
6537 }
6538
6539
6540 static int
6541 test_xmlLoadACatalog(void) {
6542     int test_ret = 0;
6543
6544
6545     /* missing type support */
6546     return(test_ret);
6547 }
6548
6549
6550 static int
6551 test_xmlLoadCatalog(void) {
6552     int test_ret = 0;
6553
6554 #if defined(LIBXML_CATALOG_ENABLED)
6555     int ret_val;
6556     const char * filename; /* a file path */
6557     int n_filename;
6558
6559     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6560         filename = gen_filepath(n_filename, 0);
6561
6562         ret_val = xmlLoadCatalog(filename);
6563         desret_int(ret_val);
6564         call_tests++;
6565         des_filepath(n_filename, filename, 0);
6566         xmlResetLastError();
6567     }
6568     function_tests++;
6569 #endif
6570
6571     return(test_ret);
6572 }
6573
6574
6575 static int
6576 test_xmlLoadCatalogs(void) {
6577     int test_ret = 0;
6578
6579 #if defined(LIBXML_CATALOG_ENABLED)
6580     char * pathss; /* a list of directories separated by a colon or a space. */
6581     int n_pathss;
6582
6583     for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6584         pathss = gen_const_char_ptr(n_pathss, 0);
6585
6586         xmlLoadCatalogs((const char *)pathss);
6587         call_tests++;
6588         des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6589         xmlResetLastError();
6590     }
6591     function_tests++;
6592 #endif
6593
6594     return(test_ret);
6595 }
6596
6597
6598 static int
6599 test_xmlLoadSGMLSuperCatalog(void) {
6600     int test_ret = 0;
6601
6602
6603     /* missing type support */
6604     return(test_ret);
6605 }
6606
6607
6608 static int
6609 test_xmlNewCatalog(void) {
6610     int test_ret = 0;
6611
6612
6613     /* missing type support */
6614     return(test_ret);
6615 }
6616
6617
6618 static int
6619 test_xmlParseCatalogFile(void) {
6620     int test_ret = 0;
6621
6622 #if defined(LIBXML_CATALOG_ENABLED)
6623     int mem_base;
6624     xmlDocPtr ret_val;
6625     const char * filename; /* the filename */
6626     int n_filename;
6627
6628     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6629         mem_base = xmlMemBlocks();
6630         filename = gen_filepath(n_filename, 0);
6631
6632         ret_val = xmlParseCatalogFile(filename);
6633         desret_xmlDocPtr(ret_val);
6634         call_tests++;
6635         des_filepath(n_filename, filename, 0);
6636         xmlResetLastError();
6637         if (mem_base != xmlMemBlocks()) {
6638             printf("Leak of %d blocks found in xmlParseCatalogFile",
6639                    xmlMemBlocks() - mem_base);
6640             test_ret++;
6641             printf(" %d", n_filename);
6642             printf("\n");
6643         }
6644     }
6645     function_tests++;
6646 #endif
6647
6648     return(test_ret);
6649 }
6650
6651 static int
6652 test_catalog(void) {
6653     int test_ret = 0;
6654         int rc = 0;
6655
6656     if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6657     rc = test_xmlACatalogAdd();
6658         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6659     rc = test_xmlACatalogDump();
6660         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6661     rc = test_xmlACatalogRemove();
6662         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6663     rc = test_xmlACatalogResolve();
6664         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6665     rc = test_xmlACatalogResolvePublic();
6666         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6667     rc = test_xmlACatalogResolveSystem();
6668         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6669     rc = test_xmlACatalogResolveURI();
6670         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6671     rc = test_xmlCatalogAdd();
6672         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6673     rc = test_xmlCatalogCleanup();
6674         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6675     rc = test_xmlCatalogConvert();
6676         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6677     rc = test_xmlCatalogDump();
6678         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6679     rc = test_xmlCatalogGetDefaults();
6680         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6681     rc = test_xmlCatalogIsEmpty();
6682         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6683     rc = test_xmlCatalogLocalResolve();
6684         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6685     rc = test_xmlCatalogLocalResolveURI();
6686         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6687     rc = test_xmlCatalogRemove();
6688         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6689     rc = test_xmlCatalogResolve();
6690         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6691     rc = test_xmlCatalogResolvePublic();
6692         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6693     rc = test_xmlCatalogResolveSystem();
6694         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6695     rc = test_xmlCatalogResolveURI();
6696         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6697     rc = test_xmlCatalogSetDefaultPrefer();
6698         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6699     rc = test_xmlCatalogSetDefaults();
6700         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6701     rc = test_xmlConvertSGMLCatalog();
6702         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6703     rc = test_xmlInitializeCatalog();
6704         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6705     rc = test_xmlLoadACatalog();
6706         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6707     rc = test_xmlLoadCatalog();
6708         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6709     rc = test_xmlLoadCatalogs();
6710         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6711     rc = test_xmlLoadSGMLSuperCatalog();
6712         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6713     rc = test_xmlNewCatalog();
6714         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6715     rc = test_xmlParseCatalogFile();
6716         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6717
6718     if (test_ret != 0)
6719         printf("Module catalog: %d errors\n", test_ret);
6720     return(test_ret);
6721 }
6722
6723 #define gen_nb_const_xmlChRangeGroup_ptr 1
6724 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6725     return(NULL);
6726 }
6727 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6728 }
6729
6730 static int
6731 test_xmlCharInRange(void) {
6732     int test_ret = 0;
6733
6734     int mem_base;
6735     int ret_val;
6736     unsigned int val; /* character to be validated */
6737     int n_val;
6738     xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6739     int n_rptr;
6740
6741     for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6742     for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6743         mem_base = xmlMemBlocks();
6744         val = gen_unsigned_int(n_val, 0);
6745         rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6746
6747         ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6748         desret_int(ret_val);
6749         call_tests++;
6750         des_unsigned_int(n_val, val, 0);
6751         des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6752         xmlResetLastError();
6753         if (mem_base != xmlMemBlocks()) {
6754             printf("Leak of %d blocks found in xmlCharInRange",
6755                    xmlMemBlocks() - mem_base);
6756             test_ret++;
6757             printf(" %d", n_val);
6758             printf(" %d", n_rptr);
6759             printf("\n");
6760         }
6761     }
6762     }
6763     function_tests++;
6764
6765     return(test_ret);
6766 }
6767
6768
6769 static int
6770 test_xmlIsBaseChar(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 = xmlIsBaseChar(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 xmlIsBaseChar",
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_xmlIsBlank(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 = xmlIsBlank(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 xmlIsBlank",
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_xmlIsChar(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 = xmlIsChar(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 xmlIsChar",
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_xmlIsCombining(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 = xmlIsCombining(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 xmlIsCombining",
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
6897 static int
6898 test_xmlIsDigit(void) {
6899     int test_ret = 0;
6900
6901     int mem_base;
6902     int ret_val;
6903     unsigned int ch; /* character to validate */
6904     int n_ch;
6905
6906     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6907         mem_base = xmlMemBlocks();
6908         ch = gen_unsigned_int(n_ch, 0);
6909
6910         ret_val = xmlIsDigit(ch);
6911         desret_int(ret_val);
6912         call_tests++;
6913         des_unsigned_int(n_ch, ch, 0);
6914         xmlResetLastError();
6915         if (mem_base != xmlMemBlocks()) {
6916             printf("Leak of %d blocks found in xmlIsDigit",
6917                    xmlMemBlocks() - mem_base);
6918             test_ret++;
6919             printf(" %d", n_ch);
6920             printf("\n");
6921         }
6922     }
6923     function_tests++;
6924
6925     return(test_ret);
6926 }
6927
6928
6929 static int
6930 test_xmlIsExtender(void) {
6931     int test_ret = 0;
6932
6933     int mem_base;
6934     int ret_val;
6935     unsigned int ch; /* character to validate */
6936     int n_ch;
6937
6938     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6939         mem_base = xmlMemBlocks();
6940         ch = gen_unsigned_int(n_ch, 0);
6941
6942         ret_val = xmlIsExtender(ch);
6943         desret_int(ret_val);
6944         call_tests++;
6945         des_unsigned_int(n_ch, ch, 0);
6946         xmlResetLastError();
6947         if (mem_base != xmlMemBlocks()) {
6948             printf("Leak of %d blocks found in xmlIsExtender",
6949                    xmlMemBlocks() - mem_base);
6950             test_ret++;
6951             printf(" %d", n_ch);
6952             printf("\n");
6953         }
6954     }
6955     function_tests++;
6956
6957     return(test_ret);
6958 }
6959
6960
6961 static int
6962 test_xmlIsIdeographic(void) {
6963     int test_ret = 0;
6964
6965     int mem_base;
6966     int ret_val;
6967     unsigned int ch; /* character to validate */
6968     int n_ch;
6969
6970     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6971         mem_base = xmlMemBlocks();
6972         ch = gen_unsigned_int(n_ch, 0);
6973
6974         ret_val = xmlIsIdeographic(ch);
6975         desret_int(ret_val);
6976         call_tests++;
6977         des_unsigned_int(n_ch, ch, 0);
6978         xmlResetLastError();
6979         if (mem_base != xmlMemBlocks()) {
6980             printf("Leak of %d blocks found in xmlIsIdeographic",
6981                    xmlMemBlocks() - mem_base);
6982             test_ret++;
6983             printf(" %d", n_ch);
6984             printf("\n");
6985         }
6986     }
6987     function_tests++;
6988
6989     return(test_ret);
6990 }
6991
6992
6993 static int
6994 test_xmlIsPubidChar(void) {
6995     int test_ret = 0;
6996
6997     int mem_base;
6998     int ret_val;
6999     unsigned int ch; /* character to validate */
7000     int n_ch;
7001
7002     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
7003         mem_base = xmlMemBlocks();
7004         ch = gen_unsigned_int(n_ch, 0);
7005
7006         ret_val = xmlIsPubidChar(ch);
7007         desret_int(ret_val);
7008         call_tests++;
7009         des_unsigned_int(n_ch, ch, 0);
7010         xmlResetLastError();
7011         if (mem_base != xmlMemBlocks()) {
7012             printf("Leak of %d blocks found in xmlIsPubidChar",
7013                    xmlMemBlocks() - mem_base);
7014             test_ret++;
7015             printf(" %d", n_ch);
7016             printf("\n");
7017         }
7018     }
7019     function_tests++;
7020
7021     return(test_ret);
7022 }
7023
7024 static int
7025 test_chvalid(void) {
7026     int test_ret = 0;
7027         int rc = 0;
7028
7029     if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
7030     rc = test_xmlCharInRange();
7031         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7032     rc = test_xmlIsBaseChar();
7033         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7034     rc = test_xmlIsBlank();
7035         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7036     rc = test_xmlIsChar();
7037         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7038     rc = test_xmlIsCombining();
7039         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7040     rc = test_xmlIsDigit();
7041         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7042     rc = test_xmlIsExtender();
7043         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7044     rc = test_xmlIsIdeographic();
7045         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7046     rc = test_xmlIsPubidChar();
7047         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7048
7049     if (test_ret != 0)
7050         printf("Module chvalid: %d errors\n", test_ret);
7051     return(test_ret);
7052 }
7053
7054 static int
7055 test_xmlBoolToText(void) {
7056     int test_ret = 0;
7057
7058 #if defined(LIBXML_DEBUG_ENABLED)
7059     int mem_base;
7060     const char * ret_val;
7061     int boolval; /* a bool to turn into text */
7062     int n_boolval;
7063
7064     for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
7065         mem_base = xmlMemBlocks();
7066         boolval = gen_int(n_boolval, 0);
7067
7068         ret_val = xmlBoolToText(boolval);
7069         desret_const_char_ptr(ret_val);
7070         call_tests++;
7071         des_int(n_boolval, boolval, 0);
7072         xmlResetLastError();
7073         if (mem_base != xmlMemBlocks()) {
7074             printf("Leak of %d blocks found in xmlBoolToText",
7075                    xmlMemBlocks() - mem_base);
7076             test_ret++;
7077             printf(" %d", n_boolval);
7078             printf("\n");
7079         }
7080     }
7081     function_tests++;
7082 #endif
7083
7084     return(test_ret);
7085 }
7086
7087
7088 static int
7089 test_xmlDebugCheckDocument(void) {
7090     int test_ret = 0;
7091
7092 #if defined(LIBXML_DEBUG_ENABLED)
7093     int mem_base;
7094     int ret_val;
7095     FILE * output; /* the FILE * for the output */
7096     int n_output;
7097     xmlDocPtr doc; /* the document */
7098     int n_doc;
7099
7100     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7101     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7102         mem_base = xmlMemBlocks();
7103         output = gen_debug_FILE_ptr(n_output, 0);
7104         doc = gen_xmlDocPtr(n_doc, 1);
7105
7106         ret_val = xmlDebugCheckDocument(output, doc);
7107         desret_int(ret_val);
7108         call_tests++;
7109         des_debug_FILE_ptr(n_output, output, 0);
7110         des_xmlDocPtr(n_doc, doc, 1);
7111         xmlResetLastError();
7112         if (mem_base != xmlMemBlocks()) {
7113             printf("Leak of %d blocks found in xmlDebugCheckDocument",
7114                    xmlMemBlocks() - mem_base);
7115             test_ret++;
7116             printf(" %d", n_output);
7117             printf(" %d", n_doc);
7118             printf("\n");
7119         }
7120     }
7121     }
7122     function_tests++;
7123 #endif
7124
7125     return(test_ret);
7126 }
7127
7128
7129 static int
7130 test_xmlDebugDumpAttr(void) {
7131     int test_ret = 0;
7132
7133 #if defined(LIBXML_DEBUG_ENABLED)
7134     int mem_base;
7135     FILE * output; /* the FILE * for the output */
7136     int n_output;
7137     xmlAttrPtr attr; /* the attribute */
7138     int n_attr;
7139     int depth; /* the indentation level. */
7140     int n_depth;
7141
7142     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7143     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7144     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7145         mem_base = xmlMemBlocks();
7146         output = gen_debug_FILE_ptr(n_output, 0);
7147         attr = gen_xmlAttrPtr(n_attr, 1);
7148         depth = gen_int(n_depth, 2);
7149
7150         xmlDebugDumpAttr(output, attr, depth);
7151         call_tests++;
7152         des_debug_FILE_ptr(n_output, output, 0);
7153         des_xmlAttrPtr(n_attr, attr, 1);
7154         des_int(n_depth, depth, 2);
7155         xmlResetLastError();
7156         if (mem_base != xmlMemBlocks()) {
7157             printf("Leak of %d blocks found in xmlDebugDumpAttr",
7158                    xmlMemBlocks() - mem_base);
7159             test_ret++;
7160             printf(" %d", n_output);
7161             printf(" %d", n_attr);
7162             printf(" %d", n_depth);
7163             printf("\n");
7164         }
7165     }
7166     }
7167     }
7168     function_tests++;
7169 #endif
7170
7171     return(test_ret);
7172 }
7173
7174
7175 static int
7176 test_xmlDebugDumpAttrList(void) {
7177     int test_ret = 0;
7178
7179 #if defined(LIBXML_DEBUG_ENABLED)
7180     int mem_base;
7181     FILE * output; /* the FILE * for the output */
7182     int n_output;
7183     xmlAttrPtr attr; /* the attribute list */
7184     int n_attr;
7185     int depth; /* the indentation level. */
7186     int n_depth;
7187
7188     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7189     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7190     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7191         mem_base = xmlMemBlocks();
7192         output = gen_debug_FILE_ptr(n_output, 0);
7193         attr = gen_xmlAttrPtr(n_attr, 1);
7194         depth = gen_int(n_depth, 2);
7195
7196         xmlDebugDumpAttrList(output, attr, depth);
7197         call_tests++;
7198         des_debug_FILE_ptr(n_output, output, 0);
7199         des_xmlAttrPtr(n_attr, attr, 1);
7200         des_int(n_depth, depth, 2);
7201         xmlResetLastError();
7202         if (mem_base != xmlMemBlocks()) {
7203             printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7204                    xmlMemBlocks() - mem_base);
7205             test_ret++;
7206             printf(" %d", n_output);
7207             printf(" %d", n_attr);
7208             printf(" %d", n_depth);
7209             printf("\n");
7210         }
7211     }
7212     }
7213     }
7214     function_tests++;
7215 #endif
7216
7217     return(test_ret);
7218 }
7219
7220
7221 static int
7222 test_xmlDebugDumpDTD(void) {
7223     int test_ret = 0;
7224
7225 #if defined(LIBXML_DEBUG_ENABLED)
7226     int mem_base;
7227     FILE * output; /* the FILE * for the output */
7228     int n_output;
7229     xmlDtdPtr dtd; /* the DTD */
7230     int n_dtd;
7231
7232     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7233     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7234         mem_base = xmlMemBlocks();
7235         output = gen_debug_FILE_ptr(n_output, 0);
7236         dtd = gen_xmlDtdPtr(n_dtd, 1);
7237
7238         xmlDebugDumpDTD(output, dtd);
7239         call_tests++;
7240         des_debug_FILE_ptr(n_output, output, 0);
7241         des_xmlDtdPtr(n_dtd, dtd, 1);
7242         xmlResetLastError();
7243         if (mem_base != xmlMemBlocks()) {
7244             printf("Leak of %d blocks found in xmlDebugDumpDTD",
7245                    xmlMemBlocks() - mem_base);
7246             test_ret++;
7247             printf(" %d", n_output);
7248             printf(" %d", n_dtd);
7249             printf("\n");
7250         }
7251     }
7252     }
7253     function_tests++;
7254 #endif
7255
7256     return(test_ret);
7257 }
7258
7259
7260 static int
7261 test_xmlDebugDumpDocument(void) {
7262     int test_ret = 0;
7263
7264 #if defined(LIBXML_DEBUG_ENABLED)
7265     int mem_base;
7266     FILE * output; /* the FILE * for the output */
7267     int n_output;
7268     xmlDocPtr doc; /* the document */
7269     int n_doc;
7270
7271     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7272     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7273         mem_base = xmlMemBlocks();
7274         output = gen_debug_FILE_ptr(n_output, 0);
7275         doc = gen_xmlDocPtr(n_doc, 1);
7276
7277         xmlDebugDumpDocument(output, doc);
7278         call_tests++;
7279         des_debug_FILE_ptr(n_output, output, 0);
7280         des_xmlDocPtr(n_doc, doc, 1);
7281         xmlResetLastError();
7282         if (mem_base != xmlMemBlocks()) {
7283             printf("Leak of %d blocks found in xmlDebugDumpDocument",
7284                    xmlMemBlocks() - mem_base);
7285             test_ret++;
7286             printf(" %d", n_output);
7287             printf(" %d", n_doc);
7288             printf("\n");
7289         }
7290     }
7291     }
7292     function_tests++;
7293 #endif
7294
7295     return(test_ret);
7296 }
7297
7298
7299 static int
7300 test_xmlDebugDumpDocumentHead(void) {
7301     int test_ret = 0;
7302
7303 #if defined(LIBXML_DEBUG_ENABLED)
7304     int mem_base;
7305     FILE * output; /* the FILE * for the output */
7306     int n_output;
7307     xmlDocPtr doc; /* the document */
7308     int n_doc;
7309
7310     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7311     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7312         mem_base = xmlMemBlocks();
7313         output = gen_debug_FILE_ptr(n_output, 0);
7314         doc = gen_xmlDocPtr(n_doc, 1);
7315
7316         xmlDebugDumpDocumentHead(output, doc);
7317         call_tests++;
7318         des_debug_FILE_ptr(n_output, output, 0);
7319         des_xmlDocPtr(n_doc, doc, 1);
7320         xmlResetLastError();
7321         if (mem_base != xmlMemBlocks()) {
7322             printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7323                    xmlMemBlocks() - mem_base);
7324             test_ret++;
7325             printf(" %d", n_output);
7326             printf(" %d", n_doc);
7327             printf("\n");
7328         }
7329     }
7330     }
7331     function_tests++;
7332 #endif
7333
7334     return(test_ret);
7335 }
7336
7337
7338 static int
7339 test_xmlDebugDumpEntities(void) {
7340     int test_ret = 0;
7341
7342 #if defined(LIBXML_DEBUG_ENABLED)
7343     int mem_base;
7344     FILE * output; /* the FILE * for the output */
7345     int n_output;
7346     xmlDocPtr doc; /* the document */
7347     int n_doc;
7348
7349     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7350     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7351         mem_base = xmlMemBlocks();
7352         output = gen_debug_FILE_ptr(n_output, 0);
7353         doc = gen_xmlDocPtr(n_doc, 1);
7354
7355         xmlDebugDumpEntities(output, doc);
7356         call_tests++;
7357         des_debug_FILE_ptr(n_output, output, 0);
7358         des_xmlDocPtr(n_doc, doc, 1);
7359         xmlResetLastError();
7360         if (mem_base != xmlMemBlocks()) {
7361             printf("Leak of %d blocks found in xmlDebugDumpEntities",
7362                    xmlMemBlocks() - mem_base);
7363             test_ret++;
7364             printf(" %d", n_output);
7365             printf(" %d", n_doc);
7366             printf("\n");
7367         }
7368     }
7369     }
7370     function_tests++;
7371 #endif
7372
7373     return(test_ret);
7374 }
7375
7376
7377 static int
7378 test_xmlDebugDumpNode(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     xmlNodePtr node; /* the node */
7386     int n_node;
7387     int depth; /* the indentation level. */
7388     int n_depth;
7389
7390     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7391     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7392     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7393         mem_base = xmlMemBlocks();
7394         output = gen_debug_FILE_ptr(n_output, 0);
7395         node = gen_xmlNodePtr(n_node, 1);
7396         depth = gen_int(n_depth, 2);
7397
7398         xmlDebugDumpNode(output, node, depth);
7399         call_tests++;
7400         des_debug_FILE_ptr(n_output, output, 0);
7401         des_xmlNodePtr(n_node, node, 1);
7402         des_int(n_depth, depth, 2);
7403         xmlResetLastError();
7404         if (mem_base != xmlMemBlocks()) {
7405             printf("Leak of %d blocks found in xmlDebugDumpNode",
7406                    xmlMemBlocks() - mem_base);
7407             test_ret++;
7408             printf(" %d", n_output);
7409             printf(" %d", n_node);
7410             printf(" %d", n_depth);
7411             printf("\n");
7412         }
7413     }
7414     }
7415     }
7416     function_tests++;
7417 #endif
7418
7419     return(test_ret);
7420 }
7421
7422
7423 static int
7424 test_xmlDebugDumpNodeList(void) {
7425     int test_ret = 0;
7426
7427 #if defined(LIBXML_DEBUG_ENABLED)
7428     int mem_base;
7429     FILE * output; /* the FILE * for the output */
7430     int n_output;
7431     xmlNodePtr node; /* the node list */
7432     int n_node;
7433     int depth; /* the indentation level. */
7434     int n_depth;
7435
7436     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7437     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7438     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7439         mem_base = xmlMemBlocks();
7440         output = gen_debug_FILE_ptr(n_output, 0);
7441         node = gen_xmlNodePtr(n_node, 1);
7442         depth = gen_int(n_depth, 2);
7443
7444         xmlDebugDumpNodeList(output, node, depth);
7445         call_tests++;
7446         des_debug_FILE_ptr(n_output, output, 0);
7447         des_xmlNodePtr(n_node, node, 1);
7448         des_int(n_depth, depth, 2);
7449         xmlResetLastError();
7450         if (mem_base != xmlMemBlocks()) {
7451             printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7452                    xmlMemBlocks() - mem_base);
7453             test_ret++;
7454             printf(" %d", n_output);
7455             printf(" %d", n_node);
7456             printf(" %d", n_depth);
7457             printf("\n");
7458         }
7459     }
7460     }
7461     }
7462     function_tests++;
7463 #endif
7464
7465     return(test_ret);
7466 }
7467
7468
7469 static int
7470 test_xmlDebugDumpOneNode(void) {
7471     int test_ret = 0;
7472
7473 #if defined(LIBXML_DEBUG_ENABLED)
7474     int mem_base;
7475     FILE * output; /* the FILE * for the output */
7476     int n_output;
7477     xmlNodePtr node; /* the node */
7478     int n_node;
7479     int depth; /* the indentation level. */
7480     int n_depth;
7481
7482     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7483     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7484     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7485         mem_base = xmlMemBlocks();
7486         output = gen_debug_FILE_ptr(n_output, 0);
7487         node = gen_xmlNodePtr(n_node, 1);
7488         depth = gen_int(n_depth, 2);
7489
7490         xmlDebugDumpOneNode(output, node, depth);
7491         call_tests++;
7492         des_debug_FILE_ptr(n_output, output, 0);
7493         des_xmlNodePtr(n_node, node, 1);
7494         des_int(n_depth, depth, 2);
7495         xmlResetLastError();
7496         if (mem_base != xmlMemBlocks()) {
7497             printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7498                    xmlMemBlocks() - mem_base);
7499             test_ret++;
7500             printf(" %d", n_output);
7501             printf(" %d", n_node);
7502             printf(" %d", n_depth);
7503             printf("\n");
7504         }
7505     }
7506     }
7507     }
7508     function_tests++;
7509 #endif
7510
7511     return(test_ret);
7512 }
7513
7514
7515 static int
7516 test_xmlDebugDumpString(void) {
7517     int test_ret = 0;
7518
7519 #if defined(LIBXML_DEBUG_ENABLED)
7520     int mem_base;
7521     FILE * output; /* the FILE * for the output */
7522     int n_output;
7523     xmlChar * str; /* the string */
7524     int n_str;
7525
7526     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7527     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7528         mem_base = xmlMemBlocks();
7529         output = gen_debug_FILE_ptr(n_output, 0);
7530         str = gen_const_xmlChar_ptr(n_str, 1);
7531
7532         xmlDebugDumpString(output, (const xmlChar *)str);
7533         call_tests++;
7534         des_debug_FILE_ptr(n_output, output, 0);
7535         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7536         xmlResetLastError();
7537         if (mem_base != xmlMemBlocks()) {
7538             printf("Leak of %d blocks found in xmlDebugDumpString",
7539                    xmlMemBlocks() - mem_base);
7540             test_ret++;
7541             printf(" %d", n_output);
7542             printf(" %d", n_str);
7543             printf("\n");
7544         }
7545     }
7546     }
7547     function_tests++;
7548 #endif
7549
7550     return(test_ret);
7551 }
7552
7553
7554 static int
7555 test_xmlLsCountNode(void) {
7556     int test_ret = 0;
7557
7558 #if defined(LIBXML_DEBUG_ENABLED)
7559     int mem_base;
7560     int ret_val;
7561     xmlNodePtr node; /* the node to count */
7562     int n_node;
7563
7564     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7565         mem_base = xmlMemBlocks();
7566         node = gen_xmlNodePtr(n_node, 0);
7567
7568         ret_val = xmlLsCountNode(node);
7569         desret_int(ret_val);
7570         call_tests++;
7571         des_xmlNodePtr(n_node, node, 0);
7572         xmlResetLastError();
7573         if (mem_base != xmlMemBlocks()) {
7574             printf("Leak of %d blocks found in xmlLsCountNode",
7575                    xmlMemBlocks() - mem_base);
7576             test_ret++;
7577             printf(" %d", n_node);
7578             printf("\n");
7579         }
7580     }
7581     function_tests++;
7582 #endif
7583
7584     return(test_ret);
7585 }
7586
7587
7588 static int
7589 test_xmlLsOneNode(void) {
7590     int test_ret = 0;
7591
7592 #if defined(LIBXML_DEBUG_ENABLED)
7593     int mem_base;
7594     FILE * output; /* the FILE * for the output */
7595     int n_output;
7596     xmlNodePtr node; /* the node to dump */
7597     int n_node;
7598
7599     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7600     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7601         mem_base = xmlMemBlocks();
7602         output = gen_debug_FILE_ptr(n_output, 0);
7603         node = gen_xmlNodePtr(n_node, 1);
7604
7605         xmlLsOneNode(output, node);
7606         call_tests++;
7607         des_debug_FILE_ptr(n_output, output, 0);
7608         des_xmlNodePtr(n_node, node, 1);
7609         xmlResetLastError();
7610         if (mem_base != xmlMemBlocks()) {
7611             printf("Leak of %d blocks found in xmlLsOneNode",
7612                    xmlMemBlocks() - mem_base);
7613             test_ret++;
7614             printf(" %d", n_output);
7615             printf(" %d", n_node);
7616             printf("\n");
7617         }
7618     }
7619     }
7620     function_tests++;
7621 #endif
7622
7623     return(test_ret);
7624 }
7625
7626
7627 #define gen_nb_char_ptr 1
7628 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7629     return(NULL);
7630 }
7631 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7632 }
7633
7634 static int
7635 test_xmlShell(void) {
7636     int test_ret = 0;
7637
7638
7639     /* missing type support */
7640     return(test_ret);
7641 }
7642
7643
7644 static int
7645 test_xmlShellBase(void) {
7646     int test_ret = 0;
7647
7648 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7649     int mem_base;
7650     int ret_val;
7651     xmlShellCtxtPtr ctxt; /* the shell context */
7652     int n_ctxt;
7653     char * arg; /* unused */
7654     int n_arg;
7655     xmlNodePtr node; /* a node */
7656     int n_node;
7657     xmlNodePtr node2; /* unused */
7658     int n_node2;
7659
7660     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7661     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7662     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7663     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7664         mem_base = xmlMemBlocks();
7665         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7666         arg = gen_char_ptr(n_arg, 1);
7667         node = gen_xmlNodePtr(n_node, 2);
7668         node2 = gen_xmlNodePtr(n_node2, 3);
7669
7670         ret_val = xmlShellBase(ctxt, arg, node, node2);
7671         desret_int(ret_val);
7672         call_tests++;
7673         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7674         des_char_ptr(n_arg, arg, 1);
7675         des_xmlNodePtr(n_node, node, 2);
7676         des_xmlNodePtr(n_node2, node2, 3);
7677         xmlResetLastError();
7678         if (mem_base != xmlMemBlocks()) {
7679             printf("Leak of %d blocks found in xmlShellBase",
7680                    xmlMemBlocks() - mem_base);
7681             test_ret++;
7682             printf(" %d", n_ctxt);
7683             printf(" %d", n_arg);
7684             printf(" %d", n_node);
7685             printf(" %d", n_node2);
7686             printf("\n");
7687         }
7688     }
7689     }
7690     }
7691     }
7692     function_tests++;
7693 #endif
7694
7695     return(test_ret);
7696 }
7697
7698
7699 static int
7700 test_xmlShellCat(void) {
7701     int test_ret = 0;
7702
7703 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7704     int mem_base;
7705     int ret_val;
7706     xmlShellCtxtPtr ctxt; /* the shell context */
7707     int n_ctxt;
7708     char * arg; /* unused */
7709     int n_arg;
7710     xmlNodePtr node; /* a node */
7711     int n_node;
7712     xmlNodePtr node2; /* unused */
7713     int n_node2;
7714
7715     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7716     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7717     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7718     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7719         mem_base = xmlMemBlocks();
7720         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7721         arg = gen_char_ptr(n_arg, 1);
7722         node = gen_xmlNodePtr(n_node, 2);
7723         node2 = gen_xmlNodePtr(n_node2, 3);
7724
7725         ret_val = xmlShellCat(ctxt, arg, node, node2);
7726         desret_int(ret_val);
7727         call_tests++;
7728         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7729         des_char_ptr(n_arg, arg, 1);
7730         des_xmlNodePtr(n_node, node, 2);
7731         des_xmlNodePtr(n_node2, node2, 3);
7732         xmlResetLastError();
7733         if (mem_base != xmlMemBlocks()) {
7734             printf("Leak of %d blocks found in xmlShellCat",
7735                    xmlMemBlocks() - mem_base);
7736             test_ret++;
7737             printf(" %d", n_ctxt);
7738             printf(" %d", n_arg);
7739             printf(" %d", n_node);
7740             printf(" %d", n_node2);
7741             printf("\n");
7742         }
7743     }
7744     }
7745     }
7746     }
7747     function_tests++;
7748 #endif
7749
7750     return(test_ret);
7751 }
7752
7753
7754 static int
7755 test_xmlShellDir(void) {
7756     int test_ret = 0;
7757
7758 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7759     int mem_base;
7760     int ret_val;
7761     xmlShellCtxtPtr ctxt; /* the shell context */
7762     int n_ctxt;
7763     char * arg; /* unused */
7764     int n_arg;
7765     xmlNodePtr node; /* a node */
7766     int n_node;
7767     xmlNodePtr node2; /* unused */
7768     int n_node2;
7769
7770     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7771     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7772     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7773     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7774         mem_base = xmlMemBlocks();
7775         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7776         arg = gen_char_ptr(n_arg, 1);
7777         node = gen_xmlNodePtr(n_node, 2);
7778         node2 = gen_xmlNodePtr(n_node2, 3);
7779
7780         ret_val = xmlShellDir(ctxt, arg, node, node2);
7781         desret_int(ret_val);
7782         call_tests++;
7783         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7784         des_char_ptr(n_arg, arg, 1);
7785         des_xmlNodePtr(n_node, node, 2);
7786         des_xmlNodePtr(n_node2, node2, 3);
7787         xmlResetLastError();
7788         if (mem_base != xmlMemBlocks()) {
7789             printf("Leak of %d blocks found in xmlShellDir",
7790                    xmlMemBlocks() - mem_base);
7791             test_ret++;
7792             printf(" %d", n_ctxt);
7793             printf(" %d", n_arg);
7794             printf(" %d", n_node);
7795             printf(" %d", n_node2);
7796             printf("\n");
7797         }
7798     }
7799     }
7800     }
7801     }
7802     function_tests++;
7803 #endif
7804
7805     return(test_ret);
7806 }
7807
7808
7809 static int
7810 test_xmlShellDu(void) {
7811     int test_ret = 0;
7812
7813 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7814     int mem_base;
7815     int ret_val;
7816     xmlShellCtxtPtr ctxt; /* the shell context */
7817     int n_ctxt;
7818     char * arg; /* unused */
7819     int n_arg;
7820     xmlNodePtr tree; /* a node defining a subtree */
7821     int n_tree;
7822     xmlNodePtr node2; /* unused */
7823     int n_node2;
7824
7825     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7826     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7827     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7828     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7829         mem_base = xmlMemBlocks();
7830         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7831         arg = gen_char_ptr(n_arg, 1);
7832         tree = gen_xmlNodePtr(n_tree, 2);
7833         node2 = gen_xmlNodePtr(n_node2, 3);
7834
7835         ret_val = xmlShellDu(ctxt, arg, tree, node2);
7836         desret_int(ret_val);
7837         call_tests++;
7838         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7839         des_char_ptr(n_arg, arg, 1);
7840         des_xmlNodePtr(n_tree, tree, 2);
7841         des_xmlNodePtr(n_node2, node2, 3);
7842         xmlResetLastError();
7843         if (mem_base != xmlMemBlocks()) {
7844             printf("Leak of %d blocks found in xmlShellDu",
7845                    xmlMemBlocks() - mem_base);
7846             test_ret++;
7847             printf(" %d", n_ctxt);
7848             printf(" %d", n_arg);
7849             printf(" %d", n_tree);
7850             printf(" %d", n_node2);
7851             printf("\n");
7852         }
7853     }
7854     }
7855     }
7856     }
7857     function_tests++;
7858 #endif
7859
7860     return(test_ret);
7861 }
7862
7863
7864 static int
7865 test_xmlShellList(void) {
7866     int test_ret = 0;
7867
7868 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7869     int mem_base;
7870     int ret_val;
7871     xmlShellCtxtPtr ctxt; /* the shell context */
7872     int n_ctxt;
7873     char * arg; /* unused */
7874     int n_arg;
7875     xmlNodePtr node; /* a node */
7876     int n_node;
7877     xmlNodePtr node2; /* unused */
7878     int n_node2;
7879
7880     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7881     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7882     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7883     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7884         mem_base = xmlMemBlocks();
7885         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7886         arg = gen_char_ptr(n_arg, 1);
7887         node = gen_xmlNodePtr(n_node, 2);
7888         node2 = gen_xmlNodePtr(n_node2, 3);
7889
7890         ret_val = xmlShellList(ctxt, arg, node, node2);
7891         desret_int(ret_val);
7892         call_tests++;
7893         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7894         des_char_ptr(n_arg, arg, 1);
7895         des_xmlNodePtr(n_node, node, 2);
7896         des_xmlNodePtr(n_node2, node2, 3);
7897         xmlResetLastError();
7898         if (mem_base != xmlMemBlocks()) {
7899             printf("Leak of %d blocks found in xmlShellList",
7900                    xmlMemBlocks() - mem_base);
7901             test_ret++;
7902             printf(" %d", n_ctxt);
7903             printf(" %d", n_arg);
7904             printf(" %d", n_node);
7905             printf(" %d", n_node2);
7906             printf("\n");
7907         }
7908     }
7909     }
7910     }
7911     }
7912     function_tests++;
7913 #endif
7914
7915     return(test_ret);
7916 }
7917
7918
7919 static int
7920 test_xmlShellLoad(void) {
7921     int test_ret = 0;
7922
7923 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7924     int mem_base;
7925     int ret_val;
7926     xmlShellCtxtPtr ctxt; /* the shell context */
7927     int n_ctxt;
7928     char * filename; /* the file name */
7929     int n_filename;
7930     xmlNodePtr node; /* unused */
7931     int n_node;
7932     xmlNodePtr node2; /* unused */
7933     int n_node2;
7934
7935     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7936     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7937     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7938     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7939         mem_base = xmlMemBlocks();
7940         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7941         filename = gen_char_ptr(n_filename, 1);
7942         node = gen_xmlNodePtr(n_node, 2);
7943         node2 = gen_xmlNodePtr(n_node2, 3);
7944
7945         ret_val = xmlShellLoad(ctxt, filename, node, node2);
7946         desret_int(ret_val);
7947         call_tests++;
7948         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7949         des_char_ptr(n_filename, filename, 1);
7950         des_xmlNodePtr(n_node, node, 2);
7951         des_xmlNodePtr(n_node2, node2, 3);
7952         xmlResetLastError();
7953         if (mem_base != xmlMemBlocks()) {
7954             printf("Leak of %d blocks found in xmlShellLoad",
7955                    xmlMemBlocks() - mem_base);
7956             test_ret++;
7957             printf(" %d", n_ctxt);
7958             printf(" %d", n_filename);
7959             printf(" %d", n_node);
7960             printf(" %d", n_node2);
7961             printf("\n");
7962         }
7963     }
7964     }
7965     }
7966     }
7967     function_tests++;
7968 #endif
7969
7970     return(test_ret);
7971 }
7972
7973
7974 static int
7975 test_xmlShellPrintXPathResult(void) {
7976     int test_ret = 0;
7977
7978 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7979     int mem_base;
7980     xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7981     int n_list;
7982
7983     for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7984         mem_base = xmlMemBlocks();
7985         list = gen_xmlXPathObjectPtr(n_list, 0);
7986
7987         xmlShellPrintXPathResult(list);
7988         call_tests++;
7989         des_xmlXPathObjectPtr(n_list, list, 0);
7990         xmlResetLastError();
7991         if (mem_base != xmlMemBlocks()) {
7992             printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7993                    xmlMemBlocks() - mem_base);
7994             test_ret++;
7995             printf(" %d", n_list);
7996             printf("\n");
7997         }
7998     }
7999     function_tests++;
8000 #endif
8001
8002     return(test_ret);
8003 }
8004
8005
8006 static int
8007 test_xmlShellPwd(void) {
8008     int test_ret = 0;
8009
8010 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
8011     int mem_base;
8012     int ret_val;
8013     xmlShellCtxtPtr ctxt; /* the shell context */
8014     int n_ctxt;
8015     char * buffer; /* the output buffer */
8016     int n_buffer;
8017     xmlNodePtr node; /* a node */
8018     int n_node;
8019     xmlNodePtr node2; /* unused */
8020     int n_node2;
8021
8022     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8023     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
8024     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8025     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8026         mem_base = xmlMemBlocks();
8027         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8028         buffer = gen_char_ptr(n_buffer, 1);
8029         node = gen_xmlNodePtr(n_node, 2);
8030         node2 = gen_xmlNodePtr(n_node2, 3);
8031
8032         ret_val = xmlShellPwd(ctxt, buffer, node, node2);
8033         desret_int(ret_val);
8034         call_tests++;
8035         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8036         des_char_ptr(n_buffer, buffer, 1);
8037         des_xmlNodePtr(n_node, node, 2);
8038         des_xmlNodePtr(n_node2, node2, 3);
8039         xmlResetLastError();
8040         if (mem_base != xmlMemBlocks()) {
8041             printf("Leak of %d blocks found in xmlShellPwd",
8042                    xmlMemBlocks() - mem_base);
8043             test_ret++;
8044             printf(" %d", n_ctxt);
8045             printf(" %d", n_buffer);
8046             printf(" %d", n_node);
8047             printf(" %d", n_node2);
8048             printf("\n");
8049         }
8050     }
8051     }
8052     }
8053     }
8054     function_tests++;
8055 #endif
8056
8057     return(test_ret);
8058 }
8059
8060
8061 static int
8062 test_xmlShellSave(void) {
8063     int test_ret = 0;
8064
8065 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8066     int mem_base;
8067     int ret_val;
8068     xmlShellCtxtPtr ctxt; /* the shell context */
8069     int n_ctxt;
8070     char * filename; /* the file name (optional) */
8071     int n_filename;
8072     xmlNodePtr node; /* unused */
8073     int n_node;
8074     xmlNodePtr node2; /* unused */
8075     int n_node2;
8076
8077     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8078     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8079     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8080     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8081         mem_base = xmlMemBlocks();
8082         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8083         filename = gen_char_ptr(n_filename, 1);
8084         node = gen_xmlNodePtr(n_node, 2);
8085         node2 = gen_xmlNodePtr(n_node2, 3);
8086
8087         ret_val = xmlShellSave(ctxt, filename, node, node2);
8088         desret_int(ret_val);
8089         call_tests++;
8090         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8091         des_char_ptr(n_filename, filename, 1);
8092         des_xmlNodePtr(n_node, node, 2);
8093         des_xmlNodePtr(n_node2, node2, 3);
8094         xmlResetLastError();
8095         if (mem_base != xmlMemBlocks()) {
8096             printf("Leak of %d blocks found in xmlShellSave",
8097                    xmlMemBlocks() - mem_base);
8098             test_ret++;
8099             printf(" %d", n_ctxt);
8100             printf(" %d", n_filename);
8101             printf(" %d", n_node);
8102             printf(" %d", n_node2);
8103             printf("\n");
8104         }
8105     }
8106     }
8107     }
8108     }
8109     function_tests++;
8110 #endif
8111
8112     return(test_ret);
8113 }
8114
8115
8116 static int
8117 test_xmlShellValidate(void) {
8118     int test_ret = 0;
8119
8120 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
8121     int mem_base;
8122     int ret_val;
8123     xmlShellCtxtPtr ctxt; /* the shell context */
8124     int n_ctxt;
8125     char * dtd; /* the DTD URI (optional) */
8126     int n_dtd;
8127     xmlNodePtr node; /* unused */
8128     int n_node;
8129     xmlNodePtr node2; /* unused */
8130     int n_node2;
8131
8132     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8133     for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8134     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8135     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8136         mem_base = xmlMemBlocks();
8137         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8138         dtd = gen_char_ptr(n_dtd, 1);
8139         node = gen_xmlNodePtr(n_node, 2);
8140         node2 = gen_xmlNodePtr(n_node2, 3);
8141
8142         ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8143         desret_int(ret_val);
8144         call_tests++;
8145         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8146         des_char_ptr(n_dtd, dtd, 1);
8147         des_xmlNodePtr(n_node, node, 2);
8148         des_xmlNodePtr(n_node2, node2, 3);
8149         xmlResetLastError();
8150         if (mem_base != xmlMemBlocks()) {
8151             printf("Leak of %d blocks found in xmlShellValidate",
8152                    xmlMemBlocks() - mem_base);
8153             test_ret++;
8154             printf(" %d", n_ctxt);
8155             printf(" %d", n_dtd);
8156             printf(" %d", n_node);
8157             printf(" %d", n_node2);
8158             printf("\n");
8159         }
8160     }
8161     }
8162     }
8163     }
8164     function_tests++;
8165 #endif
8166
8167     return(test_ret);
8168 }
8169
8170
8171 static int
8172 test_xmlShellWrite(void) {
8173     int test_ret = 0;
8174
8175 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8176     int mem_base;
8177     int ret_val;
8178     xmlShellCtxtPtr ctxt; /* the shell context */
8179     int n_ctxt;
8180     char * filename; /* the file name */
8181     int n_filename;
8182     xmlNodePtr node; /* a node in the tree */
8183     int n_node;
8184     xmlNodePtr node2; /* unused */
8185     int n_node2;
8186
8187     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8188     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8189     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8190     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8191         mem_base = xmlMemBlocks();
8192         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8193         filename = gen_char_ptr(n_filename, 1);
8194         node = gen_xmlNodePtr(n_node, 2);
8195         node2 = gen_xmlNodePtr(n_node2, 3);
8196
8197         ret_val = xmlShellWrite(ctxt, filename, node, node2);
8198         desret_int(ret_val);
8199         call_tests++;
8200         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8201         des_char_ptr(n_filename, filename, 1);
8202         des_xmlNodePtr(n_node, node, 2);
8203         des_xmlNodePtr(n_node2, node2, 3);
8204         xmlResetLastError();
8205         if (mem_base != xmlMemBlocks()) {
8206             printf("Leak of %d blocks found in xmlShellWrite",
8207                    xmlMemBlocks() - mem_base);
8208             test_ret++;
8209             printf(" %d", n_ctxt);
8210             printf(" %d", n_filename);
8211             printf(" %d", n_node);
8212             printf(" %d", n_node2);
8213             printf("\n");
8214         }
8215     }
8216     }
8217     }
8218     }
8219     function_tests++;
8220 #endif
8221
8222     return(test_ret);
8223 }
8224
8225 static int
8226 test_debugXML(void) {
8227     int test_ret = 0;
8228         int rc = 0;
8229
8230     if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8231     rc = test_xmlBoolToText();
8232         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8233     rc = test_xmlDebugCheckDocument();
8234         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8235     rc = test_xmlDebugDumpAttr();
8236         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8237     rc = test_xmlDebugDumpAttrList();
8238         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8239     rc = test_xmlDebugDumpDTD();
8240         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8241     rc = test_xmlDebugDumpDocument();
8242         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8243     rc = test_xmlDebugDumpDocumentHead();
8244         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8245     rc = test_xmlDebugDumpEntities();
8246         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8247     rc = test_xmlDebugDumpNode();
8248         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8249     rc = test_xmlDebugDumpNodeList();
8250         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8251     rc = test_xmlDebugDumpOneNode();
8252         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8253     rc = test_xmlDebugDumpString();
8254         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8255     rc = test_xmlLsCountNode();
8256         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8257     rc = test_xmlLsOneNode();
8258         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8259     rc = test_xmlShell();
8260         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8261     rc = test_xmlShellBase();
8262         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8263     rc = test_xmlShellCat();
8264         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8265     rc = test_xmlShellDir();
8266         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8267     rc = test_xmlShellDu();
8268         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8269     rc = test_xmlShellList();
8270         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8271     rc = test_xmlShellLoad();
8272         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8273     rc = test_xmlShellPrintXPathResult();
8274         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8275     rc = test_xmlShellPwd();
8276         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8277     rc = test_xmlShellSave();
8278         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8279     rc = test_xmlShellValidate();
8280         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8281     rc = test_xmlShellWrite();
8282         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8283
8284     if (test_ret != 0)
8285         printf("Module debugXML: %d errors\n", test_ret);
8286     return(test_ret);
8287 }
8288
8289 static int
8290 test_xmlDictCleanup(void) {
8291     int test_ret = 0;
8292
8293     int mem_base;
8294
8295         mem_base = xmlMemBlocks();
8296
8297         xmlDictCleanup();
8298         call_tests++;
8299         xmlResetLastError();
8300         if (mem_base != xmlMemBlocks()) {
8301             printf("Leak of %d blocks found in xmlDictCleanup",
8302                    xmlMemBlocks() - mem_base);
8303             test_ret++;
8304             printf("\n");
8305         }
8306     function_tests++;
8307
8308     return(test_ret);
8309 }
8310
8311
8312 static int
8313 test_xmlDictCreate(void) {
8314     int test_ret = 0;
8315
8316     int mem_base;
8317     xmlDictPtr ret_val;
8318
8319         mem_base = xmlMemBlocks();
8320
8321         ret_val = xmlDictCreate();
8322         desret_xmlDictPtr(ret_val);
8323         call_tests++;
8324         xmlResetLastError();
8325         if (mem_base != xmlMemBlocks()) {
8326             printf("Leak of %d blocks found in xmlDictCreate",
8327                    xmlMemBlocks() - mem_base);
8328             test_ret++;
8329             printf("\n");
8330         }
8331     function_tests++;
8332
8333     return(test_ret);
8334 }
8335
8336
8337 static int
8338 test_xmlDictCreateSub(void) {
8339     int test_ret = 0;
8340
8341     int mem_base;
8342     xmlDictPtr ret_val;
8343     xmlDictPtr sub; /* an existing dictionary */
8344     int n_sub;
8345
8346     for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8347         mem_base = xmlMemBlocks();
8348         sub = gen_xmlDictPtr(n_sub, 0);
8349
8350         ret_val = xmlDictCreateSub(sub);
8351         desret_xmlDictPtr(ret_val);
8352         call_tests++;
8353         des_xmlDictPtr(n_sub, sub, 0);
8354         xmlResetLastError();
8355         if (mem_base != xmlMemBlocks()) {
8356             printf("Leak of %d blocks found in xmlDictCreateSub",
8357                    xmlMemBlocks() - mem_base);
8358             test_ret++;
8359             printf(" %d", n_sub);
8360             printf("\n");
8361         }
8362     }
8363     function_tests++;
8364
8365     return(test_ret);
8366 }
8367
8368
8369 static int
8370 test_xmlDictExists(void) {
8371     int test_ret = 0;
8372
8373     int mem_base;
8374     const xmlChar * ret_val;
8375     xmlDictPtr dict; /* the dictionary */
8376     int n_dict;
8377     xmlChar * name; /* the name of the userdata */
8378     int n_name;
8379     int len; /* the length of the name, if -1 it is recomputed */
8380     int n_len;
8381
8382     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8383     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8384     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8385         mem_base = xmlMemBlocks();
8386         dict = gen_xmlDictPtr(n_dict, 0);
8387         name = gen_const_xmlChar_ptr(n_name, 1);
8388         len = gen_int(n_len, 2);
8389
8390         ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8391         desret_const_xmlChar_ptr(ret_val);
8392         call_tests++;
8393         des_xmlDictPtr(n_dict, dict, 0);
8394         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8395         des_int(n_len, len, 2);
8396         xmlResetLastError();
8397         if (mem_base != xmlMemBlocks()) {
8398             printf("Leak of %d blocks found in xmlDictExists",
8399                    xmlMemBlocks() - mem_base);
8400             test_ret++;
8401             printf(" %d", n_dict);
8402             printf(" %d", n_name);
8403             printf(" %d", n_len);
8404             printf("\n");
8405         }
8406     }
8407     }
8408     }
8409     function_tests++;
8410
8411     return(test_ret);
8412 }
8413
8414
8415 static int
8416 test_xmlDictGetUsage(void) {
8417     int test_ret = 0;
8418
8419
8420     /* missing type support */
8421     return(test_ret);
8422 }
8423
8424
8425 static int
8426 test_xmlDictLookup(void) {
8427     int test_ret = 0;
8428
8429     int mem_base;
8430     const xmlChar * ret_val;
8431     xmlDictPtr dict; /* the dictionary */
8432     int n_dict;
8433     xmlChar * name; /* the name of the userdata */
8434     int n_name;
8435     int len; /* the length of the name, if -1 it is recomputed */
8436     int n_len;
8437
8438     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8439     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8440     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8441         mem_base = xmlMemBlocks();
8442         dict = gen_xmlDictPtr(n_dict, 0);
8443         name = gen_const_xmlChar_ptr(n_name, 1);
8444         len = gen_int(n_len, 2);
8445
8446         ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8447         desret_const_xmlChar_ptr(ret_val);
8448         call_tests++;
8449         des_xmlDictPtr(n_dict, dict, 0);
8450         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8451         des_int(n_len, len, 2);
8452         xmlResetLastError();
8453         if (mem_base != xmlMemBlocks()) {
8454             printf("Leak of %d blocks found in xmlDictLookup",
8455                    xmlMemBlocks() - mem_base);
8456             test_ret++;
8457             printf(" %d", n_dict);
8458             printf(" %d", n_name);
8459             printf(" %d", n_len);
8460             printf("\n");
8461         }
8462     }
8463     }
8464     }
8465     function_tests++;
8466
8467     return(test_ret);
8468 }
8469
8470
8471 static int
8472 test_xmlDictOwns(void) {
8473     int test_ret = 0;
8474
8475     int mem_base;
8476     int ret_val;
8477     xmlDictPtr dict; /* the dictionary */
8478     int n_dict;
8479     xmlChar * str; /* the string */
8480     int n_str;
8481
8482     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8483     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8484         mem_base = xmlMemBlocks();
8485         dict = gen_xmlDictPtr(n_dict, 0);
8486         str = gen_const_xmlChar_ptr(n_str, 1);
8487
8488         ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8489         desret_int(ret_val);
8490         call_tests++;
8491         des_xmlDictPtr(n_dict, dict, 0);
8492         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8493         xmlResetLastError();
8494         if (mem_base != xmlMemBlocks()) {
8495             printf("Leak of %d blocks found in xmlDictOwns",
8496                    xmlMemBlocks() - mem_base);
8497             test_ret++;
8498             printf(" %d", n_dict);
8499             printf(" %d", n_str);
8500             printf("\n");
8501         }
8502     }
8503     }
8504     function_tests++;
8505
8506     return(test_ret);
8507 }
8508
8509
8510 static int
8511 test_xmlDictQLookup(void) {
8512     int test_ret = 0;
8513
8514     int mem_base;
8515     const xmlChar * ret_val;
8516     xmlDictPtr dict; /* the dictionary */
8517     int n_dict;
8518     xmlChar * prefix; /* the prefix */
8519     int n_prefix;
8520     xmlChar * name; /* the name */
8521     int n_name;
8522
8523     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8524     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8525     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8526         mem_base = xmlMemBlocks();
8527         dict = gen_xmlDictPtr(n_dict, 0);
8528         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8529         name = gen_const_xmlChar_ptr(n_name, 2);
8530
8531         ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8532         desret_const_xmlChar_ptr(ret_val);
8533         call_tests++;
8534         des_xmlDictPtr(n_dict, dict, 0);
8535         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8536         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8537         xmlResetLastError();
8538         if (mem_base != xmlMemBlocks()) {
8539             printf("Leak of %d blocks found in xmlDictQLookup",
8540                    xmlMemBlocks() - mem_base);
8541             test_ret++;
8542             printf(" %d", n_dict);
8543             printf(" %d", n_prefix);
8544             printf(" %d", n_name);
8545             printf("\n");
8546         }
8547     }
8548     }
8549     }
8550     function_tests++;
8551
8552     return(test_ret);
8553 }
8554
8555
8556 static int
8557 test_xmlDictReference(void) {
8558     int test_ret = 0;
8559
8560     int mem_base;
8561     int ret_val;
8562     xmlDictPtr dict; /* the dictionary */
8563     int n_dict;
8564
8565     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8566         mem_base = xmlMemBlocks();
8567         dict = gen_xmlDictPtr(n_dict, 0);
8568
8569         ret_val = xmlDictReference(dict);
8570         xmlDictFree(dict);
8571         desret_int(ret_val);
8572         call_tests++;
8573         des_xmlDictPtr(n_dict, dict, 0);
8574         xmlResetLastError();
8575         if (mem_base != xmlMemBlocks()) {
8576             printf("Leak of %d blocks found in xmlDictReference",
8577                    xmlMemBlocks() - mem_base);
8578             test_ret++;
8579             printf(" %d", n_dict);
8580             printf("\n");
8581         }
8582     }
8583     function_tests++;
8584
8585     return(test_ret);
8586 }
8587
8588
8589 static int
8590 test_xmlDictSetLimit(void) {
8591     int test_ret = 0;
8592
8593
8594     /* missing type support */
8595     return(test_ret);
8596 }
8597
8598
8599 static int
8600 test_xmlDictSize(void) {
8601     int test_ret = 0;
8602
8603     int mem_base;
8604     int ret_val;
8605     xmlDictPtr dict; /* the dictionary */
8606     int n_dict;
8607
8608     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8609         mem_base = xmlMemBlocks();
8610         dict = gen_xmlDictPtr(n_dict, 0);
8611
8612         ret_val = xmlDictSize(dict);
8613         desret_int(ret_val);
8614         call_tests++;
8615         des_xmlDictPtr(n_dict, dict, 0);
8616         xmlResetLastError();
8617         if (mem_base != xmlMemBlocks()) {
8618             printf("Leak of %d blocks found in xmlDictSize",
8619                    xmlMemBlocks() - mem_base);
8620             test_ret++;
8621             printf(" %d", n_dict);
8622             printf("\n");
8623         }
8624     }
8625     function_tests++;
8626
8627     return(test_ret);
8628 }
8629
8630
8631 static int
8632 test_xmlInitializeDict(void) {
8633     int test_ret = 0;
8634
8635     int mem_base;
8636     int ret_val;
8637
8638         mem_base = xmlMemBlocks();
8639
8640         ret_val = xmlInitializeDict();
8641         desret_int(ret_val);
8642         call_tests++;
8643         xmlResetLastError();
8644         if (mem_base != xmlMemBlocks()) {
8645             printf("Leak of %d blocks found in xmlInitializeDict",
8646                    xmlMemBlocks() - mem_base);
8647             test_ret++;
8648             printf("\n");
8649         }
8650     function_tests++;
8651
8652     return(test_ret);
8653 }
8654
8655 static int
8656 test_dict(void) {
8657     int test_ret = 0;
8658         int rc = 0;
8659
8660     if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
8661     rc = test_xmlDictCleanup();
8662         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8663     rc = test_xmlDictCreate();
8664         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8665     rc = test_xmlDictCreateSub();
8666         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8667     rc = test_xmlDictExists();
8668         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8669     rc = test_xmlDictGetUsage();
8670         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8671     rc = test_xmlDictLookup();
8672         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8673     rc = test_xmlDictOwns();
8674         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8675     rc = test_xmlDictQLookup();
8676         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8677     rc = test_xmlDictReference();
8678         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8679     rc = test_xmlDictSetLimit();
8680         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8681     rc = test_xmlDictSize();
8682         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8683     rc = test_xmlInitializeDict();
8684         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8685
8686     if (test_ret != 0)
8687         printf("Module dict: %d errors\n", test_ret);
8688     return(test_ret);
8689 }
8690
8691 static int
8692 test_UTF8Toisolat1(void) {
8693     int test_ret = 0;
8694
8695 #if defined(LIBXML_OUTPUT_ENABLED)
8696 #ifdef LIBXML_OUTPUT_ENABLED
8697     int mem_base;
8698     int ret_val;
8699     unsigned char * out; /* a pointer to an array of bytes to store the result */
8700     int n_out;
8701     int * outlen; /* the length of @out */
8702     int n_outlen;
8703     unsigned char * in; /* a pointer to an array of UTF-8 chars */
8704     int n_in;
8705     int * inlen; /* the length of @in */
8706     int n_inlen;
8707
8708     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8709     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8710     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8711     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8712         mem_base = xmlMemBlocks();
8713         out = gen_unsigned_char_ptr(n_out, 0);
8714         outlen = gen_int_ptr(n_outlen, 1);
8715         in = gen_const_unsigned_char_ptr(n_in, 2);
8716         inlen = gen_int_ptr(n_inlen, 3);
8717
8718         ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8719         desret_int(ret_val);
8720         call_tests++;
8721         des_unsigned_char_ptr(n_out, out, 0);
8722         des_int_ptr(n_outlen, outlen, 1);
8723         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8724         des_int_ptr(n_inlen, inlen, 3);
8725         xmlResetLastError();
8726         if (mem_base != xmlMemBlocks()) {
8727             printf("Leak of %d blocks found in UTF8Toisolat1",
8728                    xmlMemBlocks() - mem_base);
8729             test_ret++;
8730             printf(" %d", n_out);
8731             printf(" %d", n_outlen);
8732             printf(" %d", n_in);
8733             printf(" %d", n_inlen);
8734             printf("\n");
8735         }
8736     }
8737     }
8738     }
8739     }
8740     function_tests++;
8741 #endif
8742 #endif
8743
8744     return(test_ret);
8745 }
8746
8747
8748 static int
8749 test_isolat1ToUTF8(void) {
8750     int test_ret = 0;
8751
8752     int mem_base;
8753     int ret_val;
8754     unsigned char * out; /* a pointer to an array of bytes to store the result */
8755     int n_out;
8756     int * outlen; /* the length of @out */
8757     int n_outlen;
8758     unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8759     int n_in;
8760     int * inlen; /* the length of @in */
8761     int n_inlen;
8762
8763     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8764     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8765     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8766     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8767         mem_base = xmlMemBlocks();
8768         out = gen_unsigned_char_ptr(n_out, 0);
8769         outlen = gen_int_ptr(n_outlen, 1);
8770         in = gen_const_unsigned_char_ptr(n_in, 2);
8771         inlen = gen_int_ptr(n_inlen, 3);
8772
8773         ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8774         desret_int(ret_val);
8775         call_tests++;
8776         des_unsigned_char_ptr(n_out, out, 0);
8777         des_int_ptr(n_outlen, outlen, 1);
8778         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8779         des_int_ptr(n_inlen, inlen, 3);
8780         xmlResetLastError();
8781         if (mem_base != xmlMemBlocks()) {
8782             printf("Leak of %d blocks found in isolat1ToUTF8",
8783                    xmlMemBlocks() - mem_base);
8784             test_ret++;
8785             printf(" %d", n_out);
8786             printf(" %d", n_outlen);
8787             printf(" %d", n_in);
8788             printf(" %d", n_inlen);
8789             printf("\n");
8790         }
8791     }
8792     }
8793     }
8794     }
8795     function_tests++;
8796
8797     return(test_ret);
8798 }
8799
8800
8801 static int
8802 test_xmlAddEncodingAlias(void) {
8803     int test_ret = 0;
8804
8805     int ret_val;
8806     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8807     int n_name;
8808     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8809     int n_alias;
8810
8811     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8812     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8813         name = gen_const_char_ptr(n_name, 0);
8814         alias = gen_const_char_ptr(n_alias, 1);
8815
8816         ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8817         desret_int(ret_val);
8818         call_tests++;
8819         des_const_char_ptr(n_name, (const char *)name, 0);
8820         des_const_char_ptr(n_alias, (const char *)alias, 1);
8821         xmlResetLastError();
8822     }
8823     }
8824     function_tests++;
8825
8826     return(test_ret);
8827 }
8828
8829
8830 #define gen_nb_xmlCharEncodingHandler_ptr 1
8831 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8832     return(NULL);
8833 }
8834 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8835 }
8836
8837 static int
8838 test_xmlCharEncCloseFunc(void) {
8839     int test_ret = 0;
8840
8841     int mem_base;
8842     int ret_val;
8843     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8844     int n_handler;
8845
8846     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8847         mem_base = xmlMemBlocks();
8848         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8849
8850         ret_val = xmlCharEncCloseFunc(handler);
8851         desret_int(ret_val);
8852         call_tests++;
8853         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8854         xmlResetLastError();
8855         if (mem_base != xmlMemBlocks()) {
8856             printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8857                    xmlMemBlocks() - mem_base);
8858             test_ret++;
8859             printf(" %d", n_handler);
8860             printf("\n");
8861         }
8862     }
8863     function_tests++;
8864
8865     return(test_ret);
8866 }
8867
8868
8869 static int
8870 test_xmlCharEncFirstLine(void) {
8871     int test_ret = 0;
8872
8873     int mem_base;
8874     int ret_val;
8875     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8876     int n_handler;
8877     xmlBufferPtr out; /* an xmlBuffer for the output. */
8878     int n_out;
8879     xmlBufferPtr in; /* an xmlBuffer for the input */
8880     int n_in;
8881
8882     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8883     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8884     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8885         mem_base = xmlMemBlocks();
8886         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8887         out = gen_xmlBufferPtr(n_out, 1);
8888         in = gen_xmlBufferPtr(n_in, 2);
8889
8890         ret_val = xmlCharEncFirstLine(handler, out, in);
8891         desret_int(ret_val);
8892         call_tests++;
8893         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8894         des_xmlBufferPtr(n_out, out, 1);
8895         des_xmlBufferPtr(n_in, in, 2);
8896         xmlResetLastError();
8897         if (mem_base != xmlMemBlocks()) {
8898             printf("Leak of %d blocks found in xmlCharEncFirstLine",
8899                    xmlMemBlocks() - mem_base);
8900             test_ret++;
8901             printf(" %d", n_handler);
8902             printf(" %d", n_out);
8903             printf(" %d", n_in);
8904             printf("\n");
8905         }
8906     }
8907     }
8908     }
8909     function_tests++;
8910
8911     return(test_ret);
8912 }
8913
8914
8915 static int
8916 test_xmlCharEncInFunc(void) {
8917     int test_ret = 0;
8918
8919     int mem_base;
8920     int ret_val;
8921     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8922     int n_handler;
8923     xmlBufferPtr out; /* an xmlBuffer for the output. */
8924     int n_out;
8925     xmlBufferPtr in; /* an xmlBuffer for the input */
8926     int n_in;
8927
8928     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8929     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8930     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8931         mem_base = xmlMemBlocks();
8932         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8933         out = gen_xmlBufferPtr(n_out, 1);
8934         in = gen_xmlBufferPtr(n_in, 2);
8935
8936         ret_val = xmlCharEncInFunc(handler, out, in);
8937         desret_int(ret_val);
8938         call_tests++;
8939         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8940         des_xmlBufferPtr(n_out, out, 1);
8941         des_xmlBufferPtr(n_in, in, 2);
8942         xmlResetLastError();
8943         if (mem_base != xmlMemBlocks()) {
8944             printf("Leak of %d blocks found in xmlCharEncInFunc",
8945                    xmlMemBlocks() - mem_base);
8946             test_ret++;
8947             printf(" %d", n_handler);
8948             printf(" %d", n_out);
8949             printf(" %d", n_in);
8950             printf("\n");
8951         }
8952     }
8953     }
8954     }
8955     function_tests++;
8956
8957     return(test_ret);
8958 }
8959
8960
8961 static int
8962 test_xmlCharEncOutFunc(void) {
8963     int test_ret = 0;
8964
8965     int mem_base;
8966     int ret_val;
8967     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8968     int n_handler;
8969     xmlBufferPtr out; /* an xmlBuffer for the output. */
8970     int n_out;
8971     xmlBufferPtr in; /* an xmlBuffer for the input */
8972     int n_in;
8973
8974     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8975     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8976     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8977         mem_base = xmlMemBlocks();
8978         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8979         out = gen_xmlBufferPtr(n_out, 1);
8980         in = gen_xmlBufferPtr(n_in, 2);
8981
8982         ret_val = xmlCharEncOutFunc(handler, out, in);
8983         desret_int(ret_val);
8984         call_tests++;
8985         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8986         des_xmlBufferPtr(n_out, out, 1);
8987         des_xmlBufferPtr(n_in, in, 2);
8988         xmlResetLastError();
8989         if (mem_base != xmlMemBlocks()) {
8990             printf("Leak of %d blocks found in xmlCharEncOutFunc",
8991                    xmlMemBlocks() - mem_base);
8992             test_ret++;
8993             printf(" %d", n_handler);
8994             printf(" %d", n_out);
8995             printf(" %d", n_in);
8996             printf("\n");
8997         }
8998     }
8999     }
9000     }
9001     function_tests++;
9002
9003     return(test_ret);
9004 }
9005
9006
9007 static int
9008 test_xmlCleanupCharEncodingHandlers(void) {
9009     int test_ret = 0;
9010
9011
9012
9013         xmlCleanupCharEncodingHandlers();
9014         call_tests++;
9015         xmlResetLastError();
9016     function_tests++;
9017
9018     return(test_ret);
9019 }
9020
9021
9022 static int
9023 test_xmlCleanupEncodingAliases(void) {
9024     int test_ret = 0;
9025
9026     int mem_base;
9027
9028         mem_base = xmlMemBlocks();
9029
9030         xmlCleanupEncodingAliases();
9031         call_tests++;
9032         xmlResetLastError();
9033         if (mem_base != xmlMemBlocks()) {
9034             printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
9035                    xmlMemBlocks() - mem_base);
9036             test_ret++;
9037             printf("\n");
9038         }
9039     function_tests++;
9040
9041     return(test_ret);
9042 }
9043
9044
9045 static int
9046 test_xmlDelEncodingAlias(void) {
9047     int test_ret = 0;
9048
9049     int mem_base;
9050     int ret_val;
9051     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
9052     int n_alias;
9053
9054     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9055         mem_base = xmlMemBlocks();
9056         alias = gen_const_char_ptr(n_alias, 0);
9057
9058         ret_val = xmlDelEncodingAlias((const char *)alias);
9059         desret_int(ret_val);
9060         call_tests++;
9061         des_const_char_ptr(n_alias, (const char *)alias, 0);
9062         xmlResetLastError();
9063         if (mem_base != xmlMemBlocks()) {
9064             printf("Leak of %d blocks found in xmlDelEncodingAlias",
9065                    xmlMemBlocks() - mem_base);
9066             test_ret++;
9067             printf(" %d", n_alias);
9068             printf("\n");
9069         }
9070     }
9071     function_tests++;
9072
9073     return(test_ret);
9074 }
9075
9076
9077 static int
9078 test_xmlDetectCharEncoding(void) {
9079     int test_ret = 0;
9080
9081     int mem_base;
9082     xmlCharEncoding ret_val;
9083     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). */
9084     int n_in;
9085     int len; /* pointer to the length of the buffer */
9086     int n_len;
9087
9088     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
9089     for (n_len = 0;n_len < gen_nb_int;n_len++) {
9090         mem_base = xmlMemBlocks();
9091         in = gen_const_unsigned_char_ptr(n_in, 0);
9092         len = gen_int(n_len, 1);
9093
9094         ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
9095         desret_xmlCharEncoding(ret_val);
9096         call_tests++;
9097         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
9098         des_int(n_len, len, 1);
9099         xmlResetLastError();
9100         if (mem_base != xmlMemBlocks()) {
9101             printf("Leak of %d blocks found in xmlDetectCharEncoding",
9102                    xmlMemBlocks() - mem_base);
9103             test_ret++;
9104             printf(" %d", n_in);
9105             printf(" %d", n_len);
9106             printf("\n");
9107         }
9108     }
9109     }
9110     function_tests++;
9111
9112     return(test_ret);
9113 }
9114
9115
9116 static int
9117 test_xmlFindCharEncodingHandler(void) {
9118     int test_ret = 0;
9119
9120
9121     /* missing type support */
9122     return(test_ret);
9123 }
9124
9125
9126 static int
9127 test_xmlGetCharEncodingHandler(void) {
9128     int test_ret = 0;
9129
9130
9131     /* missing type support */
9132     return(test_ret);
9133 }
9134
9135
9136 static int
9137 test_xmlGetCharEncodingName(void) {
9138     int test_ret = 0;
9139
9140     int mem_base;
9141     const char * ret_val;
9142     xmlCharEncoding enc; /* the encoding */
9143     int n_enc;
9144
9145     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
9146         mem_base = xmlMemBlocks();
9147         enc = gen_xmlCharEncoding(n_enc, 0);
9148
9149         ret_val = xmlGetCharEncodingName(enc);
9150         desret_const_char_ptr(ret_val);
9151         call_tests++;
9152         des_xmlCharEncoding(n_enc, enc, 0);
9153         xmlResetLastError();
9154         if (mem_base != xmlMemBlocks()) {
9155             printf("Leak of %d blocks found in xmlGetCharEncodingName",
9156                    xmlMemBlocks() - mem_base);
9157             test_ret++;
9158             printf(" %d", n_enc);
9159             printf("\n");
9160         }
9161     }
9162     function_tests++;
9163
9164     return(test_ret);
9165 }
9166
9167
9168 static int
9169 test_xmlGetEncodingAlias(void) {
9170     int test_ret = 0;
9171
9172     int mem_base;
9173     const char * ret_val;
9174     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
9175     int n_alias;
9176
9177     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9178         mem_base = xmlMemBlocks();
9179         alias = gen_const_char_ptr(n_alias, 0);
9180
9181         ret_val = xmlGetEncodingAlias((const char *)alias);
9182         desret_const_char_ptr(ret_val);
9183         call_tests++;
9184         des_const_char_ptr(n_alias, (const char *)alias, 0);
9185         xmlResetLastError();
9186         if (mem_base != xmlMemBlocks()) {
9187             printf("Leak of %d blocks found in xmlGetEncodingAlias",
9188                    xmlMemBlocks() - mem_base);
9189             test_ret++;
9190             printf(" %d", n_alias);
9191             printf("\n");
9192         }
9193     }
9194     function_tests++;
9195
9196     return(test_ret);
9197 }
9198
9199
9200 static int
9201 test_xmlInitCharEncodingHandlers(void) {
9202     int test_ret = 0;
9203
9204
9205
9206         xmlInitCharEncodingHandlers();
9207         call_tests++;
9208         xmlResetLastError();
9209     function_tests++;
9210
9211     return(test_ret);
9212 }
9213
9214
9215 static int
9216 test_xmlNewCharEncodingHandler(void) {
9217     int test_ret = 0;
9218
9219
9220     /* missing type support */
9221     return(test_ret);
9222 }
9223
9224
9225 static int
9226 test_xmlParseCharEncoding(void) {
9227     int test_ret = 0;
9228
9229     int mem_base;
9230     xmlCharEncoding ret_val;
9231     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9232     int n_name;
9233
9234     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9235         mem_base = xmlMemBlocks();
9236         name = gen_const_char_ptr(n_name, 0);
9237
9238         ret_val = xmlParseCharEncoding((const char *)name);
9239         desret_xmlCharEncoding(ret_val);
9240         call_tests++;
9241         des_const_char_ptr(n_name, (const char *)name, 0);
9242         xmlResetLastError();
9243         if (mem_base != xmlMemBlocks()) {
9244             printf("Leak of %d blocks found in xmlParseCharEncoding",
9245                    xmlMemBlocks() - mem_base);
9246             test_ret++;
9247             printf(" %d", n_name);
9248             printf("\n");
9249         }
9250     }
9251     function_tests++;
9252
9253     return(test_ret);
9254 }
9255
9256
9257 #define gen_nb_xmlCharEncodingHandlerPtr 1
9258 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9259     return(NULL);
9260 }
9261 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9262 }
9263
9264 static int
9265 test_xmlRegisterCharEncodingHandler(void) {
9266     int test_ret = 0;
9267
9268     int mem_base;
9269     xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9270     int n_handler;
9271
9272     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9273         mem_base = xmlMemBlocks();
9274         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9275
9276         xmlRegisterCharEncodingHandler(handler);
9277         call_tests++;
9278         des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9279         xmlResetLastError();
9280         if (mem_base != xmlMemBlocks()) {
9281             printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9282                    xmlMemBlocks() - mem_base);
9283             test_ret++;
9284             printf(" %d", n_handler);
9285             printf("\n");
9286         }
9287     }
9288     function_tests++;
9289
9290     return(test_ret);
9291 }
9292
9293 static int
9294 test_encoding(void) {
9295     int test_ret = 0;
9296         int rc = 0;
9297
9298     if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9299     rc = test_UTF8Toisolat1();
9300         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9301     rc = test_isolat1ToUTF8();
9302         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9303     rc = test_xmlAddEncodingAlias();
9304         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9305     rc = test_xmlCharEncCloseFunc();
9306         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9307     rc = test_xmlCharEncFirstLine();
9308         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9309     rc = test_xmlCharEncInFunc();
9310         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9311     rc = test_xmlCharEncOutFunc();
9312         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9313     rc = test_xmlCleanupCharEncodingHandlers();
9314         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9315     rc = test_xmlCleanupEncodingAliases();
9316         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9317     rc = test_xmlDelEncodingAlias();
9318         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9319     rc = test_xmlDetectCharEncoding();
9320         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9321     rc = test_xmlFindCharEncodingHandler();
9322         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9323     rc = test_xmlGetCharEncodingHandler();
9324         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9325     rc = test_xmlGetCharEncodingName();
9326         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9327     rc = test_xmlGetEncodingAlias();
9328         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9329     rc = test_xmlInitCharEncodingHandlers();
9330         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9331     rc = test_xmlNewCharEncodingHandler();
9332         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9333     rc = test_xmlParseCharEncoding();
9334         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9335     rc = test_xmlRegisterCharEncodingHandler();
9336         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9337
9338     if (test_ret != 0)
9339         printf("Module encoding: %d errors\n", test_ret);
9340     return(test_ret);
9341 }
9342
9343 static int
9344 test_xmlAddDocEntity(void) {
9345     int test_ret = 0;
9346
9347     int mem_base;
9348     xmlEntityPtr ret_val;
9349     xmlDocPtr doc; /* the document */
9350     int n_doc;
9351     xmlChar * name; /* the entity name */
9352     int n_name;
9353     int type; /* the entity type XML_xxx_yyy_ENTITY */
9354     int n_type;
9355     xmlChar * ExternalID; /* the entity external ID if available */
9356     int n_ExternalID;
9357     xmlChar * SystemID; /* the entity system ID if available */
9358     int n_SystemID;
9359     xmlChar * content; /* the entity content */
9360     int n_content;
9361
9362     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9363     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9364     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9365     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9366     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9367     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9368         mem_base = xmlMemBlocks();
9369         doc = gen_xmlDocPtr(n_doc, 0);
9370         name = gen_const_xmlChar_ptr(n_name, 1);
9371         type = gen_int(n_type, 2);
9372         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9373         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9374         content = gen_const_xmlChar_ptr(n_content, 5);
9375
9376         ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9377         desret_xmlEntityPtr(ret_val);
9378         call_tests++;
9379         des_xmlDocPtr(n_doc, doc, 0);
9380         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9381         des_int(n_type, type, 2);
9382         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9383         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9384         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9385         xmlResetLastError();
9386         if (mem_base != xmlMemBlocks()) {
9387             printf("Leak of %d blocks found in xmlAddDocEntity",
9388                    xmlMemBlocks() - mem_base);
9389             test_ret++;
9390             printf(" %d", n_doc);
9391             printf(" %d", n_name);
9392             printf(" %d", n_type);
9393             printf(" %d", n_ExternalID);
9394             printf(" %d", n_SystemID);
9395             printf(" %d", n_content);
9396             printf("\n");
9397         }
9398     }
9399     }
9400     }
9401     }
9402     }
9403     }
9404     function_tests++;
9405
9406     return(test_ret);
9407 }
9408
9409
9410 static int
9411 test_xmlAddDtdEntity(void) {
9412     int test_ret = 0;
9413
9414     int mem_base;
9415     xmlEntityPtr ret_val;
9416     xmlDocPtr doc; /* the document */
9417     int n_doc;
9418     xmlChar * name; /* the entity name */
9419     int n_name;
9420     int type; /* the entity type XML_xxx_yyy_ENTITY */
9421     int n_type;
9422     xmlChar * ExternalID; /* the entity external ID if available */
9423     int n_ExternalID;
9424     xmlChar * SystemID; /* the entity system ID if available */
9425     int n_SystemID;
9426     xmlChar * content; /* the entity content */
9427     int n_content;
9428
9429     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9430     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9431     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9432     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9433     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9434     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9435         mem_base = xmlMemBlocks();
9436         doc = gen_xmlDocPtr(n_doc, 0);
9437         name = gen_const_xmlChar_ptr(n_name, 1);
9438         type = gen_int(n_type, 2);
9439         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9440         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9441         content = gen_const_xmlChar_ptr(n_content, 5);
9442
9443         ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9444         desret_xmlEntityPtr(ret_val);
9445         call_tests++;
9446         des_xmlDocPtr(n_doc, doc, 0);
9447         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9448         des_int(n_type, type, 2);
9449         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9450         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9451         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9452         xmlResetLastError();
9453         if (mem_base != xmlMemBlocks()) {
9454             printf("Leak of %d blocks found in xmlAddDtdEntity",
9455                    xmlMemBlocks() - mem_base);
9456             test_ret++;
9457             printf(" %d", n_doc);
9458             printf(" %d", n_name);
9459             printf(" %d", n_type);
9460             printf(" %d", n_ExternalID);
9461             printf(" %d", n_SystemID);
9462             printf(" %d", n_content);
9463             printf("\n");
9464         }
9465     }
9466     }
9467     }
9468     }
9469     }
9470     }
9471     function_tests++;
9472
9473     return(test_ret);
9474 }
9475
9476
9477 static int
9478 test_xmlCleanupPredefinedEntities(void) {
9479     int test_ret = 0;
9480
9481 #if defined(LIBXML_LEGACY_ENABLED)
9482 #ifdef LIBXML_LEGACY_ENABLED
9483     int mem_base;
9484
9485         mem_base = xmlMemBlocks();
9486
9487         xmlCleanupPredefinedEntities();
9488         call_tests++;
9489         xmlResetLastError();
9490         if (mem_base != xmlMemBlocks()) {
9491             printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9492                    xmlMemBlocks() - mem_base);
9493             test_ret++;
9494             printf("\n");
9495         }
9496     function_tests++;
9497 #endif
9498 #endif
9499
9500     return(test_ret);
9501 }
9502
9503
9504 #define gen_nb_xmlEntitiesTablePtr 1
9505 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9506     return(NULL);
9507 }
9508 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9509 }
9510
9511 static int
9512 test_xmlCopyEntitiesTable(void) {
9513     int test_ret = 0;
9514
9515
9516     /* missing type support */
9517     return(test_ret);
9518 }
9519
9520
9521 static int
9522 test_xmlCreateEntitiesTable(void) {
9523     int test_ret = 0;
9524
9525
9526     /* missing type support */
9527     return(test_ret);
9528 }
9529
9530
9531 static int
9532 test_xmlDumpEntitiesTable(void) {
9533     int test_ret = 0;
9534
9535 #if defined(LIBXML_OUTPUT_ENABLED)
9536     int mem_base;
9537     xmlBufferPtr buf; /* An XML buffer. */
9538     int n_buf;
9539     xmlEntitiesTablePtr table; /* An entity table */
9540     int n_table;
9541
9542     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9543     for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9544         mem_base = xmlMemBlocks();
9545         buf = gen_xmlBufferPtr(n_buf, 0);
9546         table = gen_xmlEntitiesTablePtr(n_table, 1);
9547
9548         xmlDumpEntitiesTable(buf, table);
9549         call_tests++;
9550         des_xmlBufferPtr(n_buf, buf, 0);
9551         des_xmlEntitiesTablePtr(n_table, table, 1);
9552         xmlResetLastError();
9553         if (mem_base != xmlMemBlocks()) {
9554             printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9555                    xmlMemBlocks() - mem_base);
9556             test_ret++;
9557             printf(" %d", n_buf);
9558             printf(" %d", n_table);
9559             printf("\n");
9560         }
9561     }
9562     }
9563     function_tests++;
9564 #endif
9565
9566     return(test_ret);
9567 }
9568
9569
9570 #define gen_nb_xmlEntityPtr 1
9571 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9572     return(NULL);
9573 }
9574 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9575 }
9576
9577 static int
9578 test_xmlDumpEntityDecl(void) {
9579     int test_ret = 0;
9580
9581 #if defined(LIBXML_OUTPUT_ENABLED)
9582     int mem_base;
9583     xmlBufferPtr buf; /* An XML buffer. */
9584     int n_buf;
9585     xmlEntityPtr ent; /* An entity table */
9586     int n_ent;
9587
9588     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9589     for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9590         mem_base = xmlMemBlocks();
9591         buf = gen_xmlBufferPtr(n_buf, 0);
9592         ent = gen_xmlEntityPtr(n_ent, 1);
9593
9594         xmlDumpEntityDecl(buf, ent);
9595         call_tests++;
9596         des_xmlBufferPtr(n_buf, buf, 0);
9597         des_xmlEntityPtr(n_ent, ent, 1);
9598         xmlResetLastError();
9599         if (mem_base != xmlMemBlocks()) {
9600             printf("Leak of %d blocks found in xmlDumpEntityDecl",
9601                    xmlMemBlocks() - mem_base);
9602             test_ret++;
9603             printf(" %d", n_buf);
9604             printf(" %d", n_ent);
9605             printf("\n");
9606         }
9607     }
9608     }
9609     function_tests++;
9610 #endif
9611
9612     return(test_ret);
9613 }
9614
9615
9616 static int
9617 test_xmlEncodeEntitiesReentrant(void) {
9618     int test_ret = 0;
9619
9620     int mem_base;
9621     xmlChar * ret_val;
9622     xmlDocPtr doc; /* the document containing the string */
9623     int n_doc;
9624     xmlChar * input; /* A string to convert to XML. */
9625     int n_input;
9626
9627     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9628     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9629         mem_base = xmlMemBlocks();
9630         doc = gen_xmlDocPtr(n_doc, 0);
9631         input = gen_const_xmlChar_ptr(n_input, 1);
9632
9633         ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9634         desret_xmlChar_ptr(ret_val);
9635         call_tests++;
9636         des_xmlDocPtr(n_doc, doc, 0);
9637         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9638         xmlResetLastError();
9639         if (mem_base != xmlMemBlocks()) {
9640             printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9641                    xmlMemBlocks() - mem_base);
9642             test_ret++;
9643             printf(" %d", n_doc);
9644             printf(" %d", n_input);
9645             printf("\n");
9646         }
9647     }
9648     }
9649     function_tests++;
9650
9651     return(test_ret);
9652 }
9653
9654
9655 #define gen_nb_const_xmlDoc_ptr 1
9656 static xmlDoc * gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9657     return(NULL);
9658 }
9659 static void des_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, const xmlDoc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9660 }
9661
9662 static int
9663 test_xmlEncodeSpecialChars(void) {
9664     int test_ret = 0;
9665
9666     int mem_base;
9667     xmlChar * ret_val;
9668     xmlDoc * doc; /* the document containing the string */
9669     int n_doc;
9670     xmlChar * input; /* A string to convert to XML. */
9671     int n_input;
9672
9673     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9674     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9675         mem_base = xmlMemBlocks();
9676         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9677         input = gen_const_xmlChar_ptr(n_input, 1);
9678
9679         ret_val = xmlEncodeSpecialChars((const xmlDoc *)doc, (const xmlChar *)input);
9680         desret_xmlChar_ptr(ret_val);
9681         call_tests++;
9682         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9683         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9684         xmlResetLastError();
9685         if (mem_base != xmlMemBlocks()) {
9686             printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9687                    xmlMemBlocks() - mem_base);
9688             test_ret++;
9689             printf(" %d", n_doc);
9690             printf(" %d", n_input);
9691             printf("\n");
9692         }
9693     }
9694     }
9695     function_tests++;
9696
9697     return(test_ret);
9698 }
9699
9700
9701 static int
9702 test_xmlGetDocEntity(void) {
9703     int test_ret = 0;
9704
9705     int mem_base;
9706     xmlEntityPtr ret_val;
9707     xmlDoc * doc; /* the document referencing the entity */
9708     int n_doc;
9709     xmlChar * name; /* the entity name */
9710     int n_name;
9711
9712     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9713     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9714         mem_base = xmlMemBlocks();
9715         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9716         name = gen_const_xmlChar_ptr(n_name, 1);
9717
9718         ret_val = xmlGetDocEntity((const xmlDoc *)doc, (const xmlChar *)name);
9719         desret_xmlEntityPtr(ret_val);
9720         call_tests++;
9721         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9722         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9723         xmlResetLastError();
9724         if (mem_base != xmlMemBlocks()) {
9725             printf("Leak of %d blocks found in xmlGetDocEntity",
9726                    xmlMemBlocks() - mem_base);
9727             test_ret++;
9728             printf(" %d", n_doc);
9729             printf(" %d", n_name);
9730             printf("\n");
9731         }
9732     }
9733     }
9734     function_tests++;
9735
9736     return(test_ret);
9737 }
9738
9739
9740 static int
9741 test_xmlGetDtdEntity(void) {
9742     int test_ret = 0;
9743
9744     int mem_base;
9745     xmlEntityPtr ret_val;
9746     xmlDocPtr doc; /* the document referencing the entity */
9747     int n_doc;
9748     xmlChar * name; /* the entity name */
9749     int n_name;
9750
9751     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9752     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9753         mem_base = xmlMemBlocks();
9754         doc = gen_xmlDocPtr(n_doc, 0);
9755         name = gen_const_xmlChar_ptr(n_name, 1);
9756
9757         ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9758         desret_xmlEntityPtr(ret_val);
9759         call_tests++;
9760         des_xmlDocPtr(n_doc, doc, 0);
9761         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9762         xmlResetLastError();
9763         if (mem_base != xmlMemBlocks()) {
9764             printf("Leak of %d blocks found in xmlGetDtdEntity",
9765                    xmlMemBlocks() - mem_base);
9766             test_ret++;
9767             printf(" %d", n_doc);
9768             printf(" %d", n_name);
9769             printf("\n");
9770         }
9771     }
9772     }
9773     function_tests++;
9774
9775     return(test_ret);
9776 }
9777
9778
9779 static int
9780 test_xmlGetParameterEntity(void) {
9781     int test_ret = 0;
9782
9783     int mem_base;
9784     xmlEntityPtr ret_val;
9785     xmlDocPtr doc; /* the document referencing the entity */
9786     int n_doc;
9787     xmlChar * name; /* the entity name */
9788     int n_name;
9789
9790     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9791     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9792         mem_base = xmlMemBlocks();
9793         doc = gen_xmlDocPtr(n_doc, 0);
9794         name = gen_const_xmlChar_ptr(n_name, 1);
9795
9796         ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9797         desret_xmlEntityPtr(ret_val);
9798         call_tests++;
9799         des_xmlDocPtr(n_doc, doc, 0);
9800         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9801         xmlResetLastError();
9802         if (mem_base != xmlMemBlocks()) {
9803             printf("Leak of %d blocks found in xmlGetParameterEntity",
9804                    xmlMemBlocks() - mem_base);
9805             test_ret++;
9806             printf(" %d", n_doc);
9807             printf(" %d", n_name);
9808             printf("\n");
9809         }
9810     }
9811     }
9812     function_tests++;
9813
9814     return(test_ret);
9815 }
9816
9817
9818 static int
9819 test_xmlGetPredefinedEntity(void) {
9820     int test_ret = 0;
9821
9822     int mem_base;
9823     xmlEntityPtr ret_val;
9824     xmlChar * name; /* the entity name */
9825     int n_name;
9826
9827     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9828         mem_base = xmlMemBlocks();
9829         name = gen_const_xmlChar_ptr(n_name, 0);
9830
9831         ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9832         desret_xmlEntityPtr(ret_val);
9833         call_tests++;
9834         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9835         xmlResetLastError();
9836         if (mem_base != xmlMemBlocks()) {
9837             printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9838                    xmlMemBlocks() - mem_base);
9839             test_ret++;
9840             printf(" %d", n_name);
9841             printf("\n");
9842         }
9843     }
9844     function_tests++;
9845
9846     return(test_ret);
9847 }
9848
9849
9850 static int
9851 test_xmlInitializePredefinedEntities(void) {
9852     int test_ret = 0;
9853
9854 #if defined(LIBXML_LEGACY_ENABLED)
9855 #ifdef LIBXML_LEGACY_ENABLED
9856     int mem_base;
9857
9858         mem_base = xmlMemBlocks();
9859
9860         xmlInitializePredefinedEntities();
9861         call_tests++;
9862         xmlResetLastError();
9863         if (mem_base != xmlMemBlocks()) {
9864             printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9865                    xmlMemBlocks() - mem_base);
9866             test_ret++;
9867             printf("\n");
9868         }
9869     function_tests++;
9870 #endif
9871 #endif
9872
9873     return(test_ret);
9874 }
9875
9876
9877 static int
9878 test_xmlNewEntity(void) {
9879     int test_ret = 0;
9880
9881     int mem_base;
9882     xmlEntityPtr ret_val;
9883     xmlDocPtr doc; /* the document */
9884     int n_doc;
9885     xmlChar * name; /* the entity name */
9886     int n_name;
9887     int type; /* the entity type XML_xxx_yyy_ENTITY */
9888     int n_type;
9889     xmlChar * ExternalID; /* the entity external ID if available */
9890     int n_ExternalID;
9891     xmlChar * SystemID; /* the entity system ID if available */
9892     int n_SystemID;
9893     xmlChar * content; /* the entity content */
9894     int n_content;
9895
9896     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9897     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9898     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9899     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9900     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9901     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9902         mem_base = xmlMemBlocks();
9903         doc = gen_xmlDocPtr(n_doc, 0);
9904         name = gen_const_xmlChar_ptr(n_name, 1);
9905         type = gen_int(n_type, 2);
9906         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9907         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9908         content = gen_const_xmlChar_ptr(n_content, 5);
9909
9910         ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9911         desret_xmlEntityPtr(ret_val);
9912         call_tests++;
9913         des_xmlDocPtr(n_doc, doc, 0);
9914         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9915         des_int(n_type, type, 2);
9916         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9917         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9918         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9919         xmlResetLastError();
9920         if (mem_base != xmlMemBlocks()) {
9921             printf("Leak of %d blocks found in xmlNewEntity",
9922                    xmlMemBlocks() - mem_base);
9923             test_ret++;
9924             printf(" %d", n_doc);
9925             printf(" %d", n_name);
9926             printf(" %d", n_type);
9927             printf(" %d", n_ExternalID);
9928             printf(" %d", n_SystemID);
9929             printf(" %d", n_content);
9930             printf("\n");
9931         }
9932     }
9933     }
9934     }
9935     }
9936     }
9937     }
9938     function_tests++;
9939
9940     return(test_ret);
9941 }
9942
9943 static int
9944 test_entities(void) {
9945     int test_ret = 0;
9946         int rc = 0;
9947
9948     if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9949     rc = test_xmlAddDocEntity();
9950         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9951     rc = test_xmlAddDtdEntity();
9952         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9953     rc = test_xmlCleanupPredefinedEntities();
9954         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9955     rc = test_xmlCopyEntitiesTable();
9956         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9957     rc = test_xmlCreateEntitiesTable();
9958         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9959     rc = test_xmlDumpEntitiesTable();
9960         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9961     rc = test_xmlDumpEntityDecl();
9962         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9963     rc = test_xmlEncodeEntitiesReentrant();
9964         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9965     rc = test_xmlEncodeSpecialChars();
9966         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9967     rc = test_xmlGetDocEntity();
9968         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9969     rc = test_xmlGetDtdEntity();
9970         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9971     rc = test_xmlGetParameterEntity();
9972         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9973     rc = test_xmlGetPredefinedEntity();
9974         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9975     rc = test_xmlInitializePredefinedEntities();
9976         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9977     rc = test_xmlNewEntity();
9978         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9979
9980     if (test_ret != 0)
9981         printf("Module entities: %d errors\n", test_ret);
9982     return(test_ret);
9983 }
9984
9985 static int
9986 test_xmlHashAddEntry(void) {
9987     int test_ret = 0;
9988
9989     int mem_base;
9990     int ret_val;
9991     xmlHashTablePtr table; /* the hash table */
9992     int n_table;
9993     xmlChar * name; /* the name of the userdata */
9994     int n_name;
9995     void * userdata; /* a pointer to the userdata */
9996     int n_userdata;
9997
9998     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9999     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10000     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10001         mem_base = xmlMemBlocks();
10002         table = gen_xmlHashTablePtr(n_table, 0);
10003         name = gen_const_xmlChar_ptr(n_name, 1);
10004         userdata = gen_userdata(n_userdata, 2);
10005
10006         ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
10007         desret_int(ret_val);
10008         call_tests++;
10009         des_xmlHashTablePtr(n_table, table, 0);
10010         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10011         des_userdata(n_userdata, userdata, 2);
10012         xmlResetLastError();
10013         if (mem_base != xmlMemBlocks()) {
10014             printf("Leak of %d blocks found in xmlHashAddEntry",
10015                    xmlMemBlocks() - mem_base);
10016             test_ret++;
10017             printf(" %d", n_table);
10018             printf(" %d", n_name);
10019             printf(" %d", n_userdata);
10020             printf("\n");
10021         }
10022     }
10023     }
10024     }
10025     function_tests++;
10026
10027     return(test_ret);
10028 }
10029
10030
10031 static int
10032 test_xmlHashAddEntry2(void) {
10033     int test_ret = 0;
10034
10035     int mem_base;
10036     int ret_val;
10037     xmlHashTablePtr table; /* the hash table */
10038     int n_table;
10039     xmlChar * name; /* the name of the userdata */
10040     int n_name;
10041     xmlChar * name2; /* a second name of the userdata */
10042     int n_name2;
10043     void * userdata; /* a pointer to the userdata */
10044     int n_userdata;
10045
10046     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10047     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10048     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10049     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10050         mem_base = xmlMemBlocks();
10051         table = gen_xmlHashTablePtr(n_table, 0);
10052         name = gen_const_xmlChar_ptr(n_name, 1);
10053         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10054         userdata = gen_userdata(n_userdata, 3);
10055
10056         ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
10057         desret_int(ret_val);
10058         call_tests++;
10059         des_xmlHashTablePtr(n_table, table, 0);
10060         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10061         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10062         des_userdata(n_userdata, userdata, 3);
10063         xmlResetLastError();
10064         if (mem_base != xmlMemBlocks()) {
10065             printf("Leak of %d blocks found in xmlHashAddEntry2",
10066                    xmlMemBlocks() - mem_base);
10067             test_ret++;
10068             printf(" %d", n_table);
10069             printf(" %d", n_name);
10070             printf(" %d", n_name2);
10071             printf(" %d", n_userdata);
10072             printf("\n");
10073         }
10074     }
10075     }
10076     }
10077     }
10078     function_tests++;
10079
10080     return(test_ret);
10081 }
10082
10083
10084 static int
10085 test_xmlHashAddEntry3(void) {
10086     int test_ret = 0;
10087
10088     int mem_base;
10089     int ret_val;
10090     xmlHashTablePtr table; /* the hash table */
10091     int n_table;
10092     xmlChar * name; /* the name of the userdata */
10093     int n_name;
10094     xmlChar * name2; /* a second name of the userdata */
10095     int n_name2;
10096     xmlChar * name3; /* a third name of the userdata */
10097     int n_name3;
10098     void * userdata; /* a pointer to the userdata */
10099     int n_userdata;
10100
10101     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10102     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10103     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10104     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10105     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10106         mem_base = xmlMemBlocks();
10107         table = gen_xmlHashTablePtr(n_table, 0);
10108         name = gen_const_xmlChar_ptr(n_name, 1);
10109         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10110         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10111         userdata = gen_userdata(n_userdata, 4);
10112
10113         ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
10114         desret_int(ret_val);
10115         call_tests++;
10116         des_xmlHashTablePtr(n_table, table, 0);
10117         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10118         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10119         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10120         des_userdata(n_userdata, userdata, 4);
10121         xmlResetLastError();
10122         if (mem_base != xmlMemBlocks()) {
10123             printf("Leak of %d blocks found in xmlHashAddEntry3",
10124                    xmlMemBlocks() - mem_base);
10125             test_ret++;
10126             printf(" %d", n_table);
10127             printf(" %d", n_name);
10128             printf(" %d", n_name2);
10129             printf(" %d", n_name3);
10130             printf(" %d", n_userdata);
10131             printf("\n");
10132         }
10133     }
10134     }
10135     }
10136     }
10137     }
10138     function_tests++;
10139
10140     return(test_ret);
10141 }
10142
10143
10144 static int
10145 test_xmlHashCopy(void) {
10146     int test_ret = 0;
10147
10148
10149     /* missing type support */
10150     return(test_ret);
10151 }
10152
10153
10154 static int
10155 test_xmlHashCreate(void) {
10156     int test_ret = 0;
10157
10158
10159     /* missing type support */
10160     return(test_ret);
10161 }
10162
10163
10164 static int
10165 test_xmlHashCreateDict(void) {
10166     int test_ret = 0;
10167
10168
10169     /* missing type support */
10170     return(test_ret);
10171 }
10172
10173
10174 static int
10175 test_xmlHashLookup(void) {
10176     int test_ret = 0;
10177
10178     int mem_base;
10179     void * ret_val;
10180     xmlHashTablePtr table; /* the hash table */
10181     int n_table;
10182     xmlChar * name; /* the name of the userdata */
10183     int n_name;
10184
10185     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10186     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10187         mem_base = xmlMemBlocks();
10188         table = gen_xmlHashTablePtr(n_table, 0);
10189         name = gen_const_xmlChar_ptr(n_name, 1);
10190
10191         ret_val = xmlHashLookup(table, (const xmlChar *)name);
10192         desret_void_ptr(ret_val);
10193         call_tests++;
10194         des_xmlHashTablePtr(n_table, table, 0);
10195         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10196         xmlResetLastError();
10197         if (mem_base != xmlMemBlocks()) {
10198             printf("Leak of %d blocks found in xmlHashLookup",
10199                    xmlMemBlocks() - mem_base);
10200             test_ret++;
10201             printf(" %d", n_table);
10202             printf(" %d", n_name);
10203             printf("\n");
10204         }
10205     }
10206     }
10207     function_tests++;
10208
10209     return(test_ret);
10210 }
10211
10212
10213 static int
10214 test_xmlHashLookup2(void) {
10215     int test_ret = 0;
10216
10217     int mem_base;
10218     void * ret_val;
10219     xmlHashTablePtr table; /* the hash table */
10220     int n_table;
10221     xmlChar * name; /* the name of the userdata */
10222     int n_name;
10223     xmlChar * name2; /* a second name of the userdata */
10224     int n_name2;
10225
10226     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10227     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10228     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10229         mem_base = xmlMemBlocks();
10230         table = gen_xmlHashTablePtr(n_table, 0);
10231         name = gen_const_xmlChar_ptr(n_name, 1);
10232         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10233
10234         ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
10235         desret_void_ptr(ret_val);
10236         call_tests++;
10237         des_xmlHashTablePtr(n_table, table, 0);
10238         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10239         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10240         xmlResetLastError();
10241         if (mem_base != xmlMemBlocks()) {
10242             printf("Leak of %d blocks found in xmlHashLookup2",
10243                    xmlMemBlocks() - mem_base);
10244             test_ret++;
10245             printf(" %d", n_table);
10246             printf(" %d", n_name);
10247             printf(" %d", n_name2);
10248             printf("\n");
10249         }
10250     }
10251     }
10252     }
10253     function_tests++;
10254
10255     return(test_ret);
10256 }
10257
10258
10259 static int
10260 test_xmlHashLookup3(void) {
10261     int test_ret = 0;
10262
10263     int mem_base;
10264     void * ret_val;
10265     xmlHashTablePtr table; /* the hash table */
10266     int n_table;
10267     xmlChar * name; /* the name of the userdata */
10268     int n_name;
10269     xmlChar * name2; /* a second name of the userdata */
10270     int n_name2;
10271     xmlChar * name3; /* a third name of the userdata */
10272     int n_name3;
10273
10274     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10275     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10276     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10277     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10278         mem_base = xmlMemBlocks();
10279         table = gen_xmlHashTablePtr(n_table, 0);
10280         name = gen_const_xmlChar_ptr(n_name, 1);
10281         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10282         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10283
10284         ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10285         desret_void_ptr(ret_val);
10286         call_tests++;
10287         des_xmlHashTablePtr(n_table, table, 0);
10288         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10289         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10290         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10291         xmlResetLastError();
10292         if (mem_base != xmlMemBlocks()) {
10293             printf("Leak of %d blocks found in xmlHashLookup3",
10294                    xmlMemBlocks() - mem_base);
10295             test_ret++;
10296             printf(" %d", n_table);
10297             printf(" %d", n_name);
10298             printf(" %d", n_name2);
10299             printf(" %d", n_name3);
10300             printf("\n");
10301         }
10302     }
10303     }
10304     }
10305     }
10306     function_tests++;
10307
10308     return(test_ret);
10309 }
10310
10311
10312 static int
10313 test_xmlHashQLookup(void) {
10314     int test_ret = 0;
10315
10316     int mem_base;
10317     void * ret_val;
10318     xmlHashTablePtr table; /* the hash table */
10319     int n_table;
10320     xmlChar * prefix; /* the prefix of the userdata */
10321     int n_prefix;
10322     xmlChar * name; /* the name of the userdata */
10323     int n_name;
10324
10325     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10326     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10327     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10328         mem_base = xmlMemBlocks();
10329         table = gen_xmlHashTablePtr(n_table, 0);
10330         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10331         name = gen_const_xmlChar_ptr(n_name, 2);
10332
10333         ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10334         desret_void_ptr(ret_val);
10335         call_tests++;
10336         des_xmlHashTablePtr(n_table, table, 0);
10337         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10338         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10339         xmlResetLastError();
10340         if (mem_base != xmlMemBlocks()) {
10341             printf("Leak of %d blocks found in xmlHashQLookup",
10342                    xmlMemBlocks() - mem_base);
10343             test_ret++;
10344             printf(" %d", n_table);
10345             printf(" %d", n_prefix);
10346             printf(" %d", n_name);
10347             printf("\n");
10348         }
10349     }
10350     }
10351     }
10352     function_tests++;
10353
10354     return(test_ret);
10355 }
10356
10357
10358 static int
10359 test_xmlHashQLookup2(void) {
10360     int test_ret = 0;
10361
10362     int mem_base;
10363     void * ret_val;
10364     xmlHashTablePtr table; /* the hash table */
10365     int n_table;
10366     xmlChar * prefix; /* the prefix of the userdata */
10367     int n_prefix;
10368     xmlChar * name; /* the name of the userdata */
10369     int n_name;
10370     xmlChar * prefix2; /* the second prefix of the userdata */
10371     int n_prefix2;
10372     xmlChar * name2; /* a second name of the userdata */
10373     int n_name2;
10374
10375     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10376     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10377     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10378     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10379     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10380         mem_base = xmlMemBlocks();
10381         table = gen_xmlHashTablePtr(n_table, 0);
10382         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10383         name = gen_const_xmlChar_ptr(n_name, 2);
10384         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10385         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10386
10387         ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10388         desret_void_ptr(ret_val);
10389         call_tests++;
10390         des_xmlHashTablePtr(n_table, table, 0);
10391         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10392         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10393         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10394         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10395         xmlResetLastError();
10396         if (mem_base != xmlMemBlocks()) {
10397             printf("Leak of %d blocks found in xmlHashQLookup2",
10398                    xmlMemBlocks() - mem_base);
10399             test_ret++;
10400             printf(" %d", n_table);
10401             printf(" %d", n_prefix);
10402             printf(" %d", n_name);
10403             printf(" %d", n_prefix2);
10404             printf(" %d", n_name2);
10405             printf("\n");
10406         }
10407     }
10408     }
10409     }
10410     }
10411     }
10412     function_tests++;
10413
10414     return(test_ret);
10415 }
10416
10417
10418 static int
10419 test_xmlHashQLookup3(void) {
10420     int test_ret = 0;
10421
10422     int mem_base;
10423     void * ret_val;
10424     xmlHashTablePtr table; /* the hash table */
10425     int n_table;
10426     xmlChar * prefix; /* the prefix of the userdata */
10427     int n_prefix;
10428     xmlChar * name; /* the name of the userdata */
10429     int n_name;
10430     xmlChar * prefix2; /* the second prefix of the userdata */
10431     int n_prefix2;
10432     xmlChar * name2; /* a second name of the userdata */
10433     int n_name2;
10434     xmlChar * prefix3; /* the third prefix of the userdata */
10435     int n_prefix3;
10436     xmlChar * name3; /* a third name of the userdata */
10437     int n_name3;
10438
10439     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10440     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10441     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10442     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10443     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10444     for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10445     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10446         mem_base = xmlMemBlocks();
10447         table = gen_xmlHashTablePtr(n_table, 0);
10448         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10449         name = gen_const_xmlChar_ptr(n_name, 2);
10450         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10451         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10452         prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10453         name3 = gen_const_xmlChar_ptr(n_name3, 6);
10454
10455         ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10456         desret_void_ptr(ret_val);
10457         call_tests++;
10458         des_xmlHashTablePtr(n_table, table, 0);
10459         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10460         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10461         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10462         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10463         des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10464         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10465         xmlResetLastError();
10466         if (mem_base != xmlMemBlocks()) {
10467             printf("Leak of %d blocks found in xmlHashQLookup3",
10468                    xmlMemBlocks() - mem_base);
10469             test_ret++;
10470             printf(" %d", n_table);
10471             printf(" %d", n_prefix);
10472             printf(" %d", n_name);
10473             printf(" %d", n_prefix2);
10474             printf(" %d", n_name2);
10475             printf(" %d", n_prefix3);
10476             printf(" %d", n_name3);
10477             printf("\n");
10478         }
10479     }
10480     }
10481     }
10482     }
10483     }
10484     }
10485     }
10486     function_tests++;
10487
10488     return(test_ret);
10489 }
10490
10491
10492 static int
10493 test_xmlHashRemoveEntry(void) {
10494     int test_ret = 0;
10495
10496     int mem_base;
10497     int ret_val;
10498     xmlHashTablePtr table; /* the hash table */
10499     int n_table;
10500     xmlChar * name; /* the name of the userdata */
10501     int n_name;
10502     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10503     int n_f;
10504
10505     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10506     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10507     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10508         mem_base = xmlMemBlocks();
10509         table = gen_xmlHashTablePtr(n_table, 0);
10510         name = gen_const_xmlChar_ptr(n_name, 1);
10511         f = gen_xmlHashDeallocator(n_f, 2);
10512
10513         ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10514         desret_int(ret_val);
10515         call_tests++;
10516         des_xmlHashTablePtr(n_table, table, 0);
10517         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10518         des_xmlHashDeallocator(n_f, f, 2);
10519         xmlResetLastError();
10520         if (mem_base != xmlMemBlocks()) {
10521             printf("Leak of %d blocks found in xmlHashRemoveEntry",
10522                    xmlMemBlocks() - mem_base);
10523             test_ret++;
10524             printf(" %d", n_table);
10525             printf(" %d", n_name);
10526             printf(" %d", n_f);
10527             printf("\n");
10528         }
10529     }
10530     }
10531     }
10532     function_tests++;
10533
10534     return(test_ret);
10535 }
10536
10537
10538 static int
10539 test_xmlHashRemoveEntry2(void) {
10540     int test_ret = 0;
10541
10542     int mem_base;
10543     int ret_val;
10544     xmlHashTablePtr table; /* the hash table */
10545     int n_table;
10546     xmlChar * name; /* the name of the userdata */
10547     int n_name;
10548     xmlChar * name2; /* a second name of the userdata */
10549     int n_name2;
10550     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10551     int n_f;
10552
10553     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10554     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10555     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10556     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10557         mem_base = xmlMemBlocks();
10558         table = gen_xmlHashTablePtr(n_table, 0);
10559         name = gen_const_xmlChar_ptr(n_name, 1);
10560         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10561         f = gen_xmlHashDeallocator(n_f, 3);
10562
10563         ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10564         desret_int(ret_val);
10565         call_tests++;
10566         des_xmlHashTablePtr(n_table, table, 0);
10567         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10568         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10569         des_xmlHashDeallocator(n_f, f, 3);
10570         xmlResetLastError();
10571         if (mem_base != xmlMemBlocks()) {
10572             printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10573                    xmlMemBlocks() - mem_base);
10574             test_ret++;
10575             printf(" %d", n_table);
10576             printf(" %d", n_name);
10577             printf(" %d", n_name2);
10578             printf(" %d", n_f);
10579             printf("\n");
10580         }
10581     }
10582     }
10583     }
10584     }
10585     function_tests++;
10586
10587     return(test_ret);
10588 }
10589
10590
10591 static int
10592 test_xmlHashRemoveEntry3(void) {
10593     int test_ret = 0;
10594
10595     int mem_base;
10596     int ret_val;
10597     xmlHashTablePtr table; /* the hash table */
10598     int n_table;
10599     xmlChar * name; /* the name of the userdata */
10600     int n_name;
10601     xmlChar * name2; /* a second name of the userdata */
10602     int n_name2;
10603     xmlChar * name3; /* a third name of the userdata */
10604     int n_name3;
10605     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10606     int n_f;
10607
10608     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10609     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10610     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10611     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10612     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10613         mem_base = xmlMemBlocks();
10614         table = gen_xmlHashTablePtr(n_table, 0);
10615         name = gen_const_xmlChar_ptr(n_name, 1);
10616         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10617         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10618         f = gen_xmlHashDeallocator(n_f, 4);
10619
10620         ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10621         desret_int(ret_val);
10622         call_tests++;
10623         des_xmlHashTablePtr(n_table, table, 0);
10624         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10625         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10626         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10627         des_xmlHashDeallocator(n_f, f, 4);
10628         xmlResetLastError();
10629         if (mem_base != xmlMemBlocks()) {
10630             printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10631                    xmlMemBlocks() - mem_base);
10632             test_ret++;
10633             printf(" %d", n_table);
10634             printf(" %d", n_name);
10635             printf(" %d", n_name2);
10636             printf(" %d", n_name3);
10637             printf(" %d", n_f);
10638             printf("\n");
10639         }
10640     }
10641     }
10642     }
10643     }
10644     }
10645     function_tests++;
10646
10647     return(test_ret);
10648 }
10649
10650
10651 static int
10652 test_xmlHashScan(void) {
10653     int test_ret = 0;
10654
10655
10656     /* missing type support */
10657     return(test_ret);
10658 }
10659
10660
10661 static int
10662 test_xmlHashScan3(void) {
10663     int test_ret = 0;
10664
10665
10666     /* missing type support */
10667     return(test_ret);
10668 }
10669
10670
10671 static int
10672 test_xmlHashScanFull(void) {
10673     int test_ret = 0;
10674
10675
10676     /* missing type support */
10677     return(test_ret);
10678 }
10679
10680
10681 static int
10682 test_xmlHashScanFull3(void) {
10683     int test_ret = 0;
10684
10685
10686     /* missing type support */
10687     return(test_ret);
10688 }
10689
10690
10691 static int
10692 test_xmlHashSize(void) {
10693     int test_ret = 0;
10694
10695     int mem_base;
10696     int ret_val;
10697     xmlHashTablePtr table; /* the hash table */
10698     int n_table;
10699
10700     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10701         mem_base = xmlMemBlocks();
10702         table = gen_xmlHashTablePtr(n_table, 0);
10703
10704         ret_val = xmlHashSize(table);
10705         desret_int(ret_val);
10706         call_tests++;
10707         des_xmlHashTablePtr(n_table, table, 0);
10708         xmlResetLastError();
10709         if (mem_base != xmlMemBlocks()) {
10710             printf("Leak of %d blocks found in xmlHashSize",
10711                    xmlMemBlocks() - mem_base);
10712             test_ret++;
10713             printf(" %d", n_table);
10714             printf("\n");
10715         }
10716     }
10717     function_tests++;
10718
10719     return(test_ret);
10720 }
10721
10722
10723 static int
10724 test_xmlHashUpdateEntry(void) {
10725     int test_ret = 0;
10726
10727     int mem_base;
10728     int ret_val;
10729     xmlHashTablePtr table; /* the hash table */
10730     int n_table;
10731     xmlChar * name; /* the name of the userdata */
10732     int n_name;
10733     void * userdata; /* a pointer to the userdata */
10734     int n_userdata;
10735     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10736     int n_f;
10737
10738     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10739     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10740     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10741     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10742         mem_base = xmlMemBlocks();
10743         table = gen_xmlHashTablePtr(n_table, 0);
10744         name = gen_const_xmlChar_ptr(n_name, 1);
10745         userdata = gen_userdata(n_userdata, 2);
10746         f = gen_xmlHashDeallocator(n_f, 3);
10747
10748         ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10749         desret_int(ret_val);
10750         call_tests++;
10751         des_xmlHashTablePtr(n_table, table, 0);
10752         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10753         des_userdata(n_userdata, userdata, 2);
10754         des_xmlHashDeallocator(n_f, f, 3);
10755         xmlResetLastError();
10756         if (mem_base != xmlMemBlocks()) {
10757             printf("Leak of %d blocks found in xmlHashUpdateEntry",
10758                    xmlMemBlocks() - mem_base);
10759             test_ret++;
10760             printf(" %d", n_table);
10761             printf(" %d", n_name);
10762             printf(" %d", n_userdata);
10763             printf(" %d", n_f);
10764             printf("\n");
10765         }
10766     }
10767     }
10768     }
10769     }
10770     function_tests++;
10771
10772     return(test_ret);
10773 }
10774
10775
10776 static int
10777 test_xmlHashUpdateEntry2(void) {
10778     int test_ret = 0;
10779
10780     int mem_base;
10781     int ret_val;
10782     xmlHashTablePtr table; /* the hash table */
10783     int n_table;
10784     xmlChar * name; /* the name of the userdata */
10785     int n_name;
10786     xmlChar * name2; /* a second name of the userdata */
10787     int n_name2;
10788     void * userdata; /* a pointer to the userdata */
10789     int n_userdata;
10790     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10791     int n_f;
10792
10793     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10794     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10795     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10796     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10797     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10798         mem_base = xmlMemBlocks();
10799         table = gen_xmlHashTablePtr(n_table, 0);
10800         name = gen_const_xmlChar_ptr(n_name, 1);
10801         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10802         userdata = gen_userdata(n_userdata, 3);
10803         f = gen_xmlHashDeallocator(n_f, 4);
10804
10805         ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10806         desret_int(ret_val);
10807         call_tests++;
10808         des_xmlHashTablePtr(n_table, table, 0);
10809         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10810         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10811         des_userdata(n_userdata, userdata, 3);
10812         des_xmlHashDeallocator(n_f, f, 4);
10813         xmlResetLastError();
10814         if (mem_base != xmlMemBlocks()) {
10815             printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10816                    xmlMemBlocks() - mem_base);
10817             test_ret++;
10818             printf(" %d", n_table);
10819             printf(" %d", n_name);
10820             printf(" %d", n_name2);
10821             printf(" %d", n_userdata);
10822             printf(" %d", n_f);
10823             printf("\n");
10824         }
10825     }
10826     }
10827     }
10828     }
10829     }
10830     function_tests++;
10831
10832     return(test_ret);
10833 }
10834
10835
10836 static int
10837 test_xmlHashUpdateEntry3(void) {
10838     int test_ret = 0;
10839
10840     int mem_base;
10841     int ret_val;
10842     xmlHashTablePtr table; /* the hash table */
10843     int n_table;
10844     xmlChar * name; /* the name of the userdata */
10845     int n_name;
10846     xmlChar * name2; /* a second name of the userdata */
10847     int n_name2;
10848     xmlChar * name3; /* a third name of the userdata */
10849     int n_name3;
10850     void * userdata; /* a pointer to the userdata */
10851     int n_userdata;
10852     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10853     int n_f;
10854
10855     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10856     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10857     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10858     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10859     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10860     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10861         mem_base = xmlMemBlocks();
10862         table = gen_xmlHashTablePtr(n_table, 0);
10863         name = gen_const_xmlChar_ptr(n_name, 1);
10864         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10865         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10866         userdata = gen_userdata(n_userdata, 4);
10867         f = gen_xmlHashDeallocator(n_f, 5);
10868
10869         ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10870         desret_int(ret_val);
10871         call_tests++;
10872         des_xmlHashTablePtr(n_table, table, 0);
10873         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10874         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10875         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10876         des_userdata(n_userdata, userdata, 4);
10877         des_xmlHashDeallocator(n_f, f, 5);
10878         xmlResetLastError();
10879         if (mem_base != xmlMemBlocks()) {
10880             printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10881                    xmlMemBlocks() - mem_base);
10882             test_ret++;
10883             printf(" %d", n_table);
10884             printf(" %d", n_name);
10885             printf(" %d", n_name2);
10886             printf(" %d", n_name3);
10887             printf(" %d", n_userdata);
10888             printf(" %d", n_f);
10889             printf("\n");
10890         }
10891     }
10892     }
10893     }
10894     }
10895     }
10896     }
10897     function_tests++;
10898
10899     return(test_ret);
10900 }
10901
10902 static int
10903 test_hash(void) {
10904     int test_ret = 0;
10905         int rc = 0;
10906
10907     if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10908     rc = test_xmlHashAddEntry();
10909         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10910     rc = test_xmlHashAddEntry2();
10911         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10912     rc = test_xmlHashAddEntry3();
10913         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10914     rc = test_xmlHashCopy();
10915         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10916     rc = test_xmlHashCreate();
10917         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10918     rc = test_xmlHashCreateDict();
10919         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10920     rc = test_xmlHashLookup();
10921         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10922     rc = test_xmlHashLookup2();
10923         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10924     rc = test_xmlHashLookup3();
10925         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10926     rc = test_xmlHashQLookup();
10927         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10928     rc = test_xmlHashQLookup2();
10929         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10930     rc = test_xmlHashQLookup3();
10931         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10932     rc = test_xmlHashRemoveEntry();
10933         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10934     rc = test_xmlHashRemoveEntry2();
10935         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10936     rc = test_xmlHashRemoveEntry3();
10937         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10938     rc = test_xmlHashScan();
10939         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10940     rc = test_xmlHashScan3();
10941         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10942     rc = test_xmlHashScanFull();
10943         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10944     rc = test_xmlHashScanFull3();
10945         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10946     rc = test_xmlHashSize();
10947         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10948     rc = test_xmlHashUpdateEntry();
10949         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10950     rc = test_xmlHashUpdateEntry2();
10951         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10952     rc = test_xmlHashUpdateEntry3();
10953         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10954
10955     if (test_ret != 0)
10956         printf("Module hash: %d errors\n", test_ret);
10957     return(test_ret);
10958 }
10959
10960 #define gen_nb_xmlLinkPtr 1
10961 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10962     return(NULL);
10963 }
10964 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10965 }
10966
10967 static int
10968 test_xmlLinkGetData(void) {
10969     int test_ret = 0;
10970
10971     int mem_base;
10972     void * ret_val;
10973     xmlLinkPtr lk; /* a link */
10974     int n_lk;
10975
10976     for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10977         mem_base = xmlMemBlocks();
10978         lk = gen_xmlLinkPtr(n_lk, 0);
10979
10980         ret_val = xmlLinkGetData(lk);
10981         desret_void_ptr(ret_val);
10982         call_tests++;
10983         des_xmlLinkPtr(n_lk, lk, 0);
10984         xmlResetLastError();
10985         if (mem_base != xmlMemBlocks()) {
10986             printf("Leak of %d blocks found in xmlLinkGetData",
10987                    xmlMemBlocks() - mem_base);
10988             test_ret++;
10989             printf(" %d", n_lk);
10990             printf("\n");
10991         }
10992     }
10993     function_tests++;
10994
10995     return(test_ret);
10996 }
10997
10998
10999 static int
11000 test_xmlListAppend(void) {
11001     int test_ret = 0;
11002
11003     int mem_base;
11004     int ret_val;
11005     xmlListPtr l; /* a list */
11006     int n_l;
11007     void * data; /* the data */
11008     int n_data;
11009
11010     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11011     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11012         mem_base = xmlMemBlocks();
11013         l = gen_xmlListPtr(n_l, 0);
11014         data = gen_userdata(n_data, 1);
11015
11016         ret_val = xmlListAppend(l, data);
11017         desret_int(ret_val);
11018         call_tests++;
11019         des_xmlListPtr(n_l, l, 0);
11020         des_userdata(n_data, data, 1);
11021         xmlResetLastError();
11022         if (mem_base != xmlMemBlocks()) {
11023             printf("Leak of %d blocks found in xmlListAppend",
11024                    xmlMemBlocks() - mem_base);
11025             test_ret++;
11026             printf(" %d", n_l);
11027             printf(" %d", n_data);
11028             printf("\n");
11029         }
11030     }
11031     }
11032     function_tests++;
11033
11034     return(test_ret);
11035 }
11036
11037
11038 static int
11039 test_xmlListClear(void) {
11040     int test_ret = 0;
11041
11042     int mem_base;
11043     xmlListPtr l; /* a list */
11044     int n_l;
11045
11046     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11047         mem_base = xmlMemBlocks();
11048         l = gen_xmlListPtr(n_l, 0);
11049
11050         xmlListClear(l);
11051         call_tests++;
11052         des_xmlListPtr(n_l, l, 0);
11053         xmlResetLastError();
11054         if (mem_base != xmlMemBlocks()) {
11055             printf("Leak of %d blocks found in xmlListClear",
11056                    xmlMemBlocks() - mem_base);
11057             test_ret++;
11058             printf(" %d", n_l);
11059             printf("\n");
11060         }
11061     }
11062     function_tests++;
11063
11064     return(test_ret);
11065 }
11066
11067
11068 #define gen_nb_const_xmlListPtr 1
11069 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11070     return(NULL);
11071 }
11072 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11073 }
11074
11075 static int
11076 test_xmlListCopy(void) {
11077     int test_ret = 0;
11078
11079     int mem_base;
11080     int ret_val;
11081     xmlListPtr cur; /* the new list */
11082     int n_cur;
11083     xmlListPtr old; /* the old list */
11084     int n_old;
11085
11086     for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
11087     for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
11088         mem_base = xmlMemBlocks();
11089         cur = gen_xmlListPtr(n_cur, 0);
11090         old = gen_const_xmlListPtr(n_old, 1);
11091
11092         ret_val = xmlListCopy(cur, (const xmlListPtr)old);
11093         desret_int(ret_val);
11094         call_tests++;
11095         des_xmlListPtr(n_cur, cur, 0);
11096         des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
11097         xmlResetLastError();
11098         if (mem_base != xmlMemBlocks()) {
11099             printf("Leak of %d blocks found in xmlListCopy",
11100                    xmlMemBlocks() - mem_base);
11101             test_ret++;
11102             printf(" %d", n_cur);
11103             printf(" %d", n_old);
11104             printf("\n");
11105         }
11106     }
11107     }
11108     function_tests++;
11109
11110     return(test_ret);
11111 }
11112
11113
11114 static int
11115 test_xmlListCreate(void) {
11116     int test_ret = 0;
11117
11118
11119     /* missing type support */
11120     return(test_ret);
11121 }
11122
11123
11124 static int
11125 test_xmlListDup(void) {
11126     int test_ret = 0;
11127
11128
11129     /* missing type support */
11130     return(test_ret);
11131 }
11132
11133
11134 static int
11135 test_xmlListEmpty(void) {
11136     int test_ret = 0;
11137
11138     int mem_base;
11139     int ret_val;
11140     xmlListPtr l; /* a list */
11141     int n_l;
11142
11143     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11144         mem_base = xmlMemBlocks();
11145         l = gen_xmlListPtr(n_l, 0);
11146
11147         ret_val = xmlListEmpty(l);
11148         desret_int(ret_val);
11149         call_tests++;
11150         des_xmlListPtr(n_l, l, 0);
11151         xmlResetLastError();
11152         if (mem_base != xmlMemBlocks()) {
11153             printf("Leak of %d blocks found in xmlListEmpty",
11154                    xmlMemBlocks() - mem_base);
11155             test_ret++;
11156             printf(" %d", n_l);
11157             printf("\n");
11158         }
11159     }
11160     function_tests++;
11161
11162     return(test_ret);
11163 }
11164
11165
11166 static int
11167 test_xmlListEnd(void) {
11168     int test_ret = 0;
11169
11170
11171     /* missing type support */
11172     return(test_ret);
11173 }
11174
11175
11176 static int
11177 test_xmlListFront(void) {
11178     int test_ret = 0;
11179
11180
11181     /* missing type support */
11182     return(test_ret);
11183 }
11184
11185
11186 static int
11187 test_xmlListInsert(void) {
11188     int test_ret = 0;
11189
11190     int mem_base;
11191     int ret_val;
11192     xmlListPtr l; /* a list */
11193     int n_l;
11194     void * data; /* the data */
11195     int n_data;
11196
11197     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11198     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11199         mem_base = xmlMemBlocks();
11200         l = gen_xmlListPtr(n_l, 0);
11201         data = gen_userdata(n_data, 1);
11202
11203         ret_val = xmlListInsert(l, data);
11204         desret_int(ret_val);
11205         call_tests++;
11206         des_xmlListPtr(n_l, l, 0);
11207         des_userdata(n_data, data, 1);
11208         xmlResetLastError();
11209         if (mem_base != xmlMemBlocks()) {
11210             printf("Leak of %d blocks found in xmlListInsert",
11211                    xmlMemBlocks() - mem_base);
11212             test_ret++;
11213             printf(" %d", n_l);
11214             printf(" %d", n_data);
11215             printf("\n");
11216         }
11217     }
11218     }
11219     function_tests++;
11220
11221     return(test_ret);
11222 }
11223
11224
11225 static int
11226 test_xmlListMerge(void) {
11227     int test_ret = 0;
11228
11229     int mem_base;
11230     xmlListPtr l1; /* the original list */
11231     int n_l1;
11232     xmlListPtr l2; /* the new list */
11233     int n_l2;
11234
11235     for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
11236     for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
11237         mem_base = xmlMemBlocks();
11238         l1 = gen_xmlListPtr(n_l1, 0);
11239         l2 = gen_xmlListPtr(n_l2, 1);
11240
11241         xmlListMerge(l1, l2);
11242         call_tests++;
11243         des_xmlListPtr(n_l1, l1, 0);
11244         des_xmlListPtr(n_l2, l2, 1);
11245         xmlResetLastError();
11246         if (mem_base != xmlMemBlocks()) {
11247             printf("Leak of %d blocks found in xmlListMerge",
11248                    xmlMemBlocks() - mem_base);
11249             test_ret++;
11250             printf(" %d", n_l1);
11251             printf(" %d", n_l2);
11252             printf("\n");
11253         }
11254     }
11255     }
11256     function_tests++;
11257
11258     return(test_ret);
11259 }
11260
11261
11262 static int
11263 test_xmlListPopBack(void) {
11264     int test_ret = 0;
11265
11266     int mem_base;
11267     xmlListPtr l; /* a list */
11268     int n_l;
11269
11270     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11271         mem_base = xmlMemBlocks();
11272         l = gen_xmlListPtr(n_l, 0);
11273
11274         xmlListPopBack(l);
11275         call_tests++;
11276         des_xmlListPtr(n_l, l, 0);
11277         xmlResetLastError();
11278         if (mem_base != xmlMemBlocks()) {
11279             printf("Leak of %d blocks found in xmlListPopBack",
11280                    xmlMemBlocks() - mem_base);
11281             test_ret++;
11282             printf(" %d", n_l);
11283             printf("\n");
11284         }
11285     }
11286     function_tests++;
11287
11288     return(test_ret);
11289 }
11290
11291
11292 static int
11293 test_xmlListPopFront(void) {
11294     int test_ret = 0;
11295
11296     int mem_base;
11297     xmlListPtr l; /* a list */
11298     int n_l;
11299
11300     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11301         mem_base = xmlMemBlocks();
11302         l = gen_xmlListPtr(n_l, 0);
11303
11304         xmlListPopFront(l);
11305         call_tests++;
11306         des_xmlListPtr(n_l, l, 0);
11307         xmlResetLastError();
11308         if (mem_base != xmlMemBlocks()) {
11309             printf("Leak of %d blocks found in xmlListPopFront",
11310                    xmlMemBlocks() - mem_base);
11311             test_ret++;
11312             printf(" %d", n_l);
11313             printf("\n");
11314         }
11315     }
11316     function_tests++;
11317
11318     return(test_ret);
11319 }
11320
11321
11322 static int
11323 test_xmlListPushBack(void) {
11324     int test_ret = 0;
11325
11326     int mem_base;
11327     int ret_val;
11328     xmlListPtr l; /* a list */
11329     int n_l;
11330     void * data; /* new data */
11331     int n_data;
11332
11333     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11334     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11335         mem_base = xmlMemBlocks();
11336         l = gen_xmlListPtr(n_l, 0);
11337         data = gen_userdata(n_data, 1);
11338
11339         ret_val = xmlListPushBack(l, data);
11340         desret_int(ret_val);
11341         call_tests++;
11342         des_xmlListPtr(n_l, l, 0);
11343         des_userdata(n_data, data, 1);
11344         xmlResetLastError();
11345         if (mem_base != xmlMemBlocks()) {
11346             printf("Leak of %d blocks found in xmlListPushBack",
11347                    xmlMemBlocks() - mem_base);
11348             test_ret++;
11349             printf(" %d", n_l);
11350             printf(" %d", n_data);
11351             printf("\n");
11352         }
11353     }
11354     }
11355     function_tests++;
11356
11357     return(test_ret);
11358 }
11359
11360
11361 static int
11362 test_xmlListPushFront(void) {
11363     int test_ret = 0;
11364
11365     int mem_base;
11366     int ret_val;
11367     xmlListPtr l; /* a list */
11368     int n_l;
11369     void * data; /* new data */
11370     int n_data;
11371
11372     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11373     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11374         mem_base = xmlMemBlocks();
11375         l = gen_xmlListPtr(n_l, 0);
11376         data = gen_userdata(n_data, 1);
11377
11378         ret_val = xmlListPushFront(l, data);
11379         desret_int(ret_val);
11380         call_tests++;
11381         des_xmlListPtr(n_l, l, 0);
11382         des_userdata(n_data, data, 1);
11383         xmlResetLastError();
11384         if (mem_base != xmlMemBlocks()) {
11385             printf("Leak of %d blocks found in xmlListPushFront",
11386                    xmlMemBlocks() - mem_base);
11387             test_ret++;
11388             printf(" %d", n_l);
11389             printf(" %d", n_data);
11390             printf("\n");
11391         }
11392     }
11393     }
11394     function_tests++;
11395
11396     return(test_ret);
11397 }
11398
11399
11400 static int
11401 test_xmlListRemoveAll(void) {
11402     int test_ret = 0;
11403
11404     int mem_base;
11405     int ret_val;
11406     xmlListPtr l; /* a list */
11407     int n_l;
11408     void * data; /* list data */
11409     int n_data;
11410
11411     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11412     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11413         mem_base = xmlMemBlocks();
11414         l = gen_xmlListPtr(n_l, 0);
11415         data = gen_userdata(n_data, 1);
11416
11417         ret_val = xmlListRemoveAll(l, data);
11418         desret_int(ret_val);
11419         call_tests++;
11420         des_xmlListPtr(n_l, l, 0);
11421         des_userdata(n_data, data, 1);
11422         xmlResetLastError();
11423         if (mem_base != xmlMemBlocks()) {
11424             printf("Leak of %d blocks found in xmlListRemoveAll",
11425                    xmlMemBlocks() - mem_base);
11426             test_ret++;
11427             printf(" %d", n_l);
11428             printf(" %d", n_data);
11429             printf("\n");
11430         }
11431     }
11432     }
11433     function_tests++;
11434
11435     return(test_ret);
11436 }
11437
11438
11439 static int
11440 test_xmlListRemoveFirst(void) {
11441     int test_ret = 0;
11442
11443     int mem_base;
11444     int ret_val;
11445     xmlListPtr l; /* a list */
11446     int n_l;
11447     void * data; /* list data */
11448     int n_data;
11449
11450     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11451     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11452         mem_base = xmlMemBlocks();
11453         l = gen_xmlListPtr(n_l, 0);
11454         data = gen_userdata(n_data, 1);
11455
11456         ret_val = xmlListRemoveFirst(l, data);
11457         desret_int(ret_val);
11458         call_tests++;
11459         des_xmlListPtr(n_l, l, 0);
11460         des_userdata(n_data, data, 1);
11461         xmlResetLastError();
11462         if (mem_base != xmlMemBlocks()) {
11463             printf("Leak of %d blocks found in xmlListRemoveFirst",
11464                    xmlMemBlocks() - mem_base);
11465             test_ret++;
11466             printf(" %d", n_l);
11467             printf(" %d", n_data);
11468             printf("\n");
11469         }
11470     }
11471     }
11472     function_tests++;
11473
11474     return(test_ret);
11475 }
11476
11477
11478 static int
11479 test_xmlListRemoveLast(void) {
11480     int test_ret = 0;
11481
11482     int mem_base;
11483     int ret_val;
11484     xmlListPtr l; /* a list */
11485     int n_l;
11486     void * data; /* list data */
11487     int n_data;
11488
11489     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11490     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11491         mem_base = xmlMemBlocks();
11492         l = gen_xmlListPtr(n_l, 0);
11493         data = gen_userdata(n_data, 1);
11494
11495         ret_val = xmlListRemoveLast(l, data);
11496         desret_int(ret_val);
11497         call_tests++;
11498         des_xmlListPtr(n_l, l, 0);
11499         des_userdata(n_data, data, 1);
11500         xmlResetLastError();
11501         if (mem_base != xmlMemBlocks()) {
11502             printf("Leak of %d blocks found in xmlListRemoveLast",
11503                    xmlMemBlocks() - mem_base);
11504             test_ret++;
11505             printf(" %d", n_l);
11506             printf(" %d", n_data);
11507             printf("\n");
11508         }
11509     }
11510     }
11511     function_tests++;
11512
11513     return(test_ret);
11514 }
11515
11516
11517 static int
11518 test_xmlListReverse(void) {
11519     int test_ret = 0;
11520
11521     int mem_base;
11522     xmlListPtr l; /* a list */
11523     int n_l;
11524
11525     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11526         mem_base = xmlMemBlocks();
11527         l = gen_xmlListPtr(n_l, 0);
11528
11529         xmlListReverse(l);
11530         call_tests++;
11531         des_xmlListPtr(n_l, l, 0);
11532         xmlResetLastError();
11533         if (mem_base != xmlMemBlocks()) {
11534             printf("Leak of %d blocks found in xmlListReverse",
11535                    xmlMemBlocks() - mem_base);
11536             test_ret++;
11537             printf(" %d", n_l);
11538             printf("\n");
11539         }
11540     }
11541     function_tests++;
11542
11543     return(test_ret);
11544 }
11545
11546
11547 static int
11548 test_xmlListReverseSearch(void) {
11549     int test_ret = 0;
11550
11551     int mem_base;
11552     void * ret_val;
11553     xmlListPtr l; /* a list */
11554     int n_l;
11555     void * data; /* a search value */
11556     int n_data;
11557
11558     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11559     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11560         mem_base = xmlMemBlocks();
11561         l = gen_xmlListPtr(n_l, 0);
11562         data = gen_userdata(n_data, 1);
11563
11564         ret_val = xmlListReverseSearch(l, data);
11565         desret_void_ptr(ret_val);
11566         call_tests++;
11567         des_xmlListPtr(n_l, l, 0);
11568         des_userdata(n_data, data, 1);
11569         xmlResetLastError();
11570         if (mem_base != xmlMemBlocks()) {
11571             printf("Leak of %d blocks found in xmlListReverseSearch",
11572                    xmlMemBlocks() - mem_base);
11573             test_ret++;
11574             printf(" %d", n_l);
11575             printf(" %d", n_data);
11576             printf("\n");
11577         }
11578     }
11579     }
11580     function_tests++;
11581
11582     return(test_ret);
11583 }
11584
11585
11586 static int
11587 test_xmlListReverseWalk(void) {
11588     int test_ret = 0;
11589
11590
11591     /* missing type support */
11592     return(test_ret);
11593 }
11594
11595
11596 static int
11597 test_xmlListSearch(void) {
11598     int test_ret = 0;
11599
11600     int mem_base;
11601     void * ret_val;
11602     xmlListPtr l; /* a list */
11603     int n_l;
11604     void * data; /* a search value */
11605     int n_data;
11606
11607     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11608     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11609         mem_base = xmlMemBlocks();
11610         l = gen_xmlListPtr(n_l, 0);
11611         data = gen_userdata(n_data, 1);
11612
11613         ret_val = xmlListSearch(l, data);
11614         desret_void_ptr(ret_val);
11615         call_tests++;
11616         des_xmlListPtr(n_l, l, 0);
11617         des_userdata(n_data, data, 1);
11618         xmlResetLastError();
11619         if (mem_base != xmlMemBlocks()) {
11620             printf("Leak of %d blocks found in xmlListSearch",
11621                    xmlMemBlocks() - mem_base);
11622             test_ret++;
11623             printf(" %d", n_l);
11624             printf(" %d", n_data);
11625             printf("\n");
11626         }
11627     }
11628     }
11629     function_tests++;
11630
11631     return(test_ret);
11632 }
11633
11634
11635 static int
11636 test_xmlListSize(void) {
11637     int test_ret = 0;
11638
11639     int mem_base;
11640     int ret_val;
11641     xmlListPtr l; /* a list */
11642     int n_l;
11643
11644     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11645         mem_base = xmlMemBlocks();
11646         l = gen_xmlListPtr(n_l, 0);
11647
11648         ret_val = xmlListSize(l);
11649         desret_int(ret_val);
11650         call_tests++;
11651         des_xmlListPtr(n_l, l, 0);
11652         xmlResetLastError();
11653         if (mem_base != xmlMemBlocks()) {
11654             printf("Leak of %d blocks found in xmlListSize",
11655                    xmlMemBlocks() - mem_base);
11656             test_ret++;
11657             printf(" %d", n_l);
11658             printf("\n");
11659         }
11660     }
11661     function_tests++;
11662
11663     return(test_ret);
11664 }
11665
11666
11667 static int
11668 test_xmlListSort(void) {
11669     int test_ret = 0;
11670
11671     int mem_base;
11672     xmlListPtr l; /* a list */
11673     int n_l;
11674
11675     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11676         mem_base = xmlMemBlocks();
11677         l = gen_xmlListPtr(n_l, 0);
11678
11679         xmlListSort(l);
11680         call_tests++;
11681         des_xmlListPtr(n_l, l, 0);
11682         xmlResetLastError();
11683         if (mem_base != xmlMemBlocks()) {
11684             printf("Leak of %d blocks found in xmlListSort",
11685                    xmlMemBlocks() - mem_base);
11686             test_ret++;
11687             printf(" %d", n_l);
11688             printf("\n");
11689         }
11690     }
11691     function_tests++;
11692
11693     return(test_ret);
11694 }
11695
11696
11697 static int
11698 test_xmlListWalk(void) {
11699     int test_ret = 0;
11700
11701
11702     /* missing type support */
11703     return(test_ret);
11704 }
11705
11706 static int
11707 test_list(void) {
11708     int test_ret = 0;
11709         int rc = 0;
11710
11711     if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11712     rc = test_xmlLinkGetData();
11713         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11714     rc = test_xmlListAppend();
11715         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11716     rc = test_xmlListClear();
11717         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11718     rc = test_xmlListCopy();
11719         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11720     rc = test_xmlListCreate();
11721         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11722     rc = test_xmlListDup();
11723         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11724     rc = test_xmlListEmpty();
11725         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11726     rc = test_xmlListEnd();
11727         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11728     rc = test_xmlListFront();
11729         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11730     rc = test_xmlListInsert();
11731         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11732     rc = test_xmlListMerge();
11733         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11734     rc = test_xmlListPopBack();
11735         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11736     rc = test_xmlListPopFront();
11737         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11738     rc = test_xmlListPushBack();
11739         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11740     rc = test_xmlListPushFront();
11741         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11742     rc = test_xmlListRemoveAll();
11743         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11744     rc = test_xmlListRemoveFirst();
11745         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11746     rc = test_xmlListRemoveLast();
11747         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11748     rc = test_xmlListReverse();
11749         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11750     rc = test_xmlListReverseSearch();
11751         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11752     rc = test_xmlListReverseWalk();
11753         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11754     rc = test_xmlListSearch();
11755         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11756     rc = test_xmlListSize();
11757         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11758     rc = test_xmlListSort();
11759         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11760     rc = test_xmlListWalk();
11761         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11762
11763     if (test_ret != 0)
11764         printf("Module list: %d errors\n", test_ret);
11765     return(test_ret);
11766 }
11767
11768 static int
11769 test_xmlNanoFTPCheckResponse(void) {
11770     int test_ret = 0;
11771
11772 #if defined(LIBXML_FTP_ENABLED)
11773     int mem_base;
11774     int ret_val;
11775     void * ctx; /* an FTP context */
11776     int n_ctx;
11777
11778     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11779         mem_base = xmlMemBlocks();
11780         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11781
11782         ret_val = xmlNanoFTPCheckResponse(ctx);
11783         desret_int(ret_val);
11784         call_tests++;
11785         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11786         xmlResetLastError();
11787         if (mem_base != xmlMemBlocks()) {
11788             printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11789                    xmlMemBlocks() - mem_base);
11790             test_ret++;
11791             printf(" %d", n_ctx);
11792             printf("\n");
11793         }
11794     }
11795     function_tests++;
11796 #endif
11797
11798     return(test_ret);
11799 }
11800
11801
11802 static int
11803 test_xmlNanoFTPCleanup(void) {
11804     int test_ret = 0;
11805
11806 #if defined(LIBXML_FTP_ENABLED)
11807     int mem_base;
11808
11809         mem_base = xmlMemBlocks();
11810
11811         xmlNanoFTPCleanup();
11812         call_tests++;
11813         xmlResetLastError();
11814         if (mem_base != xmlMemBlocks()) {
11815             printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11816                    xmlMemBlocks() - mem_base);
11817             test_ret++;
11818             printf("\n");
11819         }
11820     function_tests++;
11821 #endif
11822
11823     return(test_ret);
11824 }
11825
11826
11827 static int
11828 test_xmlNanoFTPCloseConnection(void) {
11829     int test_ret = 0;
11830
11831 #if defined(LIBXML_FTP_ENABLED)
11832     int mem_base;
11833     int ret_val;
11834     void * ctx; /* an FTP context */
11835     int n_ctx;
11836
11837     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11838         mem_base = xmlMemBlocks();
11839         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11840
11841         ret_val = xmlNanoFTPCloseConnection(ctx);
11842         desret_int(ret_val);
11843         call_tests++;
11844         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11845         xmlResetLastError();
11846         if (mem_base != xmlMemBlocks()) {
11847             printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11848                    xmlMemBlocks() - mem_base);
11849             test_ret++;
11850             printf(" %d", n_ctx);
11851             printf("\n");
11852         }
11853     }
11854     function_tests++;
11855 #endif
11856
11857     return(test_ret);
11858 }
11859
11860
11861 static int
11862 test_xmlNanoFTPCwd(void) {
11863     int test_ret = 0;
11864
11865 #if defined(LIBXML_FTP_ENABLED)
11866     int mem_base;
11867     int ret_val;
11868     void * ctx; /* an FTP context */
11869     int n_ctx;
11870     char * directory; /* a directory on the server */
11871     int n_directory;
11872
11873     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11874     for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11875         mem_base = xmlMemBlocks();
11876         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11877         directory = gen_const_char_ptr(n_directory, 1);
11878
11879         ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11880         desret_int(ret_val);
11881         call_tests++;
11882         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11883         des_const_char_ptr(n_directory, (const char *)directory, 1);
11884         xmlResetLastError();
11885         if (mem_base != xmlMemBlocks()) {
11886             printf("Leak of %d blocks found in xmlNanoFTPCwd",
11887                    xmlMemBlocks() - mem_base);
11888             test_ret++;
11889             printf(" %d", n_ctx);
11890             printf(" %d", n_directory);
11891             printf("\n");
11892         }
11893     }
11894     }
11895     function_tests++;
11896 #endif
11897
11898     return(test_ret);
11899 }
11900
11901
11902 static int
11903 test_xmlNanoFTPDele(void) {
11904     int test_ret = 0;
11905
11906 #if defined(LIBXML_FTP_ENABLED)
11907     int mem_base;
11908     int ret_val;
11909     void * ctx; /* an FTP context */
11910     int n_ctx;
11911     const char * file; /* a file or directory on the server */
11912     int n_file;
11913
11914     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11915     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11916         mem_base = xmlMemBlocks();
11917         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11918         file = gen_filepath(n_file, 1);
11919
11920         ret_val = xmlNanoFTPDele(ctx, file);
11921         desret_int(ret_val);
11922         call_tests++;
11923         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11924         des_filepath(n_file, file, 1);
11925         xmlResetLastError();
11926         if (mem_base != xmlMemBlocks()) {
11927             printf("Leak of %d blocks found in xmlNanoFTPDele",
11928                    xmlMemBlocks() - mem_base);
11929             test_ret++;
11930             printf(" %d", n_ctx);
11931             printf(" %d", n_file);
11932             printf("\n");
11933         }
11934     }
11935     }
11936     function_tests++;
11937 #endif
11938
11939     return(test_ret);
11940 }
11941
11942
11943 static int
11944 test_xmlNanoFTPGet(void) {
11945     int test_ret = 0;
11946
11947
11948     /* missing type support */
11949     return(test_ret);
11950 }
11951
11952
11953 static int
11954 test_xmlNanoFTPGetConnection(void) {
11955     int test_ret = 0;
11956
11957
11958     /* missing type support */
11959     return(test_ret);
11960 }
11961
11962
11963 static int
11964 test_xmlNanoFTPGetResponse(void) {
11965     int test_ret = 0;
11966
11967 #if defined(LIBXML_FTP_ENABLED)
11968     int mem_base;
11969     int ret_val;
11970     void * ctx; /* an FTP context */
11971     int n_ctx;
11972
11973     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11974         mem_base = xmlMemBlocks();
11975         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11976
11977         ret_val = xmlNanoFTPGetResponse(ctx);
11978         desret_int(ret_val);
11979         call_tests++;
11980         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11981         xmlResetLastError();
11982         if (mem_base != xmlMemBlocks()) {
11983             printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11984                    xmlMemBlocks() - mem_base);
11985             test_ret++;
11986             printf(" %d", n_ctx);
11987             printf("\n");
11988         }
11989     }
11990     function_tests++;
11991 #endif
11992
11993     return(test_ret);
11994 }
11995
11996
11997 static int
11998 test_xmlNanoFTPGetSocket(void) {
11999     int test_ret = 0;
12000
12001
12002     /* missing type support */
12003     return(test_ret);
12004 }
12005
12006
12007 static int
12008 test_xmlNanoFTPInit(void) {
12009     int test_ret = 0;
12010
12011 #if defined(LIBXML_FTP_ENABLED)
12012     int mem_base;
12013
12014         mem_base = xmlMemBlocks();
12015
12016         xmlNanoFTPInit();
12017         call_tests++;
12018         xmlResetLastError();
12019         if (mem_base != xmlMemBlocks()) {
12020             printf("Leak of %d blocks found in xmlNanoFTPInit",
12021                    xmlMemBlocks() - mem_base);
12022             test_ret++;
12023             printf("\n");
12024         }
12025     function_tests++;
12026 #endif
12027
12028     return(test_ret);
12029 }
12030
12031
12032 static int
12033 test_xmlNanoFTPList(void) {
12034     int test_ret = 0;
12035
12036
12037     /* missing type support */
12038     return(test_ret);
12039 }
12040
12041
12042 static int
12043 test_xmlNanoFTPNewCtxt(void) {
12044     int test_ret = 0;
12045
12046 #if defined(LIBXML_FTP_ENABLED)
12047     int mem_base;
12048     void * ret_val;
12049     const char * URL; /* The URL used to initialize the context */
12050     int n_URL;
12051
12052     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12053         mem_base = xmlMemBlocks();
12054         URL = gen_filepath(n_URL, 0);
12055
12056         ret_val = xmlNanoFTPNewCtxt(URL);
12057         desret_xmlNanoFTPCtxtPtr(ret_val);
12058         call_tests++;
12059         des_filepath(n_URL, URL, 0);
12060         xmlResetLastError();
12061         if (mem_base != xmlMemBlocks()) {
12062             printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
12063                    xmlMemBlocks() - mem_base);
12064             test_ret++;
12065             printf(" %d", n_URL);
12066             printf("\n");
12067         }
12068     }
12069     function_tests++;
12070 #endif
12071
12072     return(test_ret);
12073 }
12074
12075
12076 static int
12077 test_xmlNanoFTPOpen(void) {
12078     int test_ret = 0;
12079
12080 #if defined(LIBXML_FTP_ENABLED)
12081     int mem_base;
12082     void * ret_val;
12083     const char * URL; /* the URL to the resource */
12084     int n_URL;
12085
12086     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12087         mem_base = xmlMemBlocks();
12088         URL = gen_filepath(n_URL, 0);
12089
12090         ret_val = xmlNanoFTPOpen(URL);
12091         desret_xmlNanoFTPCtxtPtr(ret_val);
12092         call_tests++;
12093         des_filepath(n_URL, URL, 0);
12094         xmlResetLastError();
12095         if (mem_base != xmlMemBlocks()) {
12096             printf("Leak of %d blocks found in xmlNanoFTPOpen",
12097                    xmlMemBlocks() - mem_base);
12098             test_ret++;
12099             printf(" %d", n_URL);
12100             printf("\n");
12101         }
12102     }
12103     function_tests++;
12104 #endif
12105
12106     return(test_ret);
12107 }
12108
12109
12110 static int
12111 test_xmlNanoFTPProxy(void) {
12112     int test_ret = 0;
12113
12114 #if defined(LIBXML_FTP_ENABLED)
12115     char * host; /* the proxy host name */
12116     int n_host;
12117     int port; /* the proxy port */
12118     int n_port;
12119     char * user; /* the proxy user name */
12120     int n_user;
12121     char * passwd; /* the proxy password */
12122     int n_passwd;
12123     int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
12124     int n_type;
12125
12126     for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
12127     for (n_port = 0;n_port < gen_nb_int;n_port++) {
12128     for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
12129     for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
12130     for (n_type = 0;n_type < gen_nb_int;n_type++) {
12131         host = gen_const_char_ptr(n_host, 0);
12132         port = gen_int(n_port, 1);
12133         user = gen_const_char_ptr(n_user, 2);
12134         passwd = gen_const_char_ptr(n_passwd, 3);
12135         type = gen_int(n_type, 4);
12136
12137         xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
12138         call_tests++;
12139         des_const_char_ptr(n_host, (const char *)host, 0);
12140         des_int(n_port, port, 1);
12141         des_const_char_ptr(n_user, (const char *)user, 2);
12142         des_const_char_ptr(n_passwd, (const char *)passwd, 3);
12143         des_int(n_type, type, 4);
12144         xmlResetLastError();
12145     }
12146     }
12147     }
12148     }
12149     }
12150     function_tests++;
12151 #endif
12152
12153     return(test_ret);
12154 }
12155
12156
12157 static int
12158 test_xmlNanoFTPQuit(void) {
12159     int test_ret = 0;
12160
12161 #if defined(LIBXML_FTP_ENABLED)
12162     int mem_base;
12163     int ret_val;
12164     void * ctx; /* an FTP context */
12165     int n_ctx;
12166
12167     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12168         mem_base = xmlMemBlocks();
12169         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12170
12171         ret_val = xmlNanoFTPQuit(ctx);
12172         desret_int(ret_val);
12173         call_tests++;
12174         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12175         xmlResetLastError();
12176         if (mem_base != xmlMemBlocks()) {
12177             printf("Leak of %d blocks found in xmlNanoFTPQuit",
12178                    xmlMemBlocks() - mem_base);
12179             test_ret++;
12180             printf(" %d", n_ctx);
12181             printf("\n");
12182         }
12183     }
12184     function_tests++;
12185 #endif
12186
12187     return(test_ret);
12188 }
12189
12190
12191 static int
12192 test_xmlNanoFTPRead(void) {
12193     int test_ret = 0;
12194
12195 #if defined(LIBXML_FTP_ENABLED)
12196     int mem_base;
12197     int ret_val;
12198     void * ctx; /* the FTP context */
12199     int n_ctx;
12200     void * dest; /* a buffer */
12201     int n_dest;
12202     int len; /* the buffer length */
12203     int n_len;
12204
12205     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12206     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12207     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12208         mem_base = xmlMemBlocks();
12209         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12210         dest = gen_void_ptr(n_dest, 1);
12211         len = gen_int(n_len, 2);
12212
12213         ret_val = xmlNanoFTPRead(ctx, dest, len);
12214         desret_int(ret_val);
12215         call_tests++;
12216         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12217         des_void_ptr(n_dest, dest, 1);
12218         des_int(n_len, len, 2);
12219         xmlResetLastError();
12220         if (mem_base != xmlMemBlocks()) {
12221             printf("Leak of %d blocks found in xmlNanoFTPRead",
12222                    xmlMemBlocks() - mem_base);
12223             test_ret++;
12224             printf(" %d", n_ctx);
12225             printf(" %d", n_dest);
12226             printf(" %d", n_len);
12227             printf("\n");
12228         }
12229     }
12230     }
12231     }
12232     function_tests++;
12233 #endif
12234
12235     return(test_ret);
12236 }
12237
12238
12239 static int
12240 test_xmlNanoFTPScanProxy(void) {
12241     int test_ret = 0;
12242
12243 #if defined(LIBXML_FTP_ENABLED)
12244     const char * URL; /* The proxy URL used to initialize the proxy context */
12245     int n_URL;
12246
12247     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12248         URL = gen_filepath(n_URL, 0);
12249
12250         xmlNanoFTPScanProxy(URL);
12251         call_tests++;
12252         des_filepath(n_URL, URL, 0);
12253         xmlResetLastError();
12254     }
12255     function_tests++;
12256 #endif
12257
12258     return(test_ret);
12259 }
12260
12261
12262 static int
12263 test_xmlNanoFTPUpdateURL(void) {
12264     int test_ret = 0;
12265
12266 #if defined(LIBXML_FTP_ENABLED)
12267     int mem_base;
12268     int ret_val;
12269     void * ctx; /* an FTP context */
12270     int n_ctx;
12271     const char * URL; /* The URL used to update the context */
12272     int n_URL;
12273
12274     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12275     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12276         mem_base = xmlMemBlocks();
12277         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12278         URL = gen_filepath(n_URL, 1);
12279
12280         ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12281         desret_int(ret_val);
12282         call_tests++;
12283         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12284         des_filepath(n_URL, URL, 1);
12285         xmlResetLastError();
12286         if (mem_base != xmlMemBlocks()) {
12287             printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12288                    xmlMemBlocks() - mem_base);
12289             test_ret++;
12290             printf(" %d", n_ctx);
12291             printf(" %d", n_URL);
12292             printf("\n");
12293         }
12294     }
12295     }
12296     function_tests++;
12297 #endif
12298
12299     return(test_ret);
12300 }
12301
12302 static int
12303 test_nanoftp(void) {
12304     int test_ret = 0;
12305         int rc = 0;
12306
12307     if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12308     rc = test_xmlNanoFTPCheckResponse();
12309         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12310     rc = test_xmlNanoFTPCleanup();
12311         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12312     rc = test_xmlNanoFTPCloseConnection();
12313         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12314     rc = test_xmlNanoFTPCwd();
12315         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12316     rc = test_xmlNanoFTPDele();
12317         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12318     rc = test_xmlNanoFTPGet();
12319         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12320     rc = test_xmlNanoFTPGetConnection();
12321         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12322     rc = test_xmlNanoFTPGetResponse();
12323         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12324     rc = test_xmlNanoFTPGetSocket();
12325         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12326     rc = test_xmlNanoFTPInit();
12327         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12328     rc = test_xmlNanoFTPList();
12329         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12330     rc = test_xmlNanoFTPNewCtxt();
12331         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12332     rc = test_xmlNanoFTPOpen();
12333         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12334     rc = test_xmlNanoFTPProxy();
12335         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12336     rc = test_xmlNanoFTPQuit();
12337         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12338     rc = test_xmlNanoFTPRead();
12339         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12340     rc = test_xmlNanoFTPScanProxy();
12341         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12342     rc = test_xmlNanoFTPUpdateURL();
12343         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12344
12345     if (test_ret != 0)
12346         printf("Module nanoftp: %d errors\n", test_ret);
12347     return(test_ret);
12348 }
12349
12350 static int
12351 test_xmlNanoHTTPAuthHeader(void) {
12352     int test_ret = 0;
12353
12354 #if defined(LIBXML_HTTP_ENABLED)
12355     int mem_base;
12356     const char * ret_val;
12357     void * ctx; /* the HTTP context */
12358     int n_ctx;
12359
12360     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12361         mem_base = xmlMemBlocks();
12362         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12363
12364         ret_val = xmlNanoHTTPAuthHeader(ctx);
12365         desret_const_char_ptr(ret_val);
12366         call_tests++;
12367         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12368         xmlResetLastError();
12369         if (mem_base != xmlMemBlocks()) {
12370             printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12371                    xmlMemBlocks() - mem_base);
12372             test_ret++;
12373             printf(" %d", n_ctx);
12374             printf("\n");
12375         }
12376     }
12377     function_tests++;
12378 #endif
12379
12380     return(test_ret);
12381 }
12382
12383
12384 static int
12385 test_xmlNanoHTTPCleanup(void) {
12386     int test_ret = 0;
12387
12388 #if defined(LIBXML_HTTP_ENABLED)
12389     int mem_base;
12390
12391         mem_base = xmlMemBlocks();
12392
12393         xmlNanoHTTPCleanup();
12394         call_tests++;
12395         xmlResetLastError();
12396         if (mem_base != xmlMemBlocks()) {
12397             printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12398                    xmlMemBlocks() - mem_base);
12399             test_ret++;
12400             printf("\n");
12401         }
12402     function_tests++;
12403 #endif
12404
12405     return(test_ret);
12406 }
12407
12408
12409 static int
12410 test_xmlNanoHTTPContentLength(void) {
12411     int test_ret = 0;
12412
12413 #if defined(LIBXML_HTTP_ENABLED)
12414     int mem_base;
12415     int ret_val;
12416     void * ctx; /* the HTTP context */
12417     int n_ctx;
12418
12419     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12420         mem_base = xmlMemBlocks();
12421         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12422
12423         ret_val = xmlNanoHTTPContentLength(ctx);
12424         desret_int(ret_val);
12425         call_tests++;
12426         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12427         xmlResetLastError();
12428         if (mem_base != xmlMemBlocks()) {
12429             printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12430                    xmlMemBlocks() - mem_base);
12431             test_ret++;
12432             printf(" %d", n_ctx);
12433             printf("\n");
12434         }
12435     }
12436     function_tests++;
12437 #endif
12438
12439     return(test_ret);
12440 }
12441
12442
12443 static int
12444 test_xmlNanoHTTPEncoding(void) {
12445     int test_ret = 0;
12446
12447 #if defined(LIBXML_HTTP_ENABLED)
12448     int mem_base;
12449     const char * ret_val;
12450     void * ctx; /* the HTTP context */
12451     int n_ctx;
12452
12453     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12454         mem_base = xmlMemBlocks();
12455         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12456
12457         ret_val = xmlNanoHTTPEncoding(ctx);
12458         desret_const_char_ptr(ret_val);
12459         call_tests++;
12460         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12461         xmlResetLastError();
12462         if (mem_base != xmlMemBlocks()) {
12463             printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12464                    xmlMemBlocks() - mem_base);
12465             test_ret++;
12466             printf(" %d", n_ctx);
12467             printf("\n");
12468         }
12469     }
12470     function_tests++;
12471 #endif
12472
12473     return(test_ret);
12474 }
12475
12476
12477 #define gen_nb_char_ptr_ptr 1
12478 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12479     return(NULL);
12480 }
12481 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12482 }
12483
12484 static int
12485 test_xmlNanoHTTPFetch(void) {
12486     int test_ret = 0;
12487
12488 #if defined(LIBXML_HTTP_ENABLED)
12489     int mem_base;
12490     int ret_val;
12491     const char * URL; /* The URL to load */
12492     int n_URL;
12493     const char * filename; /* the filename where the content should be saved */
12494     int n_filename;
12495     char ** contentType; /* if available the Content-Type information will be returned at that location */
12496     int n_contentType;
12497
12498     for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12499     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12500     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12501         mem_base = xmlMemBlocks();
12502         URL = gen_fileoutput(n_URL, 0);
12503         filename = gen_fileoutput(n_filename, 1);
12504         contentType = gen_char_ptr_ptr(n_contentType, 2);
12505
12506         ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12507         desret_int(ret_val);
12508         call_tests++;
12509         des_fileoutput(n_URL, URL, 0);
12510         des_fileoutput(n_filename, filename, 1);
12511         des_char_ptr_ptr(n_contentType, contentType, 2);
12512         xmlResetLastError();
12513         if (mem_base != xmlMemBlocks()) {
12514             printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12515                    xmlMemBlocks() - mem_base);
12516             test_ret++;
12517             printf(" %d", n_URL);
12518             printf(" %d", n_filename);
12519             printf(" %d", n_contentType);
12520             printf("\n");
12521         }
12522     }
12523     }
12524     }
12525     function_tests++;
12526 #endif
12527
12528     return(test_ret);
12529 }
12530
12531
12532 static int
12533 test_xmlNanoHTTPInit(void) {
12534     int test_ret = 0;
12535
12536 #if defined(LIBXML_HTTP_ENABLED)
12537     int mem_base;
12538
12539         mem_base = xmlMemBlocks();
12540
12541         xmlNanoHTTPInit();
12542         call_tests++;
12543         xmlResetLastError();
12544         if (mem_base != xmlMemBlocks()) {
12545             printf("Leak of %d blocks found in xmlNanoHTTPInit",
12546                    xmlMemBlocks() - mem_base);
12547             test_ret++;
12548             printf("\n");
12549         }
12550     function_tests++;
12551 #endif
12552
12553     return(test_ret);
12554 }
12555
12556
12557 static int
12558 test_xmlNanoHTTPMimeType(void) {
12559     int test_ret = 0;
12560
12561 #if defined(LIBXML_HTTP_ENABLED)
12562     int mem_base;
12563     const char * ret_val;
12564     void * ctx; /* the HTTP context */
12565     int n_ctx;
12566
12567     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12568         mem_base = xmlMemBlocks();
12569         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12570
12571         ret_val = xmlNanoHTTPMimeType(ctx);
12572         desret_const_char_ptr(ret_val);
12573         call_tests++;
12574         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12575         xmlResetLastError();
12576         if (mem_base != xmlMemBlocks()) {
12577             printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12578                    xmlMemBlocks() - mem_base);
12579             test_ret++;
12580             printf(" %d", n_ctx);
12581             printf("\n");
12582         }
12583     }
12584     function_tests++;
12585 #endif
12586
12587     return(test_ret);
12588 }
12589
12590
12591 static int
12592 test_xmlNanoHTTPOpen(void) {
12593     int test_ret = 0;
12594
12595 #if defined(LIBXML_HTTP_ENABLED)
12596     int mem_base;
12597     void * ret_val;
12598     const char * URL; /* The URL to load */
12599     int n_URL;
12600     char ** contentType; /* if available the Content-Type information will be returned at that location */
12601     int n_contentType;
12602
12603     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12604     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12605         mem_base = xmlMemBlocks();
12606         URL = gen_filepath(n_URL, 0);
12607         contentType = gen_char_ptr_ptr(n_contentType, 1);
12608
12609         ret_val = xmlNanoHTTPOpen(URL, contentType);
12610         desret_xmlNanoHTTPCtxtPtr(ret_val);
12611         call_tests++;
12612         des_filepath(n_URL, URL, 0);
12613         des_char_ptr_ptr(n_contentType, contentType, 1);
12614         xmlResetLastError();
12615         if (mem_base != xmlMemBlocks()) {
12616             printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12617                    xmlMemBlocks() - mem_base);
12618             test_ret++;
12619             printf(" %d", n_URL);
12620             printf(" %d", n_contentType);
12621             printf("\n");
12622         }
12623     }
12624     }
12625     function_tests++;
12626 #endif
12627
12628     return(test_ret);
12629 }
12630
12631
12632 static int
12633 test_xmlNanoHTTPOpenRedir(void) {
12634     int test_ret = 0;
12635
12636 #if defined(LIBXML_HTTP_ENABLED)
12637     int mem_base;
12638     void * ret_val;
12639     const char * URL; /* The URL to load */
12640     int n_URL;
12641     char ** contentType; /* if available the Content-Type information will be returned at that location */
12642     int n_contentType;
12643     char ** redir; /* if available the redirected URL will be returned */
12644     int n_redir;
12645
12646     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12647     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12648     for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12649         mem_base = xmlMemBlocks();
12650         URL = gen_filepath(n_URL, 0);
12651         contentType = gen_char_ptr_ptr(n_contentType, 1);
12652         redir = gen_char_ptr_ptr(n_redir, 2);
12653
12654         ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12655         desret_xmlNanoHTTPCtxtPtr(ret_val);
12656         call_tests++;
12657         des_filepath(n_URL, URL, 0);
12658         des_char_ptr_ptr(n_contentType, contentType, 1);
12659         des_char_ptr_ptr(n_redir, redir, 2);
12660         xmlResetLastError();
12661         if (mem_base != xmlMemBlocks()) {
12662             printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12663                    xmlMemBlocks() - mem_base);
12664             test_ret++;
12665             printf(" %d", n_URL);
12666             printf(" %d", n_contentType);
12667             printf(" %d", n_redir);
12668             printf("\n");
12669         }
12670     }
12671     }
12672     }
12673     function_tests++;
12674 #endif
12675
12676     return(test_ret);
12677 }
12678
12679
12680 static int
12681 test_xmlNanoHTTPRead(void) {
12682     int test_ret = 0;
12683
12684 #if defined(LIBXML_HTTP_ENABLED)
12685     int mem_base;
12686     int ret_val;
12687     void * ctx; /* the HTTP context */
12688     int n_ctx;
12689     void * dest; /* a buffer */
12690     int n_dest;
12691     int len; /* the buffer length */
12692     int n_len;
12693
12694     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12695     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12696     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12697         mem_base = xmlMemBlocks();
12698         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12699         dest = gen_void_ptr(n_dest, 1);
12700         len = gen_int(n_len, 2);
12701
12702         ret_val = xmlNanoHTTPRead(ctx, dest, len);
12703         desret_int(ret_val);
12704         call_tests++;
12705         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12706         des_void_ptr(n_dest, dest, 1);
12707         des_int(n_len, len, 2);
12708         xmlResetLastError();
12709         if (mem_base != xmlMemBlocks()) {
12710             printf("Leak of %d blocks found in xmlNanoHTTPRead",
12711                    xmlMemBlocks() - mem_base);
12712             test_ret++;
12713             printf(" %d", n_ctx);
12714             printf(" %d", n_dest);
12715             printf(" %d", n_len);
12716             printf("\n");
12717         }
12718     }
12719     }
12720     }
12721     function_tests++;
12722 #endif
12723
12724     return(test_ret);
12725 }
12726
12727
12728 static int
12729 test_xmlNanoHTTPRedir(void) {
12730     int test_ret = 0;
12731
12732
12733     /* missing type support */
12734     return(test_ret);
12735 }
12736
12737
12738 static int
12739 test_xmlNanoHTTPReturnCode(void) {
12740     int test_ret = 0;
12741
12742 #if defined(LIBXML_HTTP_ENABLED)
12743     int mem_base;
12744     int ret_val;
12745     void * ctx; /* the HTTP context */
12746     int n_ctx;
12747
12748     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12749         mem_base = xmlMemBlocks();
12750         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12751
12752         ret_val = xmlNanoHTTPReturnCode(ctx);
12753         desret_int(ret_val);
12754         call_tests++;
12755         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12756         xmlResetLastError();
12757         if (mem_base != xmlMemBlocks()) {
12758             printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12759                    xmlMemBlocks() - mem_base);
12760             test_ret++;
12761             printf(" %d", n_ctx);
12762             printf("\n");
12763         }
12764     }
12765     function_tests++;
12766 #endif
12767
12768     return(test_ret);
12769 }
12770
12771
12772 static int
12773 test_xmlNanoHTTPSave(void) {
12774     int test_ret = 0;
12775
12776 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12777     int mem_base;
12778     int ret_val;
12779     void * ctxt; /* the HTTP context */
12780     int n_ctxt;
12781     const char * filename; /* the filename where the content should be saved */
12782     int n_filename;
12783
12784     for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12785     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12786         mem_base = xmlMemBlocks();
12787         ctxt = gen_void_ptr(n_ctxt, 0);
12788         filename = gen_fileoutput(n_filename, 1);
12789
12790         ret_val = xmlNanoHTTPSave(ctxt, filename);
12791         desret_int(ret_val);
12792         call_tests++;
12793         des_void_ptr(n_ctxt, ctxt, 0);
12794         des_fileoutput(n_filename, filename, 1);
12795         xmlResetLastError();
12796         if (mem_base != xmlMemBlocks()) {
12797             printf("Leak of %d blocks found in xmlNanoHTTPSave",
12798                    xmlMemBlocks() - mem_base);
12799             test_ret++;
12800             printf(" %d", n_ctxt);
12801             printf(" %d", n_filename);
12802             printf("\n");
12803         }
12804     }
12805     }
12806     function_tests++;
12807 #endif
12808
12809     return(test_ret);
12810 }
12811
12812
12813 static int
12814 test_xmlNanoHTTPScanProxy(void) {
12815     int test_ret = 0;
12816
12817 #if defined(LIBXML_HTTP_ENABLED)
12818     const char * URL; /* The proxy URL used to initialize the proxy context */
12819     int n_URL;
12820
12821     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12822         URL = gen_filepath(n_URL, 0);
12823
12824         xmlNanoHTTPScanProxy(URL);
12825         call_tests++;
12826         des_filepath(n_URL, URL, 0);
12827         xmlResetLastError();
12828     }
12829     function_tests++;
12830 #endif
12831
12832     return(test_ret);
12833 }
12834
12835 static int
12836 test_nanohttp(void) {
12837     int test_ret = 0;
12838         int rc = 0;
12839
12840     if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12841     rc = test_xmlNanoHTTPAuthHeader();
12842         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12843     rc = test_xmlNanoHTTPCleanup();
12844         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12845     rc = test_xmlNanoHTTPContentLength();
12846         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12847     rc = test_xmlNanoHTTPEncoding();
12848         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12849     rc = test_xmlNanoHTTPFetch();
12850         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12851     rc = test_xmlNanoHTTPInit();
12852         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12853     rc = test_xmlNanoHTTPMimeType();
12854         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12855     rc = test_xmlNanoHTTPOpen();
12856         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12857     rc = test_xmlNanoHTTPOpenRedir();
12858         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12859     rc = test_xmlNanoHTTPRead();
12860         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12861     rc = test_xmlNanoHTTPRedir();
12862         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12863     rc = test_xmlNanoHTTPReturnCode();
12864         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12865     rc = test_xmlNanoHTTPSave();
12866         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12867     rc = test_xmlNanoHTTPScanProxy();
12868         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12869
12870     if (test_ret != 0)
12871         printf("Module nanohttp: %d errors\n", test_ret);
12872     return(test_ret);
12873 }
12874
12875 static int
12876 test_xmlByteConsumed(void) {
12877     int test_ret = 0;
12878
12879     int mem_base;
12880     long ret_val;
12881     xmlParserCtxtPtr ctxt; /* an XML parser context */
12882     int n_ctxt;
12883
12884     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12885         mem_base = xmlMemBlocks();
12886         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12887
12888         ret_val = xmlByteConsumed(ctxt);
12889         desret_long(ret_val);
12890         call_tests++;
12891         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12892         xmlResetLastError();
12893         if (mem_base != xmlMemBlocks()) {
12894             printf("Leak of %d blocks found in xmlByteConsumed",
12895                    xmlMemBlocks() - mem_base);
12896             test_ret++;
12897             printf(" %d", n_ctxt);
12898             printf("\n");
12899         }
12900     }
12901     function_tests++;
12902
12903     return(test_ret);
12904 }
12905
12906
12907 static int
12908 test_xmlClearNodeInfoSeq(void) {
12909     int test_ret = 0;
12910
12911     int mem_base;
12912     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12913     int n_seq;
12914
12915     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12916         mem_base = xmlMemBlocks();
12917         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12918
12919         xmlClearNodeInfoSeq(seq);
12920         call_tests++;
12921         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12922         xmlResetLastError();
12923         if (mem_base != xmlMemBlocks()) {
12924             printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12925                    xmlMemBlocks() - mem_base);
12926             test_ret++;
12927             printf(" %d", n_seq);
12928             printf("\n");
12929         }
12930     }
12931     function_tests++;
12932
12933     return(test_ret);
12934 }
12935
12936
12937 static int
12938 test_xmlClearParserCtxt(void) {
12939     int test_ret = 0;
12940
12941     int mem_base;
12942     xmlParserCtxtPtr ctxt; /* an XML parser context */
12943     int n_ctxt;
12944
12945     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12946         mem_base = xmlMemBlocks();
12947         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12948
12949         xmlClearParserCtxt(ctxt);
12950         call_tests++;
12951         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12952         xmlResetLastError();
12953         if (mem_base != xmlMemBlocks()) {
12954             printf("Leak of %d blocks found in xmlClearParserCtxt",
12955                    xmlMemBlocks() - mem_base);
12956             test_ret++;
12957             printf(" %d", n_ctxt);
12958             printf("\n");
12959         }
12960     }
12961     function_tests++;
12962
12963     return(test_ret);
12964 }
12965
12966
12967 static int
12968 test_xmlCreateDocParserCtxt(void) {
12969     int test_ret = 0;
12970
12971     int mem_base;
12972     xmlParserCtxtPtr ret_val;
12973     xmlChar * cur; /* a pointer to an array of xmlChar */
12974     int n_cur;
12975
12976     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12977         mem_base = xmlMemBlocks();
12978         cur = gen_const_xmlChar_ptr(n_cur, 0);
12979
12980         ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12981         desret_xmlParserCtxtPtr(ret_val);
12982         call_tests++;
12983         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12984         xmlResetLastError();
12985         if (mem_base != xmlMemBlocks()) {
12986             printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12987                    xmlMemBlocks() - mem_base);
12988             test_ret++;
12989             printf(" %d", n_cur);
12990             printf("\n");
12991         }
12992     }
12993     function_tests++;
12994
12995     return(test_ret);
12996 }
12997
12998
12999 static int
13000 test_xmlCreatePushParserCtxt(void) {
13001     int test_ret = 0;
13002
13003 #if defined(LIBXML_PUSH_ENABLED)
13004     int mem_base;
13005     xmlParserCtxtPtr ret_val;
13006     xmlSAXHandlerPtr sax; /* a SAX handler */
13007     int n_sax;
13008     void * user_data; /* The user data returned on SAX callbacks */
13009     int n_user_data;
13010     char * chunk; /* a pointer to an array of chars */
13011     int n_chunk;
13012     int size; /* number of chars in the array */
13013     int n_size;
13014     const char * filename; /* an optional file name or URI */
13015     int n_filename;
13016
13017     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13018     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13019     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13020     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13021     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
13022         mem_base = xmlMemBlocks();
13023         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13024         user_data = gen_userdata(n_user_data, 1);
13025         chunk = gen_const_char_ptr(n_chunk, 2);
13026         size = gen_int(n_size, 3);
13027         filename = gen_fileoutput(n_filename, 4);
13028
13029         ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
13030         desret_xmlParserCtxtPtr(ret_val);
13031         call_tests++;
13032         des_xmlSAXHandlerPtr(n_sax, sax, 0);
13033         des_userdata(n_user_data, user_data, 1);
13034         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
13035         des_int(n_size, size, 3);
13036         des_fileoutput(n_filename, filename, 4);
13037         xmlResetLastError();
13038         if (mem_base != xmlMemBlocks()) {
13039             printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
13040                    xmlMemBlocks() - mem_base);
13041             test_ret++;
13042             printf(" %d", n_sax);
13043             printf(" %d", n_user_data);
13044             printf(" %d", n_chunk);
13045             printf(" %d", n_size);
13046             printf(" %d", n_filename);
13047             printf("\n");
13048         }
13049     }
13050     }
13051     }
13052     }
13053     }
13054     function_tests++;
13055 #endif
13056
13057     return(test_ret);
13058 }
13059
13060
13061 static int
13062 test_xmlCtxtReadDoc(void) {
13063     int test_ret = 0;
13064
13065     int mem_base;
13066     xmlDocPtr ret_val;
13067     xmlParserCtxtPtr ctxt; /* an XML parser context */
13068     int n_ctxt;
13069     xmlChar * cur; /* a pointer to a zero terminated string */
13070     int n_cur;
13071     const char * URL; /* the base URL to use for the document */
13072     int n_URL;
13073     char * encoding; /* the document encoding, or NULL */
13074     int n_encoding;
13075     int options; /* a combination of xmlParserOption */
13076     int n_options;
13077
13078     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13079     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13080     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13081     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13082     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13083         mem_base = xmlMemBlocks();
13084         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13085         cur = gen_const_xmlChar_ptr(n_cur, 1);
13086         URL = gen_filepath(n_URL, 2);
13087         encoding = gen_const_char_ptr(n_encoding, 3);
13088         options = gen_parseroptions(n_options, 4);
13089
13090         ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
13091         desret_xmlDocPtr(ret_val);
13092         call_tests++;
13093         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13094         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
13095         des_filepath(n_URL, URL, 2);
13096         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
13097         des_parseroptions(n_options, options, 4);
13098         xmlResetLastError();
13099         if (mem_base != xmlMemBlocks()) {
13100             printf("Leak of %d blocks found in xmlCtxtReadDoc",
13101                    xmlMemBlocks() - mem_base);
13102             test_ret++;
13103             printf(" %d", n_ctxt);
13104             printf(" %d", n_cur);
13105             printf(" %d", n_URL);
13106             printf(" %d", n_encoding);
13107             printf(" %d", n_options);
13108             printf("\n");
13109         }
13110     }
13111     }
13112     }
13113     }
13114     }
13115     function_tests++;
13116
13117     return(test_ret);
13118 }
13119
13120
13121 static int
13122 test_xmlCtxtReadFile(void) {
13123     int test_ret = 0;
13124
13125     int mem_base;
13126     xmlDocPtr ret_val;
13127     xmlParserCtxtPtr ctxt; /* an XML parser context */
13128     int n_ctxt;
13129     const char * filename; /* a file or URL */
13130     int n_filename;
13131     char * encoding; /* the document encoding, or NULL */
13132     int n_encoding;
13133     int options; /* a combination of xmlParserOption */
13134     int n_options;
13135
13136     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13137     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13138     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13139     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13140         mem_base = xmlMemBlocks();
13141         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13142         filename = gen_filepath(n_filename, 1);
13143         encoding = gen_const_char_ptr(n_encoding, 2);
13144         options = gen_parseroptions(n_options, 3);
13145
13146         ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
13147         desret_xmlDocPtr(ret_val);
13148         call_tests++;
13149         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13150         des_filepath(n_filename, filename, 1);
13151         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
13152         des_parseroptions(n_options, options, 3);
13153         xmlResetLastError();
13154         if (mem_base != xmlMemBlocks()) {
13155             printf("Leak of %d blocks found in xmlCtxtReadFile",
13156                    xmlMemBlocks() - mem_base);
13157             test_ret++;
13158             printf(" %d", n_ctxt);
13159             printf(" %d", n_filename);
13160             printf(" %d", n_encoding);
13161             printf(" %d", n_options);
13162             printf("\n");
13163         }
13164     }
13165     }
13166     }
13167     }
13168     function_tests++;
13169
13170     return(test_ret);
13171 }
13172
13173
13174 static int
13175 test_xmlCtxtReadMemory(void) {
13176     int test_ret = 0;
13177
13178     int mem_base;
13179     xmlDocPtr ret_val;
13180     xmlParserCtxtPtr ctxt; /* an XML parser context */
13181     int n_ctxt;
13182     char * buffer; /* a pointer to a char array */
13183     int n_buffer;
13184     int size; /* the size of the array */
13185     int n_size;
13186     const char * URL; /* the base URL to use for the document */
13187     int n_URL;
13188     char * encoding; /* the document encoding, or NULL */
13189     int n_encoding;
13190     int options; /* a combination of xmlParserOption */
13191     int n_options;
13192
13193     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13194     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
13195     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13196     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13197     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13198     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13199         mem_base = xmlMemBlocks();
13200         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13201         buffer = gen_const_char_ptr(n_buffer, 1);
13202         size = gen_int(n_size, 2);
13203         URL = gen_filepath(n_URL, 3);
13204         encoding = gen_const_char_ptr(n_encoding, 4);
13205         options = gen_parseroptions(n_options, 5);
13206
13207         ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
13208         desret_xmlDocPtr(ret_val);
13209         call_tests++;
13210         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13211         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
13212         des_int(n_size, size, 2);
13213         des_filepath(n_URL, URL, 3);
13214         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13215         des_parseroptions(n_options, options, 5);
13216         xmlResetLastError();
13217         if (mem_base != xmlMemBlocks()) {
13218             printf("Leak of %d blocks found in xmlCtxtReadMemory",
13219                    xmlMemBlocks() - mem_base);
13220             test_ret++;
13221             printf(" %d", n_ctxt);
13222             printf(" %d", n_buffer);
13223             printf(" %d", n_size);
13224             printf(" %d", n_URL);
13225             printf(" %d", n_encoding);
13226             printf(" %d", n_options);
13227             printf("\n");
13228         }
13229     }
13230     }
13231     }
13232     }
13233     }
13234     }
13235     function_tests++;
13236
13237     return(test_ret);
13238 }
13239
13240
13241 static int
13242 test_xmlCtxtReset(void) {
13243     int test_ret = 0;
13244
13245     int mem_base;
13246     xmlParserCtxtPtr ctxt; /* an XML parser context */
13247     int n_ctxt;
13248
13249     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13250         mem_base = xmlMemBlocks();
13251         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13252
13253         xmlCtxtReset(ctxt);
13254         call_tests++;
13255         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13256         xmlResetLastError();
13257         if (mem_base != xmlMemBlocks()) {
13258             printf("Leak of %d blocks found in xmlCtxtReset",
13259                    xmlMemBlocks() - mem_base);
13260             test_ret++;
13261             printf(" %d", n_ctxt);
13262             printf("\n");
13263         }
13264     }
13265     function_tests++;
13266
13267     return(test_ret);
13268 }
13269
13270
13271 static int
13272 test_xmlCtxtResetPush(void) {
13273     int test_ret = 0;
13274
13275     int mem_base;
13276     int ret_val;
13277     xmlParserCtxtPtr ctxt; /* an XML parser context */
13278     int n_ctxt;
13279     char * chunk; /* a pointer to an array of chars */
13280     int n_chunk;
13281     int size; /* number of chars in the array */
13282     int n_size;
13283     const char * filename; /* an optional file name or URI */
13284     int n_filename;
13285     char * encoding; /* the document encoding, or NULL */
13286     int n_encoding;
13287
13288     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13289     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13290     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13291     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13292     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13293         mem_base = xmlMemBlocks();
13294         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13295         chunk = gen_const_char_ptr(n_chunk, 1);
13296         size = gen_int(n_size, 2);
13297         filename = gen_filepath(n_filename, 3);
13298         encoding = gen_const_char_ptr(n_encoding, 4);
13299
13300         ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
13301         desret_int(ret_val);
13302         call_tests++;
13303         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13304         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13305         des_int(n_size, size, 2);
13306         des_filepath(n_filename, filename, 3);
13307         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13308         xmlResetLastError();
13309         if (mem_base != xmlMemBlocks()) {
13310             printf("Leak of %d blocks found in xmlCtxtResetPush",
13311                    xmlMemBlocks() - mem_base);
13312             test_ret++;
13313             printf(" %d", n_ctxt);
13314             printf(" %d", n_chunk);
13315             printf(" %d", n_size);
13316             printf(" %d", n_filename);
13317             printf(" %d", n_encoding);
13318             printf("\n");
13319         }
13320     }
13321     }
13322     }
13323     }
13324     }
13325     function_tests++;
13326
13327     return(test_ret);
13328 }
13329
13330
13331 static int
13332 test_xmlCtxtUseOptions(void) {
13333     int test_ret = 0;
13334
13335     int mem_base;
13336     int ret_val;
13337     xmlParserCtxtPtr ctxt; /* an XML parser context */
13338     int n_ctxt;
13339     int options; /* a combination of xmlParserOption */
13340     int n_options;
13341
13342     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13343     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13344         mem_base = xmlMemBlocks();
13345         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13346         options = gen_parseroptions(n_options, 1);
13347
13348         ret_val = xmlCtxtUseOptions(ctxt, options);
13349         desret_int(ret_val);
13350         call_tests++;
13351         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13352         des_parseroptions(n_options, options, 1);
13353         xmlResetLastError();
13354         if (mem_base != xmlMemBlocks()) {
13355             printf("Leak of %d blocks found in xmlCtxtUseOptions",
13356                    xmlMemBlocks() - mem_base);
13357             test_ret++;
13358             printf(" %d", n_ctxt);
13359             printf(" %d", n_options);
13360             printf("\n");
13361         }
13362     }
13363     }
13364     function_tests++;
13365
13366     return(test_ret);
13367 }
13368
13369
13370 static int
13371 test_xmlGetExternalEntityLoader(void) {
13372     int test_ret = 0;
13373
13374
13375     /* missing type support */
13376     return(test_ret);
13377 }
13378
13379
13380 static int
13381 test_xmlGetFeature(void) {
13382     int test_ret = 0;
13383
13384 #if defined(LIBXML_LEGACY_ENABLED)
13385 #ifdef LIBXML_LEGACY_ENABLED
13386     int mem_base;
13387     int ret_val;
13388     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13389     int n_ctxt;
13390     char * name; /* the feature name */
13391     int n_name;
13392     void * result; /* location to store the result */
13393     int n_result;
13394
13395     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13396     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13397     for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13398         mem_base = xmlMemBlocks();
13399         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13400         name = gen_const_char_ptr(n_name, 1);
13401         result = gen_void_ptr(n_result, 2);
13402
13403         ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13404         desret_int(ret_val);
13405         call_tests++;
13406         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13407         des_const_char_ptr(n_name, (const char *)name, 1);
13408         des_void_ptr(n_result, result, 2);
13409         xmlResetLastError();
13410         if (mem_base != xmlMemBlocks()) {
13411             printf("Leak of %d blocks found in xmlGetFeature",
13412                    xmlMemBlocks() - mem_base);
13413             test_ret++;
13414             printf(" %d", n_ctxt);
13415             printf(" %d", n_name);
13416             printf(" %d", n_result);
13417             printf("\n");
13418         }
13419     }
13420     }
13421     }
13422     function_tests++;
13423 #endif
13424 #endif
13425
13426     return(test_ret);
13427 }
13428
13429
13430 #define gen_nb_const_char_ptr_ptr 1
13431 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13432     return(NULL);
13433 }
13434 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13435 }
13436
13437 static int
13438 test_xmlGetFeaturesList(void) {
13439     int test_ret = 0;
13440
13441 #if defined(LIBXML_LEGACY_ENABLED)
13442 #ifdef LIBXML_LEGACY_ENABLED
13443     int mem_base;
13444     int ret_val;
13445     int * len; /* the length of the features name array (input/output) */
13446     int n_len;
13447     char ** result; /* an array of string to be filled with the features name. */
13448     int n_result;
13449
13450     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13451     for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13452         mem_base = xmlMemBlocks();
13453         len = gen_int_ptr(n_len, 0);
13454         result = gen_const_char_ptr_ptr(n_result, 1);
13455
13456         ret_val = xmlGetFeaturesList(len, (const char **)result);
13457         desret_int(ret_val);
13458         call_tests++;
13459         des_int_ptr(n_len, len, 0);
13460         des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13461         xmlResetLastError();
13462         if (mem_base != xmlMemBlocks()) {
13463             printf("Leak of %d blocks found in xmlGetFeaturesList",
13464                    xmlMemBlocks() - mem_base);
13465             test_ret++;
13466             printf(" %d", n_len);
13467             printf(" %d", n_result);
13468             printf("\n");
13469         }
13470     }
13471     }
13472     function_tests++;
13473 #endif
13474 #endif
13475
13476     return(test_ret);
13477 }
13478
13479
13480 static int
13481 test_xmlHasFeature(void) {
13482     int test_ret = 0;
13483
13484     int mem_base;
13485     int ret_val;
13486     xmlFeature feature; /* the feature to be examined */
13487     int n_feature;
13488
13489     for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13490         mem_base = xmlMemBlocks();
13491         feature = gen_xmlFeature(n_feature, 0);
13492
13493         ret_val = xmlHasFeature(feature);
13494         desret_int(ret_val);
13495         call_tests++;
13496         des_xmlFeature(n_feature, feature, 0);
13497         xmlResetLastError();
13498         if (mem_base != xmlMemBlocks()) {
13499             printf("Leak of %d blocks found in xmlHasFeature",
13500                    xmlMemBlocks() - mem_base);
13501             test_ret++;
13502             printf(" %d", n_feature);
13503             printf("\n");
13504         }
13505     }
13506     function_tests++;
13507
13508     return(test_ret);
13509 }
13510
13511
13512 static int
13513 test_xmlIOParseDTD(void) {
13514     int test_ret = 0;
13515
13516 #if defined(LIBXML_VALID_ENABLED)
13517 #ifdef LIBXML_VALID_ENABLED
13518     xmlDtdPtr ret_val;
13519     xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13520     int n_sax;
13521     xmlParserInputBufferPtr input; /* an Input Buffer */
13522     int n_input;
13523     xmlCharEncoding enc; /* the charset encoding if known */
13524     int n_enc;
13525
13526     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13527     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13528     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13529         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13530         input = gen_xmlParserInputBufferPtr(n_input, 1);
13531         enc = gen_xmlCharEncoding(n_enc, 2);
13532
13533         ret_val = xmlIOParseDTD(sax, input, enc);
13534         input = NULL;
13535         desret_xmlDtdPtr(ret_val);
13536         call_tests++;
13537         des_xmlSAXHandlerPtr(n_sax, sax, 0);
13538         des_xmlParserInputBufferPtr(n_input, input, 1);
13539         des_xmlCharEncoding(n_enc, enc, 2);
13540         xmlResetLastError();
13541     }
13542     }
13543     }
13544     function_tests++;
13545 #endif
13546 #endif
13547
13548     return(test_ret);
13549 }
13550
13551
13552 static int
13553 test_xmlInitNodeInfoSeq(void) {
13554     int test_ret = 0;
13555
13556     int mem_base;
13557     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13558     int n_seq;
13559
13560     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13561         mem_base = xmlMemBlocks();
13562         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13563
13564         xmlInitNodeInfoSeq(seq);
13565         call_tests++;
13566         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13567         xmlResetLastError();
13568         if (mem_base != xmlMemBlocks()) {
13569             printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13570                    xmlMemBlocks() - mem_base);
13571             test_ret++;
13572             printf(" %d", n_seq);
13573             printf("\n");
13574         }
13575     }
13576     function_tests++;
13577
13578     return(test_ret);
13579 }
13580
13581
13582 static int
13583 test_xmlInitParser(void) {
13584     int test_ret = 0;
13585
13586     int mem_base;
13587
13588         mem_base = xmlMemBlocks();
13589
13590         xmlInitParser();
13591         call_tests++;
13592         xmlResetLastError();
13593         if (mem_base != xmlMemBlocks()) {
13594             printf("Leak of %d blocks found in xmlInitParser",
13595                    xmlMemBlocks() - mem_base);
13596             test_ret++;
13597             printf("\n");
13598         }
13599     function_tests++;
13600
13601     return(test_ret);
13602 }
13603
13604
13605 static int
13606 test_xmlInitParserCtxt(void) {
13607     int test_ret = 0;
13608
13609     int mem_base;
13610     int ret_val;
13611     xmlParserCtxtPtr ctxt; /* an XML parser context */
13612     int n_ctxt;
13613
13614     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13615         mem_base = xmlMemBlocks();
13616         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13617
13618         ret_val = xmlInitParserCtxt(ctxt);
13619         desret_int(ret_val);
13620         call_tests++;
13621         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13622         xmlResetLastError();
13623         if (mem_base != xmlMemBlocks()) {
13624             printf("Leak of %d blocks found in xmlInitParserCtxt",
13625                    xmlMemBlocks() - mem_base);
13626             test_ret++;
13627             printf(" %d", n_ctxt);
13628             printf("\n");
13629         }
13630     }
13631     function_tests++;
13632
13633     return(test_ret);
13634 }
13635
13636
13637 static int
13638 test_xmlKeepBlanksDefault(void) {
13639     int test_ret = 0;
13640
13641     int mem_base;
13642     int ret_val;
13643     int val; /* int 0 or 1 */
13644     int n_val;
13645
13646     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13647         mem_base = xmlMemBlocks();
13648         val = gen_int(n_val, 0);
13649
13650         ret_val = xmlKeepBlanksDefault(val);
13651         desret_int(ret_val);
13652         call_tests++;
13653         des_int(n_val, val, 0);
13654         xmlResetLastError();
13655         if (mem_base != xmlMemBlocks()) {
13656             printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13657                    xmlMemBlocks() - mem_base);
13658             test_ret++;
13659             printf(" %d", n_val);
13660             printf("\n");
13661         }
13662     }
13663     function_tests++;
13664
13665     return(test_ret);
13666 }
13667
13668
13669 static int
13670 test_xmlLineNumbersDefault(void) {
13671     int test_ret = 0;
13672
13673     int mem_base;
13674     int ret_val;
13675     int val; /* int 0 or 1 */
13676     int n_val;
13677
13678     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13679         mem_base = xmlMemBlocks();
13680         val = gen_int(n_val, 0);
13681
13682         ret_val = xmlLineNumbersDefault(val);
13683         desret_int(ret_val);
13684         call_tests++;
13685         des_int(n_val, val, 0);
13686         xmlResetLastError();
13687         if (mem_base != xmlMemBlocks()) {
13688             printf("Leak of %d blocks found in xmlLineNumbersDefault",
13689                    xmlMemBlocks() - mem_base);
13690             test_ret++;
13691             printf(" %d", n_val);
13692             printf("\n");
13693         }
13694     }
13695     function_tests++;
13696
13697     return(test_ret);
13698 }
13699
13700
13701 static int
13702 test_xmlLoadExternalEntity(void) {
13703     int test_ret = 0;
13704
13705     int mem_base;
13706     xmlParserInputPtr ret_val;
13707     const char * URL; /* the URL for the entity to load */
13708     int n_URL;
13709     char * ID; /* the Public ID for the entity to load */
13710     int n_ID;
13711     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13712     int n_ctxt;
13713
13714     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13715     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13716     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13717         mem_base = xmlMemBlocks();
13718         URL = gen_filepath(n_URL, 0);
13719         ID = gen_const_char_ptr(n_ID, 1);
13720         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13721
13722         ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13723         desret_xmlParserInputPtr(ret_val);
13724         call_tests++;
13725         des_filepath(n_URL, URL, 0);
13726         des_const_char_ptr(n_ID, (const char *)ID, 1);
13727         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13728         xmlResetLastError();
13729         if (mem_base != xmlMemBlocks()) {
13730             printf("Leak of %d blocks found in xmlLoadExternalEntity",
13731                    xmlMemBlocks() - mem_base);
13732             test_ret++;
13733             printf(" %d", n_URL);
13734             printf(" %d", n_ID);
13735             printf(" %d", n_ctxt);
13736             printf("\n");
13737         }
13738     }
13739     }
13740     }
13741     function_tests++;
13742
13743     return(test_ret);
13744 }
13745
13746
13747 static int
13748 test_xmlNewIOInputStream(void) {
13749     int test_ret = 0;
13750
13751     int mem_base;
13752     xmlParserInputPtr ret_val;
13753     xmlParserCtxtPtr ctxt; /* an XML parser context */
13754     int n_ctxt;
13755     xmlParserInputBufferPtr input; /* an I/O Input */
13756     int n_input;
13757     xmlCharEncoding enc; /* the charset encoding if known */
13758     int n_enc;
13759
13760     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13761     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13762     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13763         mem_base = xmlMemBlocks();
13764         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13765         input = gen_xmlParserInputBufferPtr(n_input, 1);
13766         enc = gen_xmlCharEncoding(n_enc, 2);
13767
13768         ret_val = xmlNewIOInputStream(ctxt, input, enc);
13769         if (ret_val != NULL) input = NULL;
13770         desret_xmlParserInputPtr(ret_val);
13771         call_tests++;
13772         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13773         des_xmlParserInputBufferPtr(n_input, input, 1);
13774         des_xmlCharEncoding(n_enc, enc, 2);
13775         xmlResetLastError();
13776         if (mem_base != xmlMemBlocks()) {
13777             printf("Leak of %d blocks found in xmlNewIOInputStream",
13778                    xmlMemBlocks() - mem_base);
13779             test_ret++;
13780             printf(" %d", n_ctxt);
13781             printf(" %d", n_input);
13782             printf(" %d", n_enc);
13783             printf("\n");
13784         }
13785     }
13786     }
13787     }
13788     function_tests++;
13789
13790     return(test_ret);
13791 }
13792
13793
13794 static int
13795 test_xmlNewParserCtxt(void) {
13796     int test_ret = 0;
13797
13798     int mem_base;
13799     xmlParserCtxtPtr ret_val;
13800
13801         mem_base = xmlMemBlocks();
13802
13803         ret_val = xmlNewParserCtxt();
13804         desret_xmlParserCtxtPtr(ret_val);
13805         call_tests++;
13806         xmlResetLastError();
13807         if (mem_base != xmlMemBlocks()) {
13808             printf("Leak of %d blocks found in xmlNewParserCtxt",
13809                    xmlMemBlocks() - mem_base);
13810             test_ret++;
13811             printf("\n");
13812         }
13813     function_tests++;
13814
13815     return(test_ret);
13816 }
13817
13818
13819 #define gen_nb_xmlNodePtr_ptr 1
13820 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13821     return(NULL);
13822 }
13823 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13824 }
13825
13826 static int
13827 test_xmlParseBalancedChunkMemory(void) {
13828     int test_ret = 0;
13829
13830 #if defined(LIBXML_SAX1_ENABLED)
13831 #ifdef LIBXML_SAX1_ENABLED
13832     int mem_base;
13833     int ret_val;
13834     xmlDocPtr doc; /* the document the chunk pertains to */
13835     int n_doc;
13836     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13837     int n_sax;
13838     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13839     int n_user_data;
13840     int depth; /* Used for loop detection, use 0 */
13841     int n_depth;
13842     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13843     int n_string;
13844     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13845     int n_lst;
13846
13847     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13848     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13849     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13850     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13851     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13852     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13853         mem_base = xmlMemBlocks();
13854         doc = gen_xmlDocPtr(n_doc, 0);
13855         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13856         user_data = gen_userdata(n_user_data, 2);
13857         depth = gen_int(n_depth, 3);
13858         string = gen_const_xmlChar_ptr(n_string, 4);
13859         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13860
13861 #ifdef LIBXML_SAX1_ENABLED
13862         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13863 #endif
13864
13865
13866         ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13867         desret_int(ret_val);
13868         call_tests++;
13869         des_xmlDocPtr(n_doc, doc, 0);
13870         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13871         des_userdata(n_user_data, user_data, 2);
13872         des_int(n_depth, depth, 3);
13873         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13874         des_xmlNodePtr_ptr(n_lst, lst, 5);
13875         xmlResetLastError();
13876         if (mem_base != xmlMemBlocks()) {
13877             printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13878                    xmlMemBlocks() - mem_base);
13879             test_ret++;
13880             printf(" %d", n_doc);
13881             printf(" %d", n_sax);
13882             printf(" %d", n_user_data);
13883             printf(" %d", n_depth);
13884             printf(" %d", n_string);
13885             printf(" %d", n_lst);
13886             printf("\n");
13887         }
13888     }
13889     }
13890     }
13891     }
13892     }
13893     }
13894     function_tests++;
13895 #endif
13896 #endif
13897
13898     return(test_ret);
13899 }
13900
13901
13902 static int
13903 test_xmlParseBalancedChunkMemoryRecover(void) {
13904     int test_ret = 0;
13905
13906 #if defined(LIBXML_SAX1_ENABLED)
13907 #ifdef LIBXML_SAX1_ENABLED
13908     int mem_base;
13909     int ret_val;
13910     xmlDocPtr doc; /* the document the chunk pertains to */
13911     int n_doc;
13912     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13913     int n_sax;
13914     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13915     int n_user_data;
13916     int depth; /* Used for loop detection, use 0 */
13917     int n_depth;
13918     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13919     int n_string;
13920     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13921     int n_lst;
13922     int recover; /* return nodes even if the data is broken (use 0) */
13923     int n_recover;
13924
13925     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13926     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13927     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13928     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13929     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13930     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13931     for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13932         mem_base = xmlMemBlocks();
13933         doc = gen_xmlDocPtr(n_doc, 0);
13934         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13935         user_data = gen_userdata(n_user_data, 2);
13936         depth = gen_int(n_depth, 3);
13937         string = gen_const_xmlChar_ptr(n_string, 4);
13938         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13939         recover = gen_int(n_recover, 6);
13940
13941 #ifdef LIBXML_SAX1_ENABLED
13942         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13943 #endif
13944
13945
13946         ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13947         desret_int(ret_val);
13948         call_tests++;
13949         des_xmlDocPtr(n_doc, doc, 0);
13950         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13951         des_userdata(n_user_data, user_data, 2);
13952         des_int(n_depth, depth, 3);
13953         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13954         des_xmlNodePtr_ptr(n_lst, lst, 5);
13955         des_int(n_recover, recover, 6);
13956         xmlResetLastError();
13957         if (mem_base != xmlMemBlocks()) {
13958             printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13959                    xmlMemBlocks() - mem_base);
13960             test_ret++;
13961             printf(" %d", n_doc);
13962             printf(" %d", n_sax);
13963             printf(" %d", n_user_data);
13964             printf(" %d", n_depth);
13965             printf(" %d", n_string);
13966             printf(" %d", n_lst);
13967             printf(" %d", n_recover);
13968             printf("\n");
13969         }
13970     }
13971     }
13972     }
13973     }
13974     }
13975     }
13976     }
13977     function_tests++;
13978 #endif
13979 #endif
13980
13981     return(test_ret);
13982 }
13983
13984
13985 static int
13986 test_xmlParseChunk(void) {
13987     int test_ret = 0;
13988
13989 #if defined(LIBXML_PUSH_ENABLED)
13990     int mem_base;
13991     int ret_val;
13992     xmlParserCtxtPtr ctxt; /* an XML parser context */
13993     int n_ctxt;
13994     char * chunk; /* an char array */
13995     int n_chunk;
13996     int size; /* the size in byte of the chunk */
13997     int n_size;
13998     int terminate; /* last chunk indicator */
13999     int n_terminate;
14000
14001     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14002     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
14003     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14004     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
14005         mem_base = xmlMemBlocks();
14006         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14007         chunk = gen_const_char_ptr(n_chunk, 1);
14008         size = gen_int(n_size, 2);
14009         terminate = gen_int(n_terminate, 3);
14010
14011         ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
14012         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
14013         desret_int(ret_val);
14014         call_tests++;
14015         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14016         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
14017         des_int(n_size, size, 2);
14018         des_int(n_terminate, terminate, 3);
14019         xmlResetLastError();
14020         if (mem_base != xmlMemBlocks()) {
14021             printf("Leak of %d blocks found in xmlParseChunk",
14022                    xmlMemBlocks() - mem_base);
14023             test_ret++;
14024             printf(" %d", n_ctxt);
14025             printf(" %d", n_chunk);
14026             printf(" %d", n_size);
14027             printf(" %d", n_terminate);
14028             printf("\n");
14029         }
14030     }
14031     }
14032     }
14033     }
14034     function_tests++;
14035 #endif
14036
14037     return(test_ret);
14038 }
14039
14040
14041 static int
14042 test_xmlParseCtxtExternalEntity(void) {
14043     int test_ret = 0;
14044
14045     int mem_base;
14046     int ret_val;
14047     xmlParserCtxtPtr ctx; /* the existing parsing context */
14048     int n_ctx;
14049     xmlChar * URL; /* the URL for the entity to load */
14050     int n_URL;
14051     xmlChar * ID; /* the System ID for the entity to load */
14052     int n_ID;
14053     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14054     int n_lst;
14055
14056     for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
14057     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14058     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14059     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14060         mem_base = xmlMemBlocks();
14061         ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
14062         URL = gen_const_xmlChar_ptr(n_URL, 1);
14063         ID = gen_const_xmlChar_ptr(n_ID, 2);
14064         lst = gen_xmlNodePtr_ptr(n_lst, 3);
14065
14066         ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14067         desret_int(ret_val);
14068         call_tests++;
14069         des_xmlParserCtxtPtr(n_ctx, ctx, 0);
14070         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
14071         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
14072         des_xmlNodePtr_ptr(n_lst, lst, 3);
14073         xmlResetLastError();
14074         if (mem_base != xmlMemBlocks()) {
14075             printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
14076                    xmlMemBlocks() - mem_base);
14077             test_ret++;
14078             printf(" %d", n_ctx);
14079             printf(" %d", n_URL);
14080             printf(" %d", n_ID);
14081             printf(" %d", n_lst);
14082             printf("\n");
14083         }
14084     }
14085     }
14086     }
14087     }
14088     function_tests++;
14089
14090     return(test_ret);
14091 }
14092
14093
14094 static int
14095 test_xmlParseDTD(void) {
14096     int test_ret = 0;
14097
14098 #if defined(LIBXML_VALID_ENABLED)
14099 #ifdef LIBXML_VALID_ENABLED
14100     int mem_base;
14101     xmlDtdPtr ret_val;
14102     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14103     int n_ExternalID;
14104     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14105     int n_SystemID;
14106
14107     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14108     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14109         mem_base = xmlMemBlocks();
14110         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
14111         SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
14112
14113         ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14114         desret_xmlDtdPtr(ret_val);
14115         call_tests++;
14116         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
14117         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
14118         xmlResetLastError();
14119         if (mem_base != xmlMemBlocks()) {
14120             printf("Leak of %d blocks found in xmlParseDTD",
14121                    xmlMemBlocks() - mem_base);
14122             test_ret++;
14123             printf(" %d", n_ExternalID);
14124             printf(" %d", n_SystemID);
14125             printf("\n");
14126         }
14127     }
14128     }
14129     function_tests++;
14130 #endif
14131 #endif
14132
14133     return(test_ret);
14134 }
14135
14136
14137 static int
14138 test_xmlParseDoc(void) {
14139     int test_ret = 0;
14140
14141 #if defined(LIBXML_SAX1_ENABLED)
14142 #ifdef LIBXML_SAX1_ENABLED
14143     int mem_base;
14144     xmlDocPtr ret_val;
14145     xmlChar * cur; /* a pointer to an array of xmlChar */
14146     int n_cur;
14147
14148     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14149         mem_base = xmlMemBlocks();
14150         cur = gen_const_xmlChar_ptr(n_cur, 0);
14151
14152         ret_val = xmlParseDoc((const xmlChar *)cur);
14153         desret_xmlDocPtr(ret_val);
14154         call_tests++;
14155         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14156         xmlResetLastError();
14157         if (mem_base != xmlMemBlocks()) {
14158             printf("Leak of %d blocks found in xmlParseDoc",
14159                    xmlMemBlocks() - mem_base);
14160             test_ret++;
14161             printf(" %d", n_cur);
14162             printf("\n");
14163         }
14164     }
14165     function_tests++;
14166 #endif
14167 #endif
14168
14169     return(test_ret);
14170 }
14171
14172
14173 static int
14174 test_xmlParseDocument(void) {
14175     int test_ret = 0;
14176
14177     int mem_base;
14178     int ret_val;
14179     xmlParserCtxtPtr ctxt; /* an XML parser context */
14180     int n_ctxt;
14181
14182     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14183         mem_base = xmlMemBlocks();
14184         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14185
14186         ret_val = xmlParseDocument(ctxt);
14187         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
14188         desret_int(ret_val);
14189         call_tests++;
14190         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14191         xmlResetLastError();
14192         if (mem_base != xmlMemBlocks()) {
14193             printf("Leak of %d blocks found in xmlParseDocument",
14194                    xmlMemBlocks() - mem_base);
14195             test_ret++;
14196             printf(" %d", n_ctxt);
14197             printf("\n");
14198         }
14199     }
14200     function_tests++;
14201
14202     return(test_ret);
14203 }
14204
14205
14206 static int
14207 test_xmlParseEntity(void) {
14208     int test_ret = 0;
14209
14210 #if defined(LIBXML_SAX1_ENABLED)
14211 #ifdef LIBXML_SAX1_ENABLED
14212     int mem_base;
14213     xmlDocPtr ret_val;
14214     const char * filename; /* the filename */
14215     int n_filename;
14216
14217     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14218         mem_base = xmlMemBlocks();
14219         filename = gen_filepath(n_filename, 0);
14220
14221         ret_val = xmlParseEntity(filename);
14222         desret_xmlDocPtr(ret_val);
14223         call_tests++;
14224         des_filepath(n_filename, filename, 0);
14225         xmlResetLastError();
14226         if (mem_base != xmlMemBlocks()) {
14227             printf("Leak of %d blocks found in xmlParseEntity",
14228                    xmlMemBlocks() - mem_base);
14229             test_ret++;
14230             printf(" %d", n_filename);
14231             printf("\n");
14232         }
14233     }
14234     function_tests++;
14235 #endif
14236 #endif
14237
14238     return(test_ret);
14239 }
14240
14241
14242 static int
14243 test_xmlParseExtParsedEnt(void) {
14244     int test_ret = 0;
14245
14246     int mem_base;
14247     int ret_val;
14248     xmlParserCtxtPtr ctxt; /* an XML parser context */
14249     int n_ctxt;
14250
14251     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14252         mem_base = xmlMemBlocks();
14253         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14254
14255         ret_val = xmlParseExtParsedEnt(ctxt);
14256         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
14257         desret_int(ret_val);
14258         call_tests++;
14259         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14260         xmlResetLastError();
14261         if (mem_base != xmlMemBlocks()) {
14262             printf("Leak of %d blocks found in xmlParseExtParsedEnt",
14263                    xmlMemBlocks() - mem_base);
14264             test_ret++;
14265             printf(" %d", n_ctxt);
14266             printf("\n");
14267         }
14268     }
14269     function_tests++;
14270
14271     return(test_ret);
14272 }
14273
14274
14275 static int
14276 test_xmlParseExternalEntity(void) {
14277     int test_ret = 0;
14278
14279 #if defined(LIBXML_SAX1_ENABLED)
14280 #ifdef LIBXML_SAX1_ENABLED
14281     int mem_base;
14282     int ret_val;
14283     xmlDocPtr doc; /* the document the chunk pertains to */
14284     int n_doc;
14285     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
14286     int n_sax;
14287     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
14288     int n_user_data;
14289     int depth; /* Used for loop detection, use 0 */
14290     int n_depth;
14291     xmlChar * URL; /* the URL for the entity to load */
14292     int n_URL;
14293     xmlChar * ID; /* the System ID for the entity to load */
14294     int n_ID;
14295     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14296     int n_lst;
14297
14298     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14299     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14300     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14301     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14302     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14303     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14304     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14305         mem_base = xmlMemBlocks();
14306         doc = gen_xmlDocPtr(n_doc, 0);
14307         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14308         user_data = gen_userdata(n_user_data, 2);
14309         depth = gen_int(n_depth, 3);
14310         URL = gen_const_xmlChar_ptr(n_URL, 4);
14311         ID = gen_const_xmlChar_ptr(n_ID, 5);
14312         lst = gen_xmlNodePtr_ptr(n_lst, 6);
14313
14314         ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14315         desret_int(ret_val);
14316         call_tests++;
14317         des_xmlDocPtr(n_doc, doc, 0);
14318         des_xmlSAXHandlerPtr(n_sax, sax, 1);
14319         des_userdata(n_user_data, user_data, 2);
14320         des_int(n_depth, depth, 3);
14321         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14322         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14323         des_xmlNodePtr_ptr(n_lst, lst, 6);
14324         xmlResetLastError();
14325         if (mem_base != xmlMemBlocks()) {
14326             printf("Leak of %d blocks found in xmlParseExternalEntity",
14327                    xmlMemBlocks() - mem_base);
14328             test_ret++;
14329             printf(" %d", n_doc);
14330             printf(" %d", n_sax);
14331             printf(" %d", n_user_data);
14332             printf(" %d", n_depth);
14333             printf(" %d", n_URL);
14334             printf(" %d", n_ID);
14335             printf(" %d", n_lst);
14336             printf("\n");
14337         }
14338     }
14339     }
14340     }
14341     }
14342     }
14343     }
14344     }
14345     function_tests++;
14346 #endif
14347 #endif
14348
14349     return(test_ret);
14350 }
14351
14352
14353 static int
14354 test_xmlParseFile(void) {
14355     int test_ret = 0;
14356
14357 #if defined(LIBXML_SAX1_ENABLED)
14358 #ifdef LIBXML_SAX1_ENABLED
14359     int mem_base;
14360     xmlDocPtr ret_val;
14361     const char * filename; /* the filename */
14362     int n_filename;
14363
14364     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14365         mem_base = xmlMemBlocks();
14366         filename = gen_filepath(n_filename, 0);
14367
14368         ret_val = xmlParseFile(filename);
14369         desret_xmlDocPtr(ret_val);
14370         call_tests++;
14371         des_filepath(n_filename, filename, 0);
14372         xmlResetLastError();
14373         if (mem_base != xmlMemBlocks()) {
14374             printf("Leak of %d blocks found in xmlParseFile",
14375                    xmlMemBlocks() - mem_base);
14376             test_ret++;
14377             printf(" %d", n_filename);
14378             printf("\n");
14379         }
14380     }
14381     function_tests++;
14382 #endif
14383 #endif
14384
14385     return(test_ret);
14386 }
14387
14388
14389 static int
14390 test_xmlParseInNodeContext(void) {
14391     int test_ret = 0;
14392
14393     int mem_base;
14394     xmlParserErrors ret_val;
14395     xmlNodePtr node; /* the context node */
14396     int n_node;
14397     char * data; /* the input string */
14398     int n_data;
14399     int datalen; /* the input string length in bytes */
14400     int n_datalen;
14401     int options; /* a combination of xmlParserOption */
14402     int n_options;
14403     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14404     int n_lst;
14405
14406     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14407     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14408     for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14409     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14410     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14411         mem_base = xmlMemBlocks();
14412         node = gen_xmlNodePtr(n_node, 0);
14413         data = gen_const_char_ptr(n_data, 1);
14414         datalen = gen_int(n_datalen, 2);
14415         options = gen_parseroptions(n_options, 3);
14416         lst = gen_xmlNodePtr_ptr(n_lst, 4);
14417
14418         ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14419         desret_xmlParserErrors(ret_val);
14420         call_tests++;
14421         des_xmlNodePtr(n_node, node, 0);
14422         des_const_char_ptr(n_data, (const char *)data, 1);
14423         des_int(n_datalen, datalen, 2);
14424         des_parseroptions(n_options, options, 3);
14425         des_xmlNodePtr_ptr(n_lst, lst, 4);
14426         xmlResetLastError();
14427         if (mem_base != xmlMemBlocks()) {
14428             printf("Leak of %d blocks found in xmlParseInNodeContext",
14429                    xmlMemBlocks() - mem_base);
14430             test_ret++;
14431             printf(" %d", n_node);
14432             printf(" %d", n_data);
14433             printf(" %d", n_datalen);
14434             printf(" %d", n_options);
14435             printf(" %d", n_lst);
14436             printf("\n");
14437         }
14438     }
14439     }
14440     }
14441     }
14442     }
14443     function_tests++;
14444
14445     return(test_ret);
14446 }
14447
14448
14449 static int
14450 test_xmlParseMemory(void) {
14451     int test_ret = 0;
14452
14453 #if defined(LIBXML_SAX1_ENABLED)
14454 #ifdef LIBXML_SAX1_ENABLED
14455     int mem_base;
14456     xmlDocPtr ret_val;
14457     char * buffer; /* an pointer to a char array */
14458     int n_buffer;
14459     int size; /* the size of the array */
14460     int n_size;
14461
14462     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14463     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14464         mem_base = xmlMemBlocks();
14465         buffer = gen_const_char_ptr(n_buffer, 0);
14466         size = gen_int(n_size, 1);
14467
14468         ret_val = xmlParseMemory((const char *)buffer, size);
14469         desret_xmlDocPtr(ret_val);
14470         call_tests++;
14471         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14472         des_int(n_size, size, 1);
14473         xmlResetLastError();
14474         if (mem_base != xmlMemBlocks()) {
14475             printf("Leak of %d blocks found in xmlParseMemory",
14476                    xmlMemBlocks() - mem_base);
14477             test_ret++;
14478             printf(" %d", n_buffer);
14479             printf(" %d", n_size);
14480             printf("\n");
14481         }
14482     }
14483     }
14484     function_tests++;
14485 #endif
14486 #endif
14487
14488     return(test_ret);
14489 }
14490
14491
14492 #define gen_nb_const_xmlParserNodeInfoPtr 1
14493 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14494     return(NULL);
14495 }
14496 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14497 }
14498
14499 static int
14500 test_xmlParserAddNodeInfo(void) {
14501     int test_ret = 0;
14502
14503     int mem_base;
14504     xmlParserCtxtPtr ctxt; /* an XML parser context */
14505     int n_ctxt;
14506     xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14507     int n_info;
14508
14509     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14510     for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14511         mem_base = xmlMemBlocks();
14512         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14513         info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14514
14515         xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14516         call_tests++;
14517         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14518         des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14519         xmlResetLastError();
14520         if (mem_base != xmlMemBlocks()) {
14521             printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14522                    xmlMemBlocks() - mem_base);
14523             test_ret++;
14524             printf(" %d", n_ctxt);
14525             printf(" %d", n_info);
14526             printf("\n");
14527         }
14528     }
14529     }
14530     function_tests++;
14531
14532     return(test_ret);
14533 }
14534
14535
14536 #define gen_nb_const_xmlParserCtxtPtr 1
14537 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14538     return(NULL);
14539 }
14540 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14541 }
14542
14543 #define gen_nb_const_xmlNodePtr 1
14544 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14545     return(NULL);
14546 }
14547 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14548 }
14549
14550 static int
14551 test_xmlParserFindNodeInfo(void) {
14552     int test_ret = 0;
14553
14554     int mem_base;
14555     const xmlParserNodeInfo * ret_val;
14556     xmlParserCtxtPtr ctx; /* an XML parser context */
14557     int n_ctx;
14558     xmlNodePtr node; /* an XML node within the tree */
14559     int n_node;
14560
14561     for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14562     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14563         mem_base = xmlMemBlocks();
14564         ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14565         node = gen_const_xmlNodePtr(n_node, 1);
14566
14567         ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14568         desret_const_xmlParserNodeInfo_ptr(ret_val);
14569         call_tests++;
14570         des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14571         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14572         xmlResetLastError();
14573         if (mem_base != xmlMemBlocks()) {
14574             printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14575                    xmlMemBlocks() - mem_base);
14576             test_ret++;
14577             printf(" %d", n_ctx);
14578             printf(" %d", n_node);
14579             printf("\n");
14580         }
14581     }
14582     }
14583     function_tests++;
14584
14585     return(test_ret);
14586 }
14587
14588
14589 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14590 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14591     return(NULL);
14592 }
14593 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14594 }
14595
14596 static int
14597 test_xmlParserFindNodeInfoIndex(void) {
14598     int test_ret = 0;
14599
14600     int mem_base;
14601     unsigned long ret_val;
14602     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14603     int n_seq;
14604     xmlNodePtr node; /* an XML node pointer */
14605     int n_node;
14606
14607     for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14608     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14609         mem_base = xmlMemBlocks();
14610         seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14611         node = gen_const_xmlNodePtr(n_node, 1);
14612
14613         ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14614         desret_unsigned_long(ret_val);
14615         call_tests++;
14616         des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14617         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14618         xmlResetLastError();
14619         if (mem_base != xmlMemBlocks()) {
14620             printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14621                    xmlMemBlocks() - mem_base);
14622             test_ret++;
14623             printf(" %d", n_seq);
14624             printf(" %d", n_node);
14625             printf("\n");
14626         }
14627     }
14628     }
14629     function_tests++;
14630
14631     return(test_ret);
14632 }
14633
14634
14635 #define gen_nb_xmlParserInputPtr 1
14636 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14637     return(NULL);
14638 }
14639 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14640 }
14641
14642 static int
14643 test_xmlParserInputGrow(void) {
14644     int test_ret = 0;
14645
14646     int mem_base;
14647     int ret_val;
14648     xmlParserInputPtr in; /* an XML parser input */
14649     int n_in;
14650     int len; /* an indicative size for the lookahead */
14651     int n_len;
14652
14653     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14654     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14655         mem_base = xmlMemBlocks();
14656         in = gen_xmlParserInputPtr(n_in, 0);
14657         len = gen_int(n_len, 1);
14658
14659         ret_val = xmlParserInputGrow(in, len);
14660         desret_int(ret_val);
14661         call_tests++;
14662         des_xmlParserInputPtr(n_in, in, 0);
14663         des_int(n_len, len, 1);
14664         xmlResetLastError();
14665         if (mem_base != xmlMemBlocks()) {
14666             printf("Leak of %d blocks found in xmlParserInputGrow",
14667                    xmlMemBlocks() - mem_base);
14668             test_ret++;
14669             printf(" %d", n_in);
14670             printf(" %d", n_len);
14671             printf("\n");
14672         }
14673     }
14674     }
14675     function_tests++;
14676
14677     return(test_ret);
14678 }
14679
14680
14681 static int
14682 test_xmlParserInputRead(void) {
14683     int test_ret = 0;
14684
14685     int mem_base;
14686     int ret_val;
14687     xmlParserInputPtr in; /* an XML parser input */
14688     int n_in;
14689     int len; /* an indicative size for the lookahead */
14690     int n_len;
14691
14692     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14693     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14694         mem_base = xmlMemBlocks();
14695         in = gen_xmlParserInputPtr(n_in, 0);
14696         len = gen_int(n_len, 1);
14697
14698         ret_val = xmlParserInputRead(in, len);
14699         desret_int(ret_val);
14700         call_tests++;
14701         des_xmlParserInputPtr(n_in, in, 0);
14702         des_int(n_len, len, 1);
14703         xmlResetLastError();
14704         if (mem_base != xmlMemBlocks()) {
14705             printf("Leak of %d blocks found in xmlParserInputRead",
14706                    xmlMemBlocks() - mem_base);
14707             test_ret++;
14708             printf(" %d", n_in);
14709             printf(" %d", n_len);
14710             printf("\n");
14711         }
14712     }
14713     }
14714     function_tests++;
14715
14716     return(test_ret);
14717 }
14718
14719
14720 static int
14721 test_xmlPedanticParserDefault(void) {
14722     int test_ret = 0;
14723
14724     int mem_base;
14725     int ret_val;
14726     int val; /* int 0 or 1 */
14727     int n_val;
14728
14729     for (n_val = 0;n_val < gen_nb_int;n_val++) {
14730         mem_base = xmlMemBlocks();
14731         val = gen_int(n_val, 0);
14732
14733         ret_val = xmlPedanticParserDefault(val);
14734         desret_int(ret_val);
14735         call_tests++;
14736         des_int(n_val, val, 0);
14737         xmlResetLastError();
14738         if (mem_base != xmlMemBlocks()) {
14739             printf("Leak of %d blocks found in xmlPedanticParserDefault",
14740                    xmlMemBlocks() - mem_base);
14741             test_ret++;
14742             printf(" %d", n_val);
14743             printf("\n");
14744         }
14745     }
14746     function_tests++;
14747
14748     return(test_ret);
14749 }
14750
14751
14752 static int
14753 test_xmlReadDoc(void) {
14754     int test_ret = 0;
14755
14756     int mem_base;
14757     xmlDocPtr ret_val;
14758     xmlChar * cur; /* a pointer to a zero terminated string */
14759     int n_cur;
14760     const char * URL; /* the base URL to use for the document */
14761     int n_URL;
14762     char * encoding; /* the document encoding, or NULL */
14763     int n_encoding;
14764     int options; /* a combination of xmlParserOption */
14765     int n_options;
14766
14767     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14768     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14769     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14770     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14771         mem_base = xmlMemBlocks();
14772         cur = gen_const_xmlChar_ptr(n_cur, 0);
14773         URL = gen_filepath(n_URL, 1);
14774         encoding = gen_const_char_ptr(n_encoding, 2);
14775         options = gen_parseroptions(n_options, 3);
14776
14777         ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14778         desret_xmlDocPtr(ret_val);
14779         call_tests++;
14780         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14781         des_filepath(n_URL, URL, 1);
14782         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14783         des_parseroptions(n_options, options, 3);
14784         xmlResetLastError();
14785         if (mem_base != xmlMemBlocks()) {
14786             printf("Leak of %d blocks found in xmlReadDoc",
14787                    xmlMemBlocks() - mem_base);
14788             test_ret++;
14789             printf(" %d", n_cur);
14790             printf(" %d", n_URL);
14791             printf(" %d", n_encoding);
14792             printf(" %d", n_options);
14793             printf("\n");
14794         }
14795     }
14796     }
14797     }
14798     }
14799     function_tests++;
14800
14801     return(test_ret);
14802 }
14803
14804
14805 static int
14806 test_xmlReadFile(void) {
14807     int test_ret = 0;
14808
14809     int mem_base;
14810     xmlDocPtr ret_val;
14811     const char * filename; /* a file or URL */
14812     int n_filename;
14813     char * encoding; /* the document encoding, or NULL */
14814     int n_encoding;
14815     int options; /* a combination of xmlParserOption */
14816     int n_options;
14817
14818     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14819     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14820     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14821         mem_base = xmlMemBlocks();
14822         filename = gen_filepath(n_filename, 0);
14823         encoding = gen_const_char_ptr(n_encoding, 1);
14824         options = gen_parseroptions(n_options, 2);
14825
14826         ret_val = xmlReadFile(filename, (const char *)encoding, options);
14827         desret_xmlDocPtr(ret_val);
14828         call_tests++;
14829         des_filepath(n_filename, filename, 0);
14830         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14831         des_parseroptions(n_options, options, 2);
14832         xmlResetLastError();
14833         if (mem_base != xmlMemBlocks()) {
14834             printf("Leak of %d blocks found in xmlReadFile",
14835                    xmlMemBlocks() - mem_base);
14836             test_ret++;
14837             printf(" %d", n_filename);
14838             printf(" %d", n_encoding);
14839             printf(" %d", n_options);
14840             printf("\n");
14841         }
14842     }
14843     }
14844     }
14845     function_tests++;
14846
14847     return(test_ret);
14848 }
14849
14850
14851 static int
14852 test_xmlReadMemory(void) {
14853     int test_ret = 0;
14854
14855     int mem_base;
14856     xmlDocPtr ret_val;
14857     char * buffer; /* a pointer to a char array */
14858     int n_buffer;
14859     int size; /* the size of the array */
14860     int n_size;
14861     const char * URL; /* the base URL to use for the document */
14862     int n_URL;
14863     char * encoding; /* the document encoding, or NULL */
14864     int n_encoding;
14865     int options; /* a combination of xmlParserOption */
14866     int n_options;
14867
14868     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14869     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14870     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14871     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14872     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14873         mem_base = xmlMemBlocks();
14874         buffer = gen_const_char_ptr(n_buffer, 0);
14875         size = gen_int(n_size, 1);
14876         URL = gen_filepath(n_URL, 2);
14877         encoding = gen_const_char_ptr(n_encoding, 3);
14878         options = gen_parseroptions(n_options, 4);
14879
14880         ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14881         desret_xmlDocPtr(ret_val);
14882         call_tests++;
14883         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14884         des_int(n_size, size, 1);
14885         des_filepath(n_URL, URL, 2);
14886         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14887         des_parseroptions(n_options, options, 4);
14888         xmlResetLastError();
14889         if (mem_base != xmlMemBlocks()) {
14890             printf("Leak of %d blocks found in xmlReadMemory",
14891                    xmlMemBlocks() - mem_base);
14892             test_ret++;
14893             printf(" %d", n_buffer);
14894             printf(" %d", n_size);
14895             printf(" %d", n_URL);
14896             printf(" %d", n_encoding);
14897             printf(" %d", n_options);
14898             printf("\n");
14899         }
14900     }
14901     }
14902     }
14903     }
14904     }
14905     function_tests++;
14906
14907     return(test_ret);
14908 }
14909
14910
14911 static int
14912 test_xmlRecoverDoc(void) {
14913     int test_ret = 0;
14914
14915 #if defined(LIBXML_SAX1_ENABLED)
14916 #ifdef LIBXML_SAX1_ENABLED
14917     int mem_base;
14918     xmlDocPtr ret_val;
14919     xmlChar * cur; /* a pointer to an array of xmlChar */
14920     int n_cur;
14921
14922     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14923         mem_base = xmlMemBlocks();
14924         cur = gen_const_xmlChar_ptr(n_cur, 0);
14925
14926         ret_val = xmlRecoverDoc((const xmlChar *)cur);
14927         desret_xmlDocPtr(ret_val);
14928         call_tests++;
14929         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14930         xmlResetLastError();
14931         if (mem_base != xmlMemBlocks()) {
14932             printf("Leak of %d blocks found in xmlRecoverDoc",
14933                    xmlMemBlocks() - mem_base);
14934             test_ret++;
14935             printf(" %d", n_cur);
14936             printf("\n");
14937         }
14938     }
14939     function_tests++;
14940 #endif
14941 #endif
14942
14943     return(test_ret);
14944 }
14945
14946
14947 static int
14948 test_xmlRecoverFile(void) {
14949     int test_ret = 0;
14950
14951 #if defined(LIBXML_SAX1_ENABLED)
14952 #ifdef LIBXML_SAX1_ENABLED
14953     int mem_base;
14954     xmlDocPtr ret_val;
14955     const char * filename; /* the filename */
14956     int n_filename;
14957
14958     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14959         mem_base = xmlMemBlocks();
14960         filename = gen_filepath(n_filename, 0);
14961
14962         ret_val = xmlRecoverFile(filename);
14963         desret_xmlDocPtr(ret_val);
14964         call_tests++;
14965         des_filepath(n_filename, filename, 0);
14966         xmlResetLastError();
14967         if (mem_base != xmlMemBlocks()) {
14968             printf("Leak of %d blocks found in xmlRecoverFile",
14969                    xmlMemBlocks() - mem_base);
14970             test_ret++;
14971             printf(" %d", n_filename);
14972             printf("\n");
14973         }
14974     }
14975     function_tests++;
14976 #endif
14977 #endif
14978
14979     return(test_ret);
14980 }
14981
14982
14983 static int
14984 test_xmlRecoverMemory(void) {
14985     int test_ret = 0;
14986
14987 #if defined(LIBXML_SAX1_ENABLED)
14988 #ifdef LIBXML_SAX1_ENABLED
14989     int mem_base;
14990     xmlDocPtr ret_val;
14991     char * buffer; /* an pointer to a char array */
14992     int n_buffer;
14993     int size; /* the size of the array */
14994     int n_size;
14995
14996     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14997     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14998         mem_base = xmlMemBlocks();
14999         buffer = gen_const_char_ptr(n_buffer, 0);
15000         size = gen_int(n_size, 1);
15001
15002         ret_val = xmlRecoverMemory((const char *)buffer, size);
15003         desret_xmlDocPtr(ret_val);
15004         call_tests++;
15005         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15006         des_int(n_size, size, 1);
15007         xmlResetLastError();
15008         if (mem_base != xmlMemBlocks()) {
15009             printf("Leak of %d blocks found in xmlRecoverMemory",
15010                    xmlMemBlocks() - mem_base);
15011             test_ret++;
15012             printf(" %d", n_buffer);
15013             printf(" %d", n_size);
15014             printf("\n");
15015         }
15016     }
15017     }
15018     function_tests++;
15019 #endif
15020 #endif
15021
15022     return(test_ret);
15023 }
15024
15025
15026 static int
15027 test_xmlSAXParseDTD(void) {
15028     int test_ret = 0;
15029
15030 #if defined(LIBXML_VALID_ENABLED)
15031 #ifdef LIBXML_SAX1_ENABLED
15032     int mem_base;
15033     xmlDtdPtr ret_val;
15034     xmlSAXHandlerPtr sax; /* the SAX handler block */
15035     int n_sax;
15036     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
15037     int n_ExternalID;
15038     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
15039     int n_SystemID;
15040
15041     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15042     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
15043     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
15044         mem_base = xmlMemBlocks();
15045         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15046         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
15047         SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
15048
15049         ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
15050         desret_xmlDtdPtr(ret_val);
15051         call_tests++;
15052         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15053         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
15054         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
15055         xmlResetLastError();
15056         if (mem_base != xmlMemBlocks()) {
15057             printf("Leak of %d blocks found in xmlSAXParseDTD",
15058                    xmlMemBlocks() - mem_base);
15059             test_ret++;
15060             printf(" %d", n_sax);
15061             printf(" %d", n_ExternalID);
15062             printf(" %d", n_SystemID);
15063             printf("\n");
15064         }
15065     }
15066     }
15067     }
15068     function_tests++;
15069 #endif
15070 #endif
15071
15072     return(test_ret);
15073 }
15074
15075
15076 static int
15077 test_xmlSAXParseDoc(void) {
15078     int test_ret = 0;
15079
15080 #if defined(LIBXML_SAX1_ENABLED)
15081 #ifdef LIBXML_SAX1_ENABLED
15082     int mem_base;
15083     xmlDocPtr ret_val;
15084     xmlSAXHandlerPtr sax; /* the SAX handler block */
15085     int n_sax;
15086     xmlChar * cur; /* a pointer to an array of xmlChar */
15087     int n_cur;
15088     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15089     int n_recovery;
15090
15091     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15092     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
15093     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15094         mem_base = xmlMemBlocks();
15095         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15096         cur = gen_const_xmlChar_ptr(n_cur, 1);
15097         recovery = gen_int(n_recovery, 2);
15098
15099         ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
15100         desret_xmlDocPtr(ret_val);
15101         call_tests++;
15102         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15103         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
15104         des_int(n_recovery, recovery, 2);
15105         xmlResetLastError();
15106         if (mem_base != xmlMemBlocks()) {
15107             printf("Leak of %d blocks found in xmlSAXParseDoc",
15108                    xmlMemBlocks() - mem_base);
15109             test_ret++;
15110             printf(" %d", n_sax);
15111             printf(" %d", n_cur);
15112             printf(" %d", n_recovery);
15113             printf("\n");
15114         }
15115     }
15116     }
15117     }
15118     function_tests++;
15119 #endif
15120 #endif
15121
15122     return(test_ret);
15123 }
15124
15125
15126 static int
15127 test_xmlSAXParseEntity(void) {
15128     int test_ret = 0;
15129
15130 #if defined(LIBXML_SAX1_ENABLED)
15131 #ifdef LIBXML_SAX1_ENABLED
15132     int mem_base;
15133     xmlDocPtr ret_val;
15134     xmlSAXHandlerPtr sax; /* the SAX handler block */
15135     int n_sax;
15136     const char * filename; /* the filename */
15137     int n_filename;
15138
15139     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15140     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15141         mem_base = xmlMemBlocks();
15142         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15143         filename = gen_filepath(n_filename, 1);
15144
15145         ret_val = xmlSAXParseEntity(sax, filename);
15146         desret_xmlDocPtr(ret_val);
15147         call_tests++;
15148         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15149         des_filepath(n_filename, filename, 1);
15150         xmlResetLastError();
15151         if (mem_base != xmlMemBlocks()) {
15152             printf("Leak of %d blocks found in xmlSAXParseEntity",
15153                    xmlMemBlocks() - mem_base);
15154             test_ret++;
15155             printf(" %d", n_sax);
15156             printf(" %d", n_filename);
15157             printf("\n");
15158         }
15159     }
15160     }
15161     function_tests++;
15162 #endif
15163 #endif
15164
15165     return(test_ret);
15166 }
15167
15168
15169 static int
15170 test_xmlSAXParseFile(void) {
15171     int test_ret = 0;
15172
15173 #if defined(LIBXML_SAX1_ENABLED)
15174 #ifdef LIBXML_SAX1_ENABLED
15175     int mem_base;
15176     xmlDocPtr ret_val;
15177     xmlSAXHandlerPtr sax; /* the SAX handler block */
15178     int n_sax;
15179     const char * filename; /* the filename */
15180     int n_filename;
15181     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15182     int n_recovery;
15183
15184     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15185     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15186     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15187         mem_base = xmlMemBlocks();
15188         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15189         filename = gen_filepath(n_filename, 1);
15190         recovery = gen_int(n_recovery, 2);
15191
15192         ret_val = xmlSAXParseFile(sax, filename, recovery);
15193         desret_xmlDocPtr(ret_val);
15194         call_tests++;
15195         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15196         des_filepath(n_filename, filename, 1);
15197         des_int(n_recovery, recovery, 2);
15198         xmlResetLastError();
15199         if (mem_base != xmlMemBlocks()) {
15200             printf("Leak of %d blocks found in xmlSAXParseFile",
15201                    xmlMemBlocks() - mem_base);
15202             test_ret++;
15203             printf(" %d", n_sax);
15204             printf(" %d", n_filename);
15205             printf(" %d", n_recovery);
15206             printf("\n");
15207         }
15208     }
15209     }
15210     }
15211     function_tests++;
15212 #endif
15213 #endif
15214
15215     return(test_ret);
15216 }
15217
15218
15219 static int
15220 test_xmlSAXParseFileWithData(void) {
15221     int test_ret = 0;
15222
15223 #if defined(LIBXML_SAX1_ENABLED)
15224 #ifdef LIBXML_SAX1_ENABLED
15225     int mem_base;
15226     xmlDocPtr ret_val;
15227     xmlSAXHandlerPtr sax; /* the SAX handler block */
15228     int n_sax;
15229     const char * filename; /* the filename */
15230     int n_filename;
15231     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15232     int n_recovery;
15233     void * data; /* the userdata */
15234     int n_data;
15235
15236     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15237     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15238     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15239     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15240         mem_base = xmlMemBlocks();
15241         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15242         filename = gen_filepath(n_filename, 1);
15243         recovery = gen_int(n_recovery, 2);
15244         data = gen_userdata(n_data, 3);
15245
15246         ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
15247         desret_xmlDocPtr(ret_val);
15248         call_tests++;
15249         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15250         des_filepath(n_filename, filename, 1);
15251         des_int(n_recovery, recovery, 2);
15252         des_userdata(n_data, data, 3);
15253         xmlResetLastError();
15254         if (mem_base != xmlMemBlocks()) {
15255             printf("Leak of %d blocks found in xmlSAXParseFileWithData",
15256                    xmlMemBlocks() - mem_base);
15257             test_ret++;
15258             printf(" %d", n_sax);
15259             printf(" %d", n_filename);
15260             printf(" %d", n_recovery);
15261             printf(" %d", n_data);
15262             printf("\n");
15263         }
15264     }
15265     }
15266     }
15267     }
15268     function_tests++;
15269 #endif
15270 #endif
15271
15272     return(test_ret);
15273 }
15274
15275
15276 static int
15277 test_xmlSAXParseMemory(void) {
15278     int test_ret = 0;
15279
15280 #if defined(LIBXML_SAX1_ENABLED)
15281 #ifdef LIBXML_SAX1_ENABLED
15282     int mem_base;
15283     xmlDocPtr ret_val;
15284     xmlSAXHandlerPtr sax; /* the SAX handler block */
15285     int n_sax;
15286     char * buffer; /* an pointer to a char array */
15287     int n_buffer;
15288     int size; /* the size of the array */
15289     int n_size;
15290     int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
15291     int n_recovery;
15292
15293     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15294     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15295     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15296     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15297         mem_base = xmlMemBlocks();
15298         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15299         buffer = gen_const_char_ptr(n_buffer, 1);
15300         size = gen_int(n_size, 2);
15301         recovery = gen_int(n_recovery, 3);
15302
15303         ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15304         desret_xmlDocPtr(ret_val);
15305         call_tests++;
15306         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15307         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15308         des_int(n_size, size, 2);
15309         des_int(n_recovery, recovery, 3);
15310         xmlResetLastError();
15311         if (mem_base != xmlMemBlocks()) {
15312             printf("Leak of %d blocks found in xmlSAXParseMemory",
15313                    xmlMemBlocks() - mem_base);
15314             test_ret++;
15315             printf(" %d", n_sax);
15316             printf(" %d", n_buffer);
15317             printf(" %d", n_size);
15318             printf(" %d", n_recovery);
15319             printf("\n");
15320         }
15321     }
15322     }
15323     }
15324     }
15325     function_tests++;
15326 #endif
15327 #endif
15328
15329     return(test_ret);
15330 }
15331
15332
15333 static int
15334 test_xmlSAXParseMemoryWithData(void) {
15335     int test_ret = 0;
15336
15337 #if defined(LIBXML_SAX1_ENABLED)
15338 #ifdef LIBXML_SAX1_ENABLED
15339     int mem_base;
15340     xmlDocPtr ret_val;
15341     xmlSAXHandlerPtr sax; /* the SAX handler block */
15342     int n_sax;
15343     char * buffer; /* an pointer to a char array */
15344     int n_buffer;
15345     int size; /* the size of the array */
15346     int n_size;
15347     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15348     int n_recovery;
15349     void * data; /* the userdata */
15350     int n_data;
15351
15352     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15353     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15354     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15355     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15356     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15357         mem_base = xmlMemBlocks();
15358         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15359         buffer = gen_const_char_ptr(n_buffer, 1);
15360         size = gen_int(n_size, 2);
15361         recovery = gen_int(n_recovery, 3);
15362         data = gen_userdata(n_data, 4);
15363
15364         ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15365         desret_xmlDocPtr(ret_val);
15366         call_tests++;
15367         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15368         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15369         des_int(n_size, size, 2);
15370         des_int(n_recovery, recovery, 3);
15371         des_userdata(n_data, data, 4);
15372         xmlResetLastError();
15373         if (mem_base != xmlMemBlocks()) {
15374             printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15375                    xmlMemBlocks() - mem_base);
15376             test_ret++;
15377             printf(" %d", n_sax);
15378             printf(" %d", n_buffer);
15379             printf(" %d", n_size);
15380             printf(" %d", n_recovery);
15381             printf(" %d", n_data);
15382             printf("\n");
15383         }
15384     }
15385     }
15386     }
15387     }
15388     }
15389     function_tests++;
15390 #endif
15391 #endif
15392
15393     return(test_ret);
15394 }
15395
15396
15397 static int
15398 test_xmlSAXUserParseFile(void) {
15399     int test_ret = 0;
15400
15401 #if defined(LIBXML_SAX1_ENABLED)
15402 #ifdef LIBXML_SAX1_ENABLED
15403     int mem_base;
15404     int ret_val;
15405     xmlSAXHandlerPtr sax; /* a SAX handler */
15406     int n_sax;
15407     void * user_data; /* The user data returned on SAX callbacks */
15408     int n_user_data;
15409     const char * filename; /* a file name */
15410     int n_filename;
15411
15412     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15413     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15414     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15415         mem_base = xmlMemBlocks();
15416         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15417         user_data = gen_userdata(n_user_data, 1);
15418         filename = gen_filepath(n_filename, 2);
15419
15420 #ifdef LIBXML_SAX1_ENABLED
15421         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15422 #endif
15423
15424
15425         ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15426         desret_int(ret_val);
15427         call_tests++;
15428         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15429         des_userdata(n_user_data, user_data, 1);
15430         des_filepath(n_filename, filename, 2);
15431         xmlResetLastError();
15432         if (mem_base != xmlMemBlocks()) {
15433             printf("Leak of %d blocks found in xmlSAXUserParseFile",
15434                    xmlMemBlocks() - mem_base);
15435             test_ret++;
15436             printf(" %d", n_sax);
15437             printf(" %d", n_user_data);
15438             printf(" %d", n_filename);
15439             printf("\n");
15440         }
15441     }
15442     }
15443     }
15444     function_tests++;
15445 #endif
15446 #endif
15447
15448     return(test_ret);
15449 }
15450
15451
15452 static int
15453 test_xmlSAXUserParseMemory(void) {
15454     int test_ret = 0;
15455
15456 #if defined(LIBXML_SAX1_ENABLED)
15457 #ifdef LIBXML_SAX1_ENABLED
15458     int mem_base;
15459     int ret_val;
15460     xmlSAXHandlerPtr sax; /* a SAX handler */
15461     int n_sax;
15462     void * user_data; /* The user data returned on SAX callbacks */
15463     int n_user_data;
15464     char * buffer; /* an in-memory XML document input */
15465     int n_buffer;
15466     int size; /* the length of the XML document in bytes */
15467     int n_size;
15468
15469     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15470     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15471     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15472     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15473         mem_base = xmlMemBlocks();
15474         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15475         user_data = gen_userdata(n_user_data, 1);
15476         buffer = gen_const_char_ptr(n_buffer, 2);
15477         size = gen_int(n_size, 3);
15478
15479 #ifdef LIBXML_SAX1_ENABLED
15480         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15481 #endif
15482
15483
15484         ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15485         desret_int(ret_val);
15486         call_tests++;
15487         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15488         des_userdata(n_user_data, user_data, 1);
15489         des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15490         des_int(n_size, size, 3);
15491         xmlResetLastError();
15492         if (mem_base != xmlMemBlocks()) {
15493             printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15494                    xmlMemBlocks() - mem_base);
15495             test_ret++;
15496             printf(" %d", n_sax);
15497             printf(" %d", n_user_data);
15498             printf(" %d", n_buffer);
15499             printf(" %d", n_size);
15500             printf("\n");
15501         }
15502     }
15503     }
15504     }
15505     }
15506     function_tests++;
15507 #endif
15508 #endif
15509
15510     return(test_ret);
15511 }
15512
15513
15514 static int
15515 test_xmlSetExternalEntityLoader(void) {
15516     int test_ret = 0;
15517
15518
15519     /* missing type support */
15520     return(test_ret);
15521 }
15522
15523
15524 static int
15525 test_xmlSetFeature(void) {
15526     int test_ret = 0;
15527
15528 #if defined(LIBXML_LEGACY_ENABLED)
15529 #ifdef LIBXML_LEGACY_ENABLED
15530     int mem_base;
15531     int ret_val;
15532     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15533     int n_ctxt;
15534     char * name; /* the feature name */
15535     int n_name;
15536     void * value; /* pointer to the location of the new value */
15537     int n_value;
15538
15539     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15540     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15541     for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15542         mem_base = xmlMemBlocks();
15543         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15544         name = gen_const_char_ptr(n_name, 1);
15545         value = gen_void_ptr(n_value, 2);
15546
15547         ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15548         desret_int(ret_val);
15549         call_tests++;
15550         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15551         des_const_char_ptr(n_name, (const char *)name, 1);
15552         des_void_ptr(n_value, value, 2);
15553         xmlResetLastError();
15554         if (mem_base != xmlMemBlocks()) {
15555             printf("Leak of %d blocks found in xmlSetFeature",
15556                    xmlMemBlocks() - mem_base);
15557             test_ret++;
15558             printf(" %d", n_ctxt);
15559             printf(" %d", n_name);
15560             printf(" %d", n_value);
15561             printf("\n");
15562         }
15563     }
15564     }
15565     }
15566     function_tests++;
15567 #endif
15568 #endif
15569
15570     return(test_ret);
15571 }
15572
15573
15574 static int
15575 test_xmlSetupParserForBuffer(void) {
15576     int test_ret = 0;
15577
15578 #if defined(LIBXML_SAX1_ENABLED)
15579 #ifdef LIBXML_SAX1_ENABLED
15580     int mem_base;
15581     xmlParserCtxtPtr ctxt; /* an XML parser context */
15582     int n_ctxt;
15583     xmlChar * buffer; /* a xmlChar * buffer */
15584     int n_buffer;
15585     const char * filename; /* a file name */
15586     int n_filename;
15587
15588     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15589     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15590     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15591         mem_base = xmlMemBlocks();
15592         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15593         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15594         filename = gen_filepath(n_filename, 2);
15595
15596         xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15597         call_tests++;
15598         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15599         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15600         des_filepath(n_filename, filename, 2);
15601         xmlResetLastError();
15602         if (mem_base != xmlMemBlocks()) {
15603             printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15604                    xmlMemBlocks() - mem_base);
15605             test_ret++;
15606             printf(" %d", n_ctxt);
15607             printf(" %d", n_buffer);
15608             printf(" %d", n_filename);
15609             printf("\n");
15610         }
15611     }
15612     }
15613     }
15614     function_tests++;
15615 #endif
15616 #endif
15617
15618     return(test_ret);
15619 }
15620
15621
15622 static int
15623 test_xmlStopParser(void) {
15624     int test_ret = 0;
15625
15626 #ifdef LIBXML_PUSH_ENABLED
15627     int mem_base;
15628     xmlParserCtxtPtr ctxt; /* an XML parser context */
15629     int n_ctxt;
15630
15631     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15632         mem_base = xmlMemBlocks();
15633         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15634
15635         xmlStopParser(ctxt);
15636         call_tests++;
15637         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15638         xmlResetLastError();
15639         if (mem_base != xmlMemBlocks()) {
15640             printf("Leak of %d blocks found in xmlStopParser",
15641                    xmlMemBlocks() - mem_base);
15642             test_ret++;
15643             printf(" %d", n_ctxt);
15644             printf("\n");
15645         }
15646     }
15647     function_tests++;
15648 #endif
15649
15650     return(test_ret);
15651 }
15652
15653
15654 static int
15655 test_xmlSubstituteEntitiesDefault(void) {
15656     int test_ret = 0;
15657
15658     int mem_base;
15659     int ret_val;
15660     int val; /* int 0 or 1 */
15661     int n_val;
15662
15663     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15664         mem_base = xmlMemBlocks();
15665         val = gen_int(n_val, 0);
15666
15667         ret_val = xmlSubstituteEntitiesDefault(val);
15668         desret_int(ret_val);
15669         call_tests++;
15670         des_int(n_val, val, 0);
15671         xmlResetLastError();
15672         if (mem_base != xmlMemBlocks()) {
15673             printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15674                    xmlMemBlocks() - mem_base);
15675             test_ret++;
15676             printf(" %d", n_val);
15677             printf("\n");
15678         }
15679     }
15680     function_tests++;
15681
15682     return(test_ret);
15683 }
15684
15685 static int
15686 test_parser(void) {
15687     int test_ret = 0;
15688         int rc = 0;
15689
15690     if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15691     rc = test_xmlByteConsumed();
15692         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15693     rc = test_xmlClearNodeInfoSeq();
15694         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15695     rc = test_xmlClearParserCtxt();
15696         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15697     rc = test_xmlCreateDocParserCtxt();
15698         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15699     rc = test_xmlCreatePushParserCtxt();
15700         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15701     rc = test_xmlCtxtReadDoc();
15702         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15703     rc = test_xmlCtxtReadFile();
15704         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15705     rc = test_xmlCtxtReadMemory();
15706         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15707     rc = test_xmlCtxtReset();
15708         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15709     rc = test_xmlCtxtResetPush();
15710         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15711     rc = test_xmlCtxtUseOptions();
15712         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15713     rc = test_xmlGetExternalEntityLoader();
15714         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15715     rc = test_xmlGetFeature();
15716         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15717     rc = test_xmlGetFeaturesList();
15718         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15719     rc = test_xmlHasFeature();
15720         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15721     rc = test_xmlIOParseDTD();
15722         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15723     rc = test_xmlInitNodeInfoSeq();
15724         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15725     rc = test_xmlInitParser();
15726         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15727     rc = test_xmlInitParserCtxt();
15728         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15729     rc = test_xmlKeepBlanksDefault();
15730         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15731     rc = test_xmlLineNumbersDefault();
15732         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15733     rc = test_xmlLoadExternalEntity();
15734         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15735     rc = test_xmlNewIOInputStream();
15736         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15737     rc = test_xmlNewParserCtxt();
15738         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15739     rc = test_xmlParseBalancedChunkMemory();
15740         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15741     rc = test_xmlParseBalancedChunkMemoryRecover();
15742         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15743     rc = test_xmlParseChunk();
15744         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15745     rc = test_xmlParseCtxtExternalEntity();
15746         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15747     rc = test_xmlParseDTD();
15748         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15749     rc = test_xmlParseDoc();
15750         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15751     rc = test_xmlParseDocument();
15752         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15753     rc = test_xmlParseEntity();
15754         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15755     rc = test_xmlParseExtParsedEnt();
15756         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15757     rc = test_xmlParseExternalEntity();
15758         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15759     rc = test_xmlParseFile();
15760         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15761     rc = test_xmlParseInNodeContext();
15762         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15763     rc = test_xmlParseMemory();
15764         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15765     rc = test_xmlParserAddNodeInfo();
15766         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15767     rc = test_xmlParserFindNodeInfo();
15768         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15769     rc = test_xmlParserFindNodeInfoIndex();
15770         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15771     rc = test_xmlParserInputGrow();
15772         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15773     rc = test_xmlParserInputRead();
15774         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15775     rc = test_xmlPedanticParserDefault();
15776         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15777     rc = test_xmlReadDoc();
15778         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15779     rc = test_xmlReadFile();
15780         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15781     rc = test_xmlReadMemory();
15782         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15783     rc = test_xmlRecoverDoc();
15784         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15785     rc = test_xmlRecoverFile();
15786         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15787     rc = test_xmlRecoverMemory();
15788         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15789     rc = test_xmlSAXParseDTD();
15790         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15791     rc = test_xmlSAXParseDoc();
15792         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15793     rc = test_xmlSAXParseEntity();
15794         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15795     rc = test_xmlSAXParseFile();
15796         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15797     rc = test_xmlSAXParseFileWithData();
15798         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15799     rc = test_xmlSAXParseMemory();
15800         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15801     rc = test_xmlSAXParseMemoryWithData();
15802         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15803     rc = test_xmlSAXUserParseFile();
15804         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15805     rc = test_xmlSAXUserParseMemory();
15806         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15807     rc = test_xmlSetExternalEntityLoader();
15808         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15809     rc = test_xmlSetFeature();
15810         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15811     rc = test_xmlSetupParserForBuffer();
15812         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15813     rc = test_xmlStopParser();
15814         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15815     rc = test_xmlSubstituteEntitiesDefault();
15816         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15817
15818     if (test_ret != 0)
15819         printf("Module parser: %d errors\n", test_ret);
15820     return(test_ret);
15821 }
15822
15823 static int
15824 test_htmlCreateFileParserCtxt(void) {
15825     int test_ret = 0;
15826
15827 #if defined(LIBXML_HTML_ENABLED)
15828     int mem_base;
15829     htmlParserCtxtPtr ret_val;
15830     const char * filename; /* the filename */
15831     int n_filename;
15832     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15833     int n_encoding;
15834
15835     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15836     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15837         mem_base = xmlMemBlocks();
15838         filename = gen_fileoutput(n_filename, 0);
15839         encoding = gen_const_char_ptr(n_encoding, 1);
15840
15841         ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15842         desret_htmlParserCtxtPtr(ret_val);
15843         call_tests++;
15844         des_fileoutput(n_filename, filename, 0);
15845         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15846         xmlResetLastError();
15847         if (mem_base != xmlMemBlocks()) {
15848             printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15849                    xmlMemBlocks() - mem_base);
15850             test_ret++;
15851             printf(" %d", n_filename);
15852             printf(" %d", n_encoding);
15853             printf("\n");
15854         }
15855     }
15856     }
15857     function_tests++;
15858 #endif
15859
15860     return(test_ret);
15861 }
15862
15863
15864 static int
15865 test_htmlInitAutoClose(void) {
15866     int test_ret = 0;
15867
15868 #if defined(LIBXML_HTML_ENABLED)
15869     int mem_base;
15870
15871         mem_base = xmlMemBlocks();
15872
15873         htmlInitAutoClose();
15874         call_tests++;
15875         xmlResetLastError();
15876         if (mem_base != xmlMemBlocks()) {
15877             printf("Leak of %d blocks found in htmlInitAutoClose",
15878                    xmlMemBlocks() - mem_base);
15879             test_ret++;
15880             printf("\n");
15881         }
15882     function_tests++;
15883 #endif
15884
15885     return(test_ret);
15886 }
15887
15888
15889 static int
15890 test_inputPop(void) {
15891     int test_ret = 0;
15892
15893     int mem_base;
15894     xmlParserInputPtr ret_val;
15895     xmlParserCtxtPtr ctxt; /* an XML parser context */
15896     int n_ctxt;
15897
15898     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15899         mem_base = xmlMemBlocks();
15900         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15901
15902         ret_val = inputPop(ctxt);
15903         desret_xmlParserInputPtr(ret_val);
15904         call_tests++;
15905         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15906         xmlResetLastError();
15907         if (mem_base != xmlMemBlocks()) {
15908             printf("Leak of %d blocks found in inputPop",
15909                    xmlMemBlocks() - mem_base);
15910             test_ret++;
15911             printf(" %d", n_ctxt);
15912             printf("\n");
15913         }
15914     }
15915     function_tests++;
15916
15917     return(test_ret);
15918 }
15919
15920
15921 static int
15922 test_inputPush(void) {
15923     int test_ret = 0;
15924
15925     int mem_base;
15926     int ret_val;
15927     xmlParserCtxtPtr ctxt; /* an XML parser context */
15928     int n_ctxt;
15929     xmlParserInputPtr value; /* the parser input */
15930     int n_value;
15931
15932     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15933     for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15934         mem_base = xmlMemBlocks();
15935         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15936         value = gen_xmlParserInputPtr(n_value, 1);
15937
15938         ret_val = inputPush(ctxt, value);
15939         desret_int(ret_val);
15940         call_tests++;
15941         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15942         des_xmlParserInputPtr(n_value, value, 1);
15943         xmlResetLastError();
15944         if (mem_base != xmlMemBlocks()) {
15945             printf("Leak of %d blocks found in inputPush",
15946                    xmlMemBlocks() - mem_base);
15947             test_ret++;
15948             printf(" %d", n_ctxt);
15949             printf(" %d", n_value);
15950             printf("\n");
15951         }
15952     }
15953     }
15954     function_tests++;
15955
15956     return(test_ret);
15957 }
15958
15959
15960 static int
15961 test_namePop(void) {
15962     int test_ret = 0;
15963
15964     int mem_base;
15965     const xmlChar * ret_val;
15966     xmlParserCtxtPtr ctxt; /* an XML parser context */
15967     int n_ctxt;
15968
15969     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15970         mem_base = xmlMemBlocks();
15971         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15972
15973         ret_val = namePop(ctxt);
15974         desret_const_xmlChar_ptr(ret_val);
15975         call_tests++;
15976         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15977         xmlResetLastError();
15978         if (mem_base != xmlMemBlocks()) {
15979             printf("Leak of %d blocks found in namePop",
15980                    xmlMemBlocks() - mem_base);
15981             test_ret++;
15982             printf(" %d", n_ctxt);
15983             printf("\n");
15984         }
15985     }
15986     function_tests++;
15987
15988     return(test_ret);
15989 }
15990
15991
15992 static int
15993 test_namePush(void) {
15994     int test_ret = 0;
15995
15996     int mem_base;
15997     int ret_val;
15998     xmlParserCtxtPtr ctxt; /* an XML parser context */
15999     int n_ctxt;
16000     xmlChar * value; /* the element name */
16001     int n_value;
16002
16003     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16004     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
16005         mem_base = xmlMemBlocks();
16006         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16007         value = gen_const_xmlChar_ptr(n_value, 1);
16008
16009         ret_val = namePush(ctxt, (const xmlChar *)value);
16010         desret_int(ret_val);
16011         call_tests++;
16012         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16013         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
16014         xmlResetLastError();
16015         if (mem_base != xmlMemBlocks()) {
16016             printf("Leak of %d blocks found in namePush",
16017                    xmlMemBlocks() - mem_base);
16018             test_ret++;
16019             printf(" %d", n_ctxt);
16020             printf(" %d", n_value);
16021             printf("\n");
16022         }
16023     }
16024     }
16025     function_tests++;
16026
16027     return(test_ret);
16028 }
16029
16030
16031 static int
16032 test_nodePop(void) {
16033     int test_ret = 0;
16034
16035     int mem_base;
16036     xmlNodePtr ret_val;
16037     xmlParserCtxtPtr ctxt; /* an XML parser context */
16038     int n_ctxt;
16039
16040     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16041         mem_base = xmlMemBlocks();
16042         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16043
16044         ret_val = nodePop(ctxt);
16045         desret_xmlNodePtr(ret_val);
16046         call_tests++;
16047         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16048         xmlResetLastError();
16049         if (mem_base != xmlMemBlocks()) {
16050             printf("Leak of %d blocks found in nodePop",
16051                    xmlMemBlocks() - mem_base);
16052             test_ret++;
16053             printf(" %d", n_ctxt);
16054             printf("\n");
16055         }
16056     }
16057     function_tests++;
16058
16059     return(test_ret);
16060 }
16061
16062
16063 static int
16064 test_nodePush(void) {
16065     int test_ret = 0;
16066
16067     int mem_base;
16068     int ret_val;
16069     xmlParserCtxtPtr ctxt; /* an XML parser context */
16070     int n_ctxt;
16071     xmlNodePtr value; /* the element node */
16072     int n_value;
16073
16074     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16075     for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
16076         mem_base = xmlMemBlocks();
16077         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16078         value = gen_xmlNodePtr(n_value, 1);
16079
16080         ret_val = nodePush(ctxt, value);
16081         desret_int(ret_val);
16082         call_tests++;
16083         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16084         des_xmlNodePtr(n_value, value, 1);
16085         xmlResetLastError();
16086         if (mem_base != xmlMemBlocks()) {
16087             printf("Leak of %d blocks found in nodePush",
16088                    xmlMemBlocks() - mem_base);
16089             test_ret++;
16090             printf(" %d", n_ctxt);
16091             printf(" %d", n_value);
16092             printf("\n");
16093         }
16094     }
16095     }
16096     function_tests++;
16097
16098     return(test_ret);
16099 }
16100
16101
16102 static int
16103 test_xmlCheckLanguageID(void) {
16104     int test_ret = 0;
16105
16106     int mem_base;
16107     int ret_val;
16108     xmlChar * lang; /* pointer to the string value */
16109     int n_lang;
16110
16111     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
16112         mem_base = xmlMemBlocks();
16113         lang = gen_const_xmlChar_ptr(n_lang, 0);
16114
16115         ret_val = xmlCheckLanguageID((const xmlChar *)lang);
16116         desret_int(ret_val);
16117         call_tests++;
16118         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
16119         xmlResetLastError();
16120         if (mem_base != xmlMemBlocks()) {
16121             printf("Leak of %d blocks found in xmlCheckLanguageID",
16122                    xmlMemBlocks() - mem_base);
16123             test_ret++;
16124             printf(" %d", n_lang);
16125             printf("\n");
16126         }
16127     }
16128     function_tests++;
16129
16130     return(test_ret);
16131 }
16132
16133
16134 static int
16135 test_xmlCopyChar(void) {
16136     int test_ret = 0;
16137
16138     int mem_base;
16139     int ret_val;
16140     int len; /* Ignored, compatibility */
16141     int n_len;
16142     xmlChar * out; /* pointer to an array of xmlChar */
16143     int n_out;
16144     int val; /* the char value */
16145     int n_val;
16146
16147     for (n_len = 0;n_len < gen_nb_int;n_len++) {
16148     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
16149     for (n_val = 0;n_val < gen_nb_int;n_val++) {
16150         mem_base = xmlMemBlocks();
16151         len = gen_int(n_len, 0);
16152         out = gen_xmlChar_ptr(n_out, 1);
16153         val = gen_int(n_val, 2);
16154
16155         ret_val = xmlCopyChar(len, out, val);
16156         desret_int(ret_val);
16157         call_tests++;
16158         des_int(n_len, len, 0);
16159         des_xmlChar_ptr(n_out, out, 1);
16160         des_int(n_val, val, 2);
16161         xmlResetLastError();
16162         if (mem_base != xmlMemBlocks()) {
16163             printf("Leak of %d blocks found in xmlCopyChar",
16164                    xmlMemBlocks() - mem_base);
16165             test_ret++;
16166             printf(" %d", n_len);
16167             printf(" %d", n_out);
16168             printf(" %d", n_val);
16169             printf("\n");
16170         }
16171     }
16172     }
16173     }
16174     function_tests++;
16175
16176     return(test_ret);
16177 }
16178
16179
16180 static int
16181 test_xmlCopyCharMultiByte(void) {
16182     int test_ret = 0;
16183
16184     int mem_base;
16185     int ret_val;
16186     xmlChar * out; /* pointer to an array of xmlChar */
16187     int n_out;
16188     int val; /* the char value */
16189     int n_val;
16190
16191     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
16192     for (n_val = 0;n_val < gen_nb_int;n_val++) {
16193         mem_base = xmlMemBlocks();
16194         out = gen_xmlChar_ptr(n_out, 0);
16195         val = gen_int(n_val, 1);
16196
16197         ret_val = xmlCopyCharMultiByte(out, val);
16198         desret_int(ret_val);
16199         call_tests++;
16200         des_xmlChar_ptr(n_out, out, 0);
16201         des_int(n_val, val, 1);
16202         xmlResetLastError();
16203         if (mem_base != xmlMemBlocks()) {
16204             printf("Leak of %d blocks found in xmlCopyCharMultiByte",
16205                    xmlMemBlocks() - mem_base);
16206             test_ret++;
16207             printf(" %d", n_out);
16208             printf(" %d", n_val);
16209             printf("\n");
16210         }
16211     }
16212     }
16213     function_tests++;
16214
16215     return(test_ret);
16216 }
16217
16218
16219 static int
16220 test_xmlCreateEntityParserCtxt(void) {
16221     int test_ret = 0;
16222
16223     int mem_base;
16224     xmlParserCtxtPtr ret_val;
16225     xmlChar * URL; /* the entity URL */
16226     int n_URL;
16227     xmlChar * ID; /* the entity PUBLIC ID */
16228     int n_ID;
16229     xmlChar * base; /* a possible base for the target URI */
16230     int n_base;
16231
16232     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
16233     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
16234     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
16235         mem_base = xmlMemBlocks();
16236         URL = gen_const_xmlChar_ptr(n_URL, 0);
16237         ID = gen_const_xmlChar_ptr(n_ID, 1);
16238         base = gen_const_xmlChar_ptr(n_base, 2);
16239
16240         ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
16241         desret_xmlParserCtxtPtr(ret_val);
16242         call_tests++;
16243         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
16244         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
16245         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
16246         xmlResetLastError();
16247         if (mem_base != xmlMemBlocks()) {
16248             printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
16249                    xmlMemBlocks() - mem_base);
16250             test_ret++;
16251             printf(" %d", n_URL);
16252             printf(" %d", n_ID);
16253             printf(" %d", n_base);
16254             printf("\n");
16255         }
16256     }
16257     }
16258     }
16259     function_tests++;
16260
16261     return(test_ret);
16262 }
16263
16264
16265 static int
16266 test_xmlCreateFileParserCtxt(void) {
16267     int test_ret = 0;
16268
16269     int mem_base;
16270     xmlParserCtxtPtr ret_val;
16271     const char * filename; /* the filename */
16272     int n_filename;
16273
16274     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
16275         mem_base = xmlMemBlocks();
16276         filename = gen_fileoutput(n_filename, 0);
16277
16278         ret_val = xmlCreateFileParserCtxt(filename);
16279         desret_xmlParserCtxtPtr(ret_val);
16280         call_tests++;
16281         des_fileoutput(n_filename, filename, 0);
16282         xmlResetLastError();
16283         if (mem_base != xmlMemBlocks()) {
16284             printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
16285                    xmlMemBlocks() - mem_base);
16286             test_ret++;
16287             printf(" %d", n_filename);
16288             printf("\n");
16289         }
16290     }
16291     function_tests++;
16292
16293     return(test_ret);
16294 }
16295
16296
16297 static int
16298 test_xmlCreateMemoryParserCtxt(void) {
16299     int test_ret = 0;
16300
16301     int mem_base;
16302     xmlParserCtxtPtr ret_val;
16303     char * buffer; /* a pointer to a char array */
16304     int n_buffer;
16305     int size; /* the size of the array */
16306     int n_size;
16307
16308     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
16309     for (n_size = 0;n_size < gen_nb_int;n_size++) {
16310         mem_base = xmlMemBlocks();
16311         buffer = gen_const_char_ptr(n_buffer, 0);
16312         size = gen_int(n_size, 1);
16313
16314         ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
16315         desret_xmlParserCtxtPtr(ret_val);
16316         call_tests++;
16317         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
16318         des_int(n_size, size, 1);
16319         xmlResetLastError();
16320         if (mem_base != xmlMemBlocks()) {
16321             printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
16322                    xmlMemBlocks() - mem_base);
16323             test_ret++;
16324             printf(" %d", n_buffer);
16325             printf(" %d", n_size);
16326             printf("\n");
16327         }
16328     }
16329     }
16330     function_tests++;
16331
16332     return(test_ret);
16333 }
16334
16335
16336 static int
16337 test_xmlCreateURLParserCtxt(void) {
16338     int test_ret = 0;
16339
16340     int mem_base;
16341     xmlParserCtxtPtr ret_val;
16342     const char * filename; /* the filename or URL */
16343     int n_filename;
16344     int options; /* a combination of xmlParserOption */
16345     int n_options;
16346
16347     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
16348     for (n_options = 0;n_options < gen_nb_int;n_options++) {
16349         mem_base = xmlMemBlocks();
16350         filename = gen_fileoutput(n_filename, 0);
16351         options = gen_int(n_options, 1);
16352
16353         ret_val = xmlCreateURLParserCtxt(filename, options);
16354         desret_xmlParserCtxtPtr(ret_val);
16355         call_tests++;
16356         des_fileoutput(n_filename, filename, 0);
16357         des_int(n_options, options, 1);
16358         xmlResetLastError();
16359         if (mem_base != xmlMemBlocks()) {
16360             printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
16361                    xmlMemBlocks() - mem_base);
16362             test_ret++;
16363             printf(" %d", n_filename);
16364             printf(" %d", n_options);
16365             printf("\n");
16366         }
16367     }
16368     }
16369     function_tests++;
16370
16371     return(test_ret);
16372 }
16373
16374
16375 static int
16376 test_xmlCurrentChar(void) {
16377     int test_ret = 0;
16378
16379     int mem_base;
16380     int ret_val;
16381     xmlParserCtxtPtr ctxt; /* the XML parser context */
16382     int n_ctxt;
16383     int * len; /* pointer to the length of the char read */
16384     int n_len;
16385
16386     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16387     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16388         mem_base = xmlMemBlocks();
16389         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16390         len = gen_int_ptr(n_len, 1);
16391
16392         ret_val = xmlCurrentChar(ctxt, len);
16393         desret_int(ret_val);
16394         call_tests++;
16395         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16396         des_int_ptr(n_len, len, 1);
16397         xmlResetLastError();
16398         if (mem_base != xmlMemBlocks()) {
16399             printf("Leak of %d blocks found in xmlCurrentChar",
16400                    xmlMemBlocks() - mem_base);
16401             test_ret++;
16402             printf(" %d", n_ctxt);
16403             printf(" %d", n_len);
16404             printf("\n");
16405         }
16406     }
16407     }
16408     function_tests++;
16409
16410     return(test_ret);
16411 }
16412
16413
16414 static int
16415 test_xmlErrMemory(void) {
16416     int test_ret = 0;
16417
16418     int mem_base;
16419     xmlParserCtxtPtr ctxt; /* an XML parser context */
16420     int n_ctxt;
16421     char * extra; /* extra informations */
16422     int n_extra;
16423
16424     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16425     for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16426         mem_base = xmlMemBlocks();
16427         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16428         extra = gen_const_char_ptr(n_extra, 1);
16429
16430         xmlErrMemory(ctxt, (const char *)extra);
16431         call_tests++;
16432         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16433         des_const_char_ptr(n_extra, (const char *)extra, 1);
16434         xmlResetLastError();
16435         if (mem_base != xmlMemBlocks()) {
16436             printf("Leak of %d blocks found in xmlErrMemory",
16437                    xmlMemBlocks() - mem_base);
16438             test_ret++;
16439             printf(" %d", n_ctxt);
16440             printf(" %d", n_extra);
16441             printf("\n");
16442         }
16443     }
16444     }
16445     function_tests++;
16446
16447     return(test_ret);
16448 }
16449
16450
16451 static int
16452 test_xmlIsLetter(void) {
16453     int test_ret = 0;
16454
16455     int mem_base;
16456     int ret_val;
16457     int c; /* an unicode character (int) */
16458     int n_c;
16459
16460     for (n_c = 0;n_c < gen_nb_int;n_c++) {
16461         mem_base = xmlMemBlocks();
16462         c = gen_int(n_c, 0);
16463
16464         ret_val = xmlIsLetter(c);
16465         desret_int(ret_val);
16466         call_tests++;
16467         des_int(n_c, c, 0);
16468         xmlResetLastError();
16469         if (mem_base != xmlMemBlocks()) {
16470             printf("Leak of %d blocks found in xmlIsLetter",
16471                    xmlMemBlocks() - mem_base);
16472             test_ret++;
16473             printf(" %d", n_c);
16474             printf("\n");
16475         }
16476     }
16477     function_tests++;
16478
16479     return(test_ret);
16480 }
16481
16482
16483 static int
16484 test_xmlNewEntityInputStream(void) {
16485     int test_ret = 0;
16486
16487     int mem_base;
16488     xmlParserInputPtr ret_val;
16489     xmlParserCtxtPtr ctxt; /* an XML parser context */
16490     int n_ctxt;
16491     xmlEntityPtr entity; /* an Entity pointer */
16492     int n_entity;
16493
16494     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16495     for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16496         mem_base = xmlMemBlocks();
16497         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16498         entity = gen_xmlEntityPtr(n_entity, 1);
16499
16500         ret_val = xmlNewEntityInputStream(ctxt, entity);
16501         desret_xmlParserInputPtr(ret_val);
16502         call_tests++;
16503         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16504         des_xmlEntityPtr(n_entity, entity, 1);
16505         xmlResetLastError();
16506         if (mem_base != xmlMemBlocks()) {
16507             printf("Leak of %d blocks found in xmlNewEntityInputStream",
16508                    xmlMemBlocks() - mem_base);
16509             test_ret++;
16510             printf(" %d", n_ctxt);
16511             printf(" %d", n_entity);
16512             printf("\n");
16513         }
16514     }
16515     }
16516     function_tests++;
16517
16518     return(test_ret);
16519 }
16520
16521
16522 static int
16523 test_xmlNewInputFromFile(void) {
16524     int test_ret = 0;
16525
16526     int mem_base;
16527     xmlParserInputPtr ret_val;
16528     xmlParserCtxtPtr ctxt; /* an XML parser context */
16529     int n_ctxt;
16530     const char * filename; /* the filename to use as entity */
16531     int n_filename;
16532
16533     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16534     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16535         mem_base = xmlMemBlocks();
16536         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16537         filename = gen_filepath(n_filename, 1);
16538
16539         ret_val = xmlNewInputFromFile(ctxt, filename);
16540         desret_xmlParserInputPtr(ret_val);
16541         call_tests++;
16542         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16543         des_filepath(n_filename, filename, 1);
16544         xmlResetLastError();
16545         if (mem_base != xmlMemBlocks()) {
16546             printf("Leak of %d blocks found in xmlNewInputFromFile",
16547                    xmlMemBlocks() - mem_base);
16548             test_ret++;
16549             printf(" %d", n_ctxt);
16550             printf(" %d", n_filename);
16551             printf("\n");
16552         }
16553     }
16554     }
16555     function_tests++;
16556
16557     return(test_ret);
16558 }
16559
16560
16561 static int
16562 test_xmlNewInputStream(void) {
16563     int test_ret = 0;
16564
16565     int mem_base;
16566     xmlParserInputPtr ret_val;
16567     xmlParserCtxtPtr ctxt; /* an XML parser context */
16568     int n_ctxt;
16569
16570     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16571         mem_base = xmlMemBlocks();
16572         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16573
16574         ret_val = xmlNewInputStream(ctxt);
16575         desret_xmlParserInputPtr(ret_val);
16576         call_tests++;
16577         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16578         xmlResetLastError();
16579         if (mem_base != xmlMemBlocks()) {
16580             printf("Leak of %d blocks found in xmlNewInputStream",
16581                    xmlMemBlocks() - mem_base);
16582             test_ret++;
16583             printf(" %d", n_ctxt);
16584             printf("\n");
16585         }
16586     }
16587     function_tests++;
16588
16589     return(test_ret);
16590 }
16591
16592
16593 static int
16594 test_xmlNewStringInputStream(void) {
16595     int test_ret = 0;
16596
16597     int mem_base;
16598     xmlParserInputPtr ret_val;
16599     xmlParserCtxtPtr ctxt; /* an XML parser context */
16600     int n_ctxt;
16601     xmlChar * buffer; /* an memory buffer */
16602     int n_buffer;
16603
16604     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16605     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16606         mem_base = xmlMemBlocks();
16607         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16608         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16609
16610         ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16611         desret_xmlParserInputPtr(ret_val);
16612         call_tests++;
16613         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16614         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16615         xmlResetLastError();
16616         if (mem_base != xmlMemBlocks()) {
16617             printf("Leak of %d blocks found in xmlNewStringInputStream",
16618                    xmlMemBlocks() - mem_base);
16619             test_ret++;
16620             printf(" %d", n_ctxt);
16621             printf(" %d", n_buffer);
16622             printf("\n");
16623         }
16624     }
16625     }
16626     function_tests++;
16627
16628     return(test_ret);
16629 }
16630
16631
16632 static int
16633 test_xmlNextChar(void) {
16634     int test_ret = 0;
16635
16636     int mem_base;
16637     xmlParserCtxtPtr ctxt; /* the XML parser context */
16638     int n_ctxt;
16639
16640     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16641         mem_base = xmlMemBlocks();
16642         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16643
16644         xmlNextChar(ctxt);
16645         call_tests++;
16646         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16647         xmlResetLastError();
16648         if (mem_base != xmlMemBlocks()) {
16649             printf("Leak of %d blocks found in xmlNextChar",
16650                    xmlMemBlocks() - mem_base);
16651             test_ret++;
16652             printf(" %d", n_ctxt);
16653             printf("\n");
16654         }
16655     }
16656     function_tests++;
16657
16658     return(test_ret);
16659 }
16660
16661
16662 static int
16663 test_xmlParserInputShrink(void) {
16664     int test_ret = 0;
16665
16666     int mem_base;
16667     xmlParserInputPtr in; /* an XML parser input */
16668     int n_in;
16669
16670     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16671         mem_base = xmlMemBlocks();
16672         in = gen_xmlParserInputPtr(n_in, 0);
16673
16674         xmlParserInputShrink(in);
16675         call_tests++;
16676         des_xmlParserInputPtr(n_in, in, 0);
16677         xmlResetLastError();
16678         if (mem_base != xmlMemBlocks()) {
16679             printf("Leak of %d blocks found in xmlParserInputShrink",
16680                    xmlMemBlocks() - mem_base);
16681             test_ret++;
16682             printf(" %d", n_in);
16683             printf("\n");
16684         }
16685     }
16686     function_tests++;
16687
16688     return(test_ret);
16689 }
16690
16691
16692 static int
16693 test_xmlPopInput(void) {
16694     int test_ret = 0;
16695
16696     int mem_base;
16697     xmlChar ret_val;
16698     xmlParserCtxtPtr ctxt; /* an XML parser context */
16699     int n_ctxt;
16700
16701     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16702         mem_base = xmlMemBlocks();
16703         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16704
16705         ret_val = xmlPopInput(ctxt);
16706         desret_xmlChar(ret_val);
16707         call_tests++;
16708         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16709         xmlResetLastError();
16710         if (mem_base != xmlMemBlocks()) {
16711             printf("Leak of %d blocks found in xmlPopInput",
16712                    xmlMemBlocks() - mem_base);
16713             test_ret++;
16714             printf(" %d", n_ctxt);
16715             printf("\n");
16716         }
16717     }
16718     function_tests++;
16719
16720     return(test_ret);
16721 }
16722
16723
16724 static int
16725 test_xmlPushInput(void) {
16726     int test_ret = 0;
16727
16728     int mem_base;
16729     int ret_val;
16730     xmlParserCtxtPtr ctxt; /* an XML parser context */
16731     int n_ctxt;
16732     xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16733     int n_input;
16734
16735     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16736     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16737         mem_base = xmlMemBlocks();
16738         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16739         input = gen_xmlParserInputPtr(n_input, 1);
16740
16741         ret_val = xmlPushInput(ctxt, input);
16742         desret_int(ret_val);
16743         call_tests++;
16744         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16745         des_xmlParserInputPtr(n_input, input, 1);
16746         xmlResetLastError();
16747         if (mem_base != xmlMemBlocks()) {
16748             printf("Leak of %d blocks found in xmlPushInput",
16749                    xmlMemBlocks() - mem_base);
16750             test_ret++;
16751             printf(" %d", n_ctxt);
16752             printf(" %d", n_input);
16753             printf("\n");
16754         }
16755     }
16756     }
16757     function_tests++;
16758
16759     return(test_ret);
16760 }
16761
16762
16763 static int
16764 test_xmlSetEntityReferenceFunc(void) {
16765     int test_ret = 0;
16766
16767
16768     /* missing type support */
16769     return(test_ret);
16770 }
16771
16772
16773 static int
16774 test_xmlSplitQName(void) {
16775     int test_ret = 0;
16776
16777     int mem_base;
16778     xmlChar * ret_val;
16779     xmlParserCtxtPtr ctxt; /* an XML parser context */
16780     int n_ctxt;
16781     xmlChar * name; /* an XML parser context */
16782     int n_name;
16783     xmlChar ** prefix; /* a xmlChar ** */
16784     int n_prefix;
16785
16786     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16787     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16788     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16789         mem_base = xmlMemBlocks();
16790         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16791         name = gen_const_xmlChar_ptr(n_name, 1);
16792         prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16793
16794         ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16795         desret_xmlChar_ptr(ret_val);
16796         call_tests++;
16797         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16798         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16799         des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16800         xmlResetLastError();
16801         if (mem_base != xmlMemBlocks()) {
16802             printf("Leak of %d blocks found in xmlSplitQName",
16803                    xmlMemBlocks() - mem_base);
16804             test_ret++;
16805             printf(" %d", n_ctxt);
16806             printf(" %d", n_name);
16807             printf(" %d", n_prefix);
16808             printf("\n");
16809         }
16810     }
16811     }
16812     }
16813     function_tests++;
16814
16815     return(test_ret);
16816 }
16817
16818
16819 static int
16820 test_xmlStringCurrentChar(void) {
16821     int test_ret = 0;
16822
16823     int mem_base;
16824     int ret_val;
16825     xmlParserCtxtPtr ctxt; /* the XML parser context */
16826     int n_ctxt;
16827     xmlChar * cur; /* pointer to the beginning of the char */
16828     int n_cur;
16829     int * len; /* pointer to the length of the char read */
16830     int n_len;
16831
16832     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16833     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16834     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16835         mem_base = xmlMemBlocks();
16836         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16837         cur = gen_const_xmlChar_ptr(n_cur, 1);
16838         len = gen_int_ptr(n_len, 2);
16839
16840         ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16841         desret_int(ret_val);
16842         call_tests++;
16843         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16844         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16845         des_int_ptr(n_len, len, 2);
16846         xmlResetLastError();
16847         if (mem_base != xmlMemBlocks()) {
16848             printf("Leak of %d blocks found in xmlStringCurrentChar",
16849                    xmlMemBlocks() - mem_base);
16850             test_ret++;
16851             printf(" %d", n_ctxt);
16852             printf(" %d", n_cur);
16853             printf(" %d", n_len);
16854             printf("\n");
16855         }
16856     }
16857     }
16858     }
16859     function_tests++;
16860
16861     return(test_ret);
16862 }
16863
16864
16865 static int
16866 test_xmlStringDecodeEntities(void) {
16867     int test_ret = 0;
16868
16869     int mem_base;
16870     xmlChar * ret_val;
16871     xmlParserCtxtPtr ctxt; /* the parser context */
16872     int n_ctxt;
16873     xmlChar * str; /* the input string */
16874     int n_str;
16875     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16876     int n_what;
16877     xmlChar end; /* an end marker xmlChar, 0 if none */
16878     int n_end;
16879     xmlChar end2; /* an end marker xmlChar, 0 if none */
16880     int n_end2;
16881     xmlChar end3; /* an end marker xmlChar, 0 if none */
16882     int n_end3;
16883
16884     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16885     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16886     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16887     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16888     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16889     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16890         mem_base = xmlMemBlocks();
16891         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16892         str = gen_const_xmlChar_ptr(n_str, 1);
16893         what = gen_int(n_what, 2);
16894         end = gen_xmlChar(n_end, 3);
16895         end2 = gen_xmlChar(n_end2, 4);
16896         end3 = gen_xmlChar(n_end3, 5);
16897
16898         ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16899         desret_xmlChar_ptr(ret_val);
16900         call_tests++;
16901         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16902         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16903         des_int(n_what, what, 2);
16904         des_xmlChar(n_end, end, 3);
16905         des_xmlChar(n_end2, end2, 4);
16906         des_xmlChar(n_end3, end3, 5);
16907         xmlResetLastError();
16908         if (mem_base != xmlMemBlocks()) {
16909             printf("Leak of %d blocks found in xmlStringDecodeEntities",
16910                    xmlMemBlocks() - mem_base);
16911             test_ret++;
16912             printf(" %d", n_ctxt);
16913             printf(" %d", n_str);
16914             printf(" %d", n_what);
16915             printf(" %d", n_end);
16916             printf(" %d", n_end2);
16917             printf(" %d", n_end3);
16918             printf("\n");
16919         }
16920     }
16921     }
16922     }
16923     }
16924     }
16925     }
16926     function_tests++;
16927
16928     return(test_ret);
16929 }
16930
16931
16932 static int
16933 test_xmlStringLenDecodeEntities(void) {
16934     int test_ret = 0;
16935
16936     int mem_base;
16937     xmlChar * ret_val;
16938     xmlParserCtxtPtr ctxt; /* the parser context */
16939     int n_ctxt;
16940     xmlChar * str; /* the input string */
16941     int n_str;
16942     int len; /* the string length */
16943     int n_len;
16944     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16945     int n_what;
16946     xmlChar end; /* an end marker xmlChar, 0 if none */
16947     int n_end;
16948     xmlChar end2; /* an end marker xmlChar, 0 if none */
16949     int n_end2;
16950     xmlChar end3; /* an end marker xmlChar, 0 if none */
16951     int n_end3;
16952
16953     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16954     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16955     for (n_len = 0;n_len < gen_nb_int;n_len++) {
16956     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16957     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16958     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16959     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16960         mem_base = xmlMemBlocks();
16961         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16962         str = gen_const_xmlChar_ptr(n_str, 1);
16963         len = gen_int(n_len, 2);
16964         what = gen_int(n_what, 3);
16965         end = gen_xmlChar(n_end, 4);
16966         end2 = gen_xmlChar(n_end2, 5);
16967         end3 = gen_xmlChar(n_end3, 6);
16968
16969         ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16970         desret_xmlChar_ptr(ret_val);
16971         call_tests++;
16972         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16973         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16974         des_int(n_len, len, 2);
16975         des_int(n_what, what, 3);
16976         des_xmlChar(n_end, end, 4);
16977         des_xmlChar(n_end2, end2, 5);
16978         des_xmlChar(n_end3, end3, 6);
16979         xmlResetLastError();
16980         if (mem_base != xmlMemBlocks()) {
16981             printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16982                    xmlMemBlocks() - mem_base);
16983             test_ret++;
16984             printf(" %d", n_ctxt);
16985             printf(" %d", n_str);
16986             printf(" %d", n_len);
16987             printf(" %d", n_what);
16988             printf(" %d", n_end);
16989             printf(" %d", n_end2);
16990             printf(" %d", n_end3);
16991             printf("\n");
16992         }
16993     }
16994     }
16995     }
16996     }
16997     }
16998     }
16999     }
17000     function_tests++;
17001
17002     return(test_ret);
17003 }
17004
17005
17006 static int
17007 test_xmlSwitchEncoding(void) {
17008     int test_ret = 0;
17009
17010     int mem_base;
17011     int ret_val;
17012     xmlParserCtxtPtr ctxt; /* the parser context */
17013     int n_ctxt;
17014     xmlCharEncoding enc; /* the encoding value (number) */
17015     int n_enc;
17016
17017     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
17018     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
17019         mem_base = xmlMemBlocks();
17020         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
17021         enc = gen_xmlCharEncoding(n_enc, 1);
17022
17023         ret_val = xmlSwitchEncoding(ctxt, enc);
17024         desret_int(ret_val);
17025         call_tests++;
17026         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
17027         des_xmlCharEncoding(n_enc, enc, 1);
17028         xmlResetLastError();
17029         if (mem_base != xmlMemBlocks()) {
17030             printf("Leak of %d blocks found in xmlSwitchEncoding",
17031                    xmlMemBlocks() - mem_base);
17032             test_ret++;
17033             printf(" %d", n_ctxt);
17034             printf(" %d", n_enc);
17035             printf("\n");
17036         }
17037     }
17038     }
17039     function_tests++;
17040
17041     return(test_ret);
17042 }
17043
17044
17045 static int
17046 test_xmlSwitchInputEncoding(void) {
17047     int test_ret = 0;
17048
17049     int mem_base;
17050     int ret_val;
17051     xmlParserCtxtPtr ctxt; /* the parser context */
17052     int n_ctxt;
17053     xmlParserInputPtr input; /* the input stream */
17054     int n_input;
17055     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
17056     int n_handler;
17057
17058     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
17059     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
17060     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
17061         mem_base = xmlMemBlocks();
17062         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
17063         input = gen_xmlParserInputPtr(n_input, 1);
17064         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
17065
17066         ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
17067         desret_int(ret_val);
17068         call_tests++;
17069         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
17070         des_xmlParserInputPtr(n_input, input, 1);
17071         des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
17072         xmlResetLastError();
17073         if (mem_base != xmlMemBlocks()) {
17074             printf("Leak of %d blocks found in xmlSwitchInputEncoding",
17075                    xmlMemBlocks() - mem_base);
17076             test_ret++;
17077             printf(" %d", n_ctxt);
17078             printf(" %d", n_input);
17079             printf(" %d", n_handler);
17080             printf("\n");
17081         }
17082     }
17083     }
17084     }
17085     function_tests++;
17086
17087     return(test_ret);
17088 }
17089
17090
17091 static int
17092 test_xmlSwitchToEncoding(void) {
17093     int test_ret = 0;
17094
17095     int mem_base;
17096     int ret_val;
17097     xmlParserCtxtPtr ctxt; /* the parser context */
17098     int n_ctxt;
17099     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
17100     int n_handler;
17101
17102     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
17103     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
17104         mem_base = xmlMemBlocks();
17105         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
17106         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
17107
17108         ret_val = xmlSwitchToEncoding(ctxt, handler);
17109         desret_int(ret_val);
17110         call_tests++;
17111         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
17112         des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
17113         xmlResetLastError();
17114         if (mem_base != xmlMemBlocks()) {
17115             printf("Leak of %d blocks found in xmlSwitchToEncoding",
17116                    xmlMemBlocks() - mem_base);
17117             test_ret++;
17118             printf(" %d", n_ctxt);
17119             printf(" %d", n_handler);
17120             printf("\n");
17121         }
17122     }
17123     }
17124     function_tests++;
17125
17126     return(test_ret);
17127 }
17128
17129 static int
17130 test_parserInternals(void) {
17131     int test_ret = 0;
17132         int rc = 0;
17133
17134     if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
17135     rc = test_htmlCreateFileParserCtxt();
17136         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17137     rc = test_htmlInitAutoClose();
17138         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17139     rc = test_inputPop();
17140         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17141     rc = test_inputPush();
17142         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17143     rc = test_namePop();
17144         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17145     rc = test_namePush();
17146         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17147     rc = test_nodePop();
17148         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17149     rc = test_nodePush();
17150         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17151     rc = test_xmlCheckLanguageID();
17152         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17153     rc = test_xmlCopyChar();
17154         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17155     rc = test_xmlCopyCharMultiByte();
17156         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17157     rc = test_xmlCreateEntityParserCtxt();
17158         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17159     rc = test_xmlCreateFileParserCtxt();
17160         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17161     rc = test_xmlCreateMemoryParserCtxt();
17162         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17163     rc = test_xmlCreateURLParserCtxt();
17164         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17165     rc = test_xmlCurrentChar();
17166         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17167     rc = test_xmlErrMemory();
17168         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17169     rc = test_xmlIsLetter();
17170         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17171     rc = test_xmlNewEntityInputStream();
17172         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17173     rc = test_xmlNewInputFromFile();
17174         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17175     rc = test_xmlNewInputStream();
17176         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17177     rc = test_xmlNewStringInputStream();
17178         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17179     rc = test_xmlNextChar();
17180         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17181     rc = test_xmlParserInputShrink();
17182         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17183     rc = test_xmlPopInput();
17184         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17185     rc = test_xmlPushInput();
17186         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17187     rc = test_xmlSetEntityReferenceFunc();
17188         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17189     rc = test_xmlSplitQName();
17190         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17191     rc = test_xmlStringCurrentChar();
17192         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17193     rc = test_xmlStringDecodeEntities();
17194         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17195     rc = test_xmlStringLenDecodeEntities();
17196         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17197     rc = test_xmlSwitchEncoding();
17198         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17199     rc = test_xmlSwitchInputEncoding();
17200         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17201     rc = test_xmlSwitchToEncoding();
17202         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17203
17204     if (test_ret != 0)
17205         printf("Module parserInternals: %d errors\n", test_ret);
17206     return(test_ret);
17207 }
17208
17209 static int
17210 test_xmlPatternFromRoot(void) {
17211     int test_ret = 0;
17212
17213 #if defined(LIBXML_PATTERN_ENABLED)
17214     int mem_base;
17215     int ret_val;
17216     xmlPatternPtr comp; /* the precompiled pattern */
17217     int n_comp;
17218
17219     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17220         mem_base = xmlMemBlocks();
17221         comp = gen_xmlPatternPtr(n_comp, 0);
17222
17223         ret_val = xmlPatternFromRoot(comp);
17224         desret_int(ret_val);
17225         call_tests++;
17226         des_xmlPatternPtr(n_comp, comp, 0);
17227         xmlResetLastError();
17228         if (mem_base != xmlMemBlocks()) {
17229             printf("Leak of %d blocks found in xmlPatternFromRoot",
17230                    xmlMemBlocks() - mem_base);
17231             test_ret++;
17232             printf(" %d", n_comp);
17233             printf("\n");
17234         }
17235     }
17236     function_tests++;
17237 #endif
17238
17239     return(test_ret);
17240 }
17241
17242
17243 static int
17244 test_xmlPatternGetStreamCtxt(void) {
17245     int test_ret = 0;
17246
17247
17248     /* missing type support */
17249     return(test_ret);
17250 }
17251
17252
17253 static int
17254 test_xmlPatternMatch(void) {
17255     int test_ret = 0;
17256
17257 #if defined(LIBXML_PATTERN_ENABLED)
17258     int mem_base;
17259     int ret_val;
17260     xmlPatternPtr comp; /* the precompiled pattern */
17261     int n_comp;
17262     xmlNodePtr node; /* a node */
17263     int n_node;
17264
17265     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17266     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
17267         mem_base = xmlMemBlocks();
17268         comp = gen_xmlPatternPtr(n_comp, 0);
17269         node = gen_xmlNodePtr(n_node, 1);
17270
17271         ret_val = xmlPatternMatch(comp, node);
17272         desret_int(ret_val);
17273         call_tests++;
17274         des_xmlPatternPtr(n_comp, comp, 0);
17275         des_xmlNodePtr(n_node, node, 1);
17276         xmlResetLastError();
17277         if (mem_base != xmlMemBlocks()) {
17278             printf("Leak of %d blocks found in xmlPatternMatch",
17279                    xmlMemBlocks() - mem_base);
17280             test_ret++;
17281             printf(" %d", n_comp);
17282             printf(" %d", n_node);
17283             printf("\n");
17284         }
17285     }
17286     }
17287     function_tests++;
17288 #endif
17289
17290     return(test_ret);
17291 }
17292
17293
17294 static int
17295 test_xmlPatternMaxDepth(void) {
17296     int test_ret = 0;
17297
17298 #if defined(LIBXML_PATTERN_ENABLED)
17299     int mem_base;
17300     int ret_val;
17301     xmlPatternPtr comp; /* the precompiled pattern */
17302     int n_comp;
17303
17304     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17305         mem_base = xmlMemBlocks();
17306         comp = gen_xmlPatternPtr(n_comp, 0);
17307
17308         ret_val = xmlPatternMaxDepth(comp);
17309         desret_int(ret_val);
17310         call_tests++;
17311         des_xmlPatternPtr(n_comp, comp, 0);
17312         xmlResetLastError();
17313         if (mem_base != xmlMemBlocks()) {
17314             printf("Leak of %d blocks found in xmlPatternMaxDepth",
17315                    xmlMemBlocks() - mem_base);
17316             test_ret++;
17317             printf(" %d", n_comp);
17318             printf("\n");
17319         }
17320     }
17321     function_tests++;
17322 #endif
17323
17324     return(test_ret);
17325 }
17326
17327
17328 static int
17329 test_xmlPatternMinDepth(void) {
17330     int test_ret = 0;
17331
17332 #if defined(LIBXML_PATTERN_ENABLED)
17333     int mem_base;
17334     int ret_val;
17335     xmlPatternPtr comp; /* the precompiled pattern */
17336     int n_comp;
17337
17338     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17339         mem_base = xmlMemBlocks();
17340         comp = gen_xmlPatternPtr(n_comp, 0);
17341
17342         ret_val = xmlPatternMinDepth(comp);
17343         desret_int(ret_val);
17344         call_tests++;
17345         des_xmlPatternPtr(n_comp, comp, 0);
17346         xmlResetLastError();
17347         if (mem_base != xmlMemBlocks()) {
17348             printf("Leak of %d blocks found in xmlPatternMinDepth",
17349                    xmlMemBlocks() - mem_base);
17350             test_ret++;
17351             printf(" %d", n_comp);
17352             printf("\n");
17353         }
17354     }
17355     function_tests++;
17356 #endif
17357
17358     return(test_ret);
17359 }
17360
17361
17362 static int
17363 test_xmlPatternStreamable(void) {
17364     int test_ret = 0;
17365
17366 #if defined(LIBXML_PATTERN_ENABLED)
17367     int mem_base;
17368     int ret_val;
17369     xmlPatternPtr comp; /* the precompiled pattern */
17370     int n_comp;
17371
17372     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17373         mem_base = xmlMemBlocks();
17374         comp = gen_xmlPatternPtr(n_comp, 0);
17375
17376         ret_val = xmlPatternStreamable(comp);
17377         desret_int(ret_val);
17378         call_tests++;
17379         des_xmlPatternPtr(n_comp, comp, 0);
17380         xmlResetLastError();
17381         if (mem_base != xmlMemBlocks()) {
17382             printf("Leak of %d blocks found in xmlPatternStreamable",
17383                    xmlMemBlocks() - mem_base);
17384             test_ret++;
17385             printf(" %d", n_comp);
17386             printf("\n");
17387         }
17388     }
17389     function_tests++;
17390 #endif
17391
17392     return(test_ret);
17393 }
17394
17395
17396 static int
17397 test_xmlPatterncompile(void) {
17398     int test_ret = 0;
17399
17400
17401     /* missing type support */
17402     return(test_ret);
17403 }
17404
17405 #ifdef LIBXML_PATTERN_ENABLED
17406
17407 #define gen_nb_xmlStreamCtxtPtr 1
17408 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17409     return(NULL);
17410 }
17411 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17412 }
17413 #endif
17414
17415
17416 static int
17417 test_xmlStreamPop(void) {
17418     int test_ret = 0;
17419
17420 #if defined(LIBXML_PATTERN_ENABLED)
17421     int mem_base;
17422     int ret_val;
17423     xmlStreamCtxtPtr stream; /* the stream context */
17424     int n_stream;
17425
17426     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17427         mem_base = xmlMemBlocks();
17428         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17429
17430         ret_val = xmlStreamPop(stream);
17431         desret_int(ret_val);
17432         call_tests++;
17433         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17434         xmlResetLastError();
17435         if (mem_base != xmlMemBlocks()) {
17436             printf("Leak of %d blocks found in xmlStreamPop",
17437                    xmlMemBlocks() - mem_base);
17438             test_ret++;
17439             printf(" %d", n_stream);
17440             printf("\n");
17441         }
17442     }
17443     function_tests++;
17444 #endif
17445
17446     return(test_ret);
17447 }
17448
17449
17450 static int
17451 test_xmlStreamPush(void) {
17452     int test_ret = 0;
17453
17454 #if defined(LIBXML_PATTERN_ENABLED)
17455     int mem_base;
17456     int ret_val;
17457     xmlStreamCtxtPtr stream; /* the stream context */
17458     int n_stream;
17459     xmlChar * name; /* the current name */
17460     int n_name;
17461     xmlChar * ns; /* the namespace name */
17462     int n_ns;
17463
17464     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17465     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17466     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17467         mem_base = xmlMemBlocks();
17468         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17469         name = gen_const_xmlChar_ptr(n_name, 1);
17470         ns = gen_const_xmlChar_ptr(n_ns, 2);
17471
17472         ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17473         desret_int(ret_val);
17474         call_tests++;
17475         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17476         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17477         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17478         xmlResetLastError();
17479         if (mem_base != xmlMemBlocks()) {
17480             printf("Leak of %d blocks found in xmlStreamPush",
17481                    xmlMemBlocks() - mem_base);
17482             test_ret++;
17483             printf(" %d", n_stream);
17484             printf(" %d", n_name);
17485             printf(" %d", n_ns);
17486             printf("\n");
17487         }
17488     }
17489     }
17490     }
17491     function_tests++;
17492 #endif
17493
17494     return(test_ret);
17495 }
17496
17497
17498 static int
17499 test_xmlStreamPushAttr(void) {
17500     int test_ret = 0;
17501
17502 #if defined(LIBXML_PATTERN_ENABLED)
17503     int mem_base;
17504     int ret_val;
17505     xmlStreamCtxtPtr stream; /* the stream context */
17506     int n_stream;
17507     xmlChar * name; /* the current name */
17508     int n_name;
17509     xmlChar * ns; /* the namespace name */
17510     int n_ns;
17511
17512     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17513     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17514     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17515         mem_base = xmlMemBlocks();
17516         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17517         name = gen_const_xmlChar_ptr(n_name, 1);
17518         ns = gen_const_xmlChar_ptr(n_ns, 2);
17519
17520         ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17521         desret_int(ret_val);
17522         call_tests++;
17523         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17524         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17525         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17526         xmlResetLastError();
17527         if (mem_base != xmlMemBlocks()) {
17528             printf("Leak of %d blocks found in xmlStreamPushAttr",
17529                    xmlMemBlocks() - mem_base);
17530             test_ret++;
17531             printf(" %d", n_stream);
17532             printf(" %d", n_name);
17533             printf(" %d", n_ns);
17534             printf("\n");
17535         }
17536     }
17537     }
17538     }
17539     function_tests++;
17540 #endif
17541
17542     return(test_ret);
17543 }
17544
17545
17546 static int
17547 test_xmlStreamPushNode(void) {
17548     int test_ret = 0;
17549
17550 #if defined(LIBXML_PATTERN_ENABLED)
17551     int mem_base;
17552     int ret_val;
17553     xmlStreamCtxtPtr stream; /* the stream context */
17554     int n_stream;
17555     xmlChar * name; /* the current name */
17556     int n_name;
17557     xmlChar * ns; /* the namespace name */
17558     int n_ns;
17559     int nodeType; /* the type of the node being pushed */
17560     int n_nodeType;
17561
17562     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17563     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17564     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17565     for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17566         mem_base = xmlMemBlocks();
17567         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17568         name = gen_const_xmlChar_ptr(n_name, 1);
17569         ns = gen_const_xmlChar_ptr(n_ns, 2);
17570         nodeType = gen_int(n_nodeType, 3);
17571
17572         ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17573         desret_int(ret_val);
17574         call_tests++;
17575         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17576         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17577         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17578         des_int(n_nodeType, nodeType, 3);
17579         xmlResetLastError();
17580         if (mem_base != xmlMemBlocks()) {
17581             printf("Leak of %d blocks found in xmlStreamPushNode",
17582                    xmlMemBlocks() - mem_base);
17583             test_ret++;
17584             printf(" %d", n_stream);
17585             printf(" %d", n_name);
17586             printf(" %d", n_ns);
17587             printf(" %d", n_nodeType);
17588             printf("\n");
17589         }
17590     }
17591     }
17592     }
17593     }
17594     function_tests++;
17595 #endif
17596
17597     return(test_ret);
17598 }
17599
17600
17601 static int
17602 test_xmlStreamWantsAnyNode(void) {
17603     int test_ret = 0;
17604
17605 #if defined(LIBXML_PATTERN_ENABLED)
17606     int mem_base;
17607     int ret_val;
17608     xmlStreamCtxtPtr streamCtxt; /* the stream context */
17609     int n_streamCtxt;
17610
17611     for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17612         mem_base = xmlMemBlocks();
17613         streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17614
17615         ret_val = xmlStreamWantsAnyNode(streamCtxt);
17616         desret_int(ret_val);
17617         call_tests++;
17618         des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17619         xmlResetLastError();
17620         if (mem_base != xmlMemBlocks()) {
17621             printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17622                    xmlMemBlocks() - mem_base);
17623             test_ret++;
17624             printf(" %d", n_streamCtxt);
17625             printf("\n");
17626         }
17627     }
17628     function_tests++;
17629 #endif
17630
17631     return(test_ret);
17632 }
17633
17634 static int
17635 test_pattern(void) {
17636     int test_ret = 0;
17637         int rc = 0;
17638
17639     if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17640     rc = test_xmlPatternFromRoot();
17641         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17642     rc = test_xmlPatternGetStreamCtxt();
17643         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17644     rc = test_xmlPatternMatch();
17645         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17646     rc = test_xmlPatternMaxDepth();
17647         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17648     rc = test_xmlPatternMinDepth();
17649         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17650     rc = test_xmlPatternStreamable();
17651         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17652     rc = test_xmlPatterncompile();
17653         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17654     rc = test_xmlStreamPop();
17655         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17656     rc = test_xmlStreamPush();
17657         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17658     rc = test_xmlStreamPushAttr();
17659         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17660     rc = test_xmlStreamPushNode();
17661         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17662     rc = test_xmlStreamWantsAnyNode();
17663         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17664
17665     if (test_ret != 0)
17666         printf("Module pattern: %d errors\n", test_ret);
17667     return(test_ret);
17668 }
17669 #ifdef LIBXML_SCHEMAS_ENABLED
17670
17671 #define gen_nb_xmlRelaxNGPtr 1
17672 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17673     return(NULL);
17674 }
17675 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17676 }
17677 #endif
17678
17679
17680 static int
17681 test_xmlRelaxNGDump(void) {
17682     int test_ret = 0;
17683
17684 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17685     int mem_base;
17686     FILE * output; /* the file output */
17687     int n_output;
17688     xmlRelaxNGPtr schema; /* a schema structure */
17689     int n_schema;
17690
17691     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17692     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17693         mem_base = xmlMemBlocks();
17694         output = gen_FILE_ptr(n_output, 0);
17695         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17696
17697         xmlRelaxNGDump(output, schema);
17698         call_tests++;
17699         des_FILE_ptr(n_output, output, 0);
17700         des_xmlRelaxNGPtr(n_schema, schema, 1);
17701         xmlResetLastError();
17702         if (mem_base != xmlMemBlocks()) {
17703             printf("Leak of %d blocks found in xmlRelaxNGDump",
17704                    xmlMemBlocks() - mem_base);
17705             test_ret++;
17706             printf(" %d", n_output);
17707             printf(" %d", n_schema);
17708             printf("\n");
17709         }
17710     }
17711     }
17712     function_tests++;
17713 #endif
17714
17715     return(test_ret);
17716 }
17717
17718
17719 static int
17720 test_xmlRelaxNGDumpTree(void) {
17721     int test_ret = 0;
17722
17723 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17724     int mem_base;
17725     FILE * output; /* the file output */
17726     int n_output;
17727     xmlRelaxNGPtr schema; /* a schema structure */
17728     int n_schema;
17729
17730     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17731     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17732         mem_base = xmlMemBlocks();
17733         output = gen_FILE_ptr(n_output, 0);
17734         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17735
17736         xmlRelaxNGDumpTree(output, schema);
17737         call_tests++;
17738         des_FILE_ptr(n_output, output, 0);
17739         des_xmlRelaxNGPtr(n_schema, schema, 1);
17740         xmlResetLastError();
17741         if (mem_base != xmlMemBlocks()) {
17742             printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17743                    xmlMemBlocks() - mem_base);
17744             test_ret++;
17745             printf(" %d", n_output);
17746             printf(" %d", n_schema);
17747             printf("\n");
17748         }
17749     }
17750     }
17751     function_tests++;
17752 #endif
17753
17754     return(test_ret);
17755 }
17756
17757 #ifdef LIBXML_SCHEMAS_ENABLED
17758
17759 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17760 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17761     return(NULL);
17762 }
17763 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17764 }
17765 #endif
17766
17767 #ifdef LIBXML_SCHEMAS_ENABLED
17768
17769 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17770 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17771     return(NULL);
17772 }
17773 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17774 }
17775 #endif
17776
17777 #ifdef LIBXML_SCHEMAS_ENABLED
17778
17779 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17780 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17781     return(NULL);
17782 }
17783 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17784 }
17785 #endif
17786
17787
17788 static int
17789 test_xmlRelaxNGGetParserErrors(void) {
17790     int test_ret = 0;
17791
17792 #if defined(LIBXML_SCHEMAS_ENABLED)
17793     int mem_base;
17794     int ret_val;
17795     xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17796     int n_ctxt;
17797     xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17798     int n_err;
17799     xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17800     int n_warn;
17801     void ** ctx; /* contextual data for the callbacks result */
17802     int n_ctx;
17803
17804     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17805     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17806     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17807     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17808         mem_base = xmlMemBlocks();
17809         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17810         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17811         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17812         ctx = gen_void_ptr_ptr(n_ctx, 3);
17813
17814         ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17815         desret_int(ret_val);
17816         call_tests++;
17817         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17818         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17819         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17820         des_void_ptr_ptr(n_ctx, ctx, 3);
17821         xmlResetLastError();
17822         if (mem_base != xmlMemBlocks()) {
17823             printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17824                    xmlMemBlocks() - mem_base);
17825             test_ret++;
17826             printf(" %d", n_ctxt);
17827             printf(" %d", n_err);
17828             printf(" %d", n_warn);
17829             printf(" %d", n_ctx);
17830             printf("\n");
17831         }
17832     }
17833     }
17834     }
17835     }
17836     function_tests++;
17837 #endif
17838
17839     return(test_ret);
17840 }
17841
17842 #ifdef LIBXML_SCHEMAS_ENABLED
17843
17844 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17845 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17846     return(NULL);
17847 }
17848 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17849 }
17850 #endif
17851
17852
17853 static int
17854 test_xmlRelaxNGGetValidErrors(void) {
17855     int test_ret = 0;
17856
17857 #if defined(LIBXML_SCHEMAS_ENABLED)
17858     int mem_base;
17859     int ret_val;
17860     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17861     int n_ctxt;
17862     xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17863     int n_err;
17864     xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17865     int n_warn;
17866     void ** ctx; /* the functions context result */
17867     int n_ctx;
17868
17869     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17870     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17871     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17872     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17873         mem_base = xmlMemBlocks();
17874         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17875         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17876         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17877         ctx = gen_void_ptr_ptr(n_ctx, 3);
17878
17879         ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17880         desret_int(ret_val);
17881         call_tests++;
17882         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17883         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17884         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17885         des_void_ptr_ptr(n_ctx, ctx, 3);
17886         xmlResetLastError();
17887         if (mem_base != xmlMemBlocks()) {
17888             printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17889                    xmlMemBlocks() - mem_base);
17890             test_ret++;
17891             printf(" %d", n_ctxt);
17892             printf(" %d", n_err);
17893             printf(" %d", n_warn);
17894             printf(" %d", n_ctx);
17895             printf("\n");
17896         }
17897     }
17898     }
17899     }
17900     }
17901     function_tests++;
17902 #endif
17903
17904     return(test_ret);
17905 }
17906
17907
17908 static int
17909 test_xmlRelaxNGInitTypes(void) {
17910     int test_ret = 0;
17911
17912 #if defined(LIBXML_SCHEMAS_ENABLED)
17913     int mem_base;
17914     int ret_val;
17915
17916         mem_base = xmlMemBlocks();
17917
17918         ret_val = xmlRelaxNGInitTypes();
17919         desret_int(ret_val);
17920         call_tests++;
17921         xmlResetLastError();
17922         if (mem_base != xmlMemBlocks()) {
17923             printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17924                    xmlMemBlocks() - mem_base);
17925             test_ret++;
17926             printf("\n");
17927         }
17928     function_tests++;
17929 #endif
17930
17931     return(test_ret);
17932 }
17933
17934
17935 static int
17936 test_xmlRelaxNGNewDocParserCtxt(void) {
17937     int test_ret = 0;
17938
17939 #if defined(LIBXML_SCHEMAS_ENABLED)
17940     int mem_base;
17941     xmlRelaxNGParserCtxtPtr ret_val;
17942     xmlDocPtr doc; /* a preparsed document tree */
17943     int n_doc;
17944
17945     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17946         mem_base = xmlMemBlocks();
17947         doc = gen_xmlDocPtr(n_doc, 0);
17948
17949         ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17950         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17951         call_tests++;
17952         des_xmlDocPtr(n_doc, doc, 0);
17953         xmlResetLastError();
17954         if (mem_base != xmlMemBlocks()) {
17955             printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17956                    xmlMemBlocks() - mem_base);
17957             test_ret++;
17958             printf(" %d", n_doc);
17959             printf("\n");
17960         }
17961     }
17962     function_tests++;
17963 #endif
17964
17965     return(test_ret);
17966 }
17967
17968
17969 static int
17970 test_xmlRelaxNGNewMemParserCtxt(void) {
17971     int test_ret = 0;
17972
17973 #if defined(LIBXML_SCHEMAS_ENABLED)
17974     int mem_base;
17975     xmlRelaxNGParserCtxtPtr ret_val;
17976     char * buffer; /* a pointer to a char array containing the schemas */
17977     int n_buffer;
17978     int size; /* the size of the array */
17979     int n_size;
17980
17981     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17982     for (n_size = 0;n_size < gen_nb_int;n_size++) {
17983         mem_base = xmlMemBlocks();
17984         buffer = gen_const_char_ptr(n_buffer, 0);
17985         size = gen_int(n_size, 1);
17986
17987         ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17988         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17989         call_tests++;
17990         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17991         des_int(n_size, size, 1);
17992         xmlResetLastError();
17993         if (mem_base != xmlMemBlocks()) {
17994             printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17995                    xmlMemBlocks() - mem_base);
17996             test_ret++;
17997             printf(" %d", n_buffer);
17998             printf(" %d", n_size);
17999             printf("\n");
18000         }
18001     }
18002     }
18003     function_tests++;
18004 #endif
18005
18006     return(test_ret);
18007 }
18008
18009
18010 static int
18011 test_xmlRelaxNGNewParserCtxt(void) {
18012     int test_ret = 0;
18013
18014 #if defined(LIBXML_SCHEMAS_ENABLED)
18015     int mem_base;
18016     xmlRelaxNGParserCtxtPtr ret_val;
18017     char * URL; /* the location of the schema */
18018     int n_URL;
18019
18020     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
18021         mem_base = xmlMemBlocks();
18022         URL = gen_const_char_ptr(n_URL, 0);
18023
18024         ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
18025         desret_xmlRelaxNGParserCtxtPtr(ret_val);
18026         call_tests++;
18027         des_const_char_ptr(n_URL, (const char *)URL, 0);
18028         xmlResetLastError();
18029         if (mem_base != xmlMemBlocks()) {
18030             printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
18031                    xmlMemBlocks() - mem_base);
18032             test_ret++;
18033             printf(" %d", n_URL);
18034             printf("\n");
18035         }
18036     }
18037     function_tests++;
18038 #endif
18039
18040     return(test_ret);
18041 }
18042
18043
18044 static int
18045 test_xmlRelaxNGNewValidCtxt(void) {
18046     int test_ret = 0;
18047
18048
18049     /* missing type support */
18050     return(test_ret);
18051 }
18052
18053
18054 static int
18055 test_xmlRelaxNGParse(void) {
18056     int test_ret = 0;
18057
18058
18059     /* missing type support */
18060     return(test_ret);
18061 }
18062
18063
18064 static int
18065 test_xmlRelaxNGSetParserErrors(void) {
18066     int test_ret = 0;
18067
18068
18069     /* missing type support */
18070     return(test_ret);
18071 }
18072
18073
18074 static int
18075 test_xmlRelaxNGSetParserStructuredErrors(void) {
18076     int test_ret = 0;
18077
18078
18079     /* missing type support */
18080     return(test_ret);
18081 }
18082
18083
18084 static int
18085 test_xmlRelaxNGSetValidErrors(void) {
18086     int test_ret = 0;
18087
18088
18089     /* missing type support */
18090     return(test_ret);
18091 }
18092
18093
18094 static int
18095 test_xmlRelaxNGSetValidStructuredErrors(void) {
18096     int test_ret = 0;
18097
18098
18099     /* missing type support */
18100     return(test_ret);
18101 }
18102
18103
18104 static int
18105 test_xmlRelaxNGValidateDoc(void) {
18106     int test_ret = 0;
18107
18108 #if defined(LIBXML_SCHEMAS_ENABLED)
18109     int mem_base;
18110     int ret_val;
18111     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
18112     int n_ctxt;
18113     xmlDocPtr doc; /* a parsed document tree */
18114     int n_doc;
18115
18116     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18117     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18118         mem_base = xmlMemBlocks();
18119         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18120         doc = gen_xmlDocPtr(n_doc, 1);
18121
18122         ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
18123         desret_int(ret_val);
18124         call_tests++;
18125         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18126         des_xmlDocPtr(n_doc, doc, 1);
18127         xmlResetLastError();
18128         if (mem_base != xmlMemBlocks()) {
18129             printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
18130                    xmlMemBlocks() - mem_base);
18131             test_ret++;
18132             printf(" %d", n_ctxt);
18133             printf(" %d", n_doc);
18134             printf("\n");
18135         }
18136     }
18137     }
18138     function_tests++;
18139 #endif
18140
18141     return(test_ret);
18142 }
18143
18144
18145 static int
18146 test_xmlRelaxNGValidateFullElement(void) {
18147     int test_ret = 0;
18148
18149 #if defined(LIBXML_SCHEMAS_ENABLED)
18150     int mem_base;
18151     int ret_val;
18152     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
18153     int n_ctxt;
18154     xmlDocPtr doc; /* a document instance */
18155     int n_doc;
18156     xmlNodePtr elem; /* an element instance */
18157     int n_elem;
18158
18159     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18160     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18161     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
18162         mem_base = xmlMemBlocks();
18163         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18164         doc = gen_xmlDocPtr(n_doc, 1);
18165         elem = gen_xmlNodePtr(n_elem, 2);
18166
18167         ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
18168         desret_int(ret_val);
18169         call_tests++;
18170         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18171         des_xmlDocPtr(n_doc, doc, 1);
18172         des_xmlNodePtr(n_elem, elem, 2);
18173         xmlResetLastError();
18174         if (mem_base != xmlMemBlocks()) {
18175             printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
18176                    xmlMemBlocks() - mem_base);
18177             test_ret++;
18178             printf(" %d", n_ctxt);
18179             printf(" %d", n_doc);
18180             printf(" %d", n_elem);
18181             printf("\n");
18182         }
18183     }
18184     }
18185     }
18186     function_tests++;
18187 #endif
18188
18189     return(test_ret);
18190 }
18191
18192
18193 static int
18194 test_xmlRelaxNGValidatePopElement(void) {
18195     int test_ret = 0;
18196
18197 #if defined(LIBXML_SCHEMAS_ENABLED)
18198     int mem_base;
18199     int ret_val;
18200     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
18201     int n_ctxt;
18202     xmlDocPtr doc; /* a document instance */
18203     int n_doc;
18204     xmlNodePtr elem; /* an element instance */
18205     int n_elem;
18206
18207     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18208     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18209     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
18210         mem_base = xmlMemBlocks();
18211         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18212         doc = gen_xmlDocPtr(n_doc, 1);
18213         elem = gen_xmlNodePtr(n_elem, 2);
18214
18215         ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
18216         desret_int(ret_val);
18217         call_tests++;
18218         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18219         des_xmlDocPtr(n_doc, doc, 1);
18220         des_xmlNodePtr(n_elem, elem, 2);
18221         xmlResetLastError();
18222         if (mem_base != xmlMemBlocks()) {
18223             printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
18224                    xmlMemBlocks() - mem_base);
18225             test_ret++;
18226             printf(" %d", n_ctxt);
18227             printf(" %d", n_doc);
18228             printf(" %d", n_elem);
18229             printf("\n");
18230         }
18231     }
18232     }
18233     }
18234     function_tests++;
18235 #endif
18236
18237     return(test_ret);
18238 }
18239
18240
18241 static int
18242 test_xmlRelaxNGValidatePushCData(void) {
18243     int test_ret = 0;
18244
18245 #if defined(LIBXML_SCHEMAS_ENABLED)
18246     int mem_base;
18247     int ret_val;
18248     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
18249     int n_ctxt;
18250     xmlChar * data; /* some character data read */
18251     int n_data;
18252     int len; /* the length of the data */
18253     int n_len;
18254
18255     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18256     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
18257     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18258         mem_base = xmlMemBlocks();
18259         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18260         data = gen_const_xmlChar_ptr(n_data, 1);
18261         len = gen_int(n_len, 2);
18262
18263         ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
18264         desret_int(ret_val);
18265         call_tests++;
18266         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18267         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
18268         des_int(n_len, len, 2);
18269         xmlResetLastError();
18270         if (mem_base != xmlMemBlocks()) {
18271             printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
18272                    xmlMemBlocks() - mem_base);
18273             test_ret++;
18274             printf(" %d", n_ctxt);
18275             printf(" %d", n_data);
18276             printf(" %d", n_len);
18277             printf("\n");
18278         }
18279     }
18280     }
18281     }
18282     function_tests++;
18283 #endif
18284
18285     return(test_ret);
18286 }
18287
18288
18289 static int
18290 test_xmlRelaxNGValidatePushElement(void) {
18291     int test_ret = 0;
18292
18293 #if defined(LIBXML_SCHEMAS_ENABLED)
18294     int mem_base;
18295     int ret_val;
18296     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
18297     int n_ctxt;
18298     xmlDocPtr doc; /* a document instance */
18299     int n_doc;
18300     xmlNodePtr elem; /* an element instance */
18301     int n_elem;
18302
18303     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18304     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18305     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
18306         mem_base = xmlMemBlocks();
18307         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18308         doc = gen_xmlDocPtr(n_doc, 1);
18309         elem = gen_xmlNodePtr(n_elem, 2);
18310
18311         ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
18312         desret_int(ret_val);
18313         call_tests++;
18314         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18315         des_xmlDocPtr(n_doc, doc, 1);
18316         des_xmlNodePtr(n_elem, elem, 2);
18317         xmlResetLastError();
18318         if (mem_base != xmlMemBlocks()) {
18319             printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
18320                    xmlMemBlocks() - mem_base);
18321             test_ret++;
18322             printf(" %d", n_ctxt);
18323             printf(" %d", n_doc);
18324             printf(" %d", n_elem);
18325             printf("\n");
18326         }
18327     }
18328     }
18329     }
18330     function_tests++;
18331 #endif
18332
18333     return(test_ret);
18334 }
18335
18336
18337 static int
18338 test_xmlRelaxParserSetFlag(void) {
18339     int test_ret = 0;
18340
18341 #if defined(LIBXML_SCHEMAS_ENABLED)
18342     int mem_base;
18343     int ret_val;
18344     xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
18345     int n_ctxt;
18346     int flags; /* a set of flags values */
18347     int n_flags;
18348
18349     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
18350     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
18351         mem_base = xmlMemBlocks();
18352         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
18353         flags = gen_int(n_flags, 1);
18354
18355         ret_val = xmlRelaxParserSetFlag(ctxt, flags);
18356         desret_int(ret_val);
18357         call_tests++;
18358         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
18359         des_int(n_flags, flags, 1);
18360         xmlResetLastError();
18361         if (mem_base != xmlMemBlocks()) {
18362             printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
18363                    xmlMemBlocks() - mem_base);
18364             test_ret++;
18365             printf(" %d", n_ctxt);
18366             printf(" %d", n_flags);
18367             printf("\n");
18368         }
18369     }
18370     }
18371     function_tests++;
18372 #endif
18373
18374     return(test_ret);
18375 }
18376
18377 static int
18378 test_relaxng(void) {
18379     int test_ret = 0;
18380         int rc = 0;
18381
18382     if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
18383     rc = test_xmlRelaxNGDump();
18384         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18385     rc = test_xmlRelaxNGDumpTree();
18386         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18387     rc = test_xmlRelaxNGGetParserErrors();
18388         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18389     rc = test_xmlRelaxNGGetValidErrors();
18390         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18391     rc = test_xmlRelaxNGInitTypes();
18392         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18393     rc = test_xmlRelaxNGNewDocParserCtxt();
18394         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18395     rc = test_xmlRelaxNGNewMemParserCtxt();
18396         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18397     rc = test_xmlRelaxNGNewParserCtxt();
18398         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18399     rc = test_xmlRelaxNGNewValidCtxt();
18400         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18401     rc = test_xmlRelaxNGParse();
18402         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18403     rc = test_xmlRelaxNGSetParserErrors();
18404         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18405     rc = test_xmlRelaxNGSetParserStructuredErrors();
18406         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18407     rc = test_xmlRelaxNGSetValidErrors();
18408         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18409     rc = test_xmlRelaxNGSetValidStructuredErrors();
18410         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18411     rc = test_xmlRelaxNGValidateDoc();
18412         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18413     rc = test_xmlRelaxNGValidateFullElement();
18414         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18415     rc = test_xmlRelaxNGValidatePopElement();
18416         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18417     rc = test_xmlRelaxNGValidatePushCData();
18418         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18419     rc = test_xmlRelaxNGValidatePushElement();
18420         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18421     rc = test_xmlRelaxParserSetFlag();
18422         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18423
18424     if (test_ret != 0)
18425         printf("Module relaxng: %d errors\n", test_ret);
18426     return(test_ret);
18427 }
18428 static int
18429 test_schemasInternals(void) {
18430     int test_ret = 0;
18431
18432     if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18433
18434     if (test_ret != 0)
18435         printf("Module schemasInternals: %d errors\n", test_ret);
18436     return(test_ret);
18437 }
18438
18439 static int
18440 test_xmlSchematronNewDocParserCtxt(void) {
18441     int test_ret = 0;
18442
18443
18444     /* missing type support */
18445     return(test_ret);
18446 }
18447
18448
18449 static int
18450 test_xmlSchematronNewMemParserCtxt(void) {
18451     int test_ret = 0;
18452
18453
18454     /* missing type support */
18455     return(test_ret);
18456 }
18457
18458
18459 static int
18460 test_xmlSchematronNewParserCtxt(void) {
18461     int test_ret = 0;
18462
18463
18464     /* missing type support */
18465     return(test_ret);
18466 }
18467
18468 #ifdef LIBXML_SCHEMATRON_ENABLED
18469
18470 #define gen_nb_xmlSchematronPtr 1
18471 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18472     return(NULL);
18473 }
18474 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18475 }
18476 #endif
18477
18478
18479 static int
18480 test_xmlSchematronNewValidCtxt(void) {
18481     int test_ret = 0;
18482
18483
18484     /* missing type support */
18485     return(test_ret);
18486 }
18487
18488 #ifdef LIBXML_SCHEMATRON_ENABLED
18489
18490 #define gen_nb_xmlSchematronParserCtxtPtr 1
18491 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18492     return(NULL);
18493 }
18494 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18495 }
18496 #endif
18497
18498
18499 static int
18500 test_xmlSchematronParse(void) {
18501     int test_ret = 0;
18502
18503
18504     /* missing type support */
18505     return(test_ret);
18506 }
18507
18508 #ifdef LIBXML_SCHEMATRON_ENABLED
18509
18510 #define gen_nb_xmlSchematronValidCtxtPtr 1
18511 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18512     return(NULL);
18513 }
18514 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18515 }
18516 #endif
18517
18518
18519 static int
18520 test_xmlSchematronSetValidStructuredErrors(void) {
18521     int test_ret = 0;
18522
18523
18524     /* missing type support */
18525     return(test_ret);
18526 }
18527
18528
18529 static int
18530 test_xmlSchematronValidateDoc(void) {
18531     int test_ret = 0;
18532
18533 #if defined(LIBXML_SCHEMATRON_ENABLED)
18534     int mem_base;
18535     int ret_val;
18536     xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18537     int n_ctxt;
18538     xmlDocPtr instance; /* the document instace tree */
18539     int n_instance;
18540
18541     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18542     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18543         mem_base = xmlMemBlocks();
18544         ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18545         instance = gen_xmlDocPtr(n_instance, 1);
18546
18547         ret_val = xmlSchematronValidateDoc(ctxt, instance);
18548         desret_int(ret_val);
18549         call_tests++;
18550         des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18551         des_xmlDocPtr(n_instance, instance, 1);
18552         xmlResetLastError();
18553         if (mem_base != xmlMemBlocks()) {
18554             printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18555                    xmlMemBlocks() - mem_base);
18556             test_ret++;
18557             printf(" %d", n_ctxt);
18558             printf(" %d", n_instance);
18559             printf("\n");
18560         }
18561     }
18562     }
18563     function_tests++;
18564 #endif
18565
18566     return(test_ret);
18567 }
18568
18569 static int
18570 test_schematron(void) {
18571     int test_ret = 0;
18572         int rc = 0;
18573
18574     if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18575     rc = test_xmlSchematronNewDocParserCtxt();
18576         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18577     rc = test_xmlSchematronNewMemParserCtxt();
18578         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18579     rc = test_xmlSchematronNewParserCtxt();
18580         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18581     rc = test_xmlSchematronNewValidCtxt();
18582         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18583     rc = test_xmlSchematronParse();
18584         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18585     rc = test_xmlSchematronSetValidStructuredErrors();
18586         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18587     rc = test_xmlSchematronValidateDoc();
18588         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18589
18590     if (test_ret != 0)
18591         printf("Module schematron: %d errors\n", test_ret);
18592     return(test_ret);
18593 }
18594
18595 static int
18596 test_xmlAddChild(void) {
18597     int test_ret = 0;
18598
18599     int mem_base;
18600     xmlNodePtr ret_val;
18601     xmlNodePtr parent; /* the parent node */
18602     int n_parent;
18603     xmlNodePtr cur; /* the child node */
18604     int n_cur;
18605
18606     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18607     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18608         mem_base = xmlMemBlocks();
18609         parent = gen_xmlNodePtr(n_parent, 0);
18610         cur = gen_xmlNodePtr_in(n_cur, 1);
18611
18612         ret_val = xmlAddChild(parent, cur);
18613         if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18614         desret_xmlNodePtr(ret_val);
18615         call_tests++;
18616         des_xmlNodePtr(n_parent, parent, 0);
18617         des_xmlNodePtr_in(n_cur, cur, 1);
18618         xmlResetLastError();
18619         if (mem_base != xmlMemBlocks()) {
18620             printf("Leak of %d blocks found in xmlAddChild",
18621                    xmlMemBlocks() - mem_base);
18622             test_ret++;
18623             printf(" %d", n_parent);
18624             printf(" %d", n_cur);
18625             printf("\n");
18626         }
18627     }
18628     }
18629     function_tests++;
18630
18631     return(test_ret);
18632 }
18633
18634
18635 static int
18636 test_xmlAddChildList(void) {
18637     int test_ret = 0;
18638
18639     int mem_base;
18640     xmlNodePtr ret_val;
18641     xmlNodePtr parent; /* the parent node */
18642     int n_parent;
18643     xmlNodePtr cur; /* the first node in the list */
18644     int n_cur;
18645
18646     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18647     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18648         mem_base = xmlMemBlocks();
18649         parent = gen_xmlNodePtr(n_parent, 0);
18650         cur = gen_xmlNodePtr_in(n_cur, 1);
18651
18652         ret_val = xmlAddChildList(parent, cur);
18653         if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18654         desret_xmlNodePtr(ret_val);
18655         call_tests++;
18656         des_xmlNodePtr(n_parent, parent, 0);
18657         des_xmlNodePtr_in(n_cur, cur, 1);
18658         xmlResetLastError();
18659         if (mem_base != xmlMemBlocks()) {
18660             printf("Leak of %d blocks found in xmlAddChildList",
18661                    xmlMemBlocks() - mem_base);
18662             test_ret++;
18663             printf(" %d", n_parent);
18664             printf(" %d", n_cur);
18665             printf("\n");
18666         }
18667     }
18668     }
18669     function_tests++;
18670
18671     return(test_ret);
18672 }
18673
18674
18675 static int
18676 test_xmlAddNextSibling(void) {
18677     int test_ret = 0;
18678
18679     int mem_base;
18680     xmlNodePtr ret_val;
18681     xmlNodePtr cur; /* the child node */
18682     int n_cur;
18683     xmlNodePtr elem; /* the new node */
18684     int n_elem;
18685
18686     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18687     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18688         mem_base = xmlMemBlocks();
18689         cur = gen_xmlNodePtr(n_cur, 0);
18690         elem = gen_xmlNodePtr_in(n_elem, 1);
18691
18692         ret_val = xmlAddNextSibling(cur, elem);
18693         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18694         desret_xmlNodePtr(ret_val);
18695         call_tests++;
18696         des_xmlNodePtr(n_cur, cur, 0);
18697         des_xmlNodePtr_in(n_elem, elem, 1);
18698         xmlResetLastError();
18699         if (mem_base != xmlMemBlocks()) {
18700             printf("Leak of %d blocks found in xmlAddNextSibling",
18701                    xmlMemBlocks() - mem_base);
18702             test_ret++;
18703             printf(" %d", n_cur);
18704             printf(" %d", n_elem);
18705             printf("\n");
18706         }
18707     }
18708     }
18709     function_tests++;
18710
18711     return(test_ret);
18712 }
18713
18714
18715 static int
18716 test_xmlAddPrevSibling(void) {
18717     int test_ret = 0;
18718
18719 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
18720     int mem_base;
18721     xmlNodePtr ret_val;
18722     xmlNodePtr cur; /* the child node */
18723     int n_cur;
18724     xmlNodePtr elem; /* the new node */
18725     int n_elem;
18726
18727     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18728     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18729         mem_base = xmlMemBlocks();
18730         cur = gen_xmlNodePtr(n_cur, 0);
18731         elem = gen_xmlNodePtr_in(n_elem, 1);
18732
18733         ret_val = xmlAddPrevSibling(cur, elem);
18734         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18735         desret_xmlNodePtr(ret_val);
18736         call_tests++;
18737         des_xmlNodePtr(n_cur, cur, 0);
18738         des_xmlNodePtr_in(n_elem, elem, 1);
18739         xmlResetLastError();
18740         if (mem_base != xmlMemBlocks()) {
18741             printf("Leak of %d blocks found in xmlAddPrevSibling",
18742                    xmlMemBlocks() - mem_base);
18743             test_ret++;
18744             printf(" %d", n_cur);
18745             printf(" %d", n_elem);
18746             printf("\n");
18747         }
18748     }
18749     }
18750     function_tests++;
18751 #endif
18752
18753     return(test_ret);
18754 }
18755
18756
18757 static int
18758 test_xmlAddSibling(void) {
18759     int test_ret = 0;
18760
18761     int mem_base;
18762     xmlNodePtr ret_val;
18763     xmlNodePtr cur; /* the child node */
18764     int n_cur;
18765     xmlNodePtr elem; /* the new node */
18766     int n_elem;
18767
18768     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18769     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18770         mem_base = xmlMemBlocks();
18771         cur = gen_xmlNodePtr(n_cur, 0);
18772         elem = gen_xmlNodePtr_in(n_elem, 1);
18773
18774         ret_val = xmlAddSibling(cur, elem);
18775         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18776         desret_xmlNodePtr(ret_val);
18777         call_tests++;
18778         des_xmlNodePtr(n_cur, cur, 0);
18779         des_xmlNodePtr_in(n_elem, elem, 1);
18780         xmlResetLastError();
18781         if (mem_base != xmlMemBlocks()) {
18782             printf("Leak of %d blocks found in xmlAddSibling",
18783                    xmlMemBlocks() - mem_base);
18784             test_ret++;
18785             printf(" %d", n_cur);
18786             printf(" %d", n_elem);
18787             printf("\n");
18788         }
18789     }
18790     }
18791     function_tests++;
18792
18793     return(test_ret);
18794 }
18795
18796
18797 static int
18798 test_xmlAttrSerializeTxtContent(void) {
18799     int test_ret = 0;
18800
18801 #if defined(LIBXML_OUTPUT_ENABLED)
18802 #ifdef LIBXML_OUTPUT_ENABLED
18803     int mem_base;
18804     xmlBufferPtr buf; /* the XML buffer output */
18805     int n_buf;
18806     xmlDocPtr doc; /* the document */
18807     int n_doc;
18808     xmlAttrPtr attr; /* the attribute node */
18809     int n_attr;
18810     xmlChar * string; /* the text content */
18811     int n_string;
18812
18813     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18814     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18815     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18816     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18817         mem_base = xmlMemBlocks();
18818         buf = gen_xmlBufferPtr(n_buf, 0);
18819         doc = gen_xmlDocPtr(n_doc, 1);
18820         attr = gen_xmlAttrPtr(n_attr, 2);
18821         string = gen_const_xmlChar_ptr(n_string, 3);
18822
18823         xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18824         call_tests++;
18825         des_xmlBufferPtr(n_buf, buf, 0);
18826         des_xmlDocPtr(n_doc, doc, 1);
18827         des_xmlAttrPtr(n_attr, attr, 2);
18828         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18829         xmlResetLastError();
18830         if (mem_base != xmlMemBlocks()) {
18831             printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18832                    xmlMemBlocks() - mem_base);
18833             test_ret++;
18834             printf(" %d", n_buf);
18835             printf(" %d", n_doc);
18836             printf(" %d", n_attr);
18837             printf(" %d", n_string);
18838             printf("\n");
18839         }
18840     }
18841     }
18842     }
18843     }
18844     function_tests++;
18845 #endif
18846 #endif
18847
18848     return(test_ret);
18849 }
18850
18851
18852 #define gen_nb_const_xmlBuf_ptr 1
18853 static xmlBuf * gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18854     return(NULL);
18855 }
18856 static void des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, const xmlBuf * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18857 }
18858
18859 static int
18860 test_xmlBufContent(void) {
18861     int test_ret = 0;
18862
18863     int mem_base;
18864     xmlChar * ret_val;
18865     xmlBuf * buf; /* the buffer */
18866     int n_buf;
18867
18868     for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
18869         mem_base = xmlMemBlocks();
18870         buf = gen_const_xmlBuf_ptr(n_buf, 0);
18871
18872         ret_val = xmlBufContent((const xmlBuf *)buf);
18873         desret_xmlChar_ptr(ret_val);
18874         call_tests++;
18875         des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0);
18876         xmlResetLastError();
18877         if (mem_base != xmlMemBlocks()) {
18878             printf("Leak of %d blocks found in xmlBufContent",
18879                    xmlMemBlocks() - mem_base);
18880             test_ret++;
18881             printf(" %d", n_buf);
18882             printf("\n");
18883         }
18884     }
18885     function_tests++;
18886
18887     return(test_ret);
18888 }
18889
18890
18891 #define gen_nb_xmlBufPtr 1
18892 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18893     return(NULL);
18894 }
18895 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18896 }
18897
18898 static int
18899 test_xmlBufEnd(void) {
18900     int test_ret = 0;
18901
18902     int mem_base;
18903     xmlChar * ret_val;
18904     xmlBufPtr buf; /* the buffer */
18905     int n_buf;
18906
18907     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18908         mem_base = xmlMemBlocks();
18909         buf = gen_xmlBufPtr(n_buf, 0);
18910
18911         ret_val = xmlBufEnd(buf);
18912         desret_xmlChar_ptr(ret_val);
18913         call_tests++;
18914         des_xmlBufPtr(n_buf, buf, 0);
18915         xmlResetLastError();
18916         if (mem_base != xmlMemBlocks()) {
18917             printf("Leak of %d blocks found in xmlBufEnd",
18918                    xmlMemBlocks() - mem_base);
18919             test_ret++;
18920             printf(" %d", n_buf);
18921             printf("\n");
18922         }
18923     }
18924     function_tests++;
18925
18926     return(test_ret);
18927 }
18928
18929
18930 #define gen_nb_const_xmlNode_ptr 1
18931 static xmlNode * gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18932     return(NULL);
18933 }
18934 static void des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, const xmlNode * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18935 }
18936
18937 static int
18938 test_xmlBufGetNodeContent(void) {
18939     int test_ret = 0;
18940
18941     int mem_base;
18942     int ret_val;
18943     xmlBufPtr buf; /* a buffer xmlBufPtr */
18944     int n_buf;
18945     xmlNode * cur; /* the node being read */
18946     int n_cur;
18947
18948     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18949     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
18950         mem_base = xmlMemBlocks();
18951         buf = gen_xmlBufPtr(n_buf, 0);
18952         cur = gen_const_xmlNode_ptr(n_cur, 1);
18953
18954         ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur);
18955         desret_int(ret_val);
18956         call_tests++;
18957         des_xmlBufPtr(n_buf, buf, 0);
18958         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
18959         xmlResetLastError();
18960         if (mem_base != xmlMemBlocks()) {
18961             printf("Leak of %d blocks found in xmlBufGetNodeContent",
18962                    xmlMemBlocks() - mem_base);
18963             test_ret++;
18964             printf(" %d", n_buf);
18965             printf(" %d", n_cur);
18966             printf("\n");
18967         }
18968     }
18969     }
18970     function_tests++;
18971
18972     return(test_ret);
18973 }
18974
18975
18976 static int
18977 test_xmlBufNodeDump(void) {
18978     int test_ret = 0;
18979
18980
18981     /* missing type support */
18982     return(test_ret);
18983 }
18984
18985
18986 static int
18987 test_xmlBufShrink(void) {
18988     int test_ret = 0;
18989
18990
18991     /* missing type support */
18992     return(test_ret);
18993 }
18994
18995
18996 #define gen_nb_const_xmlBufPtr 1
18997 static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18998     return(NULL);
18999 }
19000 static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19001 }
19002
19003 static int
19004 test_xmlBufUse(void) {
19005     int test_ret = 0;
19006
19007
19008     /* missing type support */
19009     return(test_ret);
19010 }
19011
19012
19013 static int
19014 test_xmlBufferAdd(void) {
19015     int test_ret = 0;
19016
19017     int mem_base;
19018     int ret_val;
19019     xmlBufferPtr buf; /* the buffer to dump */
19020     int n_buf;
19021     xmlChar * str; /* the #xmlChar string */
19022     int n_str;
19023     int len; /* the number of #xmlChar to add */
19024     int n_len;
19025
19026     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19027     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
19028     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19029         mem_base = xmlMemBlocks();
19030         buf = gen_xmlBufferPtr(n_buf, 0);
19031         str = gen_const_xmlChar_ptr(n_str, 1);
19032         len = gen_int(n_len, 2);
19033
19034         ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
19035         desret_int(ret_val);
19036         call_tests++;
19037         des_xmlBufferPtr(n_buf, buf, 0);
19038         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
19039         des_int(n_len, len, 2);
19040         xmlResetLastError();
19041         if (mem_base != xmlMemBlocks()) {
19042             printf("Leak of %d blocks found in xmlBufferAdd",
19043                    xmlMemBlocks() - mem_base);
19044             test_ret++;
19045             printf(" %d", n_buf);
19046             printf(" %d", n_str);
19047             printf(" %d", n_len);
19048             printf("\n");
19049         }
19050     }
19051     }
19052     }
19053     function_tests++;
19054
19055     return(test_ret);
19056 }
19057
19058
19059 static int
19060 test_xmlBufferAddHead(void) {
19061     int test_ret = 0;
19062
19063     int mem_base;
19064     int ret_val;
19065     xmlBufferPtr buf; /* the buffer */
19066     int n_buf;
19067     xmlChar * str; /* the #xmlChar string */
19068     int n_str;
19069     int len; /* the number of #xmlChar to add */
19070     int n_len;
19071
19072     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19073     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
19074     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19075         mem_base = xmlMemBlocks();
19076         buf = gen_xmlBufferPtr(n_buf, 0);
19077         str = gen_const_xmlChar_ptr(n_str, 1);
19078         len = gen_int(n_len, 2);
19079
19080         ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
19081         desret_int(ret_val);
19082         call_tests++;
19083         des_xmlBufferPtr(n_buf, buf, 0);
19084         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
19085         des_int(n_len, len, 2);
19086         xmlResetLastError();
19087         if (mem_base != xmlMemBlocks()) {
19088             printf("Leak of %d blocks found in xmlBufferAddHead",
19089                    xmlMemBlocks() - mem_base);
19090             test_ret++;
19091             printf(" %d", n_buf);
19092             printf(" %d", n_str);
19093             printf(" %d", n_len);
19094             printf("\n");
19095         }
19096     }
19097     }
19098     }
19099     function_tests++;
19100
19101     return(test_ret);
19102 }
19103
19104
19105 static int
19106 test_xmlBufferCCat(void) {
19107     int test_ret = 0;
19108
19109     int mem_base;
19110     int ret_val;
19111     xmlBufferPtr buf; /* the buffer to dump */
19112     int n_buf;
19113     char * str; /* the C char string */
19114     int n_str;
19115
19116     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19117     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
19118         mem_base = xmlMemBlocks();
19119         buf = gen_xmlBufferPtr(n_buf, 0);
19120         str = gen_const_char_ptr(n_str, 1);
19121
19122         ret_val = xmlBufferCCat(buf, (const char *)str);
19123         desret_int(ret_val);
19124         call_tests++;
19125         des_xmlBufferPtr(n_buf, buf, 0);
19126         des_const_char_ptr(n_str, (const char *)str, 1);
19127         xmlResetLastError();
19128         if (mem_base != xmlMemBlocks()) {
19129             printf("Leak of %d blocks found in xmlBufferCCat",
19130                    xmlMemBlocks() - mem_base);
19131             test_ret++;
19132             printf(" %d", n_buf);
19133             printf(" %d", n_str);
19134             printf("\n");
19135         }
19136     }
19137     }
19138     function_tests++;
19139
19140     return(test_ret);
19141 }
19142
19143
19144 static int
19145 test_xmlBufferCat(void) {
19146     int test_ret = 0;
19147
19148     int mem_base;
19149     int ret_val;
19150     xmlBufferPtr buf; /* the buffer to add to */
19151     int n_buf;
19152     xmlChar * str; /* the #xmlChar string */
19153     int n_str;
19154
19155     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19156     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
19157         mem_base = xmlMemBlocks();
19158         buf = gen_xmlBufferPtr(n_buf, 0);
19159         str = gen_const_xmlChar_ptr(n_str, 1);
19160
19161         ret_val = xmlBufferCat(buf, (const xmlChar *)str);
19162         desret_int(ret_val);
19163         call_tests++;
19164         des_xmlBufferPtr(n_buf, buf, 0);
19165         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
19166         xmlResetLastError();
19167         if (mem_base != xmlMemBlocks()) {
19168             printf("Leak of %d blocks found in xmlBufferCat",
19169                    xmlMemBlocks() - mem_base);
19170             test_ret++;
19171             printf(" %d", n_buf);
19172             printf(" %d", n_str);
19173             printf("\n");
19174         }
19175     }
19176     }
19177     function_tests++;
19178
19179     return(test_ret);
19180 }
19181
19182
19183 #define gen_nb_const_xmlBuffer_ptr 1
19184 static xmlBuffer * gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19185     return(NULL);
19186 }
19187 static void des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, const xmlBuffer * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19188 }
19189
19190 static int
19191 test_xmlBufferContent(void) {
19192     int test_ret = 0;
19193
19194     int mem_base;
19195     const xmlChar * ret_val;
19196     xmlBuffer * buf; /* the buffer */
19197     int n_buf;
19198
19199     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
19200         mem_base = xmlMemBlocks();
19201         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
19202
19203         ret_val = xmlBufferContent((const xmlBuffer *)buf);
19204         desret_const_xmlChar_ptr(ret_val);
19205         call_tests++;
19206         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
19207         xmlResetLastError();
19208         if (mem_base != xmlMemBlocks()) {
19209             printf("Leak of %d blocks found in xmlBufferContent",
19210                    xmlMemBlocks() - mem_base);
19211             test_ret++;
19212             printf(" %d", n_buf);
19213             printf("\n");
19214         }
19215     }
19216     function_tests++;
19217
19218     return(test_ret);
19219 }
19220
19221
19222 static int
19223 test_xmlBufferCreate(void) {
19224     int test_ret = 0;
19225
19226     int mem_base;
19227     xmlBufferPtr ret_val;
19228
19229         mem_base = xmlMemBlocks();
19230
19231         ret_val = xmlBufferCreate();
19232         desret_xmlBufferPtr(ret_val);
19233         call_tests++;
19234         xmlResetLastError();
19235         if (mem_base != xmlMemBlocks()) {
19236             printf("Leak of %d blocks found in xmlBufferCreate",
19237                    xmlMemBlocks() - mem_base);
19238             test_ret++;
19239             printf("\n");
19240         }
19241     function_tests++;
19242
19243     return(test_ret);
19244 }
19245
19246
19247 static int
19248 test_xmlBufferCreateSize(void) {
19249     int test_ret = 0;
19250
19251
19252     /* missing type support */
19253     return(test_ret);
19254 }
19255
19256
19257 static int
19258 test_xmlBufferCreateStatic(void) {
19259     int test_ret = 0;
19260
19261
19262     /* missing type support */
19263     return(test_ret);
19264 }
19265
19266
19267 static int
19268 test_xmlBufferDetach(void) {
19269     int test_ret = 0;
19270
19271     int mem_base;
19272     xmlChar * ret_val;
19273     xmlBufferPtr buf; /* the buffer */
19274     int n_buf;
19275
19276     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19277         mem_base = xmlMemBlocks();
19278         buf = gen_xmlBufferPtr(n_buf, 0);
19279
19280         ret_val = xmlBufferDetach(buf);
19281         desret_xmlChar_ptr(ret_val);
19282         call_tests++;
19283         des_xmlBufferPtr(n_buf, buf, 0);
19284         xmlResetLastError();
19285         if (mem_base != xmlMemBlocks()) {
19286             printf("Leak of %d blocks found in xmlBufferDetach",
19287                    xmlMemBlocks() - mem_base);
19288             test_ret++;
19289             printf(" %d", n_buf);
19290             printf("\n");
19291         }
19292     }
19293     function_tests++;
19294
19295     return(test_ret);
19296 }
19297
19298
19299 static int
19300 test_xmlBufferEmpty(void) {
19301     int test_ret = 0;
19302
19303     int mem_base;
19304     xmlBufferPtr buf; /* the buffer */
19305     int n_buf;
19306
19307     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19308         mem_base = xmlMemBlocks();
19309         buf = gen_xmlBufferPtr(n_buf, 0);
19310
19311         xmlBufferEmpty(buf);
19312         call_tests++;
19313         des_xmlBufferPtr(n_buf, buf, 0);
19314         xmlResetLastError();
19315         if (mem_base != xmlMemBlocks()) {
19316             printf("Leak of %d blocks found in xmlBufferEmpty",
19317                    xmlMemBlocks() - mem_base);
19318             test_ret++;
19319             printf(" %d", n_buf);
19320             printf("\n");
19321         }
19322     }
19323     function_tests++;
19324
19325     return(test_ret);
19326 }
19327
19328
19329 static int
19330 test_xmlBufferGrow(void) {
19331     int test_ret = 0;
19332
19333     int mem_base;
19334     int ret_val;
19335     xmlBufferPtr buf; /* the buffer */
19336     int n_buf;
19337     unsigned int len; /* the minimum free size to allocate */
19338     int n_len;
19339
19340     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19341     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19342         mem_base = xmlMemBlocks();
19343         buf = gen_xmlBufferPtr(n_buf, 0);
19344         len = gen_unsigned_int(n_len, 1);
19345
19346         ret_val = xmlBufferGrow(buf, len);
19347         desret_int(ret_val);
19348         call_tests++;
19349         des_xmlBufferPtr(n_buf, buf, 0);
19350         des_unsigned_int(n_len, len, 1);
19351         xmlResetLastError();
19352         if (mem_base != xmlMemBlocks()) {
19353             printf("Leak of %d blocks found in xmlBufferGrow",
19354                    xmlMemBlocks() - mem_base);
19355             test_ret++;
19356             printf(" %d", n_buf);
19357             printf(" %d", n_len);
19358             printf("\n");
19359         }
19360     }
19361     }
19362     function_tests++;
19363
19364     return(test_ret);
19365 }
19366
19367
19368 static int
19369 test_xmlBufferLength(void) {
19370     int test_ret = 0;
19371
19372     int mem_base;
19373     int ret_val;
19374     xmlBuffer * buf; /* the buffer */
19375     int n_buf;
19376
19377     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
19378         mem_base = xmlMemBlocks();
19379         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
19380
19381         ret_val = xmlBufferLength((const xmlBuffer *)buf);
19382         desret_int(ret_val);
19383         call_tests++;
19384         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
19385         xmlResetLastError();
19386         if (mem_base != xmlMemBlocks()) {
19387             printf("Leak of %d blocks found in xmlBufferLength",
19388                    xmlMemBlocks() - mem_base);
19389             test_ret++;
19390             printf(" %d", n_buf);
19391             printf("\n");
19392         }
19393     }
19394     function_tests++;
19395
19396     return(test_ret);
19397 }
19398
19399
19400 static int
19401 test_xmlBufferResize(void) {
19402     int test_ret = 0;
19403
19404     int mem_base;
19405     int ret_val;
19406     xmlBufferPtr buf; /* the buffer to resize */
19407     int n_buf;
19408     unsigned int size; /* the desired size */
19409     int n_size;
19410
19411     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19412     for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
19413         mem_base = xmlMemBlocks();
19414         buf = gen_xmlBufferPtr(n_buf, 0);
19415         size = gen_unsigned_int(n_size, 1);
19416
19417         ret_val = xmlBufferResize(buf, size);
19418         desret_int(ret_val);
19419         call_tests++;
19420         des_xmlBufferPtr(n_buf, buf, 0);
19421         des_unsigned_int(n_size, size, 1);
19422         xmlResetLastError();
19423         if (mem_base != xmlMemBlocks()) {
19424             printf("Leak of %d blocks found in xmlBufferResize",
19425                    xmlMemBlocks() - mem_base);
19426             test_ret++;
19427             printf(" %d", n_buf);
19428             printf(" %d", n_size);
19429             printf("\n");
19430         }
19431     }
19432     }
19433     function_tests++;
19434
19435     return(test_ret);
19436 }
19437
19438
19439 static int
19440 test_xmlBufferSetAllocationScheme(void) {
19441     int test_ret = 0;
19442
19443     int mem_base;
19444     xmlBufferPtr buf; /* the buffer to tune */
19445     int n_buf;
19446     xmlBufferAllocationScheme scheme; /* allocation scheme to use */
19447     int n_scheme;
19448
19449     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19450     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
19451         mem_base = xmlMemBlocks();
19452         buf = gen_xmlBufferPtr(n_buf, 0);
19453         scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
19454
19455         xmlBufferSetAllocationScheme(buf, scheme);
19456         if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
19457         call_tests++;
19458         des_xmlBufferPtr(n_buf, buf, 0);
19459         des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
19460         xmlResetLastError();
19461         if (mem_base != xmlMemBlocks()) {
19462             printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
19463                    xmlMemBlocks() - mem_base);
19464             test_ret++;
19465             printf(" %d", n_buf);
19466             printf(" %d", n_scheme);
19467             printf("\n");
19468         }
19469     }
19470     }
19471     function_tests++;
19472
19473     return(test_ret);
19474 }
19475
19476
19477 static int
19478 test_xmlBufferShrink(void) {
19479     int test_ret = 0;
19480
19481     int mem_base;
19482     int ret_val;
19483     xmlBufferPtr buf; /* the buffer to dump */
19484     int n_buf;
19485     unsigned int len; /* the number of xmlChar to remove */
19486     int n_len;
19487
19488     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19489     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19490         mem_base = xmlMemBlocks();
19491         buf = gen_xmlBufferPtr(n_buf, 0);
19492         len = gen_unsigned_int(n_len, 1);
19493
19494         ret_val = xmlBufferShrink(buf, len);
19495         desret_int(ret_val);
19496         call_tests++;
19497         des_xmlBufferPtr(n_buf, buf, 0);
19498         des_unsigned_int(n_len, len, 1);
19499         xmlResetLastError();
19500         if (mem_base != xmlMemBlocks()) {
19501             printf("Leak of %d blocks found in xmlBufferShrink",
19502                    xmlMemBlocks() - mem_base);
19503             test_ret++;
19504             printf(" %d", n_buf);
19505             printf(" %d", n_len);
19506             printf("\n");
19507         }
19508     }
19509     }
19510     function_tests++;
19511
19512     return(test_ret);
19513 }
19514
19515
19516 static int
19517 test_xmlBufferWriteCHAR(void) {
19518     int test_ret = 0;
19519
19520     int mem_base;
19521     xmlBufferPtr buf; /* the XML buffer */
19522     int n_buf;
19523     xmlChar * string; /* the string to add */
19524     int n_string;
19525
19526     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19527     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19528         mem_base = xmlMemBlocks();
19529         buf = gen_xmlBufferPtr(n_buf, 0);
19530         string = gen_const_xmlChar_ptr(n_string, 1);
19531
19532         xmlBufferWriteCHAR(buf, (const xmlChar *)string);
19533         call_tests++;
19534         des_xmlBufferPtr(n_buf, buf, 0);
19535         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19536         xmlResetLastError();
19537         if (mem_base != xmlMemBlocks()) {
19538             printf("Leak of %d blocks found in xmlBufferWriteCHAR",
19539                    xmlMemBlocks() - mem_base);
19540             test_ret++;
19541             printf(" %d", n_buf);
19542             printf(" %d", n_string);
19543             printf("\n");
19544         }
19545     }
19546     }
19547     function_tests++;
19548
19549     return(test_ret);
19550 }
19551
19552
19553 static int
19554 test_xmlBufferWriteChar(void) {
19555     int test_ret = 0;
19556
19557     int mem_base;
19558     xmlBufferPtr buf; /* the XML buffer output */
19559     int n_buf;
19560     char * string; /* the string to add */
19561     int n_string;
19562
19563     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19564     for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
19565         mem_base = xmlMemBlocks();
19566         buf = gen_xmlBufferPtr(n_buf, 0);
19567         string = gen_const_char_ptr(n_string, 1);
19568
19569         xmlBufferWriteChar(buf, (const char *)string);
19570         call_tests++;
19571         des_xmlBufferPtr(n_buf, buf, 0);
19572         des_const_char_ptr(n_string, (const char *)string, 1);
19573         xmlResetLastError();
19574         if (mem_base != xmlMemBlocks()) {
19575             printf("Leak of %d blocks found in xmlBufferWriteChar",
19576                    xmlMemBlocks() - mem_base);
19577             test_ret++;
19578             printf(" %d", n_buf);
19579             printf(" %d", n_string);
19580             printf("\n");
19581         }
19582     }
19583     }
19584     function_tests++;
19585
19586     return(test_ret);
19587 }
19588
19589
19590 static int
19591 test_xmlBufferWriteQuotedString(void) {
19592     int test_ret = 0;
19593
19594     int mem_base;
19595     xmlBufferPtr buf; /* the XML buffer output */
19596     int n_buf;
19597     xmlChar * string; /* the string to add */
19598     int n_string;
19599
19600     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19601     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19602         mem_base = xmlMemBlocks();
19603         buf = gen_xmlBufferPtr(n_buf, 0);
19604         string = gen_const_xmlChar_ptr(n_string, 1);
19605
19606         xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
19607         call_tests++;
19608         des_xmlBufferPtr(n_buf, buf, 0);
19609         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19610         xmlResetLastError();
19611         if (mem_base != xmlMemBlocks()) {
19612             printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
19613                    xmlMemBlocks() - mem_base);
19614             test_ret++;
19615             printf(" %d", n_buf);
19616             printf(" %d", n_string);
19617             printf("\n");
19618         }
19619     }
19620     }
19621     function_tests++;
19622
19623     return(test_ret);
19624 }
19625
19626
19627 static int
19628 test_xmlBuildQName(void) {
19629     int test_ret = 0;
19630
19631     int mem_base;
19632     xmlChar * ret_val;
19633     xmlChar * ncname; /* the Name */
19634     int n_ncname;
19635     xmlChar * prefix; /* the prefix */
19636     int n_prefix;
19637     xmlChar * memory; /* preallocated memory */
19638     int n_memory;
19639     int len; /* preallocated memory length */
19640     int n_len;
19641
19642     for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19643     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19644     for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19645     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19646         mem_base = xmlMemBlocks();
19647         ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19648         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19649         memory = gen_xmlChar_ptr(n_memory, 2);
19650         len = gen_int(n_len, 3);
19651
19652         ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19653         if ((ret_val != NULL) && (ret_val != ncname) &&
19654               (ret_val != prefix) && (ret_val != memory))
19655               xmlFree(ret_val);
19656           ret_val = NULL;
19657         desret_xmlChar_ptr(ret_val);
19658         call_tests++;
19659         des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19660         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19661         des_xmlChar_ptr(n_memory, memory, 2);
19662         des_int(n_len, len, 3);
19663         xmlResetLastError();
19664         if (mem_base != xmlMemBlocks()) {
19665             printf("Leak of %d blocks found in xmlBuildQName",
19666                    xmlMemBlocks() - mem_base);
19667             test_ret++;
19668             printf(" %d", n_ncname);
19669             printf(" %d", n_prefix);
19670             printf(" %d", n_memory);
19671             printf(" %d", n_len);
19672             printf("\n");
19673         }
19674     }
19675     }
19676     }
19677     }
19678     function_tests++;
19679
19680     return(test_ret);
19681 }
19682
19683
19684 static int
19685 test_xmlChildElementCount(void) {
19686     int test_ret = 0;
19687
19688 #if defined(LIBXML_TREE_ENABLED)
19689     int mem_base;
19690     unsigned long ret_val;
19691     xmlNodePtr parent; /* the parent node */
19692     int n_parent;
19693
19694     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19695         mem_base = xmlMemBlocks();
19696         parent = gen_xmlNodePtr(n_parent, 0);
19697
19698         ret_val = xmlChildElementCount(parent);
19699         desret_unsigned_long(ret_val);
19700         call_tests++;
19701         des_xmlNodePtr(n_parent, parent, 0);
19702         xmlResetLastError();
19703         if (mem_base != xmlMemBlocks()) {
19704             printf("Leak of %d blocks found in xmlChildElementCount",
19705                    xmlMemBlocks() - mem_base);
19706             test_ret++;
19707             printf(" %d", n_parent);
19708             printf("\n");
19709         }
19710     }
19711     function_tests++;
19712 #endif
19713
19714     return(test_ret);
19715 }
19716
19717
19718 static int
19719 test_xmlCopyDoc(void) {
19720     int test_ret = 0;
19721
19722 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19723     int mem_base;
19724     xmlDocPtr ret_val;
19725     xmlDocPtr doc; /* the document */
19726     int n_doc;
19727     int recursive; /* if not zero do a recursive copy. */
19728     int n_recursive;
19729
19730     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19731     for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19732         mem_base = xmlMemBlocks();
19733         doc = gen_xmlDocPtr(n_doc, 0);
19734         recursive = gen_int(n_recursive, 1);
19735
19736         ret_val = xmlCopyDoc(doc, recursive);
19737         desret_xmlDocPtr(ret_val);
19738         call_tests++;
19739         des_xmlDocPtr(n_doc, doc, 0);
19740         des_int(n_recursive, recursive, 1);
19741         xmlResetLastError();
19742         if (mem_base != xmlMemBlocks()) {
19743             printf("Leak of %d blocks found in xmlCopyDoc",
19744                    xmlMemBlocks() - mem_base);
19745             test_ret++;
19746             printf(" %d", n_doc);
19747             printf(" %d", n_recursive);
19748             printf("\n");
19749         }
19750     }
19751     }
19752     function_tests++;
19753 #endif
19754
19755     return(test_ret);
19756 }
19757
19758
19759 static int
19760 test_xmlCopyDtd(void) {
19761     int test_ret = 0;
19762
19763 #if defined(LIBXML_TREE_ENABLED)
19764     int mem_base;
19765     xmlDtdPtr ret_val;
19766     xmlDtdPtr dtd; /* the dtd */
19767     int n_dtd;
19768
19769     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19770         mem_base = xmlMemBlocks();
19771         dtd = gen_xmlDtdPtr(n_dtd, 0);
19772
19773         ret_val = xmlCopyDtd(dtd);
19774         desret_xmlDtdPtr(ret_val);
19775         call_tests++;
19776         des_xmlDtdPtr(n_dtd, dtd, 0);
19777         xmlResetLastError();
19778         if (mem_base != xmlMemBlocks()) {
19779             printf("Leak of %d blocks found in xmlCopyDtd",
19780                    xmlMemBlocks() - mem_base);
19781             test_ret++;
19782             printf(" %d", n_dtd);
19783             printf("\n");
19784         }
19785     }
19786     function_tests++;
19787 #endif
19788
19789     return(test_ret);
19790 }
19791
19792
19793 static int
19794 test_xmlCopyNamespace(void) {
19795     int test_ret = 0;
19796
19797     int mem_base;
19798     xmlNsPtr ret_val;
19799     xmlNsPtr cur; /* the namespace */
19800     int n_cur;
19801
19802     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19803         mem_base = xmlMemBlocks();
19804         cur = gen_xmlNsPtr(n_cur, 0);
19805
19806         ret_val = xmlCopyNamespace(cur);
19807         if (ret_val != NULL) xmlFreeNs(ret_val);
19808         desret_xmlNsPtr(ret_val);
19809         call_tests++;
19810         des_xmlNsPtr(n_cur, cur, 0);
19811         xmlResetLastError();
19812         if (mem_base != xmlMemBlocks()) {
19813             printf("Leak of %d blocks found in xmlCopyNamespace",
19814                    xmlMemBlocks() - mem_base);
19815             test_ret++;
19816             printf(" %d", n_cur);
19817             printf("\n");
19818         }
19819     }
19820     function_tests++;
19821
19822     return(test_ret);
19823 }
19824
19825
19826 static int
19827 test_xmlCopyNamespaceList(void) {
19828     int test_ret = 0;
19829
19830     int mem_base;
19831     xmlNsPtr ret_val;
19832     xmlNsPtr cur; /* the first namespace */
19833     int n_cur;
19834
19835     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19836         mem_base = xmlMemBlocks();
19837         cur = gen_xmlNsPtr(n_cur, 0);
19838
19839         ret_val = xmlCopyNamespaceList(cur);
19840         if (ret_val != NULL) xmlFreeNsList(ret_val);
19841         desret_xmlNsPtr(ret_val);
19842         call_tests++;
19843         des_xmlNsPtr(n_cur, cur, 0);
19844         xmlResetLastError();
19845         if (mem_base != xmlMemBlocks()) {
19846             printf("Leak of %d blocks found in xmlCopyNamespaceList",
19847                    xmlMemBlocks() - mem_base);
19848             test_ret++;
19849             printf(" %d", n_cur);
19850             printf("\n");
19851         }
19852     }
19853     function_tests++;
19854
19855     return(test_ret);
19856 }
19857
19858
19859 static int
19860 test_xmlCopyNode(void) {
19861     int test_ret = 0;
19862
19863     int mem_base;
19864     xmlNodePtr ret_val;
19865     xmlNodePtr node; /* the node */
19866     int n_node;
19867     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19868     int n_extended;
19869
19870     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19871     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19872         mem_base = xmlMemBlocks();
19873         node = gen_xmlNodePtr(n_node, 0);
19874         extended = gen_int(n_extended, 1);
19875
19876         ret_val = xmlCopyNode(node, extended);
19877         desret_xmlNodePtr(ret_val);
19878         call_tests++;
19879         des_xmlNodePtr(n_node, node, 0);
19880         des_int(n_extended, extended, 1);
19881         xmlResetLastError();
19882         if (mem_base != xmlMemBlocks()) {
19883             printf("Leak of %d blocks found in xmlCopyNode",
19884                    xmlMemBlocks() - mem_base);
19885             test_ret++;
19886             printf(" %d", n_node);
19887             printf(" %d", n_extended);
19888             printf("\n");
19889         }
19890     }
19891     }
19892     function_tests++;
19893
19894     return(test_ret);
19895 }
19896
19897
19898 static int
19899 test_xmlCopyNodeList(void) {
19900     int test_ret = 0;
19901
19902     int mem_base;
19903     xmlNodePtr ret_val;
19904     xmlNodePtr node; /* the first node in the list. */
19905     int n_node;
19906
19907     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19908         mem_base = xmlMemBlocks();
19909         node = gen_xmlNodePtr(n_node, 0);
19910
19911         ret_val = xmlCopyNodeList(node);
19912         desret_xmlNodePtr(ret_val);
19913         call_tests++;
19914         des_xmlNodePtr(n_node, node, 0);
19915         xmlResetLastError();
19916         if (mem_base != xmlMemBlocks()) {
19917             printf("Leak of %d blocks found in xmlCopyNodeList",
19918                    xmlMemBlocks() - mem_base);
19919             test_ret++;
19920             printf(" %d", n_node);
19921             printf("\n");
19922         }
19923     }
19924     function_tests++;
19925
19926     return(test_ret);
19927 }
19928
19929
19930 static int
19931 test_xmlCopyProp(void) {
19932     int test_ret = 0;
19933
19934     int mem_base;
19935     xmlAttrPtr ret_val;
19936     xmlNodePtr target; /* the element where the attribute will be grafted */
19937     int n_target;
19938     xmlAttrPtr cur; /* the attribute */
19939     int n_cur;
19940
19941     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19942     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19943         mem_base = xmlMemBlocks();
19944         target = gen_xmlNodePtr(n_target, 0);
19945         cur = gen_xmlAttrPtr(n_cur, 1);
19946
19947         ret_val = xmlCopyProp(target, cur);
19948         desret_xmlAttrPtr(ret_val);
19949         call_tests++;
19950         des_xmlNodePtr(n_target, target, 0);
19951         des_xmlAttrPtr(n_cur, cur, 1);
19952         xmlResetLastError();
19953         if (mem_base != xmlMemBlocks()) {
19954             printf("Leak of %d blocks found in xmlCopyProp",
19955                    xmlMemBlocks() - mem_base);
19956             test_ret++;
19957             printf(" %d", n_target);
19958             printf(" %d", n_cur);
19959             printf("\n");
19960         }
19961     }
19962     }
19963     function_tests++;
19964
19965     return(test_ret);
19966 }
19967
19968
19969 static int
19970 test_xmlCopyPropList(void) {
19971     int test_ret = 0;
19972
19973     int mem_base;
19974     xmlAttrPtr ret_val;
19975     xmlNodePtr target; /* the element where the attributes will be grafted */
19976     int n_target;
19977     xmlAttrPtr cur; /* the first attribute */
19978     int n_cur;
19979
19980     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19981     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19982         mem_base = xmlMemBlocks();
19983         target = gen_xmlNodePtr(n_target, 0);
19984         cur = gen_xmlAttrPtr(n_cur, 1);
19985
19986         ret_val = xmlCopyPropList(target, cur);
19987         desret_xmlAttrPtr(ret_val);
19988         call_tests++;
19989         des_xmlNodePtr(n_target, target, 0);
19990         des_xmlAttrPtr(n_cur, cur, 1);
19991         xmlResetLastError();
19992         if (mem_base != xmlMemBlocks()) {
19993             printf("Leak of %d blocks found in xmlCopyPropList",
19994                    xmlMemBlocks() - mem_base);
19995             test_ret++;
19996             printf(" %d", n_target);
19997             printf(" %d", n_cur);
19998             printf("\n");
19999         }
20000     }
20001     }
20002     function_tests++;
20003
20004     return(test_ret);
20005 }
20006
20007
20008 static int
20009 test_xmlCreateIntSubset(void) {
20010     int test_ret = 0;
20011
20012     int mem_base;
20013     xmlDtdPtr ret_val;
20014     xmlDocPtr doc; /* the document pointer */
20015     int n_doc;
20016     xmlChar * name; /* the DTD name */
20017     int n_name;
20018     xmlChar * ExternalID; /* the external (PUBLIC) ID */
20019     int n_ExternalID;
20020     xmlChar * SystemID; /* the system ID */
20021     int n_SystemID;
20022
20023     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20024     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20025     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
20026     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
20027         mem_base = xmlMemBlocks();
20028         doc = gen_xmlDocPtr(n_doc, 0);
20029         name = gen_const_xmlChar_ptr(n_name, 1);
20030         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
20031         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
20032
20033         ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
20034         desret_xmlDtdPtr(ret_val);
20035         call_tests++;
20036         des_xmlDocPtr(n_doc, doc, 0);
20037         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20038         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
20039         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
20040         xmlResetLastError();
20041         if (mem_base != xmlMemBlocks()) {
20042             printf("Leak of %d blocks found in xmlCreateIntSubset",
20043                    xmlMemBlocks() - mem_base);
20044             test_ret++;
20045             printf(" %d", n_doc);
20046             printf(" %d", n_name);
20047             printf(" %d", n_ExternalID);
20048             printf(" %d", n_SystemID);
20049             printf("\n");
20050         }
20051     }
20052     }
20053     }
20054     }
20055     function_tests++;
20056
20057     return(test_ret);
20058 }
20059
20060
20061 #define gen_nb_xmlDOMWrapCtxtPtr 1
20062 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
20063     return(NULL);
20064 }
20065 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
20066 }
20067
20068 static int
20069 test_xmlDOMWrapAdoptNode(void) {
20070     int test_ret = 0;
20071
20072     int mem_base;
20073     int ret_val;
20074     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
20075     int n_ctxt;
20076     xmlDocPtr sourceDoc; /* the optional sourceDoc */
20077     int n_sourceDoc;
20078     xmlNodePtr node; /* the node to start with */
20079     int n_node;
20080     xmlDocPtr destDoc; /* the destination doc */
20081     int n_destDoc;
20082     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
20083     int n_destParent;
20084     int options; /* option flags */
20085     int n_options;
20086
20087     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
20088     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
20089     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20090     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
20091     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
20092     for (n_options = 0;n_options < gen_nb_int;n_options++) {
20093         mem_base = xmlMemBlocks();
20094         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
20095         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
20096         node = gen_xmlNodePtr(n_node, 2);
20097         destDoc = gen_xmlDocPtr(n_destDoc, 3);
20098         destParent = gen_xmlNodePtr(n_destParent, 4);
20099         options = gen_int(n_options, 5);
20100
20101         ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
20102         if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
20103         desret_int(ret_val);
20104         call_tests++;
20105         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
20106         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
20107         des_xmlNodePtr(n_node, node, 2);
20108         des_xmlDocPtr(n_destDoc, destDoc, 3);
20109         des_xmlNodePtr(n_destParent, destParent, 4);
20110         des_int(n_options, options, 5);
20111         xmlResetLastError();
20112         if (mem_base != xmlMemBlocks()) {
20113             printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
20114                    xmlMemBlocks() - mem_base);
20115             test_ret++;
20116             printf(" %d", n_ctxt);
20117             printf(" %d", n_sourceDoc);
20118             printf(" %d", n_node);
20119             printf(" %d", n_destDoc);
20120             printf(" %d", n_destParent);
20121             printf(" %d", n_options);
20122             printf("\n");
20123         }
20124     }
20125     }
20126     }
20127     }
20128     }
20129     }
20130     function_tests++;
20131
20132     return(test_ret);
20133 }
20134
20135
20136 static int
20137 test_xmlDOMWrapCloneNode(void) {
20138     int test_ret = 0;
20139
20140     int mem_base;
20141     int ret_val;
20142     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
20143     int n_ctxt;
20144     xmlDocPtr sourceDoc; /* the optional sourceDoc */
20145     int n_sourceDoc;
20146     xmlNodePtr node; /* the node to start with */
20147     int n_node;
20148     xmlNodePtr * resNode; /* the clone of the given @node */
20149     int n_resNode;
20150     xmlDocPtr destDoc; /* the destination doc */
20151     int n_destDoc;
20152     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
20153     int n_destParent;
20154     int deep; /* descend into child if set */
20155     int n_deep;
20156     int options; /* option flags */
20157     int n_options;
20158
20159     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
20160     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
20161     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20162     for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
20163     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
20164     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
20165     for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
20166     for (n_options = 0;n_options < gen_nb_int;n_options++) {
20167         mem_base = xmlMemBlocks();
20168         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
20169         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
20170         node = gen_xmlNodePtr(n_node, 2);
20171         resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
20172         destDoc = gen_xmlDocPtr(n_destDoc, 4);
20173         destParent = gen_xmlNodePtr(n_destParent, 5);
20174         deep = gen_int(n_deep, 6);
20175         options = gen_int(n_options, 7);
20176
20177         ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
20178         desret_int(ret_val);
20179         call_tests++;
20180         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
20181         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
20182         des_xmlNodePtr(n_node, node, 2);
20183         des_xmlNodePtr_ptr(n_resNode, resNode, 3);
20184         des_xmlDocPtr(n_destDoc, destDoc, 4);
20185         des_xmlNodePtr(n_destParent, destParent, 5);
20186         des_int(n_deep, deep, 6);
20187         des_int(n_options, options, 7);
20188         xmlResetLastError();
20189         if (mem_base != xmlMemBlocks()) {
20190             printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
20191                    xmlMemBlocks() - mem_base);
20192             test_ret++;
20193             printf(" %d", n_ctxt);
20194             printf(" %d", n_sourceDoc);
20195             printf(" %d", n_node);
20196             printf(" %d", n_resNode);
20197             printf(" %d", n_destDoc);
20198             printf(" %d", n_destParent);
20199             printf(" %d", n_deep);
20200             printf(" %d", n_options);
20201             printf("\n");
20202         }
20203     }
20204     }
20205     }
20206     }
20207     }
20208     }
20209     }
20210     }
20211     function_tests++;
20212
20213     return(test_ret);
20214 }
20215
20216
20217 static int
20218 test_xmlDOMWrapNewCtxt(void) {
20219     int test_ret = 0;
20220
20221
20222     /* missing type support */
20223     return(test_ret);
20224 }
20225
20226
20227 static int
20228 test_xmlDOMWrapReconcileNamespaces(void) {
20229     int test_ret = 0;
20230
20231     int mem_base;
20232     int ret_val;
20233     xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
20234     int n_ctxt;
20235     xmlNodePtr elem; /* the element-node */
20236     int n_elem;
20237     int options; /* option flags */
20238     int n_options;
20239
20240     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
20241     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
20242     for (n_options = 0;n_options < gen_nb_int;n_options++) {
20243         mem_base = xmlMemBlocks();
20244         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
20245         elem = gen_xmlNodePtr(n_elem, 1);
20246         options = gen_int(n_options, 2);
20247
20248         ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
20249         desret_int(ret_val);
20250         call_tests++;
20251         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
20252         des_xmlNodePtr(n_elem, elem, 1);
20253         des_int(n_options, options, 2);
20254         xmlResetLastError();
20255         if (mem_base != xmlMemBlocks()) {
20256             printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
20257                    xmlMemBlocks() - mem_base);
20258             test_ret++;
20259             printf(" %d", n_ctxt);
20260             printf(" %d", n_elem);
20261             printf(" %d", n_options);
20262             printf("\n");
20263         }
20264     }
20265     }
20266     }
20267     function_tests++;
20268
20269     return(test_ret);
20270 }
20271
20272
20273 static int
20274 test_xmlDOMWrapRemoveNode(void) {
20275     int test_ret = 0;
20276
20277     int mem_base;
20278     int ret_val;
20279     xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
20280     int n_ctxt;
20281     xmlDocPtr doc; /* the doc */
20282     int n_doc;
20283     xmlNodePtr node; /* the node to be removed. */
20284     int n_node;
20285     int options; /* set of options, unused at the moment */
20286     int n_options;
20287
20288     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
20289     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20290     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20291     for (n_options = 0;n_options < gen_nb_int;n_options++) {
20292         mem_base = xmlMemBlocks();
20293         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
20294         doc = gen_xmlDocPtr(n_doc, 1);
20295         node = gen_xmlNodePtr(n_node, 2);
20296         options = gen_int(n_options, 3);
20297
20298         ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
20299         desret_int(ret_val);
20300         call_tests++;
20301         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
20302         des_xmlDocPtr(n_doc, doc, 1);
20303         des_xmlNodePtr(n_node, node, 2);
20304         des_int(n_options, options, 3);
20305         xmlResetLastError();
20306         if (mem_base != xmlMemBlocks()) {
20307             printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
20308                    xmlMemBlocks() - mem_base);
20309             test_ret++;
20310             printf(" %d", n_ctxt);
20311             printf(" %d", n_doc);
20312             printf(" %d", n_node);
20313             printf(" %d", n_options);
20314             printf("\n");
20315         }
20316     }
20317     }
20318     }
20319     }
20320     function_tests++;
20321
20322     return(test_ret);
20323 }
20324
20325
20326 static int
20327 test_xmlDocCopyNode(void) {
20328     int test_ret = 0;
20329
20330     int mem_base;
20331     xmlNodePtr ret_val;
20332     xmlNodePtr node; /* the node */
20333     int n_node;
20334     xmlDocPtr doc; /* the document */
20335     int n_doc;
20336     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
20337     int n_extended;
20338
20339     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20340     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20341     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
20342         mem_base = xmlMemBlocks();
20343         node = gen_xmlNodePtr(n_node, 0);
20344         doc = gen_xmlDocPtr(n_doc, 1);
20345         extended = gen_int(n_extended, 2);
20346
20347         ret_val = xmlDocCopyNode(node, doc, extended);
20348         desret_xmlNodePtr(ret_val);
20349         call_tests++;
20350         des_xmlNodePtr(n_node, node, 0);
20351         des_xmlDocPtr(n_doc, doc, 1);
20352         des_int(n_extended, extended, 2);
20353         xmlResetLastError();
20354         if (mem_base != xmlMemBlocks()) {
20355             printf("Leak of %d blocks found in xmlDocCopyNode",
20356                    xmlMemBlocks() - mem_base);
20357             test_ret++;
20358             printf(" %d", n_node);
20359             printf(" %d", n_doc);
20360             printf(" %d", n_extended);
20361             printf("\n");
20362         }
20363     }
20364     }
20365     }
20366     function_tests++;
20367
20368     return(test_ret);
20369 }
20370
20371
20372 static int
20373 test_xmlDocCopyNodeList(void) {
20374     int test_ret = 0;
20375
20376     int mem_base;
20377     xmlNodePtr ret_val;
20378     xmlDocPtr doc; /* the target document */
20379     int n_doc;
20380     xmlNodePtr node; /* the first node in the list. */
20381     int n_node;
20382
20383     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20384     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20385         mem_base = xmlMemBlocks();
20386         doc = gen_xmlDocPtr(n_doc, 0);
20387         node = gen_xmlNodePtr(n_node, 1);
20388
20389         ret_val = xmlDocCopyNodeList(doc, node);
20390         desret_xmlNodePtr(ret_val);
20391         call_tests++;
20392         des_xmlDocPtr(n_doc, doc, 0);
20393         des_xmlNodePtr(n_node, node, 1);
20394         xmlResetLastError();
20395         if (mem_base != xmlMemBlocks()) {
20396             printf("Leak of %d blocks found in xmlDocCopyNodeList",
20397                    xmlMemBlocks() - mem_base);
20398             test_ret++;
20399             printf(" %d", n_doc);
20400             printf(" %d", n_node);
20401             printf("\n");
20402         }
20403     }
20404     }
20405     function_tests++;
20406
20407     return(test_ret);
20408 }
20409
20410
20411 static int
20412 test_xmlDocDump(void) {
20413     int test_ret = 0;
20414
20415 #if defined(LIBXML_OUTPUT_ENABLED)
20416     int mem_base;
20417     int ret_val;
20418     FILE * f; /* the FILE* */
20419     int n_f;
20420     xmlDocPtr cur; /* the document */
20421     int n_cur;
20422
20423     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20424     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20425         mem_base = xmlMemBlocks();
20426         f = gen_FILE_ptr(n_f, 0);
20427         cur = gen_xmlDocPtr(n_cur, 1);
20428
20429         ret_val = xmlDocDump(f, cur);
20430         desret_int(ret_val);
20431         call_tests++;
20432         des_FILE_ptr(n_f, f, 0);
20433         des_xmlDocPtr(n_cur, cur, 1);
20434         xmlResetLastError();
20435         if (mem_base != xmlMemBlocks()) {
20436             printf("Leak of %d blocks found in xmlDocDump",
20437                    xmlMemBlocks() - mem_base);
20438             test_ret++;
20439             printf(" %d", n_f);
20440             printf(" %d", n_cur);
20441             printf("\n");
20442         }
20443     }
20444     }
20445     function_tests++;
20446 #endif
20447
20448     return(test_ret);
20449 }
20450
20451
20452 static int
20453 test_xmlDocDumpFormatMemory(void) {
20454     int test_ret = 0;
20455
20456 #if defined(LIBXML_OUTPUT_ENABLED)
20457     int mem_base;
20458     xmlDocPtr cur; /* the document */
20459     int n_cur;
20460     xmlChar ** mem; /* OUT: the memory pointer */
20461     int n_mem;
20462     int * size; /* OUT: the memory length */
20463     int n_size;
20464     int format; /* should formatting spaces been added */
20465     int n_format;
20466
20467     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20468     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20469     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20470     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20471         mem_base = xmlMemBlocks();
20472         cur = gen_xmlDocPtr(n_cur, 0);
20473         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20474         size = gen_int_ptr(n_size, 2);
20475         format = gen_int(n_format, 3);
20476
20477         xmlDocDumpFormatMemory(cur, mem, size, format);
20478         call_tests++;
20479         des_xmlDocPtr(n_cur, cur, 0);
20480         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20481         des_int_ptr(n_size, size, 2);
20482         des_int(n_format, format, 3);
20483         xmlResetLastError();
20484         if (mem_base != xmlMemBlocks()) {
20485             printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
20486                    xmlMemBlocks() - mem_base);
20487             test_ret++;
20488             printf(" %d", n_cur);
20489             printf(" %d", n_mem);
20490             printf(" %d", n_size);
20491             printf(" %d", n_format);
20492             printf("\n");
20493         }
20494     }
20495     }
20496     }
20497     }
20498     function_tests++;
20499 #endif
20500
20501     return(test_ret);
20502 }
20503
20504
20505 static int
20506 test_xmlDocDumpFormatMemoryEnc(void) {
20507     int test_ret = 0;
20508
20509 #if defined(LIBXML_OUTPUT_ENABLED)
20510     int mem_base;
20511     xmlDocPtr out_doc; /* Document to generate XML text from */
20512     int n_out_doc;
20513     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20514     int n_doc_txt_ptr;
20515     int * doc_txt_len; /* Length of the generated XML text */
20516     int n_doc_txt_len;
20517     char * txt_encoding; /* Character encoding to use when generating XML text */
20518     int n_txt_encoding;
20519     int format; /* should formatting spaces been added */
20520     int n_format;
20521
20522     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20523     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20524     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20525     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20526     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20527         mem_base = xmlMemBlocks();
20528         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20529         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20530         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20531         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20532         format = gen_int(n_format, 4);
20533
20534         xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
20535         call_tests++;
20536         des_xmlDocPtr(n_out_doc, out_doc, 0);
20537         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20538         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20539         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20540         des_int(n_format, format, 4);
20541         xmlResetLastError();
20542         if (mem_base != xmlMemBlocks()) {
20543             printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
20544                    xmlMemBlocks() - mem_base);
20545             test_ret++;
20546             printf(" %d", n_out_doc);
20547             printf(" %d", n_doc_txt_ptr);
20548             printf(" %d", n_doc_txt_len);
20549             printf(" %d", n_txt_encoding);
20550             printf(" %d", n_format);
20551             printf("\n");
20552         }
20553     }
20554     }
20555     }
20556     }
20557     }
20558     function_tests++;
20559 #endif
20560
20561     return(test_ret);
20562 }
20563
20564
20565 static int
20566 test_xmlDocDumpMemory(void) {
20567     int test_ret = 0;
20568
20569 #if defined(LIBXML_OUTPUT_ENABLED)
20570     int mem_base;
20571     xmlDocPtr cur; /* the document */
20572     int n_cur;
20573     xmlChar ** mem; /* OUT: the memory pointer */
20574     int n_mem;
20575     int * size; /* OUT: the memory length */
20576     int n_size;
20577
20578     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20579     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20580     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20581         mem_base = xmlMemBlocks();
20582         cur = gen_xmlDocPtr(n_cur, 0);
20583         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20584         size = gen_int_ptr(n_size, 2);
20585
20586         xmlDocDumpMemory(cur, mem, size);
20587         call_tests++;
20588         des_xmlDocPtr(n_cur, cur, 0);
20589         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20590         des_int_ptr(n_size, size, 2);
20591         xmlResetLastError();
20592         if (mem_base != xmlMemBlocks()) {
20593             printf("Leak of %d blocks found in xmlDocDumpMemory",
20594                    xmlMemBlocks() - mem_base);
20595             test_ret++;
20596             printf(" %d", n_cur);
20597             printf(" %d", n_mem);
20598             printf(" %d", n_size);
20599             printf("\n");
20600         }
20601     }
20602     }
20603     }
20604     function_tests++;
20605 #endif
20606
20607     return(test_ret);
20608 }
20609
20610
20611 static int
20612 test_xmlDocDumpMemoryEnc(void) {
20613     int test_ret = 0;
20614
20615 #if defined(LIBXML_OUTPUT_ENABLED)
20616     int mem_base;
20617     xmlDocPtr out_doc; /* Document to generate XML text from */
20618     int n_out_doc;
20619     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20620     int n_doc_txt_ptr;
20621     int * doc_txt_len; /* Length of the generated XML text */
20622     int n_doc_txt_len;
20623     char * txt_encoding; /* Character encoding to use when generating XML text */
20624     int n_txt_encoding;
20625
20626     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20627     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20628     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20629     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20630         mem_base = xmlMemBlocks();
20631         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20632         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20633         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20634         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20635
20636         xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20637         call_tests++;
20638         des_xmlDocPtr(n_out_doc, out_doc, 0);
20639         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20640         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20641         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20642         xmlResetLastError();
20643         if (mem_base != xmlMemBlocks()) {
20644             printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20645                    xmlMemBlocks() - mem_base);
20646             test_ret++;
20647             printf(" %d", n_out_doc);
20648             printf(" %d", n_doc_txt_ptr);
20649             printf(" %d", n_doc_txt_len);
20650             printf(" %d", n_txt_encoding);
20651             printf("\n");
20652         }
20653     }
20654     }
20655     }
20656     }
20657     function_tests++;
20658 #endif
20659
20660     return(test_ret);
20661 }
20662
20663
20664 static int
20665 test_xmlDocFormatDump(void) {
20666     int test_ret = 0;
20667
20668 #if defined(LIBXML_OUTPUT_ENABLED)
20669     int mem_base;
20670     int ret_val;
20671     FILE * f; /* the FILE* */
20672     int n_f;
20673     xmlDocPtr cur; /* the document */
20674     int n_cur;
20675     int format; /* should formatting spaces been added */
20676     int n_format;
20677
20678     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20679     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20680     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20681         mem_base = xmlMemBlocks();
20682         f = gen_FILE_ptr(n_f, 0);
20683         cur = gen_xmlDocPtr(n_cur, 1);
20684         format = gen_int(n_format, 2);
20685
20686         ret_val = xmlDocFormatDump(f, cur, format);
20687         desret_int(ret_val);
20688         call_tests++;
20689         des_FILE_ptr(n_f, f, 0);
20690         des_xmlDocPtr(n_cur, cur, 1);
20691         des_int(n_format, format, 2);
20692         xmlResetLastError();
20693         if (mem_base != xmlMemBlocks()) {
20694             printf("Leak of %d blocks found in xmlDocFormatDump",
20695                    xmlMemBlocks() - mem_base);
20696             test_ret++;
20697             printf(" %d", n_f);
20698             printf(" %d", n_cur);
20699             printf(" %d", n_format);
20700             printf("\n");
20701         }
20702     }
20703     }
20704     }
20705     function_tests++;
20706 #endif
20707
20708     return(test_ret);
20709 }
20710
20711
20712 static int
20713 test_xmlDocGetRootElement(void) {
20714     int test_ret = 0;
20715
20716     int mem_base;
20717     xmlNodePtr ret_val;
20718     xmlDoc * doc; /* the document */
20719     int n_doc;
20720
20721     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20722         mem_base = xmlMemBlocks();
20723         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20724
20725         ret_val = xmlDocGetRootElement((const xmlDoc *)doc);
20726         desret_xmlNodePtr(ret_val);
20727         call_tests++;
20728         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20729         xmlResetLastError();
20730         if (mem_base != xmlMemBlocks()) {
20731             printf("Leak of %d blocks found in xmlDocGetRootElement",
20732                    xmlMemBlocks() - mem_base);
20733             test_ret++;
20734             printf(" %d", n_doc);
20735             printf("\n");
20736         }
20737     }
20738     function_tests++;
20739
20740     return(test_ret);
20741 }
20742
20743
20744 static int
20745 test_xmlDocSetRootElement(void) {
20746     int test_ret = 0;
20747
20748 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20749     int mem_base;
20750     xmlNodePtr ret_val;
20751     xmlDocPtr doc; /* the document */
20752     int n_doc;
20753     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. */
20754     int n_root;
20755
20756     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20757     for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20758         mem_base = xmlMemBlocks();
20759         doc = gen_xmlDocPtr(n_doc, 0);
20760         root = gen_xmlNodePtr_in(n_root, 1);
20761
20762         ret_val = xmlDocSetRootElement(doc, root);
20763         if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20764         desret_xmlNodePtr(ret_val);
20765         call_tests++;
20766         des_xmlDocPtr(n_doc, doc, 0);
20767         des_xmlNodePtr_in(n_root, root, 1);
20768         xmlResetLastError();
20769         if (mem_base != xmlMemBlocks()) {
20770             printf("Leak of %d blocks found in xmlDocSetRootElement",
20771                    xmlMemBlocks() - mem_base);
20772             test_ret++;
20773             printf(" %d", n_doc);
20774             printf(" %d", n_root);
20775             printf("\n");
20776         }
20777     }
20778     }
20779     function_tests++;
20780 #endif
20781
20782     return(test_ret);
20783 }
20784
20785
20786 static int
20787 test_xmlElemDump(void) {
20788     int test_ret = 0;
20789
20790 #if defined(LIBXML_OUTPUT_ENABLED)
20791     int mem_base;
20792     FILE * f; /* the FILE * for the output */
20793     int n_f;
20794     xmlDocPtr doc; /* the document */
20795     int n_doc;
20796     xmlNodePtr cur; /* the current node */
20797     int n_cur;
20798
20799     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20800     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20801     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20802         mem_base = xmlMemBlocks();
20803         f = gen_FILE_ptr(n_f, 0);
20804         doc = gen_xmlDocPtr(n_doc, 1);
20805         cur = gen_xmlNodePtr(n_cur, 2);
20806
20807         xmlElemDump(f, doc, cur);
20808         call_tests++;
20809         des_FILE_ptr(n_f, f, 0);
20810         des_xmlDocPtr(n_doc, doc, 1);
20811         des_xmlNodePtr(n_cur, cur, 2);
20812         xmlResetLastError();
20813         if (mem_base != xmlMemBlocks()) {
20814             printf("Leak of %d blocks found in xmlElemDump",
20815                    xmlMemBlocks() - mem_base);
20816             test_ret++;
20817             printf(" %d", n_f);
20818             printf(" %d", n_doc);
20819             printf(" %d", n_cur);
20820             printf("\n");
20821         }
20822     }
20823     }
20824     }
20825     function_tests++;
20826 #endif
20827
20828     return(test_ret);
20829 }
20830
20831
20832 static int
20833 test_xmlFirstElementChild(void) {
20834     int test_ret = 0;
20835
20836 #if defined(LIBXML_TREE_ENABLED)
20837     int mem_base;
20838     xmlNodePtr ret_val;
20839     xmlNodePtr parent; /* the parent node */
20840     int n_parent;
20841
20842     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20843         mem_base = xmlMemBlocks();
20844         parent = gen_xmlNodePtr(n_parent, 0);
20845
20846         ret_val = xmlFirstElementChild(parent);
20847         desret_xmlNodePtr(ret_val);
20848         call_tests++;
20849         des_xmlNodePtr(n_parent, parent, 0);
20850         xmlResetLastError();
20851         if (mem_base != xmlMemBlocks()) {
20852             printf("Leak of %d blocks found in xmlFirstElementChild",
20853                    xmlMemBlocks() - mem_base);
20854             test_ret++;
20855             printf(" %d", n_parent);
20856             printf("\n");
20857         }
20858     }
20859     function_tests++;
20860 #endif
20861
20862     return(test_ret);
20863 }
20864
20865
20866 static int
20867 test_xmlGetBufferAllocationScheme(void) {
20868     int test_ret = 0;
20869
20870     int mem_base;
20871     xmlBufferAllocationScheme ret_val;
20872
20873         mem_base = xmlMemBlocks();
20874
20875         ret_val = xmlGetBufferAllocationScheme();
20876         desret_xmlBufferAllocationScheme(ret_val);
20877         call_tests++;
20878         xmlResetLastError();
20879         if (mem_base != xmlMemBlocks()) {
20880             printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20881                    xmlMemBlocks() - mem_base);
20882             test_ret++;
20883             printf("\n");
20884         }
20885     function_tests++;
20886
20887     return(test_ret);
20888 }
20889
20890
20891 static int
20892 test_xmlGetCompressMode(void) {
20893     int test_ret = 0;
20894
20895     int mem_base;
20896     int ret_val;
20897
20898         mem_base = xmlMemBlocks();
20899
20900         ret_val = xmlGetCompressMode();
20901         desret_int(ret_val);
20902         call_tests++;
20903         xmlResetLastError();
20904         if (mem_base != xmlMemBlocks()) {
20905             printf("Leak of %d blocks found in xmlGetCompressMode",
20906                    xmlMemBlocks() - mem_base);
20907             test_ret++;
20908             printf("\n");
20909         }
20910     function_tests++;
20911
20912     return(test_ret);
20913 }
20914
20915
20916 static int
20917 test_xmlGetDocCompressMode(void) {
20918     int test_ret = 0;
20919
20920     int mem_base;
20921     int ret_val;
20922     xmlDoc * doc; /* the document */
20923     int n_doc;
20924
20925     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20926         mem_base = xmlMemBlocks();
20927         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20928
20929         ret_val = xmlGetDocCompressMode((const xmlDoc *)doc);
20930         desret_int(ret_val);
20931         call_tests++;
20932         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20933         xmlResetLastError();
20934         if (mem_base != xmlMemBlocks()) {
20935             printf("Leak of %d blocks found in xmlGetDocCompressMode",
20936                    xmlMemBlocks() - mem_base);
20937             test_ret++;
20938             printf(" %d", n_doc);
20939             printf("\n");
20940         }
20941     }
20942     function_tests++;
20943
20944     return(test_ret);
20945 }
20946
20947
20948 static int
20949 test_xmlGetIntSubset(void) {
20950     int test_ret = 0;
20951
20952     int mem_base;
20953     xmlDtdPtr ret_val;
20954     xmlDoc * doc; /* the document pointer */
20955     int n_doc;
20956
20957     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20958         mem_base = xmlMemBlocks();
20959         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20960
20961         ret_val = xmlGetIntSubset((const xmlDoc *)doc);
20962         desret_xmlDtdPtr(ret_val);
20963         call_tests++;
20964         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20965         xmlResetLastError();
20966         if (mem_base != xmlMemBlocks()) {
20967             printf("Leak of %d blocks found in xmlGetIntSubset",
20968                    xmlMemBlocks() - mem_base);
20969             test_ret++;
20970             printf(" %d", n_doc);
20971             printf("\n");
20972         }
20973     }
20974     function_tests++;
20975
20976     return(test_ret);
20977 }
20978
20979
20980 static int
20981 test_xmlGetLastChild(void) {
20982     int test_ret = 0;
20983
20984     int mem_base;
20985     xmlNodePtr ret_val;
20986     xmlNode * parent; /* the parent node */
20987     int n_parent;
20988
20989     for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
20990         mem_base = xmlMemBlocks();
20991         parent = gen_const_xmlNode_ptr(n_parent, 0);
20992
20993         ret_val = xmlGetLastChild((const xmlNode *)parent);
20994         desret_xmlNodePtr(ret_val);
20995         call_tests++;
20996         des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0);
20997         xmlResetLastError();
20998         if (mem_base != xmlMemBlocks()) {
20999             printf("Leak of %d blocks found in xmlGetLastChild",
21000                    xmlMemBlocks() - mem_base);
21001             test_ret++;
21002             printf(" %d", n_parent);
21003             printf("\n");
21004         }
21005     }
21006     function_tests++;
21007
21008     return(test_ret);
21009 }
21010
21011
21012 static int
21013 test_xmlGetLineNo(void) {
21014     int test_ret = 0;
21015
21016     int mem_base;
21017     long ret_val;
21018     xmlNode * node; /* valid node */
21019     int n_node;
21020
21021     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21022         mem_base = xmlMemBlocks();
21023         node = gen_const_xmlNode_ptr(n_node, 0);
21024
21025         ret_val = xmlGetLineNo((const xmlNode *)node);
21026         desret_long(ret_val);
21027         call_tests++;
21028         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21029         xmlResetLastError();
21030         if (mem_base != xmlMemBlocks()) {
21031             printf("Leak of %d blocks found in xmlGetLineNo",
21032                    xmlMemBlocks() - mem_base);
21033             test_ret++;
21034             printf(" %d", n_node);
21035             printf("\n");
21036         }
21037     }
21038     function_tests++;
21039
21040     return(test_ret);
21041 }
21042
21043
21044 static int
21045 test_xmlGetNoNsProp(void) {
21046     int test_ret = 0;
21047
21048     int mem_base;
21049     xmlChar * ret_val;
21050     xmlNode * node; /* the node */
21051     int n_node;
21052     xmlChar * name; /* the attribute name */
21053     int n_name;
21054
21055     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21056     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21057         mem_base = xmlMemBlocks();
21058         node = gen_const_xmlNode_ptr(n_node, 0);
21059         name = gen_const_xmlChar_ptr(n_name, 1);
21060
21061         ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name);
21062         desret_xmlChar_ptr(ret_val);
21063         call_tests++;
21064         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21065         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21066         xmlResetLastError();
21067         if (mem_base != xmlMemBlocks()) {
21068             printf("Leak of %d blocks found in xmlGetNoNsProp",
21069                    xmlMemBlocks() - mem_base);
21070             test_ret++;
21071             printf(" %d", n_node);
21072             printf(" %d", n_name);
21073             printf("\n");
21074         }
21075     }
21076     }
21077     function_tests++;
21078
21079     return(test_ret);
21080 }
21081
21082
21083 static int
21084 test_xmlGetNodePath(void) {
21085     int test_ret = 0;
21086
21087 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
21088     int mem_base;
21089     xmlChar * ret_val;
21090     xmlNode * node; /* a node */
21091     int n_node;
21092
21093     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21094         mem_base = xmlMemBlocks();
21095         node = gen_const_xmlNode_ptr(n_node, 0);
21096
21097         ret_val = xmlGetNodePath((const xmlNode *)node);
21098         desret_xmlChar_ptr(ret_val);
21099         call_tests++;
21100         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21101         xmlResetLastError();
21102         if (mem_base != xmlMemBlocks()) {
21103             printf("Leak of %d blocks found in xmlGetNodePath",
21104                    xmlMemBlocks() - mem_base);
21105             test_ret++;
21106             printf(" %d", n_node);
21107             printf("\n");
21108         }
21109     }
21110     function_tests++;
21111 #endif
21112
21113     return(test_ret);
21114 }
21115
21116
21117 static int
21118 test_xmlGetNsList(void) {
21119     int test_ret = 0;
21120
21121
21122     /* missing type support */
21123     return(test_ret);
21124 }
21125
21126
21127 static int
21128 test_xmlGetNsProp(void) {
21129     int test_ret = 0;
21130
21131     int mem_base;
21132     xmlChar * ret_val;
21133     xmlNode * node; /* the node */
21134     int n_node;
21135     xmlChar * name; /* the attribute name */
21136     int n_name;
21137     xmlChar * nameSpace; /* the URI of the namespace */
21138     int n_nameSpace;
21139
21140     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21141     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21142     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
21143         mem_base = xmlMemBlocks();
21144         node = gen_const_xmlNode_ptr(n_node, 0);
21145         name = gen_const_xmlChar_ptr(n_name, 1);
21146         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
21147
21148         ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
21149         desret_xmlChar_ptr(ret_val);
21150         call_tests++;
21151         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21152         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21153         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
21154         xmlResetLastError();
21155         if (mem_base != xmlMemBlocks()) {
21156             printf("Leak of %d blocks found in xmlGetNsProp",
21157                    xmlMemBlocks() - mem_base);
21158             test_ret++;
21159             printf(" %d", n_node);
21160             printf(" %d", n_name);
21161             printf(" %d", n_nameSpace);
21162             printf("\n");
21163         }
21164     }
21165     }
21166     }
21167     function_tests++;
21168
21169     return(test_ret);
21170 }
21171
21172
21173 static int
21174 test_xmlGetProp(void) {
21175     int test_ret = 0;
21176
21177     int mem_base;
21178     xmlChar * ret_val;
21179     xmlNode * node; /* the node */
21180     int n_node;
21181     xmlChar * name; /* the attribute name */
21182     int n_name;
21183
21184     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21185     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21186         mem_base = xmlMemBlocks();
21187         node = gen_const_xmlNode_ptr(n_node, 0);
21188         name = gen_const_xmlChar_ptr(n_name, 1);
21189
21190         ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name);
21191         desret_xmlChar_ptr(ret_val);
21192         call_tests++;
21193         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21194         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21195         xmlResetLastError();
21196         if (mem_base != xmlMemBlocks()) {
21197             printf("Leak of %d blocks found in xmlGetProp",
21198                    xmlMemBlocks() - mem_base);
21199             test_ret++;
21200             printf(" %d", n_node);
21201             printf(" %d", n_name);
21202             printf("\n");
21203         }
21204     }
21205     }
21206     function_tests++;
21207
21208     return(test_ret);
21209 }
21210
21211
21212 static int
21213 test_xmlHasNsProp(void) {
21214     int test_ret = 0;
21215
21216     int mem_base;
21217     xmlAttrPtr ret_val;
21218     xmlNode * node; /* the node */
21219     int n_node;
21220     xmlChar * name; /* the attribute name */
21221     int n_name;
21222     xmlChar * nameSpace; /* the URI of the namespace */
21223     int n_nameSpace;
21224
21225     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21226     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21227     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
21228         mem_base = xmlMemBlocks();
21229         node = gen_const_xmlNode_ptr(n_node, 0);
21230         name = gen_const_xmlChar_ptr(n_name, 1);
21231         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
21232
21233         ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
21234         desret_xmlAttrPtr(ret_val);
21235         call_tests++;
21236         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21237         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21238         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
21239         xmlResetLastError();
21240         if (mem_base != xmlMemBlocks()) {
21241             printf("Leak of %d blocks found in xmlHasNsProp",
21242                    xmlMemBlocks() - mem_base);
21243             test_ret++;
21244             printf(" %d", n_node);
21245             printf(" %d", n_name);
21246             printf(" %d", n_nameSpace);
21247             printf("\n");
21248         }
21249     }
21250     }
21251     }
21252     function_tests++;
21253
21254     return(test_ret);
21255 }
21256
21257
21258 static int
21259 test_xmlHasProp(void) {
21260     int test_ret = 0;
21261
21262     int mem_base;
21263     xmlAttrPtr ret_val;
21264     xmlNode * node; /* the node */
21265     int n_node;
21266     xmlChar * name; /* the attribute name */
21267     int n_name;
21268
21269     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21270     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21271         mem_base = xmlMemBlocks();
21272         node = gen_const_xmlNode_ptr(n_node, 0);
21273         name = gen_const_xmlChar_ptr(n_name, 1);
21274
21275         ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name);
21276         desret_xmlAttrPtr(ret_val);
21277         call_tests++;
21278         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21279         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21280         xmlResetLastError();
21281         if (mem_base != xmlMemBlocks()) {
21282             printf("Leak of %d blocks found in xmlHasProp",
21283                    xmlMemBlocks() - mem_base);
21284             test_ret++;
21285             printf(" %d", n_node);
21286             printf(" %d", n_name);
21287             printf("\n");
21288         }
21289     }
21290     }
21291     function_tests++;
21292
21293     return(test_ret);
21294 }
21295
21296
21297 static int
21298 test_xmlIsBlankNode(void) {
21299     int test_ret = 0;
21300
21301     int mem_base;
21302     int ret_val;
21303     xmlNode * node; /* the node */
21304     int n_node;
21305
21306     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21307         mem_base = xmlMemBlocks();
21308         node = gen_const_xmlNode_ptr(n_node, 0);
21309
21310         ret_val = xmlIsBlankNode((const xmlNode *)node);
21311         desret_int(ret_val);
21312         call_tests++;
21313         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21314         xmlResetLastError();
21315         if (mem_base != xmlMemBlocks()) {
21316             printf("Leak of %d blocks found in xmlIsBlankNode",
21317                    xmlMemBlocks() - mem_base);
21318             test_ret++;
21319             printf(" %d", n_node);
21320             printf("\n");
21321         }
21322     }
21323     function_tests++;
21324
21325     return(test_ret);
21326 }
21327
21328
21329 static int
21330 test_xmlIsXHTML(void) {
21331     int test_ret = 0;
21332
21333     int mem_base;
21334     int ret_val;
21335     xmlChar * systemID; /* the system identifier */
21336     int n_systemID;
21337     xmlChar * publicID; /* the public identifier */
21338     int n_publicID;
21339
21340     for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
21341     for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
21342         mem_base = xmlMemBlocks();
21343         systemID = gen_const_xmlChar_ptr(n_systemID, 0);
21344         publicID = gen_const_xmlChar_ptr(n_publicID, 1);
21345
21346         ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
21347         desret_int(ret_val);
21348         call_tests++;
21349         des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
21350         des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
21351         xmlResetLastError();
21352         if (mem_base != xmlMemBlocks()) {
21353             printf("Leak of %d blocks found in xmlIsXHTML",
21354                    xmlMemBlocks() - mem_base);
21355             test_ret++;
21356             printf(" %d", n_systemID);
21357             printf(" %d", n_publicID);
21358             printf("\n");
21359         }
21360     }
21361     }
21362     function_tests++;
21363
21364     return(test_ret);
21365 }
21366
21367
21368 static int
21369 test_xmlLastElementChild(void) {
21370     int test_ret = 0;
21371
21372 #if defined(LIBXML_TREE_ENABLED)
21373     int mem_base;
21374     xmlNodePtr ret_val;
21375     xmlNodePtr parent; /* the parent node */
21376     int n_parent;
21377
21378     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21379         mem_base = xmlMemBlocks();
21380         parent = gen_xmlNodePtr(n_parent, 0);
21381
21382         ret_val = xmlLastElementChild(parent);
21383         desret_xmlNodePtr(ret_val);
21384         call_tests++;
21385         des_xmlNodePtr(n_parent, parent, 0);
21386         xmlResetLastError();
21387         if (mem_base != xmlMemBlocks()) {
21388             printf("Leak of %d blocks found in xmlLastElementChild",
21389                    xmlMemBlocks() - mem_base);
21390             test_ret++;
21391             printf(" %d", n_parent);
21392             printf("\n");
21393         }
21394     }
21395     function_tests++;
21396 #endif
21397
21398     return(test_ret);
21399 }
21400
21401
21402 static int
21403 test_xmlNewCDataBlock(void) {
21404     int test_ret = 0;
21405
21406     int mem_base;
21407     xmlNodePtr ret_val;
21408     xmlDocPtr doc; /* the document */
21409     int n_doc;
21410     xmlChar * content; /* the CDATA block content content */
21411     int n_content;
21412     int len; /* the length of the block */
21413     int n_len;
21414
21415     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21416     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21417     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21418         mem_base = xmlMemBlocks();
21419         doc = gen_xmlDocPtr(n_doc, 0);
21420         content = gen_const_xmlChar_ptr(n_content, 1);
21421         len = gen_int(n_len, 2);
21422
21423         ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
21424         desret_xmlNodePtr(ret_val);
21425         call_tests++;
21426         des_xmlDocPtr(n_doc, doc, 0);
21427         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21428         des_int(n_len, len, 2);
21429         xmlResetLastError();
21430         if (mem_base != xmlMemBlocks()) {
21431             printf("Leak of %d blocks found in xmlNewCDataBlock",
21432                    xmlMemBlocks() - mem_base);
21433             test_ret++;
21434             printf(" %d", n_doc);
21435             printf(" %d", n_content);
21436             printf(" %d", n_len);
21437             printf("\n");
21438         }
21439     }
21440     }
21441     }
21442     function_tests++;
21443
21444     return(test_ret);
21445 }
21446
21447
21448 static int
21449 test_xmlNewCharRef(void) {
21450     int test_ret = 0;
21451
21452     int mem_base;
21453     xmlNodePtr ret_val;
21454     xmlDocPtr doc; /* the document */
21455     int n_doc;
21456     xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
21457     int n_name;
21458
21459     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21460     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21461         mem_base = xmlMemBlocks();
21462         doc = gen_xmlDocPtr(n_doc, 0);
21463         name = gen_const_xmlChar_ptr(n_name, 1);
21464
21465         ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
21466         desret_xmlNodePtr(ret_val);
21467         call_tests++;
21468         des_xmlDocPtr(n_doc, doc, 0);
21469         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21470         xmlResetLastError();
21471         if (mem_base != xmlMemBlocks()) {
21472             printf("Leak of %d blocks found in xmlNewCharRef",
21473                    xmlMemBlocks() - mem_base);
21474             test_ret++;
21475             printf(" %d", n_doc);
21476             printf(" %d", n_name);
21477             printf("\n");
21478         }
21479     }
21480     }
21481     function_tests++;
21482
21483     return(test_ret);
21484 }
21485
21486
21487 static int
21488 test_xmlNewChild(void) {
21489     int test_ret = 0;
21490
21491 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21492 #ifdef LIBXML_TREE_ENABLED
21493     int mem_base;
21494     xmlNodePtr ret_val;
21495     xmlNodePtr parent; /* the parent node */
21496     int n_parent;
21497     xmlNsPtr ns; /* a namespace if any */
21498     int n_ns;
21499     xmlChar * name; /* the name of the child */
21500     int n_name;
21501     xmlChar * content; /* the XML content of the child if any. */
21502     int n_content;
21503
21504     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21505     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21506     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21507     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21508         mem_base = xmlMemBlocks();
21509         parent = gen_xmlNodePtr(n_parent, 0);
21510         ns = gen_xmlNsPtr(n_ns, 1);
21511         name = gen_const_xmlChar_ptr(n_name, 2);
21512         content = gen_const_xmlChar_ptr(n_content, 3);
21513
21514         ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21515         desret_xmlNodePtr(ret_val);
21516         call_tests++;
21517         des_xmlNodePtr(n_parent, parent, 0);
21518         des_xmlNsPtr(n_ns, ns, 1);
21519         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21520         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21521         xmlResetLastError();
21522         if (mem_base != xmlMemBlocks()) {
21523             printf("Leak of %d blocks found in xmlNewChild",
21524                    xmlMemBlocks() - mem_base);
21525             test_ret++;
21526             printf(" %d", n_parent);
21527             printf(" %d", n_ns);
21528             printf(" %d", n_name);
21529             printf(" %d", n_content);
21530             printf("\n");
21531         }
21532     }
21533     }
21534     }
21535     }
21536     function_tests++;
21537 #endif
21538 #endif
21539
21540     return(test_ret);
21541 }
21542
21543
21544 static int
21545 test_xmlNewComment(void) {
21546     int test_ret = 0;
21547
21548     int mem_base;
21549     xmlNodePtr ret_val;
21550     xmlChar * content; /* the comment content */
21551     int n_content;
21552
21553     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21554         mem_base = xmlMemBlocks();
21555         content = gen_const_xmlChar_ptr(n_content, 0);
21556
21557         ret_val = xmlNewComment((const xmlChar *)content);
21558         desret_xmlNodePtr(ret_val);
21559         call_tests++;
21560         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21561         xmlResetLastError();
21562         if (mem_base != xmlMemBlocks()) {
21563             printf("Leak of %d blocks found in xmlNewComment",
21564                    xmlMemBlocks() - mem_base);
21565             test_ret++;
21566             printf(" %d", n_content);
21567             printf("\n");
21568         }
21569     }
21570     function_tests++;
21571
21572     return(test_ret);
21573 }
21574
21575
21576 static int
21577 test_xmlNewDoc(void) {
21578     int test_ret = 0;
21579
21580     int mem_base;
21581     xmlDocPtr ret_val;
21582     xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
21583     int n_version;
21584
21585     for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
21586         mem_base = xmlMemBlocks();
21587         version = gen_const_xmlChar_ptr(n_version, 0);
21588
21589         ret_val = xmlNewDoc((const xmlChar *)version);
21590         desret_xmlDocPtr(ret_val);
21591         call_tests++;
21592         des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
21593         xmlResetLastError();
21594         if (mem_base != xmlMemBlocks()) {
21595             printf("Leak of %d blocks found in xmlNewDoc",
21596                    xmlMemBlocks() - mem_base);
21597             test_ret++;
21598             printf(" %d", n_version);
21599             printf("\n");
21600         }
21601     }
21602     function_tests++;
21603
21604     return(test_ret);
21605 }
21606
21607
21608 static int
21609 test_xmlNewDocComment(void) {
21610     int test_ret = 0;
21611
21612     int mem_base;
21613     xmlNodePtr ret_val;
21614     xmlDocPtr doc; /* the document */
21615     int n_doc;
21616     xmlChar * content; /* the comment content */
21617     int n_content;
21618
21619     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21620     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21621         mem_base = xmlMemBlocks();
21622         doc = gen_xmlDocPtr(n_doc, 0);
21623         content = gen_const_xmlChar_ptr(n_content, 1);
21624
21625         ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21626         desret_xmlNodePtr(ret_val);
21627         call_tests++;
21628         des_xmlDocPtr(n_doc, doc, 0);
21629         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21630         xmlResetLastError();
21631         if (mem_base != xmlMemBlocks()) {
21632             printf("Leak of %d blocks found in xmlNewDocComment",
21633                    xmlMemBlocks() - mem_base);
21634             test_ret++;
21635             printf(" %d", n_doc);
21636             printf(" %d", n_content);
21637             printf("\n");
21638         }
21639     }
21640     }
21641     function_tests++;
21642
21643     return(test_ret);
21644 }
21645
21646
21647 static int
21648 test_xmlNewDocFragment(void) {
21649     int test_ret = 0;
21650
21651 #if defined(LIBXML_TREE_ENABLED)
21652     int mem_base;
21653     xmlNodePtr ret_val;
21654     xmlDocPtr doc; /* the document owning the fragment */
21655     int n_doc;
21656
21657     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21658         mem_base = xmlMemBlocks();
21659         doc = gen_xmlDocPtr(n_doc, 0);
21660
21661         ret_val = xmlNewDocFragment(doc);
21662         desret_xmlNodePtr(ret_val);
21663         call_tests++;
21664         des_xmlDocPtr(n_doc, doc, 0);
21665         xmlResetLastError();
21666         if (mem_base != xmlMemBlocks()) {
21667             printf("Leak of %d blocks found in xmlNewDocFragment",
21668                    xmlMemBlocks() - mem_base);
21669             test_ret++;
21670             printf(" %d", n_doc);
21671             printf("\n");
21672         }
21673     }
21674     function_tests++;
21675 #endif
21676
21677     return(test_ret);
21678 }
21679
21680
21681 static int
21682 test_xmlNewDocNode(void) {
21683     int test_ret = 0;
21684
21685     int mem_base;
21686     xmlNodePtr ret_val;
21687     xmlDocPtr doc; /* the document */
21688     int n_doc;
21689     xmlNsPtr ns; /* namespace if any */
21690     int n_ns;
21691     xmlChar * name; /* the node name */
21692     int n_name;
21693     xmlChar * content; /* the XML text content if any */
21694     int n_content;
21695
21696     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21697     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21698     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21699     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21700         mem_base = xmlMemBlocks();
21701         doc = gen_xmlDocPtr(n_doc, 0);
21702         ns = gen_xmlNsPtr(n_ns, 1);
21703         name = gen_const_xmlChar_ptr(n_name, 2);
21704         content = gen_const_xmlChar_ptr(n_content, 3);
21705
21706         ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21707         desret_xmlNodePtr(ret_val);
21708         call_tests++;
21709         des_xmlDocPtr(n_doc, doc, 0);
21710         des_xmlNsPtr(n_ns, ns, 1);
21711         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21712         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21713         xmlResetLastError();
21714         if (mem_base != xmlMemBlocks()) {
21715             printf("Leak of %d blocks found in xmlNewDocNode",
21716                    xmlMemBlocks() - mem_base);
21717             test_ret++;
21718             printf(" %d", n_doc);
21719             printf(" %d", n_ns);
21720             printf(" %d", n_name);
21721             printf(" %d", n_content);
21722             printf("\n");
21723         }
21724     }
21725     }
21726     }
21727     }
21728     function_tests++;
21729
21730     return(test_ret);
21731 }
21732
21733
21734 static int
21735 test_xmlNewDocNodeEatName(void) {
21736     int test_ret = 0;
21737
21738     int mem_base;
21739     xmlNodePtr ret_val;
21740     xmlDocPtr doc; /* the document */
21741     int n_doc;
21742     xmlNsPtr ns; /* namespace if any */
21743     int n_ns;
21744     xmlChar * name; /* the node name */
21745     int n_name;
21746     xmlChar * content; /* the XML text content if any */
21747     int n_content;
21748
21749     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21750     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21751     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21752     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21753         mem_base = xmlMemBlocks();
21754         doc = gen_xmlDocPtr(n_doc, 0);
21755         ns = gen_xmlNsPtr(n_ns, 1);
21756         name = gen_eaten_name(n_name, 2);
21757         content = gen_const_xmlChar_ptr(n_content, 3);
21758
21759         ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21760         desret_xmlNodePtr(ret_val);
21761         call_tests++;
21762         des_xmlDocPtr(n_doc, doc, 0);
21763         des_xmlNsPtr(n_ns, ns, 1);
21764         des_eaten_name(n_name, name, 2);
21765         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21766         xmlResetLastError();
21767         if (mem_base != xmlMemBlocks()) {
21768             printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21769                    xmlMemBlocks() - mem_base);
21770             test_ret++;
21771             printf(" %d", n_doc);
21772             printf(" %d", n_ns);
21773             printf(" %d", n_name);
21774             printf(" %d", n_content);
21775             printf("\n");
21776         }
21777     }
21778     }
21779     }
21780     }
21781     function_tests++;
21782
21783     return(test_ret);
21784 }
21785
21786
21787 static int
21788 test_xmlNewDocPI(void) {
21789     int test_ret = 0;
21790
21791     int mem_base;
21792     xmlNodePtr ret_val;
21793     xmlDocPtr doc; /* the target document */
21794     int n_doc;
21795     xmlChar * name; /* the processing instruction name */
21796     int n_name;
21797     xmlChar * content; /* the PI content */
21798     int n_content;
21799
21800     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21801     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21802     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21803         mem_base = xmlMemBlocks();
21804         doc = gen_xmlDocPtr(n_doc, 0);
21805         name = gen_const_xmlChar_ptr(n_name, 1);
21806         content = gen_const_xmlChar_ptr(n_content, 2);
21807
21808         ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21809         desret_xmlNodePtr(ret_val);
21810         call_tests++;
21811         des_xmlDocPtr(n_doc, doc, 0);
21812         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21813         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21814         xmlResetLastError();
21815         if (mem_base != xmlMemBlocks()) {
21816             printf("Leak of %d blocks found in xmlNewDocPI",
21817                    xmlMemBlocks() - mem_base);
21818             test_ret++;
21819             printf(" %d", n_doc);
21820             printf(" %d", n_name);
21821             printf(" %d", n_content);
21822             printf("\n");
21823         }
21824     }
21825     }
21826     }
21827     function_tests++;
21828
21829     return(test_ret);
21830 }
21831
21832
21833 static int
21834 test_xmlNewDocProp(void) {
21835     int test_ret = 0;
21836
21837     int mem_base;
21838     xmlAttrPtr ret_val;
21839     xmlDocPtr doc; /* the document */
21840     int n_doc;
21841     xmlChar * name; /* the name of the attribute */
21842     int n_name;
21843     xmlChar * value; /* the value of the attribute */
21844     int n_value;
21845
21846     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21847     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21848     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21849         mem_base = xmlMemBlocks();
21850         doc = gen_xmlDocPtr(n_doc, 0);
21851         name = gen_const_xmlChar_ptr(n_name, 1);
21852         value = gen_const_xmlChar_ptr(n_value, 2);
21853
21854         ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21855         desret_xmlAttrPtr(ret_val);
21856         call_tests++;
21857         des_xmlDocPtr(n_doc, doc, 0);
21858         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21859         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21860         xmlResetLastError();
21861         if (mem_base != xmlMemBlocks()) {
21862             printf("Leak of %d blocks found in xmlNewDocProp",
21863                    xmlMemBlocks() - mem_base);
21864             test_ret++;
21865             printf(" %d", n_doc);
21866             printf(" %d", n_name);
21867             printf(" %d", n_value);
21868             printf("\n");
21869         }
21870     }
21871     }
21872     }
21873     function_tests++;
21874
21875     return(test_ret);
21876 }
21877
21878
21879 static int
21880 test_xmlNewDocRawNode(void) {
21881     int test_ret = 0;
21882
21883 #if defined(LIBXML_TREE_ENABLED)
21884 #ifdef LIBXML_TREE_ENABLED
21885     int mem_base;
21886     xmlNodePtr ret_val;
21887     xmlDocPtr doc; /* the document */
21888     int n_doc;
21889     xmlNsPtr ns; /* namespace if any */
21890     int n_ns;
21891     xmlChar * name; /* the node name */
21892     int n_name;
21893     xmlChar * content; /* the text content if any */
21894     int n_content;
21895
21896     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21897     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21898     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21899     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21900         mem_base = xmlMemBlocks();
21901         doc = gen_xmlDocPtr(n_doc, 0);
21902         ns = gen_xmlNsPtr(n_ns, 1);
21903         name = gen_const_xmlChar_ptr(n_name, 2);
21904         content = gen_const_xmlChar_ptr(n_content, 3);
21905
21906         ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21907         desret_xmlNodePtr(ret_val);
21908         call_tests++;
21909         des_xmlDocPtr(n_doc, doc, 0);
21910         des_xmlNsPtr(n_ns, ns, 1);
21911         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21912         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21913         xmlResetLastError();
21914         if (mem_base != xmlMemBlocks()) {
21915             printf("Leak of %d blocks found in xmlNewDocRawNode",
21916                    xmlMemBlocks() - mem_base);
21917             test_ret++;
21918             printf(" %d", n_doc);
21919             printf(" %d", n_ns);
21920             printf(" %d", n_name);
21921             printf(" %d", n_content);
21922             printf("\n");
21923         }
21924     }
21925     }
21926     }
21927     }
21928     function_tests++;
21929 #endif
21930 #endif
21931
21932     return(test_ret);
21933 }
21934
21935
21936 static int
21937 test_xmlNewDocText(void) {
21938     int test_ret = 0;
21939
21940     int mem_base;
21941     xmlNodePtr ret_val;
21942     xmlDoc * doc; /* the document */
21943     int n_doc;
21944     xmlChar * content; /* the text content */
21945     int n_content;
21946
21947     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21948     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21949         mem_base = xmlMemBlocks();
21950         doc = gen_const_xmlDoc_ptr(n_doc, 0);
21951         content = gen_const_xmlChar_ptr(n_content, 1);
21952
21953         ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content);
21954         desret_xmlNodePtr(ret_val);
21955         call_tests++;
21956         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
21957         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21958         xmlResetLastError();
21959         if (mem_base != xmlMemBlocks()) {
21960             printf("Leak of %d blocks found in xmlNewDocText",
21961                    xmlMemBlocks() - mem_base);
21962             test_ret++;
21963             printf(" %d", n_doc);
21964             printf(" %d", n_content);
21965             printf("\n");
21966         }
21967     }
21968     }
21969     function_tests++;
21970
21971     return(test_ret);
21972 }
21973
21974
21975 static int
21976 test_xmlNewDocTextLen(void) {
21977     int test_ret = 0;
21978
21979     int mem_base;
21980     xmlNodePtr ret_val;
21981     xmlDocPtr doc; /* the document */
21982     int n_doc;
21983     xmlChar * content; /* the text content */
21984     int n_content;
21985     int len; /* the text len. */
21986     int n_len;
21987
21988     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21989     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21990     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21991         mem_base = xmlMemBlocks();
21992         doc = gen_xmlDocPtr(n_doc, 0);
21993         content = gen_const_xmlChar_ptr(n_content, 1);
21994         len = gen_int(n_len, 2);
21995
21996         ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21997         desret_xmlNodePtr(ret_val);
21998         call_tests++;
21999         des_xmlDocPtr(n_doc, doc, 0);
22000         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22001         des_int(n_len, len, 2);
22002         xmlResetLastError();
22003         if (mem_base != xmlMemBlocks()) {
22004             printf("Leak of %d blocks found in xmlNewDocTextLen",
22005                    xmlMemBlocks() - mem_base);
22006             test_ret++;
22007             printf(" %d", n_doc);
22008             printf(" %d", n_content);
22009             printf(" %d", n_len);
22010             printf("\n");
22011         }
22012     }
22013     }
22014     }
22015     function_tests++;
22016
22017     return(test_ret);
22018 }
22019
22020
22021 static int
22022 test_xmlNewDtd(void) {
22023     int test_ret = 0;
22024
22025     int mem_base;
22026     xmlDtdPtr ret_val;
22027     xmlDocPtr doc; /* the document pointer */
22028     int n_doc;
22029     xmlChar * name; /* the DTD name */
22030     int n_name;
22031     xmlChar * ExternalID; /* the external ID */
22032     int n_ExternalID;
22033     xmlChar * SystemID; /* the system ID */
22034     int n_SystemID;
22035
22036     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22037     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22038     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
22039     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
22040         mem_base = xmlMemBlocks();
22041         doc = gen_xmlDocPtr(n_doc, 0);
22042         name = gen_const_xmlChar_ptr(n_name, 1);
22043         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
22044         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
22045
22046         ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
22047         desret_xmlDtdPtr(ret_val);
22048         call_tests++;
22049         des_xmlDocPtr(n_doc, doc, 0);
22050         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22051         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
22052         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
22053         xmlResetLastError();
22054         if (mem_base != xmlMemBlocks()) {
22055             printf("Leak of %d blocks found in xmlNewDtd",
22056                    xmlMemBlocks() - mem_base);
22057             test_ret++;
22058             printf(" %d", n_doc);
22059             printf(" %d", n_name);
22060             printf(" %d", n_ExternalID);
22061             printf(" %d", n_SystemID);
22062             printf("\n");
22063         }
22064     }
22065     }
22066     }
22067     }
22068     function_tests++;
22069
22070     return(test_ret);
22071 }
22072
22073
22074 static int
22075 test_xmlNewNode(void) {
22076     int test_ret = 0;
22077
22078     int mem_base;
22079     xmlNodePtr ret_val;
22080     xmlNsPtr ns; /* namespace if any */
22081     int n_ns;
22082     xmlChar * name; /* the node name */
22083     int n_name;
22084
22085     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22086     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22087         mem_base = xmlMemBlocks();
22088         ns = gen_xmlNsPtr(n_ns, 0);
22089         name = gen_const_xmlChar_ptr(n_name, 1);
22090
22091         ret_val = xmlNewNode(ns, (const xmlChar *)name);
22092         desret_xmlNodePtr(ret_val);
22093         call_tests++;
22094         des_xmlNsPtr(n_ns, ns, 0);
22095         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22096         xmlResetLastError();
22097         if (mem_base != xmlMemBlocks()) {
22098             printf("Leak of %d blocks found in xmlNewNode",
22099                    xmlMemBlocks() - mem_base);
22100             test_ret++;
22101             printf(" %d", n_ns);
22102             printf(" %d", n_name);
22103             printf("\n");
22104         }
22105     }
22106     }
22107     function_tests++;
22108
22109     return(test_ret);
22110 }
22111
22112
22113 static int
22114 test_xmlNewNodeEatName(void) {
22115     int test_ret = 0;
22116
22117     int mem_base;
22118     xmlNodePtr ret_val;
22119     xmlNsPtr ns; /* namespace if any */
22120     int n_ns;
22121     xmlChar * name; /* the node name */
22122     int n_name;
22123
22124     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22125     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
22126         mem_base = xmlMemBlocks();
22127         ns = gen_xmlNsPtr(n_ns, 0);
22128         name = gen_eaten_name(n_name, 1);
22129
22130         ret_val = xmlNewNodeEatName(ns, name);
22131         desret_xmlNodePtr(ret_val);
22132         call_tests++;
22133         des_xmlNsPtr(n_ns, ns, 0);
22134         des_eaten_name(n_name, name, 1);
22135         xmlResetLastError();
22136         if (mem_base != xmlMemBlocks()) {
22137             printf("Leak of %d blocks found in xmlNewNodeEatName",
22138                    xmlMemBlocks() - mem_base);
22139             test_ret++;
22140             printf(" %d", n_ns);
22141             printf(" %d", n_name);
22142             printf("\n");
22143         }
22144     }
22145     }
22146     function_tests++;
22147
22148     return(test_ret);
22149 }
22150
22151
22152 static int
22153 test_xmlNewNs(void) {
22154     int test_ret = 0;
22155
22156     int mem_base;
22157     xmlNsPtr ret_val;
22158     xmlNodePtr node; /* the element carrying the namespace */
22159     int n_node;
22160     xmlChar * href; /* the URI associated */
22161     int n_href;
22162     xmlChar * prefix; /* the prefix for the namespace */
22163     int n_prefix;
22164
22165     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22166     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22167     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
22168         mem_base = xmlMemBlocks();
22169         node = gen_xmlNodePtr(n_node, 0);
22170         href = gen_const_xmlChar_ptr(n_href, 1);
22171         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
22172
22173         ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
22174         if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
22175         desret_xmlNsPtr(ret_val);
22176         call_tests++;
22177         des_xmlNodePtr(n_node, node, 0);
22178         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
22179         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
22180         xmlResetLastError();
22181         if (mem_base != xmlMemBlocks()) {
22182             printf("Leak of %d blocks found in xmlNewNs",
22183                    xmlMemBlocks() - mem_base);
22184             test_ret++;
22185             printf(" %d", n_node);
22186             printf(" %d", n_href);
22187             printf(" %d", n_prefix);
22188             printf("\n");
22189         }
22190     }
22191     }
22192     }
22193     function_tests++;
22194
22195     return(test_ret);
22196 }
22197
22198
22199 static int
22200 test_xmlNewNsProp(void) {
22201     int test_ret = 0;
22202
22203     int mem_base;
22204     xmlAttrPtr ret_val;
22205     xmlNodePtr node; /* the holding node */
22206     int n_node;
22207     xmlNsPtr ns; /* the namespace */
22208     int n_ns;
22209     xmlChar * name; /* the name of the attribute */
22210     int n_name;
22211     xmlChar * value; /* the value of the attribute */
22212     int n_value;
22213
22214     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22215     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22216     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22217     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22218         mem_base = xmlMemBlocks();
22219         node = gen_xmlNodePtr(n_node, 0);
22220         ns = gen_xmlNsPtr(n_ns, 1);
22221         name = gen_const_xmlChar_ptr(n_name, 2);
22222         value = gen_const_xmlChar_ptr(n_value, 3);
22223
22224         ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
22225         desret_xmlAttrPtr(ret_val);
22226         call_tests++;
22227         des_xmlNodePtr(n_node, node, 0);
22228         des_xmlNsPtr(n_ns, ns, 1);
22229         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22230         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
22231         xmlResetLastError();
22232         if (mem_base != xmlMemBlocks()) {
22233             printf("Leak of %d blocks found in xmlNewNsProp",
22234                    xmlMemBlocks() - mem_base);
22235             test_ret++;
22236             printf(" %d", n_node);
22237             printf(" %d", n_ns);
22238             printf(" %d", n_name);
22239             printf(" %d", n_value);
22240             printf("\n");
22241         }
22242     }
22243     }
22244     }
22245     }
22246     function_tests++;
22247
22248     return(test_ret);
22249 }
22250
22251
22252 static int
22253 test_xmlNewNsPropEatName(void) {
22254     int test_ret = 0;
22255
22256     int mem_base;
22257     xmlAttrPtr ret_val;
22258     xmlNodePtr node; /* the holding node */
22259     int n_node;
22260     xmlNsPtr ns; /* the namespace */
22261     int n_ns;
22262     xmlChar * name; /* the name of the attribute */
22263     int n_name;
22264     xmlChar * value; /* the value of the attribute */
22265     int n_value;
22266
22267     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22268     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22269     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
22270     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22271         mem_base = xmlMemBlocks();
22272         node = gen_xmlNodePtr(n_node, 0);
22273         ns = gen_xmlNsPtr(n_ns, 1);
22274         name = gen_eaten_name(n_name, 2);
22275         value = gen_const_xmlChar_ptr(n_value, 3);
22276
22277         ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
22278         desret_xmlAttrPtr(ret_val);
22279         call_tests++;
22280         des_xmlNodePtr(n_node, node, 0);
22281         des_xmlNsPtr(n_ns, ns, 1);
22282         des_eaten_name(n_name, name, 2);
22283         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
22284         xmlResetLastError();
22285         if (mem_base != xmlMemBlocks()) {
22286             printf("Leak of %d blocks found in xmlNewNsPropEatName",
22287                    xmlMemBlocks() - mem_base);
22288             test_ret++;
22289             printf(" %d", n_node);
22290             printf(" %d", n_ns);
22291             printf(" %d", n_name);
22292             printf(" %d", n_value);
22293             printf("\n");
22294         }
22295     }
22296     }
22297     }
22298     }
22299     function_tests++;
22300
22301     return(test_ret);
22302 }
22303
22304
22305 static int
22306 test_xmlNewPI(void) {
22307     int test_ret = 0;
22308
22309     int mem_base;
22310     xmlNodePtr ret_val;
22311     xmlChar * name; /* the processing instruction name */
22312     int n_name;
22313     xmlChar * content; /* the PI content */
22314     int n_content;
22315
22316     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22317     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22318         mem_base = xmlMemBlocks();
22319         name = gen_const_xmlChar_ptr(n_name, 0);
22320         content = gen_const_xmlChar_ptr(n_content, 1);
22321
22322         ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
22323         desret_xmlNodePtr(ret_val);
22324         call_tests++;
22325         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22326         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22327         xmlResetLastError();
22328         if (mem_base != xmlMemBlocks()) {
22329             printf("Leak of %d blocks found in xmlNewPI",
22330                    xmlMemBlocks() - mem_base);
22331             test_ret++;
22332             printf(" %d", n_name);
22333             printf(" %d", n_content);
22334             printf("\n");
22335         }
22336     }
22337     }
22338     function_tests++;
22339
22340     return(test_ret);
22341 }
22342
22343
22344 static int
22345 test_xmlNewProp(void) {
22346     int test_ret = 0;
22347
22348 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22349 #ifdef LIBXML_TREE_ENABLED
22350     int mem_base;
22351     xmlAttrPtr ret_val;
22352     xmlNodePtr node; /* the holding node */
22353     int n_node;
22354     xmlChar * name; /* the name of the attribute */
22355     int n_name;
22356     xmlChar * value; /* the value of the attribute */
22357     int n_value;
22358
22359     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22360     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22361     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22362         mem_base = xmlMemBlocks();
22363         node = gen_xmlNodePtr(n_node, 0);
22364         name = gen_const_xmlChar_ptr(n_name, 1);
22365         value = gen_const_xmlChar_ptr(n_value, 2);
22366
22367         ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
22368         desret_xmlAttrPtr(ret_val);
22369         call_tests++;
22370         des_xmlNodePtr(n_node, node, 0);
22371         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22372         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22373         xmlResetLastError();
22374         if (mem_base != xmlMemBlocks()) {
22375             printf("Leak of %d blocks found in xmlNewProp",
22376                    xmlMemBlocks() - mem_base);
22377             test_ret++;
22378             printf(" %d", n_node);
22379             printf(" %d", n_name);
22380             printf(" %d", n_value);
22381             printf("\n");
22382         }
22383     }
22384     }
22385     }
22386     function_tests++;
22387 #endif
22388 #endif
22389
22390     return(test_ret);
22391 }
22392
22393
22394 static int
22395 test_xmlNewReference(void) {
22396     int test_ret = 0;
22397
22398     int mem_base;
22399     xmlNodePtr ret_val;
22400     xmlDoc * doc; /* the document */
22401     int n_doc;
22402     xmlChar * name; /* the reference name, or the reference string with & and ; */
22403     int n_name;
22404
22405     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22406     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22407         mem_base = xmlMemBlocks();
22408         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22409         name = gen_const_xmlChar_ptr(n_name, 1);
22410
22411         ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name);
22412         desret_xmlNodePtr(ret_val);
22413         call_tests++;
22414         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22415         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22416         xmlResetLastError();
22417         if (mem_base != xmlMemBlocks()) {
22418             printf("Leak of %d blocks found in xmlNewReference",
22419                    xmlMemBlocks() - mem_base);
22420             test_ret++;
22421             printf(" %d", n_doc);
22422             printf(" %d", n_name);
22423             printf("\n");
22424         }
22425     }
22426     }
22427     function_tests++;
22428
22429     return(test_ret);
22430 }
22431
22432
22433 static int
22434 test_xmlNewText(void) {
22435     int test_ret = 0;
22436
22437     int mem_base;
22438     xmlNodePtr ret_val;
22439     xmlChar * content; /* the text content */
22440     int n_content;
22441
22442     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22443         mem_base = xmlMemBlocks();
22444         content = gen_const_xmlChar_ptr(n_content, 0);
22445
22446         ret_val = xmlNewText((const xmlChar *)content);
22447         desret_xmlNodePtr(ret_val);
22448         call_tests++;
22449         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22450         xmlResetLastError();
22451         if (mem_base != xmlMemBlocks()) {
22452             printf("Leak of %d blocks found in xmlNewText",
22453                    xmlMemBlocks() - mem_base);
22454             test_ret++;
22455             printf(" %d", n_content);
22456             printf("\n");
22457         }
22458     }
22459     function_tests++;
22460
22461     return(test_ret);
22462 }
22463
22464
22465 static int
22466 test_xmlNewTextChild(void) {
22467     int test_ret = 0;
22468
22469 #if defined(LIBXML_TREE_ENABLED)
22470 #ifdef LIBXML_TREE_ENABLED
22471     int mem_base;
22472     xmlNodePtr ret_val;
22473     xmlNodePtr parent; /* the parent node */
22474     int n_parent;
22475     xmlNsPtr ns; /* a namespace if any */
22476     int n_ns;
22477     xmlChar * name; /* the name of the child */
22478     int n_name;
22479     xmlChar * content; /* the text content of the child if any. */
22480     int n_content;
22481
22482     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
22483     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22484     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22485     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22486         mem_base = xmlMemBlocks();
22487         parent = gen_xmlNodePtr(n_parent, 0);
22488         ns = gen_xmlNsPtr(n_ns, 1);
22489         name = gen_const_xmlChar_ptr(n_name, 2);
22490         content = gen_const_xmlChar_ptr(n_content, 3);
22491
22492         ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
22493         desret_xmlNodePtr(ret_val);
22494         call_tests++;
22495         des_xmlNodePtr(n_parent, parent, 0);
22496         des_xmlNsPtr(n_ns, ns, 1);
22497         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22498         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
22499         xmlResetLastError();
22500         if (mem_base != xmlMemBlocks()) {
22501             printf("Leak of %d blocks found in xmlNewTextChild",
22502                    xmlMemBlocks() - mem_base);
22503             test_ret++;
22504             printf(" %d", n_parent);
22505             printf(" %d", n_ns);
22506             printf(" %d", n_name);
22507             printf(" %d", n_content);
22508             printf("\n");
22509         }
22510     }
22511     }
22512     }
22513     }
22514     function_tests++;
22515 #endif
22516 #endif
22517
22518     return(test_ret);
22519 }
22520
22521
22522 static int
22523 test_xmlNewTextLen(void) {
22524     int test_ret = 0;
22525
22526     int mem_base;
22527     xmlNodePtr ret_val;
22528     xmlChar * content; /* the text content */
22529     int n_content;
22530     int len; /* the text len. */
22531     int n_len;
22532
22533     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22534     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22535         mem_base = xmlMemBlocks();
22536         content = gen_const_xmlChar_ptr(n_content, 0);
22537         len = gen_int(n_len, 1);
22538
22539         ret_val = xmlNewTextLen((const xmlChar *)content, len);
22540         desret_xmlNodePtr(ret_val);
22541         call_tests++;
22542         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22543         des_int(n_len, len, 1);
22544         xmlResetLastError();
22545         if (mem_base != xmlMemBlocks()) {
22546             printf("Leak of %d blocks found in xmlNewTextLen",
22547                    xmlMemBlocks() - mem_base);
22548             test_ret++;
22549             printf(" %d", n_content);
22550             printf(" %d", n_len);
22551             printf("\n");
22552         }
22553     }
22554     }
22555     function_tests++;
22556
22557     return(test_ret);
22558 }
22559
22560
22561 static int
22562 test_xmlNextElementSibling(void) {
22563     int test_ret = 0;
22564
22565 #if defined(LIBXML_TREE_ENABLED)
22566     int mem_base;
22567     xmlNodePtr ret_val;
22568     xmlNodePtr node; /* the current node */
22569     int n_node;
22570
22571     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22572         mem_base = xmlMemBlocks();
22573         node = gen_xmlNodePtr(n_node, 0);
22574
22575         ret_val = xmlNextElementSibling(node);
22576         desret_xmlNodePtr(ret_val);
22577         call_tests++;
22578         des_xmlNodePtr(n_node, node, 0);
22579         xmlResetLastError();
22580         if (mem_base != xmlMemBlocks()) {
22581             printf("Leak of %d blocks found in xmlNextElementSibling",
22582                    xmlMemBlocks() - mem_base);
22583             test_ret++;
22584             printf(" %d", n_node);
22585             printf("\n");
22586         }
22587     }
22588     function_tests++;
22589 #endif
22590
22591     return(test_ret);
22592 }
22593
22594
22595 static int
22596 test_xmlNodeAddContent(void) {
22597     int test_ret = 0;
22598
22599     int mem_base;
22600     xmlNodePtr cur; /* the node being modified */
22601     int n_cur;
22602     xmlChar * content; /* extra content */
22603     int n_content;
22604
22605     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22606     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22607         mem_base = xmlMemBlocks();
22608         cur = gen_xmlNodePtr(n_cur, 0);
22609         content = gen_const_xmlChar_ptr(n_content, 1);
22610
22611         xmlNodeAddContent(cur, (const xmlChar *)content);
22612         call_tests++;
22613         des_xmlNodePtr(n_cur, cur, 0);
22614         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22615         xmlResetLastError();
22616         if (mem_base != xmlMemBlocks()) {
22617             printf("Leak of %d blocks found in xmlNodeAddContent",
22618                    xmlMemBlocks() - mem_base);
22619             test_ret++;
22620             printf(" %d", n_cur);
22621             printf(" %d", n_content);
22622             printf("\n");
22623         }
22624     }
22625     }
22626     function_tests++;
22627
22628     return(test_ret);
22629 }
22630
22631
22632 static int
22633 test_xmlNodeAddContentLen(void) {
22634     int test_ret = 0;
22635
22636     int mem_base;
22637     xmlNodePtr cur; /* the node being modified */
22638     int n_cur;
22639     xmlChar * content; /* extra content */
22640     int n_content;
22641     int len; /* the size of @content */
22642     int n_len;
22643
22644     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22645     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22646     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22647         mem_base = xmlMemBlocks();
22648         cur = gen_xmlNodePtr(n_cur, 0);
22649         content = gen_const_xmlChar_ptr(n_content, 1);
22650         len = gen_int(n_len, 2);
22651
22652         xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22653         call_tests++;
22654         des_xmlNodePtr(n_cur, cur, 0);
22655         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22656         des_int(n_len, len, 2);
22657         xmlResetLastError();
22658         if (mem_base != xmlMemBlocks()) {
22659             printf("Leak of %d blocks found in xmlNodeAddContentLen",
22660                    xmlMemBlocks() - mem_base);
22661             test_ret++;
22662             printf(" %d", n_cur);
22663             printf(" %d", n_content);
22664             printf(" %d", n_len);
22665             printf("\n");
22666         }
22667     }
22668     }
22669     }
22670     function_tests++;
22671
22672     return(test_ret);
22673 }
22674
22675
22676 static int
22677 test_xmlNodeBufGetContent(void) {
22678     int test_ret = 0;
22679
22680     int mem_base;
22681     int ret_val;
22682     xmlBufferPtr buffer; /* a buffer */
22683     int n_buffer;
22684     xmlNode * cur; /* the node being read */
22685     int n_cur;
22686
22687     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22688     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22689         mem_base = xmlMemBlocks();
22690         buffer = gen_xmlBufferPtr(n_buffer, 0);
22691         cur = gen_const_xmlNode_ptr(n_cur, 1);
22692
22693         ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur);
22694         desret_int(ret_val);
22695         call_tests++;
22696         des_xmlBufferPtr(n_buffer, buffer, 0);
22697         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22698         xmlResetLastError();
22699         if (mem_base != xmlMemBlocks()) {
22700             printf("Leak of %d blocks found in xmlNodeBufGetContent",
22701                    xmlMemBlocks() - mem_base);
22702             test_ret++;
22703             printf(" %d", n_buffer);
22704             printf(" %d", n_cur);
22705             printf("\n");
22706         }
22707     }
22708     }
22709     function_tests++;
22710
22711     return(test_ret);
22712 }
22713
22714
22715 static int
22716 test_xmlNodeDump(void) {
22717     int test_ret = 0;
22718
22719 #if defined(LIBXML_OUTPUT_ENABLED)
22720     int mem_base;
22721     int ret_val;
22722     xmlBufferPtr buf; /* the XML buffer output */
22723     int n_buf;
22724     xmlDocPtr doc; /* the document */
22725     int n_doc;
22726     xmlNodePtr cur; /* the current node */
22727     int n_cur;
22728     int level; /* the imbrication level for indenting */
22729     int n_level;
22730     int format; /* is formatting allowed */
22731     int n_format;
22732
22733     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22734     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22735     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22736     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22737     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22738         mem_base = xmlMemBlocks();
22739         buf = gen_xmlBufferPtr(n_buf, 0);
22740         doc = gen_xmlDocPtr(n_doc, 1);
22741         cur = gen_xmlNodePtr(n_cur, 2);
22742         level = gen_int(n_level, 3);
22743         format = gen_int(n_format, 4);
22744
22745         ret_val = xmlNodeDump(buf, doc, cur, level, format);
22746         desret_int(ret_val);
22747         call_tests++;
22748         des_xmlBufferPtr(n_buf, buf, 0);
22749         des_xmlDocPtr(n_doc, doc, 1);
22750         des_xmlNodePtr(n_cur, cur, 2);
22751         des_int(n_level, level, 3);
22752         des_int(n_format, format, 4);
22753         xmlResetLastError();
22754         if (mem_base != xmlMemBlocks()) {
22755             printf("Leak of %d blocks found in xmlNodeDump",
22756                    xmlMemBlocks() - mem_base);
22757             test_ret++;
22758             printf(" %d", n_buf);
22759             printf(" %d", n_doc);
22760             printf(" %d", n_cur);
22761             printf(" %d", n_level);
22762             printf(" %d", n_format);
22763             printf("\n");
22764         }
22765     }
22766     }
22767     }
22768     }
22769     }
22770     function_tests++;
22771 #endif
22772
22773     return(test_ret);
22774 }
22775
22776
22777 static int
22778 test_xmlNodeDumpOutput(void) {
22779     int test_ret = 0;
22780
22781 #if defined(LIBXML_OUTPUT_ENABLED)
22782     int mem_base;
22783     xmlOutputBufferPtr buf; /* the XML buffer output */
22784     int n_buf;
22785     xmlDocPtr doc; /* the document */
22786     int n_doc;
22787     xmlNodePtr cur; /* the current node */
22788     int n_cur;
22789     int level; /* the imbrication level for indenting */
22790     int n_level;
22791     int format; /* is formatting allowed */
22792     int n_format;
22793     char * encoding; /* an optional encoding string */
22794     int n_encoding;
22795
22796     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22797     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22798     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22799     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22800     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22801     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22802         mem_base = xmlMemBlocks();
22803         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22804         doc = gen_xmlDocPtr(n_doc, 1);
22805         cur = gen_xmlNodePtr(n_cur, 2);
22806         level = gen_int(n_level, 3);
22807         format = gen_int(n_format, 4);
22808         encoding = gen_const_char_ptr(n_encoding, 5);
22809
22810         xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22811         call_tests++;
22812         des_xmlOutputBufferPtr(n_buf, buf, 0);
22813         des_xmlDocPtr(n_doc, doc, 1);
22814         des_xmlNodePtr(n_cur, cur, 2);
22815         des_int(n_level, level, 3);
22816         des_int(n_format, format, 4);
22817         des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22818         xmlResetLastError();
22819         if (mem_base != xmlMemBlocks()) {
22820             printf("Leak of %d blocks found in xmlNodeDumpOutput",
22821                    xmlMemBlocks() - mem_base);
22822             test_ret++;
22823             printf(" %d", n_buf);
22824             printf(" %d", n_doc);
22825             printf(" %d", n_cur);
22826             printf(" %d", n_level);
22827             printf(" %d", n_format);
22828             printf(" %d", n_encoding);
22829             printf("\n");
22830         }
22831     }
22832     }
22833     }
22834     }
22835     }
22836     }
22837     function_tests++;
22838 #endif
22839
22840     return(test_ret);
22841 }
22842
22843
22844 static int
22845 test_xmlNodeGetBase(void) {
22846     int test_ret = 0;
22847
22848     int mem_base;
22849     xmlChar * ret_val;
22850     xmlDoc * doc; /* the document the node pertains to */
22851     int n_doc;
22852     xmlNode * cur; /* the node being checked */
22853     int n_cur;
22854
22855     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22856     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22857         mem_base = xmlMemBlocks();
22858         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22859         cur = gen_const_xmlNode_ptr(n_cur, 1);
22860
22861         ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur);
22862         desret_xmlChar_ptr(ret_val);
22863         call_tests++;
22864         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22865         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22866         xmlResetLastError();
22867         if (mem_base != xmlMemBlocks()) {
22868             printf("Leak of %d blocks found in xmlNodeGetBase",
22869                    xmlMemBlocks() - mem_base);
22870             test_ret++;
22871             printf(" %d", n_doc);
22872             printf(" %d", n_cur);
22873             printf("\n");
22874         }
22875     }
22876     }
22877     function_tests++;
22878
22879     return(test_ret);
22880 }
22881
22882
22883 static int
22884 test_xmlNodeGetContent(void) {
22885     int test_ret = 0;
22886
22887     int mem_base;
22888     xmlChar * ret_val;
22889     xmlNode * cur; /* the node being read */
22890     int n_cur;
22891
22892     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22893         mem_base = xmlMemBlocks();
22894         cur = gen_const_xmlNode_ptr(n_cur, 0);
22895
22896         ret_val = xmlNodeGetContent((const xmlNode *)cur);
22897         desret_xmlChar_ptr(ret_val);
22898         call_tests++;
22899         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22900         xmlResetLastError();
22901         if (mem_base != xmlMemBlocks()) {
22902             printf("Leak of %d blocks found in xmlNodeGetContent",
22903                    xmlMemBlocks() - mem_base);
22904             test_ret++;
22905             printf(" %d", n_cur);
22906             printf("\n");
22907         }
22908     }
22909     function_tests++;
22910
22911     return(test_ret);
22912 }
22913
22914
22915 static int
22916 test_xmlNodeGetLang(void) {
22917     int test_ret = 0;
22918
22919     int mem_base;
22920     xmlChar * ret_val;
22921     xmlNode * cur; /* the node being checked */
22922     int n_cur;
22923
22924     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22925         mem_base = xmlMemBlocks();
22926         cur = gen_const_xmlNode_ptr(n_cur, 0);
22927
22928         ret_val = xmlNodeGetLang((const xmlNode *)cur);
22929         desret_xmlChar_ptr(ret_val);
22930         call_tests++;
22931         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22932         xmlResetLastError();
22933         if (mem_base != xmlMemBlocks()) {
22934             printf("Leak of %d blocks found in xmlNodeGetLang",
22935                    xmlMemBlocks() - mem_base);
22936             test_ret++;
22937             printf(" %d", n_cur);
22938             printf("\n");
22939         }
22940     }
22941     function_tests++;
22942
22943     return(test_ret);
22944 }
22945
22946
22947 static int
22948 test_xmlNodeGetSpacePreserve(void) {
22949     int test_ret = 0;
22950
22951     int mem_base;
22952     int ret_val;
22953     xmlNode * cur; /* the node being checked */
22954     int n_cur;
22955
22956     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22957         mem_base = xmlMemBlocks();
22958         cur = gen_const_xmlNode_ptr(n_cur, 0);
22959
22960         ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur);
22961         desret_int(ret_val);
22962         call_tests++;
22963         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22964         xmlResetLastError();
22965         if (mem_base != xmlMemBlocks()) {
22966             printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22967                    xmlMemBlocks() - mem_base);
22968             test_ret++;
22969             printf(" %d", n_cur);
22970             printf("\n");
22971         }
22972     }
22973     function_tests++;
22974
22975     return(test_ret);
22976 }
22977
22978
22979 static int
22980 test_xmlNodeIsText(void) {
22981     int test_ret = 0;
22982
22983     int mem_base;
22984     int ret_val;
22985     xmlNode * node; /* the node */
22986     int n_node;
22987
22988     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
22989         mem_base = xmlMemBlocks();
22990         node = gen_const_xmlNode_ptr(n_node, 0);
22991
22992         ret_val = xmlNodeIsText((const xmlNode *)node);
22993         desret_int(ret_val);
22994         call_tests++;
22995         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
22996         xmlResetLastError();
22997         if (mem_base != xmlMemBlocks()) {
22998             printf("Leak of %d blocks found in xmlNodeIsText",
22999                    xmlMemBlocks() - mem_base);
23000             test_ret++;
23001             printf(" %d", n_node);
23002             printf("\n");
23003         }
23004     }
23005     function_tests++;
23006
23007     return(test_ret);
23008 }
23009
23010
23011 static int
23012 test_xmlNodeListGetRawString(void) {
23013     int test_ret = 0;
23014
23015 #if defined(LIBXML_TREE_ENABLED)
23016     int mem_base;
23017     xmlChar * ret_val;
23018     xmlDoc * doc; /* the document */
23019     int n_doc;
23020     xmlNode * list; /* a Node list */
23021     int n_list;
23022     int inLine; /* should we replace entity contents or show their external form */
23023     int n_inLine;
23024
23025     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23026     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
23027     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
23028         mem_base = xmlMemBlocks();
23029         doc = gen_const_xmlDoc_ptr(n_doc, 0);
23030         list = gen_const_xmlNode_ptr(n_list, 1);
23031         inLine = gen_int(n_inLine, 2);
23032
23033         ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine);
23034         desret_xmlChar_ptr(ret_val);
23035         call_tests++;
23036         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23037         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
23038         des_int(n_inLine, inLine, 2);
23039         xmlResetLastError();
23040         if (mem_base != xmlMemBlocks()) {
23041             printf("Leak of %d blocks found in xmlNodeListGetRawString",
23042                    xmlMemBlocks() - mem_base);
23043             test_ret++;
23044             printf(" %d", n_doc);
23045             printf(" %d", n_list);
23046             printf(" %d", n_inLine);
23047             printf("\n");
23048         }
23049     }
23050     }
23051     }
23052     function_tests++;
23053 #endif
23054
23055     return(test_ret);
23056 }
23057
23058
23059 static int
23060 test_xmlNodeListGetString(void) {
23061     int test_ret = 0;
23062
23063     int mem_base;
23064     xmlChar * ret_val;
23065     xmlDocPtr doc; /* the document */
23066     int n_doc;
23067     xmlNode * list; /* a Node list */
23068     int n_list;
23069     int inLine; /* should we replace entity contents or show their external form */
23070     int n_inLine;
23071
23072     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23073     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
23074     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
23075         mem_base = xmlMemBlocks();
23076         doc = gen_xmlDocPtr(n_doc, 0);
23077         list = gen_const_xmlNode_ptr(n_list, 1);
23078         inLine = gen_int(n_inLine, 2);
23079
23080         ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine);
23081         desret_xmlChar_ptr(ret_val);
23082         call_tests++;
23083         des_xmlDocPtr(n_doc, doc, 0);
23084         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
23085         des_int(n_inLine, inLine, 2);
23086         xmlResetLastError();
23087         if (mem_base != xmlMemBlocks()) {
23088             printf("Leak of %d blocks found in xmlNodeListGetString",
23089                    xmlMemBlocks() - mem_base);
23090             test_ret++;
23091             printf(" %d", n_doc);
23092             printf(" %d", n_list);
23093             printf(" %d", n_inLine);
23094             printf("\n");
23095         }
23096     }
23097     }
23098     }
23099     function_tests++;
23100
23101     return(test_ret);
23102 }
23103
23104
23105 static int
23106 test_xmlNodeSetBase(void) {
23107     int test_ret = 0;
23108
23109 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
23110     int mem_base;
23111     xmlNodePtr cur; /* the node being changed */
23112     int n_cur;
23113     xmlChar * uri; /* the new base URI */
23114     int n_uri;
23115
23116     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23117     for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
23118         mem_base = xmlMemBlocks();
23119         cur = gen_xmlNodePtr(n_cur, 0);
23120         uri = gen_const_xmlChar_ptr(n_uri, 1);
23121
23122         xmlNodeSetBase(cur, (const xmlChar *)uri);
23123         call_tests++;
23124         des_xmlNodePtr(n_cur, cur, 0);
23125         des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
23126         xmlResetLastError();
23127         if (mem_base != xmlMemBlocks()) {
23128             printf("Leak of %d blocks found in xmlNodeSetBase",
23129                    xmlMemBlocks() - mem_base);
23130             test_ret++;
23131             printf(" %d", n_cur);
23132             printf(" %d", n_uri);
23133             printf("\n");
23134         }
23135     }
23136     }
23137     function_tests++;
23138 #endif
23139
23140     return(test_ret);
23141 }
23142
23143
23144 static int
23145 test_xmlNodeSetContent(void) {
23146     int test_ret = 0;
23147
23148     int mem_base;
23149     xmlNodePtr cur; /* the node being modified */
23150     int n_cur;
23151     xmlChar * content; /* the new value of the content */
23152     int n_content;
23153
23154     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23155     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23156         mem_base = xmlMemBlocks();
23157         cur = gen_xmlNodePtr(n_cur, 0);
23158         content = gen_const_xmlChar_ptr(n_content, 1);
23159
23160         xmlNodeSetContent(cur, (const xmlChar *)content);
23161         call_tests++;
23162         des_xmlNodePtr(n_cur, cur, 0);
23163         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23164         xmlResetLastError();
23165         if (mem_base != xmlMemBlocks()) {
23166             printf("Leak of %d blocks found in xmlNodeSetContent",
23167                    xmlMemBlocks() - mem_base);
23168             test_ret++;
23169             printf(" %d", n_cur);
23170             printf(" %d", n_content);
23171             printf("\n");
23172         }
23173     }
23174     }
23175     function_tests++;
23176
23177     return(test_ret);
23178 }
23179
23180
23181 static int
23182 test_xmlNodeSetContentLen(void) {
23183     int test_ret = 0;
23184
23185 #if defined(LIBXML_TREE_ENABLED)
23186     int mem_base;
23187     xmlNodePtr cur; /* the node being modified */
23188     int n_cur;
23189     xmlChar * content; /* the new value of the content */
23190     int n_content;
23191     int len; /* the size of @content */
23192     int n_len;
23193
23194     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23195     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23196     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23197         mem_base = xmlMemBlocks();
23198         cur = gen_xmlNodePtr(n_cur, 0);
23199         content = gen_const_xmlChar_ptr(n_content, 1);
23200         len = gen_int(n_len, 2);
23201
23202         xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
23203         call_tests++;
23204         des_xmlNodePtr(n_cur, cur, 0);
23205         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23206         des_int(n_len, len, 2);
23207         xmlResetLastError();
23208         if (mem_base != xmlMemBlocks()) {
23209             printf("Leak of %d blocks found in xmlNodeSetContentLen",
23210                    xmlMemBlocks() - mem_base);
23211             test_ret++;
23212             printf(" %d", n_cur);
23213             printf(" %d", n_content);
23214             printf(" %d", n_len);
23215             printf("\n");
23216         }
23217     }
23218     }
23219     }
23220     function_tests++;
23221 #endif
23222
23223     return(test_ret);
23224 }
23225
23226
23227 static int
23228 test_xmlNodeSetLang(void) {
23229     int test_ret = 0;
23230
23231 #if defined(LIBXML_TREE_ENABLED)
23232     int mem_base;
23233     xmlNodePtr cur; /* the node being changed */
23234     int n_cur;
23235     xmlChar * lang; /* the language description */
23236     int n_lang;
23237
23238     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23239     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
23240         mem_base = xmlMemBlocks();
23241         cur = gen_xmlNodePtr(n_cur, 0);
23242         lang = gen_const_xmlChar_ptr(n_lang, 1);
23243
23244         xmlNodeSetLang(cur, (const xmlChar *)lang);
23245         call_tests++;
23246         des_xmlNodePtr(n_cur, cur, 0);
23247         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
23248         xmlResetLastError();
23249         if (mem_base != xmlMemBlocks()) {
23250             printf("Leak of %d blocks found in xmlNodeSetLang",
23251                    xmlMemBlocks() - mem_base);
23252             test_ret++;
23253             printf(" %d", n_cur);
23254             printf(" %d", n_lang);
23255             printf("\n");
23256         }
23257     }
23258     }
23259     function_tests++;
23260 #endif
23261
23262     return(test_ret);
23263 }
23264
23265
23266 static int
23267 test_xmlNodeSetName(void) {
23268     int test_ret = 0;
23269
23270 #if defined(LIBXML_TREE_ENABLED)
23271     int mem_base;
23272     xmlNodePtr cur; /* the node being changed */
23273     int n_cur;
23274     xmlChar * name; /* the new tag name */
23275     int n_name;
23276
23277     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23278     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23279         mem_base = xmlMemBlocks();
23280         cur = gen_xmlNodePtr(n_cur, 0);
23281         name = gen_const_xmlChar_ptr(n_name, 1);
23282
23283         xmlNodeSetName(cur, (const xmlChar *)name);
23284         call_tests++;
23285         des_xmlNodePtr(n_cur, cur, 0);
23286         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23287         xmlResetLastError();
23288         if (mem_base != xmlMemBlocks()) {
23289             printf("Leak of %d blocks found in xmlNodeSetName",
23290                    xmlMemBlocks() - mem_base);
23291             test_ret++;
23292             printf(" %d", n_cur);
23293             printf(" %d", n_name);
23294             printf("\n");
23295         }
23296     }
23297     }
23298     function_tests++;
23299 #endif
23300
23301     return(test_ret);
23302 }
23303
23304
23305 static int
23306 test_xmlNodeSetSpacePreserve(void) {
23307     int test_ret = 0;
23308
23309 #if defined(LIBXML_TREE_ENABLED)
23310     int mem_base;
23311     xmlNodePtr cur; /* the node being changed */
23312     int n_cur;
23313     int val; /* the xml:space value ("0": default, 1: "preserve") */
23314     int n_val;
23315
23316     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23317     for (n_val = 0;n_val < gen_nb_int;n_val++) {
23318         mem_base = xmlMemBlocks();
23319         cur = gen_xmlNodePtr(n_cur, 0);
23320         val = gen_int(n_val, 1);
23321
23322         xmlNodeSetSpacePreserve(cur, val);
23323         call_tests++;
23324         des_xmlNodePtr(n_cur, cur, 0);
23325         des_int(n_val, val, 1);
23326         xmlResetLastError();
23327         if (mem_base != xmlMemBlocks()) {
23328             printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
23329                    xmlMemBlocks() - mem_base);
23330             test_ret++;
23331             printf(" %d", n_cur);
23332             printf(" %d", n_val);
23333             printf("\n");
23334         }
23335     }
23336     }
23337     function_tests++;
23338 #endif
23339
23340     return(test_ret);
23341 }
23342
23343
23344 static int
23345 test_xmlPreviousElementSibling(void) {
23346     int test_ret = 0;
23347
23348 #if defined(LIBXML_TREE_ENABLED)
23349     int mem_base;
23350     xmlNodePtr ret_val;
23351     xmlNodePtr node; /* the current node */
23352     int n_node;
23353
23354     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23355         mem_base = xmlMemBlocks();
23356         node = gen_xmlNodePtr(n_node, 0);
23357
23358         ret_val = xmlPreviousElementSibling(node);
23359         desret_xmlNodePtr(ret_val);
23360         call_tests++;
23361         des_xmlNodePtr(n_node, node, 0);
23362         xmlResetLastError();
23363         if (mem_base != xmlMemBlocks()) {
23364             printf("Leak of %d blocks found in xmlPreviousElementSibling",
23365                    xmlMemBlocks() - mem_base);
23366             test_ret++;
23367             printf(" %d", n_node);
23368             printf("\n");
23369         }
23370     }
23371     function_tests++;
23372 #endif
23373
23374     return(test_ret);
23375 }
23376
23377
23378 static int
23379 test_xmlReconciliateNs(void) {
23380     int test_ret = 0;
23381
23382 #if defined(LIBXML_TREE_ENABLED)
23383 #ifdef LIBXML_TREE_ENABLED
23384     int mem_base;
23385     int ret_val;
23386     xmlDocPtr doc; /* the document */
23387     int n_doc;
23388     xmlNodePtr tree; /* a node defining the subtree to reconciliate */
23389     int n_tree;
23390
23391     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23392     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
23393         mem_base = xmlMemBlocks();
23394         doc = gen_xmlDocPtr(n_doc, 0);
23395         tree = gen_xmlNodePtr(n_tree, 1);
23396
23397         ret_val = xmlReconciliateNs(doc, tree);
23398         desret_int(ret_val);
23399         call_tests++;
23400         des_xmlDocPtr(n_doc, doc, 0);
23401         des_xmlNodePtr(n_tree, tree, 1);
23402         xmlResetLastError();
23403         if (mem_base != xmlMemBlocks()) {
23404             printf("Leak of %d blocks found in xmlReconciliateNs",
23405                    xmlMemBlocks() - mem_base);
23406             test_ret++;
23407             printf(" %d", n_doc);
23408             printf(" %d", n_tree);
23409             printf("\n");
23410         }
23411     }
23412     }
23413     function_tests++;
23414 #endif
23415 #endif
23416
23417     return(test_ret);
23418 }
23419
23420
23421 static int
23422 test_xmlRemoveProp(void) {
23423     int test_ret = 0;
23424
23425     int mem_base;
23426     int ret_val;
23427     xmlAttrPtr cur; /* an attribute */
23428     int n_cur;
23429
23430     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
23431         mem_base = xmlMemBlocks();
23432         cur = gen_xmlAttrPtr(n_cur, 0);
23433
23434         ret_val = xmlRemoveProp(cur);
23435         cur = NULL;
23436         desret_int(ret_val);
23437         call_tests++;
23438         des_xmlAttrPtr(n_cur, cur, 0);
23439         xmlResetLastError();
23440         if (mem_base != xmlMemBlocks()) {
23441             printf("Leak of %d blocks found in xmlRemoveProp",
23442                    xmlMemBlocks() - mem_base);
23443             test_ret++;
23444             printf(" %d", n_cur);
23445             printf("\n");
23446         }
23447     }
23448     function_tests++;
23449
23450     return(test_ret);
23451 }
23452
23453
23454 static int
23455 test_xmlReplaceNode(void) {
23456     int test_ret = 0;
23457
23458 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
23459     int mem_base;
23460     xmlNodePtr ret_val;
23461     xmlNodePtr old; /* the old node */
23462     int n_old;
23463     xmlNodePtr cur; /* the node */
23464     int n_cur;
23465
23466     for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
23467     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
23468         mem_base = xmlMemBlocks();
23469         old = gen_xmlNodePtr(n_old, 0);
23470         cur = gen_xmlNodePtr_in(n_cur, 1);
23471
23472         ret_val = xmlReplaceNode(old, cur);
23473         if (cur != NULL) {
23474               xmlUnlinkNode(cur);
23475               xmlFreeNode(cur) ; cur = NULL ; }
23476           if (old != NULL) {
23477               xmlUnlinkNode(old);
23478               xmlFreeNode(old) ; old = NULL ; }
23479           ret_val = NULL;
23480         desret_xmlNodePtr(ret_val);
23481         call_tests++;
23482         des_xmlNodePtr(n_old, old, 0);
23483         des_xmlNodePtr_in(n_cur, cur, 1);
23484         xmlResetLastError();
23485         if (mem_base != xmlMemBlocks()) {
23486             printf("Leak of %d blocks found in xmlReplaceNode",
23487                    xmlMemBlocks() - mem_base);
23488             test_ret++;
23489             printf(" %d", n_old);
23490             printf(" %d", n_cur);
23491             printf("\n");
23492         }
23493     }
23494     }
23495     function_tests++;
23496 #endif
23497
23498     return(test_ret);
23499 }
23500
23501
23502 static int
23503 test_xmlSaveFile(void) {
23504     int test_ret = 0;
23505
23506 #if defined(LIBXML_OUTPUT_ENABLED)
23507     int mem_base;
23508     int ret_val;
23509     const char * filename; /* the filename (or URL) */
23510     int n_filename;
23511     xmlDocPtr cur; /* the document */
23512     int n_cur;
23513
23514     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23515     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23516         mem_base = xmlMemBlocks();
23517         filename = gen_fileoutput(n_filename, 0);
23518         cur = gen_xmlDocPtr(n_cur, 1);
23519
23520         ret_val = xmlSaveFile(filename, cur);
23521         desret_int(ret_val);
23522         call_tests++;
23523         des_fileoutput(n_filename, filename, 0);
23524         des_xmlDocPtr(n_cur, cur, 1);
23525         xmlResetLastError();
23526         if (mem_base != xmlMemBlocks()) {
23527             printf("Leak of %d blocks found in xmlSaveFile",
23528                    xmlMemBlocks() - mem_base);
23529             test_ret++;
23530             printf(" %d", n_filename);
23531             printf(" %d", n_cur);
23532             printf("\n");
23533         }
23534     }
23535     }
23536     function_tests++;
23537 #endif
23538
23539     return(test_ret);
23540 }
23541
23542
23543 static int
23544 test_xmlSaveFileEnc(void) {
23545     int test_ret = 0;
23546
23547 #if defined(LIBXML_OUTPUT_ENABLED)
23548     int mem_base;
23549     int ret_val;
23550     const char * filename; /* the filename (or URL) */
23551     int n_filename;
23552     xmlDocPtr cur; /* the document */
23553     int n_cur;
23554     char * encoding; /* the name of an encoding (or NULL) */
23555     int n_encoding;
23556
23557     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23558     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23559     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23560         mem_base = xmlMemBlocks();
23561         filename = gen_fileoutput(n_filename, 0);
23562         cur = gen_xmlDocPtr(n_cur, 1);
23563         encoding = gen_const_char_ptr(n_encoding, 2);
23564
23565         ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
23566         desret_int(ret_val);
23567         call_tests++;
23568         des_fileoutput(n_filename, filename, 0);
23569         des_xmlDocPtr(n_cur, cur, 1);
23570         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23571         xmlResetLastError();
23572         if (mem_base != xmlMemBlocks()) {
23573             printf("Leak of %d blocks found in xmlSaveFileEnc",
23574                    xmlMemBlocks() - mem_base);
23575             test_ret++;
23576             printf(" %d", n_filename);
23577             printf(" %d", n_cur);
23578             printf(" %d", n_encoding);
23579             printf("\n");
23580         }
23581     }
23582     }
23583     }
23584     function_tests++;
23585 #endif
23586
23587     return(test_ret);
23588 }
23589
23590
23591 static int
23592 test_xmlSaveFileTo(void) {
23593     int test_ret = 0;
23594
23595 #if defined(LIBXML_OUTPUT_ENABLED)
23596     int mem_base;
23597     int ret_val;
23598     xmlOutputBufferPtr buf; /* an output I/O buffer */
23599     int n_buf;
23600     xmlDocPtr cur; /* the document */
23601     int n_cur;
23602     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23603     int n_encoding;
23604
23605     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23606     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23607     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23608         mem_base = xmlMemBlocks();
23609         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23610         cur = gen_xmlDocPtr(n_cur, 1);
23611         encoding = gen_const_char_ptr(n_encoding, 2);
23612
23613         ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
23614         buf = NULL;
23615         desret_int(ret_val);
23616         call_tests++;
23617         des_xmlOutputBufferPtr(n_buf, buf, 0);
23618         des_xmlDocPtr(n_cur, cur, 1);
23619         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23620         xmlResetLastError();
23621         if (mem_base != xmlMemBlocks()) {
23622             printf("Leak of %d blocks found in xmlSaveFileTo",
23623                    xmlMemBlocks() - mem_base);
23624             test_ret++;
23625             printf(" %d", n_buf);
23626             printf(" %d", n_cur);
23627             printf(" %d", n_encoding);
23628             printf("\n");
23629         }
23630     }
23631     }
23632     }
23633     function_tests++;
23634 #endif
23635
23636     return(test_ret);
23637 }
23638
23639
23640 static int
23641 test_xmlSaveFormatFile(void) {
23642     int test_ret = 0;
23643
23644 #if defined(LIBXML_OUTPUT_ENABLED)
23645     int mem_base;
23646     int ret_val;
23647     const char * filename; /* the filename (or URL) */
23648     int n_filename;
23649     xmlDocPtr cur; /* the document */
23650     int n_cur;
23651     int format; /* should formatting spaces been added */
23652     int n_format;
23653
23654     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23655     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23656     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23657         mem_base = xmlMemBlocks();
23658         filename = gen_fileoutput(n_filename, 0);
23659         cur = gen_xmlDocPtr(n_cur, 1);
23660         format = gen_int(n_format, 2);
23661
23662         ret_val = xmlSaveFormatFile(filename, cur, format);
23663         desret_int(ret_val);
23664         call_tests++;
23665         des_fileoutput(n_filename, filename, 0);
23666         des_xmlDocPtr(n_cur, cur, 1);
23667         des_int(n_format, format, 2);
23668         xmlResetLastError();
23669         if (mem_base != xmlMemBlocks()) {
23670             printf("Leak of %d blocks found in xmlSaveFormatFile",
23671                    xmlMemBlocks() - mem_base);
23672             test_ret++;
23673             printf(" %d", n_filename);
23674             printf(" %d", n_cur);
23675             printf(" %d", n_format);
23676             printf("\n");
23677         }
23678     }
23679     }
23680     }
23681     function_tests++;
23682 #endif
23683
23684     return(test_ret);
23685 }
23686
23687
23688 static int
23689 test_xmlSaveFormatFileEnc(void) {
23690     int test_ret = 0;
23691
23692 #if defined(LIBXML_OUTPUT_ENABLED)
23693     int mem_base;
23694     int ret_val;
23695     const char * filename; /* the filename or URL to output */
23696     int n_filename;
23697     xmlDocPtr cur; /* the document being saved */
23698     int n_cur;
23699     char * encoding; /* the name of the encoding to use or NULL. */
23700     int n_encoding;
23701     int format; /* should formatting spaces be added. */
23702     int n_format;
23703
23704     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23705     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23706     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23707     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23708         mem_base = xmlMemBlocks();
23709         filename = gen_fileoutput(n_filename, 0);
23710         cur = gen_xmlDocPtr(n_cur, 1);
23711         encoding = gen_const_char_ptr(n_encoding, 2);
23712         format = gen_int(n_format, 3);
23713
23714         ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23715         desret_int(ret_val);
23716         call_tests++;
23717         des_fileoutput(n_filename, filename, 0);
23718         des_xmlDocPtr(n_cur, cur, 1);
23719         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23720         des_int(n_format, format, 3);
23721         xmlResetLastError();
23722         if (mem_base != xmlMemBlocks()) {
23723             printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23724                    xmlMemBlocks() - mem_base);
23725             test_ret++;
23726             printf(" %d", n_filename);
23727             printf(" %d", n_cur);
23728             printf(" %d", n_encoding);
23729             printf(" %d", n_format);
23730             printf("\n");
23731         }
23732     }
23733     }
23734     }
23735     }
23736     function_tests++;
23737 #endif
23738
23739     return(test_ret);
23740 }
23741
23742
23743 static int
23744 test_xmlSaveFormatFileTo(void) {
23745     int test_ret = 0;
23746
23747 #if defined(LIBXML_OUTPUT_ENABLED)
23748     int mem_base;
23749     int ret_val;
23750     xmlOutputBufferPtr buf; /* an output I/O buffer */
23751     int n_buf;
23752     xmlDocPtr cur; /* the document */
23753     int n_cur;
23754     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23755     int n_encoding;
23756     int format; /* should formatting spaces been added */
23757     int n_format;
23758
23759     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23760     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23761     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23762     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23763         mem_base = xmlMemBlocks();
23764         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23765         cur = gen_xmlDocPtr(n_cur, 1);
23766         encoding = gen_const_char_ptr(n_encoding, 2);
23767         format = gen_int(n_format, 3);
23768
23769         ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23770         buf = NULL;
23771         desret_int(ret_val);
23772         call_tests++;
23773         des_xmlOutputBufferPtr(n_buf, buf, 0);
23774         des_xmlDocPtr(n_cur, cur, 1);
23775         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23776         des_int(n_format, format, 3);
23777         xmlResetLastError();
23778         if (mem_base != xmlMemBlocks()) {
23779             printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23780                    xmlMemBlocks() - mem_base);
23781             test_ret++;
23782             printf(" %d", n_buf);
23783             printf(" %d", n_cur);
23784             printf(" %d", n_encoding);
23785             printf(" %d", n_format);
23786             printf("\n");
23787         }
23788     }
23789     }
23790     }
23791     }
23792     function_tests++;
23793 #endif
23794
23795     return(test_ret);
23796 }
23797
23798
23799 static int
23800 test_xmlSearchNs(void) {
23801     int test_ret = 0;
23802
23803     int mem_base;
23804     xmlNsPtr ret_val;
23805     xmlDocPtr doc; /* the document */
23806     int n_doc;
23807     xmlNodePtr node; /* the current node */
23808     int n_node;
23809     xmlChar * nameSpace; /* the namespace prefix */
23810     int n_nameSpace;
23811
23812     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23813     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23814     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23815         mem_base = xmlMemBlocks();
23816         doc = gen_xmlDocPtr(n_doc, 0);
23817         node = gen_xmlNodePtr(n_node, 1);
23818         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23819
23820         ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23821         desret_xmlNsPtr(ret_val);
23822         call_tests++;
23823         des_xmlDocPtr(n_doc, doc, 0);
23824         des_xmlNodePtr(n_node, node, 1);
23825         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23826         xmlResetLastError();
23827         if (mem_base != xmlMemBlocks()) {
23828             printf("Leak of %d blocks found in xmlSearchNs",
23829                    xmlMemBlocks() - mem_base);
23830             test_ret++;
23831             printf(" %d", n_doc);
23832             printf(" %d", n_node);
23833             printf(" %d", n_nameSpace);
23834             printf("\n");
23835         }
23836     }
23837     }
23838     }
23839     function_tests++;
23840
23841     return(test_ret);
23842 }
23843
23844
23845 static int
23846 test_xmlSearchNsByHref(void) {
23847     int test_ret = 0;
23848
23849     int mem_base;
23850     xmlNsPtr ret_val;
23851     xmlDocPtr doc; /* the document */
23852     int n_doc;
23853     xmlNodePtr node; /* the current node */
23854     int n_node;
23855     xmlChar * href; /* the namespace value */
23856     int n_href;
23857
23858     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23859     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23860     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23861         mem_base = xmlMemBlocks();
23862         doc = gen_xmlDocPtr(n_doc, 0);
23863         node = gen_xmlNodePtr(n_node, 1);
23864         href = gen_const_xmlChar_ptr(n_href, 2);
23865
23866         ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23867         desret_xmlNsPtr(ret_val);
23868         call_tests++;
23869         des_xmlDocPtr(n_doc, doc, 0);
23870         des_xmlNodePtr(n_node, node, 1);
23871         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23872         xmlResetLastError();
23873         if (mem_base != xmlMemBlocks()) {
23874             printf("Leak of %d blocks found in xmlSearchNsByHref",
23875                    xmlMemBlocks() - mem_base);
23876             test_ret++;
23877             printf(" %d", n_doc);
23878             printf(" %d", n_node);
23879             printf(" %d", n_href);
23880             printf("\n");
23881         }
23882     }
23883     }
23884     }
23885     function_tests++;
23886
23887     return(test_ret);
23888 }
23889
23890
23891 static int
23892 test_xmlSetBufferAllocationScheme(void) {
23893     int test_ret = 0;
23894
23895     int mem_base;
23896     xmlBufferAllocationScheme scheme; /* allocation method to use */
23897     int n_scheme;
23898
23899     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23900         mem_base = xmlMemBlocks();
23901         scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23902
23903         xmlSetBufferAllocationScheme(scheme);
23904         call_tests++;
23905         des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23906         xmlResetLastError();
23907         if (mem_base != xmlMemBlocks()) {
23908             printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23909                    xmlMemBlocks() - mem_base);
23910             test_ret++;
23911             printf(" %d", n_scheme);
23912             printf("\n");
23913         }
23914     }
23915     function_tests++;
23916
23917     return(test_ret);
23918 }
23919
23920
23921 static int
23922 test_xmlSetCompressMode(void) {
23923     int test_ret = 0;
23924
23925     int mem_base;
23926     int mode; /* the compression ratio */
23927     int n_mode;
23928
23929     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23930         mem_base = xmlMemBlocks();
23931         mode = gen_int(n_mode, 0);
23932
23933         xmlSetCompressMode(mode);
23934         call_tests++;
23935         des_int(n_mode, mode, 0);
23936         xmlResetLastError();
23937         if (mem_base != xmlMemBlocks()) {
23938             printf("Leak of %d blocks found in xmlSetCompressMode",
23939                    xmlMemBlocks() - mem_base);
23940             test_ret++;
23941             printf(" %d", n_mode);
23942             printf("\n");
23943         }
23944     }
23945     function_tests++;
23946
23947     return(test_ret);
23948 }
23949
23950
23951 static int
23952 test_xmlSetDocCompressMode(void) {
23953     int test_ret = 0;
23954
23955     int mem_base;
23956     xmlDocPtr doc; /* the document */
23957     int n_doc;
23958     int mode; /* the compression ratio */
23959     int n_mode;
23960
23961     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23962     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23963         mem_base = xmlMemBlocks();
23964         doc = gen_xmlDocPtr(n_doc, 0);
23965         mode = gen_int(n_mode, 1);
23966
23967         xmlSetDocCompressMode(doc, mode);
23968         call_tests++;
23969         des_xmlDocPtr(n_doc, doc, 0);
23970         des_int(n_mode, mode, 1);
23971         xmlResetLastError();
23972         if (mem_base != xmlMemBlocks()) {
23973             printf("Leak of %d blocks found in xmlSetDocCompressMode",
23974                    xmlMemBlocks() - mem_base);
23975             test_ret++;
23976             printf(" %d", n_doc);
23977             printf(" %d", n_mode);
23978             printf("\n");
23979         }
23980     }
23981     }
23982     function_tests++;
23983
23984     return(test_ret);
23985 }
23986
23987
23988 static int
23989 test_xmlSetNs(void) {
23990     int test_ret = 0;
23991
23992     int mem_base;
23993     xmlNodePtr node; /* a node in the document */
23994     int n_node;
23995     xmlNsPtr ns; /* a namespace pointer */
23996     int n_ns;
23997
23998     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23999     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
24000         mem_base = xmlMemBlocks();
24001         node = gen_xmlNodePtr(n_node, 0);
24002         ns = gen_xmlNsPtr(n_ns, 1);
24003
24004         xmlSetNs(node, ns);
24005         call_tests++;
24006         des_xmlNodePtr(n_node, node, 0);
24007         des_xmlNsPtr(n_ns, ns, 1);
24008         xmlResetLastError();
24009         if (mem_base != xmlMemBlocks()) {
24010             printf("Leak of %d blocks found in xmlSetNs",
24011                    xmlMemBlocks() - mem_base);
24012             test_ret++;
24013             printf(" %d", n_node);
24014             printf(" %d", n_ns);
24015             printf("\n");
24016         }
24017     }
24018     }
24019     function_tests++;
24020
24021     return(test_ret);
24022 }
24023
24024
24025 static int
24026 test_xmlSetNsProp(void) {
24027     int test_ret = 0;
24028
24029 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
24030     int mem_base;
24031     xmlAttrPtr ret_val;
24032     xmlNodePtr node; /* the node */
24033     int n_node;
24034     xmlNsPtr ns; /* the namespace definition */
24035     int n_ns;
24036     xmlChar * name; /* the attribute name */
24037     int n_name;
24038     xmlChar * value; /* the attribute value */
24039     int n_value;
24040
24041     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24042     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
24043     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24044     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24045         mem_base = xmlMemBlocks();
24046         node = gen_xmlNodePtr(n_node, 0);
24047         ns = gen_xmlNsPtr(n_ns, 1);
24048         name = gen_const_xmlChar_ptr(n_name, 2);
24049         value = gen_const_xmlChar_ptr(n_value, 3);
24050
24051         ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
24052         desret_xmlAttrPtr(ret_val);
24053         call_tests++;
24054         des_xmlNodePtr(n_node, node, 0);
24055         des_xmlNsPtr(n_ns, ns, 1);
24056         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24057         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
24058         xmlResetLastError();
24059         if (mem_base != xmlMemBlocks()) {
24060             printf("Leak of %d blocks found in xmlSetNsProp",
24061                    xmlMemBlocks() - mem_base);
24062             test_ret++;
24063             printf(" %d", n_node);
24064             printf(" %d", n_ns);
24065             printf(" %d", n_name);
24066             printf(" %d", n_value);
24067             printf("\n");
24068         }
24069     }
24070     }
24071     }
24072     }
24073     function_tests++;
24074 #endif
24075
24076     return(test_ret);
24077 }
24078
24079
24080 static int
24081 test_xmlSetProp(void) {
24082     int test_ret = 0;
24083
24084 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
24085     int mem_base;
24086     xmlAttrPtr ret_val;
24087     xmlNodePtr node; /* the node */
24088     int n_node;
24089     xmlChar * name; /* the attribute name (a QName) */
24090     int n_name;
24091     xmlChar * value; /* the attribute value */
24092     int n_value;
24093
24094     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24095     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24096     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24097         mem_base = xmlMemBlocks();
24098         node = gen_xmlNodePtr(n_node, 0);
24099         name = gen_const_xmlChar_ptr(n_name, 1);
24100         value = gen_const_xmlChar_ptr(n_value, 2);
24101
24102         ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
24103         desret_xmlAttrPtr(ret_val);
24104         call_tests++;
24105         des_xmlNodePtr(n_node, node, 0);
24106         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24107         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
24108         xmlResetLastError();
24109         if (mem_base != xmlMemBlocks()) {
24110             printf("Leak of %d blocks found in xmlSetProp",
24111                    xmlMemBlocks() - mem_base);
24112             test_ret++;
24113             printf(" %d", n_node);
24114             printf(" %d", n_name);
24115             printf(" %d", n_value);
24116             printf("\n");
24117         }
24118     }
24119     }
24120     }
24121     function_tests++;
24122 #endif
24123
24124     return(test_ret);
24125 }
24126
24127
24128 static int
24129 test_xmlSplitQName2(void) {
24130     int test_ret = 0;
24131
24132     int mem_base;
24133     xmlChar * ret_val;
24134     xmlChar * name; /* the full QName */
24135     int n_name;
24136     xmlChar ** prefix; /* a xmlChar ** */
24137     int n_prefix;
24138
24139     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24140     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
24141         mem_base = xmlMemBlocks();
24142         name = gen_const_xmlChar_ptr(n_name, 0);
24143         prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
24144
24145         ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
24146         desret_xmlChar_ptr(ret_val);
24147         call_tests++;
24148         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
24149         des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
24150         xmlResetLastError();
24151         if (mem_base != xmlMemBlocks()) {
24152             printf("Leak of %d blocks found in xmlSplitQName2",
24153                    xmlMemBlocks() - mem_base);
24154             test_ret++;
24155             printf(" %d", n_name);
24156             printf(" %d", n_prefix);
24157             printf("\n");
24158         }
24159     }
24160     }
24161     function_tests++;
24162
24163     return(test_ret);
24164 }
24165
24166
24167 static int
24168 test_xmlSplitQName3(void) {
24169     int test_ret = 0;
24170
24171     int mem_base;
24172     const xmlChar * ret_val;
24173     xmlChar * name; /* the full QName */
24174     int n_name;
24175     int * len; /* an int * */
24176     int n_len;
24177
24178     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24179     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
24180         mem_base = xmlMemBlocks();
24181         name = gen_const_xmlChar_ptr(n_name, 0);
24182         len = gen_int_ptr(n_len, 1);
24183
24184         ret_val = xmlSplitQName3((const xmlChar *)name, len);
24185         desret_const_xmlChar_ptr(ret_val);
24186         call_tests++;
24187         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
24188         des_int_ptr(n_len, len, 1);
24189         xmlResetLastError();
24190         if (mem_base != xmlMemBlocks()) {
24191             printf("Leak of %d blocks found in xmlSplitQName3",
24192                    xmlMemBlocks() - mem_base);
24193             test_ret++;
24194             printf(" %d", n_name);
24195             printf(" %d", n_len);
24196             printf("\n");
24197         }
24198     }
24199     }
24200     function_tests++;
24201
24202     return(test_ret);
24203 }
24204
24205
24206 static int
24207 test_xmlStringGetNodeList(void) {
24208     int test_ret = 0;
24209
24210     int mem_base;
24211     xmlNodePtr ret_val;
24212     xmlDoc * doc; /* the document */
24213     int n_doc;
24214     xmlChar * value; /* the value of the attribute */
24215     int n_value;
24216
24217     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
24218     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24219         mem_base = xmlMemBlocks();
24220         doc = gen_const_xmlDoc_ptr(n_doc, 0);
24221         value = gen_const_xmlChar_ptr(n_value, 1);
24222
24223         ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value);
24224         desret_xmlNodePtr(ret_val);
24225         call_tests++;
24226         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
24227         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
24228         xmlResetLastError();
24229         if (mem_base != xmlMemBlocks()) {
24230             printf("Leak of %d blocks found in xmlStringGetNodeList",
24231                    xmlMemBlocks() - mem_base);
24232             test_ret++;
24233             printf(" %d", n_doc);
24234             printf(" %d", n_value);
24235             printf("\n");
24236         }
24237     }
24238     }
24239     function_tests++;
24240
24241     return(test_ret);
24242 }
24243
24244
24245 static int
24246 test_xmlStringLenGetNodeList(void) {
24247     int test_ret = 0;
24248
24249     int mem_base;
24250     xmlNodePtr ret_val;
24251     xmlDoc * doc; /* the document */
24252     int n_doc;
24253     xmlChar * value; /* the value of the text */
24254     int n_value;
24255     int len; /* the length of the string value */
24256     int n_len;
24257
24258     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
24259     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24260     for (n_len = 0;n_len < gen_nb_int;n_len++) {
24261         mem_base = xmlMemBlocks();
24262         doc = gen_const_xmlDoc_ptr(n_doc, 0);
24263         value = gen_const_xmlChar_ptr(n_value, 1);
24264         len = gen_int(n_len, 2);
24265
24266         ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len);
24267         desret_xmlNodePtr(ret_val);
24268         call_tests++;
24269         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
24270         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
24271         des_int(n_len, len, 2);
24272         xmlResetLastError();
24273         if (mem_base != xmlMemBlocks()) {
24274             printf("Leak of %d blocks found in xmlStringLenGetNodeList",
24275                    xmlMemBlocks() - mem_base);
24276             test_ret++;
24277             printf(" %d", n_doc);
24278             printf(" %d", n_value);
24279             printf(" %d", n_len);
24280             printf("\n");
24281         }
24282     }
24283     }
24284     }
24285     function_tests++;
24286
24287     return(test_ret);
24288 }
24289
24290
24291 static int
24292 test_xmlTextConcat(void) {
24293     int test_ret = 0;
24294
24295     int mem_base;
24296     int ret_val;
24297     xmlNodePtr node; /* the node */
24298     int n_node;
24299     xmlChar * content; /* the content */
24300     int n_content;
24301     int len; /* @content length */
24302     int n_len;
24303
24304     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24305     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
24306     for (n_len = 0;n_len < gen_nb_int;n_len++) {
24307         mem_base = xmlMemBlocks();
24308         node = gen_xmlNodePtr(n_node, 0);
24309         content = gen_const_xmlChar_ptr(n_content, 1);
24310         len = gen_int(n_len, 2);
24311
24312         ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
24313         desret_int(ret_val);
24314         call_tests++;
24315         des_xmlNodePtr(n_node, node, 0);
24316         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
24317         des_int(n_len, len, 2);
24318         xmlResetLastError();
24319         if (mem_base != xmlMemBlocks()) {
24320             printf("Leak of %d blocks found in xmlTextConcat",
24321                    xmlMemBlocks() - mem_base);
24322             test_ret++;
24323             printf(" %d", n_node);
24324             printf(" %d", n_content);
24325             printf(" %d", n_len);
24326             printf("\n");
24327         }
24328     }
24329     }
24330     }
24331     function_tests++;
24332
24333     return(test_ret);
24334 }
24335
24336
24337 static int
24338 test_xmlTextMerge(void) {
24339     int test_ret = 0;
24340
24341     int mem_base;
24342     xmlNodePtr ret_val;
24343     xmlNodePtr first; /* the first text node */
24344     int n_first;
24345     xmlNodePtr second; /* the second text node being merged */
24346     int n_second;
24347
24348     for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
24349     for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
24350         mem_base = xmlMemBlocks();
24351         first = gen_xmlNodePtr_in(n_first, 0);
24352         second = gen_xmlNodePtr_in(n_second, 1);
24353
24354         ret_val = xmlTextMerge(first, second);
24355         if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
24356               xmlUnlinkNode(second);
24357               xmlFreeNode(second) ; second = NULL ; }
24358         desret_xmlNodePtr(ret_val);
24359         call_tests++;
24360         des_xmlNodePtr_in(n_first, first, 0);
24361         des_xmlNodePtr_in(n_second, second, 1);
24362         xmlResetLastError();
24363         if (mem_base != xmlMemBlocks()) {
24364             printf("Leak of %d blocks found in xmlTextMerge",
24365                    xmlMemBlocks() - mem_base);
24366             test_ret++;
24367             printf(" %d", n_first);
24368             printf(" %d", n_second);
24369             printf("\n");
24370         }
24371     }
24372     }
24373     function_tests++;
24374
24375     return(test_ret);
24376 }
24377
24378
24379 static int
24380 test_xmlUnsetNsProp(void) {
24381     int test_ret = 0;
24382
24383 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24384     int mem_base;
24385     int ret_val;
24386     xmlNodePtr node; /* the node */
24387     int n_node;
24388     xmlNsPtr ns; /* the namespace definition */
24389     int n_ns;
24390     xmlChar * name; /* the attribute name */
24391     int n_name;
24392
24393     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24394     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
24395     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24396         mem_base = xmlMemBlocks();
24397         node = gen_xmlNodePtr(n_node, 0);
24398         ns = gen_xmlNsPtr(n_ns, 1);
24399         name = gen_const_xmlChar_ptr(n_name, 2);
24400
24401         ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
24402         desret_int(ret_val);
24403         call_tests++;
24404         des_xmlNodePtr(n_node, node, 0);
24405         des_xmlNsPtr(n_ns, ns, 1);
24406         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24407         xmlResetLastError();
24408         if (mem_base != xmlMemBlocks()) {
24409             printf("Leak of %d blocks found in xmlUnsetNsProp",
24410                    xmlMemBlocks() - mem_base);
24411             test_ret++;
24412             printf(" %d", n_node);
24413             printf(" %d", n_ns);
24414             printf(" %d", n_name);
24415             printf("\n");
24416         }
24417     }
24418     }
24419     }
24420     function_tests++;
24421 #endif
24422
24423     return(test_ret);
24424 }
24425
24426
24427 static int
24428 test_xmlUnsetProp(void) {
24429     int test_ret = 0;
24430
24431 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24432     int mem_base;
24433     int ret_val;
24434     xmlNodePtr node; /* the node */
24435     int n_node;
24436     xmlChar * name; /* the attribute name */
24437     int n_name;
24438
24439     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24440     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24441         mem_base = xmlMemBlocks();
24442         node = gen_xmlNodePtr(n_node, 0);
24443         name = gen_const_xmlChar_ptr(n_name, 1);
24444
24445         ret_val = xmlUnsetProp(node, (const xmlChar *)name);
24446         desret_int(ret_val);
24447         call_tests++;
24448         des_xmlNodePtr(n_node, node, 0);
24449         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24450         xmlResetLastError();
24451         if (mem_base != xmlMemBlocks()) {
24452             printf("Leak of %d blocks found in xmlUnsetProp",
24453                    xmlMemBlocks() - mem_base);
24454             test_ret++;
24455             printf(" %d", n_node);
24456             printf(" %d", n_name);
24457             printf("\n");
24458         }
24459     }
24460     }
24461     function_tests++;
24462 #endif
24463
24464     return(test_ret);
24465 }
24466
24467
24468 static int
24469 test_xmlValidateNCName(void) {
24470     int test_ret = 0;
24471
24472 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
24473 #ifdef LIBXML_TREE_ENABLED
24474     int mem_base;
24475     int ret_val;
24476     xmlChar * value; /* the value to check */
24477     int n_value;
24478     int space; /* allow spaces in front and end of the string */
24479     int n_space;
24480
24481     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24482     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24483         mem_base = xmlMemBlocks();
24484         value = gen_const_xmlChar_ptr(n_value, 0);
24485         space = gen_int(n_space, 1);
24486
24487         ret_val = xmlValidateNCName((const xmlChar *)value, space);
24488         desret_int(ret_val);
24489         call_tests++;
24490         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24491         des_int(n_space, space, 1);
24492         xmlResetLastError();
24493         if (mem_base != xmlMemBlocks()) {
24494             printf("Leak of %d blocks found in xmlValidateNCName",
24495                    xmlMemBlocks() - mem_base);
24496             test_ret++;
24497             printf(" %d", n_value);
24498             printf(" %d", n_space);
24499             printf("\n");
24500         }
24501     }
24502     }
24503     function_tests++;
24504 #endif
24505 #endif
24506
24507     return(test_ret);
24508 }
24509
24510
24511 static int
24512 test_xmlValidateNMToken(void) {
24513     int test_ret = 0;
24514
24515 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24516 #ifdef LIBXML_TREE_ENABLED
24517     int mem_base;
24518     int ret_val;
24519     xmlChar * value; /* the value to check */
24520     int n_value;
24521     int space; /* allow spaces in front and end of the string */
24522     int n_space;
24523
24524     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24525     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24526         mem_base = xmlMemBlocks();
24527         value = gen_const_xmlChar_ptr(n_value, 0);
24528         space = gen_int(n_space, 1);
24529
24530         ret_val = xmlValidateNMToken((const xmlChar *)value, space);
24531         desret_int(ret_val);
24532         call_tests++;
24533         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24534         des_int(n_space, space, 1);
24535         xmlResetLastError();
24536         if (mem_base != xmlMemBlocks()) {
24537             printf("Leak of %d blocks found in xmlValidateNMToken",
24538                    xmlMemBlocks() - mem_base);
24539             test_ret++;
24540             printf(" %d", n_value);
24541             printf(" %d", n_space);
24542             printf("\n");
24543         }
24544     }
24545     }
24546     function_tests++;
24547 #endif
24548 #endif
24549
24550     return(test_ret);
24551 }
24552
24553
24554 static int
24555 test_xmlValidateName(void) {
24556     int test_ret = 0;
24557
24558 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24559 #ifdef LIBXML_TREE_ENABLED
24560     int mem_base;
24561     int ret_val;
24562     xmlChar * value; /* the value to check */
24563     int n_value;
24564     int space; /* allow spaces in front and end of the string */
24565     int n_space;
24566
24567     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24568     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24569         mem_base = xmlMemBlocks();
24570         value = gen_const_xmlChar_ptr(n_value, 0);
24571         space = gen_int(n_space, 1);
24572
24573         ret_val = xmlValidateName((const xmlChar *)value, space);
24574         desret_int(ret_val);
24575         call_tests++;
24576         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24577         des_int(n_space, space, 1);
24578         xmlResetLastError();
24579         if (mem_base != xmlMemBlocks()) {
24580             printf("Leak of %d blocks found in xmlValidateName",
24581                    xmlMemBlocks() - mem_base);
24582             test_ret++;
24583             printf(" %d", n_value);
24584             printf(" %d", n_space);
24585             printf("\n");
24586         }
24587     }
24588     }
24589     function_tests++;
24590 #endif
24591 #endif
24592
24593     return(test_ret);
24594 }
24595
24596
24597 static int
24598 test_xmlValidateQName(void) {
24599     int test_ret = 0;
24600
24601 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24602 #ifdef LIBXML_TREE_ENABLED
24603     int mem_base;
24604     int ret_val;
24605     xmlChar * value; /* the value to check */
24606     int n_value;
24607     int space; /* allow spaces in front and end of the string */
24608     int n_space;
24609
24610     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24611     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24612         mem_base = xmlMemBlocks();
24613         value = gen_const_xmlChar_ptr(n_value, 0);
24614         space = gen_int(n_space, 1);
24615
24616         ret_val = xmlValidateQName((const xmlChar *)value, space);
24617         desret_int(ret_val);
24618         call_tests++;
24619         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24620         des_int(n_space, space, 1);
24621         xmlResetLastError();
24622         if (mem_base != xmlMemBlocks()) {
24623             printf("Leak of %d blocks found in xmlValidateQName",
24624                    xmlMemBlocks() - mem_base);
24625             test_ret++;
24626             printf(" %d", n_value);
24627             printf(" %d", n_space);
24628             printf("\n");
24629         }
24630     }
24631     }
24632     function_tests++;
24633 #endif
24634 #endif
24635
24636     return(test_ret);
24637 }
24638
24639 static int
24640 test_tree(void) {
24641     int test_ret = 0;
24642         int rc = 0;
24643
24644     if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
24645     rc = test_xmlAddChild();
24646         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24647     rc = test_xmlAddChildList();
24648         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24649     rc = test_xmlAddNextSibling();
24650         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24651     rc = test_xmlAddPrevSibling();
24652         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24653     rc = test_xmlAddSibling();
24654         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24655     rc = test_xmlAttrSerializeTxtContent();
24656         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24657     rc = test_xmlBufContent();
24658         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24659     rc = test_xmlBufEnd();
24660         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24661     rc = test_xmlBufGetNodeContent();
24662         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24663     rc = test_xmlBufNodeDump();
24664         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24665     rc = test_xmlBufShrink();
24666         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24667     rc = test_xmlBufUse();
24668         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24669     rc = test_xmlBufferAdd();
24670         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24671     rc = test_xmlBufferAddHead();
24672         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24673     rc = test_xmlBufferCCat();
24674         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24675     rc = test_xmlBufferCat();
24676         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24677     rc = test_xmlBufferContent();
24678         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24679     rc = test_xmlBufferCreate();
24680         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24681     rc = test_xmlBufferCreateSize();
24682         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24683     rc = test_xmlBufferCreateStatic();
24684         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24685     rc = test_xmlBufferDetach();
24686         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24687     rc = test_xmlBufferEmpty();
24688         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24689     rc = test_xmlBufferGrow();
24690         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24691     rc = test_xmlBufferLength();
24692         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24693     rc = test_xmlBufferResize();
24694         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24695     rc = test_xmlBufferSetAllocationScheme();
24696         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24697     rc = test_xmlBufferShrink();
24698         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24699     rc = test_xmlBufferWriteCHAR();
24700         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24701     rc = test_xmlBufferWriteChar();
24702         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24703     rc = test_xmlBufferWriteQuotedString();
24704         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24705     rc = test_xmlBuildQName();
24706         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24707     rc = test_xmlChildElementCount();
24708         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24709     rc = test_xmlCopyDoc();
24710         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24711     rc = test_xmlCopyDtd();
24712         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24713     rc = test_xmlCopyNamespace();
24714         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24715     rc = test_xmlCopyNamespaceList();
24716         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24717     rc = test_xmlCopyNode();
24718         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24719     rc = test_xmlCopyNodeList();
24720         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24721     rc = test_xmlCopyProp();
24722         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24723     rc = test_xmlCopyPropList();
24724         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24725     rc = test_xmlCreateIntSubset();
24726         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24727     rc = test_xmlDOMWrapAdoptNode();
24728         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24729     rc = test_xmlDOMWrapCloneNode();
24730         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24731     rc = test_xmlDOMWrapNewCtxt();
24732         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24733     rc = test_xmlDOMWrapReconcileNamespaces();
24734         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24735     rc = test_xmlDOMWrapRemoveNode();
24736         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24737     rc = test_xmlDocCopyNode();
24738         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24739     rc = test_xmlDocCopyNodeList();
24740         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24741     rc = test_xmlDocDump();
24742         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24743     rc = test_xmlDocDumpFormatMemory();
24744         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24745     rc = test_xmlDocDumpFormatMemoryEnc();
24746         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24747     rc = test_xmlDocDumpMemory();
24748         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24749     rc = test_xmlDocDumpMemoryEnc();
24750         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24751     rc = test_xmlDocFormatDump();
24752         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24753     rc = test_xmlDocGetRootElement();
24754         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24755     rc = test_xmlDocSetRootElement();
24756         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24757     rc = test_xmlElemDump();
24758         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24759     rc = test_xmlFirstElementChild();
24760         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24761     rc = test_xmlGetBufferAllocationScheme();
24762         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24763     rc = test_xmlGetCompressMode();
24764         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24765     rc = test_xmlGetDocCompressMode();
24766         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24767     rc = test_xmlGetIntSubset();
24768         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24769     rc = test_xmlGetLastChild();
24770         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24771     rc = test_xmlGetLineNo();
24772         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24773     rc = test_xmlGetNoNsProp();
24774         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24775     rc = test_xmlGetNodePath();
24776         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24777     rc = test_xmlGetNsList();
24778         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24779     rc = test_xmlGetNsProp();
24780         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24781     rc = test_xmlGetProp();
24782         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24783     rc = test_xmlHasNsProp();
24784         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24785     rc = test_xmlHasProp();
24786         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24787     rc = test_xmlIsBlankNode();
24788         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24789     rc = test_xmlIsXHTML();
24790         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24791     rc = test_xmlLastElementChild();
24792         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24793     rc = test_xmlNewCDataBlock();
24794         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24795     rc = test_xmlNewCharRef();
24796         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24797     rc = test_xmlNewChild();
24798         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24799     rc = test_xmlNewComment();
24800         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24801     rc = test_xmlNewDoc();
24802         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24803     rc = test_xmlNewDocComment();
24804         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24805     rc = test_xmlNewDocFragment();
24806         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24807     rc = test_xmlNewDocNode();
24808         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24809     rc = test_xmlNewDocNodeEatName();
24810         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24811     rc = test_xmlNewDocPI();
24812         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24813     rc = test_xmlNewDocProp();
24814         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24815     rc = test_xmlNewDocRawNode();
24816         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24817     rc = test_xmlNewDocText();
24818         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24819     rc = test_xmlNewDocTextLen();
24820         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24821     rc = test_xmlNewDtd();
24822         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24823     rc = test_xmlNewNode();
24824         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24825     rc = test_xmlNewNodeEatName();
24826         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24827     rc = test_xmlNewNs();
24828         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24829     rc = test_xmlNewNsProp();
24830         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24831     rc = test_xmlNewNsPropEatName();
24832         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24833     rc = test_xmlNewPI();
24834         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24835     rc = test_xmlNewProp();
24836         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24837     rc = test_xmlNewReference();
24838         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24839     rc = test_xmlNewText();
24840         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24841     rc = test_xmlNewTextChild();
24842         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24843     rc = test_xmlNewTextLen();
24844         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24845     rc = test_xmlNextElementSibling();
24846         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24847     rc = test_xmlNodeAddContent();
24848         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24849     rc = test_xmlNodeAddContentLen();
24850         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24851     rc = test_xmlNodeBufGetContent();
24852         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24853     rc = test_xmlNodeDump();
24854         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24855     rc = test_xmlNodeDumpOutput();
24856         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24857     rc = test_xmlNodeGetBase();
24858         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24859     rc = test_xmlNodeGetContent();
24860         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24861     rc = test_xmlNodeGetLang();
24862         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24863     rc = test_xmlNodeGetSpacePreserve();
24864         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24865     rc = test_xmlNodeIsText();
24866         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24867     rc = test_xmlNodeListGetRawString();
24868         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24869     rc = test_xmlNodeListGetString();
24870         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24871     rc = test_xmlNodeSetBase();
24872         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24873     rc = test_xmlNodeSetContent();
24874         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24875     rc = test_xmlNodeSetContentLen();
24876         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24877     rc = test_xmlNodeSetLang();
24878         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24879     rc = test_xmlNodeSetName();
24880         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24881     rc = test_xmlNodeSetSpacePreserve();
24882         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24883     rc = test_xmlPreviousElementSibling();
24884         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24885     rc = test_xmlReconciliateNs();
24886         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24887     rc = test_xmlRemoveProp();
24888         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24889     rc = test_xmlReplaceNode();
24890         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24891     rc = test_xmlSaveFile();
24892         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24893     rc = test_xmlSaveFileEnc();
24894         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24895     rc = test_xmlSaveFileTo();
24896         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24897     rc = test_xmlSaveFormatFile();
24898         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24899     rc = test_xmlSaveFormatFileEnc();
24900         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24901     rc = test_xmlSaveFormatFileTo();
24902         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24903     rc = test_xmlSearchNs();
24904         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24905     rc = test_xmlSearchNsByHref();
24906         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24907     rc = test_xmlSetBufferAllocationScheme();
24908         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24909     rc = test_xmlSetCompressMode();
24910         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24911     rc = test_xmlSetDocCompressMode();
24912         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24913     rc = test_xmlSetNs();
24914         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24915     rc = test_xmlSetNsProp();
24916         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24917     rc = test_xmlSetProp();
24918         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24919     rc = test_xmlSplitQName2();
24920         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24921     rc = test_xmlSplitQName3();
24922         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24923     rc = test_xmlStringGetNodeList();
24924         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24925     rc = test_xmlStringLenGetNodeList();
24926         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24927     rc = test_xmlTextConcat();
24928         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24929     rc = test_xmlTextMerge();
24930         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24931     rc = test_xmlUnsetNsProp();
24932         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24933     rc = test_xmlUnsetProp();
24934         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24935     rc = test_xmlValidateNCName();
24936         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24937     rc = test_xmlValidateNMToken();
24938         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24939     rc = test_xmlValidateName();
24940         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24941     rc = test_xmlValidateQName();
24942         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24943
24944     if (test_ret != 0)
24945         printf("Module tree: %d errors\n", test_ret);
24946     return(test_ret);
24947 }
24948
24949 static int
24950 test_xmlBuildRelativeURI(void) {
24951     int test_ret = 0;
24952
24953     int mem_base;
24954     xmlChar * ret_val;
24955     xmlChar * URI; /* the URI reference under consideration */
24956     int n_URI;
24957     xmlChar * base; /* the base value */
24958     int n_base;
24959
24960     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24961     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24962         mem_base = xmlMemBlocks();
24963         URI = gen_const_xmlChar_ptr(n_URI, 0);
24964         base = gen_const_xmlChar_ptr(n_base, 1);
24965
24966         ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24967         desret_xmlChar_ptr(ret_val);
24968         call_tests++;
24969         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24970         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24971         xmlResetLastError();
24972         if (mem_base != xmlMemBlocks()) {
24973             printf("Leak of %d blocks found in xmlBuildRelativeURI",
24974                    xmlMemBlocks() - mem_base);
24975             test_ret++;
24976             printf(" %d", n_URI);
24977             printf(" %d", n_base);
24978             printf("\n");
24979         }
24980     }
24981     }
24982     function_tests++;
24983
24984     return(test_ret);
24985 }
24986
24987
24988 static int
24989 test_xmlBuildURI(void) {
24990     int test_ret = 0;
24991
24992     int mem_base;
24993     xmlChar * ret_val;
24994     xmlChar * URI; /* the URI instance found in the document */
24995     int n_URI;
24996     xmlChar * base; /* the base value */
24997     int n_base;
24998
24999     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
25000     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
25001         mem_base = xmlMemBlocks();
25002         URI = gen_const_xmlChar_ptr(n_URI, 0);
25003         base = gen_const_xmlChar_ptr(n_base, 1);
25004
25005         ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
25006         desret_xmlChar_ptr(ret_val);
25007         call_tests++;
25008         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
25009         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
25010         xmlResetLastError();
25011         if (mem_base != xmlMemBlocks()) {
25012             printf("Leak of %d blocks found in xmlBuildURI",
25013                    xmlMemBlocks() - mem_base);
25014             test_ret++;
25015             printf(" %d", n_URI);
25016             printf(" %d", n_base);
25017             printf("\n");
25018         }
25019     }
25020     }
25021     function_tests++;
25022
25023     return(test_ret);
25024 }
25025
25026
25027 static int
25028 test_xmlCanonicPath(void) {
25029     int test_ret = 0;
25030
25031     int mem_base;
25032     xmlChar * ret_val;
25033     xmlChar * path; /* the resource locator in a filesystem notation */
25034     int n_path;
25035
25036     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
25037         mem_base = xmlMemBlocks();
25038         path = gen_const_xmlChar_ptr(n_path, 0);
25039
25040         ret_val = xmlCanonicPath((const xmlChar *)path);
25041         desret_xmlChar_ptr(ret_val);
25042         call_tests++;
25043         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
25044         xmlResetLastError();
25045         if (mem_base != xmlMemBlocks()) {
25046             printf("Leak of %d blocks found in xmlCanonicPath",
25047                    xmlMemBlocks() - mem_base);
25048             test_ret++;
25049             printf(" %d", n_path);
25050             printf("\n");
25051         }
25052     }
25053     function_tests++;
25054
25055     return(test_ret);
25056 }
25057
25058
25059 static int
25060 test_xmlCreateURI(void) {
25061     int test_ret = 0;
25062
25063
25064     /* missing type support */
25065     return(test_ret);
25066 }
25067
25068
25069 static int
25070 test_xmlNormalizeURIPath(void) {
25071     int test_ret = 0;
25072
25073     int mem_base;
25074     int ret_val;
25075     char * path; /* pointer to the path string */
25076     int n_path;
25077
25078     for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
25079         mem_base = xmlMemBlocks();
25080         path = gen_char_ptr(n_path, 0);
25081
25082         ret_val = xmlNormalizeURIPath(path);
25083         desret_int(ret_val);
25084         call_tests++;
25085         des_char_ptr(n_path, path, 0);
25086         xmlResetLastError();
25087         if (mem_base != xmlMemBlocks()) {
25088             printf("Leak of %d blocks found in xmlNormalizeURIPath",
25089                    xmlMemBlocks() - mem_base);
25090             test_ret++;
25091             printf(" %d", n_path);
25092             printf("\n");
25093         }
25094     }
25095     function_tests++;
25096
25097     return(test_ret);
25098 }
25099
25100
25101 static int
25102 test_xmlParseURI(void) {
25103     int test_ret = 0;
25104
25105
25106     /* missing type support */
25107     return(test_ret);
25108 }
25109
25110
25111 static int
25112 test_xmlParseURIRaw(void) {
25113     int test_ret = 0;
25114
25115
25116     /* missing type support */
25117     return(test_ret);
25118 }
25119
25120
25121 #define gen_nb_xmlURIPtr 1
25122 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25123     return(NULL);
25124 }
25125 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25126 }
25127
25128 static int
25129 test_xmlParseURIReference(void) {
25130     int test_ret = 0;
25131
25132     int mem_base;
25133     int ret_val;
25134     xmlURIPtr uri; /* pointer to an URI structure */
25135     int n_uri;
25136     char * str; /* the string to analyze */
25137     int n_str;
25138
25139     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
25140     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
25141         mem_base = xmlMemBlocks();
25142         uri = gen_xmlURIPtr(n_uri, 0);
25143         str = gen_const_char_ptr(n_str, 1);
25144
25145         ret_val = xmlParseURIReference(uri, (const char *)str);
25146         desret_int(ret_val);
25147         call_tests++;
25148         des_xmlURIPtr(n_uri, uri, 0);
25149         des_const_char_ptr(n_str, (const char *)str, 1);
25150         xmlResetLastError();
25151         if (mem_base != xmlMemBlocks()) {
25152             printf("Leak of %d blocks found in xmlParseURIReference",
25153                    xmlMemBlocks() - mem_base);
25154             test_ret++;
25155             printf(" %d", n_uri);
25156             printf(" %d", n_str);
25157             printf("\n");
25158         }
25159     }
25160     }
25161     function_tests++;
25162
25163     return(test_ret);
25164 }
25165
25166
25167 static int
25168 test_xmlPathToURI(void) {
25169     int test_ret = 0;
25170
25171     int mem_base;
25172     xmlChar * ret_val;
25173     xmlChar * path; /* the resource locator in a filesystem notation */
25174     int n_path;
25175
25176     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
25177         mem_base = xmlMemBlocks();
25178         path = gen_const_xmlChar_ptr(n_path, 0);
25179
25180         ret_val = xmlPathToURI((const xmlChar *)path);
25181         desret_xmlChar_ptr(ret_val);
25182         call_tests++;
25183         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
25184         xmlResetLastError();
25185         if (mem_base != xmlMemBlocks()) {
25186             printf("Leak of %d blocks found in xmlPathToURI",
25187                    xmlMemBlocks() - mem_base);
25188             test_ret++;
25189             printf(" %d", n_path);
25190             printf("\n");
25191         }
25192     }
25193     function_tests++;
25194
25195     return(test_ret);
25196 }
25197
25198
25199 static int
25200 test_xmlPrintURI(void) {
25201     int test_ret = 0;
25202
25203     int mem_base;
25204     FILE * stream; /* a FILE* for the output */
25205     int n_stream;
25206     xmlURIPtr uri; /* pointer to an xmlURI */
25207     int n_uri;
25208
25209     for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
25210     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
25211         mem_base = xmlMemBlocks();
25212         stream = gen_FILE_ptr(n_stream, 0);
25213         uri = gen_xmlURIPtr(n_uri, 1);
25214
25215         xmlPrintURI(stream, uri);
25216         call_tests++;
25217         des_FILE_ptr(n_stream, stream, 0);
25218         des_xmlURIPtr(n_uri, uri, 1);
25219         xmlResetLastError();
25220         if (mem_base != xmlMemBlocks()) {
25221             printf("Leak of %d blocks found in xmlPrintURI",
25222                    xmlMemBlocks() - mem_base);
25223             test_ret++;
25224             printf(" %d", n_stream);
25225             printf(" %d", n_uri);
25226             printf("\n");
25227         }
25228     }
25229     }
25230     function_tests++;
25231
25232     return(test_ret);
25233 }
25234
25235
25236 static int
25237 test_xmlSaveUri(void) {
25238     int test_ret = 0;
25239
25240     int mem_base;
25241     xmlChar * ret_val;
25242     xmlURIPtr uri; /* pointer to an xmlURI */
25243     int n_uri;
25244
25245     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
25246         mem_base = xmlMemBlocks();
25247         uri = gen_xmlURIPtr(n_uri, 0);
25248
25249         ret_val = xmlSaveUri(uri);
25250         desret_xmlChar_ptr(ret_val);
25251         call_tests++;
25252         des_xmlURIPtr(n_uri, uri, 0);
25253         xmlResetLastError();
25254         if (mem_base != xmlMemBlocks()) {
25255             printf("Leak of %d blocks found in xmlSaveUri",
25256                    xmlMemBlocks() - mem_base);
25257             test_ret++;
25258             printf(" %d", n_uri);
25259             printf("\n");
25260         }
25261     }
25262     function_tests++;
25263
25264     return(test_ret);
25265 }
25266
25267
25268 static int
25269 test_xmlURIEscape(void) {
25270     int test_ret = 0;
25271
25272     int mem_base;
25273     xmlChar * ret_val;
25274     xmlChar * str; /* the string of the URI to escape */
25275     int n_str;
25276
25277     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
25278         mem_base = xmlMemBlocks();
25279         str = gen_const_xmlChar_ptr(n_str, 0);
25280
25281         ret_val = xmlURIEscape((const xmlChar *)str);
25282         desret_xmlChar_ptr(ret_val);
25283         call_tests++;
25284         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
25285         xmlResetLastError();
25286         if (mem_base != xmlMemBlocks()) {
25287             printf("Leak of %d blocks found in xmlURIEscape",
25288                    xmlMemBlocks() - mem_base);
25289             test_ret++;
25290             printf(" %d", n_str);
25291             printf("\n");
25292         }
25293     }
25294     function_tests++;
25295
25296     return(test_ret);
25297 }
25298
25299
25300 static int
25301 test_xmlURIEscapeStr(void) {
25302     int test_ret = 0;
25303
25304     int mem_base;
25305     xmlChar * ret_val;
25306     xmlChar * str; /* string to escape */
25307     int n_str;
25308     xmlChar * list; /* exception list string of chars not to escape */
25309     int n_list;
25310
25311     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
25312     for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
25313         mem_base = xmlMemBlocks();
25314         str = gen_const_xmlChar_ptr(n_str, 0);
25315         list = gen_const_xmlChar_ptr(n_list, 1);
25316
25317         ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
25318         desret_xmlChar_ptr(ret_val);
25319         call_tests++;
25320         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
25321         des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
25322         xmlResetLastError();
25323         if (mem_base != xmlMemBlocks()) {
25324             printf("Leak of %d blocks found in xmlURIEscapeStr",
25325                    xmlMemBlocks() - mem_base);
25326             test_ret++;
25327             printf(" %d", n_str);
25328             printf(" %d", n_list);
25329             printf("\n");
25330         }
25331     }
25332     }
25333     function_tests++;
25334
25335     return(test_ret);
25336 }
25337
25338
25339 static int
25340 test_xmlURIUnescapeString(void) {
25341     int test_ret = 0;
25342
25343
25344     /* missing type support */
25345     return(test_ret);
25346 }
25347
25348 static int
25349 test_uri(void) {
25350     int test_ret = 0;
25351         int rc = 0;
25352
25353     if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
25354     rc = test_xmlBuildRelativeURI();
25355         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25356     rc = test_xmlBuildURI();
25357         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25358     rc = test_xmlCanonicPath();
25359         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25360     rc = test_xmlCreateURI();
25361         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25362     rc = test_xmlNormalizeURIPath();
25363         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25364     rc = test_xmlParseURI();
25365         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25366     rc = test_xmlParseURIRaw();
25367         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25368     rc = test_xmlParseURIReference();
25369         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25370     rc = test_xmlPathToURI();
25371         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25372     rc = test_xmlPrintURI();
25373         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25374     rc = test_xmlSaveUri();
25375         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25376     rc = test_xmlURIEscape();
25377         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25378     rc = test_xmlURIEscapeStr();
25379         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25380     rc = test_xmlURIUnescapeString();
25381         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25382
25383     if (test_ret != 0)
25384         printf("Module uri: %d errors\n", test_ret);
25385     return(test_ret);
25386 }
25387
25388 static int
25389 test_xmlAddAttributeDecl(void) {
25390     int test_ret = 0;
25391
25392     int mem_base;
25393     xmlAttributePtr ret_val;
25394     xmlValidCtxtPtr ctxt; /* the validation context */
25395     int n_ctxt;
25396     xmlDtdPtr dtd; /* pointer to the DTD */
25397     int n_dtd;
25398     xmlChar * elem; /* the element name */
25399     int n_elem;
25400     xmlChar * name; /* the attribute name */
25401     int n_name;
25402     xmlChar * ns; /* the attribute namespace prefix */
25403     int n_ns;
25404     xmlAttributeType type; /* the attribute type */
25405     int n_type;
25406     xmlAttributeDefault def; /* the attribute default type */
25407     int n_def;
25408     xmlChar * defaultValue; /* the attribute default value */
25409     int n_defaultValue;
25410     xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
25411     int n_tree;
25412
25413     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25414     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25415     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25416     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25417     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
25418     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25419     for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
25420     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
25421     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
25422         mem_base = xmlMemBlocks();
25423         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25424         dtd = gen_xmlDtdPtr(n_dtd, 1);
25425         elem = gen_const_xmlChar_ptr(n_elem, 2);
25426         name = gen_const_xmlChar_ptr(n_name, 3);
25427         ns = gen_const_xmlChar_ptr(n_ns, 4);
25428         type = gen_xmlAttributeType(n_type, 5);
25429         def = gen_xmlAttributeDefault(n_def, 6);
25430         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
25431         tree = gen_xmlEnumerationPtr(n_tree, 8);
25432
25433         ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
25434         desret_xmlAttributePtr(ret_val);
25435         call_tests++;
25436         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25437         des_xmlDtdPtr(n_dtd, dtd, 1);
25438         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
25439         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25440         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
25441         des_xmlAttributeType(n_type, type, 5);
25442         des_xmlAttributeDefault(n_def, def, 6);
25443         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
25444         des_xmlEnumerationPtr(n_tree, tree, 8);
25445         xmlResetLastError();
25446         if (mem_base != xmlMemBlocks()) {
25447             printf("Leak of %d blocks found in xmlAddAttributeDecl",
25448                    xmlMemBlocks() - mem_base);
25449             test_ret++;
25450             printf(" %d", n_ctxt);
25451             printf(" %d", n_dtd);
25452             printf(" %d", n_elem);
25453             printf(" %d", n_name);
25454             printf(" %d", n_ns);
25455             printf(" %d", n_type);
25456             printf(" %d", n_def);
25457             printf(" %d", n_defaultValue);
25458             printf(" %d", n_tree);
25459             printf("\n");
25460         }
25461     }
25462     }
25463     }
25464     }
25465     }
25466     }
25467     }
25468     }
25469     }
25470     function_tests++;
25471
25472     return(test_ret);
25473 }
25474
25475
25476 static int
25477 test_xmlAddElementDecl(void) {
25478     int test_ret = 0;
25479
25480     int mem_base;
25481     xmlElementPtr ret_val;
25482     xmlValidCtxtPtr ctxt; /* the validation context */
25483     int n_ctxt;
25484     xmlDtdPtr dtd; /* pointer to the DTD */
25485     int n_dtd;
25486     xmlChar * name; /* the entity name */
25487     int n_name;
25488     xmlElementTypeVal type; /* the element type */
25489     int n_type;
25490     xmlElementContentPtr content; /* the element content tree or NULL */
25491     int n_content;
25492
25493     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25494     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25495     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25496     for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
25497     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25498         mem_base = xmlMemBlocks();
25499         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25500         dtd = gen_xmlDtdPtr(n_dtd, 1);
25501         name = gen_const_xmlChar_ptr(n_name, 2);
25502         type = gen_xmlElementTypeVal(n_type, 3);
25503         content = gen_xmlElementContentPtr(n_content, 4);
25504
25505         ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
25506         desret_xmlElementPtr(ret_val);
25507         call_tests++;
25508         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25509         des_xmlDtdPtr(n_dtd, dtd, 1);
25510         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25511         des_xmlElementTypeVal(n_type, type, 3);
25512         des_xmlElementContentPtr(n_content, content, 4);
25513         xmlResetLastError();
25514         if (mem_base != xmlMemBlocks()) {
25515             printf("Leak of %d blocks found in xmlAddElementDecl",
25516                    xmlMemBlocks() - mem_base);
25517             test_ret++;
25518             printf(" %d", n_ctxt);
25519             printf(" %d", n_dtd);
25520             printf(" %d", n_name);
25521             printf(" %d", n_type);
25522             printf(" %d", n_content);
25523             printf("\n");
25524         }
25525     }
25526     }
25527     }
25528     }
25529     }
25530     function_tests++;
25531
25532     return(test_ret);
25533 }
25534
25535
25536 static int
25537 test_xmlAddID(void) {
25538     int test_ret = 0;
25539
25540
25541     /* missing type support */
25542     return(test_ret);
25543 }
25544
25545
25546 static int
25547 test_xmlAddNotationDecl(void) {
25548     int test_ret = 0;
25549
25550
25551     /* missing type support */
25552     return(test_ret);
25553 }
25554
25555
25556 static int
25557 test_xmlAddRef(void) {
25558     int test_ret = 0;
25559
25560
25561     /* missing type support */
25562     return(test_ret);
25563 }
25564
25565
25566 #define gen_nb_xmlAttributeTablePtr 1
25567 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25568     return(NULL);
25569 }
25570 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25571 }
25572
25573 static int
25574 test_xmlCopyAttributeTable(void) {
25575     int test_ret = 0;
25576
25577
25578     /* missing type support */
25579     return(test_ret);
25580 }
25581
25582
25583 static int
25584 test_xmlCopyDocElementContent(void) {
25585     int test_ret = 0;
25586
25587     int mem_base;
25588     xmlElementContentPtr ret_val;
25589     xmlDocPtr doc; /* the document owning the element declaration */
25590     int n_doc;
25591     xmlElementContentPtr cur; /* An element content pointer. */
25592     int n_cur;
25593
25594     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25595     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25596         mem_base = xmlMemBlocks();
25597         doc = gen_xmlDocPtr(n_doc, 0);
25598         cur = gen_xmlElementContentPtr(n_cur, 1);
25599
25600         ret_val = xmlCopyDocElementContent(doc, cur);
25601         desret_xmlElementContentPtr(ret_val);
25602         call_tests++;
25603         des_xmlDocPtr(n_doc, doc, 0);
25604         des_xmlElementContentPtr(n_cur, cur, 1);
25605         xmlResetLastError();
25606         if (mem_base != xmlMemBlocks()) {
25607             printf("Leak of %d blocks found in xmlCopyDocElementContent",
25608                    xmlMemBlocks() - mem_base);
25609             test_ret++;
25610             printf(" %d", n_doc);
25611             printf(" %d", n_cur);
25612             printf("\n");
25613         }
25614     }
25615     }
25616     function_tests++;
25617
25618     return(test_ret);
25619 }
25620
25621
25622 static int
25623 test_xmlCopyElementContent(void) {
25624     int test_ret = 0;
25625
25626     int mem_base;
25627     xmlElementContentPtr ret_val;
25628     xmlElementContentPtr cur; /* An element content pointer. */
25629     int n_cur;
25630
25631     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25632         mem_base = xmlMemBlocks();
25633         cur = gen_xmlElementContentPtr(n_cur, 0);
25634
25635         ret_val = xmlCopyElementContent(cur);
25636         desret_xmlElementContentPtr(ret_val);
25637         call_tests++;
25638         des_xmlElementContentPtr(n_cur, cur, 0);
25639         xmlResetLastError();
25640         if (mem_base != xmlMemBlocks()) {
25641             printf("Leak of %d blocks found in xmlCopyElementContent",
25642                    xmlMemBlocks() - mem_base);
25643             test_ret++;
25644             printf(" %d", n_cur);
25645             printf("\n");
25646         }
25647     }
25648     function_tests++;
25649
25650     return(test_ret);
25651 }
25652
25653
25654 #define gen_nb_xmlElementTablePtr 1
25655 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25656     return(NULL);
25657 }
25658 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25659 }
25660
25661 static int
25662 test_xmlCopyElementTable(void) {
25663     int test_ret = 0;
25664
25665
25666     /* missing type support */
25667     return(test_ret);
25668 }
25669
25670
25671 static int
25672 test_xmlCopyEnumeration(void) {
25673     int test_ret = 0;
25674
25675
25676     /* missing type support */
25677     return(test_ret);
25678 }
25679
25680
25681 #define gen_nb_xmlNotationTablePtr 1
25682 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25683     return(NULL);
25684 }
25685 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25686 }
25687
25688 static int
25689 test_xmlCopyNotationTable(void) {
25690     int test_ret = 0;
25691
25692
25693     /* missing type support */
25694     return(test_ret);
25695 }
25696
25697
25698 static int
25699 test_xmlCreateEnumeration(void) {
25700     int test_ret = 0;
25701
25702
25703     /* missing type support */
25704     return(test_ret);
25705 }
25706
25707
25708 #define gen_nb_xmlAttributePtr 1
25709 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25710     return(NULL);
25711 }
25712 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25713 }
25714
25715 static int
25716 test_xmlDumpAttributeDecl(void) {
25717     int test_ret = 0;
25718
25719 #if defined(LIBXML_OUTPUT_ENABLED)
25720     int mem_base;
25721     xmlBufferPtr buf; /* the XML buffer output */
25722     int n_buf;
25723     xmlAttributePtr attr; /* An attribute declaration */
25724     int n_attr;
25725
25726     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25727     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25728         mem_base = xmlMemBlocks();
25729         buf = gen_xmlBufferPtr(n_buf, 0);
25730         attr = gen_xmlAttributePtr(n_attr, 1);
25731
25732         xmlDumpAttributeDecl(buf, attr);
25733         call_tests++;
25734         des_xmlBufferPtr(n_buf, buf, 0);
25735         des_xmlAttributePtr(n_attr, attr, 1);
25736         xmlResetLastError();
25737         if (mem_base != xmlMemBlocks()) {
25738             printf("Leak of %d blocks found in xmlDumpAttributeDecl",
25739                    xmlMemBlocks() - mem_base);
25740             test_ret++;
25741             printf(" %d", n_buf);
25742             printf(" %d", n_attr);
25743             printf("\n");
25744         }
25745     }
25746     }
25747     function_tests++;
25748 #endif
25749
25750     return(test_ret);
25751 }
25752
25753
25754 static int
25755 test_xmlDumpAttributeTable(void) {
25756     int test_ret = 0;
25757
25758 #if defined(LIBXML_OUTPUT_ENABLED)
25759     int mem_base;
25760     xmlBufferPtr buf; /* the XML buffer output */
25761     int n_buf;
25762     xmlAttributeTablePtr table; /* An attribute table */
25763     int n_table;
25764
25765     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25766     for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
25767         mem_base = xmlMemBlocks();
25768         buf = gen_xmlBufferPtr(n_buf, 0);
25769         table = gen_xmlAttributeTablePtr(n_table, 1);
25770
25771         xmlDumpAttributeTable(buf, table);
25772         call_tests++;
25773         des_xmlBufferPtr(n_buf, buf, 0);
25774         des_xmlAttributeTablePtr(n_table, table, 1);
25775         xmlResetLastError();
25776         if (mem_base != xmlMemBlocks()) {
25777             printf("Leak of %d blocks found in xmlDumpAttributeTable",
25778                    xmlMemBlocks() - mem_base);
25779             test_ret++;
25780             printf(" %d", n_buf);
25781             printf(" %d", n_table);
25782             printf("\n");
25783         }
25784     }
25785     }
25786     function_tests++;
25787 #endif
25788
25789     return(test_ret);
25790 }
25791
25792
25793 #define gen_nb_xmlElementPtr 1
25794 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25795     return(NULL);
25796 }
25797 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25798 }
25799
25800 static int
25801 test_xmlDumpElementDecl(void) {
25802     int test_ret = 0;
25803
25804 #if defined(LIBXML_OUTPUT_ENABLED)
25805     int mem_base;
25806     xmlBufferPtr buf; /* the XML buffer output */
25807     int n_buf;
25808     xmlElementPtr elem; /* An element table */
25809     int n_elem;
25810
25811     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25812     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25813         mem_base = xmlMemBlocks();
25814         buf = gen_xmlBufferPtr(n_buf, 0);
25815         elem = gen_xmlElementPtr(n_elem, 1);
25816
25817         xmlDumpElementDecl(buf, elem);
25818         call_tests++;
25819         des_xmlBufferPtr(n_buf, buf, 0);
25820         des_xmlElementPtr(n_elem, elem, 1);
25821         xmlResetLastError();
25822         if (mem_base != xmlMemBlocks()) {
25823             printf("Leak of %d blocks found in xmlDumpElementDecl",
25824                    xmlMemBlocks() - mem_base);
25825             test_ret++;
25826             printf(" %d", n_buf);
25827             printf(" %d", n_elem);
25828             printf("\n");
25829         }
25830     }
25831     }
25832     function_tests++;
25833 #endif
25834
25835     return(test_ret);
25836 }
25837
25838
25839 static int
25840 test_xmlDumpElementTable(void) {
25841     int test_ret = 0;
25842
25843 #if defined(LIBXML_OUTPUT_ENABLED)
25844     int mem_base;
25845     xmlBufferPtr buf; /* the XML buffer output */
25846     int n_buf;
25847     xmlElementTablePtr table; /* An element table */
25848     int n_table;
25849
25850     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25851     for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25852         mem_base = xmlMemBlocks();
25853         buf = gen_xmlBufferPtr(n_buf, 0);
25854         table = gen_xmlElementTablePtr(n_table, 1);
25855
25856         xmlDumpElementTable(buf, table);
25857         call_tests++;
25858         des_xmlBufferPtr(n_buf, buf, 0);
25859         des_xmlElementTablePtr(n_table, table, 1);
25860         xmlResetLastError();
25861         if (mem_base != xmlMemBlocks()) {
25862             printf("Leak of %d blocks found in xmlDumpElementTable",
25863                    xmlMemBlocks() - mem_base);
25864             test_ret++;
25865             printf(" %d", n_buf);
25866             printf(" %d", n_table);
25867             printf("\n");
25868         }
25869     }
25870     }
25871     function_tests++;
25872 #endif
25873
25874     return(test_ret);
25875 }
25876
25877
25878 #define gen_nb_xmlNotationPtr 1
25879 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25880     return(NULL);
25881 }
25882 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25883 }
25884
25885 static int
25886 test_xmlDumpNotationDecl(void) {
25887     int test_ret = 0;
25888
25889 #if defined(LIBXML_OUTPUT_ENABLED)
25890     int mem_base;
25891     xmlBufferPtr buf; /* the XML buffer output */
25892     int n_buf;
25893     xmlNotationPtr nota; /* A notation declaration */
25894     int n_nota;
25895
25896     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25897     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25898         mem_base = xmlMemBlocks();
25899         buf = gen_xmlBufferPtr(n_buf, 0);
25900         nota = gen_xmlNotationPtr(n_nota, 1);
25901
25902         xmlDumpNotationDecl(buf, nota);
25903         call_tests++;
25904         des_xmlBufferPtr(n_buf, buf, 0);
25905         des_xmlNotationPtr(n_nota, nota, 1);
25906         xmlResetLastError();
25907         if (mem_base != xmlMemBlocks()) {
25908             printf("Leak of %d blocks found in xmlDumpNotationDecl",
25909                    xmlMemBlocks() - mem_base);
25910             test_ret++;
25911             printf(" %d", n_buf);
25912             printf(" %d", n_nota);
25913             printf("\n");
25914         }
25915     }
25916     }
25917     function_tests++;
25918 #endif
25919
25920     return(test_ret);
25921 }
25922
25923
25924 static int
25925 test_xmlDumpNotationTable(void) {
25926     int test_ret = 0;
25927
25928 #if defined(LIBXML_OUTPUT_ENABLED)
25929     int mem_base;
25930     xmlBufferPtr buf; /* the XML buffer output */
25931     int n_buf;
25932     xmlNotationTablePtr table; /* A notation table */
25933     int n_table;
25934
25935     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25936     for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25937         mem_base = xmlMemBlocks();
25938         buf = gen_xmlBufferPtr(n_buf, 0);
25939         table = gen_xmlNotationTablePtr(n_table, 1);
25940
25941         xmlDumpNotationTable(buf, table);
25942         call_tests++;
25943         des_xmlBufferPtr(n_buf, buf, 0);
25944         des_xmlNotationTablePtr(n_table, table, 1);
25945         xmlResetLastError();
25946         if (mem_base != xmlMemBlocks()) {
25947             printf("Leak of %d blocks found in xmlDumpNotationTable",
25948                    xmlMemBlocks() - mem_base);
25949             test_ret++;
25950             printf(" %d", n_buf);
25951             printf(" %d", n_table);
25952             printf("\n");
25953         }
25954     }
25955     }
25956     function_tests++;
25957 #endif
25958
25959     return(test_ret);
25960 }
25961
25962
25963 static int
25964 test_xmlGetDtdAttrDesc(void) {
25965     int test_ret = 0;
25966
25967     int mem_base;
25968     xmlAttributePtr ret_val;
25969     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25970     int n_dtd;
25971     xmlChar * elem; /* the element name */
25972     int n_elem;
25973     xmlChar * name; /* the attribute name */
25974     int n_name;
25975
25976     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25977     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25978     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25979         mem_base = xmlMemBlocks();
25980         dtd = gen_xmlDtdPtr(n_dtd, 0);
25981         elem = gen_const_xmlChar_ptr(n_elem, 1);
25982         name = gen_const_xmlChar_ptr(n_name, 2);
25983
25984         ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25985         desret_xmlAttributePtr(ret_val);
25986         call_tests++;
25987         des_xmlDtdPtr(n_dtd, dtd, 0);
25988         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25989         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25990         xmlResetLastError();
25991         if (mem_base != xmlMemBlocks()) {
25992             printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25993                    xmlMemBlocks() - mem_base);
25994             test_ret++;
25995             printf(" %d", n_dtd);
25996             printf(" %d", n_elem);
25997             printf(" %d", n_name);
25998             printf("\n");
25999         }
26000     }
26001     }
26002     }
26003     function_tests++;
26004
26005     return(test_ret);
26006 }
26007
26008
26009 static int
26010 test_xmlGetDtdElementDesc(void) {
26011     int test_ret = 0;
26012
26013     int mem_base;
26014     xmlElementPtr ret_val;
26015     xmlDtdPtr dtd; /* a pointer to the DtD to search */
26016     int n_dtd;
26017     xmlChar * name; /* the element name */
26018     int n_name;
26019
26020     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26021     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26022         mem_base = xmlMemBlocks();
26023         dtd = gen_xmlDtdPtr(n_dtd, 0);
26024         name = gen_const_xmlChar_ptr(n_name, 1);
26025
26026         ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
26027         desret_xmlElementPtr(ret_val);
26028         call_tests++;
26029         des_xmlDtdPtr(n_dtd, dtd, 0);
26030         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
26031         xmlResetLastError();
26032         if (mem_base != xmlMemBlocks()) {
26033             printf("Leak of %d blocks found in xmlGetDtdElementDesc",
26034                    xmlMemBlocks() - mem_base);
26035             test_ret++;
26036             printf(" %d", n_dtd);
26037             printf(" %d", n_name);
26038             printf("\n");
26039         }
26040     }
26041     }
26042     function_tests++;
26043
26044     return(test_ret);
26045 }
26046
26047
26048 static int
26049 test_xmlGetDtdNotationDesc(void) {
26050     int test_ret = 0;
26051
26052
26053     /* missing type support */
26054     return(test_ret);
26055 }
26056
26057
26058 static int
26059 test_xmlGetDtdQAttrDesc(void) {
26060     int test_ret = 0;
26061
26062     int mem_base;
26063     xmlAttributePtr ret_val;
26064     xmlDtdPtr dtd; /* a pointer to the DtD to search */
26065     int n_dtd;
26066     xmlChar * elem; /* the element name */
26067     int n_elem;
26068     xmlChar * name; /* the attribute name */
26069     int n_name;
26070     xmlChar * prefix; /* the attribute namespace prefix */
26071     int n_prefix;
26072
26073     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26074     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
26075     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26076     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26077         mem_base = xmlMemBlocks();
26078         dtd = gen_xmlDtdPtr(n_dtd, 0);
26079         elem = gen_const_xmlChar_ptr(n_elem, 1);
26080         name = gen_const_xmlChar_ptr(n_name, 2);
26081         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26082
26083         ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
26084         desret_xmlAttributePtr(ret_val);
26085         call_tests++;
26086         des_xmlDtdPtr(n_dtd, dtd, 0);
26087         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
26088         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26089         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26090         xmlResetLastError();
26091         if (mem_base != xmlMemBlocks()) {
26092             printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
26093                    xmlMemBlocks() - mem_base);
26094             test_ret++;
26095             printf(" %d", n_dtd);
26096             printf(" %d", n_elem);
26097             printf(" %d", n_name);
26098             printf(" %d", n_prefix);
26099             printf("\n");
26100         }
26101     }
26102     }
26103     }
26104     }
26105     function_tests++;
26106
26107     return(test_ret);
26108 }
26109
26110
26111 static int
26112 test_xmlGetDtdQElementDesc(void) {
26113     int test_ret = 0;
26114
26115     int mem_base;
26116     xmlElementPtr ret_val;
26117     xmlDtdPtr dtd; /* a pointer to the DtD to search */
26118     int n_dtd;
26119     xmlChar * name; /* the element name */
26120     int n_name;
26121     xmlChar * prefix; /* the element namespace prefix */
26122     int n_prefix;
26123
26124     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26125     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26126     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26127         mem_base = xmlMemBlocks();
26128         dtd = gen_xmlDtdPtr(n_dtd, 0);
26129         name = gen_const_xmlChar_ptr(n_name, 1);
26130         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
26131
26132         ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
26133         desret_xmlElementPtr(ret_val);
26134         call_tests++;
26135         des_xmlDtdPtr(n_dtd, dtd, 0);
26136         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
26137         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
26138         xmlResetLastError();
26139         if (mem_base != xmlMemBlocks()) {
26140             printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
26141                    xmlMemBlocks() - mem_base);
26142             test_ret++;
26143             printf(" %d", n_dtd);
26144             printf(" %d", n_name);
26145             printf(" %d", n_prefix);
26146             printf("\n");
26147         }
26148     }
26149     }
26150     }
26151     function_tests++;
26152
26153     return(test_ret);
26154 }
26155
26156
26157 static int
26158 test_xmlGetID(void) {
26159     int test_ret = 0;
26160
26161     int mem_base;
26162     xmlAttrPtr ret_val;
26163     xmlDocPtr doc; /* pointer to the document */
26164     int n_doc;
26165     xmlChar * ID; /* the ID value */
26166     int n_ID;
26167
26168     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26169     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
26170         mem_base = xmlMemBlocks();
26171         doc = gen_xmlDocPtr(n_doc, 0);
26172         ID = gen_const_xmlChar_ptr(n_ID, 1);
26173
26174         ret_val = xmlGetID(doc, (const xmlChar *)ID);
26175         desret_xmlAttrPtr(ret_val);
26176         call_tests++;
26177         des_xmlDocPtr(n_doc, doc, 0);
26178         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
26179         xmlResetLastError();
26180         if (mem_base != xmlMemBlocks()) {
26181             printf("Leak of %d blocks found in xmlGetID",
26182                    xmlMemBlocks() - mem_base);
26183             test_ret++;
26184             printf(" %d", n_doc);
26185             printf(" %d", n_ID);
26186             printf("\n");
26187         }
26188     }
26189     }
26190     function_tests++;
26191
26192     return(test_ret);
26193 }
26194
26195
26196 static int
26197 test_xmlGetRefs(void) {
26198     int test_ret = 0;
26199
26200
26201     /* missing type support */
26202     return(test_ret);
26203 }
26204
26205
26206 static int
26207 test_xmlIsID(void) {
26208     int test_ret = 0;
26209
26210     int mem_base;
26211     int ret_val;
26212     xmlDocPtr doc; /* the document */
26213     int n_doc;
26214     xmlNodePtr elem; /* the element carrying the attribute */
26215     int n_elem;
26216     xmlAttrPtr attr; /* the attribute */
26217     int n_attr;
26218
26219     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26220     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26221     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26222         mem_base = xmlMemBlocks();
26223         doc = gen_xmlDocPtr(n_doc, 0);
26224         elem = gen_xmlNodePtr(n_elem, 1);
26225         attr = gen_xmlAttrPtr(n_attr, 2);
26226
26227         ret_val = xmlIsID(doc, elem, attr);
26228         desret_int(ret_val);
26229         call_tests++;
26230         des_xmlDocPtr(n_doc, doc, 0);
26231         des_xmlNodePtr(n_elem, elem, 1);
26232         des_xmlAttrPtr(n_attr, attr, 2);
26233         xmlResetLastError();
26234         if (mem_base != xmlMemBlocks()) {
26235             printf("Leak of %d blocks found in xmlIsID",
26236                    xmlMemBlocks() - mem_base);
26237             test_ret++;
26238             printf(" %d", n_doc);
26239             printf(" %d", n_elem);
26240             printf(" %d", n_attr);
26241             printf("\n");
26242         }
26243     }
26244     }
26245     }
26246     function_tests++;
26247
26248     return(test_ret);
26249 }
26250
26251
26252 static int
26253 test_xmlIsMixedElement(void) {
26254     int test_ret = 0;
26255
26256     int mem_base;
26257     int ret_val;
26258     xmlDocPtr doc; /* the document */
26259     int n_doc;
26260     xmlChar * name; /* the element name */
26261     int n_name;
26262
26263     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26264     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26265         mem_base = xmlMemBlocks();
26266         doc = gen_xmlDocPtr(n_doc, 0);
26267         name = gen_const_xmlChar_ptr(n_name, 1);
26268
26269         ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
26270         desret_int(ret_val);
26271         call_tests++;
26272         des_xmlDocPtr(n_doc, doc, 0);
26273         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
26274         xmlResetLastError();
26275         if (mem_base != xmlMemBlocks()) {
26276             printf("Leak of %d blocks found in xmlIsMixedElement",
26277                    xmlMemBlocks() - mem_base);
26278             test_ret++;
26279             printf(" %d", n_doc);
26280             printf(" %d", n_name);
26281             printf("\n");
26282         }
26283     }
26284     }
26285     function_tests++;
26286
26287     return(test_ret);
26288 }
26289
26290
26291 static int
26292 test_xmlIsRef(void) {
26293     int test_ret = 0;
26294
26295     int mem_base;
26296     int ret_val;
26297     xmlDocPtr doc; /* the document */
26298     int n_doc;
26299     xmlNodePtr elem; /* the element carrying the attribute */
26300     int n_elem;
26301     xmlAttrPtr attr; /* the attribute */
26302     int n_attr;
26303
26304     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26305     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26306     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26307         mem_base = xmlMemBlocks();
26308         doc = gen_xmlDocPtr(n_doc, 0);
26309         elem = gen_xmlNodePtr(n_elem, 1);
26310         attr = gen_xmlAttrPtr(n_attr, 2);
26311
26312         ret_val = xmlIsRef(doc, elem, attr);
26313         desret_int(ret_val);
26314         call_tests++;
26315         des_xmlDocPtr(n_doc, doc, 0);
26316         des_xmlNodePtr(n_elem, elem, 1);
26317         des_xmlAttrPtr(n_attr, attr, 2);
26318         xmlResetLastError();
26319         if (mem_base != xmlMemBlocks()) {
26320             printf("Leak of %d blocks found in xmlIsRef",
26321                    xmlMemBlocks() - mem_base);
26322             test_ret++;
26323             printf(" %d", n_doc);
26324             printf(" %d", n_elem);
26325             printf(" %d", n_attr);
26326             printf("\n");
26327         }
26328     }
26329     }
26330     }
26331     function_tests++;
26332
26333     return(test_ret);
26334 }
26335
26336
26337 static int
26338 test_xmlNewDocElementContent(void) {
26339     int test_ret = 0;
26340
26341     int mem_base;
26342     xmlElementContentPtr ret_val;
26343     xmlDocPtr doc; /* the document */
26344     int n_doc;
26345     xmlChar * name; /* the subelement name or NULL */
26346     int n_name;
26347     xmlElementContentType type; /* the type of element content decl */
26348     int n_type;
26349
26350     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26351     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26352     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
26353         mem_base = xmlMemBlocks();
26354         doc = gen_xmlDocPtr(n_doc, 0);
26355         name = gen_const_xmlChar_ptr(n_name, 1);
26356         type = gen_xmlElementContentType(n_type, 2);
26357
26358         ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
26359         xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
26360         desret_xmlElementContentPtr(ret_val);
26361         call_tests++;
26362         des_xmlDocPtr(n_doc, doc, 0);
26363         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
26364         des_xmlElementContentType(n_type, type, 2);
26365         xmlResetLastError();
26366         if (mem_base != xmlMemBlocks()) {
26367             printf("Leak of %d blocks found in xmlNewDocElementContent",
26368                    xmlMemBlocks() - mem_base);
26369             test_ret++;
26370             printf(" %d", n_doc);
26371             printf(" %d", n_name);
26372             printf(" %d", n_type);
26373             printf("\n");
26374         }
26375     }
26376     }
26377     }
26378     function_tests++;
26379
26380     return(test_ret);
26381 }
26382
26383
26384 static int
26385 test_xmlNewElementContent(void) {
26386     int test_ret = 0;
26387
26388     int mem_base;
26389     xmlElementContentPtr ret_val;
26390     xmlChar * name; /* the subelement name or NULL */
26391     int n_name;
26392     xmlElementContentType type; /* the type of element content decl */
26393     int n_type;
26394
26395     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26396     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
26397         mem_base = xmlMemBlocks();
26398         name = gen_const_xmlChar_ptr(n_name, 0);
26399         type = gen_xmlElementContentType(n_type, 1);
26400
26401         ret_val = xmlNewElementContent((const xmlChar *)name, type);
26402         desret_xmlElementContentPtr(ret_val);
26403         call_tests++;
26404         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
26405         des_xmlElementContentType(n_type, type, 1);
26406         xmlResetLastError();
26407         if (mem_base != xmlMemBlocks()) {
26408             printf("Leak of %d blocks found in xmlNewElementContent",
26409                    xmlMemBlocks() - mem_base);
26410             test_ret++;
26411             printf(" %d", n_name);
26412             printf(" %d", n_type);
26413             printf("\n");
26414         }
26415     }
26416     }
26417     function_tests++;
26418
26419     return(test_ret);
26420 }
26421
26422
26423 static int
26424 test_xmlNewValidCtxt(void) {
26425     int test_ret = 0;
26426
26427
26428     /* missing type support */
26429     return(test_ret);
26430 }
26431
26432
26433 static int
26434 test_xmlRemoveID(void) {
26435     int test_ret = 0;
26436
26437     int mem_base;
26438     int ret_val;
26439     xmlDocPtr doc; /* the document */
26440     int n_doc;
26441     xmlAttrPtr attr; /* the attribute */
26442     int n_attr;
26443
26444     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26445     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26446         mem_base = xmlMemBlocks();
26447         doc = gen_xmlDocPtr(n_doc, 0);
26448         attr = gen_xmlAttrPtr(n_attr, 1);
26449
26450         ret_val = xmlRemoveID(doc, attr);
26451         desret_int(ret_val);
26452         call_tests++;
26453         des_xmlDocPtr(n_doc, doc, 0);
26454         des_xmlAttrPtr(n_attr, attr, 1);
26455         xmlResetLastError();
26456         if (mem_base != xmlMemBlocks()) {
26457             printf("Leak of %d blocks found in xmlRemoveID",
26458                    xmlMemBlocks() - mem_base);
26459             test_ret++;
26460             printf(" %d", n_doc);
26461             printf(" %d", n_attr);
26462             printf("\n");
26463         }
26464     }
26465     }
26466     function_tests++;
26467
26468     return(test_ret);
26469 }
26470
26471
26472 static int
26473 test_xmlRemoveRef(void) {
26474     int test_ret = 0;
26475
26476     int mem_base;
26477     int ret_val;
26478     xmlDocPtr doc; /* the document */
26479     int n_doc;
26480     xmlAttrPtr attr; /* the attribute */
26481     int n_attr;
26482
26483     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26484     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26485         mem_base = xmlMemBlocks();
26486         doc = gen_xmlDocPtr(n_doc, 0);
26487         attr = gen_xmlAttrPtr(n_attr, 1);
26488
26489         ret_val = xmlRemoveRef(doc, attr);
26490         desret_int(ret_val);
26491         call_tests++;
26492         des_xmlDocPtr(n_doc, doc, 0);
26493         des_xmlAttrPtr(n_attr, attr, 1);
26494         xmlResetLastError();
26495         if (mem_base != xmlMemBlocks()) {
26496             printf("Leak of %d blocks found in xmlRemoveRef",
26497                    xmlMemBlocks() - mem_base);
26498             test_ret++;
26499             printf(" %d", n_doc);
26500             printf(" %d", n_attr);
26501             printf("\n");
26502         }
26503     }
26504     }
26505     function_tests++;
26506
26507     return(test_ret);
26508 }
26509
26510
26511 static int
26512 test_xmlSnprintfElementContent(void) {
26513     int test_ret = 0;
26514
26515     int mem_base;
26516     char * buf; /* an output buffer */
26517     int n_buf;
26518     int size; /* the buffer size */
26519     int n_size;
26520     xmlElementContentPtr content; /* An element table */
26521     int n_content;
26522     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26523     int n_englob;
26524
26525     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26526     for (n_size = 0;n_size < gen_nb_int;n_size++) {
26527     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26528     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26529         mem_base = xmlMemBlocks();
26530         buf = gen_char_ptr(n_buf, 0);
26531         size = gen_int(n_size, 1);
26532         content = gen_xmlElementContentPtr(n_content, 2);
26533         englob = gen_int(n_englob, 3);
26534
26535         xmlSnprintfElementContent(buf, size, content, englob);
26536         call_tests++;
26537         des_char_ptr(n_buf, buf, 0);
26538         des_int(n_size, size, 1);
26539         des_xmlElementContentPtr(n_content, content, 2);
26540         des_int(n_englob, englob, 3);
26541         xmlResetLastError();
26542         if (mem_base != xmlMemBlocks()) {
26543             printf("Leak of %d blocks found in xmlSnprintfElementContent",
26544                    xmlMemBlocks() - mem_base);
26545             test_ret++;
26546             printf(" %d", n_buf);
26547             printf(" %d", n_size);
26548             printf(" %d", n_content);
26549             printf(" %d", n_englob);
26550             printf("\n");
26551         }
26552     }
26553     }
26554     }
26555     }
26556     function_tests++;
26557
26558     return(test_ret);
26559 }
26560
26561
26562 static int
26563 test_xmlSprintfElementContent(void) {
26564     int test_ret = 0;
26565
26566 #if defined(LIBXML_OUTPUT_ENABLED)
26567 #ifdef LIBXML_OUTPUT_ENABLED
26568     int mem_base;
26569     char * buf; /* an output buffer */
26570     int n_buf;
26571     xmlElementContentPtr content; /* An element table */
26572     int n_content;
26573     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26574     int n_englob;
26575
26576     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26577     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26578     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26579         mem_base = xmlMemBlocks();
26580         buf = gen_char_ptr(n_buf, 0);
26581         content = gen_xmlElementContentPtr(n_content, 1);
26582         englob = gen_int(n_englob, 2);
26583
26584         xmlSprintfElementContent(buf, content, englob);
26585         call_tests++;
26586         des_char_ptr(n_buf, buf, 0);
26587         des_xmlElementContentPtr(n_content, content, 1);
26588         des_int(n_englob, englob, 2);
26589         xmlResetLastError();
26590         if (mem_base != xmlMemBlocks()) {
26591             printf("Leak of %d blocks found in xmlSprintfElementContent",
26592                    xmlMemBlocks() - mem_base);
26593             test_ret++;
26594             printf(" %d", n_buf);
26595             printf(" %d", n_content);
26596             printf(" %d", n_englob);
26597             printf("\n");
26598         }
26599     }
26600     }
26601     }
26602     function_tests++;
26603 #endif
26604 #endif
26605
26606     return(test_ret);
26607 }
26608
26609
26610 static int
26611 test_xmlValidBuildContentModel(void) {
26612     int test_ret = 0;
26613
26614 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26615     int mem_base;
26616     int ret_val;
26617     xmlValidCtxtPtr ctxt; /* a validation context */
26618     int n_ctxt;
26619     xmlElementPtr elem; /* an element declaration node */
26620     int n_elem;
26621
26622     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26623     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26624         mem_base = xmlMemBlocks();
26625         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26626         elem = gen_xmlElementPtr(n_elem, 1);
26627
26628         ret_val = xmlValidBuildContentModel(ctxt, elem);
26629         desret_int(ret_val);
26630         call_tests++;
26631         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26632         des_xmlElementPtr(n_elem, elem, 1);
26633         xmlResetLastError();
26634         if (mem_base != xmlMemBlocks()) {
26635             printf("Leak of %d blocks found in xmlValidBuildContentModel",
26636                    xmlMemBlocks() - mem_base);
26637             test_ret++;
26638             printf(" %d", n_ctxt);
26639             printf(" %d", n_elem);
26640             printf("\n");
26641         }
26642     }
26643     }
26644     function_tests++;
26645 #endif
26646
26647     return(test_ret);
26648 }
26649
26650
26651 static int
26652 test_xmlValidCtxtNormalizeAttributeValue(void) {
26653     int test_ret = 0;
26654
26655 #if defined(LIBXML_VALID_ENABLED)
26656     int mem_base;
26657     xmlChar * ret_val;
26658     xmlValidCtxtPtr ctxt; /* the validation context or NULL */
26659     int n_ctxt;
26660     xmlDocPtr doc; /* the document */
26661     int n_doc;
26662     xmlNodePtr elem; /* the parent */
26663     int n_elem;
26664     xmlChar * name; /* the attribute name */
26665     int n_name;
26666     xmlChar * value; /* the attribute value */
26667     int n_value;
26668
26669     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26670     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26671     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26672     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26673     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26674         mem_base = xmlMemBlocks();
26675         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26676         doc = gen_xmlDocPtr(n_doc, 1);
26677         elem = gen_xmlNodePtr(n_elem, 2);
26678         name = gen_const_xmlChar_ptr(n_name, 3);
26679         value = gen_const_xmlChar_ptr(n_value, 4);
26680
26681         ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26682         desret_xmlChar_ptr(ret_val);
26683         call_tests++;
26684         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26685         des_xmlDocPtr(n_doc, doc, 1);
26686         des_xmlNodePtr(n_elem, elem, 2);
26687         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
26688         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26689         xmlResetLastError();
26690         if (mem_base != xmlMemBlocks()) {
26691             printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
26692                    xmlMemBlocks() - mem_base);
26693             test_ret++;
26694             printf(" %d", n_ctxt);
26695             printf(" %d", n_doc);
26696             printf(" %d", n_elem);
26697             printf(" %d", n_name);
26698             printf(" %d", n_value);
26699             printf("\n");
26700         }
26701     }
26702     }
26703     }
26704     }
26705     }
26706     function_tests++;
26707 #endif
26708
26709     return(test_ret);
26710 }
26711
26712
26713 #define gen_nb_xmlElementContent_ptr 1
26714 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26715     return(NULL);
26716 }
26717 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26718 }
26719
26720 static int
26721 test_xmlValidGetPotentialChildren(void) {
26722     int test_ret = 0;
26723
26724 #if defined(LIBXML_VALID_ENABLED)
26725 #ifdef LIBXML_VALID_ENABLED
26726     int mem_base;
26727     int ret_val;
26728     xmlElementContent * ctree; /* an element content tree */
26729     int n_ctree;
26730     xmlChar ** names; /* an array to store the list of child names */
26731     int n_names;
26732     int * len; /* a pointer to the number of element in the list */
26733     int n_len;
26734     int max; /* the size of the array */
26735     int n_max;
26736
26737     for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
26738     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26739     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
26740     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26741         mem_base = xmlMemBlocks();
26742         ctree = gen_xmlElementContent_ptr(n_ctree, 0);
26743         names = gen_const_xmlChar_ptr_ptr(n_names, 1);
26744         len = gen_int_ptr(n_len, 2);
26745         max = gen_int(n_max, 3);
26746
26747         ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
26748         desret_int(ret_val);
26749         call_tests++;
26750         des_xmlElementContent_ptr(n_ctree, ctree, 0);
26751         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
26752         des_int_ptr(n_len, len, 2);
26753         des_int(n_max, max, 3);
26754         xmlResetLastError();
26755         if (mem_base != xmlMemBlocks()) {
26756             printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
26757                    xmlMemBlocks() - mem_base);
26758             test_ret++;
26759             printf(" %d", n_ctree);
26760             printf(" %d", n_names);
26761             printf(" %d", n_len);
26762             printf(" %d", n_max);
26763             printf("\n");
26764         }
26765     }
26766     }
26767     }
26768     }
26769     function_tests++;
26770 #endif
26771 #endif
26772
26773     return(test_ret);
26774 }
26775
26776
26777 static int
26778 test_xmlValidGetValidElements(void) {
26779     int test_ret = 0;
26780
26781 #if defined(LIBXML_VALID_ENABLED)
26782 #ifdef LIBXML_VALID_ENABLED
26783     int mem_base;
26784     int ret_val;
26785     xmlNode * prev; /* an element to insert after */
26786     int n_prev;
26787     xmlNode * next; /* an element to insert next */
26788     int n_next;
26789     xmlChar ** names; /* an array to store the list of child names */
26790     int n_names;
26791     int max; /* the size of the array */
26792     int n_max;
26793
26794     for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
26795     for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26796     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26797     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26798         mem_base = xmlMemBlocks();
26799         prev = gen_xmlNodePtr(n_prev, 0);
26800         next = gen_xmlNodePtr(n_next, 1);
26801         names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26802         max = gen_int(n_max, 3);
26803
26804         ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26805         desret_int(ret_val);
26806         call_tests++;
26807         des_xmlNodePtr(n_prev, prev, 0);
26808         des_xmlNodePtr(n_next, next, 1);
26809         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26810         des_int(n_max, max, 3);
26811         xmlResetLastError();
26812         if (mem_base != xmlMemBlocks()) {
26813             printf("Leak of %d blocks found in xmlValidGetValidElements",
26814                    xmlMemBlocks() - mem_base);
26815             test_ret++;
26816             printf(" %d", n_prev);
26817             printf(" %d", n_next);
26818             printf(" %d", n_names);
26819             printf(" %d", n_max);
26820             printf("\n");
26821         }
26822     }
26823     }
26824     }
26825     }
26826     function_tests++;
26827 #endif
26828 #endif
26829
26830     return(test_ret);
26831 }
26832
26833
26834 static int
26835 test_xmlValidNormalizeAttributeValue(void) {
26836     int test_ret = 0;
26837
26838 #if defined(LIBXML_VALID_ENABLED)
26839     int mem_base;
26840     xmlChar * ret_val;
26841     xmlDocPtr doc; /* the document */
26842     int n_doc;
26843     xmlNodePtr elem; /* the parent */
26844     int n_elem;
26845     xmlChar * name; /* the attribute name */
26846     int n_name;
26847     xmlChar * value; /* the attribute value */
26848     int n_value;
26849
26850     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26851     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26852     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26853     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26854         mem_base = xmlMemBlocks();
26855         doc = gen_xmlDocPtr(n_doc, 0);
26856         elem = gen_xmlNodePtr(n_elem, 1);
26857         name = gen_const_xmlChar_ptr(n_name, 2);
26858         value = gen_const_xmlChar_ptr(n_value, 3);
26859
26860         ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26861         desret_xmlChar_ptr(ret_val);
26862         call_tests++;
26863         des_xmlDocPtr(n_doc, doc, 0);
26864         des_xmlNodePtr(n_elem, elem, 1);
26865         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26866         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26867         xmlResetLastError();
26868         if (mem_base != xmlMemBlocks()) {
26869             printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26870                    xmlMemBlocks() - mem_base);
26871             test_ret++;
26872             printf(" %d", n_doc);
26873             printf(" %d", n_elem);
26874             printf(" %d", n_name);
26875             printf(" %d", n_value);
26876             printf("\n");
26877         }
26878     }
26879     }
26880     }
26881     }
26882     function_tests++;
26883 #endif
26884
26885     return(test_ret);
26886 }
26887
26888
26889 static int
26890 test_xmlValidateAttributeDecl(void) {
26891     int test_ret = 0;
26892
26893 #if defined(LIBXML_VALID_ENABLED)
26894     int mem_base;
26895     int ret_val;
26896     xmlValidCtxtPtr ctxt; /* the validation context */
26897     int n_ctxt;
26898     xmlDocPtr doc; /* a document instance */
26899     int n_doc;
26900     xmlAttributePtr attr; /* an attribute definition */
26901     int n_attr;
26902
26903     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26904     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26905     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26906         mem_base = xmlMemBlocks();
26907         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26908         doc = gen_xmlDocPtr(n_doc, 1);
26909         attr = gen_xmlAttributePtr(n_attr, 2);
26910
26911         ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26912         desret_int(ret_val);
26913         call_tests++;
26914         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26915         des_xmlDocPtr(n_doc, doc, 1);
26916         des_xmlAttributePtr(n_attr, attr, 2);
26917         xmlResetLastError();
26918         if (mem_base != xmlMemBlocks()) {
26919             printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26920                    xmlMemBlocks() - mem_base);
26921             test_ret++;
26922             printf(" %d", n_ctxt);
26923             printf(" %d", n_doc);
26924             printf(" %d", n_attr);
26925             printf("\n");
26926         }
26927     }
26928     }
26929     }
26930     function_tests++;
26931 #endif
26932
26933     return(test_ret);
26934 }
26935
26936
26937 static int
26938 test_xmlValidateAttributeValue(void) {
26939     int test_ret = 0;
26940
26941 #if defined(LIBXML_VALID_ENABLED)
26942     int mem_base;
26943     int ret_val;
26944     xmlAttributeType type; /* an attribute type */
26945     int n_type;
26946     xmlChar * value; /* an attribute value */
26947     int n_value;
26948
26949     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26950     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26951         mem_base = xmlMemBlocks();
26952         type = gen_xmlAttributeType(n_type, 0);
26953         value = gen_const_xmlChar_ptr(n_value, 1);
26954
26955         ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26956         desret_int(ret_val);
26957         call_tests++;
26958         des_xmlAttributeType(n_type, type, 0);
26959         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26960         xmlResetLastError();
26961         if (mem_base != xmlMemBlocks()) {
26962             printf("Leak of %d blocks found in xmlValidateAttributeValue",
26963                    xmlMemBlocks() - mem_base);
26964             test_ret++;
26965             printf(" %d", n_type);
26966             printf(" %d", n_value);
26967             printf("\n");
26968         }
26969     }
26970     }
26971     function_tests++;
26972 #endif
26973
26974     return(test_ret);
26975 }
26976
26977
26978 static int
26979 test_xmlValidateDocument(void) {
26980     int test_ret = 0;
26981
26982 #if defined(LIBXML_VALID_ENABLED)
26983     int mem_base;
26984     int ret_val;
26985     xmlValidCtxtPtr ctxt; /* the validation context */
26986     int n_ctxt;
26987     xmlDocPtr doc; /* a document instance */
26988     int n_doc;
26989
26990     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26991     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26992         mem_base = xmlMemBlocks();
26993         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26994         doc = gen_xmlDocPtr(n_doc, 1);
26995
26996         ret_val = xmlValidateDocument(ctxt, doc);
26997         desret_int(ret_val);
26998         call_tests++;
26999         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27000         des_xmlDocPtr(n_doc, doc, 1);
27001         xmlResetLastError();
27002         if (mem_base != xmlMemBlocks()) {
27003             printf("Leak of %d blocks found in xmlValidateDocument",
27004                    xmlMemBlocks() - mem_base);
27005             test_ret++;
27006             printf(" %d", n_ctxt);
27007             printf(" %d", n_doc);
27008             printf("\n");
27009         }
27010     }
27011     }
27012     function_tests++;
27013 #endif
27014
27015     return(test_ret);
27016 }
27017
27018
27019 static int
27020 test_xmlValidateDocumentFinal(void) {
27021     int test_ret = 0;
27022
27023 #if defined(LIBXML_VALID_ENABLED)
27024     int mem_base;
27025     int ret_val;
27026     xmlValidCtxtPtr ctxt; /* the validation context */
27027     int n_ctxt;
27028     xmlDocPtr doc; /* a document instance */
27029     int n_doc;
27030
27031     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27032     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27033         mem_base = xmlMemBlocks();
27034         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27035         doc = gen_xmlDocPtr(n_doc, 1);
27036
27037         ret_val = xmlValidateDocumentFinal(ctxt, doc);
27038         desret_int(ret_val);
27039         call_tests++;
27040         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27041         des_xmlDocPtr(n_doc, doc, 1);
27042         xmlResetLastError();
27043         if (mem_base != xmlMemBlocks()) {
27044             printf("Leak of %d blocks found in xmlValidateDocumentFinal",
27045                    xmlMemBlocks() - mem_base);
27046             test_ret++;
27047             printf(" %d", n_ctxt);
27048             printf(" %d", n_doc);
27049             printf("\n");
27050         }
27051     }
27052     }
27053     function_tests++;
27054 #endif
27055
27056     return(test_ret);
27057 }
27058
27059
27060 static int
27061 test_xmlValidateDtd(void) {
27062     int test_ret = 0;
27063
27064 #if defined(LIBXML_VALID_ENABLED)
27065     int mem_base;
27066     int ret_val;
27067     xmlValidCtxtPtr ctxt; /* the validation context */
27068     int n_ctxt;
27069     xmlDocPtr doc; /* a document instance */
27070     int n_doc;
27071     xmlDtdPtr dtd; /* a dtd instance */
27072     int n_dtd;
27073
27074     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27075     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27076     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
27077         mem_base = xmlMemBlocks();
27078         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27079         doc = gen_xmlDocPtr(n_doc, 1);
27080         dtd = gen_xmlDtdPtr(n_dtd, 2);
27081
27082         ret_val = xmlValidateDtd(ctxt, doc, dtd);
27083         desret_int(ret_val);
27084         call_tests++;
27085         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27086         des_xmlDocPtr(n_doc, doc, 1);
27087         des_xmlDtdPtr(n_dtd, dtd, 2);
27088         xmlResetLastError();
27089         if (mem_base != xmlMemBlocks()) {
27090             printf("Leak of %d blocks found in xmlValidateDtd",
27091                    xmlMemBlocks() - mem_base);
27092             test_ret++;
27093             printf(" %d", n_ctxt);
27094             printf(" %d", n_doc);
27095             printf(" %d", n_dtd);
27096             printf("\n");
27097         }
27098     }
27099     }
27100     }
27101     function_tests++;
27102 #endif
27103
27104     return(test_ret);
27105 }
27106
27107
27108 static int
27109 test_xmlValidateDtdFinal(void) {
27110     int test_ret = 0;
27111
27112 #if defined(LIBXML_VALID_ENABLED)
27113     int mem_base;
27114     int ret_val;
27115     xmlValidCtxtPtr ctxt; /* the validation context */
27116     int n_ctxt;
27117     xmlDocPtr doc; /* a document instance */
27118     int n_doc;
27119
27120     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27121     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27122         mem_base = xmlMemBlocks();
27123         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27124         doc = gen_xmlDocPtr(n_doc, 1);
27125
27126         ret_val = xmlValidateDtdFinal(ctxt, doc);
27127         desret_int(ret_val);
27128         call_tests++;
27129         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27130         des_xmlDocPtr(n_doc, doc, 1);
27131         xmlResetLastError();
27132         if (mem_base != xmlMemBlocks()) {
27133             printf("Leak of %d blocks found in xmlValidateDtdFinal",
27134                    xmlMemBlocks() - mem_base);
27135             test_ret++;
27136             printf(" %d", n_ctxt);
27137             printf(" %d", n_doc);
27138             printf("\n");
27139         }
27140     }
27141     }
27142     function_tests++;
27143 #endif
27144
27145     return(test_ret);
27146 }
27147
27148
27149 static int
27150 test_xmlValidateElement(void) {
27151     int test_ret = 0;
27152
27153 #if defined(LIBXML_VALID_ENABLED)
27154     int mem_base;
27155     int ret_val;
27156     xmlValidCtxtPtr ctxt; /* the validation context */
27157     int n_ctxt;
27158     xmlDocPtr doc; /* a document instance */
27159     int n_doc;
27160     xmlNodePtr elem; /* an element instance */
27161     int n_elem;
27162
27163     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27164     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27165     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27166         mem_base = xmlMemBlocks();
27167         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27168         doc = gen_xmlDocPtr(n_doc, 1);
27169         elem = gen_xmlNodePtr(n_elem, 2);
27170
27171         ret_val = xmlValidateElement(ctxt, doc, elem);
27172         desret_int(ret_val);
27173         call_tests++;
27174         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27175         des_xmlDocPtr(n_doc, doc, 1);
27176         des_xmlNodePtr(n_elem, elem, 2);
27177         xmlResetLastError();
27178         if (mem_base != xmlMemBlocks()) {
27179             printf("Leak of %d blocks found in xmlValidateElement",
27180                    xmlMemBlocks() - mem_base);
27181             test_ret++;
27182             printf(" %d", n_ctxt);
27183             printf(" %d", n_doc);
27184             printf(" %d", n_elem);
27185             printf("\n");
27186         }
27187     }
27188     }
27189     }
27190     function_tests++;
27191 #endif
27192
27193     return(test_ret);
27194 }
27195
27196
27197 static int
27198 test_xmlValidateElementDecl(void) {
27199     int test_ret = 0;
27200
27201 #if defined(LIBXML_VALID_ENABLED)
27202     int mem_base;
27203     int ret_val;
27204     xmlValidCtxtPtr ctxt; /* the validation context */
27205     int n_ctxt;
27206     xmlDocPtr doc; /* a document instance */
27207     int n_doc;
27208     xmlElementPtr elem; /* an element definition */
27209     int n_elem;
27210
27211     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27212     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27213     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
27214         mem_base = xmlMemBlocks();
27215         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27216         doc = gen_xmlDocPtr(n_doc, 1);
27217         elem = gen_xmlElementPtr(n_elem, 2);
27218
27219         ret_val = xmlValidateElementDecl(ctxt, doc, elem);
27220         desret_int(ret_val);
27221         call_tests++;
27222         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27223         des_xmlDocPtr(n_doc, doc, 1);
27224         des_xmlElementPtr(n_elem, elem, 2);
27225         xmlResetLastError();
27226         if (mem_base != xmlMemBlocks()) {
27227             printf("Leak of %d blocks found in xmlValidateElementDecl",
27228                    xmlMemBlocks() - mem_base);
27229             test_ret++;
27230             printf(" %d", n_ctxt);
27231             printf(" %d", n_doc);
27232             printf(" %d", n_elem);
27233             printf("\n");
27234         }
27235     }
27236     }
27237     }
27238     function_tests++;
27239 #endif
27240
27241     return(test_ret);
27242 }
27243
27244
27245 static int
27246 test_xmlValidateNameValue(void) {
27247     int test_ret = 0;
27248
27249 #if defined(LIBXML_VALID_ENABLED)
27250     int mem_base;
27251     int ret_val;
27252     xmlChar * value; /* an Name value */
27253     int n_value;
27254
27255     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27256         mem_base = xmlMemBlocks();
27257         value = gen_const_xmlChar_ptr(n_value, 0);
27258
27259         ret_val = xmlValidateNameValue((const xmlChar *)value);
27260         desret_int(ret_val);
27261         call_tests++;
27262         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
27263         xmlResetLastError();
27264         if (mem_base != xmlMemBlocks()) {
27265             printf("Leak of %d blocks found in xmlValidateNameValue",
27266                    xmlMemBlocks() - mem_base);
27267             test_ret++;
27268             printf(" %d", n_value);
27269             printf("\n");
27270         }
27271     }
27272     function_tests++;
27273 #endif
27274
27275     return(test_ret);
27276 }
27277
27278
27279 static int
27280 test_xmlValidateNamesValue(void) {
27281     int test_ret = 0;
27282
27283 #if defined(LIBXML_VALID_ENABLED)
27284     int mem_base;
27285     int ret_val;
27286     xmlChar * value; /* an Names value */
27287     int n_value;
27288
27289     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27290         mem_base = xmlMemBlocks();
27291         value = gen_const_xmlChar_ptr(n_value, 0);
27292
27293         ret_val = xmlValidateNamesValue((const xmlChar *)value);
27294         desret_int(ret_val);
27295         call_tests++;
27296         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
27297         xmlResetLastError();
27298         if (mem_base != xmlMemBlocks()) {
27299             printf("Leak of %d blocks found in xmlValidateNamesValue",
27300                    xmlMemBlocks() - mem_base);
27301             test_ret++;
27302             printf(" %d", n_value);
27303             printf("\n");
27304         }
27305     }
27306     function_tests++;
27307 #endif
27308
27309     return(test_ret);
27310 }
27311
27312
27313 static int
27314 test_xmlValidateNmtokenValue(void) {
27315     int test_ret = 0;
27316
27317 #if defined(LIBXML_VALID_ENABLED)
27318     int mem_base;
27319     int ret_val;
27320     xmlChar * value; /* an Nmtoken value */
27321     int n_value;
27322
27323     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27324         mem_base = xmlMemBlocks();
27325         value = gen_const_xmlChar_ptr(n_value, 0);
27326
27327         ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
27328         desret_int(ret_val);
27329         call_tests++;
27330         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
27331         xmlResetLastError();
27332         if (mem_base != xmlMemBlocks()) {
27333             printf("Leak of %d blocks found in xmlValidateNmtokenValue",
27334                    xmlMemBlocks() - mem_base);
27335             test_ret++;
27336             printf(" %d", n_value);
27337             printf("\n");
27338         }
27339     }
27340     function_tests++;
27341 #endif
27342
27343     return(test_ret);
27344 }
27345
27346
27347 static int
27348 test_xmlValidateNmtokensValue(void) {
27349     int test_ret = 0;
27350
27351 #if defined(LIBXML_VALID_ENABLED)
27352     int mem_base;
27353     int ret_val;
27354     xmlChar * value; /* an Nmtokens value */
27355     int n_value;
27356
27357     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27358         mem_base = xmlMemBlocks();
27359         value = gen_const_xmlChar_ptr(n_value, 0);
27360
27361         ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
27362         desret_int(ret_val);
27363         call_tests++;
27364         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
27365         xmlResetLastError();
27366         if (mem_base != xmlMemBlocks()) {
27367             printf("Leak of %d blocks found in xmlValidateNmtokensValue",
27368                    xmlMemBlocks() - mem_base);
27369             test_ret++;
27370             printf(" %d", n_value);
27371             printf("\n");
27372         }
27373     }
27374     function_tests++;
27375 #endif
27376
27377     return(test_ret);
27378 }
27379
27380
27381 static int
27382 test_xmlValidateNotationDecl(void) {
27383     int test_ret = 0;
27384
27385 #if defined(LIBXML_VALID_ENABLED)
27386     int mem_base;
27387     int ret_val;
27388     xmlValidCtxtPtr ctxt; /* the validation context */
27389     int n_ctxt;
27390     xmlDocPtr doc; /* a document instance */
27391     int n_doc;
27392     xmlNotationPtr nota; /* a notation definition */
27393     int n_nota;
27394
27395     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27396     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27397     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
27398         mem_base = xmlMemBlocks();
27399         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27400         doc = gen_xmlDocPtr(n_doc, 1);
27401         nota = gen_xmlNotationPtr(n_nota, 2);
27402
27403         ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
27404         desret_int(ret_val);
27405         call_tests++;
27406         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27407         des_xmlDocPtr(n_doc, doc, 1);
27408         des_xmlNotationPtr(n_nota, nota, 2);
27409         xmlResetLastError();
27410         if (mem_base != xmlMemBlocks()) {
27411             printf("Leak of %d blocks found in xmlValidateNotationDecl",
27412                    xmlMemBlocks() - mem_base);
27413             test_ret++;
27414             printf(" %d", n_ctxt);
27415             printf(" %d", n_doc);
27416             printf(" %d", n_nota);
27417             printf("\n");
27418         }
27419     }
27420     }
27421     }
27422     function_tests++;
27423 #endif
27424
27425     return(test_ret);
27426 }
27427
27428
27429 static int
27430 test_xmlValidateNotationUse(void) {
27431     int test_ret = 0;
27432
27433 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
27434     int mem_base;
27435     int ret_val;
27436     xmlValidCtxtPtr ctxt; /* the validation context */
27437     int n_ctxt;
27438     xmlDocPtr doc; /* the document */
27439     int n_doc;
27440     xmlChar * notationName; /* the notation name to check */
27441     int n_notationName;
27442
27443     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27444     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27445     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
27446         mem_base = xmlMemBlocks();
27447         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27448         doc = gen_xmlDocPtr(n_doc, 1);
27449         notationName = gen_const_xmlChar_ptr(n_notationName, 2);
27450
27451         ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
27452         desret_int(ret_val);
27453         call_tests++;
27454         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27455         des_xmlDocPtr(n_doc, doc, 1);
27456         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
27457         xmlResetLastError();
27458         if (mem_base != xmlMemBlocks()) {
27459             printf("Leak of %d blocks found in xmlValidateNotationUse",
27460                    xmlMemBlocks() - mem_base);
27461             test_ret++;
27462             printf(" %d", n_ctxt);
27463             printf(" %d", n_doc);
27464             printf(" %d", n_notationName);
27465             printf("\n");
27466         }
27467     }
27468     }
27469     }
27470     function_tests++;
27471 #endif
27472
27473     return(test_ret);
27474 }
27475
27476
27477 static int
27478 test_xmlValidateOneAttribute(void) {
27479     int test_ret = 0;
27480
27481 #if defined(LIBXML_VALID_ENABLED)
27482     int mem_base;
27483     int ret_val;
27484     xmlValidCtxtPtr ctxt; /* the validation context */
27485     int n_ctxt;
27486     xmlDocPtr doc; /* a document instance */
27487     int n_doc;
27488     xmlNodePtr elem; /* an element instance */
27489     int n_elem;
27490     xmlAttrPtr attr; /* an attribute instance */
27491     int n_attr;
27492     xmlChar * value; /* the attribute value (without entities processing) */
27493     int n_value;
27494
27495     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27496     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27497     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27498     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
27499     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27500         mem_base = xmlMemBlocks();
27501         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27502         doc = gen_xmlDocPtr(n_doc, 1);
27503         elem = gen_xmlNodePtr(n_elem, 2);
27504         attr = gen_xmlAttrPtr(n_attr, 3);
27505         value = gen_const_xmlChar_ptr(n_value, 4);
27506
27507         ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
27508         desret_int(ret_val);
27509         call_tests++;
27510         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27511         des_xmlDocPtr(n_doc, doc, 1);
27512         des_xmlNodePtr(n_elem, elem, 2);
27513         des_xmlAttrPtr(n_attr, attr, 3);
27514         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
27515         xmlResetLastError();
27516         if (mem_base != xmlMemBlocks()) {
27517             printf("Leak of %d blocks found in xmlValidateOneAttribute",
27518                    xmlMemBlocks() - mem_base);
27519             test_ret++;
27520             printf(" %d", n_ctxt);
27521             printf(" %d", n_doc);
27522             printf(" %d", n_elem);
27523             printf(" %d", n_attr);
27524             printf(" %d", n_value);
27525             printf("\n");
27526         }
27527     }
27528     }
27529     }
27530     }
27531     }
27532     function_tests++;
27533 #endif
27534
27535     return(test_ret);
27536 }
27537
27538
27539 static int
27540 test_xmlValidateOneElement(void) {
27541     int test_ret = 0;
27542
27543 #if defined(LIBXML_VALID_ENABLED)
27544     int mem_base;
27545     int ret_val;
27546     xmlValidCtxtPtr ctxt; /* the validation context */
27547     int n_ctxt;
27548     xmlDocPtr doc; /* a document instance */
27549     int n_doc;
27550     xmlNodePtr elem; /* an element instance */
27551     int n_elem;
27552
27553     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27554     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27555     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27556         mem_base = xmlMemBlocks();
27557         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27558         doc = gen_xmlDocPtr(n_doc, 1);
27559         elem = gen_xmlNodePtr(n_elem, 2);
27560
27561         ret_val = xmlValidateOneElement(ctxt, doc, elem);
27562         desret_int(ret_val);
27563         call_tests++;
27564         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27565         des_xmlDocPtr(n_doc, doc, 1);
27566         des_xmlNodePtr(n_elem, elem, 2);
27567         xmlResetLastError();
27568         if (mem_base != xmlMemBlocks()) {
27569             printf("Leak of %d blocks found in xmlValidateOneElement",
27570                    xmlMemBlocks() - mem_base);
27571             test_ret++;
27572             printf(" %d", n_ctxt);
27573             printf(" %d", n_doc);
27574             printf(" %d", n_elem);
27575             printf("\n");
27576         }
27577     }
27578     }
27579     }
27580     function_tests++;
27581 #endif
27582
27583     return(test_ret);
27584 }
27585
27586
27587 static int
27588 test_xmlValidateOneNamespace(void) {
27589     int test_ret = 0;
27590
27591 #if defined(LIBXML_VALID_ENABLED)
27592     int mem_base;
27593     int ret_val;
27594     xmlValidCtxtPtr ctxt; /* the validation context */
27595     int n_ctxt;
27596     xmlDocPtr doc; /* a document instance */
27597     int n_doc;
27598     xmlNodePtr elem; /* an element instance */
27599     int n_elem;
27600     xmlChar * prefix; /* the namespace prefix */
27601     int n_prefix;
27602     xmlNsPtr ns; /* an namespace declaration instance */
27603     int n_ns;
27604     xmlChar * value; /* the attribute value (without entities processing) */
27605     int n_value;
27606
27607     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27608     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27609     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27610     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
27611     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
27612     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27613         mem_base = xmlMemBlocks();
27614         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27615         doc = gen_xmlDocPtr(n_doc, 1);
27616         elem = gen_xmlNodePtr(n_elem, 2);
27617         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
27618         ns = gen_xmlNsPtr(n_ns, 4);
27619         value = gen_const_xmlChar_ptr(n_value, 5);
27620
27621         ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
27622         desret_int(ret_val);
27623         call_tests++;
27624         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27625         des_xmlDocPtr(n_doc, doc, 1);
27626         des_xmlNodePtr(n_elem, elem, 2);
27627         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
27628         des_xmlNsPtr(n_ns, ns, 4);
27629         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
27630         xmlResetLastError();
27631         if (mem_base != xmlMemBlocks()) {
27632             printf("Leak of %d blocks found in xmlValidateOneNamespace",
27633                    xmlMemBlocks() - mem_base);
27634             test_ret++;
27635             printf(" %d", n_ctxt);
27636             printf(" %d", n_doc);
27637             printf(" %d", n_elem);
27638             printf(" %d", n_prefix);
27639             printf(" %d", n_ns);
27640             printf(" %d", n_value);
27641             printf("\n");
27642         }
27643     }
27644     }
27645     }
27646     }
27647     }
27648     }
27649     function_tests++;
27650 #endif
27651
27652     return(test_ret);
27653 }
27654
27655
27656 static int
27657 test_xmlValidatePopElement(void) {
27658     int test_ret = 0;
27659
27660 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27661     int mem_base;
27662     int ret_val;
27663     xmlValidCtxtPtr ctxt; /* the validation context */
27664     int n_ctxt;
27665     xmlDocPtr doc; /* a document instance */
27666     int n_doc;
27667     xmlNodePtr elem; /* an element instance */
27668     int n_elem;
27669     xmlChar * qname; /* the qualified name as appearing in the serialization */
27670     int n_qname;
27671
27672     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27673     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27674     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27675     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27676         mem_base = xmlMemBlocks();
27677         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27678         doc = gen_xmlDocPtr(n_doc, 1);
27679         elem = gen_xmlNodePtr(n_elem, 2);
27680         qname = gen_const_xmlChar_ptr(n_qname, 3);
27681
27682         ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
27683         desret_int(ret_val);
27684         call_tests++;
27685         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27686         des_xmlDocPtr(n_doc, doc, 1);
27687         des_xmlNodePtr(n_elem, elem, 2);
27688         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27689         xmlResetLastError();
27690         if (mem_base != xmlMemBlocks()) {
27691             printf("Leak of %d blocks found in xmlValidatePopElement",
27692                    xmlMemBlocks() - mem_base);
27693             test_ret++;
27694             printf(" %d", n_ctxt);
27695             printf(" %d", n_doc);
27696             printf(" %d", n_elem);
27697             printf(" %d", n_qname);
27698             printf("\n");
27699         }
27700     }
27701     }
27702     }
27703     }
27704     function_tests++;
27705 #endif
27706
27707     return(test_ret);
27708 }
27709
27710
27711 static int
27712 test_xmlValidatePushCData(void) {
27713     int test_ret = 0;
27714
27715 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27716     int mem_base;
27717     int ret_val;
27718     xmlValidCtxtPtr ctxt; /* the validation context */
27719     int n_ctxt;
27720     xmlChar * data; /* some character data read */
27721     int n_data;
27722     int len; /* the length of the data */
27723     int n_len;
27724
27725     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27726     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
27727     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27728         mem_base = xmlMemBlocks();
27729         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27730         data = gen_const_xmlChar_ptr(n_data, 1);
27731         len = gen_int(n_len, 2);
27732
27733         ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
27734         desret_int(ret_val);
27735         call_tests++;
27736         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27737         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
27738         des_int(n_len, len, 2);
27739         xmlResetLastError();
27740         if (mem_base != xmlMemBlocks()) {
27741             printf("Leak of %d blocks found in xmlValidatePushCData",
27742                    xmlMemBlocks() - mem_base);
27743             test_ret++;
27744             printf(" %d", n_ctxt);
27745             printf(" %d", n_data);
27746             printf(" %d", n_len);
27747             printf("\n");
27748         }
27749     }
27750     }
27751     }
27752     function_tests++;
27753 #endif
27754
27755     return(test_ret);
27756 }
27757
27758
27759 static int
27760 test_xmlValidatePushElement(void) {
27761     int test_ret = 0;
27762
27763 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27764     int mem_base;
27765     int ret_val;
27766     xmlValidCtxtPtr ctxt; /* the validation context */
27767     int n_ctxt;
27768     xmlDocPtr doc; /* a document instance */
27769     int n_doc;
27770     xmlNodePtr elem; /* an element instance */
27771     int n_elem;
27772     xmlChar * qname; /* the qualified name as appearing in the serialization */
27773     int n_qname;
27774
27775     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27776     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27777     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27778     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27779         mem_base = xmlMemBlocks();
27780         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27781         doc = gen_xmlDocPtr(n_doc, 1);
27782         elem = gen_xmlNodePtr(n_elem, 2);
27783         qname = gen_const_xmlChar_ptr(n_qname, 3);
27784
27785         ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
27786         desret_int(ret_val);
27787         call_tests++;
27788         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27789         des_xmlDocPtr(n_doc, doc, 1);
27790         des_xmlNodePtr(n_elem, elem, 2);
27791         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27792         xmlResetLastError();
27793         if (mem_base != xmlMemBlocks()) {
27794             printf("Leak of %d blocks found in xmlValidatePushElement",
27795                    xmlMemBlocks() - mem_base);
27796             test_ret++;
27797             printf(" %d", n_ctxt);
27798             printf(" %d", n_doc);
27799             printf(" %d", n_elem);
27800             printf(" %d", n_qname);
27801             printf("\n");
27802         }
27803     }
27804     }
27805     }
27806     }
27807     function_tests++;
27808 #endif
27809
27810     return(test_ret);
27811 }
27812
27813
27814 static int
27815 test_xmlValidateRoot(void) {
27816     int test_ret = 0;
27817
27818 #if defined(LIBXML_VALID_ENABLED)
27819     int mem_base;
27820     int ret_val;
27821     xmlValidCtxtPtr ctxt; /* the validation context */
27822     int n_ctxt;
27823     xmlDocPtr doc; /* a document instance */
27824     int n_doc;
27825
27826     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27827     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27828         mem_base = xmlMemBlocks();
27829         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27830         doc = gen_xmlDocPtr(n_doc, 1);
27831
27832         ret_val = xmlValidateRoot(ctxt, doc);
27833         desret_int(ret_val);
27834         call_tests++;
27835         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27836         des_xmlDocPtr(n_doc, doc, 1);
27837         xmlResetLastError();
27838         if (mem_base != xmlMemBlocks()) {
27839             printf("Leak of %d blocks found in xmlValidateRoot",
27840                    xmlMemBlocks() - mem_base);
27841             test_ret++;
27842             printf(" %d", n_ctxt);
27843             printf(" %d", n_doc);
27844             printf("\n");
27845         }
27846     }
27847     }
27848     function_tests++;
27849 #endif
27850
27851     return(test_ret);
27852 }
27853
27854 static int
27855 test_valid(void) {
27856     int test_ret = 0;
27857         int rc = 0;
27858
27859     if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27860     rc = test_xmlAddAttributeDecl();
27861         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27862     rc = test_xmlAddElementDecl();
27863         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27864     rc = test_xmlAddID();
27865         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27866     rc = test_xmlAddNotationDecl();
27867         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27868     rc = test_xmlAddRef();
27869         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27870     rc = test_xmlCopyAttributeTable();
27871         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27872     rc = test_xmlCopyDocElementContent();
27873         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27874     rc = test_xmlCopyElementContent();
27875         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27876     rc = test_xmlCopyElementTable();
27877         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27878     rc = test_xmlCopyEnumeration();
27879         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27880     rc = test_xmlCopyNotationTable();
27881         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27882     rc = test_xmlCreateEnumeration();
27883         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27884     rc = test_xmlDumpAttributeDecl();
27885         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27886     rc = test_xmlDumpAttributeTable();
27887         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27888     rc = test_xmlDumpElementDecl();
27889         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27890     rc = test_xmlDumpElementTable();
27891         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27892     rc = test_xmlDumpNotationDecl();
27893         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27894     rc = test_xmlDumpNotationTable();
27895         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27896     rc = test_xmlGetDtdAttrDesc();
27897         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27898     rc = test_xmlGetDtdElementDesc();
27899         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27900     rc = test_xmlGetDtdNotationDesc();
27901         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27902     rc = test_xmlGetDtdQAttrDesc();
27903         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27904     rc = test_xmlGetDtdQElementDesc();
27905         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27906     rc = test_xmlGetID();
27907         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27908     rc = test_xmlGetRefs();
27909         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27910     rc = test_xmlIsID();
27911         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27912     rc = test_xmlIsMixedElement();
27913         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27914     rc = test_xmlIsRef();
27915         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27916     rc = test_xmlNewDocElementContent();
27917         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27918     rc = test_xmlNewElementContent();
27919         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27920     rc = test_xmlNewValidCtxt();
27921         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27922     rc = test_xmlRemoveID();
27923         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27924     rc = test_xmlRemoveRef();
27925         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27926     rc = test_xmlSnprintfElementContent();
27927         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27928     rc = test_xmlSprintfElementContent();
27929         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27930     rc = test_xmlValidBuildContentModel();
27931         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27932     rc = test_xmlValidCtxtNormalizeAttributeValue();
27933         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27934     rc = test_xmlValidGetPotentialChildren();
27935         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27936     rc = test_xmlValidGetValidElements();
27937         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27938     rc = test_xmlValidNormalizeAttributeValue();
27939         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27940     rc = test_xmlValidateAttributeDecl();
27941         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27942     rc = test_xmlValidateAttributeValue();
27943         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27944     rc = test_xmlValidateDocument();
27945         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27946     rc = test_xmlValidateDocumentFinal();
27947         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27948     rc = test_xmlValidateDtd();
27949         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27950     rc = test_xmlValidateDtdFinal();
27951         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27952     rc = test_xmlValidateElement();
27953         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27954     rc = test_xmlValidateElementDecl();
27955         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27956     rc = test_xmlValidateNameValue();
27957         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27958     rc = test_xmlValidateNamesValue();
27959         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27960     rc = test_xmlValidateNmtokenValue();
27961         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27962     rc = test_xmlValidateNmtokensValue();
27963         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27964     rc = test_xmlValidateNotationDecl();
27965         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27966     rc = test_xmlValidateNotationUse();
27967         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27968     rc = test_xmlValidateOneAttribute();
27969         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27970     rc = test_xmlValidateOneElement();
27971         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27972     rc = test_xmlValidateOneNamespace();
27973         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27974     rc = test_xmlValidatePopElement();
27975         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27976     rc = test_xmlValidatePushCData();
27977         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27978     rc = test_xmlValidatePushElement();
27979         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27980     rc = test_xmlValidateRoot();
27981         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27982
27983     if (test_ret != 0)
27984         printf("Module valid: %d errors\n", test_ret);
27985     return(test_ret);
27986 }
27987
27988 static int
27989 test_xmlXIncludeNewContext(void) {
27990     int test_ret = 0;
27991
27992
27993     /* missing type support */
27994     return(test_ret);
27995 }
27996
27997
27998 static int
27999 test_xmlXIncludeProcess(void) {
28000     int test_ret = 0;
28001
28002 #if defined(LIBXML_XINCLUDE_ENABLED)
28003     int mem_base;
28004     int ret_val;
28005     xmlDocPtr doc; /* an XML document */
28006     int n_doc;
28007
28008     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28009         mem_base = xmlMemBlocks();
28010         doc = gen_xmlDocPtr(n_doc, 0);
28011
28012         ret_val = xmlXIncludeProcess(doc);
28013         desret_int(ret_val);
28014         call_tests++;
28015         des_xmlDocPtr(n_doc, doc, 0);
28016         xmlResetLastError();
28017         if (mem_base != xmlMemBlocks()) {
28018             printf("Leak of %d blocks found in xmlXIncludeProcess",
28019                    xmlMemBlocks() - mem_base);
28020             test_ret++;
28021             printf(" %d", n_doc);
28022             printf("\n");
28023         }
28024     }
28025     function_tests++;
28026 #endif
28027
28028     return(test_ret);
28029 }
28030
28031
28032 static int
28033 test_xmlXIncludeProcessFlags(void) {
28034     int test_ret = 0;
28035
28036 #if defined(LIBXML_XINCLUDE_ENABLED)
28037     int mem_base;
28038     int ret_val;
28039     xmlDocPtr doc; /* an XML document */
28040     int n_doc;
28041     int flags; /* a set of xmlParserOption used for parsing XML includes */
28042     int n_flags;
28043
28044     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28045     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28046         mem_base = xmlMemBlocks();
28047         doc = gen_xmlDocPtr(n_doc, 0);
28048         flags = gen_int(n_flags, 1);
28049
28050         ret_val = xmlXIncludeProcessFlags(doc, flags);
28051         desret_int(ret_val);
28052         call_tests++;
28053         des_xmlDocPtr(n_doc, doc, 0);
28054         des_int(n_flags, flags, 1);
28055         xmlResetLastError();
28056         if (mem_base != xmlMemBlocks()) {
28057             printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
28058                    xmlMemBlocks() - mem_base);
28059             test_ret++;
28060             printf(" %d", n_doc);
28061             printf(" %d", n_flags);
28062             printf("\n");
28063         }
28064     }
28065     }
28066     function_tests++;
28067 #endif
28068
28069     return(test_ret);
28070 }
28071
28072
28073 static int
28074 test_xmlXIncludeProcessFlagsData(void) {
28075     int test_ret = 0;
28076
28077 #if defined(LIBXML_XINCLUDE_ENABLED)
28078     int mem_base;
28079     int ret_val;
28080     xmlDocPtr doc; /* an XML document */
28081     int n_doc;
28082     int flags; /* a set of xmlParserOption used for parsing XML includes */
28083     int n_flags;
28084     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
28085     int n_data;
28086
28087     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28088     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28089     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
28090         mem_base = xmlMemBlocks();
28091         doc = gen_xmlDocPtr(n_doc, 0);
28092         flags = gen_int(n_flags, 1);
28093         data = gen_userdata(n_data, 2);
28094
28095         ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
28096         desret_int(ret_val);
28097         call_tests++;
28098         des_xmlDocPtr(n_doc, doc, 0);
28099         des_int(n_flags, flags, 1);
28100         des_userdata(n_data, data, 2);
28101         xmlResetLastError();
28102         if (mem_base != xmlMemBlocks()) {
28103             printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
28104                    xmlMemBlocks() - mem_base);
28105             test_ret++;
28106             printf(" %d", n_doc);
28107             printf(" %d", n_flags);
28108             printf(" %d", n_data);
28109             printf("\n");
28110         }
28111     }
28112     }
28113     }
28114     function_tests++;
28115 #endif
28116
28117     return(test_ret);
28118 }
28119
28120 #ifdef LIBXML_XINCLUDE_ENABLED
28121
28122 #define gen_nb_xmlXIncludeCtxtPtr 1
28123 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28124     return(NULL);
28125 }
28126 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28127 }
28128 #endif
28129
28130
28131 static int
28132 test_xmlXIncludeProcessNode(void) {
28133     int test_ret = 0;
28134
28135 #if defined(LIBXML_XINCLUDE_ENABLED)
28136     int mem_base;
28137     int ret_val;
28138     xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
28139     int n_ctxt;
28140     xmlNodePtr node; /* a node in an XML document */
28141     int n_node;
28142
28143     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
28144     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
28145         mem_base = xmlMemBlocks();
28146         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
28147         node = gen_xmlNodePtr(n_node, 1);
28148
28149         ret_val = xmlXIncludeProcessNode(ctxt, node);
28150         desret_int(ret_val);
28151         call_tests++;
28152         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
28153         des_xmlNodePtr(n_node, node, 1);
28154         xmlResetLastError();
28155         if (mem_base != xmlMemBlocks()) {
28156             printf("Leak of %d blocks found in xmlXIncludeProcessNode",
28157                    xmlMemBlocks() - mem_base);
28158             test_ret++;
28159             printf(" %d", n_ctxt);
28160             printf(" %d", n_node);
28161             printf("\n");
28162         }
28163     }
28164     }
28165     function_tests++;
28166 #endif
28167
28168     return(test_ret);
28169 }
28170
28171
28172 static int
28173 test_xmlXIncludeProcessTree(void) {
28174     int test_ret = 0;
28175
28176 #if defined(LIBXML_XINCLUDE_ENABLED)
28177     int mem_base;
28178     int ret_val;
28179     xmlNodePtr tree; /* a node in an XML document */
28180     int n_tree;
28181
28182     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
28183         mem_base = xmlMemBlocks();
28184         tree = gen_xmlNodePtr(n_tree, 0);
28185
28186         ret_val = xmlXIncludeProcessTree(tree);
28187         desret_int(ret_val);
28188         call_tests++;
28189         des_xmlNodePtr(n_tree, tree, 0);
28190         xmlResetLastError();
28191         if (mem_base != xmlMemBlocks()) {
28192             printf("Leak of %d blocks found in xmlXIncludeProcessTree",
28193                    xmlMemBlocks() - mem_base);
28194             test_ret++;
28195             printf(" %d", n_tree);
28196             printf("\n");
28197         }
28198     }
28199     function_tests++;
28200 #endif
28201
28202     return(test_ret);
28203 }
28204
28205
28206 static int
28207 test_xmlXIncludeProcessTreeFlags(void) {
28208     int test_ret = 0;
28209
28210 #if defined(LIBXML_XINCLUDE_ENABLED)
28211     int mem_base;
28212     int ret_val;
28213     xmlNodePtr tree; /* a node in an XML document */
28214     int n_tree;
28215     int flags; /* a set of xmlParserOption used for parsing XML includes */
28216     int n_flags;
28217
28218     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
28219     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28220         mem_base = xmlMemBlocks();
28221         tree = gen_xmlNodePtr(n_tree, 0);
28222         flags = gen_int(n_flags, 1);
28223
28224         ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
28225         desret_int(ret_val);
28226         call_tests++;
28227         des_xmlNodePtr(n_tree, tree, 0);
28228         des_int(n_flags, flags, 1);
28229         xmlResetLastError();
28230         if (mem_base != xmlMemBlocks()) {
28231             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
28232                    xmlMemBlocks() - mem_base);
28233             test_ret++;
28234             printf(" %d", n_tree);
28235             printf(" %d", n_flags);
28236             printf("\n");
28237         }
28238     }
28239     }
28240     function_tests++;
28241 #endif
28242
28243     return(test_ret);
28244 }
28245
28246
28247 static int
28248 test_xmlXIncludeProcessTreeFlagsData(void) {
28249     int test_ret = 0;
28250
28251 #if defined(LIBXML_XINCLUDE_ENABLED)
28252     int mem_base;
28253     int ret_val;
28254     xmlNodePtr tree; /* an XML node */
28255     int n_tree;
28256     int flags; /* a set of xmlParserOption used for parsing XML includes */
28257     int n_flags;
28258     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
28259     int n_data;
28260
28261     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
28262     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28263     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
28264         mem_base = xmlMemBlocks();
28265         tree = gen_xmlNodePtr(n_tree, 0);
28266         flags = gen_int(n_flags, 1);
28267         data = gen_userdata(n_data, 2);
28268
28269         ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
28270         desret_int(ret_val);
28271         call_tests++;
28272         des_xmlNodePtr(n_tree, tree, 0);
28273         des_int(n_flags, flags, 1);
28274         des_userdata(n_data, data, 2);
28275         xmlResetLastError();
28276         if (mem_base != xmlMemBlocks()) {
28277             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
28278                    xmlMemBlocks() - mem_base);
28279             test_ret++;
28280             printf(" %d", n_tree);
28281             printf(" %d", n_flags);
28282             printf(" %d", n_data);
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_xmlXIncludeSetFlags(void) {
28297     int test_ret = 0;
28298
28299 #if defined(LIBXML_XINCLUDE_ENABLED)
28300     int mem_base;
28301     int ret_val;
28302     xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
28303     int n_ctxt;
28304     int flags; /* a set of xmlParserOption used for parsing XML includes */
28305     int n_flags;
28306
28307     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
28308     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28309         mem_base = xmlMemBlocks();
28310         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
28311         flags = gen_int(n_flags, 1);
28312
28313         ret_val = xmlXIncludeSetFlags(ctxt, flags);
28314         desret_int(ret_val);
28315         call_tests++;
28316         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
28317         des_int(n_flags, flags, 1);
28318         xmlResetLastError();
28319         if (mem_base != xmlMemBlocks()) {
28320             printf("Leak of %d blocks found in xmlXIncludeSetFlags",
28321                    xmlMemBlocks() - mem_base);
28322             test_ret++;
28323             printf(" %d", n_ctxt);
28324             printf(" %d", n_flags);
28325             printf("\n");
28326         }
28327     }
28328     }
28329     function_tests++;
28330 #endif
28331
28332     return(test_ret);
28333 }
28334
28335 static int
28336 test_xinclude(void) {
28337     int test_ret = 0;
28338         int rc = 0;
28339
28340     if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
28341     rc = test_xmlXIncludeNewContext();
28342         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28343     rc = test_xmlXIncludeProcess();
28344         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28345     rc = test_xmlXIncludeProcessFlags();
28346         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28347     rc = test_xmlXIncludeProcessFlagsData();
28348         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28349     rc = test_xmlXIncludeProcessNode();
28350         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28351     rc = test_xmlXIncludeProcessTree();
28352         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28353     rc = test_xmlXIncludeProcessTreeFlags();
28354         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28355     rc = test_xmlXIncludeProcessTreeFlagsData();
28356         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28357     rc = test_xmlXIncludeSetFlags();
28358         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28359
28360     if (test_ret != 0)
28361         printf("Module xinclude: %d errors\n", test_ret);
28362     return(test_ret);
28363 }
28364
28365 static int
28366 test_xmlAllocOutputBuffer(void) {
28367     int test_ret = 0;
28368
28369 #if defined(LIBXML_OUTPUT_ENABLED)
28370     int mem_base;
28371     xmlOutputBufferPtr ret_val;
28372     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28373     int n_encoder;
28374
28375     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28376         mem_base = xmlMemBlocks();
28377         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
28378
28379         ret_val = xmlAllocOutputBuffer(encoder);
28380         desret_xmlOutputBufferPtr(ret_val);
28381         call_tests++;
28382         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
28383         xmlResetLastError();
28384         if (mem_base != xmlMemBlocks()) {
28385             printf("Leak of %d blocks found in xmlAllocOutputBuffer",
28386                    xmlMemBlocks() - mem_base);
28387             test_ret++;
28388             printf(" %d", n_encoder);
28389             printf("\n");
28390         }
28391     }
28392     function_tests++;
28393 #endif
28394
28395     return(test_ret);
28396 }
28397
28398
28399 static int
28400 test_xmlAllocParserInputBuffer(void) {
28401     int test_ret = 0;
28402
28403     int mem_base;
28404     xmlParserInputBufferPtr ret_val;
28405     xmlCharEncoding enc; /* the charset encoding if known */
28406     int n_enc;
28407
28408     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28409         mem_base = xmlMemBlocks();
28410         enc = gen_xmlCharEncoding(n_enc, 0);
28411
28412         ret_val = xmlAllocParserInputBuffer(enc);
28413         desret_xmlParserInputBufferPtr(ret_val);
28414         call_tests++;
28415         des_xmlCharEncoding(n_enc, enc, 0);
28416         xmlResetLastError();
28417         if (mem_base != xmlMemBlocks()) {
28418             printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
28419                    xmlMemBlocks() - mem_base);
28420             test_ret++;
28421             printf(" %d", n_enc);
28422             printf("\n");
28423         }
28424     }
28425     function_tests++;
28426
28427     return(test_ret);
28428 }
28429
28430
28431 static int
28432 test_xmlCheckFilename(void) {
28433     int test_ret = 0;
28434
28435     int mem_base;
28436     int ret_val;
28437     char * path; /* the path to check */
28438     int n_path;
28439
28440     for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
28441         mem_base = xmlMemBlocks();
28442         path = gen_const_char_ptr(n_path, 0);
28443
28444         ret_val = xmlCheckFilename((const char *)path);
28445         desret_int(ret_val);
28446         call_tests++;
28447         des_const_char_ptr(n_path, (const char *)path, 0);
28448         xmlResetLastError();
28449         if (mem_base != xmlMemBlocks()) {
28450             printf("Leak of %d blocks found in xmlCheckFilename",
28451                    xmlMemBlocks() - mem_base);
28452             test_ret++;
28453             printf(" %d", n_path);
28454             printf("\n");
28455         }
28456     }
28457     function_tests++;
28458
28459     return(test_ret);
28460 }
28461
28462
28463 static int
28464 test_xmlCheckHTTPInput(void) {
28465     int test_ret = 0;
28466
28467     int mem_base;
28468     xmlParserInputPtr ret_val;
28469     xmlParserCtxtPtr ctxt; /* an XML parser context */
28470     int n_ctxt;
28471     xmlParserInputPtr ret; /* an XML parser input */
28472     int n_ret;
28473
28474     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28475     for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
28476         mem_base = xmlMemBlocks();
28477         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
28478         ret = gen_xmlParserInputPtr(n_ret, 1);
28479
28480         ret_val = xmlCheckHTTPInput(ctxt, ret);
28481         desret_xmlParserInputPtr(ret_val);
28482         call_tests++;
28483         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
28484         des_xmlParserInputPtr(n_ret, ret, 1);
28485         xmlResetLastError();
28486         if (mem_base != xmlMemBlocks()) {
28487             printf("Leak of %d blocks found in xmlCheckHTTPInput",
28488                    xmlMemBlocks() - mem_base);
28489             test_ret++;
28490             printf(" %d", n_ctxt);
28491             printf(" %d", n_ret);
28492             printf("\n");
28493         }
28494     }
28495     }
28496     function_tests++;
28497
28498     return(test_ret);
28499 }
28500
28501
28502 static int
28503 test_xmlCleanupInputCallbacks(void) {
28504     int test_ret = 0;
28505
28506     int mem_base;
28507
28508         mem_base = xmlMemBlocks();
28509
28510         xmlCleanupInputCallbacks();
28511         call_tests++;
28512         xmlResetLastError();
28513         if (mem_base != xmlMemBlocks()) {
28514             printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
28515                    xmlMemBlocks() - mem_base);
28516             test_ret++;
28517             printf("\n");
28518         }
28519     function_tests++;
28520
28521     return(test_ret);
28522 }
28523
28524
28525 static int
28526 test_xmlCleanupOutputCallbacks(void) {
28527     int test_ret = 0;
28528
28529 #if defined(LIBXML_OUTPUT_ENABLED)
28530     int mem_base;
28531
28532         mem_base = xmlMemBlocks();
28533
28534         xmlCleanupOutputCallbacks();
28535         call_tests++;
28536         xmlResetLastError();
28537         if (mem_base != xmlMemBlocks()) {
28538             printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
28539                    xmlMemBlocks() - mem_base);
28540             test_ret++;
28541             printf("\n");
28542         }
28543     function_tests++;
28544 #endif
28545
28546     return(test_ret);
28547 }
28548
28549
28550 static int
28551 test_xmlFileClose(void) {
28552     int test_ret = 0;
28553
28554     int mem_base;
28555     int ret_val;
28556     void * context; /* the I/O context */
28557     int n_context;
28558
28559     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28560         mem_base = xmlMemBlocks();
28561         context = gen_void_ptr(n_context, 0);
28562
28563         ret_val = xmlFileClose(context);
28564         desret_int(ret_val);
28565         call_tests++;
28566         des_void_ptr(n_context, context, 0);
28567         xmlResetLastError();
28568         if (mem_base != xmlMemBlocks()) {
28569             printf("Leak of %d blocks found in xmlFileClose",
28570                    xmlMemBlocks() - mem_base);
28571             test_ret++;
28572             printf(" %d", n_context);
28573             printf("\n");
28574         }
28575     }
28576     function_tests++;
28577
28578     return(test_ret);
28579 }
28580
28581
28582 static int
28583 test_xmlFileMatch(void) {
28584     int test_ret = 0;
28585
28586     int mem_base;
28587     int ret_val;
28588     const char * filename; /* the URI for matching */
28589     int n_filename;
28590
28591     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28592         mem_base = xmlMemBlocks();
28593         filename = gen_filepath(n_filename, 0);
28594
28595         ret_val = xmlFileMatch(filename);
28596         desret_int(ret_val);
28597         call_tests++;
28598         des_filepath(n_filename, filename, 0);
28599         xmlResetLastError();
28600         if (mem_base != xmlMemBlocks()) {
28601             printf("Leak of %d blocks found in xmlFileMatch",
28602                    xmlMemBlocks() - mem_base);
28603             test_ret++;
28604             printf(" %d", n_filename);
28605             printf("\n");
28606         }
28607     }
28608     function_tests++;
28609
28610     return(test_ret);
28611 }
28612
28613
28614 static int
28615 test_xmlFileOpen(void) {
28616     int test_ret = 0;
28617
28618     int mem_base;
28619     void * ret_val;
28620     const char * filename; /* the URI for matching */
28621     int n_filename;
28622
28623     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28624         mem_base = xmlMemBlocks();
28625         filename = gen_filepath(n_filename, 0);
28626
28627         ret_val = xmlFileOpen(filename);
28628         desret_void_ptr(ret_val);
28629         call_tests++;
28630         des_filepath(n_filename, filename, 0);
28631         xmlResetLastError();
28632         if (mem_base != xmlMemBlocks()) {
28633             printf("Leak of %d blocks found in xmlFileOpen",
28634                    xmlMemBlocks() - mem_base);
28635             test_ret++;
28636             printf(" %d", n_filename);
28637             printf("\n");
28638         }
28639     }
28640     function_tests++;
28641
28642     return(test_ret);
28643 }
28644
28645
28646 static int
28647 test_xmlFileRead(void) {
28648     int test_ret = 0;
28649
28650     int mem_base;
28651     int ret_val;
28652     void * context; /* the I/O context */
28653     int n_context;
28654     char * buffer; /* where to drop data */
28655     int n_buffer;
28656     int len; /* number of bytes to write */
28657     int n_len;
28658
28659     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28660     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28661     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28662         mem_base = xmlMemBlocks();
28663         context = gen_void_ptr(n_context, 0);
28664         buffer = gen_char_ptr(n_buffer, 1);
28665         len = gen_int(n_len, 2);
28666
28667         ret_val = xmlFileRead(context, buffer, len);
28668         desret_int(ret_val);
28669         call_tests++;
28670         des_void_ptr(n_context, context, 0);
28671         des_char_ptr(n_buffer, buffer, 1);
28672         des_int(n_len, len, 2);
28673         xmlResetLastError();
28674         if (mem_base != xmlMemBlocks()) {
28675             printf("Leak of %d blocks found in xmlFileRead",
28676                    xmlMemBlocks() - mem_base);
28677             test_ret++;
28678             printf(" %d", n_context);
28679             printf(" %d", n_buffer);
28680             printf(" %d", n_len);
28681             printf("\n");
28682         }
28683     }
28684     }
28685     }
28686     function_tests++;
28687
28688     return(test_ret);
28689 }
28690
28691
28692 static int
28693 test_xmlIOFTPClose(void) {
28694     int test_ret = 0;
28695
28696 #if defined(LIBXML_FTP_ENABLED)
28697     int mem_base;
28698     int ret_val;
28699     void * context; /* the I/O context */
28700     int n_context;
28701
28702     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28703         mem_base = xmlMemBlocks();
28704         context = gen_void_ptr(n_context, 0);
28705
28706         ret_val = xmlIOFTPClose(context);
28707         desret_int(ret_val);
28708         call_tests++;
28709         des_void_ptr(n_context, context, 0);
28710         xmlResetLastError();
28711         if (mem_base != xmlMemBlocks()) {
28712             printf("Leak of %d blocks found in xmlIOFTPClose",
28713                    xmlMemBlocks() - mem_base);
28714             test_ret++;
28715             printf(" %d", n_context);
28716             printf("\n");
28717         }
28718     }
28719     function_tests++;
28720 #endif
28721
28722     return(test_ret);
28723 }
28724
28725
28726 static int
28727 test_xmlIOFTPMatch(void) {
28728     int test_ret = 0;
28729
28730 #if defined(LIBXML_FTP_ENABLED)
28731     int mem_base;
28732     int ret_val;
28733     const char * filename; /* the URI for matching */
28734     int n_filename;
28735
28736     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28737         mem_base = xmlMemBlocks();
28738         filename = gen_filepath(n_filename, 0);
28739
28740         ret_val = xmlIOFTPMatch(filename);
28741         desret_int(ret_val);
28742         call_tests++;
28743         des_filepath(n_filename, filename, 0);
28744         xmlResetLastError();
28745         if (mem_base != xmlMemBlocks()) {
28746             printf("Leak of %d blocks found in xmlIOFTPMatch",
28747                    xmlMemBlocks() - mem_base);
28748             test_ret++;
28749             printf(" %d", n_filename);
28750             printf("\n");
28751         }
28752     }
28753     function_tests++;
28754 #endif
28755
28756     return(test_ret);
28757 }
28758
28759
28760 static int
28761 test_xmlIOFTPOpen(void) {
28762     int test_ret = 0;
28763
28764 #if defined(LIBXML_FTP_ENABLED)
28765     int mem_base;
28766     void * ret_val;
28767     const char * filename; /* the URI for matching */
28768     int n_filename;
28769
28770     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28771         mem_base = xmlMemBlocks();
28772         filename = gen_filepath(n_filename, 0);
28773
28774         ret_val = xmlIOFTPOpen(filename);
28775         desret_void_ptr(ret_val);
28776         call_tests++;
28777         des_filepath(n_filename, filename, 0);
28778         xmlResetLastError();
28779         if (mem_base != xmlMemBlocks()) {
28780             printf("Leak of %d blocks found in xmlIOFTPOpen",
28781                    xmlMemBlocks() - mem_base);
28782             test_ret++;
28783             printf(" %d", n_filename);
28784             printf("\n");
28785         }
28786     }
28787     function_tests++;
28788 #endif
28789
28790     return(test_ret);
28791 }
28792
28793
28794 static int
28795 test_xmlIOFTPRead(void) {
28796     int test_ret = 0;
28797
28798 #if defined(LIBXML_FTP_ENABLED)
28799     int mem_base;
28800     int ret_val;
28801     void * context; /* the I/O context */
28802     int n_context;
28803     char * buffer; /* where to drop data */
28804     int n_buffer;
28805     int len; /* number of bytes to write */
28806     int n_len;
28807
28808     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28809     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28810     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28811         mem_base = xmlMemBlocks();
28812         context = gen_void_ptr(n_context, 0);
28813         buffer = gen_char_ptr(n_buffer, 1);
28814         len = gen_int(n_len, 2);
28815
28816         ret_val = xmlIOFTPRead(context, buffer, len);
28817         desret_int(ret_val);
28818         call_tests++;
28819         des_void_ptr(n_context, context, 0);
28820         des_char_ptr(n_buffer, buffer, 1);
28821         des_int(n_len, len, 2);
28822         xmlResetLastError();
28823         if (mem_base != xmlMemBlocks()) {
28824             printf("Leak of %d blocks found in xmlIOFTPRead",
28825                    xmlMemBlocks() - mem_base);
28826             test_ret++;
28827             printf(" %d", n_context);
28828             printf(" %d", n_buffer);
28829             printf(" %d", n_len);
28830             printf("\n");
28831         }
28832     }
28833     }
28834     }
28835     function_tests++;
28836 #endif
28837
28838     return(test_ret);
28839 }
28840
28841
28842 static int
28843 test_xmlIOHTTPClose(void) {
28844     int test_ret = 0;
28845
28846 #if defined(LIBXML_HTTP_ENABLED)
28847     int mem_base;
28848     int ret_val;
28849     void * context; /* the I/O context */
28850     int n_context;
28851
28852     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28853         mem_base = xmlMemBlocks();
28854         context = gen_void_ptr(n_context, 0);
28855
28856         ret_val = xmlIOHTTPClose(context);
28857         desret_int(ret_val);
28858         call_tests++;
28859         des_void_ptr(n_context, context, 0);
28860         xmlResetLastError();
28861         if (mem_base != xmlMemBlocks()) {
28862             printf("Leak of %d blocks found in xmlIOHTTPClose",
28863                    xmlMemBlocks() - mem_base);
28864             test_ret++;
28865             printf(" %d", n_context);
28866             printf("\n");
28867         }
28868     }
28869     function_tests++;
28870 #endif
28871
28872     return(test_ret);
28873 }
28874
28875
28876 static int
28877 test_xmlIOHTTPMatch(void) {
28878     int test_ret = 0;
28879
28880 #if defined(LIBXML_HTTP_ENABLED)
28881     int mem_base;
28882     int ret_val;
28883     const char * filename; /* the URI for matching */
28884     int n_filename;
28885
28886     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28887         mem_base = xmlMemBlocks();
28888         filename = gen_filepath(n_filename, 0);
28889
28890         ret_val = xmlIOHTTPMatch(filename);
28891         desret_int(ret_val);
28892         call_tests++;
28893         des_filepath(n_filename, filename, 0);
28894         xmlResetLastError();
28895         if (mem_base != xmlMemBlocks()) {
28896             printf("Leak of %d blocks found in xmlIOHTTPMatch",
28897                    xmlMemBlocks() - mem_base);
28898             test_ret++;
28899             printf(" %d", n_filename);
28900             printf("\n");
28901         }
28902     }
28903     function_tests++;
28904 #endif
28905
28906     return(test_ret);
28907 }
28908
28909
28910 static int
28911 test_xmlIOHTTPOpen(void) {
28912     int test_ret = 0;
28913
28914 #if defined(LIBXML_HTTP_ENABLED)
28915     int mem_base;
28916     void * ret_val;
28917     const char * filename; /* the URI for matching */
28918     int n_filename;
28919
28920     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28921         mem_base = xmlMemBlocks();
28922         filename = gen_filepath(n_filename, 0);
28923
28924         ret_val = xmlIOHTTPOpen(filename);
28925         desret_xmlNanoHTTPCtxtPtr(ret_val);
28926         call_tests++;
28927         des_filepath(n_filename, filename, 0);
28928         xmlResetLastError();
28929         if (mem_base != xmlMemBlocks()) {
28930             printf("Leak of %d blocks found in xmlIOHTTPOpen",
28931                    xmlMemBlocks() - mem_base);
28932             test_ret++;
28933             printf(" %d", n_filename);
28934             printf("\n");
28935         }
28936     }
28937     function_tests++;
28938 #endif
28939
28940     return(test_ret);
28941 }
28942
28943
28944 static int
28945 test_xmlIOHTTPRead(void) {
28946     int test_ret = 0;
28947
28948 #if defined(LIBXML_HTTP_ENABLED)
28949     int mem_base;
28950     int ret_val;
28951     void * context; /* the I/O context */
28952     int n_context;
28953     char * buffer; /* where to drop data */
28954     int n_buffer;
28955     int len; /* number of bytes to write */
28956     int n_len;
28957
28958     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28959     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28960     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28961         mem_base = xmlMemBlocks();
28962         context = gen_void_ptr(n_context, 0);
28963         buffer = gen_char_ptr(n_buffer, 1);
28964         len = gen_int(n_len, 2);
28965
28966         ret_val = xmlIOHTTPRead(context, buffer, len);
28967         desret_int(ret_val);
28968         call_tests++;
28969         des_void_ptr(n_context, context, 0);
28970         des_char_ptr(n_buffer, buffer, 1);
28971         des_int(n_len, len, 2);
28972         xmlResetLastError();
28973         if (mem_base != xmlMemBlocks()) {
28974             printf("Leak of %d blocks found in xmlIOHTTPRead",
28975                    xmlMemBlocks() - mem_base);
28976             test_ret++;
28977             printf(" %d", n_context);
28978             printf(" %d", n_buffer);
28979             printf(" %d", n_len);
28980             printf("\n");
28981         }
28982     }
28983     }
28984     }
28985     function_tests++;
28986 #endif
28987
28988     return(test_ret);
28989 }
28990
28991
28992 static int
28993 test_xmlNoNetExternalEntityLoader(void) {
28994     int test_ret = 0;
28995
28996     int mem_base;
28997     xmlParserInputPtr ret_val;
28998     const char * URL; /* the URL for the entity to load */
28999     int n_URL;
29000     char * ID; /* the System ID for the entity to load */
29001     int n_ID;
29002     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
29003     int n_ctxt;
29004
29005     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29006     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
29007     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
29008         mem_base = xmlMemBlocks();
29009         URL = gen_filepath(n_URL, 0);
29010         ID = gen_const_char_ptr(n_ID, 1);
29011         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
29012
29013         ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
29014         desret_xmlParserInputPtr(ret_val);
29015         call_tests++;
29016         des_filepath(n_URL, URL, 0);
29017         des_const_char_ptr(n_ID, (const char *)ID, 1);
29018         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
29019         xmlResetLastError();
29020         if (mem_base != xmlMemBlocks()) {
29021             printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
29022                    xmlMemBlocks() - mem_base);
29023             test_ret++;
29024             printf(" %d", n_URL);
29025             printf(" %d", n_ID);
29026             printf(" %d", n_ctxt);
29027             printf("\n");
29028         }
29029     }
29030     }
29031     }
29032     function_tests++;
29033
29034     return(test_ret);
29035 }
29036
29037
29038 static int
29039 test_xmlNormalizeWindowsPath(void) {
29040     int test_ret = 0;
29041
29042     int mem_base;
29043     xmlChar * ret_val;
29044     xmlChar * path; /* the input file path */
29045     int n_path;
29046
29047     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
29048         mem_base = xmlMemBlocks();
29049         path = gen_const_xmlChar_ptr(n_path, 0);
29050
29051         ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
29052         desret_xmlChar_ptr(ret_val);
29053         call_tests++;
29054         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
29055         xmlResetLastError();
29056         if (mem_base != xmlMemBlocks()) {
29057             printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
29058                    xmlMemBlocks() - mem_base);
29059             test_ret++;
29060             printf(" %d", n_path);
29061             printf("\n");
29062         }
29063     }
29064     function_tests++;
29065
29066     return(test_ret);
29067 }
29068
29069
29070 static int
29071 test_xmlOutputBufferCreateBuffer(void) {
29072     int test_ret = 0;
29073
29074 #if defined(LIBXML_OUTPUT_ENABLED)
29075     int mem_base;
29076     xmlOutputBufferPtr ret_val;
29077     xmlBufferPtr buffer; /* a xmlBufferPtr */
29078     int n_buffer;
29079     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
29080     int n_encoder;
29081
29082     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
29083     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
29084         mem_base = xmlMemBlocks();
29085         buffer = gen_xmlBufferPtr(n_buffer, 0);
29086         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
29087
29088         ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
29089         desret_xmlOutputBufferPtr(ret_val);
29090         call_tests++;
29091         des_xmlBufferPtr(n_buffer, buffer, 0);
29092         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
29093         xmlResetLastError();
29094         if (mem_base != xmlMemBlocks()) {
29095             printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
29096                    xmlMemBlocks() - mem_base);
29097             test_ret++;
29098             printf(" %d", n_buffer);
29099             printf(" %d", n_encoder);
29100             printf("\n");
29101         }
29102     }
29103     }
29104     function_tests++;
29105 #endif
29106
29107     return(test_ret);
29108 }
29109
29110
29111 static int
29112 test_xmlOutputBufferCreateFd(void) {
29113     int test_ret = 0;
29114
29115 #if defined(LIBXML_OUTPUT_ENABLED)
29116     int mem_base;
29117     xmlOutputBufferPtr ret_val;
29118     int fd; /* a file descriptor number */
29119     int n_fd;
29120     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
29121     int n_encoder;
29122
29123     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
29124     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
29125         mem_base = xmlMemBlocks();
29126         fd = gen_int(n_fd, 0);
29127         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
29128
29129         ret_val = xmlOutputBufferCreateFd(fd, encoder);
29130         desret_xmlOutputBufferPtr(ret_val);
29131         call_tests++;
29132         des_int(n_fd, fd, 0);
29133         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
29134         xmlResetLastError();
29135         if (mem_base != xmlMemBlocks()) {
29136             printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
29137                    xmlMemBlocks() - mem_base);
29138             test_ret++;
29139             printf(" %d", n_fd);
29140             printf(" %d", n_encoder);
29141             printf("\n");
29142         }
29143     }
29144     }
29145     function_tests++;
29146 #endif
29147
29148     return(test_ret);
29149 }
29150
29151
29152 static int
29153 test_xmlOutputBufferCreateFile(void) {
29154     int test_ret = 0;
29155
29156 #if defined(LIBXML_OUTPUT_ENABLED)
29157     int mem_base;
29158     xmlOutputBufferPtr ret_val;
29159     FILE * file; /* a FILE* */
29160     int n_file;
29161     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
29162     int n_encoder;
29163
29164     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
29165     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
29166         mem_base = xmlMemBlocks();
29167         file = gen_FILE_ptr(n_file, 0);
29168         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
29169
29170         ret_val = xmlOutputBufferCreateFile(file, encoder);
29171         desret_xmlOutputBufferPtr(ret_val);
29172         call_tests++;
29173         des_FILE_ptr(n_file, file, 0);
29174         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
29175         xmlResetLastError();
29176         if (mem_base != xmlMemBlocks()) {
29177             printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
29178                    xmlMemBlocks() - mem_base);
29179             test_ret++;
29180             printf(" %d", n_file);
29181             printf(" %d", n_encoder);
29182             printf("\n");
29183         }
29184     }
29185     }
29186     function_tests++;
29187 #endif
29188
29189     return(test_ret);
29190 }
29191
29192
29193 static int
29194 test_xmlOutputBufferCreateFilename(void) {
29195     int test_ret = 0;
29196
29197 #if defined(LIBXML_OUTPUT_ENABLED)
29198     int mem_base;
29199     xmlOutputBufferPtr ret_val;
29200     const char * URI; /* a C string containing the URI or filename */
29201     int n_URI;
29202     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
29203     int n_encoder;
29204     int compression; /* the compression ration (0 none, 9 max). */
29205     int n_compression;
29206
29207     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
29208     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
29209     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
29210         mem_base = xmlMemBlocks();
29211         URI = gen_fileoutput(n_URI, 0);
29212         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
29213         compression = gen_int(n_compression, 2);
29214
29215         ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
29216         desret_xmlOutputBufferPtr(ret_val);
29217         call_tests++;
29218         des_fileoutput(n_URI, URI, 0);
29219         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
29220         des_int(n_compression, compression, 2);
29221         xmlResetLastError();
29222         if (mem_base != xmlMemBlocks()) {
29223             printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
29224                    xmlMemBlocks() - mem_base);
29225             test_ret++;
29226             printf(" %d", n_URI);
29227             printf(" %d", n_encoder);
29228             printf(" %d", n_compression);
29229             printf("\n");
29230         }
29231     }
29232     }
29233     }
29234     function_tests++;
29235 #endif
29236
29237     return(test_ret);
29238 }
29239
29240
29241 static int
29242 test_xmlOutputBufferFlush(void) {
29243     int test_ret = 0;
29244
29245 #if defined(LIBXML_OUTPUT_ENABLED)
29246     int mem_base;
29247     int ret_val;
29248     xmlOutputBufferPtr out; /* a buffered output */
29249     int n_out;
29250
29251     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
29252         mem_base = xmlMemBlocks();
29253         out = gen_xmlOutputBufferPtr(n_out, 0);
29254
29255         ret_val = xmlOutputBufferFlush(out);
29256         desret_int(ret_val);
29257         call_tests++;
29258         des_xmlOutputBufferPtr(n_out, out, 0);
29259         xmlResetLastError();
29260         if (mem_base != xmlMemBlocks()) {
29261             printf("Leak of %d blocks found in xmlOutputBufferFlush",
29262                    xmlMemBlocks() - mem_base);
29263             test_ret++;
29264             printf(" %d", n_out);
29265             printf("\n");
29266         }
29267     }
29268     function_tests++;
29269 #endif
29270
29271     return(test_ret);
29272 }
29273
29274
29275 static int
29276 test_xmlOutputBufferGetContent(void) {
29277     int test_ret = 0;
29278
29279 #if defined(LIBXML_OUTPUT_ENABLED)
29280     int mem_base;
29281     const xmlChar * ret_val;
29282     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
29283     int n_out;
29284
29285     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
29286         mem_base = xmlMemBlocks();
29287         out = gen_xmlOutputBufferPtr(n_out, 0);
29288
29289         ret_val = xmlOutputBufferGetContent(out);
29290         desret_const_xmlChar_ptr(ret_val);
29291         call_tests++;
29292         des_xmlOutputBufferPtr(n_out, out, 0);
29293         xmlResetLastError();
29294         if (mem_base != xmlMemBlocks()) {
29295             printf("Leak of %d blocks found in xmlOutputBufferGetContent",
29296                    xmlMemBlocks() - mem_base);
29297             test_ret++;
29298             printf(" %d", n_out);
29299             printf("\n");
29300         }
29301     }
29302     function_tests++;
29303 #endif
29304
29305     return(test_ret);
29306 }
29307
29308
29309 static int
29310 test_xmlOutputBufferGetSize(void) {
29311     int test_ret = 0;
29312
29313
29314     /* missing type support */
29315     return(test_ret);
29316 }
29317
29318
29319 static int
29320 test_xmlOutputBufferWrite(void) {
29321     int test_ret = 0;
29322
29323 #if defined(LIBXML_OUTPUT_ENABLED)
29324     int mem_base;
29325     int ret_val;
29326     xmlOutputBufferPtr out; /* a buffered parser output */
29327     int n_out;
29328     int len; /* the size in bytes of the array. */
29329     int n_len;
29330     char * buf; /* an char array */
29331     int n_buf;
29332
29333     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
29334     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29335     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
29336         mem_base = xmlMemBlocks();
29337         out = gen_xmlOutputBufferPtr(n_out, 0);
29338         len = gen_int(n_len, 1);
29339         buf = gen_const_char_ptr(n_buf, 2);
29340
29341         ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
29342         desret_int(ret_val);
29343         call_tests++;
29344         des_xmlOutputBufferPtr(n_out, out, 0);
29345         des_int(n_len, len, 1);
29346         des_const_char_ptr(n_buf, (const char *)buf, 2);
29347         xmlResetLastError();
29348         if (mem_base != xmlMemBlocks()) {
29349             printf("Leak of %d blocks found in xmlOutputBufferWrite",
29350                    xmlMemBlocks() - mem_base);
29351             test_ret++;
29352             printf(" %d", n_out);
29353             printf(" %d", n_len);
29354             printf(" %d", n_buf);
29355             printf("\n");
29356         }
29357     }
29358     }
29359     }
29360     function_tests++;
29361 #endif
29362
29363     return(test_ret);
29364 }
29365
29366
29367 static int
29368 test_xmlOutputBufferWriteEscape(void) {
29369     int test_ret = 0;
29370
29371
29372     /* missing type support */
29373     return(test_ret);
29374 }
29375
29376
29377 static int
29378 test_xmlOutputBufferWriteString(void) {
29379     int test_ret = 0;
29380
29381 #if defined(LIBXML_OUTPUT_ENABLED)
29382     int mem_base;
29383     int ret_val;
29384     xmlOutputBufferPtr out; /* a buffered parser output */
29385     int n_out;
29386     char * str; /* a zero terminated C string */
29387     int n_str;
29388
29389     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
29390     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
29391         mem_base = xmlMemBlocks();
29392         out = gen_xmlOutputBufferPtr(n_out, 0);
29393         str = gen_const_char_ptr(n_str, 1);
29394
29395         ret_val = xmlOutputBufferWriteString(out, (const char *)str);
29396         desret_int(ret_val);
29397         call_tests++;
29398         des_xmlOutputBufferPtr(n_out, out, 0);
29399         des_const_char_ptr(n_str, (const char *)str, 1);
29400         xmlResetLastError();
29401         if (mem_base != xmlMemBlocks()) {
29402             printf("Leak of %d blocks found in xmlOutputBufferWriteString",
29403                    xmlMemBlocks() - mem_base);
29404             test_ret++;
29405             printf(" %d", n_out);
29406             printf(" %d", n_str);
29407             printf("\n");
29408         }
29409     }
29410     }
29411     function_tests++;
29412 #endif
29413
29414     return(test_ret);
29415 }
29416
29417
29418 static int
29419 test_xmlParserGetDirectory(void) {
29420     int test_ret = 0;
29421
29422
29423     /* missing type support */
29424     return(test_ret);
29425 }
29426
29427
29428 static int
29429 test_xmlParserInputBufferCreateFd(void) {
29430     int test_ret = 0;
29431
29432     int mem_base;
29433     xmlParserInputBufferPtr ret_val;
29434     int fd; /* a file descriptor number */
29435     int n_fd;
29436     xmlCharEncoding enc; /* the charset encoding if known */
29437     int n_enc;
29438
29439     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
29440     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29441         mem_base = xmlMemBlocks();
29442         fd = gen_int(n_fd, 0);
29443         enc = gen_xmlCharEncoding(n_enc, 1);
29444         if (fd >= 0) fd = -1;
29445
29446         ret_val = xmlParserInputBufferCreateFd(fd, enc);
29447         desret_xmlParserInputBufferPtr(ret_val);
29448         call_tests++;
29449         des_int(n_fd, fd, 0);
29450         des_xmlCharEncoding(n_enc, enc, 1);
29451         xmlResetLastError();
29452         if (mem_base != xmlMemBlocks()) {
29453             printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
29454                    xmlMemBlocks() - mem_base);
29455             test_ret++;
29456             printf(" %d", n_fd);
29457             printf(" %d", n_enc);
29458             printf("\n");
29459         }
29460     }
29461     }
29462     function_tests++;
29463
29464     return(test_ret);
29465 }
29466
29467
29468 static int
29469 test_xmlParserInputBufferCreateFile(void) {
29470     int test_ret = 0;
29471
29472     int mem_base;
29473     xmlParserInputBufferPtr ret_val;
29474     FILE * file; /* a FILE* */
29475     int n_file;
29476     xmlCharEncoding enc; /* the charset encoding if known */
29477     int n_enc;
29478
29479     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
29480     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29481         mem_base = xmlMemBlocks();
29482         file = gen_FILE_ptr(n_file, 0);
29483         enc = gen_xmlCharEncoding(n_enc, 1);
29484
29485         ret_val = xmlParserInputBufferCreateFile(file, enc);
29486         desret_xmlParserInputBufferPtr(ret_val);
29487         call_tests++;
29488         des_FILE_ptr(n_file, file, 0);
29489         des_xmlCharEncoding(n_enc, enc, 1);
29490         xmlResetLastError();
29491         if (mem_base != xmlMemBlocks()) {
29492             printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
29493                    xmlMemBlocks() - mem_base);
29494             test_ret++;
29495             printf(" %d", n_file);
29496             printf(" %d", n_enc);
29497             printf("\n");
29498         }
29499     }
29500     }
29501     function_tests++;
29502
29503     return(test_ret);
29504 }
29505
29506
29507 static int
29508 test_xmlParserInputBufferCreateFilename(void) {
29509     int test_ret = 0;
29510
29511     int mem_base;
29512     xmlParserInputBufferPtr ret_val;
29513     const char * URI; /* a C string containing the URI or filename */
29514     int n_URI;
29515     xmlCharEncoding enc; /* the charset encoding if known */
29516     int n_enc;
29517
29518     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
29519     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29520         mem_base = xmlMemBlocks();
29521         URI = gen_fileoutput(n_URI, 0);
29522         enc = gen_xmlCharEncoding(n_enc, 1);
29523
29524         ret_val = xmlParserInputBufferCreateFilename(URI, enc);
29525         desret_xmlParserInputBufferPtr(ret_val);
29526         call_tests++;
29527         des_fileoutput(n_URI, URI, 0);
29528         des_xmlCharEncoding(n_enc, enc, 1);
29529         xmlResetLastError();
29530         if (mem_base != xmlMemBlocks()) {
29531             printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
29532                    xmlMemBlocks() - mem_base);
29533             test_ret++;
29534             printf(" %d", n_URI);
29535             printf(" %d", n_enc);
29536             printf("\n");
29537         }
29538     }
29539     }
29540     function_tests++;
29541
29542     return(test_ret);
29543 }
29544
29545
29546 static int
29547 test_xmlParserInputBufferCreateMem(void) {
29548     int test_ret = 0;
29549
29550     int mem_base;
29551     xmlParserInputBufferPtr ret_val;
29552     char * mem; /* the memory input */
29553     int n_mem;
29554     int size; /* the length of the memory block */
29555     int n_size;
29556     xmlCharEncoding enc; /* the charset encoding if known */
29557     int n_enc;
29558
29559     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
29560     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29561     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29562         mem_base = xmlMemBlocks();
29563         mem = gen_const_char_ptr(n_mem, 0);
29564         size = gen_int(n_size, 1);
29565         enc = gen_xmlCharEncoding(n_enc, 2);
29566
29567         ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
29568         desret_xmlParserInputBufferPtr(ret_val);
29569         call_tests++;
29570         des_const_char_ptr(n_mem, (const char *)mem, 0);
29571         des_int(n_size, size, 1);
29572         des_xmlCharEncoding(n_enc, enc, 2);
29573         xmlResetLastError();
29574         if (mem_base != xmlMemBlocks()) {
29575             printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
29576                    xmlMemBlocks() - mem_base);
29577             test_ret++;
29578             printf(" %d", n_mem);
29579             printf(" %d", n_size);
29580             printf(" %d", n_enc);
29581             printf("\n");
29582         }
29583     }
29584     }
29585     }
29586     function_tests++;
29587
29588     return(test_ret);
29589 }
29590
29591
29592 static int
29593 test_xmlParserInputBufferCreateStatic(void) {
29594     int test_ret = 0;
29595
29596     int mem_base;
29597     xmlParserInputBufferPtr ret_val;
29598     char * mem; /* the memory input */
29599     int n_mem;
29600     int size; /* the length of the memory block */
29601     int n_size;
29602     xmlCharEncoding enc; /* the charset encoding if known */
29603     int n_enc;
29604
29605     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
29606     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29607     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29608         mem_base = xmlMemBlocks();
29609         mem = gen_const_char_ptr(n_mem, 0);
29610         size = gen_int(n_size, 1);
29611         enc = gen_xmlCharEncoding(n_enc, 2);
29612
29613         ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
29614         desret_xmlParserInputBufferPtr(ret_val);
29615         call_tests++;
29616         des_const_char_ptr(n_mem, (const char *)mem, 0);
29617         des_int(n_size, size, 1);
29618         des_xmlCharEncoding(n_enc, enc, 2);
29619         xmlResetLastError();
29620         if (mem_base != xmlMemBlocks()) {
29621             printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
29622                    xmlMemBlocks() - mem_base);
29623             test_ret++;
29624             printf(" %d", n_mem);
29625             printf(" %d", n_size);
29626             printf(" %d", n_enc);
29627             printf("\n");
29628         }
29629     }
29630     }
29631     }
29632     function_tests++;
29633
29634     return(test_ret);
29635 }
29636
29637
29638 static int
29639 test_xmlParserInputBufferGrow(void) {
29640     int test_ret = 0;
29641
29642     int mem_base;
29643     int ret_val;
29644     xmlParserInputBufferPtr in; /* a buffered parser input */
29645     int n_in;
29646     int len; /* indicative value of the amount of chars to read */
29647     int n_len;
29648
29649     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29650     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29651         mem_base = xmlMemBlocks();
29652         in = gen_xmlParserInputBufferPtr(n_in, 0);
29653         len = gen_int(n_len, 1);
29654
29655         ret_val = xmlParserInputBufferGrow(in, len);
29656         desret_int(ret_val);
29657         call_tests++;
29658         des_xmlParserInputBufferPtr(n_in, in, 0);
29659         des_int(n_len, len, 1);
29660         xmlResetLastError();
29661         if (mem_base != xmlMemBlocks()) {
29662             printf("Leak of %d blocks found in xmlParserInputBufferGrow",
29663                    xmlMemBlocks() - mem_base);
29664             test_ret++;
29665             printf(" %d", n_in);
29666             printf(" %d", n_len);
29667             printf("\n");
29668         }
29669     }
29670     }
29671     function_tests++;
29672
29673     return(test_ret);
29674 }
29675
29676
29677 static int
29678 test_xmlParserInputBufferPush(void) {
29679     int test_ret = 0;
29680
29681     int mem_base;
29682     int ret_val;
29683     xmlParserInputBufferPtr in; /* a buffered parser input */
29684     int n_in;
29685     int len; /* the size in bytes of the array. */
29686     int n_len;
29687     char * buf; /* an char array */
29688     int n_buf;
29689
29690     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29691     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29692     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
29693         mem_base = xmlMemBlocks();
29694         in = gen_xmlParserInputBufferPtr(n_in, 0);
29695         len = gen_int(n_len, 1);
29696         buf = gen_const_char_ptr(n_buf, 2);
29697
29698         ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
29699         desret_int(ret_val);
29700         call_tests++;
29701         des_xmlParserInputBufferPtr(n_in, in, 0);
29702         des_int(n_len, len, 1);
29703         des_const_char_ptr(n_buf, (const char *)buf, 2);
29704         xmlResetLastError();
29705         if (mem_base != xmlMemBlocks()) {
29706             printf("Leak of %d blocks found in xmlParserInputBufferPush",
29707                    xmlMemBlocks() - mem_base);
29708             test_ret++;
29709             printf(" %d", n_in);
29710             printf(" %d", n_len);
29711             printf(" %d", n_buf);
29712             printf("\n");
29713         }
29714     }
29715     }
29716     }
29717     function_tests++;
29718
29719     return(test_ret);
29720 }
29721
29722
29723 static int
29724 test_xmlParserInputBufferRead(void) {
29725     int test_ret = 0;
29726
29727     int mem_base;
29728     int ret_val;
29729     xmlParserInputBufferPtr in; /* a buffered parser input */
29730     int n_in;
29731     int len; /* indicative value of the amount of chars to read */
29732     int n_len;
29733
29734     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29735     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29736         mem_base = xmlMemBlocks();
29737         in = gen_xmlParserInputBufferPtr(n_in, 0);
29738         len = gen_int(n_len, 1);
29739
29740         ret_val = xmlParserInputBufferRead(in, len);
29741         desret_int(ret_val);
29742         call_tests++;
29743         des_xmlParserInputBufferPtr(n_in, in, 0);
29744         des_int(n_len, len, 1);
29745         xmlResetLastError();
29746         if (mem_base != xmlMemBlocks()) {
29747             printf("Leak of %d blocks found in xmlParserInputBufferRead",
29748                    xmlMemBlocks() - mem_base);
29749             test_ret++;
29750             printf(" %d", n_in);
29751             printf(" %d", n_len);
29752             printf("\n");
29753         }
29754     }
29755     }
29756     function_tests++;
29757
29758     return(test_ret);
29759 }
29760
29761
29762 static int
29763 test_xmlPopInputCallbacks(void) {
29764     int test_ret = 0;
29765
29766     int mem_base;
29767     int ret_val;
29768
29769         mem_base = xmlMemBlocks();
29770
29771         ret_val = xmlPopInputCallbacks();
29772         desret_int(ret_val);
29773         call_tests++;
29774         xmlResetLastError();
29775         if (mem_base != xmlMemBlocks()) {
29776             printf("Leak of %d blocks found in xmlPopInputCallbacks",
29777                    xmlMemBlocks() - mem_base);
29778             test_ret++;
29779             printf("\n");
29780         }
29781     function_tests++;
29782
29783     return(test_ret);
29784 }
29785
29786
29787 static int
29788 test_xmlRegisterDefaultInputCallbacks(void) {
29789     int test_ret = 0;
29790
29791     int mem_base;
29792
29793         mem_base = xmlMemBlocks();
29794
29795         xmlRegisterDefaultInputCallbacks();
29796         call_tests++;
29797         xmlResetLastError();
29798         if (mem_base != xmlMemBlocks()) {
29799             printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
29800                    xmlMemBlocks() - mem_base);
29801             test_ret++;
29802             printf("\n");
29803         }
29804     function_tests++;
29805
29806     return(test_ret);
29807 }
29808
29809
29810 static int
29811 test_xmlRegisterDefaultOutputCallbacks(void) {
29812     int test_ret = 0;
29813
29814 #if defined(LIBXML_OUTPUT_ENABLED)
29815     int mem_base;
29816
29817         mem_base = xmlMemBlocks();
29818
29819         xmlRegisterDefaultOutputCallbacks();
29820         call_tests++;
29821         xmlResetLastError();
29822         if (mem_base != xmlMemBlocks()) {
29823             printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
29824                    xmlMemBlocks() - mem_base);
29825             test_ret++;
29826             printf("\n");
29827         }
29828     function_tests++;
29829 #endif
29830
29831     return(test_ret);
29832 }
29833
29834
29835 static int
29836 test_xmlRegisterHTTPPostCallbacks(void) {
29837     int test_ret = 0;
29838
29839 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
29840     int mem_base;
29841
29842         mem_base = xmlMemBlocks();
29843
29844         xmlRegisterHTTPPostCallbacks();
29845         call_tests++;
29846         xmlResetLastError();
29847         if (mem_base != xmlMemBlocks()) {
29848             printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
29849                    xmlMemBlocks() - mem_base);
29850             test_ret++;
29851             printf("\n");
29852         }
29853     function_tests++;
29854 #endif
29855
29856     return(test_ret);
29857 }
29858
29859 static int
29860 test_xmlIO(void) {
29861     int test_ret = 0;
29862         int rc = 0;
29863
29864     if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
29865     rc = test_xmlAllocOutputBuffer();
29866         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29867     rc = test_xmlAllocParserInputBuffer();
29868         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29869     rc = test_xmlCheckFilename();
29870         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29871     rc = test_xmlCheckHTTPInput();
29872         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29873     rc = test_xmlCleanupInputCallbacks();
29874         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29875     rc = test_xmlCleanupOutputCallbacks();
29876         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29877     rc = test_xmlFileClose();
29878         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29879     rc = test_xmlFileMatch();
29880         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29881     rc = test_xmlFileOpen();
29882         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29883     rc = test_xmlFileRead();
29884         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29885     rc = test_xmlIOFTPClose();
29886         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29887     rc = test_xmlIOFTPMatch();
29888         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29889     rc = test_xmlIOFTPOpen();
29890         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29891     rc = test_xmlIOFTPRead();
29892         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29893     rc = test_xmlIOHTTPClose();
29894         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29895     rc = test_xmlIOHTTPMatch();
29896         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29897     rc = test_xmlIOHTTPOpen();
29898         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29899     rc = test_xmlIOHTTPRead();
29900         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29901     rc = test_xmlNoNetExternalEntityLoader();
29902         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29903     rc = test_xmlNormalizeWindowsPath();
29904         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29905     rc = test_xmlOutputBufferCreateBuffer();
29906         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29907     rc = test_xmlOutputBufferCreateFd();
29908         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29909     rc = test_xmlOutputBufferCreateFile();
29910         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29911     rc = test_xmlOutputBufferCreateFilename();
29912         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29913     rc = test_xmlOutputBufferFlush();
29914         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29915     rc = test_xmlOutputBufferGetContent();
29916         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29917     rc = test_xmlOutputBufferGetSize();
29918         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29919     rc = test_xmlOutputBufferWrite();
29920         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29921     rc = test_xmlOutputBufferWriteEscape();
29922         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29923     rc = test_xmlOutputBufferWriteString();
29924         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29925     rc = test_xmlParserGetDirectory();
29926         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29927     rc = test_xmlParserInputBufferCreateFd();
29928         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29929     rc = test_xmlParserInputBufferCreateFile();
29930         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29931     rc = test_xmlParserInputBufferCreateFilename();
29932         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29933     rc = test_xmlParserInputBufferCreateMem();
29934         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29935     rc = test_xmlParserInputBufferCreateStatic();
29936         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29937     rc = test_xmlParserInputBufferGrow();
29938         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29939     rc = test_xmlParserInputBufferPush();
29940         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29941     rc = test_xmlParserInputBufferRead();
29942         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29943     rc = test_xmlPopInputCallbacks();
29944         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29945     rc = test_xmlRegisterDefaultInputCallbacks();
29946         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29947     rc = test_xmlRegisterDefaultOutputCallbacks();
29948         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29949     rc = test_xmlRegisterHTTPPostCallbacks();
29950         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29951
29952     if (test_ret != 0)
29953         printf("Module xmlIO: %d errors\n", test_ret);
29954     return(test_ret);
29955 }
29956 #ifdef LIBXML_AUTOMATA_ENABLED
29957
29958 #define gen_nb_xmlAutomataPtr 1
29959 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29960     return(NULL);
29961 }
29962 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29963 }
29964 #endif
29965
29966
29967 static int
29968 test_xmlAutomataCompile(void) {
29969     int test_ret = 0;
29970
29971
29972     /* missing type support */
29973     return(test_ret);
29974 }
29975
29976
29977 static int
29978 test_xmlAutomataGetInitState(void) {
29979     int test_ret = 0;
29980
29981
29982     /* missing type support */
29983     return(test_ret);
29984 }
29985
29986
29987 static int
29988 test_xmlAutomataIsDeterminist(void) {
29989     int test_ret = 0;
29990
29991 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29992     int mem_base;
29993     int ret_val;
29994     xmlAutomataPtr am; /* an automata */
29995     int n_am;
29996
29997     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29998         mem_base = xmlMemBlocks();
29999         am = gen_xmlAutomataPtr(n_am, 0);
30000
30001         ret_val = xmlAutomataIsDeterminist(am);
30002         desret_int(ret_val);
30003         call_tests++;
30004         des_xmlAutomataPtr(n_am, am, 0);
30005         xmlResetLastError();
30006         if (mem_base != xmlMemBlocks()) {
30007             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
30008                    xmlMemBlocks() - mem_base);
30009             test_ret++;
30010             printf(" %d", n_am);
30011             printf("\n");
30012         }
30013     }
30014     function_tests++;
30015 #endif
30016
30017     return(test_ret);
30018 }
30019
30020 #ifdef LIBXML_AUTOMATA_ENABLED
30021
30022 #define gen_nb_xmlAutomataStatePtr 1
30023 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30024     return(NULL);
30025 }
30026 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30027 }
30028 #endif
30029
30030
30031 static int
30032 test_xmlAutomataNewAllTrans(void) {
30033     int test_ret = 0;
30034
30035
30036     /* missing type support */
30037     return(test_ret);
30038 }
30039
30040
30041 static int
30042 test_xmlAutomataNewCountTrans(void) {
30043     int test_ret = 0;
30044
30045
30046     /* missing type support */
30047     return(test_ret);
30048 }
30049
30050
30051 static int
30052 test_xmlAutomataNewCountTrans2(void) {
30053     int test_ret = 0;
30054
30055
30056     /* missing type support */
30057     return(test_ret);
30058 }
30059
30060
30061 static int
30062 test_xmlAutomataNewCountedTrans(void) {
30063     int test_ret = 0;
30064
30065
30066     /* missing type support */
30067     return(test_ret);
30068 }
30069
30070
30071 static int
30072 test_xmlAutomataNewCounter(void) {
30073     int test_ret = 0;
30074
30075 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
30076     int mem_base;
30077     int ret_val;
30078     xmlAutomataPtr am; /* an automata */
30079     int n_am;
30080     int min; /* the minimal value on the counter */
30081     int n_min;
30082     int max; /* the maximal value on the counter */
30083     int n_max;
30084
30085     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
30086     for (n_min = 0;n_min < gen_nb_int;n_min++) {
30087     for (n_max = 0;n_max < gen_nb_int;n_max++) {
30088         mem_base = xmlMemBlocks();
30089         am = gen_xmlAutomataPtr(n_am, 0);
30090         min = gen_int(n_min, 1);
30091         max = gen_int(n_max, 2);
30092
30093         ret_val = xmlAutomataNewCounter(am, min, max);
30094         desret_int(ret_val);
30095         call_tests++;
30096         des_xmlAutomataPtr(n_am, am, 0);
30097         des_int(n_min, min, 1);
30098         des_int(n_max, max, 2);
30099         xmlResetLastError();
30100         if (mem_base != xmlMemBlocks()) {
30101             printf("Leak of %d blocks found in xmlAutomataNewCounter",
30102                    xmlMemBlocks() - mem_base);
30103             test_ret++;
30104             printf(" %d", n_am);
30105             printf(" %d", n_min);
30106             printf(" %d", n_max);
30107             printf("\n");
30108         }
30109     }
30110     }
30111     }
30112     function_tests++;
30113 #endif
30114
30115     return(test_ret);
30116 }
30117
30118
30119 static int
30120 test_xmlAutomataNewCounterTrans(void) {
30121     int test_ret = 0;
30122
30123
30124     /* missing type support */
30125     return(test_ret);
30126 }
30127
30128
30129 static int
30130 test_xmlAutomataNewEpsilon(void) {
30131     int test_ret = 0;
30132
30133
30134     /* missing type support */
30135     return(test_ret);
30136 }
30137
30138
30139 static int
30140 test_xmlAutomataNewNegTrans(void) {
30141     int test_ret = 0;
30142
30143
30144     /* missing type support */
30145     return(test_ret);
30146 }
30147
30148
30149 static int
30150 test_xmlAutomataNewOnceTrans(void) {
30151     int test_ret = 0;
30152
30153
30154     /* missing type support */
30155     return(test_ret);
30156 }
30157
30158
30159 static int
30160 test_xmlAutomataNewOnceTrans2(void) {
30161     int test_ret = 0;
30162
30163
30164     /* missing type support */
30165     return(test_ret);
30166 }
30167
30168
30169 static int
30170 test_xmlAutomataNewState(void) {
30171     int test_ret = 0;
30172
30173
30174     /* missing type support */
30175     return(test_ret);
30176 }
30177
30178
30179 static int
30180 test_xmlAutomataNewTransition(void) {
30181     int test_ret = 0;
30182
30183
30184     /* missing type support */
30185     return(test_ret);
30186 }
30187
30188
30189 static int
30190 test_xmlAutomataNewTransition2(void) {
30191     int test_ret = 0;
30192
30193
30194     /* missing type support */
30195     return(test_ret);
30196 }
30197
30198
30199 static int
30200 test_xmlAutomataSetFinalState(void) {
30201     int test_ret = 0;
30202
30203 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
30204     int mem_base;
30205     int ret_val;
30206     xmlAutomataPtr am; /* an automata */
30207     int n_am;
30208     xmlAutomataStatePtr state; /* a state in this automata */
30209     int n_state;
30210
30211     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
30212     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
30213         mem_base = xmlMemBlocks();
30214         am = gen_xmlAutomataPtr(n_am, 0);
30215         state = gen_xmlAutomataStatePtr(n_state, 1);
30216
30217         ret_val = xmlAutomataSetFinalState(am, state);
30218         desret_int(ret_val);
30219         call_tests++;
30220         des_xmlAutomataPtr(n_am, am, 0);
30221         des_xmlAutomataStatePtr(n_state, state, 1);
30222         xmlResetLastError();
30223         if (mem_base != xmlMemBlocks()) {
30224             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
30225                    xmlMemBlocks() - mem_base);
30226             test_ret++;
30227             printf(" %d", n_am);
30228             printf(" %d", n_state);
30229             printf("\n");
30230         }
30231     }
30232     }
30233     function_tests++;
30234 #endif
30235
30236     return(test_ret);
30237 }
30238
30239
30240 static int
30241 test_xmlNewAutomata(void) {
30242     int test_ret = 0;
30243
30244
30245     /* missing type support */
30246     return(test_ret);
30247 }
30248
30249 static int
30250 test_xmlautomata(void) {
30251     int test_ret = 0;
30252         int rc = 0;
30253
30254     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
30255     rc = test_xmlAutomataCompile();
30256         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30257     rc = test_xmlAutomataGetInitState();
30258         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30259     rc = test_xmlAutomataIsDeterminist();
30260         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30261     rc = test_xmlAutomataNewAllTrans();
30262         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30263     rc = test_xmlAutomataNewCountTrans();
30264         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30265     rc = test_xmlAutomataNewCountTrans2();
30266         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30267     rc = test_xmlAutomataNewCountedTrans();
30268         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30269     rc = test_xmlAutomataNewCounter();
30270         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30271     rc = test_xmlAutomataNewCounterTrans();
30272         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30273     rc = test_xmlAutomataNewEpsilon();
30274         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30275     rc = test_xmlAutomataNewNegTrans();
30276         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30277     rc = test_xmlAutomataNewOnceTrans();
30278         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30279     rc = test_xmlAutomataNewOnceTrans2();
30280         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30281     rc = test_xmlAutomataNewState();
30282         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30283     rc = test_xmlAutomataNewTransition();
30284         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30285     rc = test_xmlAutomataNewTransition2();
30286         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30287     rc = test_xmlAutomataSetFinalState();
30288         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30289     rc = test_xmlNewAutomata();
30290         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30291
30292     if (test_ret != 0)
30293         printf("Module xmlautomata: %d errors\n", test_ret);
30294     return(test_ret);
30295 }
30296
30297 #define gen_nb_xmlGenericErrorFunc_ptr 1
30298 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30299     return(NULL);
30300 }
30301 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30302 }
30303
30304 static int
30305 test_initGenericErrorDefaultFunc(void) {
30306     int test_ret = 0;
30307
30308     int mem_base;
30309     xmlGenericErrorFunc * handler; /* the handler */
30310     int n_handler;
30311
30312     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
30313         mem_base = xmlMemBlocks();
30314         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
30315
30316         initGenericErrorDefaultFunc(handler);
30317         call_tests++;
30318         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
30319         xmlResetLastError();
30320         if (mem_base != xmlMemBlocks()) {
30321             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
30322                    xmlMemBlocks() - mem_base);
30323             test_ret++;
30324             printf(" %d", n_handler);
30325             printf("\n");
30326         }
30327     }
30328     function_tests++;
30329
30330     return(test_ret);
30331 }
30332
30333
30334 #define gen_nb_xmlErrorPtr 1
30335 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30336     return(NULL);
30337 }
30338 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30339 }
30340
30341 static int
30342 test_xmlCopyError(void) {
30343     int test_ret = 0;
30344
30345     int mem_base;
30346     int ret_val;
30347     xmlErrorPtr from; /* a source error */
30348     int n_from;
30349     xmlErrorPtr to; /* a target error */
30350     int n_to;
30351
30352     for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
30353     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
30354         mem_base = xmlMemBlocks();
30355         from = gen_xmlErrorPtr(n_from, 0);
30356         to = gen_xmlErrorPtr(n_to, 1);
30357
30358         ret_val = xmlCopyError(from, to);
30359         desret_int(ret_val);
30360         call_tests++;
30361         des_xmlErrorPtr(n_from, from, 0);
30362         des_xmlErrorPtr(n_to, to, 1);
30363         xmlResetLastError();
30364         if (mem_base != xmlMemBlocks()) {
30365             printf("Leak of %d blocks found in xmlCopyError",
30366                    xmlMemBlocks() - mem_base);
30367             test_ret++;
30368             printf(" %d", n_from);
30369             printf(" %d", n_to);
30370             printf("\n");
30371         }
30372     }
30373     }
30374     function_tests++;
30375
30376     return(test_ret);
30377 }
30378
30379
30380 static int
30381 test_xmlCtxtGetLastError(void) {
30382     int test_ret = 0;
30383
30384
30385     /* missing type support */
30386     return(test_ret);
30387 }
30388
30389
30390 static int
30391 test_xmlCtxtResetLastError(void) {
30392     int test_ret = 0;
30393
30394     int mem_base;
30395     void * ctx; /* an XML parser context */
30396     int n_ctx;
30397
30398     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
30399         mem_base = xmlMemBlocks();
30400         ctx = gen_void_ptr(n_ctx, 0);
30401
30402         xmlCtxtResetLastError(ctx);
30403         call_tests++;
30404         des_void_ptr(n_ctx, ctx, 0);
30405         xmlResetLastError();
30406         if (mem_base != xmlMemBlocks()) {
30407             printf("Leak of %d blocks found in xmlCtxtResetLastError",
30408                    xmlMemBlocks() - mem_base);
30409             test_ret++;
30410             printf(" %d", n_ctx);
30411             printf("\n");
30412         }
30413     }
30414     function_tests++;
30415
30416     return(test_ret);
30417 }
30418
30419
30420 static int
30421 test_xmlGetLastError(void) {
30422     int test_ret = 0;
30423
30424
30425     /* missing type support */
30426     return(test_ret);
30427 }
30428
30429
30430 static int
30431 test_xmlParserError(void) {
30432     int test_ret = 0;
30433
30434
30435     /* missing type support */
30436     return(test_ret);
30437 }
30438
30439
30440 static int
30441 test_xmlParserPrintFileContext(void) {
30442     int test_ret = 0;
30443
30444     int mem_base;
30445     xmlParserInputPtr input; /* an xmlParserInputPtr input */
30446     int n_input;
30447
30448     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
30449         mem_base = xmlMemBlocks();
30450         input = gen_xmlParserInputPtr(n_input, 0);
30451
30452         xmlParserPrintFileContext(input);
30453         call_tests++;
30454         des_xmlParserInputPtr(n_input, input, 0);
30455         xmlResetLastError();
30456         if (mem_base != xmlMemBlocks()) {
30457             printf("Leak of %d blocks found in xmlParserPrintFileContext",
30458                    xmlMemBlocks() - mem_base);
30459             test_ret++;
30460             printf(" %d", n_input);
30461             printf("\n");
30462         }
30463     }
30464     function_tests++;
30465
30466     return(test_ret);
30467 }
30468
30469
30470 static int
30471 test_xmlParserPrintFileInfo(void) {
30472     int test_ret = 0;
30473
30474     int mem_base;
30475     xmlParserInputPtr input; /* an xmlParserInputPtr input */
30476     int n_input;
30477
30478     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
30479         mem_base = xmlMemBlocks();
30480         input = gen_xmlParserInputPtr(n_input, 0);
30481
30482         xmlParserPrintFileInfo(input);
30483         call_tests++;
30484         des_xmlParserInputPtr(n_input, input, 0);
30485         xmlResetLastError();
30486         if (mem_base != xmlMemBlocks()) {
30487             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
30488                    xmlMemBlocks() - mem_base);
30489             test_ret++;
30490             printf(" %d", n_input);
30491             printf("\n");
30492         }
30493     }
30494     function_tests++;
30495
30496     return(test_ret);
30497 }
30498
30499
30500 static int
30501 test_xmlParserValidityError(void) {
30502     int test_ret = 0;
30503
30504
30505     /* missing type support */
30506     return(test_ret);
30507 }
30508
30509
30510 static int
30511 test_xmlParserValidityWarning(void) {
30512     int test_ret = 0;
30513
30514
30515     /* missing type support */
30516     return(test_ret);
30517 }
30518
30519
30520 static int
30521 test_xmlParserWarning(void) {
30522     int test_ret = 0;
30523
30524
30525     /* missing type support */
30526     return(test_ret);
30527 }
30528
30529
30530 static int
30531 test_xmlResetError(void) {
30532     int test_ret = 0;
30533
30534     int mem_base;
30535     xmlErrorPtr err; /* pointer to the error. */
30536     int n_err;
30537
30538     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
30539         mem_base = xmlMemBlocks();
30540         err = gen_xmlErrorPtr(n_err, 0);
30541
30542         xmlResetError(err);
30543         call_tests++;
30544         des_xmlErrorPtr(n_err, err, 0);
30545         xmlResetLastError();
30546         if (mem_base != xmlMemBlocks()) {
30547             printf("Leak of %d blocks found in xmlResetError",
30548                    xmlMemBlocks() - mem_base);
30549             test_ret++;
30550             printf(" %d", n_err);
30551             printf("\n");
30552         }
30553     }
30554     function_tests++;
30555
30556     return(test_ret);
30557 }
30558
30559
30560 static int
30561 test_xmlResetLastError(void) {
30562     int test_ret = 0;
30563
30564
30565
30566         xmlResetLastError();
30567         call_tests++;
30568         xmlResetLastError();
30569     function_tests++;
30570
30571     return(test_ret);
30572 }
30573
30574
30575 static int
30576 test_xmlSetGenericErrorFunc(void) {
30577     int test_ret = 0;
30578
30579
30580     /* missing type support */
30581     return(test_ret);
30582 }
30583
30584
30585 static int
30586 test_xmlSetStructuredErrorFunc(void) {
30587     int test_ret = 0;
30588
30589
30590     /* missing type support */
30591     return(test_ret);
30592 }
30593
30594 static int
30595 test_xmlerror(void) {
30596     int test_ret = 0;
30597         int rc = 0;
30598
30599     if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
30600     rc = test_initGenericErrorDefaultFunc();
30601         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30602     rc = test_xmlCopyError();
30603         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30604     rc = test_xmlCtxtGetLastError();
30605         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30606     rc = test_xmlCtxtResetLastError();
30607         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30608     rc = test_xmlGetLastError();
30609         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30610     rc = test_xmlParserError();
30611         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30612     rc = test_xmlParserPrintFileContext();
30613         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30614     rc = test_xmlParserPrintFileInfo();
30615         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30616     rc = test_xmlParserValidityError();
30617         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30618     rc = test_xmlParserValidityWarning();
30619         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30620     rc = test_xmlParserWarning();
30621         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30622     rc = test_xmlResetError();
30623         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30624     rc = test_xmlResetLastError();
30625         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30626     rc = test_xmlSetGenericErrorFunc();
30627         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30628     rc = test_xmlSetStructuredErrorFunc();
30629         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30630
30631     if (test_ret != 0)
30632         printf("Module xmlerror: %d errors\n", test_ret);
30633     return(test_ret);
30634 }
30635 #ifdef LIBXML_MODULES_ENABLED
30636
30637 #define gen_nb_xmlModulePtr 1
30638 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30639     return(NULL);
30640 }
30641 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30642 }
30643 #endif
30644
30645
30646 static int
30647 test_xmlModuleClose(void) {
30648     int test_ret = 0;
30649
30650 #if defined(LIBXML_MODULES_ENABLED)
30651     int mem_base;
30652     int ret_val;
30653     xmlModulePtr module; /* the module handle */
30654     int n_module;
30655
30656     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30657         mem_base = xmlMemBlocks();
30658         module = gen_xmlModulePtr(n_module, 0);
30659
30660         ret_val = xmlModuleClose(module);
30661         desret_int(ret_val);
30662         call_tests++;
30663         des_xmlModulePtr(n_module, module, 0);
30664         xmlResetLastError();
30665         if (mem_base != xmlMemBlocks()) {
30666             printf("Leak of %d blocks found in xmlModuleClose",
30667                    xmlMemBlocks() - mem_base);
30668             test_ret++;
30669             printf(" %d", n_module);
30670             printf("\n");
30671         }
30672     }
30673     function_tests++;
30674 #endif
30675
30676     return(test_ret);
30677 }
30678
30679
30680 static int
30681 test_xmlModuleOpen(void) {
30682     int test_ret = 0;
30683
30684
30685     /* missing type support */
30686     return(test_ret);
30687 }
30688
30689
30690 static int
30691 test_xmlModuleSymbol(void) {
30692     int test_ret = 0;
30693
30694 #if defined(LIBXML_MODULES_ENABLED)
30695     int mem_base;
30696     int ret_val;
30697     xmlModulePtr module; /* the module */
30698     int n_module;
30699     char * name; /* the name of the symbol */
30700     int n_name;
30701     void ** symbol; /* the resulting symbol address */
30702     int n_symbol;
30703
30704     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30705     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
30706     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
30707         mem_base = xmlMemBlocks();
30708         module = gen_xmlModulePtr(n_module, 0);
30709         name = gen_const_char_ptr(n_name, 1);
30710         symbol = gen_void_ptr_ptr(n_symbol, 2);
30711
30712         ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
30713         desret_int(ret_val);
30714         call_tests++;
30715         des_xmlModulePtr(n_module, module, 0);
30716         des_const_char_ptr(n_name, (const char *)name, 1);
30717         des_void_ptr_ptr(n_symbol, symbol, 2);
30718         xmlResetLastError();
30719         if (mem_base != xmlMemBlocks()) {
30720             printf("Leak of %d blocks found in xmlModuleSymbol",
30721                    xmlMemBlocks() - mem_base);
30722             test_ret++;
30723             printf(" %d", n_module);
30724             printf(" %d", n_name);
30725             printf(" %d", n_symbol);
30726             printf("\n");
30727         }
30728     }
30729     }
30730     }
30731     function_tests++;
30732 #endif
30733
30734     return(test_ret);
30735 }
30736
30737 static int
30738 test_xmlmodule(void) {
30739     int test_ret = 0;
30740         int rc = 0;
30741
30742     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
30743     rc = test_xmlModuleClose();
30744         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30745     rc = test_xmlModuleOpen();
30746         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30747     rc = test_xmlModuleSymbol();
30748         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30749
30750     if (test_ret != 0)
30751         printf("Module xmlmodule: %d errors\n", test_ret);
30752     return(test_ret);
30753 }
30754
30755 static int
30756 test_xmlNewTextReader(void) {
30757     int test_ret = 0;
30758
30759 #if defined(LIBXML_READER_ENABLED)
30760     int mem_base;
30761     xmlTextReaderPtr ret_val;
30762     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
30763     int n_input;
30764     const char * URI; /* the URI information for the source if available */
30765     int n_URI;
30766
30767     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
30768     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30769         mem_base = xmlMemBlocks();
30770         input = gen_xmlParserInputBufferPtr(n_input, 0);
30771         URI = gen_filepath(n_URI, 1);
30772
30773         ret_val = xmlNewTextReader(input, URI);
30774         desret_xmlTextReaderPtr(ret_val);
30775         call_tests++;
30776         des_xmlParserInputBufferPtr(n_input, input, 0);
30777         des_filepath(n_URI, URI, 1);
30778         xmlResetLastError();
30779         if (mem_base != xmlMemBlocks()) {
30780             printf("Leak of %d blocks found in xmlNewTextReader",
30781                    xmlMemBlocks() - mem_base);
30782             test_ret++;
30783             printf(" %d", n_input);
30784             printf(" %d", n_URI);
30785             printf("\n");
30786         }
30787     }
30788     }
30789     function_tests++;
30790 #endif
30791
30792     return(test_ret);
30793 }
30794
30795
30796 static int
30797 test_xmlNewTextReaderFilename(void) {
30798     int test_ret = 0;
30799
30800 #if defined(LIBXML_READER_ENABLED)
30801     int mem_base;
30802     xmlTextReaderPtr ret_val;
30803     const char * URI; /* the URI of the resource to process */
30804     int n_URI;
30805
30806     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30807         mem_base = xmlMemBlocks();
30808         URI = gen_filepath(n_URI, 0);
30809
30810         ret_val = xmlNewTextReaderFilename(URI);
30811         desret_xmlTextReaderPtr(ret_val);
30812         call_tests++;
30813         des_filepath(n_URI, URI, 0);
30814         xmlResetLastError();
30815         if (mem_base != xmlMemBlocks()) {
30816             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
30817                    xmlMemBlocks() - mem_base);
30818             test_ret++;
30819             printf(" %d", n_URI);
30820             printf("\n");
30821         }
30822     }
30823     function_tests++;
30824 #endif
30825
30826     return(test_ret);
30827 }
30828
30829
30830 static int
30831 test_xmlReaderForDoc(void) {
30832     int test_ret = 0;
30833
30834 #if defined(LIBXML_READER_ENABLED)
30835     int mem_base;
30836     xmlTextReaderPtr ret_val;
30837     xmlChar * cur; /* a pointer to a zero terminated string */
30838     int n_cur;
30839     const char * URL; /* the base URL to use for the document */
30840     int n_URL;
30841     char * encoding; /* the document encoding, or NULL */
30842     int n_encoding;
30843     int options; /* a combination of xmlParserOption */
30844     int n_options;
30845
30846     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30847     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30848     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30849     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30850         mem_base = xmlMemBlocks();
30851         cur = gen_const_xmlChar_ptr(n_cur, 0);
30852         URL = gen_filepath(n_URL, 1);
30853         encoding = gen_const_char_ptr(n_encoding, 2);
30854         options = gen_parseroptions(n_options, 3);
30855
30856         ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
30857         desret_xmlTextReaderPtr(ret_val);
30858         call_tests++;
30859         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
30860         des_filepath(n_URL, URL, 1);
30861         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30862         des_parseroptions(n_options, options, 3);
30863         xmlResetLastError();
30864         if (mem_base != xmlMemBlocks()) {
30865             printf("Leak of %d blocks found in xmlReaderForDoc",
30866                    xmlMemBlocks() - mem_base);
30867             test_ret++;
30868             printf(" %d", n_cur);
30869             printf(" %d", n_URL);
30870             printf(" %d", n_encoding);
30871             printf(" %d", n_options);
30872             printf("\n");
30873         }
30874     }
30875     }
30876     }
30877     }
30878     function_tests++;
30879 #endif
30880
30881     return(test_ret);
30882 }
30883
30884
30885 static int
30886 test_xmlReaderForFile(void) {
30887     int test_ret = 0;
30888
30889 #if defined(LIBXML_READER_ENABLED)
30890     int mem_base;
30891     xmlTextReaderPtr ret_val;
30892     const char * filename; /* a file or URL */
30893     int n_filename;
30894     char * encoding; /* the document encoding, or NULL */
30895     int n_encoding;
30896     int options; /* a combination of xmlParserOption */
30897     int n_options;
30898
30899     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30900     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30901     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30902         mem_base = xmlMemBlocks();
30903         filename = gen_filepath(n_filename, 0);
30904         encoding = gen_const_char_ptr(n_encoding, 1);
30905         options = gen_parseroptions(n_options, 2);
30906
30907         ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
30908         desret_xmlTextReaderPtr(ret_val);
30909         call_tests++;
30910         des_filepath(n_filename, filename, 0);
30911         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
30912         des_parseroptions(n_options, options, 2);
30913         xmlResetLastError();
30914         if (mem_base != xmlMemBlocks()) {
30915             printf("Leak of %d blocks found in xmlReaderForFile",
30916                    xmlMemBlocks() - mem_base);
30917             test_ret++;
30918             printf(" %d", n_filename);
30919             printf(" %d", n_encoding);
30920             printf(" %d", n_options);
30921             printf("\n");
30922         }
30923     }
30924     }
30925     }
30926     function_tests++;
30927 #endif
30928
30929     return(test_ret);
30930 }
30931
30932
30933 static int
30934 test_xmlReaderForMemory(void) {
30935     int test_ret = 0;
30936
30937 #if defined(LIBXML_READER_ENABLED)
30938     int mem_base;
30939     xmlTextReaderPtr ret_val;
30940     char * buffer; /* a pointer to a char array */
30941     int n_buffer;
30942     int size; /* the size of the array */
30943     int n_size;
30944     const char * URL; /* the base URL to use for the document */
30945     int n_URL;
30946     char * encoding; /* the document encoding, or NULL */
30947     int n_encoding;
30948     int options; /* a combination of xmlParserOption */
30949     int n_options;
30950
30951     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30952     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30953     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30954     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30955     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30956         mem_base = xmlMemBlocks();
30957         buffer = gen_const_char_ptr(n_buffer, 0);
30958         size = gen_int(n_size, 1);
30959         URL = gen_filepath(n_URL, 2);
30960         encoding = gen_const_char_ptr(n_encoding, 3);
30961         options = gen_parseroptions(n_options, 4);
30962
30963         ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
30964         desret_xmlTextReaderPtr(ret_val);
30965         call_tests++;
30966         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
30967         des_int(n_size, size, 1);
30968         des_filepath(n_URL, URL, 2);
30969         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30970         des_parseroptions(n_options, options, 4);
30971         xmlResetLastError();
30972         if (mem_base != xmlMemBlocks()) {
30973             printf("Leak of %d blocks found in xmlReaderForMemory",
30974                    xmlMemBlocks() - mem_base);
30975             test_ret++;
30976             printf(" %d", n_buffer);
30977             printf(" %d", n_size);
30978             printf(" %d", n_URL);
30979             printf(" %d", n_encoding);
30980             printf(" %d", n_options);
30981             printf("\n");
30982         }
30983     }
30984     }
30985     }
30986     }
30987     }
30988     function_tests++;
30989 #endif
30990
30991     return(test_ret);
30992 }
30993
30994
30995 static int
30996 test_xmlReaderNewDoc(void) {
30997     int test_ret = 0;
30998
30999 #if defined(LIBXML_READER_ENABLED)
31000     int mem_base;
31001     int ret_val;
31002     xmlTextReaderPtr reader; /* an XML reader */
31003     int n_reader;
31004     xmlChar * cur; /* a pointer to a zero terminated string */
31005     int n_cur;
31006     const char * URL; /* the base URL to use for the document */
31007     int n_URL;
31008     char * encoding; /* the document encoding, or NULL */
31009     int n_encoding;
31010     int options; /* a combination of xmlParserOption */
31011     int n_options;
31012
31013     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31014     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
31015     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
31016     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
31017     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
31018         mem_base = xmlMemBlocks();
31019         reader = gen_xmlTextReaderPtr(n_reader, 0);
31020         cur = gen_const_xmlChar_ptr(n_cur, 1);
31021         URL = gen_filepath(n_URL, 2);
31022         encoding = gen_const_char_ptr(n_encoding, 3);
31023         options = gen_parseroptions(n_options, 4);
31024
31025         ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
31026         desret_int(ret_val);
31027         call_tests++;
31028         des_xmlTextReaderPtr(n_reader, reader, 0);
31029         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
31030         des_filepath(n_URL, URL, 2);
31031         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
31032         des_parseroptions(n_options, options, 4);
31033         xmlResetLastError();
31034         if (mem_base != xmlMemBlocks()) {
31035             printf("Leak of %d blocks found in xmlReaderNewDoc",
31036                    xmlMemBlocks() - mem_base);
31037             test_ret++;
31038             printf(" %d", n_reader);
31039             printf(" %d", n_cur);
31040             printf(" %d", n_URL);
31041             printf(" %d", n_encoding);
31042             printf(" %d", n_options);
31043             printf("\n");
31044         }
31045     }
31046     }
31047     }
31048     }
31049     }
31050     function_tests++;
31051 #endif
31052
31053     return(test_ret);
31054 }
31055
31056
31057 static int
31058 test_xmlReaderNewFile(void) {
31059     int test_ret = 0;
31060
31061 #if defined(LIBXML_READER_ENABLED)
31062     int mem_base;
31063     int ret_val;
31064     xmlTextReaderPtr reader; /* an XML reader */
31065     int n_reader;
31066     const char * filename; /* a file or URL */
31067     int n_filename;
31068     char * encoding; /* the document encoding, or NULL */
31069     int n_encoding;
31070     int options; /* a combination of xmlParserOption */
31071     int n_options;
31072
31073     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31074     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
31075     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
31076     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
31077         mem_base = xmlMemBlocks();
31078         reader = gen_xmlTextReaderPtr(n_reader, 0);
31079         filename = gen_filepath(n_filename, 1);
31080         encoding = gen_const_char_ptr(n_encoding, 2);
31081         options = gen_parseroptions(n_options, 3);
31082
31083         ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
31084         desret_int(ret_val);
31085         call_tests++;
31086         des_xmlTextReaderPtr(n_reader, reader, 0);
31087         des_filepath(n_filename, filename, 1);
31088         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
31089         des_parseroptions(n_options, options, 3);
31090         xmlResetLastError();
31091         if (mem_base != xmlMemBlocks()) {
31092             printf("Leak of %d blocks found in xmlReaderNewFile",
31093                    xmlMemBlocks() - mem_base);
31094             test_ret++;
31095             printf(" %d", n_reader);
31096             printf(" %d", n_filename);
31097             printf(" %d", n_encoding);
31098             printf(" %d", n_options);
31099             printf("\n");
31100         }
31101     }
31102     }
31103     }
31104     }
31105     function_tests++;
31106 #endif
31107
31108     return(test_ret);
31109 }
31110
31111
31112 static int
31113 test_xmlReaderNewMemory(void) {
31114     int test_ret = 0;
31115
31116 #if defined(LIBXML_READER_ENABLED)
31117     int mem_base;
31118     int ret_val;
31119     xmlTextReaderPtr reader; /* an XML reader */
31120     int n_reader;
31121     char * buffer; /* a pointer to a char array */
31122     int n_buffer;
31123     int size; /* the size of the array */
31124     int n_size;
31125     const char * URL; /* the base URL to use for the document */
31126     int n_URL;
31127     char * encoding; /* the document encoding, or NULL */
31128     int n_encoding;
31129     int options; /* a combination of xmlParserOption */
31130     int n_options;
31131
31132     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31133     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
31134     for (n_size = 0;n_size < gen_nb_int;n_size++) {
31135     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
31136     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
31137     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
31138         mem_base = xmlMemBlocks();
31139         reader = gen_xmlTextReaderPtr(n_reader, 0);
31140         buffer = gen_const_char_ptr(n_buffer, 1);
31141         size = gen_int(n_size, 2);
31142         URL = gen_filepath(n_URL, 3);
31143         encoding = gen_const_char_ptr(n_encoding, 4);
31144         options = gen_parseroptions(n_options, 5);
31145
31146         ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
31147         desret_int(ret_val);
31148         call_tests++;
31149         des_xmlTextReaderPtr(n_reader, reader, 0);
31150         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
31151         des_int(n_size, size, 2);
31152         des_filepath(n_URL, URL, 3);
31153         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
31154         des_parseroptions(n_options, options, 5);
31155         xmlResetLastError();
31156         if (mem_base != xmlMemBlocks()) {
31157             printf("Leak of %d blocks found in xmlReaderNewMemory",
31158                    xmlMemBlocks() - mem_base);
31159             test_ret++;
31160             printf(" %d", n_reader);
31161             printf(" %d", n_buffer);
31162             printf(" %d", n_size);
31163             printf(" %d", n_URL);
31164             printf(" %d", n_encoding);
31165             printf(" %d", n_options);
31166             printf("\n");
31167         }
31168     }
31169     }
31170     }
31171     }
31172     }
31173     }
31174     function_tests++;
31175 #endif
31176
31177     return(test_ret);
31178 }
31179
31180
31181 static int
31182 test_xmlReaderNewWalker(void) {
31183     int test_ret = 0;
31184
31185 #if defined(LIBXML_READER_ENABLED)
31186     int mem_base;
31187     int ret_val;
31188     xmlTextReaderPtr reader; /* an XML reader */
31189     int n_reader;
31190     xmlDocPtr doc; /* a preparsed document */
31191     int n_doc;
31192
31193     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31194     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31195         mem_base = xmlMemBlocks();
31196         reader = gen_xmlTextReaderPtr(n_reader, 0);
31197         doc = gen_xmlDocPtr(n_doc, 1);
31198
31199         ret_val = xmlReaderNewWalker(reader, doc);
31200         desret_int(ret_val);
31201         call_tests++;
31202         des_xmlTextReaderPtr(n_reader, reader, 0);
31203         des_xmlDocPtr(n_doc, doc, 1);
31204         xmlResetLastError();
31205         if (mem_base != xmlMemBlocks()) {
31206             printf("Leak of %d blocks found in xmlReaderNewWalker",
31207                    xmlMemBlocks() - mem_base);
31208             test_ret++;
31209             printf(" %d", n_reader);
31210             printf(" %d", n_doc);
31211             printf("\n");
31212         }
31213     }
31214     }
31215     function_tests++;
31216 #endif
31217
31218     return(test_ret);
31219 }
31220
31221
31222 static int
31223 test_xmlReaderWalker(void) {
31224     int test_ret = 0;
31225
31226 #if defined(LIBXML_READER_ENABLED)
31227     int mem_base;
31228     xmlTextReaderPtr ret_val;
31229     xmlDocPtr doc; /* a preparsed document */
31230     int n_doc;
31231
31232     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31233         mem_base = xmlMemBlocks();
31234         doc = gen_xmlDocPtr(n_doc, 0);
31235
31236         ret_val = xmlReaderWalker(doc);
31237         desret_xmlTextReaderPtr(ret_val);
31238         call_tests++;
31239         des_xmlDocPtr(n_doc, doc, 0);
31240         xmlResetLastError();
31241         if (mem_base != xmlMemBlocks()) {
31242             printf("Leak of %d blocks found in xmlReaderWalker",
31243                    xmlMemBlocks() - mem_base);
31244             test_ret++;
31245             printf(" %d", n_doc);
31246             printf("\n");
31247         }
31248     }
31249     function_tests++;
31250 #endif
31251
31252     return(test_ret);
31253 }
31254
31255
31256 static int
31257 test_xmlTextReaderAttributeCount(void) {
31258     int test_ret = 0;
31259
31260 #if defined(LIBXML_READER_ENABLED)
31261     int mem_base;
31262     int ret_val;
31263     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31264     int n_reader;
31265
31266     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31267         mem_base = xmlMemBlocks();
31268         reader = gen_xmlTextReaderPtr(n_reader, 0);
31269
31270         ret_val = xmlTextReaderAttributeCount(reader);
31271         desret_int(ret_val);
31272         call_tests++;
31273         des_xmlTextReaderPtr(n_reader, reader, 0);
31274         xmlResetLastError();
31275         if (mem_base != xmlMemBlocks()) {
31276             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
31277                    xmlMemBlocks() - mem_base);
31278             test_ret++;
31279             printf(" %d", n_reader);
31280             printf("\n");
31281         }
31282     }
31283     function_tests++;
31284 #endif
31285
31286     return(test_ret);
31287 }
31288
31289
31290 static int
31291 test_xmlTextReaderBaseUri(void) {
31292     int test_ret = 0;
31293
31294 #if defined(LIBXML_READER_ENABLED)
31295     int mem_base;
31296     xmlChar * ret_val;
31297     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31298     int n_reader;
31299
31300     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31301         mem_base = xmlMemBlocks();
31302         reader = gen_xmlTextReaderPtr(n_reader, 0);
31303
31304         ret_val = xmlTextReaderBaseUri(reader);
31305         desret_xmlChar_ptr(ret_val);
31306         call_tests++;
31307         des_xmlTextReaderPtr(n_reader, reader, 0);
31308         xmlResetLastError();
31309         if (mem_base != xmlMemBlocks()) {
31310             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
31311                    xmlMemBlocks() - mem_base);
31312             test_ret++;
31313             printf(" %d", n_reader);
31314             printf("\n");
31315         }
31316     }
31317     function_tests++;
31318 #endif
31319
31320     return(test_ret);
31321 }
31322
31323
31324 static int
31325 test_xmlTextReaderByteConsumed(void) {
31326     int test_ret = 0;
31327
31328 #if defined(LIBXML_READER_ENABLED)
31329     int mem_base;
31330     long ret_val;
31331     xmlTextReaderPtr reader; /* an XML reader */
31332     int n_reader;
31333
31334     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31335         mem_base = xmlMemBlocks();
31336         reader = gen_xmlTextReaderPtr(n_reader, 0);
31337
31338         ret_val = xmlTextReaderByteConsumed(reader);
31339         desret_long(ret_val);
31340         call_tests++;
31341         des_xmlTextReaderPtr(n_reader, reader, 0);
31342         xmlResetLastError();
31343         if (mem_base != xmlMemBlocks()) {
31344             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
31345                    xmlMemBlocks() - mem_base);
31346             test_ret++;
31347             printf(" %d", n_reader);
31348             printf("\n");
31349         }
31350     }
31351     function_tests++;
31352 #endif
31353
31354     return(test_ret);
31355 }
31356
31357
31358 static int
31359 test_xmlTextReaderClose(void) {
31360     int test_ret = 0;
31361
31362 #if defined(LIBXML_READER_ENABLED)
31363     int mem_base;
31364     int ret_val;
31365     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31366     int n_reader;
31367
31368     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31369         mem_base = xmlMemBlocks();
31370         reader = gen_xmlTextReaderPtr(n_reader, 0);
31371
31372         ret_val = xmlTextReaderClose(reader);
31373         desret_int(ret_val);
31374         call_tests++;
31375         des_xmlTextReaderPtr(n_reader, reader, 0);
31376         xmlResetLastError();
31377         if (mem_base != xmlMemBlocks()) {
31378             printf("Leak of %d blocks found in xmlTextReaderClose",
31379                    xmlMemBlocks() - mem_base);
31380             test_ret++;
31381             printf(" %d", n_reader);
31382             printf("\n");
31383         }
31384     }
31385     function_tests++;
31386 #endif
31387
31388     return(test_ret);
31389 }
31390
31391
31392 static int
31393 test_xmlTextReaderConstBaseUri(void) {
31394     int test_ret = 0;
31395
31396 #if defined(LIBXML_READER_ENABLED)
31397     int mem_base;
31398     const xmlChar * ret_val;
31399     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31400     int n_reader;
31401
31402     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31403         mem_base = xmlMemBlocks();
31404         reader = gen_xmlTextReaderPtr(n_reader, 0);
31405
31406         ret_val = xmlTextReaderConstBaseUri(reader);
31407         desret_const_xmlChar_ptr(ret_val);
31408         call_tests++;
31409         des_xmlTextReaderPtr(n_reader, reader, 0);
31410         xmlResetLastError();
31411         if (mem_base != xmlMemBlocks()) {
31412             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
31413                    xmlMemBlocks() - mem_base);
31414             test_ret++;
31415             printf(" %d", n_reader);
31416             printf("\n");
31417         }
31418     }
31419     function_tests++;
31420 #endif
31421
31422     return(test_ret);
31423 }
31424
31425
31426 static int
31427 test_xmlTextReaderConstEncoding(void) {
31428     int test_ret = 0;
31429
31430 #if defined(LIBXML_READER_ENABLED)
31431     int mem_base;
31432     const xmlChar * ret_val;
31433     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31434     int n_reader;
31435
31436     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31437         mem_base = xmlMemBlocks();
31438         reader = gen_xmlTextReaderPtr(n_reader, 0);
31439
31440         ret_val = xmlTextReaderConstEncoding(reader);
31441         desret_const_xmlChar_ptr(ret_val);
31442         call_tests++;
31443         des_xmlTextReaderPtr(n_reader, reader, 0);
31444         xmlResetLastError();
31445         if (mem_base != xmlMemBlocks()) {
31446             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
31447                    xmlMemBlocks() - mem_base);
31448             test_ret++;
31449             printf(" %d", n_reader);
31450             printf("\n");
31451         }
31452     }
31453     function_tests++;
31454 #endif
31455
31456     return(test_ret);
31457 }
31458
31459
31460 static int
31461 test_xmlTextReaderConstLocalName(void) {
31462     int test_ret = 0;
31463
31464 #if defined(LIBXML_READER_ENABLED)
31465     int mem_base;
31466     const xmlChar * ret_val;
31467     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31468     int n_reader;
31469
31470     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31471         mem_base = xmlMemBlocks();
31472         reader = gen_xmlTextReaderPtr(n_reader, 0);
31473
31474         ret_val = xmlTextReaderConstLocalName(reader);
31475         desret_const_xmlChar_ptr(ret_val);
31476         call_tests++;
31477         des_xmlTextReaderPtr(n_reader, reader, 0);
31478         xmlResetLastError();
31479         if (mem_base != xmlMemBlocks()) {
31480             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
31481                    xmlMemBlocks() - mem_base);
31482             test_ret++;
31483             printf(" %d", n_reader);
31484             printf("\n");
31485         }
31486     }
31487     function_tests++;
31488 #endif
31489
31490     return(test_ret);
31491 }
31492
31493
31494 static int
31495 test_xmlTextReaderConstName(void) {
31496     int test_ret = 0;
31497
31498 #if defined(LIBXML_READER_ENABLED)
31499     int mem_base;
31500     const xmlChar * ret_val;
31501     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31502     int n_reader;
31503
31504     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31505         mem_base = xmlMemBlocks();
31506         reader = gen_xmlTextReaderPtr(n_reader, 0);
31507
31508         ret_val = xmlTextReaderConstName(reader);
31509         desret_const_xmlChar_ptr(ret_val);
31510         call_tests++;
31511         des_xmlTextReaderPtr(n_reader, reader, 0);
31512         xmlResetLastError();
31513         if (mem_base != xmlMemBlocks()) {
31514             printf("Leak of %d blocks found in xmlTextReaderConstName",
31515                    xmlMemBlocks() - mem_base);
31516             test_ret++;
31517             printf(" %d", n_reader);
31518             printf("\n");
31519         }
31520     }
31521     function_tests++;
31522 #endif
31523
31524     return(test_ret);
31525 }
31526
31527
31528 static int
31529 test_xmlTextReaderConstNamespaceUri(void) {
31530     int test_ret = 0;
31531
31532 #if defined(LIBXML_READER_ENABLED)
31533     int mem_base;
31534     const xmlChar * ret_val;
31535     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31536     int n_reader;
31537
31538     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31539         mem_base = xmlMemBlocks();
31540         reader = gen_xmlTextReaderPtr(n_reader, 0);
31541
31542         ret_val = xmlTextReaderConstNamespaceUri(reader);
31543         desret_const_xmlChar_ptr(ret_val);
31544         call_tests++;
31545         des_xmlTextReaderPtr(n_reader, reader, 0);
31546         xmlResetLastError();
31547         if (mem_base != xmlMemBlocks()) {
31548             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
31549                    xmlMemBlocks() - mem_base);
31550             test_ret++;
31551             printf(" %d", n_reader);
31552             printf("\n");
31553         }
31554     }
31555     function_tests++;
31556 #endif
31557
31558     return(test_ret);
31559 }
31560
31561
31562 static int
31563 test_xmlTextReaderConstPrefix(void) {
31564     int test_ret = 0;
31565
31566 #if defined(LIBXML_READER_ENABLED)
31567     int mem_base;
31568     const xmlChar * ret_val;
31569     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31570     int n_reader;
31571
31572     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31573         mem_base = xmlMemBlocks();
31574         reader = gen_xmlTextReaderPtr(n_reader, 0);
31575
31576         ret_val = xmlTextReaderConstPrefix(reader);
31577         desret_const_xmlChar_ptr(ret_val);
31578         call_tests++;
31579         des_xmlTextReaderPtr(n_reader, reader, 0);
31580         xmlResetLastError();
31581         if (mem_base != xmlMemBlocks()) {
31582             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
31583                    xmlMemBlocks() - mem_base);
31584             test_ret++;
31585             printf(" %d", n_reader);
31586             printf("\n");
31587         }
31588     }
31589     function_tests++;
31590 #endif
31591
31592     return(test_ret);
31593 }
31594
31595
31596 static int
31597 test_xmlTextReaderConstString(void) {
31598     int test_ret = 0;
31599
31600 #if defined(LIBXML_READER_ENABLED)
31601     int mem_base;
31602     const xmlChar * ret_val;
31603     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31604     int n_reader;
31605     xmlChar * str; /* the string to intern. */
31606     int n_str;
31607
31608     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31609     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
31610         mem_base = xmlMemBlocks();
31611         reader = gen_xmlTextReaderPtr(n_reader, 0);
31612         str = gen_const_xmlChar_ptr(n_str, 1);
31613
31614         ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
31615         desret_const_xmlChar_ptr(ret_val);
31616         call_tests++;
31617         des_xmlTextReaderPtr(n_reader, reader, 0);
31618         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
31619         xmlResetLastError();
31620         if (mem_base != xmlMemBlocks()) {
31621             printf("Leak of %d blocks found in xmlTextReaderConstString",
31622                    xmlMemBlocks() - mem_base);
31623             test_ret++;
31624             printf(" %d", n_reader);
31625             printf(" %d", n_str);
31626             printf("\n");
31627         }
31628     }
31629     }
31630     function_tests++;
31631 #endif
31632
31633     return(test_ret);
31634 }
31635
31636
31637 static int
31638 test_xmlTextReaderConstValue(void) {
31639     int test_ret = 0;
31640
31641 #if defined(LIBXML_READER_ENABLED)
31642     int mem_base;
31643     const xmlChar * ret_val;
31644     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31645     int n_reader;
31646
31647     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31648         mem_base = xmlMemBlocks();
31649         reader = gen_xmlTextReaderPtr(n_reader, 0);
31650
31651         ret_val = xmlTextReaderConstValue(reader);
31652         desret_const_xmlChar_ptr(ret_val);
31653         call_tests++;
31654         des_xmlTextReaderPtr(n_reader, reader, 0);
31655         xmlResetLastError();
31656         if (mem_base != xmlMemBlocks()) {
31657             printf("Leak of %d blocks found in xmlTextReaderConstValue",
31658                    xmlMemBlocks() - mem_base);
31659             test_ret++;
31660             printf(" %d", n_reader);
31661             printf("\n");
31662         }
31663     }
31664     function_tests++;
31665 #endif
31666
31667     return(test_ret);
31668 }
31669
31670
31671 static int
31672 test_xmlTextReaderConstXmlLang(void) {
31673     int test_ret = 0;
31674
31675 #if defined(LIBXML_READER_ENABLED)
31676     int mem_base;
31677     const xmlChar * ret_val;
31678     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31679     int n_reader;
31680
31681     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31682         mem_base = xmlMemBlocks();
31683         reader = gen_xmlTextReaderPtr(n_reader, 0);
31684
31685         ret_val = xmlTextReaderConstXmlLang(reader);
31686         desret_const_xmlChar_ptr(ret_val);
31687         call_tests++;
31688         des_xmlTextReaderPtr(n_reader, reader, 0);
31689         xmlResetLastError();
31690         if (mem_base != xmlMemBlocks()) {
31691             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
31692                    xmlMemBlocks() - mem_base);
31693             test_ret++;
31694             printf(" %d", n_reader);
31695             printf("\n");
31696         }
31697     }
31698     function_tests++;
31699 #endif
31700
31701     return(test_ret);
31702 }
31703
31704
31705 static int
31706 test_xmlTextReaderConstXmlVersion(void) {
31707     int test_ret = 0;
31708
31709 #if defined(LIBXML_READER_ENABLED)
31710     int mem_base;
31711     const xmlChar * ret_val;
31712     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31713     int n_reader;
31714
31715     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31716         mem_base = xmlMemBlocks();
31717         reader = gen_xmlTextReaderPtr(n_reader, 0);
31718
31719         ret_val = xmlTextReaderConstXmlVersion(reader);
31720         desret_const_xmlChar_ptr(ret_val);
31721         call_tests++;
31722         des_xmlTextReaderPtr(n_reader, reader, 0);
31723         xmlResetLastError();
31724         if (mem_base != xmlMemBlocks()) {
31725             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
31726                    xmlMemBlocks() - mem_base);
31727             test_ret++;
31728             printf(" %d", n_reader);
31729             printf("\n");
31730         }
31731     }
31732     function_tests++;
31733 #endif
31734
31735     return(test_ret);
31736 }
31737
31738
31739 static int
31740 test_xmlTextReaderCurrentDoc(void) {
31741     int test_ret = 0;
31742
31743 #if defined(LIBXML_READER_ENABLED)
31744     int mem_base;
31745     xmlDocPtr ret_val;
31746     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31747     int n_reader;
31748
31749     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31750         mem_base = xmlMemBlocks();
31751         reader = gen_xmlTextReaderPtr(n_reader, 0);
31752
31753         ret_val = xmlTextReaderCurrentDoc(reader);
31754         desret_xmlDocPtr(ret_val);
31755         call_tests++;
31756         des_xmlTextReaderPtr(n_reader, reader, 0);
31757         xmlResetLastError();
31758         if (mem_base != xmlMemBlocks()) {
31759             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
31760                    xmlMemBlocks() - mem_base);
31761             test_ret++;
31762             printf(" %d", n_reader);
31763             printf("\n");
31764         }
31765     }
31766     function_tests++;
31767 #endif
31768
31769     return(test_ret);
31770 }
31771
31772
31773 static int
31774 test_xmlTextReaderCurrentNode(void) {
31775     int test_ret = 0;
31776
31777 #if defined(LIBXML_READER_ENABLED)
31778     int mem_base;
31779     xmlNodePtr ret_val;
31780     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31781     int n_reader;
31782
31783     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31784         mem_base = xmlMemBlocks();
31785         reader = gen_xmlTextReaderPtr(n_reader, 0);
31786
31787         ret_val = xmlTextReaderCurrentNode(reader);
31788         desret_xmlNodePtr(ret_val);
31789         call_tests++;
31790         des_xmlTextReaderPtr(n_reader, reader, 0);
31791         xmlResetLastError();
31792         if (mem_base != xmlMemBlocks()) {
31793             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
31794                    xmlMemBlocks() - mem_base);
31795             test_ret++;
31796             printf(" %d", n_reader);
31797             printf("\n");
31798         }
31799     }
31800     function_tests++;
31801 #endif
31802
31803     return(test_ret);
31804 }
31805
31806
31807 static int
31808 test_xmlTextReaderDepth(void) {
31809     int test_ret = 0;
31810
31811 #if defined(LIBXML_READER_ENABLED)
31812     int mem_base;
31813     int ret_val;
31814     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31815     int n_reader;
31816
31817     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31818         mem_base = xmlMemBlocks();
31819         reader = gen_xmlTextReaderPtr(n_reader, 0);
31820
31821         ret_val = xmlTextReaderDepth(reader);
31822         desret_int(ret_val);
31823         call_tests++;
31824         des_xmlTextReaderPtr(n_reader, reader, 0);
31825         xmlResetLastError();
31826         if (mem_base != xmlMemBlocks()) {
31827             printf("Leak of %d blocks found in xmlTextReaderDepth",
31828                    xmlMemBlocks() - mem_base);
31829             test_ret++;
31830             printf(" %d", n_reader);
31831             printf("\n");
31832         }
31833     }
31834     function_tests++;
31835 #endif
31836
31837     return(test_ret);
31838 }
31839
31840
31841 static int
31842 test_xmlTextReaderExpand(void) {
31843     int test_ret = 0;
31844
31845 #if defined(LIBXML_READER_ENABLED)
31846     int mem_base;
31847     xmlNodePtr ret_val;
31848     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31849     int n_reader;
31850
31851     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31852         mem_base = xmlMemBlocks();
31853         reader = gen_xmlTextReaderPtr(n_reader, 0);
31854
31855         ret_val = xmlTextReaderExpand(reader);
31856         desret_xmlNodePtr(ret_val);
31857         call_tests++;
31858         des_xmlTextReaderPtr(n_reader, reader, 0);
31859         xmlResetLastError();
31860         if (mem_base != xmlMemBlocks()) {
31861             printf("Leak of %d blocks found in xmlTextReaderExpand",
31862                    xmlMemBlocks() - mem_base);
31863             test_ret++;
31864             printf(" %d", n_reader);
31865             printf("\n");
31866         }
31867     }
31868     function_tests++;
31869 #endif
31870
31871     return(test_ret);
31872 }
31873
31874
31875 static int
31876 test_xmlTextReaderGetAttribute(void) {
31877     int test_ret = 0;
31878
31879 #if defined(LIBXML_READER_ENABLED)
31880     int mem_base;
31881     xmlChar * ret_val;
31882     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31883     int n_reader;
31884     xmlChar * name; /* the qualified name of the attribute. */
31885     int n_name;
31886
31887     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31888     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31889         mem_base = xmlMemBlocks();
31890         reader = gen_xmlTextReaderPtr(n_reader, 0);
31891         name = gen_const_xmlChar_ptr(n_name, 1);
31892
31893         ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
31894         desret_xmlChar_ptr(ret_val);
31895         call_tests++;
31896         des_xmlTextReaderPtr(n_reader, reader, 0);
31897         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31898         xmlResetLastError();
31899         if (mem_base != xmlMemBlocks()) {
31900             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
31901                    xmlMemBlocks() - mem_base);
31902             test_ret++;
31903             printf(" %d", n_reader);
31904             printf(" %d", n_name);
31905             printf("\n");
31906         }
31907     }
31908     }
31909     function_tests++;
31910 #endif
31911
31912     return(test_ret);
31913 }
31914
31915
31916 static int
31917 test_xmlTextReaderGetAttributeNo(void) {
31918     int test_ret = 0;
31919
31920 #if defined(LIBXML_READER_ENABLED)
31921     int mem_base;
31922     xmlChar * ret_val;
31923     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31924     int n_reader;
31925     int no; /* the zero-based index of the attribute relative to the containing element */
31926     int n_no;
31927
31928     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31929     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31930         mem_base = xmlMemBlocks();
31931         reader = gen_xmlTextReaderPtr(n_reader, 0);
31932         no = gen_int(n_no, 1);
31933
31934         ret_val = xmlTextReaderGetAttributeNo(reader, no);
31935         desret_xmlChar_ptr(ret_val);
31936         call_tests++;
31937         des_xmlTextReaderPtr(n_reader, reader, 0);
31938         des_int(n_no, no, 1);
31939         xmlResetLastError();
31940         if (mem_base != xmlMemBlocks()) {
31941             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
31942                    xmlMemBlocks() - mem_base);
31943             test_ret++;
31944             printf(" %d", n_reader);
31945             printf(" %d", n_no);
31946             printf("\n");
31947         }
31948     }
31949     }
31950     function_tests++;
31951 #endif
31952
31953     return(test_ret);
31954 }
31955
31956
31957 static int
31958 test_xmlTextReaderGetAttributeNs(void) {
31959     int test_ret = 0;
31960
31961 #if defined(LIBXML_READER_ENABLED)
31962     int mem_base;
31963     xmlChar * ret_val;
31964     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31965     int n_reader;
31966     xmlChar * localName; /* the local name of the attribute. */
31967     int n_localName;
31968     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31969     int n_namespaceURI;
31970
31971     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31972     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31973     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31974         mem_base = xmlMemBlocks();
31975         reader = gen_xmlTextReaderPtr(n_reader, 0);
31976         localName = gen_const_xmlChar_ptr(n_localName, 1);
31977         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31978
31979         ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31980         desret_xmlChar_ptr(ret_val);
31981         call_tests++;
31982         des_xmlTextReaderPtr(n_reader, reader, 0);
31983         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31984         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31985         xmlResetLastError();
31986         if (mem_base != xmlMemBlocks()) {
31987             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
31988                    xmlMemBlocks() - mem_base);
31989             test_ret++;
31990             printf(" %d", n_reader);
31991             printf(" %d", n_localName);
31992             printf(" %d", n_namespaceURI);
31993             printf("\n");
31994         }
31995     }
31996     }
31997     }
31998     function_tests++;
31999 #endif
32000
32001     return(test_ret);
32002 }
32003
32004 #ifdef LIBXML_READER_ENABLED
32005
32006 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
32007 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32008     return(NULL);
32009 }
32010 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32011 }
32012 #endif
32013
32014
32015 static int
32016 test_xmlTextReaderGetErrorHandler(void) {
32017     int test_ret = 0;
32018
32019 #if defined(LIBXML_READER_ENABLED)
32020     int mem_base;
32021     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32022     int n_reader;
32023     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
32024     int n_f;
32025     void ** arg; /* a user argument */
32026     int n_arg;
32027
32028     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32029     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
32030     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
32031         mem_base = xmlMemBlocks();
32032         reader = gen_xmlTextReaderPtr(n_reader, 0);
32033         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
32034         arg = gen_void_ptr_ptr(n_arg, 2);
32035
32036         xmlTextReaderGetErrorHandler(reader, f, arg);
32037         call_tests++;
32038         des_xmlTextReaderPtr(n_reader, reader, 0);
32039         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
32040         des_void_ptr_ptr(n_arg, arg, 2);
32041         xmlResetLastError();
32042         if (mem_base != xmlMemBlocks()) {
32043             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
32044                    xmlMemBlocks() - mem_base);
32045             test_ret++;
32046             printf(" %d", n_reader);
32047             printf(" %d", n_f);
32048             printf(" %d", n_arg);
32049             printf("\n");
32050         }
32051     }
32052     }
32053     }
32054     function_tests++;
32055 #endif
32056
32057     return(test_ret);
32058 }
32059
32060
32061 static int
32062 test_xmlTextReaderGetParserColumnNumber(void) {
32063     int test_ret = 0;
32064
32065 #if defined(LIBXML_READER_ENABLED)
32066     int mem_base;
32067     int ret_val;
32068     xmlTextReaderPtr reader; /* the user data (XML reader context) */
32069     int n_reader;
32070
32071     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32072         mem_base = xmlMemBlocks();
32073         reader = gen_xmlTextReaderPtr(n_reader, 0);
32074
32075         ret_val = xmlTextReaderGetParserColumnNumber(reader);
32076         desret_int(ret_val);
32077         call_tests++;
32078         des_xmlTextReaderPtr(n_reader, reader, 0);
32079         xmlResetLastError();
32080         if (mem_base != xmlMemBlocks()) {
32081             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
32082                    xmlMemBlocks() - mem_base);
32083             test_ret++;
32084             printf(" %d", n_reader);
32085             printf("\n");
32086         }
32087     }
32088     function_tests++;
32089 #endif
32090
32091     return(test_ret);
32092 }
32093
32094
32095 static int
32096 test_xmlTextReaderGetParserLineNumber(void) {
32097     int test_ret = 0;
32098
32099 #if defined(LIBXML_READER_ENABLED)
32100     int mem_base;
32101     int ret_val;
32102     xmlTextReaderPtr reader; /* the user data (XML reader context) */
32103     int n_reader;
32104
32105     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32106         mem_base = xmlMemBlocks();
32107         reader = gen_xmlTextReaderPtr(n_reader, 0);
32108
32109         ret_val = xmlTextReaderGetParserLineNumber(reader);
32110         desret_int(ret_val);
32111         call_tests++;
32112         des_xmlTextReaderPtr(n_reader, reader, 0);
32113         xmlResetLastError();
32114         if (mem_base != xmlMemBlocks()) {
32115             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
32116                    xmlMemBlocks() - mem_base);
32117             test_ret++;
32118             printf(" %d", n_reader);
32119             printf("\n");
32120         }
32121     }
32122     function_tests++;
32123 #endif
32124
32125     return(test_ret);
32126 }
32127
32128
32129 static int
32130 test_xmlTextReaderGetParserProp(void) {
32131     int test_ret = 0;
32132
32133 #if defined(LIBXML_READER_ENABLED)
32134     int mem_base;
32135     int ret_val;
32136     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32137     int n_reader;
32138     int prop; /* the xmlParserProperties to get */
32139     int n_prop;
32140
32141     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32142     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32143         mem_base = xmlMemBlocks();
32144         reader = gen_xmlTextReaderPtr(n_reader, 0);
32145         prop = gen_int(n_prop, 1);
32146
32147         ret_val = xmlTextReaderGetParserProp(reader, prop);
32148         desret_int(ret_val);
32149         call_tests++;
32150         des_xmlTextReaderPtr(n_reader, reader, 0);
32151         des_int(n_prop, prop, 1);
32152         xmlResetLastError();
32153         if (mem_base != xmlMemBlocks()) {
32154             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
32155                    xmlMemBlocks() - mem_base);
32156             test_ret++;
32157             printf(" %d", n_reader);
32158             printf(" %d", n_prop);
32159             printf("\n");
32160         }
32161     }
32162     }
32163     function_tests++;
32164 #endif
32165
32166     return(test_ret);
32167 }
32168
32169
32170 static int
32171 test_xmlTextReaderGetRemainder(void) {
32172     int test_ret = 0;
32173
32174 #if defined(LIBXML_READER_ENABLED)
32175     int mem_base;
32176     xmlParserInputBufferPtr ret_val;
32177     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32178     int n_reader;
32179
32180     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32181         mem_base = xmlMemBlocks();
32182         reader = gen_xmlTextReaderPtr(n_reader, 0);
32183
32184         ret_val = xmlTextReaderGetRemainder(reader);
32185         desret_xmlParserInputBufferPtr(ret_val);
32186         call_tests++;
32187         des_xmlTextReaderPtr(n_reader, reader, 0);
32188         xmlResetLastError();
32189         if (mem_base != xmlMemBlocks()) {
32190             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
32191                    xmlMemBlocks() - mem_base);
32192             test_ret++;
32193             printf(" %d", n_reader);
32194             printf("\n");
32195         }
32196     }
32197     function_tests++;
32198 #endif
32199
32200     return(test_ret);
32201 }
32202
32203
32204 static int
32205 test_xmlTextReaderHasAttributes(void) {
32206     int test_ret = 0;
32207
32208 #if defined(LIBXML_READER_ENABLED)
32209     int mem_base;
32210     int ret_val;
32211     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32212     int n_reader;
32213
32214     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32215         mem_base = xmlMemBlocks();
32216         reader = gen_xmlTextReaderPtr(n_reader, 0);
32217
32218         ret_val = xmlTextReaderHasAttributes(reader);
32219         desret_int(ret_val);
32220         call_tests++;
32221         des_xmlTextReaderPtr(n_reader, reader, 0);
32222         xmlResetLastError();
32223         if (mem_base != xmlMemBlocks()) {
32224             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
32225                    xmlMemBlocks() - mem_base);
32226             test_ret++;
32227             printf(" %d", n_reader);
32228             printf("\n");
32229         }
32230     }
32231     function_tests++;
32232 #endif
32233
32234     return(test_ret);
32235 }
32236
32237
32238 static int
32239 test_xmlTextReaderHasValue(void) {
32240     int test_ret = 0;
32241
32242 #if defined(LIBXML_READER_ENABLED)
32243     int mem_base;
32244     int ret_val;
32245     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32246     int n_reader;
32247
32248     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32249         mem_base = xmlMemBlocks();
32250         reader = gen_xmlTextReaderPtr(n_reader, 0);
32251
32252         ret_val = xmlTextReaderHasValue(reader);
32253         desret_int(ret_val);
32254         call_tests++;
32255         des_xmlTextReaderPtr(n_reader, reader, 0);
32256         xmlResetLastError();
32257         if (mem_base != xmlMemBlocks()) {
32258             printf("Leak of %d blocks found in xmlTextReaderHasValue",
32259                    xmlMemBlocks() - mem_base);
32260             test_ret++;
32261             printf(" %d", n_reader);
32262             printf("\n");
32263         }
32264     }
32265     function_tests++;
32266 #endif
32267
32268     return(test_ret);
32269 }
32270
32271
32272 static int
32273 test_xmlTextReaderIsDefault(void) {
32274     int test_ret = 0;
32275
32276 #if defined(LIBXML_READER_ENABLED)
32277     int mem_base;
32278     int ret_val;
32279     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32280     int n_reader;
32281
32282     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32283         mem_base = xmlMemBlocks();
32284         reader = gen_xmlTextReaderPtr(n_reader, 0);
32285
32286         ret_val = xmlTextReaderIsDefault(reader);
32287         desret_int(ret_val);
32288         call_tests++;
32289         des_xmlTextReaderPtr(n_reader, reader, 0);
32290         xmlResetLastError();
32291         if (mem_base != xmlMemBlocks()) {
32292             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
32293                    xmlMemBlocks() - mem_base);
32294             test_ret++;
32295             printf(" %d", n_reader);
32296             printf("\n");
32297         }
32298     }
32299     function_tests++;
32300 #endif
32301
32302     return(test_ret);
32303 }
32304
32305
32306 static int
32307 test_xmlTextReaderIsEmptyElement(void) {
32308     int test_ret = 0;
32309
32310 #if defined(LIBXML_READER_ENABLED)
32311     int mem_base;
32312     int ret_val;
32313     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32314     int n_reader;
32315
32316     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32317         mem_base = xmlMemBlocks();
32318         reader = gen_xmlTextReaderPtr(n_reader, 0);
32319
32320         ret_val = xmlTextReaderIsEmptyElement(reader);
32321         desret_int(ret_val);
32322         call_tests++;
32323         des_xmlTextReaderPtr(n_reader, reader, 0);
32324         xmlResetLastError();
32325         if (mem_base != xmlMemBlocks()) {
32326             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
32327                    xmlMemBlocks() - mem_base);
32328             test_ret++;
32329             printf(" %d", n_reader);
32330             printf("\n");
32331         }
32332     }
32333     function_tests++;
32334 #endif
32335
32336     return(test_ret);
32337 }
32338
32339
32340 static int
32341 test_xmlTextReaderIsNamespaceDecl(void) {
32342     int test_ret = 0;
32343
32344 #if defined(LIBXML_READER_ENABLED)
32345     int mem_base;
32346     int ret_val;
32347     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32348     int n_reader;
32349
32350     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32351         mem_base = xmlMemBlocks();
32352         reader = gen_xmlTextReaderPtr(n_reader, 0);
32353
32354         ret_val = xmlTextReaderIsNamespaceDecl(reader);
32355         desret_int(ret_val);
32356         call_tests++;
32357         des_xmlTextReaderPtr(n_reader, reader, 0);
32358         xmlResetLastError();
32359         if (mem_base != xmlMemBlocks()) {
32360             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
32361                    xmlMemBlocks() - mem_base);
32362             test_ret++;
32363             printf(" %d", n_reader);
32364             printf("\n");
32365         }
32366     }
32367     function_tests++;
32368 #endif
32369
32370     return(test_ret);
32371 }
32372
32373
32374 static int
32375 test_xmlTextReaderIsValid(void) {
32376     int test_ret = 0;
32377
32378 #if defined(LIBXML_READER_ENABLED)
32379     int mem_base;
32380     int ret_val;
32381     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32382     int n_reader;
32383
32384     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32385         mem_base = xmlMemBlocks();
32386         reader = gen_xmlTextReaderPtr(n_reader, 0);
32387
32388         ret_val = xmlTextReaderIsValid(reader);
32389         desret_int(ret_val);
32390         call_tests++;
32391         des_xmlTextReaderPtr(n_reader, reader, 0);
32392         xmlResetLastError();
32393         if (mem_base != xmlMemBlocks()) {
32394             printf("Leak of %d blocks found in xmlTextReaderIsValid",
32395                    xmlMemBlocks() - mem_base);
32396             test_ret++;
32397             printf(" %d", n_reader);
32398             printf("\n");
32399         }
32400     }
32401     function_tests++;
32402 #endif
32403
32404     return(test_ret);
32405 }
32406
32407
32408 static int
32409 test_xmlTextReaderLocalName(void) {
32410     int test_ret = 0;
32411
32412 #if defined(LIBXML_READER_ENABLED)
32413     int mem_base;
32414     xmlChar * ret_val;
32415     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32416     int n_reader;
32417
32418     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32419         mem_base = xmlMemBlocks();
32420         reader = gen_xmlTextReaderPtr(n_reader, 0);
32421
32422         ret_val = xmlTextReaderLocalName(reader);
32423         desret_xmlChar_ptr(ret_val);
32424         call_tests++;
32425         des_xmlTextReaderPtr(n_reader, reader, 0);
32426         xmlResetLastError();
32427         if (mem_base != xmlMemBlocks()) {
32428             printf("Leak of %d blocks found in xmlTextReaderLocalName",
32429                    xmlMemBlocks() - mem_base);
32430             test_ret++;
32431             printf(" %d", n_reader);
32432             printf("\n");
32433         }
32434     }
32435     function_tests++;
32436 #endif
32437
32438     return(test_ret);
32439 }
32440
32441 #ifdef LIBXML_READER_ENABLED
32442
32443 #define gen_nb_xmlTextReaderLocatorPtr 1
32444 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32445     return(NULL);
32446 }
32447 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32448 }
32449 #endif
32450
32451
32452 static int
32453 test_xmlTextReaderLocatorBaseURI(void) {
32454     int test_ret = 0;
32455
32456 #if defined(LIBXML_READER_ENABLED)
32457     int mem_base;
32458     xmlChar * ret_val;
32459     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
32460     int n_locator;
32461
32462     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
32463         mem_base = xmlMemBlocks();
32464         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
32465
32466         ret_val = xmlTextReaderLocatorBaseURI(locator);
32467         desret_xmlChar_ptr(ret_val);
32468         call_tests++;
32469         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
32470         xmlResetLastError();
32471         if (mem_base != xmlMemBlocks()) {
32472             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
32473                    xmlMemBlocks() - mem_base);
32474             test_ret++;
32475             printf(" %d", n_locator);
32476             printf("\n");
32477         }
32478     }
32479     function_tests++;
32480 #endif
32481
32482     return(test_ret);
32483 }
32484
32485
32486 static int
32487 test_xmlTextReaderLocatorLineNumber(void) {
32488     int test_ret = 0;
32489
32490 #if defined(LIBXML_READER_ENABLED)
32491     int mem_base;
32492     int ret_val;
32493     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
32494     int n_locator;
32495
32496     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
32497         mem_base = xmlMemBlocks();
32498         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
32499
32500         ret_val = xmlTextReaderLocatorLineNumber(locator);
32501         desret_int(ret_val);
32502         call_tests++;
32503         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
32504         xmlResetLastError();
32505         if (mem_base != xmlMemBlocks()) {
32506             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
32507                    xmlMemBlocks() - mem_base);
32508             test_ret++;
32509             printf(" %d", n_locator);
32510             printf("\n");
32511         }
32512     }
32513     function_tests++;
32514 #endif
32515
32516     return(test_ret);
32517 }
32518
32519
32520 static int
32521 test_xmlTextReaderLookupNamespace(void) {
32522     int test_ret = 0;
32523
32524 #if defined(LIBXML_READER_ENABLED)
32525     int mem_base;
32526     xmlChar * ret_val;
32527     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32528     int n_reader;
32529     xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
32530     int n_prefix;
32531
32532     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32533     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
32534         mem_base = xmlMemBlocks();
32535         reader = gen_xmlTextReaderPtr(n_reader, 0);
32536         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
32537
32538         ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
32539         desret_xmlChar_ptr(ret_val);
32540         call_tests++;
32541         des_xmlTextReaderPtr(n_reader, reader, 0);
32542         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
32543         xmlResetLastError();
32544         if (mem_base != xmlMemBlocks()) {
32545             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
32546                    xmlMemBlocks() - mem_base);
32547             test_ret++;
32548             printf(" %d", n_reader);
32549             printf(" %d", n_prefix);
32550             printf("\n");
32551         }
32552     }
32553     }
32554     function_tests++;
32555 #endif
32556
32557     return(test_ret);
32558 }
32559
32560
32561 static int
32562 test_xmlTextReaderMoveToAttribute(void) {
32563     int test_ret = 0;
32564
32565 #if defined(LIBXML_READER_ENABLED)
32566     int mem_base;
32567     int ret_val;
32568     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32569     int n_reader;
32570     xmlChar * name; /* the qualified name of the attribute. */
32571     int n_name;
32572
32573     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32574     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
32575         mem_base = xmlMemBlocks();
32576         reader = gen_xmlTextReaderPtr(n_reader, 0);
32577         name = gen_const_xmlChar_ptr(n_name, 1);
32578
32579         ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
32580         desret_int(ret_val);
32581         call_tests++;
32582         des_xmlTextReaderPtr(n_reader, reader, 0);
32583         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
32584         xmlResetLastError();
32585         if (mem_base != xmlMemBlocks()) {
32586             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
32587                    xmlMemBlocks() - mem_base);
32588             test_ret++;
32589             printf(" %d", n_reader);
32590             printf(" %d", n_name);
32591             printf("\n");
32592         }
32593     }
32594     }
32595     function_tests++;
32596 #endif
32597
32598     return(test_ret);
32599 }
32600
32601
32602 static int
32603 test_xmlTextReaderMoveToAttributeNo(void) {
32604     int test_ret = 0;
32605
32606 #if defined(LIBXML_READER_ENABLED)
32607     int mem_base;
32608     int ret_val;
32609     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32610     int n_reader;
32611     int no; /* the zero-based index of the attribute relative to the containing element. */
32612     int n_no;
32613
32614     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32615     for (n_no = 0;n_no < gen_nb_int;n_no++) {
32616         mem_base = xmlMemBlocks();
32617         reader = gen_xmlTextReaderPtr(n_reader, 0);
32618         no = gen_int(n_no, 1);
32619
32620         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
32621         desret_int(ret_val);
32622         call_tests++;
32623         des_xmlTextReaderPtr(n_reader, reader, 0);
32624         des_int(n_no, no, 1);
32625         xmlResetLastError();
32626         if (mem_base != xmlMemBlocks()) {
32627             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
32628                    xmlMemBlocks() - mem_base);
32629             test_ret++;
32630             printf(" %d", n_reader);
32631             printf(" %d", n_no);
32632             printf("\n");
32633         }
32634     }
32635     }
32636     function_tests++;
32637 #endif
32638
32639     return(test_ret);
32640 }
32641
32642
32643 static int
32644 test_xmlTextReaderMoveToAttributeNs(void) {
32645     int test_ret = 0;
32646
32647 #if defined(LIBXML_READER_ENABLED)
32648     int mem_base;
32649     int ret_val;
32650     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32651     int n_reader;
32652     xmlChar * localName; /* the local name of the attribute. */
32653     int n_localName;
32654     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
32655     int n_namespaceURI;
32656
32657     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32658     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
32659     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
32660         mem_base = xmlMemBlocks();
32661         reader = gen_xmlTextReaderPtr(n_reader, 0);
32662         localName = gen_const_xmlChar_ptr(n_localName, 1);
32663         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
32664
32665         ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
32666         desret_int(ret_val);
32667         call_tests++;
32668         des_xmlTextReaderPtr(n_reader, reader, 0);
32669         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
32670         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
32671         xmlResetLastError();
32672         if (mem_base != xmlMemBlocks()) {
32673             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
32674                    xmlMemBlocks() - mem_base);
32675             test_ret++;
32676             printf(" %d", n_reader);
32677             printf(" %d", n_localName);
32678             printf(" %d", n_namespaceURI);
32679             printf("\n");
32680         }
32681     }
32682     }
32683     }
32684     function_tests++;
32685 #endif
32686
32687     return(test_ret);
32688 }
32689
32690
32691 static int
32692 test_xmlTextReaderMoveToElement(void) {
32693     int test_ret = 0;
32694
32695 #if defined(LIBXML_READER_ENABLED)
32696     int mem_base;
32697     int ret_val;
32698     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32699     int n_reader;
32700
32701     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32702         mem_base = xmlMemBlocks();
32703         reader = gen_xmlTextReaderPtr(n_reader, 0);
32704
32705         ret_val = xmlTextReaderMoveToElement(reader);
32706         desret_int(ret_val);
32707         call_tests++;
32708         des_xmlTextReaderPtr(n_reader, reader, 0);
32709         xmlResetLastError();
32710         if (mem_base != xmlMemBlocks()) {
32711             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
32712                    xmlMemBlocks() - mem_base);
32713             test_ret++;
32714             printf(" %d", n_reader);
32715             printf("\n");
32716         }
32717     }
32718     function_tests++;
32719 #endif
32720
32721     return(test_ret);
32722 }
32723
32724
32725 static int
32726 test_xmlTextReaderMoveToFirstAttribute(void) {
32727     int test_ret = 0;
32728
32729 #if defined(LIBXML_READER_ENABLED)
32730     int mem_base;
32731     int ret_val;
32732     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32733     int n_reader;
32734
32735     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32736         mem_base = xmlMemBlocks();
32737         reader = gen_xmlTextReaderPtr(n_reader, 0);
32738
32739         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
32740         desret_int(ret_val);
32741         call_tests++;
32742         des_xmlTextReaderPtr(n_reader, reader, 0);
32743         xmlResetLastError();
32744         if (mem_base != xmlMemBlocks()) {
32745             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
32746                    xmlMemBlocks() - mem_base);
32747             test_ret++;
32748             printf(" %d", n_reader);
32749             printf("\n");
32750         }
32751     }
32752     function_tests++;
32753 #endif
32754
32755     return(test_ret);
32756 }
32757
32758
32759 static int
32760 test_xmlTextReaderMoveToNextAttribute(void) {
32761     int test_ret = 0;
32762
32763 #if defined(LIBXML_READER_ENABLED)
32764     int mem_base;
32765     int ret_val;
32766     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32767     int n_reader;
32768
32769     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32770         mem_base = xmlMemBlocks();
32771         reader = gen_xmlTextReaderPtr(n_reader, 0);
32772
32773         ret_val = xmlTextReaderMoveToNextAttribute(reader);
32774         desret_int(ret_val);
32775         call_tests++;
32776         des_xmlTextReaderPtr(n_reader, reader, 0);
32777         xmlResetLastError();
32778         if (mem_base != xmlMemBlocks()) {
32779             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
32780                    xmlMemBlocks() - mem_base);
32781             test_ret++;
32782             printf(" %d", n_reader);
32783             printf("\n");
32784         }
32785     }
32786     function_tests++;
32787 #endif
32788
32789     return(test_ret);
32790 }
32791
32792
32793 static int
32794 test_xmlTextReaderName(void) {
32795     int test_ret = 0;
32796
32797 #if defined(LIBXML_READER_ENABLED)
32798     int mem_base;
32799     xmlChar * ret_val;
32800     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32801     int n_reader;
32802
32803     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32804         mem_base = xmlMemBlocks();
32805         reader = gen_xmlTextReaderPtr(n_reader, 0);
32806
32807         ret_val = xmlTextReaderName(reader);
32808         desret_xmlChar_ptr(ret_val);
32809         call_tests++;
32810         des_xmlTextReaderPtr(n_reader, reader, 0);
32811         xmlResetLastError();
32812         if (mem_base != xmlMemBlocks()) {
32813             printf("Leak of %d blocks found in xmlTextReaderName",
32814                    xmlMemBlocks() - mem_base);
32815             test_ret++;
32816             printf(" %d", n_reader);
32817             printf("\n");
32818         }
32819     }
32820     function_tests++;
32821 #endif
32822
32823     return(test_ret);
32824 }
32825
32826
32827 static int
32828 test_xmlTextReaderNamespaceUri(void) {
32829     int test_ret = 0;
32830
32831 #if defined(LIBXML_READER_ENABLED)
32832     int mem_base;
32833     xmlChar * ret_val;
32834     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32835     int n_reader;
32836
32837     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32838         mem_base = xmlMemBlocks();
32839         reader = gen_xmlTextReaderPtr(n_reader, 0);
32840
32841         ret_val = xmlTextReaderNamespaceUri(reader);
32842         desret_xmlChar_ptr(ret_val);
32843         call_tests++;
32844         des_xmlTextReaderPtr(n_reader, reader, 0);
32845         xmlResetLastError();
32846         if (mem_base != xmlMemBlocks()) {
32847             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
32848                    xmlMemBlocks() - mem_base);
32849             test_ret++;
32850             printf(" %d", n_reader);
32851             printf("\n");
32852         }
32853     }
32854     function_tests++;
32855 #endif
32856
32857     return(test_ret);
32858 }
32859
32860
32861 static int
32862 test_xmlTextReaderNext(void) {
32863     int test_ret = 0;
32864
32865 #if defined(LIBXML_READER_ENABLED)
32866     int mem_base;
32867     int ret_val;
32868     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32869     int n_reader;
32870
32871     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32872         mem_base = xmlMemBlocks();
32873         reader = gen_xmlTextReaderPtr(n_reader, 0);
32874
32875         ret_val = xmlTextReaderNext(reader);
32876         desret_int(ret_val);
32877         call_tests++;
32878         des_xmlTextReaderPtr(n_reader, reader, 0);
32879         xmlResetLastError();
32880         if (mem_base != xmlMemBlocks()) {
32881             printf("Leak of %d blocks found in xmlTextReaderNext",
32882                    xmlMemBlocks() - mem_base);
32883             test_ret++;
32884             printf(" %d", n_reader);
32885             printf("\n");
32886         }
32887     }
32888     function_tests++;
32889 #endif
32890
32891     return(test_ret);
32892 }
32893
32894
32895 static int
32896 test_xmlTextReaderNextSibling(void) {
32897     int test_ret = 0;
32898
32899 #if defined(LIBXML_READER_ENABLED)
32900     int mem_base;
32901     int ret_val;
32902     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32903     int n_reader;
32904
32905     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32906         mem_base = xmlMemBlocks();
32907         reader = gen_xmlTextReaderPtr(n_reader, 0);
32908
32909         ret_val = xmlTextReaderNextSibling(reader);
32910         desret_int(ret_val);
32911         call_tests++;
32912         des_xmlTextReaderPtr(n_reader, reader, 0);
32913         xmlResetLastError();
32914         if (mem_base != xmlMemBlocks()) {
32915             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
32916                    xmlMemBlocks() - mem_base);
32917             test_ret++;
32918             printf(" %d", n_reader);
32919             printf("\n");
32920         }
32921     }
32922     function_tests++;
32923 #endif
32924
32925     return(test_ret);
32926 }
32927
32928
32929 static int
32930 test_xmlTextReaderNodeType(void) {
32931     int test_ret = 0;
32932
32933 #if defined(LIBXML_READER_ENABLED)
32934     int mem_base;
32935     int ret_val;
32936     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32937     int n_reader;
32938
32939     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32940         mem_base = xmlMemBlocks();
32941         reader = gen_xmlTextReaderPtr(n_reader, 0);
32942
32943         ret_val = xmlTextReaderNodeType(reader);
32944         desret_int(ret_val);
32945         call_tests++;
32946         des_xmlTextReaderPtr(n_reader, reader, 0);
32947         xmlResetLastError();
32948         if (mem_base != xmlMemBlocks()) {
32949             printf("Leak of %d blocks found in xmlTextReaderNodeType",
32950                    xmlMemBlocks() - mem_base);
32951             test_ret++;
32952             printf(" %d", n_reader);
32953             printf("\n");
32954         }
32955     }
32956     function_tests++;
32957 #endif
32958
32959     return(test_ret);
32960 }
32961
32962
32963 static int
32964 test_xmlTextReaderNormalization(void) {
32965     int test_ret = 0;
32966
32967 #if defined(LIBXML_READER_ENABLED)
32968     int mem_base;
32969     int ret_val;
32970     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32971     int n_reader;
32972
32973     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32974         mem_base = xmlMemBlocks();
32975         reader = gen_xmlTextReaderPtr(n_reader, 0);
32976
32977         ret_val = xmlTextReaderNormalization(reader);
32978         desret_int(ret_val);
32979         call_tests++;
32980         des_xmlTextReaderPtr(n_reader, reader, 0);
32981         xmlResetLastError();
32982         if (mem_base != xmlMemBlocks()) {
32983             printf("Leak of %d blocks found in xmlTextReaderNormalization",
32984                    xmlMemBlocks() - mem_base);
32985             test_ret++;
32986             printf(" %d", n_reader);
32987             printf("\n");
32988         }
32989     }
32990     function_tests++;
32991 #endif
32992
32993     return(test_ret);
32994 }
32995
32996
32997 static int
32998 test_xmlTextReaderPrefix(void) {
32999     int test_ret = 0;
33000
33001 #if defined(LIBXML_READER_ENABLED)
33002     int mem_base;
33003     xmlChar * ret_val;
33004     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33005     int n_reader;
33006
33007     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33008         mem_base = xmlMemBlocks();
33009         reader = gen_xmlTextReaderPtr(n_reader, 0);
33010
33011         ret_val = xmlTextReaderPrefix(reader);
33012         desret_xmlChar_ptr(ret_val);
33013         call_tests++;
33014         des_xmlTextReaderPtr(n_reader, reader, 0);
33015         xmlResetLastError();
33016         if (mem_base != xmlMemBlocks()) {
33017             printf("Leak of %d blocks found in xmlTextReaderPrefix",
33018                    xmlMemBlocks() - mem_base);
33019             test_ret++;
33020             printf(" %d", n_reader);
33021             printf("\n");
33022         }
33023     }
33024     function_tests++;
33025 #endif
33026
33027     return(test_ret);
33028 }
33029
33030
33031 static int
33032 test_xmlTextReaderPreserve(void) {
33033     int test_ret = 0;
33034
33035 #if defined(LIBXML_READER_ENABLED)
33036     int mem_base;
33037     xmlNodePtr ret_val;
33038     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33039     int n_reader;
33040
33041     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33042         mem_base = xmlMemBlocks();
33043         reader = gen_xmlTextReaderPtr(n_reader, 0);
33044
33045         ret_val = xmlTextReaderPreserve(reader);
33046         desret_xmlNodePtr(ret_val);
33047         call_tests++;
33048         des_xmlTextReaderPtr(n_reader, reader, 0);
33049         xmlResetLastError();
33050         if (mem_base != xmlMemBlocks()) {
33051             printf("Leak of %d blocks found in xmlTextReaderPreserve",
33052                    xmlMemBlocks() - mem_base);
33053             test_ret++;
33054             printf(" %d", n_reader);
33055             printf("\n");
33056         }
33057     }
33058     function_tests++;
33059 #endif
33060
33061     return(test_ret);
33062 }
33063
33064
33065 static int
33066 test_xmlTextReaderPreservePattern(void) {
33067     int test_ret = 0;
33068
33069 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
33070 #ifdef LIBXML_PATTERN_ENABLED
33071     int mem_base;
33072     int ret_val;
33073     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33074     int n_reader;
33075     xmlChar * pattern; /* an XPath subset pattern */
33076     int n_pattern;
33077     xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
33078     int n_namespaces;
33079
33080     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33081     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
33082     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
33083         mem_base = xmlMemBlocks();
33084         reader = gen_xmlTextReaderPtr(n_reader, 0);
33085         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
33086         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
33087
33088         ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
33089         desret_int(ret_val);
33090         call_tests++;
33091         des_xmlTextReaderPtr(n_reader, reader, 0);
33092         des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
33093         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
33094         xmlResetLastError();
33095         if (mem_base != xmlMemBlocks()) {
33096             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
33097                    xmlMemBlocks() - mem_base);
33098             test_ret++;
33099             printf(" %d", n_reader);
33100             printf(" %d", n_pattern);
33101             printf(" %d", n_namespaces);
33102             printf("\n");
33103         }
33104     }
33105     }
33106     }
33107     function_tests++;
33108 #endif
33109 #endif
33110
33111     return(test_ret);
33112 }
33113
33114
33115 static int
33116 test_xmlTextReaderQuoteChar(void) {
33117     int test_ret = 0;
33118
33119 #if defined(LIBXML_READER_ENABLED)
33120     int mem_base;
33121     int ret_val;
33122     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33123     int n_reader;
33124
33125     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33126         mem_base = xmlMemBlocks();
33127         reader = gen_xmlTextReaderPtr(n_reader, 0);
33128
33129         ret_val = xmlTextReaderQuoteChar(reader);
33130         desret_int(ret_val);
33131         call_tests++;
33132         des_xmlTextReaderPtr(n_reader, reader, 0);
33133         xmlResetLastError();
33134         if (mem_base != xmlMemBlocks()) {
33135             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
33136                    xmlMemBlocks() - mem_base);
33137             test_ret++;
33138             printf(" %d", n_reader);
33139             printf("\n");
33140         }
33141     }
33142     function_tests++;
33143 #endif
33144
33145     return(test_ret);
33146 }
33147
33148
33149 static int
33150 test_xmlTextReaderRead(void) {
33151     int test_ret = 0;
33152
33153 #if defined(LIBXML_READER_ENABLED)
33154     int mem_base;
33155     int ret_val;
33156     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33157     int n_reader;
33158
33159     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33160         mem_base = xmlMemBlocks();
33161         reader = gen_xmlTextReaderPtr(n_reader, 0);
33162
33163         ret_val = xmlTextReaderRead(reader);
33164         desret_int(ret_val);
33165         call_tests++;
33166         des_xmlTextReaderPtr(n_reader, reader, 0);
33167         xmlResetLastError();
33168         if (mem_base != xmlMemBlocks()) {
33169             printf("Leak of %d blocks found in xmlTextReaderRead",
33170                    xmlMemBlocks() - mem_base);
33171             test_ret++;
33172             printf(" %d", n_reader);
33173             printf("\n");
33174         }
33175     }
33176     function_tests++;
33177 #endif
33178
33179     return(test_ret);
33180 }
33181
33182
33183 static int
33184 test_xmlTextReaderReadAttributeValue(void) {
33185     int test_ret = 0;
33186
33187 #if defined(LIBXML_READER_ENABLED)
33188     int mem_base;
33189     int ret_val;
33190     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33191     int n_reader;
33192
33193     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33194         mem_base = xmlMemBlocks();
33195         reader = gen_xmlTextReaderPtr(n_reader, 0);
33196
33197         ret_val = xmlTextReaderReadAttributeValue(reader);
33198         desret_int(ret_val);
33199         call_tests++;
33200         des_xmlTextReaderPtr(n_reader, reader, 0);
33201         xmlResetLastError();
33202         if (mem_base != xmlMemBlocks()) {
33203             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
33204                    xmlMemBlocks() - mem_base);
33205             test_ret++;
33206             printf(" %d", n_reader);
33207             printf("\n");
33208         }
33209     }
33210     function_tests++;
33211 #endif
33212
33213     return(test_ret);
33214 }
33215
33216
33217 static int
33218 test_xmlTextReaderReadState(void) {
33219     int test_ret = 0;
33220
33221 #if defined(LIBXML_READER_ENABLED)
33222     int mem_base;
33223     int ret_val;
33224     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33225     int n_reader;
33226
33227     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33228         mem_base = xmlMemBlocks();
33229         reader = gen_xmlTextReaderPtr(n_reader, 0);
33230
33231         ret_val = xmlTextReaderReadState(reader);
33232         desret_int(ret_val);
33233         call_tests++;
33234         des_xmlTextReaderPtr(n_reader, reader, 0);
33235         xmlResetLastError();
33236         if (mem_base != xmlMemBlocks()) {
33237             printf("Leak of %d blocks found in xmlTextReaderReadState",
33238                    xmlMemBlocks() - mem_base);
33239             test_ret++;
33240             printf(" %d", n_reader);
33241             printf("\n");
33242         }
33243     }
33244     function_tests++;
33245 #endif
33246
33247     return(test_ret);
33248 }
33249
33250
33251 static int
33252 test_xmlTextReaderRelaxNGSetSchema(void) {
33253     int test_ret = 0;
33254
33255 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33256     int mem_base;
33257     int ret_val;
33258     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33259     int n_reader;
33260     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
33261     int n_schema;
33262
33263     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33264     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
33265         mem_base = xmlMemBlocks();
33266         reader = gen_xmlTextReaderPtr(n_reader, 0);
33267         schema = gen_xmlRelaxNGPtr(n_schema, 1);
33268
33269         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
33270         desret_int(ret_val);
33271         call_tests++;
33272         des_xmlTextReaderPtr(n_reader, reader, 0);
33273         des_xmlRelaxNGPtr(n_schema, schema, 1);
33274         xmlResetLastError();
33275         if (mem_base != xmlMemBlocks()) {
33276             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
33277                    xmlMemBlocks() - mem_base);
33278             test_ret++;
33279             printf(" %d", n_reader);
33280             printf(" %d", n_schema);
33281             printf("\n");
33282         }
33283     }
33284     }
33285     function_tests++;
33286 #endif
33287
33288     return(test_ret);
33289 }
33290
33291
33292 static int
33293 test_xmlTextReaderRelaxNGValidate(void) {
33294     int test_ret = 0;
33295
33296 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33297     int mem_base;
33298     int ret_val;
33299     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33300     int n_reader;
33301     char * rng; /* the path to a RelaxNG schema or NULL */
33302     int n_rng;
33303
33304     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33305     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
33306         mem_base = xmlMemBlocks();
33307         reader = gen_xmlTextReaderPtr(n_reader, 0);
33308         rng = gen_const_char_ptr(n_rng, 1);
33309
33310         ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
33311         desret_int(ret_val);
33312         call_tests++;
33313         des_xmlTextReaderPtr(n_reader, reader, 0);
33314         des_const_char_ptr(n_rng, (const char *)rng, 1);
33315         xmlResetLastError();
33316         if (mem_base != xmlMemBlocks()) {
33317             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
33318                    xmlMemBlocks() - mem_base);
33319             test_ret++;
33320             printf(" %d", n_reader);
33321             printf(" %d", n_rng);
33322             printf("\n");
33323         }
33324     }
33325     }
33326     function_tests++;
33327 #endif
33328
33329     return(test_ret);
33330 }
33331
33332
33333 static int
33334 test_xmlTextReaderRelaxNGValidateCtxt(void) {
33335     int test_ret = 0;
33336
33337 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33338     int mem_base;
33339     int ret_val;
33340     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33341     int n_reader;
33342     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
33343     int n_ctxt;
33344     int options; /* options (not used yet) */
33345     int n_options;
33346
33347     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33348     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
33349     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
33350         mem_base = xmlMemBlocks();
33351         reader = gen_xmlTextReaderPtr(n_reader, 0);
33352         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
33353         options = gen_parseroptions(n_options, 2);
33354
33355         ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
33356         desret_int(ret_val);
33357         call_tests++;
33358         des_xmlTextReaderPtr(n_reader, reader, 0);
33359         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
33360         des_parseroptions(n_options, options, 2);
33361         xmlResetLastError();
33362         if (mem_base != xmlMemBlocks()) {
33363             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
33364                    xmlMemBlocks() - mem_base);
33365             test_ret++;
33366             printf(" %d", n_reader);
33367             printf(" %d", n_ctxt);
33368             printf(" %d", n_options);
33369             printf("\n");
33370         }
33371     }
33372     }
33373     }
33374     function_tests++;
33375 #endif
33376
33377     return(test_ret);
33378 }
33379
33380
33381 static int
33382 test_xmlTextReaderSchemaValidate(void) {
33383     int test_ret = 0;
33384
33385 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33386     int ret_val;
33387     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33388     int n_reader;
33389     char * xsd; /* the path to a W3C XSD schema or NULL */
33390     int n_xsd;
33391
33392     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33393     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
33394         reader = gen_xmlTextReaderPtr(n_reader, 0);
33395         xsd = gen_const_char_ptr(n_xsd, 1);
33396
33397         ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
33398         desret_int(ret_val);
33399         call_tests++;
33400         des_xmlTextReaderPtr(n_reader, reader, 0);
33401         des_const_char_ptr(n_xsd, (const char *)xsd, 1);
33402         xmlResetLastError();
33403     }
33404     }
33405     function_tests++;
33406 #endif
33407
33408     return(test_ret);
33409 }
33410
33411
33412 static int
33413 test_xmlTextReaderSchemaValidateCtxt(void) {
33414     int test_ret = 0;
33415
33416 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33417     int mem_base;
33418     int ret_val;
33419     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33420     int n_reader;
33421     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
33422     int n_ctxt;
33423     int options; /* options (not used yet) */
33424     int n_options;
33425
33426     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33427     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33428     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
33429         mem_base = xmlMemBlocks();
33430         reader = gen_xmlTextReaderPtr(n_reader, 0);
33431         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
33432         options = gen_parseroptions(n_options, 2);
33433
33434         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
33435         desret_int(ret_val);
33436         call_tests++;
33437         des_xmlTextReaderPtr(n_reader, reader, 0);
33438         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
33439         des_parseroptions(n_options, options, 2);
33440         xmlResetLastError();
33441         if (mem_base != xmlMemBlocks()) {
33442             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
33443                    xmlMemBlocks() - mem_base);
33444             test_ret++;
33445             printf(" %d", n_reader);
33446             printf(" %d", n_ctxt);
33447             printf(" %d", n_options);
33448             printf("\n");
33449         }
33450     }
33451     }
33452     }
33453     function_tests++;
33454 #endif
33455
33456     return(test_ret);
33457 }
33458
33459
33460 static int
33461 test_xmlTextReaderSetErrorHandler(void) {
33462     int test_ret = 0;
33463
33464
33465     /* missing type support */
33466     return(test_ret);
33467 }
33468
33469
33470 static int
33471 test_xmlTextReaderSetParserProp(void) {
33472     int test_ret = 0;
33473
33474 #if defined(LIBXML_READER_ENABLED)
33475     int mem_base;
33476     int ret_val;
33477     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33478     int n_reader;
33479     int prop; /* the xmlParserProperties to set */
33480     int n_prop;
33481     int value; /* usually 0 or 1 to (de)activate it */
33482     int n_value;
33483
33484     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33485     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
33486     for (n_value = 0;n_value < gen_nb_int;n_value++) {
33487         mem_base = xmlMemBlocks();
33488         reader = gen_xmlTextReaderPtr(n_reader, 0);
33489         prop = gen_int(n_prop, 1);
33490         value = gen_int(n_value, 2);
33491
33492         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
33493         desret_int(ret_val);
33494         call_tests++;
33495         des_xmlTextReaderPtr(n_reader, reader, 0);
33496         des_int(n_prop, prop, 1);
33497         des_int(n_value, value, 2);
33498         xmlResetLastError();
33499         if (mem_base != xmlMemBlocks()) {
33500             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
33501                    xmlMemBlocks() - mem_base);
33502             test_ret++;
33503             printf(" %d", n_reader);
33504             printf(" %d", n_prop);
33505             printf(" %d", n_value);
33506             printf("\n");
33507         }
33508     }
33509     }
33510     }
33511     function_tests++;
33512 #endif
33513
33514     return(test_ret);
33515 }
33516
33517
33518 static int
33519 test_xmlTextReaderSetSchema(void) {
33520     int test_ret = 0;
33521
33522 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33523     int mem_base;
33524     int ret_val;
33525     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33526     int n_reader;
33527     xmlSchemaPtr schema; /* a precompiled Schema schema */
33528     int n_schema;
33529
33530     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33531     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33532         mem_base = xmlMemBlocks();
33533         reader = gen_xmlTextReaderPtr(n_reader, 0);
33534         schema = gen_xmlSchemaPtr(n_schema, 1);
33535
33536         ret_val = xmlTextReaderSetSchema(reader, schema);
33537         desret_int(ret_val);
33538         call_tests++;
33539         des_xmlTextReaderPtr(n_reader, reader, 0);
33540         des_xmlSchemaPtr(n_schema, schema, 1);
33541         xmlResetLastError();
33542         if (mem_base != xmlMemBlocks()) {
33543             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
33544                    xmlMemBlocks() - mem_base);
33545             test_ret++;
33546             printf(" %d", n_reader);
33547             printf(" %d", n_schema);
33548             printf("\n");
33549         }
33550     }
33551     }
33552     function_tests++;
33553 #endif
33554
33555     return(test_ret);
33556 }
33557
33558
33559 static int
33560 test_xmlTextReaderSetStructuredErrorHandler(void) {
33561     int test_ret = 0;
33562
33563
33564     /* missing type support */
33565     return(test_ret);
33566 }
33567
33568
33569 static int
33570 test_xmlTextReaderSetup(void) {
33571     int test_ret = 0;
33572
33573 #if defined(LIBXML_READER_ENABLED)
33574     int mem_base;
33575     int ret_val;
33576     xmlTextReaderPtr reader; /* an XML reader */
33577     int n_reader;
33578     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
33579     int n_input;
33580     const char * URL; /* the base URL to use for the document */
33581     int n_URL;
33582     char * encoding; /* the document encoding, or NULL */
33583     int n_encoding;
33584     int options; /* a combination of xmlParserOption */
33585     int n_options;
33586
33587     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33588     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
33589     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
33590     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
33591     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
33592         mem_base = xmlMemBlocks();
33593         reader = gen_xmlTextReaderPtr(n_reader, 0);
33594         input = gen_xmlParserInputBufferPtr(n_input, 1);
33595         URL = gen_filepath(n_URL, 2);
33596         encoding = gen_const_char_ptr(n_encoding, 3);
33597         options = gen_parseroptions(n_options, 4);
33598
33599         ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
33600         desret_int(ret_val);
33601         call_tests++;
33602         des_xmlTextReaderPtr(n_reader, reader, 0);
33603         des_filepath(n_URL, URL, 2);
33604         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
33605         des_parseroptions(n_options, options, 4);
33606         xmlResetLastError();
33607         if (mem_base != xmlMemBlocks()) {
33608             printf("Leak of %d blocks found in xmlTextReaderSetup",
33609                    xmlMemBlocks() - mem_base);
33610             test_ret++;
33611             printf(" %d", n_reader);
33612             printf(" %d", n_input);
33613             printf(" %d", n_URL);
33614             printf(" %d", n_encoding);
33615             printf(" %d", n_options);
33616             printf("\n");
33617         }
33618     }
33619     }
33620     }
33621     }
33622     }
33623     function_tests++;
33624 #endif
33625
33626     return(test_ret);
33627 }
33628
33629
33630 static int
33631 test_xmlTextReaderStandalone(void) {
33632     int test_ret = 0;
33633
33634 #if defined(LIBXML_READER_ENABLED)
33635     int mem_base;
33636     int ret_val;
33637     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33638     int n_reader;
33639
33640     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33641         mem_base = xmlMemBlocks();
33642         reader = gen_xmlTextReaderPtr(n_reader, 0);
33643
33644         ret_val = xmlTextReaderStandalone(reader);
33645         desret_int(ret_val);
33646         call_tests++;
33647         des_xmlTextReaderPtr(n_reader, reader, 0);
33648         xmlResetLastError();
33649         if (mem_base != xmlMemBlocks()) {
33650             printf("Leak of %d blocks found in xmlTextReaderStandalone",
33651                    xmlMemBlocks() - mem_base);
33652             test_ret++;
33653             printf(" %d", n_reader);
33654             printf("\n");
33655         }
33656     }
33657     function_tests++;
33658 #endif
33659
33660     return(test_ret);
33661 }
33662
33663
33664 static int
33665 test_xmlTextReaderValue(void) {
33666     int test_ret = 0;
33667
33668 #if defined(LIBXML_READER_ENABLED)
33669     int mem_base;
33670     xmlChar * ret_val;
33671     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33672     int n_reader;
33673
33674     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33675         mem_base = xmlMemBlocks();
33676         reader = gen_xmlTextReaderPtr(n_reader, 0);
33677
33678         ret_val = xmlTextReaderValue(reader);
33679         desret_xmlChar_ptr(ret_val);
33680         call_tests++;
33681         des_xmlTextReaderPtr(n_reader, reader, 0);
33682         xmlResetLastError();
33683         if (mem_base != xmlMemBlocks()) {
33684             printf("Leak of %d blocks found in xmlTextReaderValue",
33685                    xmlMemBlocks() - mem_base);
33686             test_ret++;
33687             printf(" %d", n_reader);
33688             printf("\n");
33689         }
33690     }
33691     function_tests++;
33692 #endif
33693
33694     return(test_ret);
33695 }
33696
33697
33698 static int
33699 test_xmlTextReaderXmlLang(void) {
33700     int test_ret = 0;
33701
33702 #if defined(LIBXML_READER_ENABLED)
33703     int mem_base;
33704     xmlChar * ret_val;
33705     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33706     int n_reader;
33707
33708     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33709         mem_base = xmlMemBlocks();
33710         reader = gen_xmlTextReaderPtr(n_reader, 0);
33711
33712         ret_val = xmlTextReaderXmlLang(reader);
33713         desret_xmlChar_ptr(ret_val);
33714         call_tests++;
33715         des_xmlTextReaderPtr(n_reader, reader, 0);
33716         xmlResetLastError();
33717         if (mem_base != xmlMemBlocks()) {
33718             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
33719                    xmlMemBlocks() - mem_base);
33720             test_ret++;
33721             printf(" %d", n_reader);
33722             printf("\n");
33723         }
33724     }
33725     function_tests++;
33726 #endif
33727
33728     return(test_ret);
33729 }
33730
33731 static int
33732 test_xmlreader(void) {
33733     int test_ret = 0;
33734         int rc = 0;
33735
33736     if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
33737     rc = test_xmlNewTextReader();
33738         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33739     rc = test_xmlNewTextReaderFilename();
33740         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33741     rc = test_xmlReaderForDoc();
33742         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33743     rc = test_xmlReaderForFile();
33744         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33745     rc = test_xmlReaderForMemory();
33746         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33747     rc = test_xmlReaderNewDoc();
33748         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33749     rc = test_xmlReaderNewFile();
33750         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33751     rc = test_xmlReaderNewMemory();
33752         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33753     rc = test_xmlReaderNewWalker();
33754         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33755     rc = test_xmlReaderWalker();
33756         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33757     rc = test_xmlTextReaderAttributeCount();
33758         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33759     rc = test_xmlTextReaderBaseUri();
33760         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33761     rc = test_xmlTextReaderByteConsumed();
33762         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33763     rc = test_xmlTextReaderClose();
33764         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33765     rc = test_xmlTextReaderConstBaseUri();
33766         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33767     rc = test_xmlTextReaderConstEncoding();
33768         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33769     rc = test_xmlTextReaderConstLocalName();
33770         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33771     rc = test_xmlTextReaderConstName();
33772         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33773     rc = test_xmlTextReaderConstNamespaceUri();
33774         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33775     rc = test_xmlTextReaderConstPrefix();
33776         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33777     rc = test_xmlTextReaderConstString();
33778         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33779     rc = test_xmlTextReaderConstValue();
33780         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33781     rc = test_xmlTextReaderConstXmlLang();
33782         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33783     rc = test_xmlTextReaderConstXmlVersion();
33784         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33785     rc = test_xmlTextReaderCurrentDoc();
33786         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33787     rc = test_xmlTextReaderCurrentNode();
33788         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33789     rc = test_xmlTextReaderDepth();
33790         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33791     rc = test_xmlTextReaderExpand();
33792         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33793     rc = test_xmlTextReaderGetAttribute();
33794         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33795     rc = test_xmlTextReaderGetAttributeNo();
33796         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33797     rc = test_xmlTextReaderGetAttributeNs();
33798         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33799     rc = test_xmlTextReaderGetErrorHandler();
33800         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33801     rc = test_xmlTextReaderGetParserColumnNumber();
33802         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33803     rc = test_xmlTextReaderGetParserLineNumber();
33804         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33805     rc = test_xmlTextReaderGetParserProp();
33806         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33807     rc = test_xmlTextReaderGetRemainder();
33808         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33809     rc = test_xmlTextReaderHasAttributes();
33810         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33811     rc = test_xmlTextReaderHasValue();
33812         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33813     rc = test_xmlTextReaderIsDefault();
33814         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33815     rc = test_xmlTextReaderIsEmptyElement();
33816         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33817     rc = test_xmlTextReaderIsNamespaceDecl();
33818         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33819     rc = test_xmlTextReaderIsValid();
33820         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33821     rc = test_xmlTextReaderLocalName();
33822         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33823     rc = test_xmlTextReaderLocatorBaseURI();
33824         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33825     rc = test_xmlTextReaderLocatorLineNumber();
33826         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33827     rc = test_xmlTextReaderLookupNamespace();
33828         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33829     rc = test_xmlTextReaderMoveToAttribute();
33830         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33831     rc = test_xmlTextReaderMoveToAttributeNo();
33832         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33833     rc = test_xmlTextReaderMoveToAttributeNs();
33834         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33835     rc = test_xmlTextReaderMoveToElement();
33836         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33837     rc = test_xmlTextReaderMoveToFirstAttribute();
33838         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33839     rc = test_xmlTextReaderMoveToNextAttribute();
33840         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33841     rc = test_xmlTextReaderName();
33842         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33843     rc = test_xmlTextReaderNamespaceUri();
33844         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33845     rc = test_xmlTextReaderNext();
33846         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33847     rc = test_xmlTextReaderNextSibling();
33848         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33849     rc = test_xmlTextReaderNodeType();
33850         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33851     rc = test_xmlTextReaderNormalization();
33852         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33853     rc = test_xmlTextReaderPrefix();
33854         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33855     rc = test_xmlTextReaderPreserve();
33856         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33857     rc = test_xmlTextReaderPreservePattern();
33858         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33859     rc = test_xmlTextReaderQuoteChar();
33860         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33861     rc = test_xmlTextReaderRead();
33862         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33863     rc = test_xmlTextReaderReadAttributeValue();
33864         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33865     rc = test_xmlTextReaderReadState();
33866         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33867     rc = test_xmlTextReaderRelaxNGSetSchema();
33868         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33869     rc = test_xmlTextReaderRelaxNGValidate();
33870         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33871     rc = test_xmlTextReaderRelaxNGValidateCtxt();
33872         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33873     rc = test_xmlTextReaderSchemaValidate();
33874         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33875     rc = test_xmlTextReaderSchemaValidateCtxt();
33876         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33877     rc = test_xmlTextReaderSetErrorHandler();
33878         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33879     rc = test_xmlTextReaderSetParserProp();
33880         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33881     rc = test_xmlTextReaderSetSchema();
33882         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33883     rc = test_xmlTextReaderSetStructuredErrorHandler();
33884         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33885     rc = test_xmlTextReaderSetup();
33886         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33887     rc = test_xmlTextReaderStandalone();
33888         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33889     rc = test_xmlTextReaderValue();
33890         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33891     rc = test_xmlTextReaderXmlLang();
33892         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33893
33894     if (test_ret != 0)
33895         printf("Module xmlreader: %d errors\n", test_ret);
33896     return(test_ret);
33897 }
33898
33899 static int
33900 test_xmlExpCtxtNbCons(void) {
33901     int test_ret = 0;
33902
33903 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33904     int mem_base;
33905     int ret_val;
33906     xmlExpCtxtPtr ctxt; /* an expression context */
33907     int n_ctxt;
33908
33909     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33910         mem_base = xmlMemBlocks();
33911         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33912
33913         ret_val = xmlExpCtxtNbCons(ctxt);
33914         desret_int(ret_val);
33915         call_tests++;
33916         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33917         xmlResetLastError();
33918         if (mem_base != xmlMemBlocks()) {
33919             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
33920                    xmlMemBlocks() - mem_base);
33921             test_ret++;
33922             printf(" %d", n_ctxt);
33923             printf("\n");
33924         }
33925     }
33926     function_tests++;
33927 #endif
33928
33929     return(test_ret);
33930 }
33931
33932
33933 static int
33934 test_xmlExpCtxtNbNodes(void) {
33935     int test_ret = 0;
33936
33937 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33938     int mem_base;
33939     int ret_val;
33940     xmlExpCtxtPtr ctxt; /* an expression context */
33941     int n_ctxt;
33942
33943     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33944         mem_base = xmlMemBlocks();
33945         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33946
33947         ret_val = xmlExpCtxtNbNodes(ctxt);
33948         desret_int(ret_val);
33949         call_tests++;
33950         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33951         xmlResetLastError();
33952         if (mem_base != xmlMemBlocks()) {
33953             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
33954                    xmlMemBlocks() - mem_base);
33955             test_ret++;
33956             printf(" %d", n_ctxt);
33957             printf("\n");
33958         }
33959     }
33960     function_tests++;
33961 #endif
33962
33963     return(test_ret);
33964 }
33965
33966
33967 static int
33968 test_xmlExpDump(void) {
33969     int test_ret = 0;
33970
33971 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33972     int mem_base;
33973     xmlBufferPtr buf; /* a buffer to receive the output */
33974     int n_buf;
33975     xmlExpNodePtr expr; /* the compiled expression */
33976     int n_expr;
33977
33978     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
33979     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33980         mem_base = xmlMemBlocks();
33981         buf = gen_xmlBufferPtr(n_buf, 0);
33982         expr = gen_xmlExpNodePtr(n_expr, 1);
33983
33984         xmlExpDump(buf, expr);
33985         call_tests++;
33986         des_xmlBufferPtr(n_buf, buf, 0);
33987         des_xmlExpNodePtr(n_expr, expr, 1);
33988         xmlResetLastError();
33989         if (mem_base != xmlMemBlocks()) {
33990             printf("Leak of %d blocks found in xmlExpDump",
33991                    xmlMemBlocks() - mem_base);
33992             test_ret++;
33993             printf(" %d", n_buf);
33994             printf(" %d", n_expr);
33995             printf("\n");
33996         }
33997     }
33998     }
33999     function_tests++;
34000 #endif
34001
34002     return(test_ret);
34003 }
34004
34005
34006 static int
34007 test_xmlExpExpDerive(void) {
34008     int test_ret = 0;
34009
34010
34011     /* missing type support */
34012     return(test_ret);
34013 }
34014
34015
34016 static int
34017 test_xmlExpGetLanguage(void) {
34018     int test_ret = 0;
34019
34020 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34021     int mem_base;
34022     int ret_val;
34023     xmlExpCtxtPtr ctxt; /* the expression context */
34024     int n_ctxt;
34025     xmlExpNodePtr exp; /* the expression */
34026     int n_exp;
34027     xmlChar ** langList; /* where to store the tokens */
34028     int n_langList;
34029     int len; /* the allocated length of @list */
34030     int n_len;
34031
34032     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
34033     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34034     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
34035     for (n_len = 0;n_len < gen_nb_int;n_len++) {
34036         mem_base = xmlMemBlocks();
34037         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
34038         exp = gen_xmlExpNodePtr(n_exp, 1);
34039         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
34040         len = gen_int(n_len, 3);
34041
34042         ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
34043         desret_int(ret_val);
34044         call_tests++;
34045         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
34046         des_xmlExpNodePtr(n_exp, exp, 1);
34047         des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
34048         des_int(n_len, len, 3);
34049         xmlResetLastError();
34050         if (mem_base != xmlMemBlocks()) {
34051             printf("Leak of %d blocks found in xmlExpGetLanguage",
34052                    xmlMemBlocks() - mem_base);
34053             test_ret++;
34054             printf(" %d", n_ctxt);
34055             printf(" %d", n_exp);
34056             printf(" %d", n_langList);
34057             printf(" %d", n_len);
34058             printf("\n");
34059         }
34060     }
34061     }
34062     }
34063     }
34064     function_tests++;
34065 #endif
34066
34067     return(test_ret);
34068 }
34069
34070
34071 static int
34072 test_xmlExpGetStart(void) {
34073     int test_ret = 0;
34074
34075 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34076     int mem_base;
34077     int ret_val;
34078     xmlExpCtxtPtr ctxt; /* the expression context */
34079     int n_ctxt;
34080     xmlExpNodePtr exp; /* the expression */
34081     int n_exp;
34082     xmlChar ** tokList; /* where to store the tokens */
34083     int n_tokList;
34084     int len; /* the allocated length of @list */
34085     int n_len;
34086
34087     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
34088     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34089     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
34090     for (n_len = 0;n_len < gen_nb_int;n_len++) {
34091         mem_base = xmlMemBlocks();
34092         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
34093         exp = gen_xmlExpNodePtr(n_exp, 1);
34094         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
34095         len = gen_int(n_len, 3);
34096
34097         ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
34098         desret_int(ret_val);
34099         call_tests++;
34100         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
34101         des_xmlExpNodePtr(n_exp, exp, 1);
34102         des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
34103         des_int(n_len, len, 3);
34104         xmlResetLastError();
34105         if (mem_base != xmlMemBlocks()) {
34106             printf("Leak of %d blocks found in xmlExpGetStart",
34107                    xmlMemBlocks() - mem_base);
34108             test_ret++;
34109             printf(" %d", n_ctxt);
34110             printf(" %d", n_exp);
34111             printf(" %d", n_tokList);
34112             printf(" %d", n_len);
34113             printf("\n");
34114         }
34115     }
34116     }
34117     }
34118     }
34119     function_tests++;
34120 #endif
34121
34122     return(test_ret);
34123 }
34124
34125
34126 static int
34127 test_xmlExpIsNillable(void) {
34128     int test_ret = 0;
34129
34130 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34131     int mem_base;
34132     int ret_val;
34133     xmlExpNodePtr exp; /* the expression */
34134     int n_exp;
34135
34136     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34137         mem_base = xmlMemBlocks();
34138         exp = gen_xmlExpNodePtr(n_exp, 0);
34139
34140         ret_val = xmlExpIsNillable(exp);
34141         desret_int(ret_val);
34142         call_tests++;
34143         des_xmlExpNodePtr(n_exp, exp, 0);
34144         xmlResetLastError();
34145         if (mem_base != xmlMemBlocks()) {
34146             printf("Leak of %d blocks found in xmlExpIsNillable",
34147                    xmlMemBlocks() - mem_base);
34148             test_ret++;
34149             printf(" %d", n_exp);
34150             printf("\n");
34151         }
34152     }
34153     function_tests++;
34154 #endif
34155
34156     return(test_ret);
34157 }
34158
34159
34160 static int
34161 test_xmlExpMaxToken(void) {
34162     int test_ret = 0;
34163
34164 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34165     int mem_base;
34166     int ret_val;
34167     xmlExpNodePtr expr; /* a compiled expression */
34168     int n_expr;
34169
34170     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
34171         mem_base = xmlMemBlocks();
34172         expr = gen_xmlExpNodePtr(n_expr, 0);
34173
34174         ret_val = xmlExpMaxToken(expr);
34175         desret_int(ret_val);
34176         call_tests++;
34177         des_xmlExpNodePtr(n_expr, expr, 0);
34178         xmlResetLastError();
34179         if (mem_base != xmlMemBlocks()) {
34180             printf("Leak of %d blocks found in xmlExpMaxToken",
34181                    xmlMemBlocks() - mem_base);
34182             test_ret++;
34183             printf(" %d", n_expr);
34184             printf("\n");
34185         }
34186     }
34187     function_tests++;
34188 #endif
34189
34190     return(test_ret);
34191 }
34192
34193
34194 static int
34195 test_xmlExpNewAtom(void) {
34196     int test_ret = 0;
34197
34198
34199     /* missing type support */
34200     return(test_ret);
34201 }
34202
34203
34204 static int
34205 test_xmlExpNewCtxt(void) {
34206     int test_ret = 0;
34207
34208
34209     /* missing type support */
34210     return(test_ret);
34211 }
34212
34213
34214 static int
34215 test_xmlExpNewOr(void) {
34216     int test_ret = 0;
34217
34218
34219     /* missing type support */
34220     return(test_ret);
34221 }
34222
34223
34224 static int
34225 test_xmlExpNewRange(void) {
34226     int test_ret = 0;
34227
34228
34229     /* missing type support */
34230     return(test_ret);
34231 }
34232
34233
34234 static int
34235 test_xmlExpNewSeq(void) {
34236     int test_ret = 0;
34237
34238
34239     /* missing type support */
34240     return(test_ret);
34241 }
34242
34243
34244 static int
34245 test_xmlExpParse(void) {
34246     int test_ret = 0;
34247
34248
34249     /* missing type support */
34250     return(test_ret);
34251 }
34252
34253
34254 static int
34255 test_xmlExpRef(void) {
34256     int test_ret = 0;
34257
34258 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34259     int mem_base;
34260     xmlExpNodePtr exp; /* the expression */
34261     int n_exp;
34262
34263     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34264         mem_base = xmlMemBlocks();
34265         exp = gen_xmlExpNodePtr(n_exp, 0);
34266
34267         xmlExpRef(exp);
34268         call_tests++;
34269         des_xmlExpNodePtr(n_exp, exp, 0);
34270         xmlResetLastError();
34271         if (mem_base != xmlMemBlocks()) {
34272             printf("Leak of %d blocks found in xmlExpRef",
34273                    xmlMemBlocks() - mem_base);
34274             test_ret++;
34275             printf(" %d", n_exp);
34276             printf("\n");
34277         }
34278     }
34279     function_tests++;
34280 #endif
34281
34282     return(test_ret);
34283 }
34284
34285
34286 static int
34287 test_xmlExpStringDerive(void) {
34288     int test_ret = 0;
34289
34290
34291     /* missing type support */
34292     return(test_ret);
34293 }
34294
34295
34296 static int
34297 test_xmlExpSubsume(void) {
34298     int test_ret = 0;
34299
34300 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34301     int mem_base;
34302     int ret_val;
34303     xmlExpCtxtPtr ctxt; /* the expressions context */
34304     int n_ctxt;
34305     xmlExpNodePtr exp; /* the englobing expression */
34306     int n_exp;
34307     xmlExpNodePtr sub; /* the subexpression */
34308     int n_sub;
34309
34310     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
34311     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34312     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
34313         mem_base = xmlMemBlocks();
34314         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
34315         exp = gen_xmlExpNodePtr(n_exp, 1);
34316         sub = gen_xmlExpNodePtr(n_sub, 2);
34317
34318         ret_val = xmlExpSubsume(ctxt, exp, sub);
34319         desret_int(ret_val);
34320         call_tests++;
34321         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
34322         des_xmlExpNodePtr(n_exp, exp, 1);
34323         des_xmlExpNodePtr(n_sub, sub, 2);
34324         xmlResetLastError();
34325         if (mem_base != xmlMemBlocks()) {
34326             printf("Leak of %d blocks found in xmlExpSubsume",
34327                    xmlMemBlocks() - mem_base);
34328             test_ret++;
34329             printf(" %d", n_ctxt);
34330             printf(" %d", n_exp);
34331             printf(" %d", n_sub);
34332             printf("\n");
34333         }
34334     }
34335     }
34336     }
34337     function_tests++;
34338 #endif
34339
34340     return(test_ret);
34341 }
34342
34343 #ifdef LIBXML_REGEXP_ENABLED
34344
34345 #define gen_nb_xmlRegExecCtxtPtr 1
34346 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34347     return(NULL);
34348 }
34349 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34350 }
34351 #endif
34352
34353
34354 static int
34355 test_xmlRegExecErrInfo(void) {
34356     int test_ret = 0;
34357
34358 #if defined(LIBXML_REGEXP_ENABLED)
34359     int mem_base;
34360     int ret_val;
34361     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
34362     int n_exec;
34363     xmlChar ** string; /* return value for the error string */
34364     int n_string;
34365     int * nbval; /* pointer to the number of accepted values IN/OUT */
34366     int n_nbval;
34367     int * nbneg; /* return number of negative transitions */
34368     int n_nbneg;
34369     xmlChar ** values; /* pointer to the array of acceptable values */
34370     int n_values;
34371     int * terminal; /* return value if this was a terminal state */
34372     int n_terminal;
34373
34374     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
34375     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
34376     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
34377     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
34378     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
34379     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
34380         mem_base = xmlMemBlocks();
34381         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
34382         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
34383         nbval = gen_int_ptr(n_nbval, 2);
34384         nbneg = gen_int_ptr(n_nbneg, 3);
34385         values = gen_xmlChar_ptr_ptr(n_values, 4);
34386         terminal = gen_int_ptr(n_terminal, 5);
34387
34388         ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
34389         desret_int(ret_val);
34390         call_tests++;
34391         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
34392         des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
34393         des_int_ptr(n_nbval, nbval, 2);
34394         des_int_ptr(n_nbneg, nbneg, 3);
34395         des_xmlChar_ptr_ptr(n_values, values, 4);
34396         des_int_ptr(n_terminal, terminal, 5);
34397         xmlResetLastError();
34398         if (mem_base != xmlMemBlocks()) {
34399             printf("Leak of %d blocks found in xmlRegExecErrInfo",
34400                    xmlMemBlocks() - mem_base);
34401             test_ret++;
34402             printf(" %d", n_exec);
34403             printf(" %d", n_string);
34404             printf(" %d", n_nbval);
34405             printf(" %d", n_nbneg);
34406             printf(" %d", n_values);
34407             printf(" %d", n_terminal);
34408             printf("\n");
34409         }
34410     }
34411     }
34412     }
34413     }
34414     }
34415     }
34416     function_tests++;
34417 #endif
34418
34419     return(test_ret);
34420 }
34421
34422
34423 static int
34424 test_xmlRegExecNextValues(void) {
34425     int test_ret = 0;
34426
34427 #if defined(LIBXML_REGEXP_ENABLED)
34428     int mem_base;
34429     int ret_val;
34430     xmlRegExecCtxtPtr exec; /* a regexp execution context */
34431     int n_exec;
34432     int * nbval; /* pointer to the number of accepted values IN/OUT */
34433     int n_nbval;
34434     int * nbneg; /* return number of negative transitions */
34435     int n_nbneg;
34436     xmlChar ** values; /* pointer to the array of acceptable values */
34437     int n_values;
34438     int * terminal; /* return value if this was a terminal state */
34439     int n_terminal;
34440
34441     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
34442     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
34443     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
34444     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
34445     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
34446         mem_base = xmlMemBlocks();
34447         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
34448         nbval = gen_int_ptr(n_nbval, 1);
34449         nbneg = gen_int_ptr(n_nbneg, 2);
34450         values = gen_xmlChar_ptr_ptr(n_values, 3);
34451         terminal = gen_int_ptr(n_terminal, 4);
34452
34453         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
34454         desret_int(ret_val);
34455         call_tests++;
34456         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
34457         des_int_ptr(n_nbval, nbval, 1);
34458         des_int_ptr(n_nbneg, nbneg, 2);
34459         des_xmlChar_ptr_ptr(n_values, values, 3);
34460         des_int_ptr(n_terminal, terminal, 4);
34461         xmlResetLastError();
34462         if (mem_base != xmlMemBlocks()) {
34463             printf("Leak of %d blocks found in xmlRegExecNextValues",
34464                    xmlMemBlocks() - mem_base);
34465             test_ret++;
34466             printf(" %d", n_exec);
34467             printf(" %d", n_nbval);
34468             printf(" %d", n_nbneg);
34469             printf(" %d", n_values);
34470             printf(" %d", n_terminal);
34471             printf("\n");
34472         }
34473     }
34474     }
34475     }
34476     }
34477     }
34478     function_tests++;
34479 #endif
34480
34481     return(test_ret);
34482 }
34483
34484
34485 static int
34486 test_xmlRegExecPushString(void) {
34487     int test_ret = 0;
34488
34489 #if defined(LIBXML_REGEXP_ENABLED)
34490     int mem_base;
34491     int ret_val;
34492     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
34493     int n_exec;
34494     xmlChar * value; /* a string token input */
34495     int n_value;
34496     void * data; /* data associated to the token to reuse in callbacks */
34497     int n_data;
34498
34499     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
34500     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34501     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
34502         mem_base = xmlMemBlocks();
34503         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
34504         value = gen_const_xmlChar_ptr(n_value, 1);
34505         data = gen_userdata(n_data, 2);
34506
34507         ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
34508         desret_int(ret_val);
34509         call_tests++;
34510         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
34511         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34512         des_userdata(n_data, data, 2);
34513         xmlResetLastError();
34514         if (mem_base != xmlMemBlocks()) {
34515             printf("Leak of %d blocks found in xmlRegExecPushString",
34516                    xmlMemBlocks() - mem_base);
34517             test_ret++;
34518             printf(" %d", n_exec);
34519             printf(" %d", n_value);
34520             printf(" %d", n_data);
34521             printf("\n");
34522         }
34523     }
34524     }
34525     }
34526     function_tests++;
34527 #endif
34528
34529     return(test_ret);
34530 }
34531
34532
34533 static int
34534 test_xmlRegExecPushString2(void) {
34535     int test_ret = 0;
34536
34537 #if defined(LIBXML_REGEXP_ENABLED)
34538     int mem_base;
34539     int ret_val;
34540     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
34541     int n_exec;
34542     xmlChar * value; /* the first string token input */
34543     int n_value;
34544     xmlChar * value2; /* the second string token input */
34545     int n_value2;
34546     void * data; /* data associated to the token to reuse in callbacks */
34547     int n_data;
34548
34549     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
34550     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34551     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
34552     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
34553         mem_base = xmlMemBlocks();
34554         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
34555         value = gen_const_xmlChar_ptr(n_value, 1);
34556         value2 = gen_const_xmlChar_ptr(n_value2, 2);
34557         data = gen_userdata(n_data, 3);
34558
34559         ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
34560         desret_int(ret_val);
34561         call_tests++;
34562         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
34563         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34564         des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
34565         des_userdata(n_data, data, 3);
34566         xmlResetLastError();
34567         if (mem_base != xmlMemBlocks()) {
34568             printf("Leak of %d blocks found in xmlRegExecPushString2",
34569                    xmlMemBlocks() - mem_base);
34570             test_ret++;
34571             printf(" %d", n_exec);
34572             printf(" %d", n_value);
34573             printf(" %d", n_value2);
34574             printf(" %d", n_data);
34575             printf("\n");
34576         }
34577     }
34578     }
34579     }
34580     }
34581     function_tests++;
34582 #endif
34583
34584     return(test_ret);
34585 }
34586
34587 #ifdef LIBXML_REGEXP_ENABLED
34588
34589 #define gen_nb_xmlRegexpPtr 1
34590 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34591     return(NULL);
34592 }
34593 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34594 }
34595 #endif
34596
34597
34598 static int
34599 test_xmlRegNewExecCtxt(void) {
34600     int test_ret = 0;
34601
34602
34603     /* missing type support */
34604     return(test_ret);
34605 }
34606
34607
34608 static int
34609 test_xmlRegexpCompile(void) {
34610     int test_ret = 0;
34611
34612
34613     /* missing type support */
34614     return(test_ret);
34615 }
34616
34617
34618 static int
34619 test_xmlRegexpExec(void) {
34620     int test_ret = 0;
34621
34622 #if defined(LIBXML_REGEXP_ENABLED)
34623     int mem_base;
34624     int ret_val;
34625     xmlRegexpPtr comp; /* the compiled regular expression */
34626     int n_comp;
34627     xmlChar * content; /* the value to check against the regular expression */
34628     int n_content;
34629
34630     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
34631     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
34632         mem_base = xmlMemBlocks();
34633         comp = gen_xmlRegexpPtr(n_comp, 0);
34634         content = gen_const_xmlChar_ptr(n_content, 1);
34635
34636         ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
34637         desret_int(ret_val);
34638         call_tests++;
34639         des_xmlRegexpPtr(n_comp, comp, 0);
34640         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
34641         xmlResetLastError();
34642         if (mem_base != xmlMemBlocks()) {
34643             printf("Leak of %d blocks found in xmlRegexpExec",
34644                    xmlMemBlocks() - mem_base);
34645             test_ret++;
34646             printf(" %d", n_comp);
34647             printf(" %d", n_content);
34648             printf("\n");
34649         }
34650     }
34651     }
34652     function_tests++;
34653 #endif
34654
34655     return(test_ret);
34656 }
34657
34658
34659 static int
34660 test_xmlRegexpIsDeterminist(void) {
34661     int test_ret = 0;
34662
34663 #if defined(LIBXML_REGEXP_ENABLED)
34664     int mem_base;
34665     int ret_val;
34666     xmlRegexpPtr comp; /* the compiled regular expression */
34667     int n_comp;
34668
34669     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
34670         mem_base = xmlMemBlocks();
34671         comp = gen_xmlRegexpPtr(n_comp, 0);
34672
34673         ret_val = xmlRegexpIsDeterminist(comp);
34674         desret_int(ret_val);
34675         call_tests++;
34676         des_xmlRegexpPtr(n_comp, comp, 0);
34677         xmlResetLastError();
34678         if (mem_base != xmlMemBlocks()) {
34679             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
34680                    xmlMemBlocks() - mem_base);
34681             test_ret++;
34682             printf(" %d", n_comp);
34683             printf("\n");
34684         }
34685     }
34686     function_tests++;
34687 #endif
34688
34689     return(test_ret);
34690 }
34691
34692
34693 static int
34694 test_xmlRegexpPrint(void) {
34695     int test_ret = 0;
34696
34697 #if defined(LIBXML_REGEXP_ENABLED)
34698     int mem_base;
34699     FILE * output; /* the file for the output debug */
34700     int n_output;
34701     xmlRegexpPtr regexp; /* the compiled regexp */
34702     int n_regexp;
34703
34704     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34705     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
34706         mem_base = xmlMemBlocks();
34707         output = gen_FILE_ptr(n_output, 0);
34708         regexp = gen_xmlRegexpPtr(n_regexp, 1);
34709
34710         xmlRegexpPrint(output, regexp);
34711         call_tests++;
34712         des_FILE_ptr(n_output, output, 0);
34713         des_xmlRegexpPtr(n_regexp, regexp, 1);
34714         xmlResetLastError();
34715         if (mem_base != xmlMemBlocks()) {
34716             printf("Leak of %d blocks found in xmlRegexpPrint",
34717                    xmlMemBlocks() - mem_base);
34718             test_ret++;
34719             printf(" %d", n_output);
34720             printf(" %d", n_regexp);
34721             printf("\n");
34722         }
34723     }
34724     }
34725     function_tests++;
34726 #endif
34727
34728     return(test_ret);
34729 }
34730
34731 static int
34732 test_xmlregexp(void) {
34733     int test_ret = 0;
34734         int rc = 0;
34735
34736     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
34737     rc = test_xmlExpCtxtNbCons();
34738         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34739     rc = test_xmlExpCtxtNbNodes();
34740         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34741     rc = test_xmlExpDump();
34742         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34743     rc = test_xmlExpExpDerive();
34744         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34745     rc = test_xmlExpGetLanguage();
34746         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34747     rc = test_xmlExpGetStart();
34748         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34749     rc = test_xmlExpIsNillable();
34750         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34751     rc = test_xmlExpMaxToken();
34752         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34753     rc = test_xmlExpNewAtom();
34754         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34755     rc = test_xmlExpNewCtxt();
34756         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34757     rc = test_xmlExpNewOr();
34758         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34759     rc = test_xmlExpNewRange();
34760         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34761     rc = test_xmlExpNewSeq();
34762         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34763     rc = test_xmlExpParse();
34764         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34765     rc = test_xmlExpRef();
34766         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34767     rc = test_xmlExpStringDerive();
34768         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34769     rc = test_xmlExpSubsume();
34770         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34771     rc = test_xmlRegExecErrInfo();
34772         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34773     rc = test_xmlRegExecNextValues();
34774         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34775     rc = test_xmlRegExecPushString();
34776         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34777     rc = test_xmlRegExecPushString2();
34778         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34779     rc = test_xmlRegNewExecCtxt();
34780         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34781     rc = test_xmlRegexpCompile();
34782         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34783     rc = test_xmlRegexpExec();
34784         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34785     rc = test_xmlRegexpIsDeterminist();
34786         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34787     rc = test_xmlRegexpPrint();
34788         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34789
34790     if (test_ret != 0)
34791         printf("Module xmlregexp: %d errors\n", test_ret);
34792     return(test_ret);
34793 }
34794 #ifdef LIBXML_OUTPUT_ENABLED
34795
34796 #define gen_nb_xmlSaveCtxtPtr 1
34797 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34798     return(NULL);
34799 }
34800 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34801 }
34802 #endif
34803
34804
34805 static int
34806 test_xmlSaveClose(void) {
34807     int test_ret = 0;
34808
34809 #if defined(LIBXML_OUTPUT_ENABLED)
34810     int mem_base;
34811     int ret_val;
34812     xmlSaveCtxtPtr ctxt; /* a document saving context */
34813     int n_ctxt;
34814
34815     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34816         mem_base = xmlMemBlocks();
34817         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34818
34819         ret_val = xmlSaveClose(ctxt);
34820         desret_int(ret_val);
34821         call_tests++;
34822         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34823         xmlResetLastError();
34824         if (mem_base != xmlMemBlocks()) {
34825             printf("Leak of %d blocks found in xmlSaveClose",
34826                    xmlMemBlocks() - mem_base);
34827             test_ret++;
34828             printf(" %d", n_ctxt);
34829             printf("\n");
34830         }
34831     }
34832     function_tests++;
34833 #endif
34834
34835     return(test_ret);
34836 }
34837
34838
34839 static int
34840 test_xmlSaveDoc(void) {
34841     int test_ret = 0;
34842
34843 #if defined(LIBXML_OUTPUT_ENABLED)
34844     int mem_base;
34845     long ret_val;
34846     xmlSaveCtxtPtr ctxt; /* a document saving context */
34847     int n_ctxt;
34848     xmlDocPtr doc; /* a document */
34849     int n_doc;
34850
34851     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34852     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34853         mem_base = xmlMemBlocks();
34854         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34855         doc = gen_xmlDocPtr(n_doc, 1);
34856
34857         ret_val = xmlSaveDoc(ctxt, doc);
34858         desret_long(ret_val);
34859         call_tests++;
34860         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34861         des_xmlDocPtr(n_doc, doc, 1);
34862         xmlResetLastError();
34863         if (mem_base != xmlMemBlocks()) {
34864             printf("Leak of %d blocks found in xmlSaveDoc",
34865                    xmlMemBlocks() - mem_base);
34866             test_ret++;
34867             printf(" %d", n_ctxt);
34868             printf(" %d", n_doc);
34869             printf("\n");
34870         }
34871     }
34872     }
34873     function_tests++;
34874 #endif
34875
34876     return(test_ret);
34877 }
34878
34879
34880 static int
34881 test_xmlSaveFlush(void) {
34882     int test_ret = 0;
34883
34884 #if defined(LIBXML_OUTPUT_ENABLED)
34885     int mem_base;
34886     int ret_val;
34887     xmlSaveCtxtPtr ctxt; /* a document saving context */
34888     int n_ctxt;
34889
34890     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34891         mem_base = xmlMemBlocks();
34892         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34893
34894         ret_val = xmlSaveFlush(ctxt);
34895         desret_int(ret_val);
34896         call_tests++;
34897         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34898         xmlResetLastError();
34899         if (mem_base != xmlMemBlocks()) {
34900             printf("Leak of %d blocks found in xmlSaveFlush",
34901                    xmlMemBlocks() - mem_base);
34902             test_ret++;
34903             printf(" %d", n_ctxt);
34904             printf("\n");
34905         }
34906     }
34907     function_tests++;
34908 #endif
34909
34910     return(test_ret);
34911 }
34912
34913
34914 static int
34915 test_xmlSaveSetAttrEscape(void) {
34916     int test_ret = 0;
34917
34918
34919     /* missing type support */
34920     return(test_ret);
34921 }
34922
34923
34924 static int
34925 test_xmlSaveSetEscape(void) {
34926     int test_ret = 0;
34927
34928
34929     /* missing type support */
34930     return(test_ret);
34931 }
34932
34933
34934 static int
34935 test_xmlSaveToBuffer(void) {
34936     int test_ret = 0;
34937
34938
34939     /* missing type support */
34940     return(test_ret);
34941 }
34942
34943
34944 static int
34945 test_xmlSaveToFd(void) {
34946     int test_ret = 0;
34947
34948
34949     /* missing type support */
34950     return(test_ret);
34951 }
34952
34953
34954 static int
34955 test_xmlSaveToFilename(void) {
34956     int test_ret = 0;
34957
34958
34959     /* missing type support */
34960     return(test_ret);
34961 }
34962
34963
34964 static int
34965 test_xmlSaveTree(void) {
34966     int test_ret = 0;
34967
34968 #if defined(LIBXML_OUTPUT_ENABLED)
34969     int mem_base;
34970     long ret_val;
34971     xmlSaveCtxtPtr ctxt; /* a document saving context */
34972     int n_ctxt;
34973     xmlNodePtr node; /* the top node of the subtree to save */
34974     int n_node;
34975
34976     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34977     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34978         mem_base = xmlMemBlocks();
34979         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34980         node = gen_xmlNodePtr(n_node, 1);
34981
34982         ret_val = xmlSaveTree(ctxt, node);
34983         desret_long(ret_val);
34984         call_tests++;
34985         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34986         des_xmlNodePtr(n_node, node, 1);
34987         xmlResetLastError();
34988         if (mem_base != xmlMemBlocks()) {
34989             printf("Leak of %d blocks found in xmlSaveTree",
34990                    xmlMemBlocks() - mem_base);
34991             test_ret++;
34992             printf(" %d", n_ctxt);
34993             printf(" %d", n_node);
34994             printf("\n");
34995         }
34996     }
34997     }
34998     function_tests++;
34999 #endif
35000
35001     return(test_ret);
35002 }
35003
35004 static int
35005 test_xmlsave(void) {
35006     int test_ret = 0;
35007         int rc = 0;
35008
35009     if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
35010     rc = test_xmlSaveClose();
35011         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35012     rc = test_xmlSaveDoc();
35013         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35014     rc = test_xmlSaveFlush();
35015         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35016     rc = test_xmlSaveSetAttrEscape();
35017         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35018     rc = test_xmlSaveSetEscape();
35019         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35020     rc = test_xmlSaveToBuffer();
35021         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35022     rc = test_xmlSaveToFd();
35023         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35024     rc = test_xmlSaveToFilename();
35025         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35026     rc = test_xmlSaveTree();
35027         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35028
35029     if (test_ret != 0)
35030         printf("Module xmlsave: %d errors\n", test_ret);
35031     return(test_ret);
35032 }
35033
35034 static int
35035 test_xmlSchemaDump(void) {
35036     int test_ret = 0;
35037
35038 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
35039     int mem_base;
35040     FILE * output; /* the file output */
35041     int n_output;
35042     xmlSchemaPtr schema; /* a schema structure */
35043     int n_schema;
35044
35045     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
35046     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
35047         mem_base = xmlMemBlocks();
35048         output = gen_FILE_ptr(n_output, 0);
35049         schema = gen_xmlSchemaPtr(n_schema, 1);
35050
35051         xmlSchemaDump(output, schema);
35052         call_tests++;
35053         des_FILE_ptr(n_output, output, 0);
35054         des_xmlSchemaPtr(n_schema, schema, 1);
35055         xmlResetLastError();
35056         if (mem_base != xmlMemBlocks()) {
35057             printf("Leak of %d blocks found in xmlSchemaDump",
35058                    xmlMemBlocks() - mem_base);
35059             test_ret++;
35060             printf(" %d", n_output);
35061             printf(" %d", n_schema);
35062             printf("\n");
35063         }
35064     }
35065     }
35066     function_tests++;
35067 #endif
35068
35069     return(test_ret);
35070 }
35071
35072 #ifdef LIBXML_SCHEMAS_ENABLED
35073
35074 #define gen_nb_xmlSchemaParserCtxtPtr 1
35075 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35076     return(NULL);
35077 }
35078 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35079 }
35080 #endif
35081
35082 #ifdef LIBXML_SCHEMAS_ENABLED
35083
35084 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
35085 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35086     return(NULL);
35087 }
35088 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35089 }
35090 #endif
35091
35092 #ifdef LIBXML_SCHEMAS_ENABLED
35093
35094 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
35095 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35096     return(NULL);
35097 }
35098 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35099 }
35100 #endif
35101
35102
35103 static int
35104 test_xmlSchemaGetParserErrors(void) {
35105     int test_ret = 0;
35106
35107 #if defined(LIBXML_SCHEMAS_ENABLED)
35108     int mem_base;
35109     int ret_val;
35110     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
35111     int n_ctxt;
35112     xmlSchemaValidityErrorFunc * err; /* the error callback result */
35113     int n_err;
35114     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
35115     int n_warn;
35116     void ** ctx; /* contextual data for the callbacks result */
35117     int n_ctx;
35118
35119     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
35120     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
35121     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
35122     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
35123         mem_base = xmlMemBlocks();
35124         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
35125         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
35126         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
35127         ctx = gen_void_ptr_ptr(n_ctx, 3);
35128
35129         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
35130         desret_int(ret_val);
35131         call_tests++;
35132         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
35133         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
35134         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
35135         des_void_ptr_ptr(n_ctx, ctx, 3);
35136         xmlResetLastError();
35137         if (mem_base != xmlMemBlocks()) {
35138             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
35139                    xmlMemBlocks() - mem_base);
35140             test_ret++;
35141             printf(" %d", n_ctxt);
35142             printf(" %d", n_err);
35143             printf(" %d", n_warn);
35144             printf(" %d", n_ctx);
35145             printf("\n");
35146         }
35147     }
35148     }
35149     }
35150     }
35151     function_tests++;
35152 #endif
35153
35154     return(test_ret);
35155 }
35156
35157
35158 static int
35159 test_xmlSchemaGetValidErrors(void) {
35160     int test_ret = 0;
35161
35162 #if defined(LIBXML_SCHEMAS_ENABLED)
35163     int mem_base;
35164     int ret_val;
35165     xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
35166     int n_ctxt;
35167     xmlSchemaValidityErrorFunc * err; /* the error function result */
35168     int n_err;
35169     xmlSchemaValidityWarningFunc * warn; /* the warning function result */
35170     int n_warn;
35171     void ** ctx; /* the functions context result */
35172     int n_ctx;
35173
35174     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35175     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
35176     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
35177     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
35178         mem_base = xmlMemBlocks();
35179         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35180         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
35181         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
35182         ctx = gen_void_ptr_ptr(n_ctx, 3);
35183
35184         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
35185         desret_int(ret_val);
35186         call_tests++;
35187         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35188         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
35189         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
35190         des_void_ptr_ptr(n_ctx, ctx, 3);
35191         xmlResetLastError();
35192         if (mem_base != xmlMemBlocks()) {
35193             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
35194                    xmlMemBlocks() - mem_base);
35195             test_ret++;
35196             printf(" %d", n_ctxt);
35197             printf(" %d", n_err);
35198             printf(" %d", n_warn);
35199             printf(" %d", n_ctx);
35200             printf("\n");
35201         }
35202     }
35203     }
35204     }
35205     }
35206     function_tests++;
35207 #endif
35208
35209     return(test_ret);
35210 }
35211
35212
35213 static int
35214 test_xmlSchemaIsValid(void) {
35215     int test_ret = 0;
35216
35217 #if defined(LIBXML_SCHEMAS_ENABLED)
35218     int mem_base;
35219     int ret_val;
35220     xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
35221     int n_ctxt;
35222
35223     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35224         mem_base = xmlMemBlocks();
35225         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35226
35227         ret_val = xmlSchemaIsValid(ctxt);
35228         desret_int(ret_val);
35229         call_tests++;
35230         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35231         xmlResetLastError();
35232         if (mem_base != xmlMemBlocks()) {
35233             printf("Leak of %d blocks found in xmlSchemaIsValid",
35234                    xmlMemBlocks() - mem_base);
35235             test_ret++;
35236             printf(" %d", n_ctxt);
35237             printf("\n");
35238         }
35239     }
35240     function_tests++;
35241 #endif
35242
35243     return(test_ret);
35244 }
35245
35246
35247 static int
35248 test_xmlSchemaNewDocParserCtxt(void) {
35249     int test_ret = 0;
35250
35251 #if defined(LIBXML_SCHEMAS_ENABLED)
35252     int mem_base;
35253     xmlSchemaParserCtxtPtr ret_val;
35254     xmlDocPtr doc; /* a preparsed document tree */
35255     int n_doc;
35256
35257     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
35258         mem_base = xmlMemBlocks();
35259         doc = gen_xmlDocPtr(n_doc, 0);
35260
35261         ret_val = xmlSchemaNewDocParserCtxt(doc);
35262         desret_xmlSchemaParserCtxtPtr(ret_val);
35263         call_tests++;
35264         des_xmlDocPtr(n_doc, doc, 0);
35265         xmlResetLastError();
35266         if (mem_base != xmlMemBlocks()) {
35267             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
35268                    xmlMemBlocks() - mem_base);
35269             test_ret++;
35270             printf(" %d", n_doc);
35271             printf("\n");
35272         }
35273     }
35274     function_tests++;
35275 #endif
35276
35277     return(test_ret);
35278 }
35279
35280
35281 static int
35282 test_xmlSchemaNewMemParserCtxt(void) {
35283     int test_ret = 0;
35284
35285 #if defined(LIBXML_SCHEMAS_ENABLED)
35286     int mem_base;
35287     xmlSchemaParserCtxtPtr ret_val;
35288     char * buffer; /* a pointer to a char array containing the schemas */
35289     int n_buffer;
35290     int size; /* the size of the array */
35291     int n_size;
35292
35293     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
35294     for (n_size = 0;n_size < gen_nb_int;n_size++) {
35295         mem_base = xmlMemBlocks();
35296         buffer = gen_const_char_ptr(n_buffer, 0);
35297         size = gen_int(n_size, 1);
35298
35299         ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
35300         desret_xmlSchemaParserCtxtPtr(ret_val);
35301         call_tests++;
35302         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
35303         des_int(n_size, size, 1);
35304         xmlResetLastError();
35305         if (mem_base != xmlMemBlocks()) {
35306             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
35307                    xmlMemBlocks() - mem_base);
35308             test_ret++;
35309             printf(" %d", n_buffer);
35310             printf(" %d", n_size);
35311             printf("\n");
35312         }
35313     }
35314     }
35315     function_tests++;
35316 #endif
35317
35318     return(test_ret);
35319 }
35320
35321
35322 static int
35323 test_xmlSchemaNewParserCtxt(void) {
35324     int test_ret = 0;
35325
35326 #if defined(LIBXML_SCHEMAS_ENABLED)
35327     int mem_base;
35328     xmlSchemaParserCtxtPtr ret_val;
35329     char * URL; /* the location of the schema */
35330     int n_URL;
35331
35332     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
35333         mem_base = xmlMemBlocks();
35334         URL = gen_const_char_ptr(n_URL, 0);
35335
35336         ret_val = xmlSchemaNewParserCtxt((const char *)URL);
35337         desret_xmlSchemaParserCtxtPtr(ret_val);
35338         call_tests++;
35339         des_const_char_ptr(n_URL, (const char *)URL, 0);
35340         xmlResetLastError();
35341         if (mem_base != xmlMemBlocks()) {
35342             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
35343                    xmlMemBlocks() - mem_base);
35344             test_ret++;
35345             printf(" %d", n_URL);
35346             printf("\n");
35347         }
35348     }
35349     function_tests++;
35350 #endif
35351
35352     return(test_ret);
35353 }
35354
35355
35356 static int
35357 test_xmlSchemaNewValidCtxt(void) {
35358     int test_ret = 0;
35359
35360
35361     /* missing type support */
35362     return(test_ret);
35363 }
35364
35365
35366 static int
35367 test_xmlSchemaParse(void) {
35368     int test_ret = 0;
35369
35370
35371     /* missing type support */
35372     return(test_ret);
35373 }
35374
35375 #ifdef LIBXML_SCHEMAS_ENABLED
35376
35377 #define gen_nb_xmlSAXHandlerPtr_ptr 1
35378 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35379     return(NULL);
35380 }
35381 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35382 }
35383 #endif
35384
35385
35386 static int
35387 test_xmlSchemaSAXPlug(void) {
35388     int test_ret = 0;
35389
35390
35391     /* missing type support */
35392     return(test_ret);
35393 }
35394
35395 #ifdef LIBXML_SCHEMAS_ENABLED
35396
35397 #define gen_nb_xmlSchemaSAXPlugPtr 1
35398 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35399     return(NULL);
35400 }
35401 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35402 }
35403 #endif
35404
35405
35406 static int
35407 test_xmlSchemaSAXUnplug(void) {
35408     int test_ret = 0;
35409
35410 #if defined(LIBXML_SCHEMAS_ENABLED)
35411     int mem_base;
35412     int ret_val;
35413     xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
35414     int n_plug;
35415
35416     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
35417         mem_base = xmlMemBlocks();
35418         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
35419
35420         ret_val = xmlSchemaSAXUnplug(plug);
35421         desret_int(ret_val);
35422         call_tests++;
35423         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
35424         xmlResetLastError();
35425         if (mem_base != xmlMemBlocks()) {
35426             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
35427                    xmlMemBlocks() - mem_base);
35428             test_ret++;
35429             printf(" %d", n_plug);
35430             printf("\n");
35431         }
35432     }
35433     function_tests++;
35434 #endif
35435
35436     return(test_ret);
35437 }
35438
35439
35440 static int
35441 test_xmlSchemaSetParserErrors(void) {
35442     int test_ret = 0;
35443
35444
35445     /* missing type support */
35446     return(test_ret);
35447 }
35448
35449
35450 static int
35451 test_xmlSchemaSetParserStructuredErrors(void) {
35452     int test_ret = 0;
35453
35454
35455     /* missing type support */
35456     return(test_ret);
35457 }
35458
35459
35460 static int
35461 test_xmlSchemaSetValidErrors(void) {
35462     int test_ret = 0;
35463
35464
35465     /* missing type support */
35466     return(test_ret);
35467 }
35468
35469
35470 static int
35471 test_xmlSchemaSetValidOptions(void) {
35472     int test_ret = 0;
35473
35474 #if defined(LIBXML_SCHEMAS_ENABLED)
35475     int mem_base;
35476     int ret_val;
35477     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35478     int n_ctxt;
35479     int options; /* a combination of xmlSchemaValidOption */
35480     int n_options;
35481
35482     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35483     for (n_options = 0;n_options < gen_nb_int;n_options++) {
35484         mem_base = xmlMemBlocks();
35485         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35486         options = gen_int(n_options, 1);
35487
35488         ret_val = xmlSchemaSetValidOptions(ctxt, options);
35489         desret_int(ret_val);
35490         call_tests++;
35491         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35492         des_int(n_options, options, 1);
35493         xmlResetLastError();
35494         if (mem_base != xmlMemBlocks()) {
35495             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
35496                    xmlMemBlocks() - mem_base);
35497             test_ret++;
35498             printf(" %d", n_ctxt);
35499             printf(" %d", n_options);
35500             printf("\n");
35501         }
35502     }
35503     }
35504     function_tests++;
35505 #endif
35506
35507     return(test_ret);
35508 }
35509
35510
35511 static int
35512 test_xmlSchemaSetValidStructuredErrors(void) {
35513     int test_ret = 0;
35514
35515
35516     /* missing type support */
35517     return(test_ret);
35518 }
35519
35520
35521 static int
35522 test_xmlSchemaValidCtxtGetOptions(void) {
35523     int test_ret = 0;
35524
35525 #if defined(LIBXML_SCHEMAS_ENABLED)
35526     int mem_base;
35527     int ret_val;
35528     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35529     int n_ctxt;
35530
35531     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35532         mem_base = xmlMemBlocks();
35533         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35534
35535         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
35536         desret_int(ret_val);
35537         call_tests++;
35538         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35539         xmlResetLastError();
35540         if (mem_base != xmlMemBlocks()) {
35541             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
35542                    xmlMemBlocks() - mem_base);
35543             test_ret++;
35544             printf(" %d", n_ctxt);
35545             printf("\n");
35546         }
35547     }
35548     function_tests++;
35549 #endif
35550
35551     return(test_ret);
35552 }
35553
35554
35555 static int
35556 test_xmlSchemaValidCtxtGetParserCtxt(void) {
35557     int test_ret = 0;
35558
35559 #if defined(LIBXML_SCHEMAS_ENABLED)
35560     int mem_base;
35561     xmlParserCtxtPtr ret_val;
35562     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35563     int n_ctxt;
35564
35565     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35566         mem_base = xmlMemBlocks();
35567         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35568
35569         ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
35570         desret_xmlParserCtxtPtr(ret_val);
35571         call_tests++;
35572         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35573         xmlResetLastError();
35574         if (mem_base != xmlMemBlocks()) {
35575             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
35576                    xmlMemBlocks() - mem_base);
35577             test_ret++;
35578             printf(" %d", n_ctxt);
35579             printf("\n");
35580         }
35581     }
35582     function_tests++;
35583 #endif
35584
35585     return(test_ret);
35586 }
35587
35588
35589 static int
35590 test_xmlSchemaValidateDoc(void) {
35591     int test_ret = 0;
35592
35593 #if defined(LIBXML_SCHEMAS_ENABLED)
35594     int mem_base;
35595     int ret_val;
35596     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35597     int n_ctxt;
35598     xmlDocPtr doc; /* a parsed document tree */
35599     int n_doc;
35600
35601     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35602     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
35603         mem_base = xmlMemBlocks();
35604         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35605         doc = gen_xmlDocPtr(n_doc, 1);
35606
35607         ret_val = xmlSchemaValidateDoc(ctxt, doc);
35608         desret_int(ret_val);
35609         call_tests++;
35610         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35611         des_xmlDocPtr(n_doc, doc, 1);
35612         xmlResetLastError();
35613         if (mem_base != xmlMemBlocks()) {
35614             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
35615                    xmlMemBlocks() - mem_base);
35616             test_ret++;
35617             printf(" %d", n_ctxt);
35618             printf(" %d", n_doc);
35619             printf("\n");
35620         }
35621     }
35622     }
35623     function_tests++;
35624 #endif
35625
35626     return(test_ret);
35627 }
35628
35629
35630 static int
35631 test_xmlSchemaValidateFile(void) {
35632     int test_ret = 0;
35633
35634 #if defined(LIBXML_SCHEMAS_ENABLED)
35635     int mem_base;
35636     int ret_val;
35637     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35638     int n_ctxt;
35639     const char * filename; /* the URI of the instance */
35640     int n_filename;
35641     int options; /* a future set of options, currently unused */
35642     int n_options;
35643
35644     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35645     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
35646     for (n_options = 0;n_options < gen_nb_int;n_options++) {
35647         mem_base = xmlMemBlocks();
35648         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35649         filename = gen_filepath(n_filename, 1);
35650         options = gen_int(n_options, 2);
35651
35652         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
35653         desret_int(ret_val);
35654         call_tests++;
35655         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35656         des_filepath(n_filename, filename, 1);
35657         des_int(n_options, options, 2);
35658         xmlResetLastError();
35659         if (mem_base != xmlMemBlocks()) {
35660             printf("Leak of %d blocks found in xmlSchemaValidateFile",
35661                    xmlMemBlocks() - mem_base);
35662             test_ret++;
35663             printf(" %d", n_ctxt);
35664             printf(" %d", n_filename);
35665             printf(" %d", n_options);
35666             printf("\n");
35667         }
35668     }
35669     }
35670     }
35671     function_tests++;
35672 #endif
35673
35674     return(test_ret);
35675 }
35676
35677
35678 static int
35679 test_xmlSchemaValidateOneElement(void) {
35680     int test_ret = 0;
35681
35682 #if defined(LIBXML_SCHEMAS_ENABLED)
35683     int mem_base;
35684     int ret_val;
35685     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35686     int n_ctxt;
35687     xmlNodePtr elem; /* an element node */
35688     int n_elem;
35689
35690     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35691     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
35692         mem_base = xmlMemBlocks();
35693         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35694         elem = gen_xmlNodePtr(n_elem, 1);
35695
35696         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
35697         desret_int(ret_val);
35698         call_tests++;
35699         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35700         des_xmlNodePtr(n_elem, elem, 1);
35701         xmlResetLastError();
35702         if (mem_base != xmlMemBlocks()) {
35703             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
35704                    xmlMemBlocks() - mem_base);
35705             test_ret++;
35706             printf(" %d", n_ctxt);
35707             printf(" %d", n_elem);
35708             printf("\n");
35709         }
35710     }
35711     }
35712     function_tests++;
35713 #endif
35714
35715     return(test_ret);
35716 }
35717
35718
35719 static int
35720 test_xmlSchemaValidateSetFilename(void) {
35721     int test_ret = 0;
35722
35723 #if defined(LIBXML_SCHEMAS_ENABLED)
35724     int mem_base;
35725     xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
35726     int n_vctxt;
35727     const char * filename; /* the file name */
35728     int n_filename;
35729
35730     for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
35731     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
35732         mem_base = xmlMemBlocks();
35733         vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
35734         filename = gen_filepath(n_filename, 1);
35735
35736         xmlSchemaValidateSetFilename(vctxt, filename);
35737         call_tests++;
35738         des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
35739         des_filepath(n_filename, filename, 1);
35740         xmlResetLastError();
35741         if (mem_base != xmlMemBlocks()) {
35742             printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
35743                    xmlMemBlocks() - mem_base);
35744             test_ret++;
35745             printf(" %d", n_vctxt);
35746             printf(" %d", n_filename);
35747             printf("\n");
35748         }
35749     }
35750     }
35751     function_tests++;
35752 #endif
35753
35754     return(test_ret);
35755 }
35756
35757
35758 static int
35759 test_xmlSchemaValidateSetLocator(void) {
35760     int test_ret = 0;
35761
35762
35763     /* missing type support */
35764     return(test_ret);
35765 }
35766
35767
35768 static int
35769 test_xmlSchemaValidateStream(void) {
35770     int test_ret = 0;
35771
35772 #if defined(LIBXML_SCHEMAS_ENABLED)
35773     int mem_base;
35774     int ret_val;
35775     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35776     int n_ctxt;
35777     xmlParserInputBufferPtr input; /* the input to use for reading the data */
35778     int n_input;
35779     xmlCharEncoding enc; /* an optional encoding information */
35780     int n_enc;
35781     xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
35782     int n_sax;
35783     void * user_data; /* the context to provide to the SAX handler. */
35784     int n_user_data;
35785
35786     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35787     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
35788     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
35789     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
35790     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
35791         mem_base = xmlMemBlocks();
35792         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35793         input = gen_xmlParserInputBufferPtr(n_input, 1);
35794         enc = gen_xmlCharEncoding(n_enc, 2);
35795         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
35796         user_data = gen_userdata(n_user_data, 4);
35797
35798         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
35799         desret_int(ret_val);
35800         call_tests++;
35801         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35802         des_xmlParserInputBufferPtr(n_input, input, 1);
35803         des_xmlCharEncoding(n_enc, enc, 2);
35804         des_xmlSAXHandlerPtr(n_sax, sax, 3);
35805         des_userdata(n_user_data, user_data, 4);
35806         xmlResetLastError();
35807         if (mem_base != xmlMemBlocks()) {
35808             printf("Leak of %d blocks found in xmlSchemaValidateStream",
35809                    xmlMemBlocks() - mem_base);
35810             test_ret++;
35811             printf(" %d", n_ctxt);
35812             printf(" %d", n_input);
35813             printf(" %d", n_enc);
35814             printf(" %d", n_sax);
35815             printf(" %d", n_user_data);
35816             printf("\n");
35817         }
35818     }
35819     }
35820     }
35821     }
35822     }
35823     function_tests++;
35824 #endif
35825
35826     return(test_ret);
35827 }
35828
35829 static int
35830 test_xmlschemas(void) {
35831     int test_ret = 0;
35832         int rc = 0;
35833
35834     if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
35835     rc = test_xmlSchemaDump();
35836         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35837     rc = test_xmlSchemaGetParserErrors();
35838         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35839     rc = test_xmlSchemaGetValidErrors();
35840         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35841     rc = test_xmlSchemaIsValid();
35842         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35843     rc = test_xmlSchemaNewDocParserCtxt();
35844         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35845     rc = test_xmlSchemaNewMemParserCtxt();
35846         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35847     rc = test_xmlSchemaNewParserCtxt();
35848         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35849     rc = test_xmlSchemaNewValidCtxt();
35850         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35851     rc = test_xmlSchemaParse();
35852         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35853     rc = test_xmlSchemaSAXPlug();
35854         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35855     rc = test_xmlSchemaSAXUnplug();
35856         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35857     rc = test_xmlSchemaSetParserErrors();
35858         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35859     rc = test_xmlSchemaSetParserStructuredErrors();
35860         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35861     rc = test_xmlSchemaSetValidErrors();
35862         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35863     rc = test_xmlSchemaSetValidOptions();
35864         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35865     rc = test_xmlSchemaSetValidStructuredErrors();
35866         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35867     rc = test_xmlSchemaValidCtxtGetOptions();
35868         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35869     rc = test_xmlSchemaValidCtxtGetParserCtxt();
35870         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35871     rc = test_xmlSchemaValidateDoc();
35872         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35873     rc = test_xmlSchemaValidateFile();
35874         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35875     rc = test_xmlSchemaValidateOneElement();
35876         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35877     rc = test_xmlSchemaValidateSetFilename();
35878         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35879     rc = test_xmlSchemaValidateSetLocator();
35880         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35881     rc = test_xmlSchemaValidateStream();
35882         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35883
35884     if (test_ret != 0)
35885         printf("Module xmlschemas: %d errors\n", test_ret);
35886     return(test_ret);
35887 }
35888 #ifdef LIBXML_SCHEMAS_ENABLED
35889
35890 #define gen_nb_xmlSchemaFacetPtr 1
35891 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35892     return(NULL);
35893 }
35894 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35895 }
35896 #endif
35897
35898 #ifdef LIBXML_SCHEMAS_ENABLED
35899
35900 #define gen_nb_xmlSchemaTypePtr 1
35901 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35902     return(NULL);
35903 }
35904 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35905 }
35906 #endif
35907
35908
35909 static int
35910 test_xmlSchemaCheckFacet(void) {
35911     int test_ret = 0;
35912
35913 #if defined(LIBXML_SCHEMAS_ENABLED)
35914     int mem_base;
35915     int ret_val;
35916     xmlSchemaFacetPtr facet; /* the facet */
35917     int n_facet;
35918     xmlSchemaTypePtr typeDecl; /* the schema type definition */
35919     int n_typeDecl;
35920     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
35921     int n_pctxt;
35922     xmlChar * name; /* the optional name of the type */
35923     int n_name;
35924
35925     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35926     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
35927     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
35928     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35929         mem_base = xmlMemBlocks();
35930         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35931         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
35932         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
35933         name = gen_const_xmlChar_ptr(n_name, 3);
35934
35935         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
35936         desret_int(ret_val);
35937         call_tests++;
35938         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35939         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
35940         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
35941         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
35942         xmlResetLastError();
35943         if (mem_base != xmlMemBlocks()) {
35944             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
35945                    xmlMemBlocks() - mem_base);
35946             test_ret++;
35947             printf(" %d", n_facet);
35948             printf(" %d", n_typeDecl);
35949             printf(" %d", n_pctxt);
35950             printf(" %d", n_name);
35951             printf("\n");
35952         }
35953     }
35954     }
35955     }
35956     }
35957     function_tests++;
35958 #endif
35959
35960     return(test_ret);
35961 }
35962
35963
35964 static int
35965 test_xmlSchemaCleanupTypes(void) {
35966     int test_ret = 0;
35967
35968 #if defined(LIBXML_SCHEMAS_ENABLED)
35969
35970
35971         xmlSchemaCleanupTypes();
35972         call_tests++;
35973         xmlResetLastError();
35974     function_tests++;
35975 #endif
35976
35977     return(test_ret);
35978 }
35979
35980
35981 static int
35982 test_xmlSchemaCollapseString(void) {
35983     int test_ret = 0;
35984
35985 #if defined(LIBXML_SCHEMAS_ENABLED)
35986     int mem_base;
35987     xmlChar * ret_val;
35988     xmlChar * value; /* a value */
35989     int n_value;
35990
35991     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35992         mem_base = xmlMemBlocks();
35993         value = gen_const_xmlChar_ptr(n_value, 0);
35994
35995         ret_val = xmlSchemaCollapseString((const xmlChar *)value);
35996         desret_xmlChar_ptr(ret_val);
35997         call_tests++;
35998         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35999         xmlResetLastError();
36000         if (mem_base != xmlMemBlocks()) {
36001             printf("Leak of %d blocks found in xmlSchemaCollapseString",
36002                    xmlMemBlocks() - mem_base);
36003             test_ret++;
36004             printf(" %d", n_value);
36005             printf("\n");
36006         }
36007     }
36008     function_tests++;
36009 #endif
36010
36011     return(test_ret);
36012 }
36013
36014 #ifdef LIBXML_SCHEMAS_ENABLED
36015
36016 #define gen_nb_xmlSchemaValPtr 1
36017 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36018     return(NULL);
36019 }
36020 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36021 }
36022 #endif
36023
36024
36025 static int
36026 test_xmlSchemaCompareValues(void) {
36027     int test_ret = 0;
36028
36029 #if defined(LIBXML_SCHEMAS_ENABLED)
36030     int mem_base;
36031     int ret_val;
36032     xmlSchemaValPtr x; /* a first value */
36033     int n_x;
36034     xmlSchemaValPtr y; /* a second value */
36035     int n_y;
36036
36037     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
36038     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
36039         mem_base = xmlMemBlocks();
36040         x = gen_xmlSchemaValPtr(n_x, 0);
36041         y = gen_xmlSchemaValPtr(n_y, 1);
36042
36043         ret_val = xmlSchemaCompareValues(x, y);
36044         desret_int(ret_val);
36045         call_tests++;
36046         des_xmlSchemaValPtr(n_x, x, 0);
36047         des_xmlSchemaValPtr(n_y, y, 1);
36048         xmlResetLastError();
36049         if (mem_base != xmlMemBlocks()) {
36050             printf("Leak of %d blocks found in xmlSchemaCompareValues",
36051                    xmlMemBlocks() - mem_base);
36052             test_ret++;
36053             printf(" %d", n_x);
36054             printf(" %d", n_y);
36055             printf("\n");
36056         }
36057     }
36058     }
36059     function_tests++;
36060 #endif
36061
36062     return(test_ret);
36063 }
36064
36065
36066 static int
36067 test_xmlSchemaCompareValuesWhtsp(void) {
36068     int test_ret = 0;
36069
36070 #if defined(LIBXML_SCHEMAS_ENABLED)
36071     int mem_base;
36072     int ret_val;
36073     xmlSchemaValPtr x; /* a first value */
36074     int n_x;
36075     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
36076     int n_xws;
36077     xmlSchemaValPtr y; /* a second value */
36078     int n_y;
36079     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
36080     int n_yws;
36081
36082     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
36083     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
36084     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
36085     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
36086         mem_base = xmlMemBlocks();
36087         x = gen_xmlSchemaValPtr(n_x, 0);
36088         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
36089         y = gen_xmlSchemaValPtr(n_y, 2);
36090         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
36091
36092         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
36093         desret_int(ret_val);
36094         call_tests++;
36095         des_xmlSchemaValPtr(n_x, x, 0);
36096         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
36097         des_xmlSchemaValPtr(n_y, y, 2);
36098         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
36099         xmlResetLastError();
36100         if (mem_base != xmlMemBlocks()) {
36101             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
36102                    xmlMemBlocks() - mem_base);
36103             test_ret++;
36104             printf(" %d", n_x);
36105             printf(" %d", n_xws);
36106             printf(" %d", n_y);
36107             printf(" %d", n_yws);
36108             printf("\n");
36109         }
36110     }
36111     }
36112     }
36113     }
36114     function_tests++;
36115 #endif
36116
36117     return(test_ret);
36118 }
36119
36120
36121 static int
36122 test_xmlSchemaCopyValue(void) {
36123     int test_ret = 0;
36124
36125
36126     /* missing type support */
36127     return(test_ret);
36128 }
36129
36130
36131 static int
36132 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
36133     int test_ret = 0;
36134
36135 #if defined(LIBXML_SCHEMAS_ENABLED)
36136     int mem_base;
36137     xmlSchemaTypePtr ret_val;
36138     xmlSchemaTypePtr type; /* the built-in simple type. */
36139     int n_type;
36140
36141     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36142         mem_base = xmlMemBlocks();
36143         type = gen_xmlSchemaTypePtr(n_type, 0);
36144
36145         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
36146         desret_xmlSchemaTypePtr(ret_val);
36147         call_tests++;
36148         des_xmlSchemaTypePtr(n_type, type, 0);
36149         xmlResetLastError();
36150         if (mem_base != xmlMemBlocks()) {
36151             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
36152                    xmlMemBlocks() - mem_base);
36153             test_ret++;
36154             printf(" %d", n_type);
36155             printf("\n");
36156         }
36157     }
36158     function_tests++;
36159 #endif
36160
36161     return(test_ret);
36162 }
36163
36164
36165 static int
36166 test_xmlSchemaGetBuiltInType(void) {
36167     int test_ret = 0;
36168
36169 #if defined(LIBXML_SCHEMAS_ENABLED)
36170     xmlSchemaTypePtr ret_val;
36171     xmlSchemaValType type; /* the type of the built in type */
36172     int n_type;
36173
36174     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
36175         type = gen_xmlSchemaValType(n_type, 0);
36176
36177         ret_val = xmlSchemaGetBuiltInType(type);
36178         desret_xmlSchemaTypePtr(ret_val);
36179         call_tests++;
36180         des_xmlSchemaValType(n_type, type, 0);
36181         xmlResetLastError();
36182     }
36183     function_tests++;
36184 #endif
36185
36186     return(test_ret);
36187 }
36188
36189
36190 static int
36191 test_xmlSchemaGetCanonValue(void) {
36192     int test_ret = 0;
36193
36194 #if defined(LIBXML_SCHEMAS_ENABLED)
36195     int mem_base;
36196     int ret_val;
36197     xmlSchemaValPtr val; /* the precomputed value */
36198     int n_val;
36199     xmlChar ** retValue; /* the returned value */
36200     int n_retValue;
36201
36202     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36203     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
36204         mem_base = xmlMemBlocks();
36205         val = gen_xmlSchemaValPtr(n_val, 0);
36206         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
36207
36208         ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
36209         desret_int(ret_val);
36210         call_tests++;
36211         des_xmlSchemaValPtr(n_val, val, 0);
36212         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
36213         xmlResetLastError();
36214         if (mem_base != xmlMemBlocks()) {
36215             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
36216                    xmlMemBlocks() - mem_base);
36217             test_ret++;
36218             printf(" %d", n_val);
36219             printf(" %d", n_retValue);
36220             printf("\n");
36221         }
36222     }
36223     }
36224     function_tests++;
36225 #endif
36226
36227     return(test_ret);
36228 }
36229
36230
36231 static int
36232 test_xmlSchemaGetCanonValueWhtsp(void) {
36233     int test_ret = 0;
36234
36235 #if defined(LIBXML_SCHEMAS_ENABLED)
36236     int mem_base;
36237     int ret_val;
36238     xmlSchemaValPtr val; /* the precomputed value */
36239     int n_val;
36240     xmlChar ** retValue; /* the returned value */
36241     int n_retValue;
36242     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36243     int n_ws;
36244
36245     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36246     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
36247     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36248         mem_base = xmlMemBlocks();
36249         val = gen_xmlSchemaValPtr(n_val, 0);
36250         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
36251         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
36252
36253         ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
36254         desret_int(ret_val);
36255         call_tests++;
36256         des_xmlSchemaValPtr(n_val, val, 0);
36257         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
36258         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
36259         xmlResetLastError();
36260         if (mem_base != xmlMemBlocks()) {
36261             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
36262                    xmlMemBlocks() - mem_base);
36263             test_ret++;
36264             printf(" %d", n_val);
36265             printf(" %d", n_retValue);
36266             printf(" %d", n_ws);
36267             printf("\n");
36268         }
36269     }
36270     }
36271     }
36272     function_tests++;
36273 #endif
36274
36275     return(test_ret);
36276 }
36277
36278
36279 static int
36280 test_xmlSchemaGetFacetValueAsULong(void) {
36281     int test_ret = 0;
36282
36283 #if defined(LIBXML_SCHEMAS_ENABLED)
36284     int mem_base;
36285     unsigned long ret_val;
36286     xmlSchemaFacetPtr facet; /* an schemas type facet */
36287     int n_facet;
36288
36289     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36290         mem_base = xmlMemBlocks();
36291         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36292
36293         ret_val = xmlSchemaGetFacetValueAsULong(facet);
36294         desret_unsigned_long(ret_val);
36295         call_tests++;
36296         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36297         xmlResetLastError();
36298         if (mem_base != xmlMemBlocks()) {
36299             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
36300                    xmlMemBlocks() - mem_base);
36301             test_ret++;
36302             printf(" %d", n_facet);
36303             printf("\n");
36304         }
36305     }
36306     function_tests++;
36307 #endif
36308
36309     return(test_ret);
36310 }
36311
36312
36313 static int
36314 test_xmlSchemaGetPredefinedType(void) {
36315     int test_ret = 0;
36316
36317 #if defined(LIBXML_SCHEMAS_ENABLED)
36318     int mem_base;
36319     xmlSchemaTypePtr ret_val;
36320     xmlChar * name; /* the type name */
36321     int n_name;
36322     xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
36323     int n_ns;
36324
36325     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36326     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
36327         mem_base = xmlMemBlocks();
36328         name = gen_const_xmlChar_ptr(n_name, 0);
36329         ns = gen_const_xmlChar_ptr(n_ns, 1);
36330
36331         ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
36332         desret_xmlSchemaTypePtr(ret_val);
36333         call_tests++;
36334         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
36335         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
36336         xmlResetLastError();
36337         if (mem_base != xmlMemBlocks()) {
36338             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
36339                    xmlMemBlocks() - mem_base);
36340             test_ret++;
36341             printf(" %d", n_name);
36342             printf(" %d", n_ns);
36343             printf("\n");
36344         }
36345     }
36346     }
36347     function_tests++;
36348 #endif
36349
36350     return(test_ret);
36351 }
36352
36353
36354 static int
36355 test_xmlSchemaGetValType(void) {
36356     int test_ret = 0;
36357
36358 #if defined(LIBXML_SCHEMAS_ENABLED)
36359     int mem_base;
36360     xmlSchemaValType ret_val;
36361     xmlSchemaValPtr val; /* a schemas value */
36362     int n_val;
36363
36364     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36365         mem_base = xmlMemBlocks();
36366         val = gen_xmlSchemaValPtr(n_val, 0);
36367
36368         ret_val = xmlSchemaGetValType(val);
36369         desret_xmlSchemaValType(ret_val);
36370         call_tests++;
36371         des_xmlSchemaValPtr(n_val, val, 0);
36372         xmlResetLastError();
36373         if (mem_base != xmlMemBlocks()) {
36374             printf("Leak of %d blocks found in xmlSchemaGetValType",
36375                    xmlMemBlocks() - mem_base);
36376             test_ret++;
36377             printf(" %d", n_val);
36378             printf("\n");
36379         }
36380     }
36381     function_tests++;
36382 #endif
36383
36384     return(test_ret);
36385 }
36386
36387
36388 static int
36389 test_xmlSchemaInitTypes(void) {
36390     int test_ret = 0;
36391
36392 #if defined(LIBXML_SCHEMAS_ENABLED)
36393
36394
36395         xmlSchemaInitTypes();
36396         call_tests++;
36397         xmlResetLastError();
36398     function_tests++;
36399 #endif
36400
36401     return(test_ret);
36402 }
36403
36404
36405 static int
36406 test_xmlSchemaIsBuiltInTypeFacet(void) {
36407     int test_ret = 0;
36408
36409 #if defined(LIBXML_SCHEMAS_ENABLED)
36410     int mem_base;
36411     int ret_val;
36412     xmlSchemaTypePtr type; /* the built-in type */
36413     int n_type;
36414     int facetType; /* the facet type */
36415     int n_facetType;
36416
36417     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36418     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
36419         mem_base = xmlMemBlocks();
36420         type = gen_xmlSchemaTypePtr(n_type, 0);
36421         facetType = gen_int(n_facetType, 1);
36422
36423         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
36424         desret_int(ret_val);
36425         call_tests++;
36426         des_xmlSchemaTypePtr(n_type, type, 0);
36427         des_int(n_facetType, facetType, 1);
36428         xmlResetLastError();
36429         if (mem_base != xmlMemBlocks()) {
36430             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
36431                    xmlMemBlocks() - mem_base);
36432             test_ret++;
36433             printf(" %d", n_type);
36434             printf(" %d", n_facetType);
36435             printf("\n");
36436         }
36437     }
36438     }
36439     function_tests++;
36440 #endif
36441
36442     return(test_ret);
36443 }
36444
36445
36446 static int
36447 test_xmlSchemaNewFacet(void) {
36448     int test_ret = 0;
36449
36450
36451     /* missing type support */
36452     return(test_ret);
36453 }
36454
36455
36456 static int
36457 test_xmlSchemaNewNOTATIONValue(void) {
36458     int test_ret = 0;
36459
36460
36461     /* missing type support */
36462     return(test_ret);
36463 }
36464
36465
36466 static int
36467 test_xmlSchemaNewQNameValue(void) {
36468     int test_ret = 0;
36469
36470
36471     /* missing type support */
36472     return(test_ret);
36473 }
36474
36475
36476 static int
36477 test_xmlSchemaNewStringValue(void) {
36478     int test_ret = 0;
36479
36480
36481     /* missing type support */
36482     return(test_ret);
36483 }
36484
36485 #ifdef LIBXML_SCHEMAS_ENABLED
36486
36487 #define gen_nb_xmlSchemaValPtr_ptr 1
36488 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36489     return(NULL);
36490 }
36491 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36492 }
36493 #endif
36494
36495
36496 static int
36497 test_xmlSchemaValPredefTypeNode(void) {
36498     int test_ret = 0;
36499
36500 #if defined(LIBXML_SCHEMAS_ENABLED)
36501     int mem_base;
36502     int ret_val;
36503     xmlSchemaTypePtr type; /* the predefined type */
36504     int n_type;
36505     xmlChar * value; /* the value to check */
36506     int n_value;
36507     xmlSchemaValPtr * val; /* the return computed value */
36508     int n_val;
36509     xmlNodePtr node; /* the node containing the value */
36510     int n_node;
36511
36512     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36513     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36514     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36515     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
36516         mem_base = xmlMemBlocks();
36517         type = gen_xmlSchemaTypePtr(n_type, 0);
36518         value = gen_const_xmlChar_ptr(n_value, 1);
36519         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36520         node = gen_xmlNodePtr(n_node, 3);
36521
36522         ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
36523         desret_int(ret_val);
36524         call_tests++;
36525         des_xmlSchemaTypePtr(n_type, type, 0);
36526         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36527         des_xmlSchemaValPtr_ptr(n_val, val, 2);
36528         des_xmlNodePtr(n_node, node, 3);
36529         xmlResetLastError();
36530         if (mem_base != xmlMemBlocks()) {
36531             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
36532                    xmlMemBlocks() - mem_base);
36533             test_ret++;
36534             printf(" %d", n_type);
36535             printf(" %d", n_value);
36536             printf(" %d", n_val);
36537             printf(" %d", n_node);
36538             printf("\n");
36539         }
36540     }
36541     }
36542     }
36543     }
36544     function_tests++;
36545 #endif
36546
36547     return(test_ret);
36548 }
36549
36550
36551 static int
36552 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
36553     int test_ret = 0;
36554
36555 #if defined(LIBXML_SCHEMAS_ENABLED)
36556     int mem_base;
36557     int ret_val;
36558     xmlSchemaTypePtr type; /* the predefined type */
36559     int n_type;
36560     xmlChar * value; /* the value to check */
36561     int n_value;
36562     xmlSchemaValPtr * val; /* the return computed value */
36563     int n_val;
36564     xmlNodePtr node; /* the node containing the value */
36565     int n_node;
36566
36567     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36568     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36569     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36570     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
36571         mem_base = xmlMemBlocks();
36572         type = gen_xmlSchemaTypePtr(n_type, 0);
36573         value = gen_const_xmlChar_ptr(n_value, 1);
36574         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36575         node = gen_xmlNodePtr(n_node, 3);
36576
36577         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
36578         desret_int(ret_val);
36579         call_tests++;
36580         des_xmlSchemaTypePtr(n_type, type, 0);
36581         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36582         des_xmlSchemaValPtr_ptr(n_val, val, 2);
36583         des_xmlNodePtr(n_node, node, 3);
36584         xmlResetLastError();
36585         if (mem_base != xmlMemBlocks()) {
36586             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
36587                    xmlMemBlocks() - mem_base);
36588             test_ret++;
36589             printf(" %d", n_type);
36590             printf(" %d", n_value);
36591             printf(" %d", n_val);
36592             printf(" %d", n_node);
36593             printf("\n");
36594         }
36595     }
36596     }
36597     }
36598     }
36599     function_tests++;
36600 #endif
36601
36602     return(test_ret);
36603 }
36604
36605
36606 static int
36607 test_xmlSchemaValidateFacet(void) {
36608     int test_ret = 0;
36609
36610 #if defined(LIBXML_SCHEMAS_ENABLED)
36611     int mem_base;
36612     int ret_val;
36613     xmlSchemaTypePtr base; /* the base type */
36614     int n_base;
36615     xmlSchemaFacetPtr facet; /* the facet to check */
36616     int n_facet;
36617     xmlChar * value; /* the lexical repr of the value to validate */
36618     int n_value;
36619     xmlSchemaValPtr val; /* the precomputed value */
36620     int n_val;
36621
36622     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
36623     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36624     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36625     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36626         mem_base = xmlMemBlocks();
36627         base = gen_xmlSchemaTypePtr(n_base, 0);
36628         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
36629         value = gen_const_xmlChar_ptr(n_value, 2);
36630         val = gen_xmlSchemaValPtr(n_val, 3);
36631
36632         ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
36633         desret_int(ret_val);
36634         call_tests++;
36635         des_xmlSchemaTypePtr(n_base, base, 0);
36636         des_xmlSchemaFacetPtr(n_facet, facet, 1);
36637         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36638         des_xmlSchemaValPtr(n_val, val, 3);
36639         xmlResetLastError();
36640         if (mem_base != xmlMemBlocks()) {
36641             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
36642                    xmlMemBlocks() - mem_base);
36643             test_ret++;
36644             printf(" %d", n_base);
36645             printf(" %d", n_facet);
36646             printf(" %d", n_value);
36647             printf(" %d", n_val);
36648             printf("\n");
36649         }
36650     }
36651     }
36652     }
36653     }
36654     function_tests++;
36655 #endif
36656
36657     return(test_ret);
36658 }
36659
36660
36661 static int
36662 test_xmlSchemaValidateFacetWhtsp(void) {
36663     int test_ret = 0;
36664
36665 #if defined(LIBXML_SCHEMAS_ENABLED)
36666     int mem_base;
36667     int ret_val;
36668     xmlSchemaFacetPtr facet; /* the facet to check */
36669     int n_facet;
36670     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
36671     int n_fws;
36672     xmlSchemaValType valType; /* the built-in type of the value */
36673     int n_valType;
36674     xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
36675     int n_value;
36676     xmlSchemaValPtr val; /* the precomputed value */
36677     int n_val;
36678     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36679     int n_ws;
36680
36681     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36682     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
36683     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
36684     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36685     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36686     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36687         mem_base = xmlMemBlocks();
36688         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36689         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
36690         valType = gen_xmlSchemaValType(n_valType, 2);
36691         value = gen_const_xmlChar_ptr(n_value, 3);
36692         val = gen_xmlSchemaValPtr(n_val, 4);
36693         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
36694
36695         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
36696         desret_int(ret_val);
36697         call_tests++;
36698         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36699         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
36700         des_xmlSchemaValType(n_valType, valType, 2);
36701         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
36702         des_xmlSchemaValPtr(n_val, val, 4);
36703         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
36704         xmlResetLastError();
36705         if (mem_base != xmlMemBlocks()) {
36706             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
36707                    xmlMemBlocks() - mem_base);
36708             test_ret++;
36709             printf(" %d", n_facet);
36710             printf(" %d", n_fws);
36711             printf(" %d", n_valType);
36712             printf(" %d", n_value);
36713             printf(" %d", n_val);
36714             printf(" %d", n_ws);
36715             printf("\n");
36716         }
36717     }
36718     }
36719     }
36720     }
36721     }
36722     }
36723     function_tests++;
36724 #endif
36725
36726     return(test_ret);
36727 }
36728
36729
36730 static int
36731 test_xmlSchemaValidateLengthFacet(void) {
36732     int test_ret = 0;
36733
36734 #if defined(LIBXML_SCHEMAS_ENABLED)
36735     int mem_base;
36736     int ret_val;
36737     xmlSchemaTypePtr type; /* the built-in type */
36738     int n_type;
36739     xmlSchemaFacetPtr facet; /* the facet to check */
36740     int n_facet;
36741     xmlChar * value; /* the lexical repr. of the value to be validated */
36742     int n_value;
36743     xmlSchemaValPtr val; /* the precomputed value */
36744     int n_val;
36745     unsigned long * length; /* the actual length of the value */
36746     int n_length;
36747
36748     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36749     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36750     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36751     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36752     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
36753         mem_base = xmlMemBlocks();
36754         type = gen_xmlSchemaTypePtr(n_type, 0);
36755         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
36756         value = gen_const_xmlChar_ptr(n_value, 2);
36757         val = gen_xmlSchemaValPtr(n_val, 3);
36758         length = gen_unsigned_long_ptr(n_length, 4);
36759
36760         ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
36761         desret_int(ret_val);
36762         call_tests++;
36763         des_xmlSchemaTypePtr(n_type, type, 0);
36764         des_xmlSchemaFacetPtr(n_facet, facet, 1);
36765         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36766         des_xmlSchemaValPtr(n_val, val, 3);
36767         des_unsigned_long_ptr(n_length, length, 4);
36768         xmlResetLastError();
36769         if (mem_base != xmlMemBlocks()) {
36770             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
36771                    xmlMemBlocks() - mem_base);
36772             test_ret++;
36773             printf(" %d", n_type);
36774             printf(" %d", n_facet);
36775             printf(" %d", n_value);
36776             printf(" %d", n_val);
36777             printf(" %d", n_length);
36778             printf("\n");
36779         }
36780     }
36781     }
36782     }
36783     }
36784     }
36785     function_tests++;
36786 #endif
36787
36788     return(test_ret);
36789 }
36790
36791
36792 static int
36793 test_xmlSchemaValidateLengthFacetWhtsp(void) {
36794     int test_ret = 0;
36795
36796 #if defined(LIBXML_SCHEMAS_ENABLED)
36797     int mem_base;
36798     int ret_val;
36799     xmlSchemaFacetPtr facet; /* the facet to check */
36800     int n_facet;
36801     xmlSchemaValType valType; /* the built-in type */
36802     int n_valType;
36803     xmlChar * value; /* the lexical repr. of the value to be validated */
36804     int n_value;
36805     xmlSchemaValPtr val; /* the precomputed value */
36806     int n_val;
36807     unsigned long * length; /* the actual length of the value */
36808     int n_length;
36809     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36810     int n_ws;
36811
36812     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36813     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
36814     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36815     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36816     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
36817     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36818         mem_base = xmlMemBlocks();
36819         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36820         valType = gen_xmlSchemaValType(n_valType, 1);
36821         value = gen_const_xmlChar_ptr(n_value, 2);
36822         val = gen_xmlSchemaValPtr(n_val, 3);
36823         length = gen_unsigned_long_ptr(n_length, 4);
36824         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
36825
36826         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
36827         desret_int(ret_val);
36828         call_tests++;
36829         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36830         des_xmlSchemaValType(n_valType, valType, 1);
36831         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36832         des_xmlSchemaValPtr(n_val, val, 3);
36833         des_unsigned_long_ptr(n_length, length, 4);
36834         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
36835         xmlResetLastError();
36836         if (mem_base != xmlMemBlocks()) {
36837             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
36838                    xmlMemBlocks() - mem_base);
36839             test_ret++;
36840             printf(" %d", n_facet);
36841             printf(" %d", n_valType);
36842             printf(" %d", n_value);
36843             printf(" %d", n_val);
36844             printf(" %d", n_length);
36845             printf(" %d", n_ws);
36846             printf("\n");
36847         }
36848     }
36849     }
36850     }
36851     }
36852     }
36853     }
36854     function_tests++;
36855 #endif
36856
36857     return(test_ret);
36858 }
36859
36860
36861 static int
36862 test_xmlSchemaValidateListSimpleTypeFacet(void) {
36863     int test_ret = 0;
36864
36865 #if defined(LIBXML_SCHEMAS_ENABLED)
36866     int mem_base;
36867     int ret_val;
36868     xmlSchemaFacetPtr facet; /* the facet to check */
36869     int n_facet;
36870     xmlChar * value; /* the lexical repr of the value to validate */
36871     int n_value;
36872     unsigned long actualLen; /* the number of list items */
36873     int n_actualLen;
36874     unsigned long * expectedLen; /* the resulting expected number of list items */
36875     int n_expectedLen;
36876
36877     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36878     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36879     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
36880     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
36881         mem_base = xmlMemBlocks();
36882         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36883         value = gen_const_xmlChar_ptr(n_value, 1);
36884         actualLen = gen_unsigned_long(n_actualLen, 2);
36885         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
36886
36887         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
36888         desret_int(ret_val);
36889         call_tests++;
36890         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36891         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36892         des_unsigned_long(n_actualLen, actualLen, 2);
36893         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
36894         xmlResetLastError();
36895         if (mem_base != xmlMemBlocks()) {
36896             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
36897                    xmlMemBlocks() - mem_base);
36898             test_ret++;
36899             printf(" %d", n_facet);
36900             printf(" %d", n_value);
36901             printf(" %d", n_actualLen);
36902             printf(" %d", n_expectedLen);
36903             printf("\n");
36904         }
36905     }
36906     }
36907     }
36908     }
36909     function_tests++;
36910 #endif
36911
36912     return(test_ret);
36913 }
36914
36915
36916 static int
36917 test_xmlSchemaValidatePredefinedType(void) {
36918     int test_ret = 0;
36919
36920 #if defined(LIBXML_SCHEMAS_ENABLED)
36921     int mem_base;
36922     int ret_val;
36923     xmlSchemaTypePtr type; /* the predefined type */
36924     int n_type;
36925     xmlChar * value; /* the value to check */
36926     int n_value;
36927     xmlSchemaValPtr * val; /* the return computed value */
36928     int n_val;
36929
36930     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36931     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36932     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36933         mem_base = xmlMemBlocks();
36934         type = gen_xmlSchemaTypePtr(n_type, 0);
36935         value = gen_const_xmlChar_ptr(n_value, 1);
36936         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36937
36938         ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
36939         desret_int(ret_val);
36940         call_tests++;
36941         des_xmlSchemaTypePtr(n_type, type, 0);
36942         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36943         des_xmlSchemaValPtr_ptr(n_val, val, 2);
36944         xmlResetLastError();
36945         if (mem_base != xmlMemBlocks()) {
36946             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
36947                    xmlMemBlocks() - mem_base);
36948             test_ret++;
36949             printf(" %d", n_type);
36950             printf(" %d", n_value);
36951             printf(" %d", n_val);
36952             printf("\n");
36953         }
36954     }
36955     }
36956     }
36957     function_tests++;
36958 #endif
36959
36960     return(test_ret);
36961 }
36962
36963
36964 static int
36965 test_xmlSchemaValueAppend(void) {
36966     int test_ret = 0;
36967
36968 #if defined(LIBXML_SCHEMAS_ENABLED)
36969     int mem_base;
36970     int ret_val;
36971     xmlSchemaValPtr prev; /* the value */
36972     int n_prev;
36973     xmlSchemaValPtr cur; /* the value to be appended */
36974     int n_cur;
36975
36976     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
36977     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
36978         mem_base = xmlMemBlocks();
36979         prev = gen_xmlSchemaValPtr(n_prev, 0);
36980         cur = gen_xmlSchemaValPtr(n_cur, 1);
36981
36982         ret_val = xmlSchemaValueAppend(prev, cur);
36983         desret_int(ret_val);
36984         call_tests++;
36985         des_xmlSchemaValPtr(n_prev, prev, 0);
36986         des_xmlSchemaValPtr(n_cur, cur, 1);
36987         xmlResetLastError();
36988         if (mem_base != xmlMemBlocks()) {
36989             printf("Leak of %d blocks found in xmlSchemaValueAppend",
36990                    xmlMemBlocks() - mem_base);
36991             test_ret++;
36992             printf(" %d", n_prev);
36993             printf(" %d", n_cur);
36994             printf("\n");
36995         }
36996     }
36997     }
36998     function_tests++;
36999 #endif
37000
37001     return(test_ret);
37002 }
37003
37004
37005 static int
37006 test_xmlSchemaValueGetAsBoolean(void) {
37007     int test_ret = 0;
37008
37009 #if defined(LIBXML_SCHEMAS_ENABLED)
37010     int mem_base;
37011     int ret_val;
37012     xmlSchemaValPtr val; /* the value */
37013     int n_val;
37014
37015     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
37016         mem_base = xmlMemBlocks();
37017         val = gen_xmlSchemaValPtr(n_val, 0);
37018
37019         ret_val = xmlSchemaValueGetAsBoolean(val);
37020         desret_int(ret_val);
37021         call_tests++;
37022         des_xmlSchemaValPtr(n_val, val, 0);
37023         xmlResetLastError();
37024         if (mem_base != xmlMemBlocks()) {
37025             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
37026                    xmlMemBlocks() - mem_base);
37027             test_ret++;
37028             printf(" %d", n_val);
37029             printf("\n");
37030         }
37031     }
37032     function_tests++;
37033 #endif
37034
37035     return(test_ret);
37036 }
37037
37038
37039 static int
37040 test_xmlSchemaValueGetAsString(void) {
37041     int test_ret = 0;
37042
37043 #if defined(LIBXML_SCHEMAS_ENABLED)
37044     int mem_base;
37045     const xmlChar * ret_val;
37046     xmlSchemaValPtr val; /* the value */
37047     int n_val;
37048
37049     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
37050         mem_base = xmlMemBlocks();
37051         val = gen_xmlSchemaValPtr(n_val, 0);
37052
37053         ret_val = xmlSchemaValueGetAsString(val);
37054         desret_const_xmlChar_ptr(ret_val);
37055         call_tests++;
37056         des_xmlSchemaValPtr(n_val, val, 0);
37057         xmlResetLastError();
37058         if (mem_base != xmlMemBlocks()) {
37059             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
37060                    xmlMemBlocks() - mem_base);
37061             test_ret++;
37062             printf(" %d", n_val);
37063             printf("\n");
37064         }
37065     }
37066     function_tests++;
37067 #endif
37068
37069     return(test_ret);
37070 }
37071
37072
37073 static int
37074 test_xmlSchemaValueGetNext(void) {
37075     int test_ret = 0;
37076
37077
37078     /* missing type support */
37079     return(test_ret);
37080 }
37081
37082
37083 static int
37084 test_xmlSchemaWhiteSpaceReplace(void) {
37085     int test_ret = 0;
37086
37087 #if defined(LIBXML_SCHEMAS_ENABLED)
37088     int mem_base;
37089     xmlChar * ret_val;
37090     xmlChar * value; /* a value */
37091     int n_value;
37092
37093     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
37094         mem_base = xmlMemBlocks();
37095         value = gen_const_xmlChar_ptr(n_value, 0);
37096
37097         ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
37098         desret_xmlChar_ptr(ret_val);
37099         call_tests++;
37100         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
37101         xmlResetLastError();
37102         if (mem_base != xmlMemBlocks()) {
37103             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
37104                    xmlMemBlocks() - mem_base);
37105             test_ret++;
37106             printf(" %d", n_value);
37107             printf("\n");
37108         }
37109     }
37110     function_tests++;
37111 #endif
37112
37113     return(test_ret);
37114 }
37115
37116 static int
37117 test_xmlschemastypes(void) {
37118     int test_ret = 0;
37119         int rc = 0;
37120
37121     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
37122     rc = test_xmlSchemaCheckFacet();
37123         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37124     rc = test_xmlSchemaCleanupTypes();
37125         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37126     rc = test_xmlSchemaCollapseString();
37127         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37128     rc = test_xmlSchemaCompareValues();
37129         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37130     rc = test_xmlSchemaCompareValuesWhtsp();
37131         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37132     rc = test_xmlSchemaCopyValue();
37133         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37134     rc = test_xmlSchemaGetBuiltInListSimpleTypeItemType();
37135         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37136     rc = test_xmlSchemaGetBuiltInType();
37137         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37138     rc = test_xmlSchemaGetCanonValue();
37139         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37140     rc = test_xmlSchemaGetCanonValueWhtsp();
37141         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37142     rc = test_xmlSchemaGetFacetValueAsULong();
37143         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37144     rc = test_xmlSchemaGetPredefinedType();
37145         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37146     rc = test_xmlSchemaGetValType();
37147         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37148     rc = test_xmlSchemaInitTypes();
37149         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37150     rc = test_xmlSchemaIsBuiltInTypeFacet();
37151         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37152     rc = test_xmlSchemaNewFacet();
37153         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37154     rc = test_xmlSchemaNewNOTATIONValue();
37155         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37156     rc = test_xmlSchemaNewQNameValue();
37157         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37158     rc = test_xmlSchemaNewStringValue();
37159         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37160     rc = test_xmlSchemaValPredefTypeNode();
37161         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37162     rc = test_xmlSchemaValPredefTypeNodeNoNorm();
37163         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37164     rc = test_xmlSchemaValidateFacet();
37165         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37166     rc = test_xmlSchemaValidateFacetWhtsp();
37167         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37168     rc = test_xmlSchemaValidateLengthFacet();
37169         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37170     rc = test_xmlSchemaValidateLengthFacetWhtsp();
37171         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37172     rc = test_xmlSchemaValidateListSimpleTypeFacet();
37173         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37174     rc = test_xmlSchemaValidatePredefinedType();
37175         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37176     rc = test_xmlSchemaValueAppend();
37177         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37178     rc = test_xmlSchemaValueGetAsBoolean();
37179         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37180     rc = test_xmlSchemaValueGetAsString();
37181         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37182     rc = test_xmlSchemaValueGetNext();
37183         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37184     rc = test_xmlSchemaWhiteSpaceReplace();
37185         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37186
37187     if (test_ret != 0)
37188         printf("Module xmlschemastypes: %d errors\n", test_ret);
37189     return(test_ret);
37190 }
37191
37192 static int
37193 test_xmlCharStrdup(void) {
37194     int test_ret = 0;
37195
37196     int mem_base;
37197     xmlChar * ret_val;
37198     char * cur; /* the input char * */
37199     int n_cur;
37200
37201     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
37202         mem_base = xmlMemBlocks();
37203         cur = gen_const_char_ptr(n_cur, 0);
37204
37205         ret_val = xmlCharStrdup((const char *)cur);
37206         desret_xmlChar_ptr(ret_val);
37207         call_tests++;
37208         des_const_char_ptr(n_cur, (const char *)cur, 0);
37209         xmlResetLastError();
37210         if (mem_base != xmlMemBlocks()) {
37211             printf("Leak of %d blocks found in xmlCharStrdup",
37212                    xmlMemBlocks() - mem_base);
37213             test_ret++;
37214             printf(" %d", n_cur);
37215             printf("\n");
37216         }
37217     }
37218     function_tests++;
37219
37220     return(test_ret);
37221 }
37222
37223
37224 static int
37225 test_xmlCharStrndup(void) {
37226     int test_ret = 0;
37227
37228     int mem_base;
37229     xmlChar * ret_val;
37230     char * cur; /* the input char * */
37231     int n_cur;
37232     int len; /* the len of @cur */
37233     int n_len;
37234
37235     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
37236     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37237         mem_base = xmlMemBlocks();
37238         cur = gen_const_char_ptr(n_cur, 0);
37239         len = gen_int(n_len, 1);
37240
37241         ret_val = xmlCharStrndup((const char *)cur, len);
37242         desret_xmlChar_ptr(ret_val);
37243         call_tests++;
37244         des_const_char_ptr(n_cur, (const char *)cur, 0);
37245         des_int(n_len, len, 1);
37246         xmlResetLastError();
37247         if (mem_base != xmlMemBlocks()) {
37248             printf("Leak of %d blocks found in xmlCharStrndup",
37249                    xmlMemBlocks() - mem_base);
37250             test_ret++;
37251             printf(" %d", n_cur);
37252             printf(" %d", n_len);
37253             printf("\n");
37254         }
37255     }
37256     }
37257     function_tests++;
37258
37259     return(test_ret);
37260 }
37261
37262
37263 static int
37264 test_xmlCheckUTF8(void) {
37265     int test_ret = 0;
37266
37267     int mem_base;
37268     int ret_val;
37269     unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
37270     int n_utf;
37271
37272     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
37273         mem_base = xmlMemBlocks();
37274         utf = gen_const_unsigned_char_ptr(n_utf, 0);
37275
37276         ret_val = xmlCheckUTF8((const unsigned char *)utf);
37277         desret_int(ret_val);
37278         call_tests++;
37279         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
37280         xmlResetLastError();
37281         if (mem_base != xmlMemBlocks()) {
37282             printf("Leak of %d blocks found in xmlCheckUTF8",
37283                    xmlMemBlocks() - mem_base);
37284             test_ret++;
37285             printf(" %d", n_utf);
37286             printf("\n");
37287         }
37288     }
37289     function_tests++;
37290
37291     return(test_ret);
37292 }
37293
37294
37295 static int
37296 test_xmlGetUTF8Char(void) {
37297     int test_ret = 0;
37298
37299     int mem_base;
37300     int ret_val;
37301     unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
37302     int n_utf;
37303     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. */
37304     int n_len;
37305
37306     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
37307     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
37308         mem_base = xmlMemBlocks();
37309         utf = gen_const_unsigned_char_ptr(n_utf, 0);
37310         len = gen_int_ptr(n_len, 1);
37311
37312         ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
37313         desret_int(ret_val);
37314         call_tests++;
37315         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
37316         des_int_ptr(n_len, len, 1);
37317         xmlResetLastError();
37318         if (mem_base != xmlMemBlocks()) {
37319             printf("Leak of %d blocks found in xmlGetUTF8Char",
37320                    xmlMemBlocks() - mem_base);
37321             test_ret++;
37322             printf(" %d", n_utf);
37323             printf(" %d", n_len);
37324             printf("\n");
37325         }
37326     }
37327     }
37328     function_tests++;
37329
37330     return(test_ret);
37331 }
37332
37333
37334 static int
37335 test_xmlStrEqual(void) {
37336     int test_ret = 0;
37337
37338     int mem_base;
37339     int ret_val;
37340     xmlChar * str1; /* the first xmlChar * */
37341     int n_str1;
37342     xmlChar * str2; /* the second xmlChar * */
37343     int n_str2;
37344
37345     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37346     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37347         mem_base = xmlMemBlocks();
37348         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37349         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37350
37351         ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
37352         desret_int(ret_val);
37353         call_tests++;
37354         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37355         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37356         xmlResetLastError();
37357         if (mem_base != xmlMemBlocks()) {
37358             printf("Leak of %d blocks found in xmlStrEqual",
37359                    xmlMemBlocks() - mem_base);
37360             test_ret++;
37361             printf(" %d", n_str1);
37362             printf(" %d", n_str2);
37363             printf("\n");
37364         }
37365     }
37366     }
37367     function_tests++;
37368
37369     return(test_ret);
37370 }
37371
37372
37373 static int
37374 test_xmlStrPrintf(void) {
37375     int test_ret = 0;
37376
37377
37378     /* missing type support */
37379     return(test_ret);
37380 }
37381
37382
37383 static int
37384 test_xmlStrQEqual(void) {
37385     int test_ret = 0;
37386
37387     int mem_base;
37388     int ret_val;
37389     xmlChar * pref; /* the prefix of the QName */
37390     int n_pref;
37391     xmlChar * name; /* the localname of the QName */
37392     int n_name;
37393     xmlChar * str; /* the second xmlChar * */
37394     int n_str;
37395
37396     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
37397     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
37398     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37399         mem_base = xmlMemBlocks();
37400         pref = gen_const_xmlChar_ptr(n_pref, 0);
37401         name = gen_const_xmlChar_ptr(n_name, 1);
37402         str = gen_const_xmlChar_ptr(n_str, 2);
37403
37404         ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
37405         desret_int(ret_val);
37406         call_tests++;
37407         des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
37408         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
37409         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
37410         xmlResetLastError();
37411         if (mem_base != xmlMemBlocks()) {
37412             printf("Leak of %d blocks found in xmlStrQEqual",
37413                    xmlMemBlocks() - mem_base);
37414             test_ret++;
37415             printf(" %d", n_pref);
37416             printf(" %d", n_name);
37417             printf(" %d", n_str);
37418             printf("\n");
37419         }
37420     }
37421     }
37422     }
37423     function_tests++;
37424
37425     return(test_ret);
37426 }
37427
37428
37429 static int
37430 test_xmlStrVPrintf(void) {
37431     int test_ret = 0;
37432
37433
37434     /* missing type support */
37435     return(test_ret);
37436 }
37437
37438
37439 static int
37440 test_xmlStrcasecmp(void) {
37441     int test_ret = 0;
37442
37443     int mem_base;
37444     int ret_val;
37445     xmlChar * str1; /* the first xmlChar * */
37446     int n_str1;
37447     xmlChar * str2; /* the second xmlChar * */
37448     int n_str2;
37449
37450     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37451     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37452         mem_base = xmlMemBlocks();
37453         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37454         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37455
37456         ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
37457         desret_int(ret_val);
37458         call_tests++;
37459         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37460         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37461         xmlResetLastError();
37462         if (mem_base != xmlMemBlocks()) {
37463             printf("Leak of %d blocks found in xmlStrcasecmp",
37464                    xmlMemBlocks() - mem_base);
37465             test_ret++;
37466             printf(" %d", n_str1);
37467             printf(" %d", n_str2);
37468             printf("\n");
37469         }
37470     }
37471     }
37472     function_tests++;
37473
37474     return(test_ret);
37475 }
37476
37477
37478 static int
37479 test_xmlStrcasestr(void) {
37480     int test_ret = 0;
37481
37482     int mem_base;
37483     const xmlChar * ret_val;
37484     xmlChar * str; /* the xmlChar * array (haystack) */
37485     int n_str;
37486     xmlChar * val; /* the xmlChar to search (needle) */
37487     int n_val;
37488
37489     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37490     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
37491         mem_base = xmlMemBlocks();
37492         str = gen_const_xmlChar_ptr(n_str, 0);
37493         val = gen_const_xmlChar_ptr(n_val, 1);
37494
37495         ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
37496         desret_const_xmlChar_ptr(ret_val);
37497         call_tests++;
37498         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37499         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
37500         xmlResetLastError();
37501         if (mem_base != xmlMemBlocks()) {
37502             printf("Leak of %d blocks found in xmlStrcasestr",
37503                    xmlMemBlocks() - mem_base);
37504             test_ret++;
37505             printf(" %d", n_str);
37506             printf(" %d", n_val);
37507             printf("\n");
37508         }
37509     }
37510     }
37511     function_tests++;
37512
37513     return(test_ret);
37514 }
37515
37516
37517 static int
37518 test_xmlStrchr(void) {
37519     int test_ret = 0;
37520
37521     int mem_base;
37522     const xmlChar * ret_val;
37523     xmlChar * str; /* the xmlChar * array */
37524     int n_str;
37525     xmlChar val; /* the xmlChar to search */
37526     int n_val;
37527
37528     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37529     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
37530         mem_base = xmlMemBlocks();
37531         str = gen_const_xmlChar_ptr(n_str, 0);
37532         val = gen_xmlChar(n_val, 1);
37533
37534         ret_val = xmlStrchr((const xmlChar *)str, val);
37535         desret_const_xmlChar_ptr(ret_val);
37536         call_tests++;
37537         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37538         des_xmlChar(n_val, val, 1);
37539         xmlResetLastError();
37540         if (mem_base != xmlMemBlocks()) {
37541             printf("Leak of %d blocks found in xmlStrchr",
37542                    xmlMemBlocks() - mem_base);
37543             test_ret++;
37544             printf(" %d", n_str);
37545             printf(" %d", n_val);
37546             printf("\n");
37547         }
37548     }
37549     }
37550     function_tests++;
37551
37552     return(test_ret);
37553 }
37554
37555
37556 static int
37557 test_xmlStrcmp(void) {
37558     int test_ret = 0;
37559
37560     int mem_base;
37561     int ret_val;
37562     xmlChar * str1; /* the first xmlChar * */
37563     int n_str1;
37564     xmlChar * str2; /* the second xmlChar * */
37565     int n_str2;
37566
37567     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37568     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37569         mem_base = xmlMemBlocks();
37570         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37571         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37572
37573         ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
37574         desret_int(ret_val);
37575         call_tests++;
37576         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37577         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37578         xmlResetLastError();
37579         if (mem_base != xmlMemBlocks()) {
37580             printf("Leak of %d blocks found in xmlStrcmp",
37581                    xmlMemBlocks() - mem_base);
37582             test_ret++;
37583             printf(" %d", n_str1);
37584             printf(" %d", n_str2);
37585             printf("\n");
37586         }
37587     }
37588     }
37589     function_tests++;
37590
37591     return(test_ret);
37592 }
37593
37594
37595 static int
37596 test_xmlStrdup(void) {
37597     int test_ret = 0;
37598
37599     int mem_base;
37600     xmlChar * ret_val;
37601     xmlChar * cur; /* the input xmlChar * */
37602     int n_cur;
37603
37604     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
37605         mem_base = xmlMemBlocks();
37606         cur = gen_const_xmlChar_ptr(n_cur, 0);
37607
37608         ret_val = xmlStrdup((const xmlChar *)cur);
37609         desret_xmlChar_ptr(ret_val);
37610         call_tests++;
37611         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
37612         xmlResetLastError();
37613         if (mem_base != xmlMemBlocks()) {
37614             printf("Leak of %d blocks found in xmlStrdup",
37615                    xmlMemBlocks() - mem_base);
37616             test_ret++;
37617             printf(" %d", n_cur);
37618             printf("\n");
37619         }
37620     }
37621     function_tests++;
37622
37623     return(test_ret);
37624 }
37625
37626
37627 static int
37628 test_xmlStrlen(void) {
37629     int test_ret = 0;
37630
37631     int mem_base;
37632     int ret_val;
37633     xmlChar * str; /* the xmlChar * array */
37634     int n_str;
37635
37636     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37637         mem_base = xmlMemBlocks();
37638         str = gen_const_xmlChar_ptr(n_str, 0);
37639
37640         ret_val = xmlStrlen((const xmlChar *)str);
37641         desret_int(ret_val);
37642         call_tests++;
37643         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37644         xmlResetLastError();
37645         if (mem_base != xmlMemBlocks()) {
37646             printf("Leak of %d blocks found in xmlStrlen",
37647                    xmlMemBlocks() - mem_base);
37648             test_ret++;
37649             printf(" %d", n_str);
37650             printf("\n");
37651         }
37652     }
37653     function_tests++;
37654
37655     return(test_ret);
37656 }
37657
37658
37659 static int
37660 test_xmlStrncasecmp(void) {
37661     int test_ret = 0;
37662
37663     int mem_base;
37664     int ret_val;
37665     xmlChar * str1; /* the first xmlChar * */
37666     int n_str1;
37667     xmlChar * str2; /* the second xmlChar * */
37668     int n_str2;
37669     int len; /* the max comparison length */
37670     int n_len;
37671
37672     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37673     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37674     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37675         mem_base = xmlMemBlocks();
37676         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37677         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37678         len = gen_int(n_len, 2);
37679
37680         ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
37681         desret_int(ret_val);
37682         call_tests++;
37683         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37684         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37685         des_int(n_len, len, 2);
37686         xmlResetLastError();
37687         if (mem_base != xmlMemBlocks()) {
37688             printf("Leak of %d blocks found in xmlStrncasecmp",
37689                    xmlMemBlocks() - mem_base);
37690             test_ret++;
37691             printf(" %d", n_str1);
37692             printf(" %d", n_str2);
37693             printf(" %d", n_len);
37694             printf("\n");
37695         }
37696     }
37697     }
37698     }
37699     function_tests++;
37700
37701     return(test_ret);
37702 }
37703
37704
37705 static int
37706 test_xmlStrncatNew(void) {
37707     int test_ret = 0;
37708
37709     int mem_base;
37710     xmlChar * ret_val;
37711     xmlChar * str1; /* first xmlChar string */
37712     int n_str1;
37713     xmlChar * str2; /* second xmlChar string */
37714     int n_str2;
37715     int len; /* the len of @str2 or < 0 */
37716     int n_len;
37717
37718     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37719     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37720     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37721         mem_base = xmlMemBlocks();
37722         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37723         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37724         len = gen_int(n_len, 2);
37725
37726         ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
37727         desret_xmlChar_ptr(ret_val);
37728         call_tests++;
37729         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37730         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37731         des_int(n_len, len, 2);
37732         xmlResetLastError();
37733         if (mem_base != xmlMemBlocks()) {
37734             printf("Leak of %d blocks found in xmlStrncatNew",
37735                    xmlMemBlocks() - mem_base);
37736             test_ret++;
37737             printf(" %d", n_str1);
37738             printf(" %d", n_str2);
37739             printf(" %d", n_len);
37740             printf("\n");
37741         }
37742     }
37743     }
37744     }
37745     function_tests++;
37746
37747     return(test_ret);
37748 }
37749
37750
37751 static int
37752 test_xmlStrncmp(void) {
37753     int test_ret = 0;
37754
37755     int mem_base;
37756     int ret_val;
37757     xmlChar * str1; /* the first xmlChar * */
37758     int n_str1;
37759     xmlChar * str2; /* the second xmlChar * */
37760     int n_str2;
37761     int len; /* the max comparison length */
37762     int n_len;
37763
37764     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37765     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37766     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37767         mem_base = xmlMemBlocks();
37768         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37769         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37770         len = gen_int(n_len, 2);
37771
37772         ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
37773         desret_int(ret_val);
37774         call_tests++;
37775         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37776         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37777         des_int(n_len, len, 2);
37778         xmlResetLastError();
37779         if (mem_base != xmlMemBlocks()) {
37780             printf("Leak of %d blocks found in xmlStrncmp",
37781                    xmlMemBlocks() - mem_base);
37782             test_ret++;
37783             printf(" %d", n_str1);
37784             printf(" %d", n_str2);
37785             printf(" %d", n_len);
37786             printf("\n");
37787         }
37788     }
37789     }
37790     }
37791     function_tests++;
37792
37793     return(test_ret);
37794 }
37795
37796
37797 static int
37798 test_xmlStrndup(void) {
37799     int test_ret = 0;
37800
37801     int mem_base;
37802     xmlChar * ret_val;
37803     xmlChar * cur; /* the input xmlChar * */
37804     int n_cur;
37805     int len; /* the len of @cur */
37806     int n_len;
37807
37808     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
37809     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37810         mem_base = xmlMemBlocks();
37811         cur = gen_const_xmlChar_ptr(n_cur, 0);
37812         len = gen_int(n_len, 1);
37813
37814         ret_val = xmlStrndup((const xmlChar *)cur, len);
37815         desret_xmlChar_ptr(ret_val);
37816         call_tests++;
37817         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
37818         des_int(n_len, len, 1);
37819         xmlResetLastError();
37820         if (mem_base != xmlMemBlocks()) {
37821             printf("Leak of %d blocks found in xmlStrndup",
37822                    xmlMemBlocks() - mem_base);
37823             test_ret++;
37824             printf(" %d", n_cur);
37825             printf(" %d", n_len);
37826             printf("\n");
37827         }
37828     }
37829     }
37830     function_tests++;
37831
37832     return(test_ret);
37833 }
37834
37835
37836 static int
37837 test_xmlStrstr(void) {
37838     int test_ret = 0;
37839
37840     int mem_base;
37841     const xmlChar * ret_val;
37842     xmlChar * str; /* the xmlChar * array (haystack) */
37843     int n_str;
37844     xmlChar * val; /* the xmlChar to search (needle) */
37845     int n_val;
37846
37847     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37848     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
37849         mem_base = xmlMemBlocks();
37850         str = gen_const_xmlChar_ptr(n_str, 0);
37851         val = gen_const_xmlChar_ptr(n_val, 1);
37852
37853         ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
37854         desret_const_xmlChar_ptr(ret_val);
37855         call_tests++;
37856         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37857         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
37858         xmlResetLastError();
37859         if (mem_base != xmlMemBlocks()) {
37860             printf("Leak of %d blocks found in xmlStrstr",
37861                    xmlMemBlocks() - mem_base);
37862             test_ret++;
37863             printf(" %d", n_str);
37864             printf(" %d", n_val);
37865             printf("\n");
37866         }
37867     }
37868     }
37869     function_tests++;
37870
37871     return(test_ret);
37872 }
37873
37874
37875 static int
37876 test_xmlStrsub(void) {
37877     int test_ret = 0;
37878
37879     int mem_base;
37880     xmlChar * ret_val;
37881     xmlChar * str; /* the xmlChar * array (haystack) */
37882     int n_str;
37883     int start; /* the index of the first char (zero based) */
37884     int n_start;
37885     int len; /* the length of the substring */
37886     int n_len;
37887
37888     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37889     for (n_start = 0;n_start < gen_nb_int;n_start++) {
37890     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37891         mem_base = xmlMemBlocks();
37892         str = gen_const_xmlChar_ptr(n_str, 0);
37893         start = gen_int(n_start, 1);
37894         len = gen_int(n_len, 2);
37895
37896         ret_val = xmlStrsub((const xmlChar *)str, start, len);
37897         desret_xmlChar_ptr(ret_val);
37898         call_tests++;
37899         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37900         des_int(n_start, start, 1);
37901         des_int(n_len, len, 2);
37902         xmlResetLastError();
37903         if (mem_base != xmlMemBlocks()) {
37904             printf("Leak of %d blocks found in xmlStrsub",
37905                    xmlMemBlocks() - mem_base);
37906             test_ret++;
37907             printf(" %d", n_str);
37908             printf(" %d", n_start);
37909             printf(" %d", n_len);
37910             printf("\n");
37911         }
37912     }
37913     }
37914     }
37915     function_tests++;
37916
37917     return(test_ret);
37918 }
37919
37920
37921 static int
37922 test_xmlUTF8Charcmp(void) {
37923     int test_ret = 0;
37924
37925     int mem_base;
37926     int ret_val;
37927     xmlChar * utf1; /* pointer to first UTF8 char */
37928     int n_utf1;
37929     xmlChar * utf2; /* pointer to second UTF8 char */
37930     int n_utf2;
37931
37932     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
37933     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
37934         mem_base = xmlMemBlocks();
37935         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
37936         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
37937
37938         ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
37939         desret_int(ret_val);
37940         call_tests++;
37941         des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
37942         des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
37943         xmlResetLastError();
37944         if (mem_base != xmlMemBlocks()) {
37945             printf("Leak of %d blocks found in xmlUTF8Charcmp",
37946                    xmlMemBlocks() - mem_base);
37947             test_ret++;
37948             printf(" %d", n_utf1);
37949             printf(" %d", n_utf2);
37950             printf("\n");
37951         }
37952     }
37953     }
37954     function_tests++;
37955
37956     return(test_ret);
37957 }
37958
37959
37960 static int
37961 test_xmlUTF8Size(void) {
37962     int test_ret = 0;
37963
37964     int mem_base;
37965     int ret_val;
37966     xmlChar * utf; /* pointer to the UTF8 character */
37967     int n_utf;
37968
37969     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
37970         mem_base = xmlMemBlocks();
37971         utf = gen_const_xmlChar_ptr(n_utf, 0);
37972
37973         ret_val = xmlUTF8Size((const xmlChar *)utf);
37974         desret_int(ret_val);
37975         call_tests++;
37976         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
37977         xmlResetLastError();
37978         if (mem_base != xmlMemBlocks()) {
37979             printf("Leak of %d blocks found in xmlUTF8Size",
37980                    xmlMemBlocks() - mem_base);
37981             test_ret++;
37982             printf(" %d", n_utf);
37983             printf("\n");
37984         }
37985     }
37986     function_tests++;
37987
37988     return(test_ret);
37989 }
37990
37991
37992 static int
37993 test_xmlUTF8Strlen(void) {
37994     int test_ret = 0;
37995
37996     int mem_base;
37997     int ret_val;
37998     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
37999     int n_utf;
38000
38001     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38002         mem_base = xmlMemBlocks();
38003         utf = gen_const_xmlChar_ptr(n_utf, 0);
38004
38005         ret_val = xmlUTF8Strlen((const xmlChar *)utf);
38006         desret_int(ret_val);
38007         call_tests++;
38008         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38009         xmlResetLastError();
38010         if (mem_base != xmlMemBlocks()) {
38011             printf("Leak of %d blocks found in xmlUTF8Strlen",
38012                    xmlMemBlocks() - mem_base);
38013             test_ret++;
38014             printf(" %d", n_utf);
38015             printf("\n");
38016         }
38017     }
38018     function_tests++;
38019
38020     return(test_ret);
38021 }
38022
38023
38024 static int
38025 test_xmlUTF8Strloc(void) {
38026     int test_ret = 0;
38027
38028     int mem_base;
38029     int ret_val;
38030     xmlChar * utf; /* the input UTF8 * */
38031     int n_utf;
38032     xmlChar * utfchar; /* the UTF8 character to be found */
38033     int n_utfchar;
38034
38035     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38036     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
38037         mem_base = xmlMemBlocks();
38038         utf = gen_const_xmlChar_ptr(n_utf, 0);
38039         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
38040
38041         ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
38042         desret_int(ret_val);
38043         call_tests++;
38044         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38045         des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
38046         xmlResetLastError();
38047         if (mem_base != xmlMemBlocks()) {
38048             printf("Leak of %d blocks found in xmlUTF8Strloc",
38049                    xmlMemBlocks() - mem_base);
38050             test_ret++;
38051             printf(" %d", n_utf);
38052             printf(" %d", n_utfchar);
38053             printf("\n");
38054         }
38055     }
38056     }
38057     function_tests++;
38058
38059     return(test_ret);
38060 }
38061
38062
38063 static int
38064 test_xmlUTF8Strndup(void) {
38065     int test_ret = 0;
38066
38067     int mem_base;
38068     xmlChar * ret_val;
38069     xmlChar * utf; /* the input UTF8 * */
38070     int n_utf;
38071     int len; /* the len of @utf (in chars) */
38072     int n_len;
38073
38074     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38075     for (n_len = 0;n_len < gen_nb_int;n_len++) {
38076         mem_base = xmlMemBlocks();
38077         utf = gen_const_xmlChar_ptr(n_utf, 0);
38078         len = gen_int(n_len, 1);
38079
38080         ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
38081         desret_xmlChar_ptr(ret_val);
38082         call_tests++;
38083         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38084         des_int(n_len, len, 1);
38085         xmlResetLastError();
38086         if (mem_base != xmlMemBlocks()) {
38087             printf("Leak of %d blocks found in xmlUTF8Strndup",
38088                    xmlMemBlocks() - mem_base);
38089             test_ret++;
38090             printf(" %d", n_utf);
38091             printf(" %d", n_len);
38092             printf("\n");
38093         }
38094     }
38095     }
38096     function_tests++;
38097
38098     return(test_ret);
38099 }
38100
38101
38102 static int
38103 test_xmlUTF8Strpos(void) {
38104     int test_ret = 0;
38105
38106     int mem_base;
38107     const xmlChar * ret_val;
38108     xmlChar * utf; /* the input UTF8 * */
38109     int n_utf;
38110     int pos; /* the position of the desired UTF8 char (in chars) */
38111     int n_pos;
38112
38113     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38114     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
38115         mem_base = xmlMemBlocks();
38116         utf = gen_const_xmlChar_ptr(n_utf, 0);
38117         pos = gen_int(n_pos, 1);
38118
38119         ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
38120         desret_const_xmlChar_ptr(ret_val);
38121         call_tests++;
38122         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38123         des_int(n_pos, pos, 1);
38124         xmlResetLastError();
38125         if (mem_base != xmlMemBlocks()) {
38126             printf("Leak of %d blocks found in xmlUTF8Strpos",
38127                    xmlMemBlocks() - mem_base);
38128             test_ret++;
38129             printf(" %d", n_utf);
38130             printf(" %d", n_pos);
38131             printf("\n");
38132         }
38133     }
38134     }
38135     function_tests++;
38136
38137     return(test_ret);
38138 }
38139
38140
38141 static int
38142 test_xmlUTF8Strsize(void) {
38143     int test_ret = 0;
38144
38145     int mem_base;
38146     int ret_val;
38147     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
38148     int n_utf;
38149     int len; /* the number of characters in the array */
38150     int n_len;
38151
38152     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38153     for (n_len = 0;n_len < gen_nb_int;n_len++) {
38154         mem_base = xmlMemBlocks();
38155         utf = gen_const_xmlChar_ptr(n_utf, 0);
38156         len = gen_int(n_len, 1);
38157
38158         ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
38159         desret_int(ret_val);
38160         call_tests++;
38161         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38162         des_int(n_len, len, 1);
38163         xmlResetLastError();
38164         if (mem_base != xmlMemBlocks()) {
38165             printf("Leak of %d blocks found in xmlUTF8Strsize",
38166                    xmlMemBlocks() - mem_base);
38167             test_ret++;
38168             printf(" %d", n_utf);
38169             printf(" %d", n_len);
38170             printf("\n");
38171         }
38172     }
38173     }
38174     function_tests++;
38175
38176     return(test_ret);
38177 }
38178
38179
38180 static int
38181 test_xmlUTF8Strsub(void) {
38182     int test_ret = 0;
38183
38184     int mem_base;
38185     xmlChar * ret_val;
38186     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
38187     int n_utf;
38188     int start; /* relative pos of first char */
38189     int n_start;
38190     int len; /* total number to copy */
38191     int n_len;
38192
38193     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38194     for (n_start = 0;n_start < gen_nb_int;n_start++) {
38195     for (n_len = 0;n_len < gen_nb_int;n_len++) {
38196         mem_base = xmlMemBlocks();
38197         utf = gen_const_xmlChar_ptr(n_utf, 0);
38198         start = gen_int(n_start, 1);
38199         len = gen_int(n_len, 2);
38200
38201         ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
38202         desret_xmlChar_ptr(ret_val);
38203         call_tests++;
38204         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38205         des_int(n_start, start, 1);
38206         des_int(n_len, len, 2);
38207         xmlResetLastError();
38208         if (mem_base != xmlMemBlocks()) {
38209             printf("Leak of %d blocks found in xmlUTF8Strsub",
38210                    xmlMemBlocks() - mem_base);
38211             test_ret++;
38212             printf(" %d", n_utf);
38213             printf(" %d", n_start);
38214             printf(" %d", n_len);
38215             printf("\n");
38216         }
38217     }
38218     }
38219     }
38220     function_tests++;
38221
38222     return(test_ret);
38223 }
38224
38225 static int
38226 test_xmlstring(void) {
38227     int test_ret = 0;
38228         int rc = 0;
38229
38230     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
38231     rc = test_xmlCharStrdup();
38232         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38233     rc = test_xmlCharStrndup();
38234         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38235     rc = test_xmlCheckUTF8();
38236         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38237     rc = test_xmlGetUTF8Char();
38238         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38239     rc = test_xmlStrEqual();
38240         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38241     rc = test_xmlStrPrintf();
38242         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38243     rc = test_xmlStrQEqual();
38244         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38245     rc = test_xmlStrVPrintf();
38246         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38247     rc = test_xmlStrcasecmp();
38248         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38249     rc = test_xmlStrcasestr();
38250         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38251     rc = test_xmlStrchr();
38252         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38253     rc = test_xmlStrcmp();
38254         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38255     rc = test_xmlStrdup();
38256         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38257     rc = test_xmlStrlen();
38258         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38259     rc = test_xmlStrncasecmp();
38260         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38261     rc = test_xmlStrncatNew();
38262         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38263     rc = test_xmlStrncmp();
38264         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38265     rc = test_xmlStrndup();
38266         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38267     rc = test_xmlStrstr();
38268         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38269     rc = test_xmlStrsub();
38270         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38271     rc = test_xmlUTF8Charcmp();
38272         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38273     rc = test_xmlUTF8Size();
38274         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38275     rc = test_xmlUTF8Strlen();
38276         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38277     rc = test_xmlUTF8Strloc();
38278         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38279     rc = test_xmlUTF8Strndup();
38280         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38281     rc = test_xmlUTF8Strpos();
38282         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38283     rc = test_xmlUTF8Strsize();
38284         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38285     rc = test_xmlUTF8Strsub();
38286         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38287
38288     if (test_ret != 0)
38289         printf("Module xmlstring: %d errors\n", test_ret);
38290     return(test_ret);
38291 }
38292
38293 static int
38294 test_xmlUCSIsAegeanNumbers(void) {
38295     int test_ret = 0;
38296
38297 #if defined(LIBXML_UNICODE_ENABLED)
38298     int mem_base;
38299     int ret_val;
38300     int code; /* UCS code point */
38301     int n_code;
38302
38303     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38304         mem_base = xmlMemBlocks();
38305         code = gen_int(n_code, 0);
38306
38307         ret_val = xmlUCSIsAegeanNumbers(code);
38308         desret_int(ret_val);
38309         call_tests++;
38310         des_int(n_code, code, 0);
38311         xmlResetLastError();
38312         if (mem_base != xmlMemBlocks()) {
38313             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
38314                    xmlMemBlocks() - mem_base);
38315             test_ret++;
38316             printf(" %d", n_code);
38317             printf("\n");
38318         }
38319     }
38320     function_tests++;
38321 #endif
38322
38323     return(test_ret);
38324 }
38325
38326
38327 static int
38328 test_xmlUCSIsAlphabeticPresentationForms(void) {
38329     int test_ret = 0;
38330
38331 #if defined(LIBXML_UNICODE_ENABLED)
38332     int mem_base;
38333     int ret_val;
38334     int code; /* UCS code point */
38335     int n_code;
38336
38337     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38338         mem_base = xmlMemBlocks();
38339         code = gen_int(n_code, 0);
38340
38341         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
38342         desret_int(ret_val);
38343         call_tests++;
38344         des_int(n_code, code, 0);
38345         xmlResetLastError();
38346         if (mem_base != xmlMemBlocks()) {
38347             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
38348                    xmlMemBlocks() - mem_base);
38349             test_ret++;
38350             printf(" %d", n_code);
38351             printf("\n");
38352         }
38353     }
38354     function_tests++;
38355 #endif
38356
38357     return(test_ret);
38358 }
38359
38360
38361 static int
38362 test_xmlUCSIsArabic(void) {
38363     int test_ret = 0;
38364
38365 #if defined(LIBXML_UNICODE_ENABLED)
38366     int mem_base;
38367     int ret_val;
38368     int code; /* UCS code point */
38369     int n_code;
38370
38371     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38372         mem_base = xmlMemBlocks();
38373         code = gen_int(n_code, 0);
38374
38375         ret_val = xmlUCSIsArabic(code);
38376         desret_int(ret_val);
38377         call_tests++;
38378         des_int(n_code, code, 0);
38379         xmlResetLastError();
38380         if (mem_base != xmlMemBlocks()) {
38381             printf("Leak of %d blocks found in xmlUCSIsArabic",
38382                    xmlMemBlocks() - mem_base);
38383             test_ret++;
38384             printf(" %d", n_code);
38385             printf("\n");
38386         }
38387     }
38388     function_tests++;
38389 #endif
38390
38391     return(test_ret);
38392 }
38393
38394
38395 static int
38396 test_xmlUCSIsArabicPresentationFormsA(void) {
38397     int test_ret = 0;
38398
38399 #if defined(LIBXML_UNICODE_ENABLED)
38400     int mem_base;
38401     int ret_val;
38402     int code; /* UCS code point */
38403     int n_code;
38404
38405     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38406         mem_base = xmlMemBlocks();
38407         code = gen_int(n_code, 0);
38408
38409         ret_val = xmlUCSIsArabicPresentationFormsA(code);
38410         desret_int(ret_val);
38411         call_tests++;
38412         des_int(n_code, code, 0);
38413         xmlResetLastError();
38414         if (mem_base != xmlMemBlocks()) {
38415             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
38416                    xmlMemBlocks() - mem_base);
38417             test_ret++;
38418             printf(" %d", n_code);
38419             printf("\n");
38420         }
38421     }
38422     function_tests++;
38423 #endif
38424
38425     return(test_ret);
38426 }
38427
38428
38429 static int
38430 test_xmlUCSIsArabicPresentationFormsB(void) {
38431     int test_ret = 0;
38432
38433 #if defined(LIBXML_UNICODE_ENABLED)
38434     int mem_base;
38435     int ret_val;
38436     int code; /* UCS code point */
38437     int n_code;
38438
38439     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38440         mem_base = xmlMemBlocks();
38441         code = gen_int(n_code, 0);
38442
38443         ret_val = xmlUCSIsArabicPresentationFormsB(code);
38444         desret_int(ret_val);
38445         call_tests++;
38446         des_int(n_code, code, 0);
38447         xmlResetLastError();
38448         if (mem_base != xmlMemBlocks()) {
38449             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
38450                    xmlMemBlocks() - mem_base);
38451             test_ret++;
38452             printf(" %d", n_code);
38453             printf("\n");
38454         }
38455     }
38456     function_tests++;
38457 #endif
38458
38459     return(test_ret);
38460 }
38461
38462
38463 static int
38464 test_xmlUCSIsArmenian(void) {
38465     int test_ret = 0;
38466
38467 #if defined(LIBXML_UNICODE_ENABLED)
38468     int mem_base;
38469     int ret_val;
38470     int code; /* UCS code point */
38471     int n_code;
38472
38473     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38474         mem_base = xmlMemBlocks();
38475         code = gen_int(n_code, 0);
38476
38477         ret_val = xmlUCSIsArmenian(code);
38478         desret_int(ret_val);
38479         call_tests++;
38480         des_int(n_code, code, 0);
38481         xmlResetLastError();
38482         if (mem_base != xmlMemBlocks()) {
38483             printf("Leak of %d blocks found in xmlUCSIsArmenian",
38484                    xmlMemBlocks() - mem_base);
38485             test_ret++;
38486             printf(" %d", n_code);
38487             printf("\n");
38488         }
38489     }
38490     function_tests++;
38491 #endif
38492
38493     return(test_ret);
38494 }
38495
38496
38497 static int
38498 test_xmlUCSIsArrows(void) {
38499     int test_ret = 0;
38500
38501 #if defined(LIBXML_UNICODE_ENABLED)
38502     int mem_base;
38503     int ret_val;
38504     int code; /* UCS code point */
38505     int n_code;
38506
38507     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38508         mem_base = xmlMemBlocks();
38509         code = gen_int(n_code, 0);
38510
38511         ret_val = xmlUCSIsArrows(code);
38512         desret_int(ret_val);
38513         call_tests++;
38514         des_int(n_code, code, 0);
38515         xmlResetLastError();
38516         if (mem_base != xmlMemBlocks()) {
38517             printf("Leak of %d blocks found in xmlUCSIsArrows",
38518                    xmlMemBlocks() - mem_base);
38519             test_ret++;
38520             printf(" %d", n_code);
38521             printf("\n");
38522         }
38523     }
38524     function_tests++;
38525 #endif
38526
38527     return(test_ret);
38528 }
38529
38530
38531 static int
38532 test_xmlUCSIsBasicLatin(void) {
38533     int test_ret = 0;
38534
38535 #if defined(LIBXML_UNICODE_ENABLED)
38536     int mem_base;
38537     int ret_val;
38538     int code; /* UCS code point */
38539     int n_code;
38540
38541     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38542         mem_base = xmlMemBlocks();
38543         code = gen_int(n_code, 0);
38544
38545         ret_val = xmlUCSIsBasicLatin(code);
38546         desret_int(ret_val);
38547         call_tests++;
38548         des_int(n_code, code, 0);
38549         xmlResetLastError();
38550         if (mem_base != xmlMemBlocks()) {
38551             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
38552                    xmlMemBlocks() - mem_base);
38553             test_ret++;
38554             printf(" %d", n_code);
38555             printf("\n");
38556         }
38557     }
38558     function_tests++;
38559 #endif
38560
38561     return(test_ret);
38562 }
38563
38564
38565 static int
38566 test_xmlUCSIsBengali(void) {
38567     int test_ret = 0;
38568
38569 #if defined(LIBXML_UNICODE_ENABLED)
38570     int mem_base;
38571     int ret_val;
38572     int code; /* UCS code point */
38573     int n_code;
38574
38575     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38576         mem_base = xmlMemBlocks();
38577         code = gen_int(n_code, 0);
38578
38579         ret_val = xmlUCSIsBengali(code);
38580         desret_int(ret_val);
38581         call_tests++;
38582         des_int(n_code, code, 0);
38583         xmlResetLastError();
38584         if (mem_base != xmlMemBlocks()) {
38585             printf("Leak of %d blocks found in xmlUCSIsBengali",
38586                    xmlMemBlocks() - mem_base);
38587             test_ret++;
38588             printf(" %d", n_code);
38589             printf("\n");
38590         }
38591     }
38592     function_tests++;
38593 #endif
38594
38595     return(test_ret);
38596 }
38597
38598
38599 static int
38600 test_xmlUCSIsBlock(void) {
38601     int test_ret = 0;
38602
38603 #if defined(LIBXML_UNICODE_ENABLED)
38604     int mem_base;
38605     int ret_val;
38606     int code; /* UCS code point */
38607     int n_code;
38608     char * block; /* UCS block name */
38609     int n_block;
38610
38611     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38612     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
38613         mem_base = xmlMemBlocks();
38614         code = gen_int(n_code, 0);
38615         block = gen_const_char_ptr(n_block, 1);
38616
38617         ret_val = xmlUCSIsBlock(code, (const char *)block);
38618         desret_int(ret_val);
38619         call_tests++;
38620         des_int(n_code, code, 0);
38621         des_const_char_ptr(n_block, (const char *)block, 1);
38622         xmlResetLastError();
38623         if (mem_base != xmlMemBlocks()) {
38624             printf("Leak of %d blocks found in xmlUCSIsBlock",
38625                    xmlMemBlocks() - mem_base);
38626             test_ret++;
38627             printf(" %d", n_code);
38628             printf(" %d", n_block);
38629             printf("\n");
38630         }
38631     }
38632     }
38633     function_tests++;
38634 #endif
38635
38636     return(test_ret);
38637 }
38638
38639
38640 static int
38641 test_xmlUCSIsBlockElements(void) {
38642     int test_ret = 0;
38643
38644 #if defined(LIBXML_UNICODE_ENABLED)
38645     int mem_base;
38646     int ret_val;
38647     int code; /* UCS code point */
38648     int n_code;
38649
38650     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38651         mem_base = xmlMemBlocks();
38652         code = gen_int(n_code, 0);
38653
38654         ret_val = xmlUCSIsBlockElements(code);
38655         desret_int(ret_val);
38656         call_tests++;
38657         des_int(n_code, code, 0);
38658         xmlResetLastError();
38659         if (mem_base != xmlMemBlocks()) {
38660             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
38661                    xmlMemBlocks() - mem_base);
38662             test_ret++;
38663             printf(" %d", n_code);
38664             printf("\n");
38665         }
38666     }
38667     function_tests++;
38668 #endif
38669
38670     return(test_ret);
38671 }
38672
38673
38674 static int
38675 test_xmlUCSIsBopomofo(void) {
38676     int test_ret = 0;
38677
38678 #if defined(LIBXML_UNICODE_ENABLED)
38679     int mem_base;
38680     int ret_val;
38681     int code; /* UCS code point */
38682     int n_code;
38683
38684     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38685         mem_base = xmlMemBlocks();
38686         code = gen_int(n_code, 0);
38687
38688         ret_val = xmlUCSIsBopomofo(code);
38689         desret_int(ret_val);
38690         call_tests++;
38691         des_int(n_code, code, 0);
38692         xmlResetLastError();
38693         if (mem_base != xmlMemBlocks()) {
38694             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
38695                    xmlMemBlocks() - mem_base);
38696             test_ret++;
38697             printf(" %d", n_code);
38698             printf("\n");
38699         }
38700     }
38701     function_tests++;
38702 #endif
38703
38704     return(test_ret);
38705 }
38706
38707
38708 static int
38709 test_xmlUCSIsBopomofoExtended(void) {
38710     int test_ret = 0;
38711
38712 #if defined(LIBXML_UNICODE_ENABLED)
38713     int mem_base;
38714     int ret_val;
38715     int code; /* UCS code point */
38716     int n_code;
38717
38718     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38719         mem_base = xmlMemBlocks();
38720         code = gen_int(n_code, 0);
38721
38722         ret_val = xmlUCSIsBopomofoExtended(code);
38723         desret_int(ret_val);
38724         call_tests++;
38725         des_int(n_code, code, 0);
38726         xmlResetLastError();
38727         if (mem_base != xmlMemBlocks()) {
38728             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
38729                    xmlMemBlocks() - mem_base);
38730             test_ret++;
38731             printf(" %d", n_code);
38732             printf("\n");
38733         }
38734     }
38735     function_tests++;
38736 #endif
38737
38738     return(test_ret);
38739 }
38740
38741
38742 static int
38743 test_xmlUCSIsBoxDrawing(void) {
38744     int test_ret = 0;
38745
38746 #if defined(LIBXML_UNICODE_ENABLED)
38747     int mem_base;
38748     int ret_val;
38749     int code; /* UCS code point */
38750     int n_code;
38751
38752     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38753         mem_base = xmlMemBlocks();
38754         code = gen_int(n_code, 0);
38755
38756         ret_val = xmlUCSIsBoxDrawing(code);
38757         desret_int(ret_val);
38758         call_tests++;
38759         des_int(n_code, code, 0);
38760         xmlResetLastError();
38761         if (mem_base != xmlMemBlocks()) {
38762             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
38763                    xmlMemBlocks() - mem_base);
38764             test_ret++;
38765             printf(" %d", n_code);
38766             printf("\n");
38767         }
38768     }
38769     function_tests++;
38770 #endif
38771
38772     return(test_ret);
38773 }
38774
38775
38776 static int
38777 test_xmlUCSIsBraillePatterns(void) {
38778     int test_ret = 0;
38779
38780 #if defined(LIBXML_UNICODE_ENABLED)
38781     int mem_base;
38782     int ret_val;
38783     int code; /* UCS code point */
38784     int n_code;
38785
38786     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38787         mem_base = xmlMemBlocks();
38788         code = gen_int(n_code, 0);
38789
38790         ret_val = xmlUCSIsBraillePatterns(code);
38791         desret_int(ret_val);
38792         call_tests++;
38793         des_int(n_code, code, 0);
38794         xmlResetLastError();
38795         if (mem_base != xmlMemBlocks()) {
38796             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
38797                    xmlMemBlocks() - mem_base);
38798             test_ret++;
38799             printf(" %d", n_code);
38800             printf("\n");
38801         }
38802     }
38803     function_tests++;
38804 #endif
38805
38806     return(test_ret);
38807 }
38808
38809
38810 static int
38811 test_xmlUCSIsBuhid(void) {
38812     int test_ret = 0;
38813
38814 #if defined(LIBXML_UNICODE_ENABLED)
38815     int mem_base;
38816     int ret_val;
38817     int code; /* UCS code point */
38818     int n_code;
38819
38820     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38821         mem_base = xmlMemBlocks();
38822         code = gen_int(n_code, 0);
38823
38824         ret_val = xmlUCSIsBuhid(code);
38825         desret_int(ret_val);
38826         call_tests++;
38827         des_int(n_code, code, 0);
38828         xmlResetLastError();
38829         if (mem_base != xmlMemBlocks()) {
38830             printf("Leak of %d blocks found in xmlUCSIsBuhid",
38831                    xmlMemBlocks() - mem_base);
38832             test_ret++;
38833             printf(" %d", n_code);
38834             printf("\n");
38835         }
38836     }
38837     function_tests++;
38838 #endif
38839
38840     return(test_ret);
38841 }
38842
38843
38844 static int
38845 test_xmlUCSIsByzantineMusicalSymbols(void) {
38846     int test_ret = 0;
38847
38848 #if defined(LIBXML_UNICODE_ENABLED)
38849     int mem_base;
38850     int ret_val;
38851     int code; /* UCS code point */
38852     int n_code;
38853
38854     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38855         mem_base = xmlMemBlocks();
38856         code = gen_int(n_code, 0);
38857
38858         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
38859         desret_int(ret_val);
38860         call_tests++;
38861         des_int(n_code, code, 0);
38862         xmlResetLastError();
38863         if (mem_base != xmlMemBlocks()) {
38864             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
38865                    xmlMemBlocks() - mem_base);
38866             test_ret++;
38867             printf(" %d", n_code);
38868             printf("\n");
38869         }
38870     }
38871     function_tests++;
38872 #endif
38873
38874     return(test_ret);
38875 }
38876
38877
38878 static int
38879 test_xmlUCSIsCJKCompatibility(void) {
38880     int test_ret = 0;
38881
38882 #if defined(LIBXML_UNICODE_ENABLED)
38883     int mem_base;
38884     int ret_val;
38885     int code; /* UCS code point */
38886     int n_code;
38887
38888     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38889         mem_base = xmlMemBlocks();
38890         code = gen_int(n_code, 0);
38891
38892         ret_val = xmlUCSIsCJKCompatibility(code);
38893         desret_int(ret_val);
38894         call_tests++;
38895         des_int(n_code, code, 0);
38896         xmlResetLastError();
38897         if (mem_base != xmlMemBlocks()) {
38898             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
38899                    xmlMemBlocks() - mem_base);
38900             test_ret++;
38901             printf(" %d", n_code);
38902             printf("\n");
38903         }
38904     }
38905     function_tests++;
38906 #endif
38907
38908     return(test_ret);
38909 }
38910
38911
38912 static int
38913 test_xmlUCSIsCJKCompatibilityForms(void) {
38914     int test_ret = 0;
38915
38916 #if defined(LIBXML_UNICODE_ENABLED)
38917     int mem_base;
38918     int ret_val;
38919     int code; /* UCS code point */
38920     int n_code;
38921
38922     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38923         mem_base = xmlMemBlocks();
38924         code = gen_int(n_code, 0);
38925
38926         ret_val = xmlUCSIsCJKCompatibilityForms(code);
38927         desret_int(ret_val);
38928         call_tests++;
38929         des_int(n_code, code, 0);
38930         xmlResetLastError();
38931         if (mem_base != xmlMemBlocks()) {
38932             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
38933                    xmlMemBlocks() - mem_base);
38934             test_ret++;
38935             printf(" %d", n_code);
38936             printf("\n");
38937         }
38938     }
38939     function_tests++;
38940 #endif
38941
38942     return(test_ret);
38943 }
38944
38945
38946 static int
38947 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
38948     int test_ret = 0;
38949
38950 #if defined(LIBXML_UNICODE_ENABLED)
38951     int mem_base;
38952     int ret_val;
38953     int code; /* UCS code point */
38954     int n_code;
38955
38956     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38957         mem_base = xmlMemBlocks();
38958         code = gen_int(n_code, 0);
38959
38960         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
38961         desret_int(ret_val);
38962         call_tests++;
38963         des_int(n_code, code, 0);
38964         xmlResetLastError();
38965         if (mem_base != xmlMemBlocks()) {
38966             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
38967                    xmlMemBlocks() - mem_base);
38968             test_ret++;
38969             printf(" %d", n_code);
38970             printf("\n");
38971         }
38972     }
38973     function_tests++;
38974 #endif
38975
38976     return(test_ret);
38977 }
38978
38979
38980 static int
38981 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
38982     int test_ret = 0;
38983
38984 #if defined(LIBXML_UNICODE_ENABLED)
38985     int mem_base;
38986     int ret_val;
38987     int code; /* UCS code point */
38988     int n_code;
38989
38990     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38991         mem_base = xmlMemBlocks();
38992         code = gen_int(n_code, 0);
38993
38994         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
38995         desret_int(ret_val);
38996         call_tests++;
38997         des_int(n_code, code, 0);
38998         xmlResetLastError();
38999         if (mem_base != xmlMemBlocks()) {
39000             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
39001                    xmlMemBlocks() - mem_base);
39002             test_ret++;
39003             printf(" %d", n_code);
39004             printf("\n");
39005         }
39006     }
39007     function_tests++;
39008 #endif
39009
39010     return(test_ret);
39011 }
39012
39013
39014 static int
39015 test_xmlUCSIsCJKRadicalsSupplement(void) {
39016     int test_ret = 0;
39017
39018 #if defined(LIBXML_UNICODE_ENABLED)
39019     int mem_base;
39020     int ret_val;
39021     int code; /* UCS code point */
39022     int n_code;
39023
39024     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39025         mem_base = xmlMemBlocks();
39026         code = gen_int(n_code, 0);
39027
39028         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
39029         desret_int(ret_val);
39030         call_tests++;
39031         des_int(n_code, code, 0);
39032         xmlResetLastError();
39033         if (mem_base != xmlMemBlocks()) {
39034             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
39035                    xmlMemBlocks() - mem_base);
39036             test_ret++;
39037             printf(" %d", n_code);
39038             printf("\n");
39039         }
39040     }
39041     function_tests++;
39042 #endif
39043
39044     return(test_ret);
39045 }
39046
39047
39048 static int
39049 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
39050     int test_ret = 0;
39051
39052 #if defined(LIBXML_UNICODE_ENABLED)
39053     int mem_base;
39054     int ret_val;
39055     int code; /* UCS code point */
39056     int n_code;
39057
39058     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39059         mem_base = xmlMemBlocks();
39060         code = gen_int(n_code, 0);
39061
39062         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
39063         desret_int(ret_val);
39064         call_tests++;
39065         des_int(n_code, code, 0);
39066         xmlResetLastError();
39067         if (mem_base != xmlMemBlocks()) {
39068             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
39069                    xmlMemBlocks() - mem_base);
39070             test_ret++;
39071             printf(" %d", n_code);
39072             printf("\n");
39073         }
39074     }
39075     function_tests++;
39076 #endif
39077
39078     return(test_ret);
39079 }
39080
39081
39082 static int
39083 test_xmlUCSIsCJKUnifiedIdeographs(void) {
39084     int test_ret = 0;
39085
39086 #if defined(LIBXML_UNICODE_ENABLED)
39087     int mem_base;
39088     int ret_val;
39089     int code; /* UCS code point */
39090     int n_code;
39091
39092     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39093         mem_base = xmlMemBlocks();
39094         code = gen_int(n_code, 0);
39095
39096         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
39097         desret_int(ret_val);
39098         call_tests++;
39099         des_int(n_code, code, 0);
39100         xmlResetLastError();
39101         if (mem_base != xmlMemBlocks()) {
39102             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
39103                    xmlMemBlocks() - mem_base);
39104             test_ret++;
39105             printf(" %d", n_code);
39106             printf("\n");
39107         }
39108     }
39109     function_tests++;
39110 #endif
39111
39112     return(test_ret);
39113 }
39114
39115
39116 static int
39117 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
39118     int test_ret = 0;
39119
39120 #if defined(LIBXML_UNICODE_ENABLED)
39121     int mem_base;
39122     int ret_val;
39123     int code; /* UCS code point */
39124     int n_code;
39125
39126     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39127         mem_base = xmlMemBlocks();
39128         code = gen_int(n_code, 0);
39129
39130         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
39131         desret_int(ret_val);
39132         call_tests++;
39133         des_int(n_code, code, 0);
39134         xmlResetLastError();
39135         if (mem_base != xmlMemBlocks()) {
39136             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
39137                    xmlMemBlocks() - mem_base);
39138             test_ret++;
39139             printf(" %d", n_code);
39140             printf("\n");
39141         }
39142     }
39143     function_tests++;
39144 #endif
39145
39146     return(test_ret);
39147 }
39148
39149
39150 static int
39151 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
39152     int test_ret = 0;
39153
39154 #if defined(LIBXML_UNICODE_ENABLED)
39155     int mem_base;
39156     int ret_val;
39157     int code; /* UCS code point */
39158     int n_code;
39159
39160     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39161         mem_base = xmlMemBlocks();
39162         code = gen_int(n_code, 0);
39163
39164         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
39165         desret_int(ret_val);
39166         call_tests++;
39167         des_int(n_code, code, 0);
39168         xmlResetLastError();
39169         if (mem_base != xmlMemBlocks()) {
39170             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
39171                    xmlMemBlocks() - mem_base);
39172             test_ret++;
39173             printf(" %d", n_code);
39174             printf("\n");
39175         }
39176     }
39177     function_tests++;
39178 #endif
39179
39180     return(test_ret);
39181 }
39182
39183
39184 static int
39185 test_xmlUCSIsCat(void) {
39186     int test_ret = 0;
39187
39188 #if defined(LIBXML_UNICODE_ENABLED)
39189     int mem_base;
39190     int ret_val;
39191     int code; /* UCS code point */
39192     int n_code;
39193     char * cat; /* UCS Category name */
39194     int n_cat;
39195
39196     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39197     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
39198         mem_base = xmlMemBlocks();
39199         code = gen_int(n_code, 0);
39200         cat = gen_const_char_ptr(n_cat, 1);
39201
39202         ret_val = xmlUCSIsCat(code, (const char *)cat);
39203         desret_int(ret_val);
39204         call_tests++;
39205         des_int(n_code, code, 0);
39206         des_const_char_ptr(n_cat, (const char *)cat, 1);
39207         xmlResetLastError();
39208         if (mem_base != xmlMemBlocks()) {
39209             printf("Leak of %d blocks found in xmlUCSIsCat",
39210                    xmlMemBlocks() - mem_base);
39211             test_ret++;
39212             printf(" %d", n_code);
39213             printf(" %d", n_cat);
39214             printf("\n");
39215         }
39216     }
39217     }
39218     function_tests++;
39219 #endif
39220
39221     return(test_ret);
39222 }
39223
39224
39225 static int
39226 test_xmlUCSIsCatC(void) {
39227     int test_ret = 0;
39228
39229 #if defined(LIBXML_UNICODE_ENABLED)
39230     int mem_base;
39231     int ret_val;
39232     int code; /* UCS code point */
39233     int n_code;
39234
39235     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39236         mem_base = xmlMemBlocks();
39237         code = gen_int(n_code, 0);
39238
39239         ret_val = xmlUCSIsCatC(code);
39240         desret_int(ret_val);
39241         call_tests++;
39242         des_int(n_code, code, 0);
39243         xmlResetLastError();
39244         if (mem_base != xmlMemBlocks()) {
39245             printf("Leak of %d blocks found in xmlUCSIsCatC",
39246                    xmlMemBlocks() - mem_base);
39247             test_ret++;
39248             printf(" %d", n_code);
39249             printf("\n");
39250         }
39251     }
39252     function_tests++;
39253 #endif
39254
39255     return(test_ret);
39256 }
39257
39258
39259 static int
39260 test_xmlUCSIsCatCc(void) {
39261     int test_ret = 0;
39262
39263 #if defined(LIBXML_UNICODE_ENABLED)
39264     int mem_base;
39265     int ret_val;
39266     int code; /* UCS code point */
39267     int n_code;
39268
39269     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39270         mem_base = xmlMemBlocks();
39271         code = gen_int(n_code, 0);
39272
39273         ret_val = xmlUCSIsCatCc(code);
39274         desret_int(ret_val);
39275         call_tests++;
39276         des_int(n_code, code, 0);
39277         xmlResetLastError();
39278         if (mem_base != xmlMemBlocks()) {
39279             printf("Leak of %d blocks found in xmlUCSIsCatCc",
39280                    xmlMemBlocks() - mem_base);
39281             test_ret++;
39282             printf(" %d", n_code);
39283             printf("\n");
39284         }
39285     }
39286     function_tests++;
39287 #endif
39288
39289     return(test_ret);
39290 }
39291
39292
39293 static int
39294 test_xmlUCSIsCatCf(void) {
39295     int test_ret = 0;
39296
39297 #if defined(LIBXML_UNICODE_ENABLED)
39298     int mem_base;
39299     int ret_val;
39300     int code; /* UCS code point */
39301     int n_code;
39302
39303     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39304         mem_base = xmlMemBlocks();
39305         code = gen_int(n_code, 0);
39306
39307         ret_val = xmlUCSIsCatCf(code);
39308         desret_int(ret_val);
39309         call_tests++;
39310         des_int(n_code, code, 0);
39311         xmlResetLastError();
39312         if (mem_base != xmlMemBlocks()) {
39313             printf("Leak of %d blocks found in xmlUCSIsCatCf",
39314                    xmlMemBlocks() - mem_base);
39315             test_ret++;
39316             printf(" %d", n_code);
39317             printf("\n");
39318         }
39319     }
39320     function_tests++;
39321 #endif
39322
39323     return(test_ret);
39324 }
39325
39326
39327 static int
39328 test_xmlUCSIsCatCo(void) {
39329     int test_ret = 0;
39330
39331 #if defined(LIBXML_UNICODE_ENABLED)
39332     int mem_base;
39333     int ret_val;
39334     int code; /* UCS code point */
39335     int n_code;
39336
39337     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39338         mem_base = xmlMemBlocks();
39339         code = gen_int(n_code, 0);
39340
39341         ret_val = xmlUCSIsCatCo(code);
39342         desret_int(ret_val);
39343         call_tests++;
39344         des_int(n_code, code, 0);
39345         xmlResetLastError();
39346         if (mem_base != xmlMemBlocks()) {
39347             printf("Leak of %d blocks found in xmlUCSIsCatCo",
39348                    xmlMemBlocks() - mem_base);
39349             test_ret++;
39350             printf(" %d", n_code);
39351             printf("\n");
39352         }
39353     }
39354     function_tests++;
39355 #endif
39356
39357     return(test_ret);
39358 }
39359
39360
39361 static int
39362 test_xmlUCSIsCatCs(void) {
39363     int test_ret = 0;
39364
39365 #if defined(LIBXML_UNICODE_ENABLED)
39366     int mem_base;
39367     int ret_val;
39368     int code; /* UCS code point */
39369     int n_code;
39370
39371     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39372         mem_base = xmlMemBlocks();
39373         code = gen_int(n_code, 0);
39374
39375         ret_val = xmlUCSIsCatCs(code);
39376         desret_int(ret_val);
39377         call_tests++;
39378         des_int(n_code, code, 0);
39379         xmlResetLastError();
39380         if (mem_base != xmlMemBlocks()) {
39381             printf("Leak of %d blocks found in xmlUCSIsCatCs",
39382                    xmlMemBlocks() - mem_base);
39383             test_ret++;
39384             printf(" %d", n_code);
39385             printf("\n");
39386         }
39387     }
39388     function_tests++;
39389 #endif
39390
39391     return(test_ret);
39392 }
39393
39394
39395 static int
39396 test_xmlUCSIsCatL(void) {
39397     int test_ret = 0;
39398
39399 #if defined(LIBXML_UNICODE_ENABLED)
39400     int mem_base;
39401     int ret_val;
39402     int code; /* UCS code point */
39403     int n_code;
39404
39405     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39406         mem_base = xmlMemBlocks();
39407         code = gen_int(n_code, 0);
39408
39409         ret_val = xmlUCSIsCatL(code);
39410         desret_int(ret_val);
39411         call_tests++;
39412         des_int(n_code, code, 0);
39413         xmlResetLastError();
39414         if (mem_base != xmlMemBlocks()) {
39415             printf("Leak of %d blocks found in xmlUCSIsCatL",
39416                    xmlMemBlocks() - mem_base);
39417             test_ret++;
39418             printf(" %d", n_code);
39419             printf("\n");
39420         }
39421     }
39422     function_tests++;
39423 #endif
39424
39425     return(test_ret);
39426 }
39427
39428
39429 static int
39430 test_xmlUCSIsCatLl(void) {
39431     int test_ret = 0;
39432
39433 #if defined(LIBXML_UNICODE_ENABLED)
39434     int mem_base;
39435     int ret_val;
39436     int code; /* UCS code point */
39437     int n_code;
39438
39439     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39440         mem_base = xmlMemBlocks();
39441         code = gen_int(n_code, 0);
39442
39443         ret_val = xmlUCSIsCatLl(code);
39444         desret_int(ret_val);
39445         call_tests++;
39446         des_int(n_code, code, 0);
39447         xmlResetLastError();
39448         if (mem_base != xmlMemBlocks()) {
39449             printf("Leak of %d blocks found in xmlUCSIsCatLl",
39450                    xmlMemBlocks() - mem_base);
39451             test_ret++;
39452             printf(" %d", n_code);
39453             printf("\n");
39454         }
39455     }
39456     function_tests++;
39457 #endif
39458
39459     return(test_ret);
39460 }
39461
39462
39463 static int
39464 test_xmlUCSIsCatLm(void) {
39465     int test_ret = 0;
39466
39467 #if defined(LIBXML_UNICODE_ENABLED)
39468     int mem_base;
39469     int ret_val;
39470     int code; /* UCS code point */
39471     int n_code;
39472
39473     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39474         mem_base = xmlMemBlocks();
39475         code = gen_int(n_code, 0);
39476
39477         ret_val = xmlUCSIsCatLm(code);
39478         desret_int(ret_val);
39479         call_tests++;
39480         des_int(n_code, code, 0);
39481         xmlResetLastError();
39482         if (mem_base != xmlMemBlocks()) {
39483             printf("Leak of %d blocks found in xmlUCSIsCatLm",
39484                    xmlMemBlocks() - mem_base);
39485             test_ret++;
39486             printf(" %d", n_code);
39487             printf("\n");
39488         }
39489     }
39490     function_tests++;
39491 #endif
39492
39493     return(test_ret);
39494 }
39495
39496
39497 static int
39498 test_xmlUCSIsCatLo(void) {
39499     int test_ret = 0;
39500
39501 #if defined(LIBXML_UNICODE_ENABLED)
39502     int mem_base;
39503     int ret_val;
39504     int code; /* UCS code point */
39505     int n_code;
39506
39507     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39508         mem_base = xmlMemBlocks();
39509         code = gen_int(n_code, 0);
39510
39511         ret_val = xmlUCSIsCatLo(code);
39512         desret_int(ret_val);
39513         call_tests++;
39514         des_int(n_code, code, 0);
39515         xmlResetLastError();
39516         if (mem_base != xmlMemBlocks()) {
39517             printf("Leak of %d blocks found in xmlUCSIsCatLo",
39518                    xmlMemBlocks() - mem_base);
39519             test_ret++;
39520             printf(" %d", n_code);
39521             printf("\n");
39522         }
39523     }
39524     function_tests++;
39525 #endif
39526
39527     return(test_ret);
39528 }
39529
39530
39531 static int
39532 test_xmlUCSIsCatLt(void) {
39533     int test_ret = 0;
39534
39535 #if defined(LIBXML_UNICODE_ENABLED)
39536     int mem_base;
39537     int ret_val;
39538     int code; /* UCS code point */
39539     int n_code;
39540
39541     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39542         mem_base = xmlMemBlocks();
39543         code = gen_int(n_code, 0);
39544
39545         ret_val = xmlUCSIsCatLt(code);
39546         desret_int(ret_val);
39547         call_tests++;
39548         des_int(n_code, code, 0);
39549         xmlResetLastError();
39550         if (mem_base != xmlMemBlocks()) {
39551             printf("Leak of %d blocks found in xmlUCSIsCatLt",
39552                    xmlMemBlocks() - mem_base);
39553             test_ret++;
39554             printf(" %d", n_code);
39555             printf("\n");
39556         }
39557     }
39558     function_tests++;
39559 #endif
39560
39561     return(test_ret);
39562 }
39563
39564
39565 static int
39566 test_xmlUCSIsCatLu(void) {
39567     int test_ret = 0;
39568
39569 #if defined(LIBXML_UNICODE_ENABLED)
39570     int mem_base;
39571     int ret_val;
39572     int code; /* UCS code point */
39573     int n_code;
39574
39575     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39576         mem_base = xmlMemBlocks();
39577         code = gen_int(n_code, 0);
39578
39579         ret_val = xmlUCSIsCatLu(code);
39580         desret_int(ret_val);
39581         call_tests++;
39582         des_int(n_code, code, 0);
39583         xmlResetLastError();
39584         if (mem_base != xmlMemBlocks()) {
39585             printf("Leak of %d blocks found in xmlUCSIsCatLu",
39586                    xmlMemBlocks() - mem_base);
39587             test_ret++;
39588             printf(" %d", n_code);
39589             printf("\n");
39590         }
39591     }
39592     function_tests++;
39593 #endif
39594
39595     return(test_ret);
39596 }
39597
39598
39599 static int
39600 test_xmlUCSIsCatM(void) {
39601     int test_ret = 0;
39602
39603 #if defined(LIBXML_UNICODE_ENABLED)
39604     int mem_base;
39605     int ret_val;
39606     int code; /* UCS code point */
39607     int n_code;
39608
39609     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39610         mem_base = xmlMemBlocks();
39611         code = gen_int(n_code, 0);
39612
39613         ret_val = xmlUCSIsCatM(code);
39614         desret_int(ret_val);
39615         call_tests++;
39616         des_int(n_code, code, 0);
39617         xmlResetLastError();
39618         if (mem_base != xmlMemBlocks()) {
39619             printf("Leak of %d blocks found in xmlUCSIsCatM",
39620                    xmlMemBlocks() - mem_base);
39621             test_ret++;
39622             printf(" %d", n_code);
39623             printf("\n");
39624         }
39625     }
39626     function_tests++;
39627 #endif
39628
39629     return(test_ret);
39630 }
39631
39632
39633 static int
39634 test_xmlUCSIsCatMc(void) {
39635     int test_ret = 0;
39636
39637 #if defined(LIBXML_UNICODE_ENABLED)
39638     int mem_base;
39639     int ret_val;
39640     int code; /* UCS code point */
39641     int n_code;
39642
39643     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39644         mem_base = xmlMemBlocks();
39645         code = gen_int(n_code, 0);
39646
39647         ret_val = xmlUCSIsCatMc(code);
39648         desret_int(ret_val);
39649         call_tests++;
39650         des_int(n_code, code, 0);
39651         xmlResetLastError();
39652         if (mem_base != xmlMemBlocks()) {
39653             printf("Leak of %d blocks found in xmlUCSIsCatMc",
39654                    xmlMemBlocks() - mem_base);
39655             test_ret++;
39656             printf(" %d", n_code);
39657             printf("\n");
39658         }
39659     }
39660     function_tests++;
39661 #endif
39662
39663     return(test_ret);
39664 }
39665
39666
39667 static int
39668 test_xmlUCSIsCatMe(void) {
39669     int test_ret = 0;
39670
39671 #if defined(LIBXML_UNICODE_ENABLED)
39672     int mem_base;
39673     int ret_val;
39674     int code; /* UCS code point */
39675     int n_code;
39676
39677     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39678         mem_base = xmlMemBlocks();
39679         code = gen_int(n_code, 0);
39680
39681         ret_val = xmlUCSIsCatMe(code);
39682         desret_int(ret_val);
39683         call_tests++;
39684         des_int(n_code, code, 0);
39685         xmlResetLastError();
39686         if (mem_base != xmlMemBlocks()) {
39687             printf("Leak of %d blocks found in xmlUCSIsCatMe",
39688                    xmlMemBlocks() - mem_base);
39689             test_ret++;
39690             printf(" %d", n_code);
39691             printf("\n");
39692         }
39693     }
39694     function_tests++;
39695 #endif
39696
39697     return(test_ret);
39698 }
39699
39700
39701 static int
39702 test_xmlUCSIsCatMn(void) {
39703     int test_ret = 0;
39704
39705 #if defined(LIBXML_UNICODE_ENABLED)
39706     int mem_base;
39707     int ret_val;
39708     int code; /* UCS code point */
39709     int n_code;
39710
39711     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39712         mem_base = xmlMemBlocks();
39713         code = gen_int(n_code, 0);
39714
39715         ret_val = xmlUCSIsCatMn(code);
39716         desret_int(ret_val);
39717         call_tests++;
39718         des_int(n_code, code, 0);
39719         xmlResetLastError();
39720         if (mem_base != xmlMemBlocks()) {
39721             printf("Leak of %d blocks found in xmlUCSIsCatMn",
39722                    xmlMemBlocks() - mem_base);
39723             test_ret++;
39724             printf(" %d", n_code);
39725             printf("\n");
39726         }
39727     }
39728     function_tests++;
39729 #endif
39730
39731     return(test_ret);
39732 }
39733
39734
39735 static int
39736 test_xmlUCSIsCatN(void) {
39737     int test_ret = 0;
39738
39739 #if defined(LIBXML_UNICODE_ENABLED)
39740     int mem_base;
39741     int ret_val;
39742     int code; /* UCS code point */
39743     int n_code;
39744
39745     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39746         mem_base = xmlMemBlocks();
39747         code = gen_int(n_code, 0);
39748
39749         ret_val = xmlUCSIsCatN(code);
39750         desret_int(ret_val);
39751         call_tests++;
39752         des_int(n_code, code, 0);
39753         xmlResetLastError();
39754         if (mem_base != xmlMemBlocks()) {
39755             printf("Leak of %d blocks found in xmlUCSIsCatN",
39756                    xmlMemBlocks() - mem_base);
39757             test_ret++;
39758             printf(" %d", n_code);
39759             printf("\n");
39760         }
39761     }
39762     function_tests++;
39763 #endif
39764
39765     return(test_ret);
39766 }
39767
39768
39769 static int
39770 test_xmlUCSIsCatNd(void) {
39771     int test_ret = 0;
39772
39773 #if defined(LIBXML_UNICODE_ENABLED)
39774     int mem_base;
39775     int ret_val;
39776     int code; /* UCS code point */
39777     int n_code;
39778
39779     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39780         mem_base = xmlMemBlocks();
39781         code = gen_int(n_code, 0);
39782
39783         ret_val = xmlUCSIsCatNd(code);
39784         desret_int(ret_val);
39785         call_tests++;
39786         des_int(n_code, code, 0);
39787         xmlResetLastError();
39788         if (mem_base != xmlMemBlocks()) {
39789             printf("Leak of %d blocks found in xmlUCSIsCatNd",
39790                    xmlMemBlocks() - mem_base);
39791             test_ret++;
39792             printf(" %d", n_code);
39793             printf("\n");
39794         }
39795     }
39796     function_tests++;
39797 #endif
39798
39799     return(test_ret);
39800 }
39801
39802
39803 static int
39804 test_xmlUCSIsCatNl(void) {
39805     int test_ret = 0;
39806
39807 #if defined(LIBXML_UNICODE_ENABLED)
39808     int mem_base;
39809     int ret_val;
39810     int code; /* UCS code point */
39811     int n_code;
39812
39813     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39814         mem_base = xmlMemBlocks();
39815         code = gen_int(n_code, 0);
39816
39817         ret_val = xmlUCSIsCatNl(code);
39818         desret_int(ret_val);
39819         call_tests++;
39820         des_int(n_code, code, 0);
39821         xmlResetLastError();
39822         if (mem_base != xmlMemBlocks()) {
39823             printf("Leak of %d blocks found in xmlUCSIsCatNl",
39824                    xmlMemBlocks() - mem_base);
39825             test_ret++;
39826             printf(" %d", n_code);
39827             printf("\n");
39828         }
39829     }
39830     function_tests++;
39831 #endif
39832
39833     return(test_ret);
39834 }
39835
39836
39837 static int
39838 test_xmlUCSIsCatNo(void) {
39839     int test_ret = 0;
39840
39841 #if defined(LIBXML_UNICODE_ENABLED)
39842     int mem_base;
39843     int ret_val;
39844     int code; /* UCS code point */
39845     int n_code;
39846
39847     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39848         mem_base = xmlMemBlocks();
39849         code = gen_int(n_code, 0);
39850
39851         ret_val = xmlUCSIsCatNo(code);
39852         desret_int(ret_val);
39853         call_tests++;
39854         des_int(n_code, code, 0);
39855         xmlResetLastError();
39856         if (mem_base != xmlMemBlocks()) {
39857             printf("Leak of %d blocks found in xmlUCSIsCatNo",
39858                    xmlMemBlocks() - mem_base);
39859             test_ret++;
39860             printf(" %d", n_code);
39861             printf("\n");
39862         }
39863     }
39864     function_tests++;
39865 #endif
39866
39867     return(test_ret);
39868 }
39869
39870
39871 static int
39872 test_xmlUCSIsCatP(void) {
39873     int test_ret = 0;
39874
39875 #if defined(LIBXML_UNICODE_ENABLED)
39876     int mem_base;
39877     int ret_val;
39878     int code; /* UCS code point */
39879     int n_code;
39880
39881     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39882         mem_base = xmlMemBlocks();
39883         code = gen_int(n_code, 0);
39884
39885         ret_val = xmlUCSIsCatP(code);
39886         desret_int(ret_val);
39887         call_tests++;
39888         des_int(n_code, code, 0);
39889         xmlResetLastError();
39890         if (mem_base != xmlMemBlocks()) {
39891             printf("Leak of %d blocks found in xmlUCSIsCatP",
39892                    xmlMemBlocks() - mem_base);
39893             test_ret++;
39894             printf(" %d", n_code);
39895             printf("\n");
39896         }
39897     }
39898     function_tests++;
39899 #endif
39900
39901     return(test_ret);
39902 }
39903
39904
39905 static int
39906 test_xmlUCSIsCatPc(void) {
39907     int test_ret = 0;
39908
39909 #if defined(LIBXML_UNICODE_ENABLED)
39910     int mem_base;
39911     int ret_val;
39912     int code; /* UCS code point */
39913     int n_code;
39914
39915     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39916         mem_base = xmlMemBlocks();
39917         code = gen_int(n_code, 0);
39918
39919         ret_val = xmlUCSIsCatPc(code);
39920         desret_int(ret_val);
39921         call_tests++;
39922         des_int(n_code, code, 0);
39923         xmlResetLastError();
39924         if (mem_base != xmlMemBlocks()) {
39925             printf("Leak of %d blocks found in xmlUCSIsCatPc",
39926                    xmlMemBlocks() - mem_base);
39927             test_ret++;
39928             printf(" %d", n_code);
39929             printf("\n");
39930         }
39931     }
39932     function_tests++;
39933 #endif
39934
39935     return(test_ret);
39936 }
39937
39938
39939 static int
39940 test_xmlUCSIsCatPd(void) {
39941     int test_ret = 0;
39942
39943 #if defined(LIBXML_UNICODE_ENABLED)
39944     int mem_base;
39945     int ret_val;
39946     int code; /* UCS code point */
39947     int n_code;
39948
39949     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39950         mem_base = xmlMemBlocks();
39951         code = gen_int(n_code, 0);
39952
39953         ret_val = xmlUCSIsCatPd(code);
39954         desret_int(ret_val);
39955         call_tests++;
39956         des_int(n_code, code, 0);
39957         xmlResetLastError();
39958         if (mem_base != xmlMemBlocks()) {
39959             printf("Leak of %d blocks found in xmlUCSIsCatPd",
39960                    xmlMemBlocks() - mem_base);
39961             test_ret++;
39962             printf(" %d", n_code);
39963             printf("\n");
39964         }
39965     }
39966     function_tests++;
39967 #endif
39968
39969     return(test_ret);
39970 }
39971
39972
39973 static int
39974 test_xmlUCSIsCatPe(void) {
39975     int test_ret = 0;
39976
39977 #if defined(LIBXML_UNICODE_ENABLED)
39978     int mem_base;
39979     int ret_val;
39980     int code; /* UCS code point */
39981     int n_code;
39982
39983     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39984         mem_base = xmlMemBlocks();
39985         code = gen_int(n_code, 0);
39986
39987         ret_val = xmlUCSIsCatPe(code);
39988         desret_int(ret_val);
39989         call_tests++;
39990         des_int(n_code, code, 0);
39991         xmlResetLastError();
39992         if (mem_base != xmlMemBlocks()) {
39993             printf("Leak of %d blocks found in xmlUCSIsCatPe",
39994                    xmlMemBlocks() - mem_base);
39995             test_ret++;
39996             printf(" %d", n_code);
39997             printf("\n");
39998         }
39999     }
40000     function_tests++;
40001 #endif
40002
40003     return(test_ret);
40004 }
40005
40006
40007 static int
40008 test_xmlUCSIsCatPf(void) {
40009     int test_ret = 0;
40010
40011 #if defined(LIBXML_UNICODE_ENABLED)
40012     int mem_base;
40013     int ret_val;
40014     int code; /* UCS code point */
40015     int n_code;
40016
40017     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40018         mem_base = xmlMemBlocks();
40019         code = gen_int(n_code, 0);
40020
40021         ret_val = xmlUCSIsCatPf(code);
40022         desret_int(ret_val);
40023         call_tests++;
40024         des_int(n_code, code, 0);
40025         xmlResetLastError();
40026         if (mem_base != xmlMemBlocks()) {
40027             printf("Leak of %d blocks found in xmlUCSIsCatPf",
40028                    xmlMemBlocks() - mem_base);
40029             test_ret++;
40030             printf(" %d", n_code);
40031             printf("\n");
40032         }
40033     }
40034     function_tests++;
40035 #endif
40036
40037     return(test_ret);
40038 }
40039
40040
40041 static int
40042 test_xmlUCSIsCatPi(void) {
40043     int test_ret = 0;
40044
40045 #if defined(LIBXML_UNICODE_ENABLED)
40046     int mem_base;
40047     int ret_val;
40048     int code; /* UCS code point */
40049     int n_code;
40050
40051     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40052         mem_base = xmlMemBlocks();
40053         code = gen_int(n_code, 0);
40054
40055         ret_val = xmlUCSIsCatPi(code);
40056         desret_int(ret_val);
40057         call_tests++;
40058         des_int(n_code, code, 0);
40059         xmlResetLastError();
40060         if (mem_base != xmlMemBlocks()) {
40061             printf("Leak of %d blocks found in xmlUCSIsCatPi",
40062                    xmlMemBlocks() - mem_base);
40063             test_ret++;
40064             printf(" %d", n_code);
40065             printf("\n");
40066         }
40067     }
40068     function_tests++;
40069 #endif
40070
40071     return(test_ret);
40072 }
40073
40074
40075 static int
40076 test_xmlUCSIsCatPo(void) {
40077     int test_ret = 0;
40078
40079 #if defined(LIBXML_UNICODE_ENABLED)
40080     int mem_base;
40081     int ret_val;
40082     int code; /* UCS code point */
40083     int n_code;
40084
40085     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40086         mem_base = xmlMemBlocks();
40087         code = gen_int(n_code, 0);
40088
40089         ret_val = xmlUCSIsCatPo(code);
40090         desret_int(ret_val);
40091         call_tests++;
40092         des_int(n_code, code, 0);
40093         xmlResetLastError();
40094         if (mem_base != xmlMemBlocks()) {
40095             printf("Leak of %d blocks found in xmlUCSIsCatPo",
40096                    xmlMemBlocks() - mem_base);
40097             test_ret++;
40098             printf(" %d", n_code);
40099             printf("\n");
40100         }
40101     }
40102     function_tests++;
40103 #endif
40104
40105     return(test_ret);
40106 }
40107
40108
40109 static int
40110 test_xmlUCSIsCatPs(void) {
40111     int test_ret = 0;
40112
40113 #if defined(LIBXML_UNICODE_ENABLED)
40114     int mem_base;
40115     int ret_val;
40116     int code; /* UCS code point */
40117     int n_code;
40118
40119     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40120         mem_base = xmlMemBlocks();
40121         code = gen_int(n_code, 0);
40122
40123         ret_val = xmlUCSIsCatPs(code);
40124         desret_int(ret_val);
40125         call_tests++;
40126         des_int(n_code, code, 0);
40127         xmlResetLastError();
40128         if (mem_base != xmlMemBlocks()) {
40129             printf("Leak of %d blocks found in xmlUCSIsCatPs",
40130                    xmlMemBlocks() - mem_base);
40131             test_ret++;
40132             printf(" %d", n_code);
40133             printf("\n");
40134         }
40135     }
40136     function_tests++;
40137 #endif
40138
40139     return(test_ret);
40140 }
40141
40142
40143 static int
40144 test_xmlUCSIsCatS(void) {
40145     int test_ret = 0;
40146
40147 #if defined(LIBXML_UNICODE_ENABLED)
40148     int mem_base;
40149     int ret_val;
40150     int code; /* UCS code point */
40151     int n_code;
40152
40153     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40154         mem_base = xmlMemBlocks();
40155         code = gen_int(n_code, 0);
40156
40157         ret_val = xmlUCSIsCatS(code);
40158         desret_int(ret_val);
40159         call_tests++;
40160         des_int(n_code, code, 0);
40161         xmlResetLastError();
40162         if (mem_base != xmlMemBlocks()) {
40163             printf("Leak of %d blocks found in xmlUCSIsCatS",
40164                    xmlMemBlocks() - mem_base);
40165             test_ret++;
40166             printf(" %d", n_code);
40167             printf("\n");
40168         }
40169     }
40170     function_tests++;
40171 #endif
40172
40173     return(test_ret);
40174 }
40175
40176
40177 static int
40178 test_xmlUCSIsCatSc(void) {
40179     int test_ret = 0;
40180
40181 #if defined(LIBXML_UNICODE_ENABLED)
40182     int mem_base;
40183     int ret_val;
40184     int code; /* UCS code point */
40185     int n_code;
40186
40187     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40188         mem_base = xmlMemBlocks();
40189         code = gen_int(n_code, 0);
40190
40191         ret_val = xmlUCSIsCatSc(code);
40192         desret_int(ret_val);
40193         call_tests++;
40194         des_int(n_code, code, 0);
40195         xmlResetLastError();
40196         if (mem_base != xmlMemBlocks()) {
40197             printf("Leak of %d blocks found in xmlUCSIsCatSc",
40198                    xmlMemBlocks() - mem_base);
40199             test_ret++;
40200             printf(" %d", n_code);
40201             printf("\n");
40202         }
40203     }
40204     function_tests++;
40205 #endif
40206
40207     return(test_ret);
40208 }
40209
40210
40211 static int
40212 test_xmlUCSIsCatSk(void) {
40213     int test_ret = 0;
40214
40215 #if defined(LIBXML_UNICODE_ENABLED)
40216     int mem_base;
40217     int ret_val;
40218     int code; /* UCS code point */
40219     int n_code;
40220
40221     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40222         mem_base = xmlMemBlocks();
40223         code = gen_int(n_code, 0);
40224
40225         ret_val = xmlUCSIsCatSk(code);
40226         desret_int(ret_val);
40227         call_tests++;
40228         des_int(n_code, code, 0);
40229         xmlResetLastError();
40230         if (mem_base != xmlMemBlocks()) {
40231             printf("Leak of %d blocks found in xmlUCSIsCatSk",
40232                    xmlMemBlocks() - mem_base);
40233             test_ret++;
40234             printf(" %d", n_code);
40235             printf("\n");
40236         }
40237     }
40238     function_tests++;
40239 #endif
40240
40241     return(test_ret);
40242 }
40243
40244
40245 static int
40246 test_xmlUCSIsCatSm(void) {
40247     int test_ret = 0;
40248
40249 #if defined(LIBXML_UNICODE_ENABLED)
40250     int mem_base;
40251     int ret_val;
40252     int code; /* UCS code point */
40253     int n_code;
40254
40255     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40256         mem_base = xmlMemBlocks();
40257         code = gen_int(n_code, 0);
40258
40259         ret_val = xmlUCSIsCatSm(code);
40260         desret_int(ret_val);
40261         call_tests++;
40262         des_int(n_code, code, 0);
40263         xmlResetLastError();
40264         if (mem_base != xmlMemBlocks()) {
40265             printf("Leak of %d blocks found in xmlUCSIsCatSm",
40266                    xmlMemBlocks() - mem_base);
40267             test_ret++;
40268             printf(" %d", n_code);
40269             printf("\n");
40270         }
40271     }
40272     function_tests++;
40273 #endif
40274
40275     return(test_ret);
40276 }
40277
40278
40279 static int
40280 test_xmlUCSIsCatSo(void) {
40281     int test_ret = 0;
40282
40283 #if defined(LIBXML_UNICODE_ENABLED)
40284     int mem_base;
40285     int ret_val;
40286     int code; /* UCS code point */
40287     int n_code;
40288
40289     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40290         mem_base = xmlMemBlocks();
40291         code = gen_int(n_code, 0);
40292
40293         ret_val = xmlUCSIsCatSo(code);
40294         desret_int(ret_val);
40295         call_tests++;
40296         des_int(n_code, code, 0);
40297         xmlResetLastError();
40298         if (mem_base != xmlMemBlocks()) {
40299             printf("Leak of %d blocks found in xmlUCSIsCatSo",
40300                    xmlMemBlocks() - mem_base);
40301             test_ret++;
40302             printf(" %d", n_code);
40303             printf("\n");
40304         }
40305     }
40306     function_tests++;
40307 #endif
40308
40309     return(test_ret);
40310 }
40311
40312
40313 static int
40314 test_xmlUCSIsCatZ(void) {
40315     int test_ret = 0;
40316
40317 #if defined(LIBXML_UNICODE_ENABLED)
40318     int mem_base;
40319     int ret_val;
40320     int code; /* UCS code point */
40321     int n_code;
40322
40323     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40324         mem_base = xmlMemBlocks();
40325         code = gen_int(n_code, 0);
40326
40327         ret_val = xmlUCSIsCatZ(code);
40328         desret_int(ret_val);
40329         call_tests++;
40330         des_int(n_code, code, 0);
40331         xmlResetLastError();
40332         if (mem_base != xmlMemBlocks()) {
40333             printf("Leak of %d blocks found in xmlUCSIsCatZ",
40334                    xmlMemBlocks() - mem_base);
40335             test_ret++;
40336             printf(" %d", n_code);
40337             printf("\n");
40338         }
40339     }
40340     function_tests++;
40341 #endif
40342
40343     return(test_ret);
40344 }
40345
40346
40347 static int
40348 test_xmlUCSIsCatZl(void) {
40349     int test_ret = 0;
40350
40351 #if defined(LIBXML_UNICODE_ENABLED)
40352     int mem_base;
40353     int ret_val;
40354     int code; /* UCS code point */
40355     int n_code;
40356
40357     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40358         mem_base = xmlMemBlocks();
40359         code = gen_int(n_code, 0);
40360
40361         ret_val = xmlUCSIsCatZl(code);
40362         desret_int(ret_val);
40363         call_tests++;
40364         des_int(n_code, code, 0);
40365         xmlResetLastError();
40366         if (mem_base != xmlMemBlocks()) {
40367             printf("Leak of %d blocks found in xmlUCSIsCatZl",
40368                    xmlMemBlocks() - mem_base);
40369             test_ret++;
40370             printf(" %d", n_code);
40371             printf("\n");
40372         }
40373     }
40374     function_tests++;
40375 #endif
40376
40377     return(test_ret);
40378 }
40379
40380
40381 static int
40382 test_xmlUCSIsCatZp(void) {
40383     int test_ret = 0;
40384
40385 #if defined(LIBXML_UNICODE_ENABLED)
40386     int mem_base;
40387     int ret_val;
40388     int code; /* UCS code point */
40389     int n_code;
40390
40391     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40392         mem_base = xmlMemBlocks();
40393         code = gen_int(n_code, 0);
40394
40395         ret_val = xmlUCSIsCatZp(code);
40396         desret_int(ret_val);
40397         call_tests++;
40398         des_int(n_code, code, 0);
40399         xmlResetLastError();
40400         if (mem_base != xmlMemBlocks()) {
40401             printf("Leak of %d blocks found in xmlUCSIsCatZp",
40402                    xmlMemBlocks() - mem_base);
40403             test_ret++;
40404             printf(" %d", n_code);
40405             printf("\n");
40406         }
40407     }
40408     function_tests++;
40409 #endif
40410
40411     return(test_ret);
40412 }
40413
40414
40415 static int
40416 test_xmlUCSIsCatZs(void) {
40417     int test_ret = 0;
40418
40419 #if defined(LIBXML_UNICODE_ENABLED)
40420     int mem_base;
40421     int ret_val;
40422     int code; /* UCS code point */
40423     int n_code;
40424
40425     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40426         mem_base = xmlMemBlocks();
40427         code = gen_int(n_code, 0);
40428
40429         ret_val = xmlUCSIsCatZs(code);
40430         desret_int(ret_val);
40431         call_tests++;
40432         des_int(n_code, code, 0);
40433         xmlResetLastError();
40434         if (mem_base != xmlMemBlocks()) {
40435             printf("Leak of %d blocks found in xmlUCSIsCatZs",
40436                    xmlMemBlocks() - mem_base);
40437             test_ret++;
40438             printf(" %d", n_code);
40439             printf("\n");
40440         }
40441     }
40442     function_tests++;
40443 #endif
40444
40445     return(test_ret);
40446 }
40447
40448
40449 static int
40450 test_xmlUCSIsCherokee(void) {
40451     int test_ret = 0;
40452
40453 #if defined(LIBXML_UNICODE_ENABLED)
40454     int mem_base;
40455     int ret_val;
40456     int code; /* UCS code point */
40457     int n_code;
40458
40459     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40460         mem_base = xmlMemBlocks();
40461         code = gen_int(n_code, 0);
40462
40463         ret_val = xmlUCSIsCherokee(code);
40464         desret_int(ret_val);
40465         call_tests++;
40466         des_int(n_code, code, 0);
40467         xmlResetLastError();
40468         if (mem_base != xmlMemBlocks()) {
40469             printf("Leak of %d blocks found in xmlUCSIsCherokee",
40470                    xmlMemBlocks() - mem_base);
40471             test_ret++;
40472             printf(" %d", n_code);
40473             printf("\n");
40474         }
40475     }
40476     function_tests++;
40477 #endif
40478
40479     return(test_ret);
40480 }
40481
40482
40483 static int
40484 test_xmlUCSIsCombiningDiacriticalMarks(void) {
40485     int test_ret = 0;
40486
40487 #if defined(LIBXML_UNICODE_ENABLED)
40488     int mem_base;
40489     int ret_val;
40490     int code; /* UCS code point */
40491     int n_code;
40492
40493     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40494         mem_base = xmlMemBlocks();
40495         code = gen_int(n_code, 0);
40496
40497         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
40498         desret_int(ret_val);
40499         call_tests++;
40500         des_int(n_code, code, 0);
40501         xmlResetLastError();
40502         if (mem_base != xmlMemBlocks()) {
40503             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
40504                    xmlMemBlocks() - mem_base);
40505             test_ret++;
40506             printf(" %d", n_code);
40507             printf("\n");
40508         }
40509     }
40510     function_tests++;
40511 #endif
40512
40513     return(test_ret);
40514 }
40515
40516
40517 static int
40518 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
40519     int test_ret = 0;
40520
40521 #if defined(LIBXML_UNICODE_ENABLED)
40522     int mem_base;
40523     int ret_val;
40524     int code; /* UCS code point */
40525     int n_code;
40526
40527     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40528         mem_base = xmlMemBlocks();
40529         code = gen_int(n_code, 0);
40530
40531         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
40532         desret_int(ret_val);
40533         call_tests++;
40534         des_int(n_code, code, 0);
40535         xmlResetLastError();
40536         if (mem_base != xmlMemBlocks()) {
40537             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
40538                    xmlMemBlocks() - mem_base);
40539             test_ret++;
40540             printf(" %d", n_code);
40541             printf("\n");
40542         }
40543     }
40544     function_tests++;
40545 #endif
40546
40547     return(test_ret);
40548 }
40549
40550
40551 static int
40552 test_xmlUCSIsCombiningHalfMarks(void) {
40553     int test_ret = 0;
40554
40555 #if defined(LIBXML_UNICODE_ENABLED)
40556     int mem_base;
40557     int ret_val;
40558     int code; /* UCS code point */
40559     int n_code;
40560
40561     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40562         mem_base = xmlMemBlocks();
40563         code = gen_int(n_code, 0);
40564
40565         ret_val = xmlUCSIsCombiningHalfMarks(code);
40566         desret_int(ret_val);
40567         call_tests++;
40568         des_int(n_code, code, 0);
40569         xmlResetLastError();
40570         if (mem_base != xmlMemBlocks()) {
40571             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
40572                    xmlMemBlocks() - mem_base);
40573             test_ret++;
40574             printf(" %d", n_code);
40575             printf("\n");
40576         }
40577     }
40578     function_tests++;
40579 #endif
40580
40581     return(test_ret);
40582 }
40583
40584
40585 static int
40586 test_xmlUCSIsCombiningMarksforSymbols(void) {
40587     int test_ret = 0;
40588
40589 #if defined(LIBXML_UNICODE_ENABLED)
40590     int mem_base;
40591     int ret_val;
40592     int code; /* UCS code point */
40593     int n_code;
40594
40595     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40596         mem_base = xmlMemBlocks();
40597         code = gen_int(n_code, 0);
40598
40599         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
40600         desret_int(ret_val);
40601         call_tests++;
40602         des_int(n_code, code, 0);
40603         xmlResetLastError();
40604         if (mem_base != xmlMemBlocks()) {
40605             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
40606                    xmlMemBlocks() - mem_base);
40607             test_ret++;
40608             printf(" %d", n_code);
40609             printf("\n");
40610         }
40611     }
40612     function_tests++;
40613 #endif
40614
40615     return(test_ret);
40616 }
40617
40618
40619 static int
40620 test_xmlUCSIsControlPictures(void) {
40621     int test_ret = 0;
40622
40623 #if defined(LIBXML_UNICODE_ENABLED)
40624     int mem_base;
40625     int ret_val;
40626     int code; /* UCS code point */
40627     int n_code;
40628
40629     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40630         mem_base = xmlMemBlocks();
40631         code = gen_int(n_code, 0);
40632
40633         ret_val = xmlUCSIsControlPictures(code);
40634         desret_int(ret_val);
40635         call_tests++;
40636         des_int(n_code, code, 0);
40637         xmlResetLastError();
40638         if (mem_base != xmlMemBlocks()) {
40639             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
40640                    xmlMemBlocks() - mem_base);
40641             test_ret++;
40642             printf(" %d", n_code);
40643             printf("\n");
40644         }
40645     }
40646     function_tests++;
40647 #endif
40648
40649     return(test_ret);
40650 }
40651
40652
40653 static int
40654 test_xmlUCSIsCurrencySymbols(void) {
40655     int test_ret = 0;
40656
40657 #if defined(LIBXML_UNICODE_ENABLED)
40658     int mem_base;
40659     int ret_val;
40660     int code; /* UCS code point */
40661     int n_code;
40662
40663     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40664         mem_base = xmlMemBlocks();
40665         code = gen_int(n_code, 0);
40666
40667         ret_val = xmlUCSIsCurrencySymbols(code);
40668         desret_int(ret_val);
40669         call_tests++;
40670         des_int(n_code, code, 0);
40671         xmlResetLastError();
40672         if (mem_base != xmlMemBlocks()) {
40673             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
40674                    xmlMemBlocks() - mem_base);
40675             test_ret++;
40676             printf(" %d", n_code);
40677             printf("\n");
40678         }
40679     }
40680     function_tests++;
40681 #endif
40682
40683     return(test_ret);
40684 }
40685
40686
40687 static int
40688 test_xmlUCSIsCypriotSyllabary(void) {
40689     int test_ret = 0;
40690
40691 #if defined(LIBXML_UNICODE_ENABLED)
40692     int mem_base;
40693     int ret_val;
40694     int code; /* UCS code point */
40695     int n_code;
40696
40697     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40698         mem_base = xmlMemBlocks();
40699         code = gen_int(n_code, 0);
40700
40701         ret_val = xmlUCSIsCypriotSyllabary(code);
40702         desret_int(ret_val);
40703         call_tests++;
40704         des_int(n_code, code, 0);
40705         xmlResetLastError();
40706         if (mem_base != xmlMemBlocks()) {
40707             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
40708                    xmlMemBlocks() - mem_base);
40709             test_ret++;
40710             printf(" %d", n_code);
40711             printf("\n");
40712         }
40713     }
40714     function_tests++;
40715 #endif
40716
40717     return(test_ret);
40718 }
40719
40720
40721 static int
40722 test_xmlUCSIsCyrillic(void) {
40723     int test_ret = 0;
40724
40725 #if defined(LIBXML_UNICODE_ENABLED)
40726     int mem_base;
40727     int ret_val;
40728     int code; /* UCS code point */
40729     int n_code;
40730
40731     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40732         mem_base = xmlMemBlocks();
40733         code = gen_int(n_code, 0);
40734
40735         ret_val = xmlUCSIsCyrillic(code);
40736         desret_int(ret_val);
40737         call_tests++;
40738         des_int(n_code, code, 0);
40739         xmlResetLastError();
40740         if (mem_base != xmlMemBlocks()) {
40741             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
40742                    xmlMemBlocks() - mem_base);
40743             test_ret++;
40744             printf(" %d", n_code);
40745             printf("\n");
40746         }
40747     }
40748     function_tests++;
40749 #endif
40750
40751     return(test_ret);
40752 }
40753
40754
40755 static int
40756 test_xmlUCSIsCyrillicSupplement(void) {
40757     int test_ret = 0;
40758
40759 #if defined(LIBXML_UNICODE_ENABLED)
40760     int mem_base;
40761     int ret_val;
40762     int code; /* UCS code point */
40763     int n_code;
40764
40765     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40766         mem_base = xmlMemBlocks();
40767         code = gen_int(n_code, 0);
40768
40769         ret_val = xmlUCSIsCyrillicSupplement(code);
40770         desret_int(ret_val);
40771         call_tests++;
40772         des_int(n_code, code, 0);
40773         xmlResetLastError();
40774         if (mem_base != xmlMemBlocks()) {
40775             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
40776                    xmlMemBlocks() - mem_base);
40777             test_ret++;
40778             printf(" %d", n_code);
40779             printf("\n");
40780         }
40781     }
40782     function_tests++;
40783 #endif
40784
40785     return(test_ret);
40786 }
40787
40788
40789 static int
40790 test_xmlUCSIsDeseret(void) {
40791     int test_ret = 0;
40792
40793 #if defined(LIBXML_UNICODE_ENABLED)
40794     int mem_base;
40795     int ret_val;
40796     int code; /* UCS code point */
40797     int n_code;
40798
40799     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40800         mem_base = xmlMemBlocks();
40801         code = gen_int(n_code, 0);
40802
40803         ret_val = xmlUCSIsDeseret(code);
40804         desret_int(ret_val);
40805         call_tests++;
40806         des_int(n_code, code, 0);
40807         xmlResetLastError();
40808         if (mem_base != xmlMemBlocks()) {
40809             printf("Leak of %d blocks found in xmlUCSIsDeseret",
40810                    xmlMemBlocks() - mem_base);
40811             test_ret++;
40812             printf(" %d", n_code);
40813             printf("\n");
40814         }
40815     }
40816     function_tests++;
40817 #endif
40818
40819     return(test_ret);
40820 }
40821
40822
40823 static int
40824 test_xmlUCSIsDevanagari(void) {
40825     int test_ret = 0;
40826
40827 #if defined(LIBXML_UNICODE_ENABLED)
40828     int mem_base;
40829     int ret_val;
40830     int code; /* UCS code point */
40831     int n_code;
40832
40833     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40834         mem_base = xmlMemBlocks();
40835         code = gen_int(n_code, 0);
40836
40837         ret_val = xmlUCSIsDevanagari(code);
40838         desret_int(ret_val);
40839         call_tests++;
40840         des_int(n_code, code, 0);
40841         xmlResetLastError();
40842         if (mem_base != xmlMemBlocks()) {
40843             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
40844                    xmlMemBlocks() - mem_base);
40845             test_ret++;
40846             printf(" %d", n_code);
40847             printf("\n");
40848         }
40849     }
40850     function_tests++;
40851 #endif
40852
40853     return(test_ret);
40854 }
40855
40856
40857 static int
40858 test_xmlUCSIsDingbats(void) {
40859     int test_ret = 0;
40860
40861 #if defined(LIBXML_UNICODE_ENABLED)
40862     int mem_base;
40863     int ret_val;
40864     int code; /* UCS code point */
40865     int n_code;
40866
40867     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40868         mem_base = xmlMemBlocks();
40869         code = gen_int(n_code, 0);
40870
40871         ret_val = xmlUCSIsDingbats(code);
40872         desret_int(ret_val);
40873         call_tests++;
40874         des_int(n_code, code, 0);
40875         xmlResetLastError();
40876         if (mem_base != xmlMemBlocks()) {
40877             printf("Leak of %d blocks found in xmlUCSIsDingbats",
40878                    xmlMemBlocks() - mem_base);
40879             test_ret++;
40880             printf(" %d", n_code);
40881             printf("\n");
40882         }
40883     }
40884     function_tests++;
40885 #endif
40886
40887     return(test_ret);
40888 }
40889
40890
40891 static int
40892 test_xmlUCSIsEnclosedAlphanumerics(void) {
40893     int test_ret = 0;
40894
40895 #if defined(LIBXML_UNICODE_ENABLED)
40896     int mem_base;
40897     int ret_val;
40898     int code; /* UCS code point */
40899     int n_code;
40900
40901     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40902         mem_base = xmlMemBlocks();
40903         code = gen_int(n_code, 0);
40904
40905         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
40906         desret_int(ret_val);
40907         call_tests++;
40908         des_int(n_code, code, 0);
40909         xmlResetLastError();
40910         if (mem_base != xmlMemBlocks()) {
40911             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
40912                    xmlMemBlocks() - mem_base);
40913             test_ret++;
40914             printf(" %d", n_code);
40915             printf("\n");
40916         }
40917     }
40918     function_tests++;
40919 #endif
40920
40921     return(test_ret);
40922 }
40923
40924
40925 static int
40926 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
40927     int test_ret = 0;
40928
40929 #if defined(LIBXML_UNICODE_ENABLED)
40930     int mem_base;
40931     int ret_val;
40932     int code; /* UCS code point */
40933     int n_code;
40934
40935     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40936         mem_base = xmlMemBlocks();
40937         code = gen_int(n_code, 0);
40938
40939         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
40940         desret_int(ret_val);
40941         call_tests++;
40942         des_int(n_code, code, 0);
40943         xmlResetLastError();
40944         if (mem_base != xmlMemBlocks()) {
40945             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
40946                    xmlMemBlocks() - mem_base);
40947             test_ret++;
40948             printf(" %d", n_code);
40949             printf("\n");
40950         }
40951     }
40952     function_tests++;
40953 #endif
40954
40955     return(test_ret);
40956 }
40957
40958
40959 static int
40960 test_xmlUCSIsEthiopic(void) {
40961     int test_ret = 0;
40962
40963 #if defined(LIBXML_UNICODE_ENABLED)
40964     int mem_base;
40965     int ret_val;
40966     int code; /* UCS code point */
40967     int n_code;
40968
40969     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40970         mem_base = xmlMemBlocks();
40971         code = gen_int(n_code, 0);
40972
40973         ret_val = xmlUCSIsEthiopic(code);
40974         desret_int(ret_val);
40975         call_tests++;
40976         des_int(n_code, code, 0);
40977         xmlResetLastError();
40978         if (mem_base != xmlMemBlocks()) {
40979             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
40980                    xmlMemBlocks() - mem_base);
40981             test_ret++;
40982             printf(" %d", n_code);
40983             printf("\n");
40984         }
40985     }
40986     function_tests++;
40987 #endif
40988
40989     return(test_ret);
40990 }
40991
40992
40993 static int
40994 test_xmlUCSIsGeneralPunctuation(void) {
40995     int test_ret = 0;
40996
40997 #if defined(LIBXML_UNICODE_ENABLED)
40998     int mem_base;
40999     int ret_val;
41000     int code; /* UCS code point */
41001     int n_code;
41002
41003     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41004         mem_base = xmlMemBlocks();
41005         code = gen_int(n_code, 0);
41006
41007         ret_val = xmlUCSIsGeneralPunctuation(code);
41008         desret_int(ret_val);
41009         call_tests++;
41010         des_int(n_code, code, 0);
41011         xmlResetLastError();
41012         if (mem_base != xmlMemBlocks()) {
41013             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
41014                    xmlMemBlocks() - mem_base);
41015             test_ret++;
41016             printf(" %d", n_code);
41017             printf("\n");
41018         }
41019     }
41020     function_tests++;
41021 #endif
41022
41023     return(test_ret);
41024 }
41025
41026
41027 static int
41028 test_xmlUCSIsGeometricShapes(void) {
41029     int test_ret = 0;
41030
41031 #if defined(LIBXML_UNICODE_ENABLED)
41032     int mem_base;
41033     int ret_val;
41034     int code; /* UCS code point */
41035     int n_code;
41036
41037     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41038         mem_base = xmlMemBlocks();
41039         code = gen_int(n_code, 0);
41040
41041         ret_val = xmlUCSIsGeometricShapes(code);
41042         desret_int(ret_val);
41043         call_tests++;
41044         des_int(n_code, code, 0);
41045         xmlResetLastError();
41046         if (mem_base != xmlMemBlocks()) {
41047             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
41048                    xmlMemBlocks() - mem_base);
41049             test_ret++;
41050             printf(" %d", n_code);
41051             printf("\n");
41052         }
41053     }
41054     function_tests++;
41055 #endif
41056
41057     return(test_ret);
41058 }
41059
41060
41061 static int
41062 test_xmlUCSIsGeorgian(void) {
41063     int test_ret = 0;
41064
41065 #if defined(LIBXML_UNICODE_ENABLED)
41066     int mem_base;
41067     int ret_val;
41068     int code; /* UCS code point */
41069     int n_code;
41070
41071     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41072         mem_base = xmlMemBlocks();
41073         code = gen_int(n_code, 0);
41074
41075         ret_val = xmlUCSIsGeorgian(code);
41076         desret_int(ret_val);
41077         call_tests++;
41078         des_int(n_code, code, 0);
41079         xmlResetLastError();
41080         if (mem_base != xmlMemBlocks()) {
41081             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
41082                    xmlMemBlocks() - mem_base);
41083             test_ret++;
41084             printf(" %d", n_code);
41085             printf("\n");
41086         }
41087     }
41088     function_tests++;
41089 #endif
41090
41091     return(test_ret);
41092 }
41093
41094
41095 static int
41096 test_xmlUCSIsGothic(void) {
41097     int test_ret = 0;
41098
41099 #if defined(LIBXML_UNICODE_ENABLED)
41100     int mem_base;
41101     int ret_val;
41102     int code; /* UCS code point */
41103     int n_code;
41104
41105     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41106         mem_base = xmlMemBlocks();
41107         code = gen_int(n_code, 0);
41108
41109         ret_val = xmlUCSIsGothic(code);
41110         desret_int(ret_val);
41111         call_tests++;
41112         des_int(n_code, code, 0);
41113         xmlResetLastError();
41114         if (mem_base != xmlMemBlocks()) {
41115             printf("Leak of %d blocks found in xmlUCSIsGothic",
41116                    xmlMemBlocks() - mem_base);
41117             test_ret++;
41118             printf(" %d", n_code);
41119             printf("\n");
41120         }
41121     }
41122     function_tests++;
41123 #endif
41124
41125     return(test_ret);
41126 }
41127
41128
41129 static int
41130 test_xmlUCSIsGreek(void) {
41131     int test_ret = 0;
41132
41133 #if defined(LIBXML_UNICODE_ENABLED)
41134     int mem_base;
41135     int ret_val;
41136     int code; /* UCS code point */
41137     int n_code;
41138
41139     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41140         mem_base = xmlMemBlocks();
41141         code = gen_int(n_code, 0);
41142
41143         ret_val = xmlUCSIsGreek(code);
41144         desret_int(ret_val);
41145         call_tests++;
41146         des_int(n_code, code, 0);
41147         xmlResetLastError();
41148         if (mem_base != xmlMemBlocks()) {
41149             printf("Leak of %d blocks found in xmlUCSIsGreek",
41150                    xmlMemBlocks() - mem_base);
41151             test_ret++;
41152             printf(" %d", n_code);
41153             printf("\n");
41154         }
41155     }
41156     function_tests++;
41157 #endif
41158
41159     return(test_ret);
41160 }
41161
41162
41163 static int
41164 test_xmlUCSIsGreekExtended(void) {
41165     int test_ret = 0;
41166
41167 #if defined(LIBXML_UNICODE_ENABLED)
41168     int mem_base;
41169     int ret_val;
41170     int code; /* UCS code point */
41171     int n_code;
41172
41173     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41174         mem_base = xmlMemBlocks();
41175         code = gen_int(n_code, 0);
41176
41177         ret_val = xmlUCSIsGreekExtended(code);
41178         desret_int(ret_val);
41179         call_tests++;
41180         des_int(n_code, code, 0);
41181         xmlResetLastError();
41182         if (mem_base != xmlMemBlocks()) {
41183             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
41184                    xmlMemBlocks() - mem_base);
41185             test_ret++;
41186             printf(" %d", n_code);
41187             printf("\n");
41188         }
41189     }
41190     function_tests++;
41191 #endif
41192
41193     return(test_ret);
41194 }
41195
41196
41197 static int
41198 test_xmlUCSIsGreekandCoptic(void) {
41199     int test_ret = 0;
41200
41201 #if defined(LIBXML_UNICODE_ENABLED)
41202     int mem_base;
41203     int ret_val;
41204     int code; /* UCS code point */
41205     int n_code;
41206
41207     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41208         mem_base = xmlMemBlocks();
41209         code = gen_int(n_code, 0);
41210
41211         ret_val = xmlUCSIsGreekandCoptic(code);
41212         desret_int(ret_val);
41213         call_tests++;
41214         des_int(n_code, code, 0);
41215         xmlResetLastError();
41216         if (mem_base != xmlMemBlocks()) {
41217             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
41218                    xmlMemBlocks() - mem_base);
41219             test_ret++;
41220             printf(" %d", n_code);
41221             printf("\n");
41222         }
41223     }
41224     function_tests++;
41225 #endif
41226
41227     return(test_ret);
41228 }
41229
41230
41231 static int
41232 test_xmlUCSIsGujarati(void) {
41233     int test_ret = 0;
41234
41235 #if defined(LIBXML_UNICODE_ENABLED)
41236     int mem_base;
41237     int ret_val;
41238     int code; /* UCS code point */
41239     int n_code;
41240
41241     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41242         mem_base = xmlMemBlocks();
41243         code = gen_int(n_code, 0);
41244
41245         ret_val = xmlUCSIsGujarati(code);
41246         desret_int(ret_val);
41247         call_tests++;
41248         des_int(n_code, code, 0);
41249         xmlResetLastError();
41250         if (mem_base != xmlMemBlocks()) {
41251             printf("Leak of %d blocks found in xmlUCSIsGujarati",
41252                    xmlMemBlocks() - mem_base);
41253             test_ret++;
41254             printf(" %d", n_code);
41255             printf("\n");
41256         }
41257     }
41258     function_tests++;
41259 #endif
41260
41261     return(test_ret);
41262 }
41263
41264
41265 static int
41266 test_xmlUCSIsGurmukhi(void) {
41267     int test_ret = 0;
41268
41269 #if defined(LIBXML_UNICODE_ENABLED)
41270     int mem_base;
41271     int ret_val;
41272     int code; /* UCS code point */
41273     int n_code;
41274
41275     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41276         mem_base = xmlMemBlocks();
41277         code = gen_int(n_code, 0);
41278
41279         ret_val = xmlUCSIsGurmukhi(code);
41280         desret_int(ret_val);
41281         call_tests++;
41282         des_int(n_code, code, 0);
41283         xmlResetLastError();
41284         if (mem_base != xmlMemBlocks()) {
41285             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
41286                    xmlMemBlocks() - mem_base);
41287             test_ret++;
41288             printf(" %d", n_code);
41289             printf("\n");
41290         }
41291     }
41292     function_tests++;
41293 #endif
41294
41295     return(test_ret);
41296 }
41297
41298
41299 static int
41300 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
41301     int test_ret = 0;
41302
41303 #if defined(LIBXML_UNICODE_ENABLED)
41304     int mem_base;
41305     int ret_val;
41306     int code; /* UCS code point */
41307     int n_code;
41308
41309     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41310         mem_base = xmlMemBlocks();
41311         code = gen_int(n_code, 0);
41312
41313         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
41314         desret_int(ret_val);
41315         call_tests++;
41316         des_int(n_code, code, 0);
41317         xmlResetLastError();
41318         if (mem_base != xmlMemBlocks()) {
41319             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
41320                    xmlMemBlocks() - mem_base);
41321             test_ret++;
41322             printf(" %d", n_code);
41323             printf("\n");
41324         }
41325     }
41326     function_tests++;
41327 #endif
41328
41329     return(test_ret);
41330 }
41331
41332
41333 static int
41334 test_xmlUCSIsHangulCompatibilityJamo(void) {
41335     int test_ret = 0;
41336
41337 #if defined(LIBXML_UNICODE_ENABLED)
41338     int mem_base;
41339     int ret_val;
41340     int code; /* UCS code point */
41341     int n_code;
41342
41343     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41344         mem_base = xmlMemBlocks();
41345         code = gen_int(n_code, 0);
41346
41347         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
41348         desret_int(ret_val);
41349         call_tests++;
41350         des_int(n_code, code, 0);
41351         xmlResetLastError();
41352         if (mem_base != xmlMemBlocks()) {
41353             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
41354                    xmlMemBlocks() - mem_base);
41355             test_ret++;
41356             printf(" %d", n_code);
41357             printf("\n");
41358         }
41359     }
41360     function_tests++;
41361 #endif
41362
41363     return(test_ret);
41364 }
41365
41366
41367 static int
41368 test_xmlUCSIsHangulJamo(void) {
41369     int test_ret = 0;
41370
41371 #if defined(LIBXML_UNICODE_ENABLED)
41372     int mem_base;
41373     int ret_val;
41374     int code; /* UCS code point */
41375     int n_code;
41376
41377     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41378         mem_base = xmlMemBlocks();
41379         code = gen_int(n_code, 0);
41380
41381         ret_val = xmlUCSIsHangulJamo(code);
41382         desret_int(ret_val);
41383         call_tests++;
41384         des_int(n_code, code, 0);
41385         xmlResetLastError();
41386         if (mem_base != xmlMemBlocks()) {
41387             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
41388                    xmlMemBlocks() - mem_base);
41389             test_ret++;
41390             printf(" %d", n_code);
41391             printf("\n");
41392         }
41393     }
41394     function_tests++;
41395 #endif
41396
41397     return(test_ret);
41398 }
41399
41400
41401 static int
41402 test_xmlUCSIsHangulSyllables(void) {
41403     int test_ret = 0;
41404
41405 #if defined(LIBXML_UNICODE_ENABLED)
41406     int mem_base;
41407     int ret_val;
41408     int code; /* UCS code point */
41409     int n_code;
41410
41411     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41412         mem_base = xmlMemBlocks();
41413         code = gen_int(n_code, 0);
41414
41415         ret_val = xmlUCSIsHangulSyllables(code);
41416         desret_int(ret_val);
41417         call_tests++;
41418         des_int(n_code, code, 0);
41419         xmlResetLastError();
41420         if (mem_base != xmlMemBlocks()) {
41421             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
41422                    xmlMemBlocks() - mem_base);
41423             test_ret++;
41424             printf(" %d", n_code);
41425             printf("\n");
41426         }
41427     }
41428     function_tests++;
41429 #endif
41430
41431     return(test_ret);
41432 }
41433
41434
41435 static int
41436 test_xmlUCSIsHanunoo(void) {
41437     int test_ret = 0;
41438
41439 #if defined(LIBXML_UNICODE_ENABLED)
41440     int mem_base;
41441     int ret_val;
41442     int code; /* UCS code point */
41443     int n_code;
41444
41445     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41446         mem_base = xmlMemBlocks();
41447         code = gen_int(n_code, 0);
41448
41449         ret_val = xmlUCSIsHanunoo(code);
41450         desret_int(ret_val);
41451         call_tests++;
41452         des_int(n_code, code, 0);
41453         xmlResetLastError();
41454         if (mem_base != xmlMemBlocks()) {
41455             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
41456                    xmlMemBlocks() - mem_base);
41457             test_ret++;
41458             printf(" %d", n_code);
41459             printf("\n");
41460         }
41461     }
41462     function_tests++;
41463 #endif
41464
41465     return(test_ret);
41466 }
41467
41468
41469 static int
41470 test_xmlUCSIsHebrew(void) {
41471     int test_ret = 0;
41472
41473 #if defined(LIBXML_UNICODE_ENABLED)
41474     int mem_base;
41475     int ret_val;
41476     int code; /* UCS code point */
41477     int n_code;
41478
41479     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41480         mem_base = xmlMemBlocks();
41481         code = gen_int(n_code, 0);
41482
41483         ret_val = xmlUCSIsHebrew(code);
41484         desret_int(ret_val);
41485         call_tests++;
41486         des_int(n_code, code, 0);
41487         xmlResetLastError();
41488         if (mem_base != xmlMemBlocks()) {
41489             printf("Leak of %d blocks found in xmlUCSIsHebrew",
41490                    xmlMemBlocks() - mem_base);
41491             test_ret++;
41492             printf(" %d", n_code);
41493             printf("\n");
41494         }
41495     }
41496     function_tests++;
41497 #endif
41498
41499     return(test_ret);
41500 }
41501
41502
41503 static int
41504 test_xmlUCSIsHighPrivateUseSurrogates(void) {
41505     int test_ret = 0;
41506
41507 #if defined(LIBXML_UNICODE_ENABLED)
41508     int mem_base;
41509     int ret_val;
41510     int code; /* UCS code point */
41511     int n_code;
41512
41513     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41514         mem_base = xmlMemBlocks();
41515         code = gen_int(n_code, 0);
41516
41517         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
41518         desret_int(ret_val);
41519         call_tests++;
41520         des_int(n_code, code, 0);
41521         xmlResetLastError();
41522         if (mem_base != xmlMemBlocks()) {
41523             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
41524                    xmlMemBlocks() - mem_base);
41525             test_ret++;
41526             printf(" %d", n_code);
41527             printf("\n");
41528         }
41529     }
41530     function_tests++;
41531 #endif
41532
41533     return(test_ret);
41534 }
41535
41536
41537 static int
41538 test_xmlUCSIsHighSurrogates(void) {
41539     int test_ret = 0;
41540
41541 #if defined(LIBXML_UNICODE_ENABLED)
41542     int mem_base;
41543     int ret_val;
41544     int code; /* UCS code point */
41545     int n_code;
41546
41547     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41548         mem_base = xmlMemBlocks();
41549         code = gen_int(n_code, 0);
41550
41551         ret_val = xmlUCSIsHighSurrogates(code);
41552         desret_int(ret_val);
41553         call_tests++;
41554         des_int(n_code, code, 0);
41555         xmlResetLastError();
41556         if (mem_base != xmlMemBlocks()) {
41557             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
41558                    xmlMemBlocks() - mem_base);
41559             test_ret++;
41560             printf(" %d", n_code);
41561             printf("\n");
41562         }
41563     }
41564     function_tests++;
41565 #endif
41566
41567     return(test_ret);
41568 }
41569
41570
41571 static int
41572 test_xmlUCSIsHiragana(void) {
41573     int test_ret = 0;
41574
41575 #if defined(LIBXML_UNICODE_ENABLED)
41576     int mem_base;
41577     int ret_val;
41578     int code; /* UCS code point */
41579     int n_code;
41580
41581     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41582         mem_base = xmlMemBlocks();
41583         code = gen_int(n_code, 0);
41584
41585         ret_val = xmlUCSIsHiragana(code);
41586         desret_int(ret_val);
41587         call_tests++;
41588         des_int(n_code, code, 0);
41589         xmlResetLastError();
41590         if (mem_base != xmlMemBlocks()) {
41591             printf("Leak of %d blocks found in xmlUCSIsHiragana",
41592                    xmlMemBlocks() - mem_base);
41593             test_ret++;
41594             printf(" %d", n_code);
41595             printf("\n");
41596         }
41597     }
41598     function_tests++;
41599 #endif
41600
41601     return(test_ret);
41602 }
41603
41604
41605 static int
41606 test_xmlUCSIsIPAExtensions(void) {
41607     int test_ret = 0;
41608
41609 #if defined(LIBXML_UNICODE_ENABLED)
41610     int mem_base;
41611     int ret_val;
41612     int code; /* UCS code point */
41613     int n_code;
41614
41615     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41616         mem_base = xmlMemBlocks();
41617         code = gen_int(n_code, 0);
41618
41619         ret_val = xmlUCSIsIPAExtensions(code);
41620         desret_int(ret_val);
41621         call_tests++;
41622         des_int(n_code, code, 0);
41623         xmlResetLastError();
41624         if (mem_base != xmlMemBlocks()) {
41625             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
41626                    xmlMemBlocks() - mem_base);
41627             test_ret++;
41628             printf(" %d", n_code);
41629             printf("\n");
41630         }
41631     }
41632     function_tests++;
41633 #endif
41634
41635     return(test_ret);
41636 }
41637
41638
41639 static int
41640 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
41641     int test_ret = 0;
41642
41643 #if defined(LIBXML_UNICODE_ENABLED)
41644     int mem_base;
41645     int ret_val;
41646     int code; /* UCS code point */
41647     int n_code;
41648
41649     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41650         mem_base = xmlMemBlocks();
41651         code = gen_int(n_code, 0);
41652
41653         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
41654         desret_int(ret_val);
41655         call_tests++;
41656         des_int(n_code, code, 0);
41657         xmlResetLastError();
41658         if (mem_base != xmlMemBlocks()) {
41659             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
41660                    xmlMemBlocks() - mem_base);
41661             test_ret++;
41662             printf(" %d", n_code);
41663             printf("\n");
41664         }
41665     }
41666     function_tests++;
41667 #endif
41668
41669     return(test_ret);
41670 }
41671
41672
41673 static int
41674 test_xmlUCSIsKanbun(void) {
41675     int test_ret = 0;
41676
41677 #if defined(LIBXML_UNICODE_ENABLED)
41678     int mem_base;
41679     int ret_val;
41680     int code; /* UCS code point */
41681     int n_code;
41682
41683     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41684         mem_base = xmlMemBlocks();
41685         code = gen_int(n_code, 0);
41686
41687         ret_val = xmlUCSIsKanbun(code);
41688         desret_int(ret_val);
41689         call_tests++;
41690         des_int(n_code, code, 0);
41691         xmlResetLastError();
41692         if (mem_base != xmlMemBlocks()) {
41693             printf("Leak of %d blocks found in xmlUCSIsKanbun",
41694                    xmlMemBlocks() - mem_base);
41695             test_ret++;
41696             printf(" %d", n_code);
41697             printf("\n");
41698         }
41699     }
41700     function_tests++;
41701 #endif
41702
41703     return(test_ret);
41704 }
41705
41706
41707 static int
41708 test_xmlUCSIsKangxiRadicals(void) {
41709     int test_ret = 0;
41710
41711 #if defined(LIBXML_UNICODE_ENABLED)
41712     int mem_base;
41713     int ret_val;
41714     int code; /* UCS code point */
41715     int n_code;
41716
41717     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41718         mem_base = xmlMemBlocks();
41719         code = gen_int(n_code, 0);
41720
41721         ret_val = xmlUCSIsKangxiRadicals(code);
41722         desret_int(ret_val);
41723         call_tests++;
41724         des_int(n_code, code, 0);
41725         xmlResetLastError();
41726         if (mem_base != xmlMemBlocks()) {
41727             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
41728                    xmlMemBlocks() - mem_base);
41729             test_ret++;
41730             printf(" %d", n_code);
41731             printf("\n");
41732         }
41733     }
41734     function_tests++;
41735 #endif
41736
41737     return(test_ret);
41738 }
41739
41740
41741 static int
41742 test_xmlUCSIsKannada(void) {
41743     int test_ret = 0;
41744
41745 #if defined(LIBXML_UNICODE_ENABLED)
41746     int mem_base;
41747     int ret_val;
41748     int code; /* UCS code point */
41749     int n_code;
41750
41751     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41752         mem_base = xmlMemBlocks();
41753         code = gen_int(n_code, 0);
41754
41755         ret_val = xmlUCSIsKannada(code);
41756         desret_int(ret_val);
41757         call_tests++;
41758         des_int(n_code, code, 0);
41759         xmlResetLastError();
41760         if (mem_base != xmlMemBlocks()) {
41761             printf("Leak of %d blocks found in xmlUCSIsKannada",
41762                    xmlMemBlocks() - mem_base);
41763             test_ret++;
41764             printf(" %d", n_code);
41765             printf("\n");
41766         }
41767     }
41768     function_tests++;
41769 #endif
41770
41771     return(test_ret);
41772 }
41773
41774
41775 static int
41776 test_xmlUCSIsKatakana(void) {
41777     int test_ret = 0;
41778
41779 #if defined(LIBXML_UNICODE_ENABLED)
41780     int mem_base;
41781     int ret_val;
41782     int code; /* UCS code point */
41783     int n_code;
41784
41785     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41786         mem_base = xmlMemBlocks();
41787         code = gen_int(n_code, 0);
41788
41789         ret_val = xmlUCSIsKatakana(code);
41790         desret_int(ret_val);
41791         call_tests++;
41792         des_int(n_code, code, 0);
41793         xmlResetLastError();
41794         if (mem_base != xmlMemBlocks()) {
41795             printf("Leak of %d blocks found in xmlUCSIsKatakana",
41796                    xmlMemBlocks() - mem_base);
41797             test_ret++;
41798             printf(" %d", n_code);
41799             printf("\n");
41800         }
41801     }
41802     function_tests++;
41803 #endif
41804
41805     return(test_ret);
41806 }
41807
41808
41809 static int
41810 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
41811     int test_ret = 0;
41812
41813 #if defined(LIBXML_UNICODE_ENABLED)
41814     int mem_base;
41815     int ret_val;
41816     int code; /* UCS code point */
41817     int n_code;
41818
41819     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41820         mem_base = xmlMemBlocks();
41821         code = gen_int(n_code, 0);
41822
41823         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
41824         desret_int(ret_val);
41825         call_tests++;
41826         des_int(n_code, code, 0);
41827         xmlResetLastError();
41828         if (mem_base != xmlMemBlocks()) {
41829             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
41830                    xmlMemBlocks() - mem_base);
41831             test_ret++;
41832             printf(" %d", n_code);
41833             printf("\n");
41834         }
41835     }
41836     function_tests++;
41837 #endif
41838
41839     return(test_ret);
41840 }
41841
41842
41843 static int
41844 test_xmlUCSIsKhmer(void) {
41845     int test_ret = 0;
41846
41847 #if defined(LIBXML_UNICODE_ENABLED)
41848     int mem_base;
41849     int ret_val;
41850     int code; /* UCS code point */
41851     int n_code;
41852
41853     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41854         mem_base = xmlMemBlocks();
41855         code = gen_int(n_code, 0);
41856
41857         ret_val = xmlUCSIsKhmer(code);
41858         desret_int(ret_val);
41859         call_tests++;
41860         des_int(n_code, code, 0);
41861         xmlResetLastError();
41862         if (mem_base != xmlMemBlocks()) {
41863             printf("Leak of %d blocks found in xmlUCSIsKhmer",
41864                    xmlMemBlocks() - mem_base);
41865             test_ret++;
41866             printf(" %d", n_code);
41867             printf("\n");
41868         }
41869     }
41870     function_tests++;
41871 #endif
41872
41873     return(test_ret);
41874 }
41875
41876
41877 static int
41878 test_xmlUCSIsKhmerSymbols(void) {
41879     int test_ret = 0;
41880
41881 #if defined(LIBXML_UNICODE_ENABLED)
41882     int mem_base;
41883     int ret_val;
41884     int code; /* UCS code point */
41885     int n_code;
41886
41887     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41888         mem_base = xmlMemBlocks();
41889         code = gen_int(n_code, 0);
41890
41891         ret_val = xmlUCSIsKhmerSymbols(code);
41892         desret_int(ret_val);
41893         call_tests++;
41894         des_int(n_code, code, 0);
41895         xmlResetLastError();
41896         if (mem_base != xmlMemBlocks()) {
41897             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
41898                    xmlMemBlocks() - mem_base);
41899             test_ret++;
41900             printf(" %d", n_code);
41901             printf("\n");
41902         }
41903     }
41904     function_tests++;
41905 #endif
41906
41907     return(test_ret);
41908 }
41909
41910
41911 static int
41912 test_xmlUCSIsLao(void) {
41913     int test_ret = 0;
41914
41915 #if defined(LIBXML_UNICODE_ENABLED)
41916     int mem_base;
41917     int ret_val;
41918     int code; /* UCS code point */
41919     int n_code;
41920
41921     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41922         mem_base = xmlMemBlocks();
41923         code = gen_int(n_code, 0);
41924
41925         ret_val = xmlUCSIsLao(code);
41926         desret_int(ret_val);
41927         call_tests++;
41928         des_int(n_code, code, 0);
41929         xmlResetLastError();
41930         if (mem_base != xmlMemBlocks()) {
41931             printf("Leak of %d blocks found in xmlUCSIsLao",
41932                    xmlMemBlocks() - mem_base);
41933             test_ret++;
41934             printf(" %d", n_code);
41935             printf("\n");
41936         }
41937     }
41938     function_tests++;
41939 #endif
41940
41941     return(test_ret);
41942 }
41943
41944
41945 static int
41946 test_xmlUCSIsLatin1Supplement(void) {
41947     int test_ret = 0;
41948
41949 #if defined(LIBXML_UNICODE_ENABLED)
41950     int mem_base;
41951     int ret_val;
41952     int code; /* UCS code point */
41953     int n_code;
41954
41955     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41956         mem_base = xmlMemBlocks();
41957         code = gen_int(n_code, 0);
41958
41959         ret_val = xmlUCSIsLatin1Supplement(code);
41960         desret_int(ret_val);
41961         call_tests++;
41962         des_int(n_code, code, 0);
41963         xmlResetLastError();
41964         if (mem_base != xmlMemBlocks()) {
41965             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
41966                    xmlMemBlocks() - mem_base);
41967             test_ret++;
41968             printf(" %d", n_code);
41969             printf("\n");
41970         }
41971     }
41972     function_tests++;
41973 #endif
41974
41975     return(test_ret);
41976 }
41977
41978
41979 static int
41980 test_xmlUCSIsLatinExtendedA(void) {
41981     int test_ret = 0;
41982
41983 #if defined(LIBXML_UNICODE_ENABLED)
41984     int mem_base;
41985     int ret_val;
41986     int code; /* UCS code point */
41987     int n_code;
41988
41989     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41990         mem_base = xmlMemBlocks();
41991         code = gen_int(n_code, 0);
41992
41993         ret_val = xmlUCSIsLatinExtendedA(code);
41994         desret_int(ret_val);
41995         call_tests++;
41996         des_int(n_code, code, 0);
41997         xmlResetLastError();
41998         if (mem_base != xmlMemBlocks()) {
41999             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
42000                    xmlMemBlocks() - mem_base);
42001             test_ret++;
42002             printf(" %d", n_code);
42003             printf("\n");
42004         }
42005     }
42006     function_tests++;
42007 #endif
42008
42009     return(test_ret);
42010 }
42011
42012
42013 static int
42014 test_xmlUCSIsLatinExtendedAdditional(void) {
42015     int test_ret = 0;
42016
42017 #if defined(LIBXML_UNICODE_ENABLED)
42018     int mem_base;
42019     int ret_val;
42020     int code; /* UCS code point */
42021     int n_code;
42022
42023     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42024         mem_base = xmlMemBlocks();
42025         code = gen_int(n_code, 0);
42026
42027         ret_val = xmlUCSIsLatinExtendedAdditional(code);
42028         desret_int(ret_val);
42029         call_tests++;
42030         des_int(n_code, code, 0);
42031         xmlResetLastError();
42032         if (mem_base != xmlMemBlocks()) {
42033             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
42034                    xmlMemBlocks() - mem_base);
42035             test_ret++;
42036             printf(" %d", n_code);
42037             printf("\n");
42038         }
42039     }
42040     function_tests++;
42041 #endif
42042
42043     return(test_ret);
42044 }
42045
42046
42047 static int
42048 test_xmlUCSIsLatinExtendedB(void) {
42049     int test_ret = 0;
42050
42051 #if defined(LIBXML_UNICODE_ENABLED)
42052     int mem_base;
42053     int ret_val;
42054     int code; /* UCS code point */
42055     int n_code;
42056
42057     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42058         mem_base = xmlMemBlocks();
42059         code = gen_int(n_code, 0);
42060
42061         ret_val = xmlUCSIsLatinExtendedB(code);
42062         desret_int(ret_val);
42063         call_tests++;
42064         des_int(n_code, code, 0);
42065         xmlResetLastError();
42066         if (mem_base != xmlMemBlocks()) {
42067             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
42068                    xmlMemBlocks() - mem_base);
42069             test_ret++;
42070             printf(" %d", n_code);
42071             printf("\n");
42072         }
42073     }
42074     function_tests++;
42075 #endif
42076
42077     return(test_ret);
42078 }
42079
42080
42081 static int
42082 test_xmlUCSIsLetterlikeSymbols(void) {
42083     int test_ret = 0;
42084
42085 #if defined(LIBXML_UNICODE_ENABLED)
42086     int mem_base;
42087     int ret_val;
42088     int code; /* UCS code point */
42089     int n_code;
42090
42091     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42092         mem_base = xmlMemBlocks();
42093         code = gen_int(n_code, 0);
42094
42095         ret_val = xmlUCSIsLetterlikeSymbols(code);
42096         desret_int(ret_val);
42097         call_tests++;
42098         des_int(n_code, code, 0);
42099         xmlResetLastError();
42100         if (mem_base != xmlMemBlocks()) {
42101             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
42102                    xmlMemBlocks() - mem_base);
42103             test_ret++;
42104             printf(" %d", n_code);
42105             printf("\n");
42106         }
42107     }
42108     function_tests++;
42109 #endif
42110
42111     return(test_ret);
42112 }
42113
42114
42115 static int
42116 test_xmlUCSIsLimbu(void) {
42117     int test_ret = 0;
42118
42119 #if defined(LIBXML_UNICODE_ENABLED)
42120     int mem_base;
42121     int ret_val;
42122     int code; /* UCS code point */
42123     int n_code;
42124
42125     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42126         mem_base = xmlMemBlocks();
42127         code = gen_int(n_code, 0);
42128
42129         ret_val = xmlUCSIsLimbu(code);
42130         desret_int(ret_val);
42131         call_tests++;
42132         des_int(n_code, code, 0);
42133         xmlResetLastError();
42134         if (mem_base != xmlMemBlocks()) {
42135             printf("Leak of %d blocks found in xmlUCSIsLimbu",
42136                    xmlMemBlocks() - mem_base);
42137             test_ret++;
42138             printf(" %d", n_code);
42139             printf("\n");
42140         }
42141     }
42142     function_tests++;
42143 #endif
42144
42145     return(test_ret);
42146 }
42147
42148
42149 static int
42150 test_xmlUCSIsLinearBIdeograms(void) {
42151     int test_ret = 0;
42152
42153 #if defined(LIBXML_UNICODE_ENABLED)
42154     int mem_base;
42155     int ret_val;
42156     int code; /* UCS code point */
42157     int n_code;
42158
42159     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42160         mem_base = xmlMemBlocks();
42161         code = gen_int(n_code, 0);
42162
42163         ret_val = xmlUCSIsLinearBIdeograms(code);
42164         desret_int(ret_val);
42165         call_tests++;
42166         des_int(n_code, code, 0);
42167         xmlResetLastError();
42168         if (mem_base != xmlMemBlocks()) {
42169             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
42170                    xmlMemBlocks() - mem_base);
42171             test_ret++;
42172             printf(" %d", n_code);
42173             printf("\n");
42174         }
42175     }
42176     function_tests++;
42177 #endif
42178
42179     return(test_ret);
42180 }
42181
42182
42183 static int
42184 test_xmlUCSIsLinearBSyllabary(void) {
42185     int test_ret = 0;
42186
42187 #if defined(LIBXML_UNICODE_ENABLED)
42188     int mem_base;
42189     int ret_val;
42190     int code; /* UCS code point */
42191     int n_code;
42192
42193     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42194         mem_base = xmlMemBlocks();
42195         code = gen_int(n_code, 0);
42196
42197         ret_val = xmlUCSIsLinearBSyllabary(code);
42198         desret_int(ret_val);
42199         call_tests++;
42200         des_int(n_code, code, 0);
42201         xmlResetLastError();
42202         if (mem_base != xmlMemBlocks()) {
42203             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
42204                    xmlMemBlocks() - mem_base);
42205             test_ret++;
42206             printf(" %d", n_code);
42207             printf("\n");
42208         }
42209     }
42210     function_tests++;
42211 #endif
42212
42213     return(test_ret);
42214 }
42215
42216
42217 static int
42218 test_xmlUCSIsLowSurrogates(void) {
42219     int test_ret = 0;
42220
42221 #if defined(LIBXML_UNICODE_ENABLED)
42222     int mem_base;
42223     int ret_val;
42224     int code; /* UCS code point */
42225     int n_code;
42226
42227     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42228         mem_base = xmlMemBlocks();
42229         code = gen_int(n_code, 0);
42230
42231         ret_val = xmlUCSIsLowSurrogates(code);
42232         desret_int(ret_val);
42233         call_tests++;
42234         des_int(n_code, code, 0);
42235         xmlResetLastError();
42236         if (mem_base != xmlMemBlocks()) {
42237             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
42238                    xmlMemBlocks() - mem_base);
42239             test_ret++;
42240             printf(" %d", n_code);
42241             printf("\n");
42242         }
42243     }
42244     function_tests++;
42245 #endif
42246
42247     return(test_ret);
42248 }
42249
42250
42251 static int
42252 test_xmlUCSIsMalayalam(void) {
42253     int test_ret = 0;
42254
42255 #if defined(LIBXML_UNICODE_ENABLED)
42256     int mem_base;
42257     int ret_val;
42258     int code; /* UCS code point */
42259     int n_code;
42260
42261     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42262         mem_base = xmlMemBlocks();
42263         code = gen_int(n_code, 0);
42264
42265         ret_val = xmlUCSIsMalayalam(code);
42266         desret_int(ret_val);
42267         call_tests++;
42268         des_int(n_code, code, 0);
42269         xmlResetLastError();
42270         if (mem_base != xmlMemBlocks()) {
42271             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
42272                    xmlMemBlocks() - mem_base);
42273             test_ret++;
42274             printf(" %d", n_code);
42275             printf("\n");
42276         }
42277     }
42278     function_tests++;
42279 #endif
42280
42281     return(test_ret);
42282 }
42283
42284
42285 static int
42286 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
42287     int test_ret = 0;
42288
42289 #if defined(LIBXML_UNICODE_ENABLED)
42290     int mem_base;
42291     int ret_val;
42292     int code; /* UCS code point */
42293     int n_code;
42294
42295     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42296         mem_base = xmlMemBlocks();
42297         code = gen_int(n_code, 0);
42298
42299         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
42300         desret_int(ret_val);
42301         call_tests++;
42302         des_int(n_code, code, 0);
42303         xmlResetLastError();
42304         if (mem_base != xmlMemBlocks()) {
42305             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
42306                    xmlMemBlocks() - mem_base);
42307             test_ret++;
42308             printf(" %d", n_code);
42309             printf("\n");
42310         }
42311     }
42312     function_tests++;
42313 #endif
42314
42315     return(test_ret);
42316 }
42317
42318
42319 static int
42320 test_xmlUCSIsMathematicalOperators(void) {
42321     int test_ret = 0;
42322
42323 #if defined(LIBXML_UNICODE_ENABLED)
42324     int mem_base;
42325     int ret_val;
42326     int code; /* UCS code point */
42327     int n_code;
42328
42329     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42330         mem_base = xmlMemBlocks();
42331         code = gen_int(n_code, 0);
42332
42333         ret_val = xmlUCSIsMathematicalOperators(code);
42334         desret_int(ret_val);
42335         call_tests++;
42336         des_int(n_code, code, 0);
42337         xmlResetLastError();
42338         if (mem_base != xmlMemBlocks()) {
42339             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
42340                    xmlMemBlocks() - mem_base);
42341             test_ret++;
42342             printf(" %d", n_code);
42343             printf("\n");
42344         }
42345     }
42346     function_tests++;
42347 #endif
42348
42349     return(test_ret);
42350 }
42351
42352
42353 static int
42354 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
42355     int test_ret = 0;
42356
42357 #if defined(LIBXML_UNICODE_ENABLED)
42358     int mem_base;
42359     int ret_val;
42360     int code; /* UCS code point */
42361     int n_code;
42362
42363     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42364         mem_base = xmlMemBlocks();
42365         code = gen_int(n_code, 0);
42366
42367         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
42368         desret_int(ret_val);
42369         call_tests++;
42370         des_int(n_code, code, 0);
42371         xmlResetLastError();
42372         if (mem_base != xmlMemBlocks()) {
42373             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
42374                    xmlMemBlocks() - mem_base);
42375             test_ret++;
42376             printf(" %d", n_code);
42377             printf("\n");
42378         }
42379     }
42380     function_tests++;
42381 #endif
42382
42383     return(test_ret);
42384 }
42385
42386
42387 static int
42388 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
42389     int test_ret = 0;
42390
42391 #if defined(LIBXML_UNICODE_ENABLED)
42392     int mem_base;
42393     int ret_val;
42394     int code; /* UCS code point */
42395     int n_code;
42396
42397     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42398         mem_base = xmlMemBlocks();
42399         code = gen_int(n_code, 0);
42400
42401         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
42402         desret_int(ret_val);
42403         call_tests++;
42404         des_int(n_code, code, 0);
42405         xmlResetLastError();
42406         if (mem_base != xmlMemBlocks()) {
42407             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
42408                    xmlMemBlocks() - mem_base);
42409             test_ret++;
42410             printf(" %d", n_code);
42411             printf("\n");
42412         }
42413     }
42414     function_tests++;
42415 #endif
42416
42417     return(test_ret);
42418 }
42419
42420
42421 static int
42422 test_xmlUCSIsMiscellaneousSymbols(void) {
42423     int test_ret = 0;
42424
42425 #if defined(LIBXML_UNICODE_ENABLED)
42426     int mem_base;
42427     int ret_val;
42428     int code; /* UCS code point */
42429     int n_code;
42430
42431     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42432         mem_base = xmlMemBlocks();
42433         code = gen_int(n_code, 0);
42434
42435         ret_val = xmlUCSIsMiscellaneousSymbols(code);
42436         desret_int(ret_val);
42437         call_tests++;
42438         des_int(n_code, code, 0);
42439         xmlResetLastError();
42440         if (mem_base != xmlMemBlocks()) {
42441             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
42442                    xmlMemBlocks() - mem_base);
42443             test_ret++;
42444             printf(" %d", n_code);
42445             printf("\n");
42446         }
42447     }
42448     function_tests++;
42449 #endif
42450
42451     return(test_ret);
42452 }
42453
42454
42455 static int
42456 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
42457     int test_ret = 0;
42458
42459 #if defined(LIBXML_UNICODE_ENABLED)
42460     int mem_base;
42461     int ret_val;
42462     int code; /* UCS code point */
42463     int n_code;
42464
42465     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42466         mem_base = xmlMemBlocks();
42467         code = gen_int(n_code, 0);
42468
42469         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
42470         desret_int(ret_val);
42471         call_tests++;
42472         des_int(n_code, code, 0);
42473         xmlResetLastError();
42474         if (mem_base != xmlMemBlocks()) {
42475             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
42476                    xmlMemBlocks() - mem_base);
42477             test_ret++;
42478             printf(" %d", n_code);
42479             printf("\n");
42480         }
42481     }
42482     function_tests++;
42483 #endif
42484
42485     return(test_ret);
42486 }
42487
42488
42489 static int
42490 test_xmlUCSIsMiscellaneousTechnical(void) {
42491     int test_ret = 0;
42492
42493 #if defined(LIBXML_UNICODE_ENABLED)
42494     int mem_base;
42495     int ret_val;
42496     int code; /* UCS code point */
42497     int n_code;
42498
42499     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42500         mem_base = xmlMemBlocks();
42501         code = gen_int(n_code, 0);
42502
42503         ret_val = xmlUCSIsMiscellaneousTechnical(code);
42504         desret_int(ret_val);
42505         call_tests++;
42506         des_int(n_code, code, 0);
42507         xmlResetLastError();
42508         if (mem_base != xmlMemBlocks()) {
42509             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
42510                    xmlMemBlocks() - mem_base);
42511             test_ret++;
42512             printf(" %d", n_code);
42513             printf("\n");
42514         }
42515     }
42516     function_tests++;
42517 #endif
42518
42519     return(test_ret);
42520 }
42521
42522
42523 static int
42524 test_xmlUCSIsMongolian(void) {
42525     int test_ret = 0;
42526
42527 #if defined(LIBXML_UNICODE_ENABLED)
42528     int mem_base;
42529     int ret_val;
42530     int code; /* UCS code point */
42531     int n_code;
42532
42533     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42534         mem_base = xmlMemBlocks();
42535         code = gen_int(n_code, 0);
42536
42537         ret_val = xmlUCSIsMongolian(code);
42538         desret_int(ret_val);
42539         call_tests++;
42540         des_int(n_code, code, 0);
42541         xmlResetLastError();
42542         if (mem_base != xmlMemBlocks()) {
42543             printf("Leak of %d blocks found in xmlUCSIsMongolian",
42544                    xmlMemBlocks() - mem_base);
42545             test_ret++;
42546             printf(" %d", n_code);
42547             printf("\n");
42548         }
42549     }
42550     function_tests++;
42551 #endif
42552
42553     return(test_ret);
42554 }
42555
42556
42557 static int
42558 test_xmlUCSIsMusicalSymbols(void) {
42559     int test_ret = 0;
42560
42561 #if defined(LIBXML_UNICODE_ENABLED)
42562     int mem_base;
42563     int ret_val;
42564     int code; /* UCS code point */
42565     int n_code;
42566
42567     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42568         mem_base = xmlMemBlocks();
42569         code = gen_int(n_code, 0);
42570
42571         ret_val = xmlUCSIsMusicalSymbols(code);
42572         desret_int(ret_val);
42573         call_tests++;
42574         des_int(n_code, code, 0);
42575         xmlResetLastError();
42576         if (mem_base != xmlMemBlocks()) {
42577             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
42578                    xmlMemBlocks() - mem_base);
42579             test_ret++;
42580             printf(" %d", n_code);
42581             printf("\n");
42582         }
42583     }
42584     function_tests++;
42585 #endif
42586
42587     return(test_ret);
42588 }
42589
42590
42591 static int
42592 test_xmlUCSIsMyanmar(void) {
42593     int test_ret = 0;
42594
42595 #if defined(LIBXML_UNICODE_ENABLED)
42596     int mem_base;
42597     int ret_val;
42598     int code; /* UCS code point */
42599     int n_code;
42600
42601     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42602         mem_base = xmlMemBlocks();
42603         code = gen_int(n_code, 0);
42604
42605         ret_val = xmlUCSIsMyanmar(code);
42606         desret_int(ret_val);
42607         call_tests++;
42608         des_int(n_code, code, 0);
42609         xmlResetLastError();
42610         if (mem_base != xmlMemBlocks()) {
42611             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
42612                    xmlMemBlocks() - mem_base);
42613             test_ret++;
42614             printf(" %d", n_code);
42615             printf("\n");
42616         }
42617     }
42618     function_tests++;
42619 #endif
42620
42621     return(test_ret);
42622 }
42623
42624
42625 static int
42626 test_xmlUCSIsNumberForms(void) {
42627     int test_ret = 0;
42628
42629 #if defined(LIBXML_UNICODE_ENABLED)
42630     int mem_base;
42631     int ret_val;
42632     int code; /* UCS code point */
42633     int n_code;
42634
42635     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42636         mem_base = xmlMemBlocks();
42637         code = gen_int(n_code, 0);
42638
42639         ret_val = xmlUCSIsNumberForms(code);
42640         desret_int(ret_val);
42641         call_tests++;
42642         des_int(n_code, code, 0);
42643         xmlResetLastError();
42644         if (mem_base != xmlMemBlocks()) {
42645             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
42646                    xmlMemBlocks() - mem_base);
42647             test_ret++;
42648             printf(" %d", n_code);
42649             printf("\n");
42650         }
42651     }
42652     function_tests++;
42653 #endif
42654
42655     return(test_ret);
42656 }
42657
42658
42659 static int
42660 test_xmlUCSIsOgham(void) {
42661     int test_ret = 0;
42662
42663 #if defined(LIBXML_UNICODE_ENABLED)
42664     int mem_base;
42665     int ret_val;
42666     int code; /* UCS code point */
42667     int n_code;
42668
42669     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42670         mem_base = xmlMemBlocks();
42671         code = gen_int(n_code, 0);
42672
42673         ret_val = xmlUCSIsOgham(code);
42674         desret_int(ret_val);
42675         call_tests++;
42676         des_int(n_code, code, 0);
42677         xmlResetLastError();
42678         if (mem_base != xmlMemBlocks()) {
42679             printf("Leak of %d blocks found in xmlUCSIsOgham",
42680                    xmlMemBlocks() - mem_base);
42681             test_ret++;
42682             printf(" %d", n_code);
42683             printf("\n");
42684         }
42685     }
42686     function_tests++;
42687 #endif
42688
42689     return(test_ret);
42690 }
42691
42692
42693 static int
42694 test_xmlUCSIsOldItalic(void) {
42695     int test_ret = 0;
42696
42697 #if defined(LIBXML_UNICODE_ENABLED)
42698     int mem_base;
42699     int ret_val;
42700     int code; /* UCS code point */
42701     int n_code;
42702
42703     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42704         mem_base = xmlMemBlocks();
42705         code = gen_int(n_code, 0);
42706
42707         ret_val = xmlUCSIsOldItalic(code);
42708         desret_int(ret_val);
42709         call_tests++;
42710         des_int(n_code, code, 0);
42711         xmlResetLastError();
42712         if (mem_base != xmlMemBlocks()) {
42713             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
42714                    xmlMemBlocks() - mem_base);
42715             test_ret++;
42716             printf(" %d", n_code);
42717             printf("\n");
42718         }
42719     }
42720     function_tests++;
42721 #endif
42722
42723     return(test_ret);
42724 }
42725
42726
42727 static int
42728 test_xmlUCSIsOpticalCharacterRecognition(void) {
42729     int test_ret = 0;
42730
42731 #if defined(LIBXML_UNICODE_ENABLED)
42732     int mem_base;
42733     int ret_val;
42734     int code; /* UCS code point */
42735     int n_code;
42736
42737     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42738         mem_base = xmlMemBlocks();
42739         code = gen_int(n_code, 0);
42740
42741         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
42742         desret_int(ret_val);
42743         call_tests++;
42744         des_int(n_code, code, 0);
42745         xmlResetLastError();
42746         if (mem_base != xmlMemBlocks()) {
42747             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
42748                    xmlMemBlocks() - mem_base);
42749             test_ret++;
42750             printf(" %d", n_code);
42751             printf("\n");
42752         }
42753     }
42754     function_tests++;
42755 #endif
42756
42757     return(test_ret);
42758 }
42759
42760
42761 static int
42762 test_xmlUCSIsOriya(void) {
42763     int test_ret = 0;
42764
42765 #if defined(LIBXML_UNICODE_ENABLED)
42766     int mem_base;
42767     int ret_val;
42768     int code; /* UCS code point */
42769     int n_code;
42770
42771     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42772         mem_base = xmlMemBlocks();
42773         code = gen_int(n_code, 0);
42774
42775         ret_val = xmlUCSIsOriya(code);
42776         desret_int(ret_val);
42777         call_tests++;
42778         des_int(n_code, code, 0);
42779         xmlResetLastError();
42780         if (mem_base != xmlMemBlocks()) {
42781             printf("Leak of %d blocks found in xmlUCSIsOriya",
42782                    xmlMemBlocks() - mem_base);
42783             test_ret++;
42784             printf(" %d", n_code);
42785             printf("\n");
42786         }
42787     }
42788     function_tests++;
42789 #endif
42790
42791     return(test_ret);
42792 }
42793
42794
42795 static int
42796 test_xmlUCSIsOsmanya(void) {
42797     int test_ret = 0;
42798
42799 #if defined(LIBXML_UNICODE_ENABLED)
42800     int mem_base;
42801     int ret_val;
42802     int code; /* UCS code point */
42803     int n_code;
42804
42805     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42806         mem_base = xmlMemBlocks();
42807         code = gen_int(n_code, 0);
42808
42809         ret_val = xmlUCSIsOsmanya(code);
42810         desret_int(ret_val);
42811         call_tests++;
42812         des_int(n_code, code, 0);
42813         xmlResetLastError();
42814         if (mem_base != xmlMemBlocks()) {
42815             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
42816                    xmlMemBlocks() - mem_base);
42817             test_ret++;
42818             printf(" %d", n_code);
42819             printf("\n");
42820         }
42821     }
42822     function_tests++;
42823 #endif
42824
42825     return(test_ret);
42826 }
42827
42828
42829 static int
42830 test_xmlUCSIsPhoneticExtensions(void) {
42831     int test_ret = 0;
42832
42833 #if defined(LIBXML_UNICODE_ENABLED)
42834     int mem_base;
42835     int ret_val;
42836     int code; /* UCS code point */
42837     int n_code;
42838
42839     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42840         mem_base = xmlMemBlocks();
42841         code = gen_int(n_code, 0);
42842
42843         ret_val = xmlUCSIsPhoneticExtensions(code);
42844         desret_int(ret_val);
42845         call_tests++;
42846         des_int(n_code, code, 0);
42847         xmlResetLastError();
42848         if (mem_base != xmlMemBlocks()) {
42849             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
42850                    xmlMemBlocks() - mem_base);
42851             test_ret++;
42852             printf(" %d", n_code);
42853             printf("\n");
42854         }
42855     }
42856     function_tests++;
42857 #endif
42858
42859     return(test_ret);
42860 }
42861
42862
42863 static int
42864 test_xmlUCSIsPrivateUse(void) {
42865     int test_ret = 0;
42866
42867 #if defined(LIBXML_UNICODE_ENABLED)
42868     int mem_base;
42869     int ret_val;
42870     int code; /* UCS code point */
42871     int n_code;
42872
42873     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42874         mem_base = xmlMemBlocks();
42875         code = gen_int(n_code, 0);
42876
42877         ret_val = xmlUCSIsPrivateUse(code);
42878         desret_int(ret_val);
42879         call_tests++;
42880         des_int(n_code, code, 0);
42881         xmlResetLastError();
42882         if (mem_base != xmlMemBlocks()) {
42883             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
42884                    xmlMemBlocks() - mem_base);
42885             test_ret++;
42886             printf(" %d", n_code);
42887             printf("\n");
42888         }
42889     }
42890     function_tests++;
42891 #endif
42892
42893     return(test_ret);
42894 }
42895
42896
42897 static int
42898 test_xmlUCSIsPrivateUseArea(void) {
42899     int test_ret = 0;
42900
42901 #if defined(LIBXML_UNICODE_ENABLED)
42902     int mem_base;
42903     int ret_val;
42904     int code; /* UCS code point */
42905     int n_code;
42906
42907     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42908         mem_base = xmlMemBlocks();
42909         code = gen_int(n_code, 0);
42910
42911         ret_val = xmlUCSIsPrivateUseArea(code);
42912         desret_int(ret_val);
42913         call_tests++;
42914         des_int(n_code, code, 0);
42915         xmlResetLastError();
42916         if (mem_base != xmlMemBlocks()) {
42917             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
42918                    xmlMemBlocks() - mem_base);
42919             test_ret++;
42920             printf(" %d", n_code);
42921             printf("\n");
42922         }
42923     }
42924     function_tests++;
42925 #endif
42926
42927     return(test_ret);
42928 }
42929
42930
42931 static int
42932 test_xmlUCSIsRunic(void) {
42933     int test_ret = 0;
42934
42935 #if defined(LIBXML_UNICODE_ENABLED)
42936     int mem_base;
42937     int ret_val;
42938     int code; /* UCS code point */
42939     int n_code;
42940
42941     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42942         mem_base = xmlMemBlocks();
42943         code = gen_int(n_code, 0);
42944
42945         ret_val = xmlUCSIsRunic(code);
42946         desret_int(ret_val);
42947         call_tests++;
42948         des_int(n_code, code, 0);
42949         xmlResetLastError();
42950         if (mem_base != xmlMemBlocks()) {
42951             printf("Leak of %d blocks found in xmlUCSIsRunic",
42952                    xmlMemBlocks() - mem_base);
42953             test_ret++;
42954             printf(" %d", n_code);
42955             printf("\n");
42956         }
42957     }
42958     function_tests++;
42959 #endif
42960
42961     return(test_ret);
42962 }
42963
42964
42965 static int
42966 test_xmlUCSIsShavian(void) {
42967     int test_ret = 0;
42968
42969 #if defined(LIBXML_UNICODE_ENABLED)
42970     int mem_base;
42971     int ret_val;
42972     int code; /* UCS code point */
42973     int n_code;
42974
42975     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42976         mem_base = xmlMemBlocks();
42977         code = gen_int(n_code, 0);
42978
42979         ret_val = xmlUCSIsShavian(code);
42980         desret_int(ret_val);
42981         call_tests++;
42982         des_int(n_code, code, 0);
42983         xmlResetLastError();
42984         if (mem_base != xmlMemBlocks()) {
42985             printf("Leak of %d blocks found in xmlUCSIsShavian",
42986                    xmlMemBlocks() - mem_base);
42987             test_ret++;
42988             printf(" %d", n_code);
42989             printf("\n");
42990         }
42991     }
42992     function_tests++;
42993 #endif
42994
42995     return(test_ret);
42996 }
42997
42998
42999 static int
43000 test_xmlUCSIsSinhala(void) {
43001     int test_ret = 0;
43002
43003 #if defined(LIBXML_UNICODE_ENABLED)
43004     int mem_base;
43005     int ret_val;
43006     int code; /* UCS code point */
43007     int n_code;
43008
43009     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43010         mem_base = xmlMemBlocks();
43011         code = gen_int(n_code, 0);
43012
43013         ret_val = xmlUCSIsSinhala(code);
43014         desret_int(ret_val);
43015         call_tests++;
43016         des_int(n_code, code, 0);
43017         xmlResetLastError();
43018         if (mem_base != xmlMemBlocks()) {
43019             printf("Leak of %d blocks found in xmlUCSIsSinhala",
43020                    xmlMemBlocks() - mem_base);
43021             test_ret++;
43022             printf(" %d", n_code);
43023             printf("\n");
43024         }
43025     }
43026     function_tests++;
43027 #endif
43028
43029     return(test_ret);
43030 }
43031
43032
43033 static int
43034 test_xmlUCSIsSmallFormVariants(void) {
43035     int test_ret = 0;
43036
43037 #if defined(LIBXML_UNICODE_ENABLED)
43038     int mem_base;
43039     int ret_val;
43040     int code; /* UCS code point */
43041     int n_code;
43042
43043     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43044         mem_base = xmlMemBlocks();
43045         code = gen_int(n_code, 0);
43046
43047         ret_val = xmlUCSIsSmallFormVariants(code);
43048         desret_int(ret_val);
43049         call_tests++;
43050         des_int(n_code, code, 0);
43051         xmlResetLastError();
43052         if (mem_base != xmlMemBlocks()) {
43053             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
43054                    xmlMemBlocks() - mem_base);
43055             test_ret++;
43056             printf(" %d", n_code);
43057             printf("\n");
43058         }
43059     }
43060     function_tests++;
43061 #endif
43062
43063     return(test_ret);
43064 }
43065
43066
43067 static int
43068 test_xmlUCSIsSpacingModifierLetters(void) {
43069     int test_ret = 0;
43070
43071 #if defined(LIBXML_UNICODE_ENABLED)
43072     int mem_base;
43073     int ret_val;
43074     int code; /* UCS code point */
43075     int n_code;
43076
43077     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43078         mem_base = xmlMemBlocks();
43079         code = gen_int(n_code, 0);
43080
43081         ret_val = xmlUCSIsSpacingModifierLetters(code);
43082         desret_int(ret_val);
43083         call_tests++;
43084         des_int(n_code, code, 0);
43085         xmlResetLastError();
43086         if (mem_base != xmlMemBlocks()) {
43087             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
43088                    xmlMemBlocks() - mem_base);
43089             test_ret++;
43090             printf(" %d", n_code);
43091             printf("\n");
43092         }
43093     }
43094     function_tests++;
43095 #endif
43096
43097     return(test_ret);
43098 }
43099
43100
43101 static int
43102 test_xmlUCSIsSpecials(void) {
43103     int test_ret = 0;
43104
43105 #if defined(LIBXML_UNICODE_ENABLED)
43106     int mem_base;
43107     int ret_val;
43108     int code; /* UCS code point */
43109     int n_code;
43110
43111     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43112         mem_base = xmlMemBlocks();
43113         code = gen_int(n_code, 0);
43114
43115         ret_val = xmlUCSIsSpecials(code);
43116         desret_int(ret_val);
43117         call_tests++;
43118         des_int(n_code, code, 0);
43119         xmlResetLastError();
43120         if (mem_base != xmlMemBlocks()) {
43121             printf("Leak of %d blocks found in xmlUCSIsSpecials",
43122                    xmlMemBlocks() - mem_base);
43123             test_ret++;
43124             printf(" %d", n_code);
43125             printf("\n");
43126         }
43127     }
43128     function_tests++;
43129 #endif
43130
43131     return(test_ret);
43132 }
43133
43134
43135 static int
43136 test_xmlUCSIsSuperscriptsandSubscripts(void) {
43137     int test_ret = 0;
43138
43139 #if defined(LIBXML_UNICODE_ENABLED)
43140     int mem_base;
43141     int ret_val;
43142     int code; /* UCS code point */
43143     int n_code;
43144
43145     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43146         mem_base = xmlMemBlocks();
43147         code = gen_int(n_code, 0);
43148
43149         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
43150         desret_int(ret_val);
43151         call_tests++;
43152         des_int(n_code, code, 0);
43153         xmlResetLastError();
43154         if (mem_base != xmlMemBlocks()) {
43155             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
43156                    xmlMemBlocks() - mem_base);
43157             test_ret++;
43158             printf(" %d", n_code);
43159             printf("\n");
43160         }
43161     }
43162     function_tests++;
43163 #endif
43164
43165     return(test_ret);
43166 }
43167
43168
43169 static int
43170 test_xmlUCSIsSupplementalArrowsA(void) {
43171     int test_ret = 0;
43172
43173 #if defined(LIBXML_UNICODE_ENABLED)
43174     int mem_base;
43175     int ret_val;
43176     int code; /* UCS code point */
43177     int n_code;
43178
43179     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43180         mem_base = xmlMemBlocks();
43181         code = gen_int(n_code, 0);
43182
43183         ret_val = xmlUCSIsSupplementalArrowsA(code);
43184         desret_int(ret_val);
43185         call_tests++;
43186         des_int(n_code, code, 0);
43187         xmlResetLastError();
43188         if (mem_base != xmlMemBlocks()) {
43189             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
43190                    xmlMemBlocks() - mem_base);
43191             test_ret++;
43192             printf(" %d", n_code);
43193             printf("\n");
43194         }
43195     }
43196     function_tests++;
43197 #endif
43198
43199     return(test_ret);
43200 }
43201
43202
43203 static int
43204 test_xmlUCSIsSupplementalArrowsB(void) {
43205     int test_ret = 0;
43206
43207 #if defined(LIBXML_UNICODE_ENABLED)
43208     int mem_base;
43209     int ret_val;
43210     int code; /* UCS code point */
43211     int n_code;
43212
43213     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43214         mem_base = xmlMemBlocks();
43215         code = gen_int(n_code, 0);
43216
43217         ret_val = xmlUCSIsSupplementalArrowsB(code);
43218         desret_int(ret_val);
43219         call_tests++;
43220         des_int(n_code, code, 0);
43221         xmlResetLastError();
43222         if (mem_base != xmlMemBlocks()) {
43223             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
43224                    xmlMemBlocks() - mem_base);
43225             test_ret++;
43226             printf(" %d", n_code);
43227             printf("\n");
43228         }
43229     }
43230     function_tests++;
43231 #endif
43232
43233     return(test_ret);
43234 }
43235
43236
43237 static int
43238 test_xmlUCSIsSupplementalMathematicalOperators(void) {
43239     int test_ret = 0;
43240
43241 #if defined(LIBXML_UNICODE_ENABLED)
43242     int mem_base;
43243     int ret_val;
43244     int code; /* UCS code point */
43245     int n_code;
43246
43247     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43248         mem_base = xmlMemBlocks();
43249         code = gen_int(n_code, 0);
43250
43251         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
43252         desret_int(ret_val);
43253         call_tests++;
43254         des_int(n_code, code, 0);
43255         xmlResetLastError();
43256         if (mem_base != xmlMemBlocks()) {
43257             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
43258                    xmlMemBlocks() - mem_base);
43259             test_ret++;
43260             printf(" %d", n_code);
43261             printf("\n");
43262         }
43263     }
43264     function_tests++;
43265 #endif
43266
43267     return(test_ret);
43268 }
43269
43270
43271 static int
43272 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
43273     int test_ret = 0;
43274
43275 #if defined(LIBXML_UNICODE_ENABLED)
43276     int mem_base;
43277     int ret_val;
43278     int code; /* UCS code point */
43279     int n_code;
43280
43281     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43282         mem_base = xmlMemBlocks();
43283         code = gen_int(n_code, 0);
43284
43285         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
43286         desret_int(ret_val);
43287         call_tests++;
43288         des_int(n_code, code, 0);
43289         xmlResetLastError();
43290         if (mem_base != xmlMemBlocks()) {
43291             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
43292                    xmlMemBlocks() - mem_base);
43293             test_ret++;
43294             printf(" %d", n_code);
43295             printf("\n");
43296         }
43297     }
43298     function_tests++;
43299 #endif
43300
43301     return(test_ret);
43302 }
43303
43304
43305 static int
43306 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
43307     int test_ret = 0;
43308
43309 #if defined(LIBXML_UNICODE_ENABLED)
43310     int mem_base;
43311     int ret_val;
43312     int code; /* UCS code point */
43313     int n_code;
43314
43315     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43316         mem_base = xmlMemBlocks();
43317         code = gen_int(n_code, 0);
43318
43319         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
43320         desret_int(ret_val);
43321         call_tests++;
43322         des_int(n_code, code, 0);
43323         xmlResetLastError();
43324         if (mem_base != xmlMemBlocks()) {
43325             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
43326                    xmlMemBlocks() - mem_base);
43327             test_ret++;
43328             printf(" %d", n_code);
43329             printf("\n");
43330         }
43331     }
43332     function_tests++;
43333 #endif
43334
43335     return(test_ret);
43336 }
43337
43338
43339 static int
43340 test_xmlUCSIsSyriac(void) {
43341     int test_ret = 0;
43342
43343 #if defined(LIBXML_UNICODE_ENABLED)
43344     int mem_base;
43345     int ret_val;
43346     int code; /* UCS code point */
43347     int n_code;
43348
43349     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43350         mem_base = xmlMemBlocks();
43351         code = gen_int(n_code, 0);
43352
43353         ret_val = xmlUCSIsSyriac(code);
43354         desret_int(ret_val);
43355         call_tests++;
43356         des_int(n_code, code, 0);
43357         xmlResetLastError();
43358         if (mem_base != xmlMemBlocks()) {
43359             printf("Leak of %d blocks found in xmlUCSIsSyriac",
43360                    xmlMemBlocks() - mem_base);
43361             test_ret++;
43362             printf(" %d", n_code);
43363             printf("\n");
43364         }
43365     }
43366     function_tests++;
43367 #endif
43368
43369     return(test_ret);
43370 }
43371
43372
43373 static int
43374 test_xmlUCSIsTagalog(void) {
43375     int test_ret = 0;
43376
43377 #if defined(LIBXML_UNICODE_ENABLED)
43378     int mem_base;
43379     int ret_val;
43380     int code; /* UCS code point */
43381     int n_code;
43382
43383     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43384         mem_base = xmlMemBlocks();
43385         code = gen_int(n_code, 0);
43386
43387         ret_val = xmlUCSIsTagalog(code);
43388         desret_int(ret_val);
43389         call_tests++;
43390         des_int(n_code, code, 0);
43391         xmlResetLastError();
43392         if (mem_base != xmlMemBlocks()) {
43393             printf("Leak of %d blocks found in xmlUCSIsTagalog",
43394                    xmlMemBlocks() - mem_base);
43395             test_ret++;
43396             printf(" %d", n_code);
43397             printf("\n");
43398         }
43399     }
43400     function_tests++;
43401 #endif
43402
43403     return(test_ret);
43404 }
43405
43406
43407 static int
43408 test_xmlUCSIsTagbanwa(void) {
43409     int test_ret = 0;
43410
43411 #if defined(LIBXML_UNICODE_ENABLED)
43412     int mem_base;
43413     int ret_val;
43414     int code; /* UCS code point */
43415     int n_code;
43416
43417     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43418         mem_base = xmlMemBlocks();
43419         code = gen_int(n_code, 0);
43420
43421         ret_val = xmlUCSIsTagbanwa(code);
43422         desret_int(ret_val);
43423         call_tests++;
43424         des_int(n_code, code, 0);
43425         xmlResetLastError();
43426         if (mem_base != xmlMemBlocks()) {
43427             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
43428                    xmlMemBlocks() - mem_base);
43429             test_ret++;
43430             printf(" %d", n_code);
43431             printf("\n");
43432         }
43433     }
43434     function_tests++;
43435 #endif
43436
43437     return(test_ret);
43438 }
43439
43440
43441 static int
43442 test_xmlUCSIsTags(void) {
43443     int test_ret = 0;
43444
43445 #if defined(LIBXML_UNICODE_ENABLED)
43446     int mem_base;
43447     int ret_val;
43448     int code; /* UCS code point */
43449     int n_code;
43450
43451     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43452         mem_base = xmlMemBlocks();
43453         code = gen_int(n_code, 0);
43454
43455         ret_val = xmlUCSIsTags(code);
43456         desret_int(ret_val);
43457         call_tests++;
43458         des_int(n_code, code, 0);
43459         xmlResetLastError();
43460         if (mem_base != xmlMemBlocks()) {
43461             printf("Leak of %d blocks found in xmlUCSIsTags",
43462                    xmlMemBlocks() - mem_base);
43463             test_ret++;
43464             printf(" %d", n_code);
43465             printf("\n");
43466         }
43467     }
43468     function_tests++;
43469 #endif
43470
43471     return(test_ret);
43472 }
43473
43474
43475 static int
43476 test_xmlUCSIsTaiLe(void) {
43477     int test_ret = 0;
43478
43479 #if defined(LIBXML_UNICODE_ENABLED)
43480     int mem_base;
43481     int ret_val;
43482     int code; /* UCS code point */
43483     int n_code;
43484
43485     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43486         mem_base = xmlMemBlocks();
43487         code = gen_int(n_code, 0);
43488
43489         ret_val = xmlUCSIsTaiLe(code);
43490         desret_int(ret_val);
43491         call_tests++;
43492         des_int(n_code, code, 0);
43493         xmlResetLastError();
43494         if (mem_base != xmlMemBlocks()) {
43495             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
43496                    xmlMemBlocks() - mem_base);
43497             test_ret++;
43498             printf(" %d", n_code);
43499             printf("\n");
43500         }
43501     }
43502     function_tests++;
43503 #endif
43504
43505     return(test_ret);
43506 }
43507
43508
43509 static int
43510 test_xmlUCSIsTaiXuanJingSymbols(void) {
43511     int test_ret = 0;
43512
43513 #if defined(LIBXML_UNICODE_ENABLED)
43514     int mem_base;
43515     int ret_val;
43516     int code; /* UCS code point */
43517     int n_code;
43518
43519     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43520         mem_base = xmlMemBlocks();
43521         code = gen_int(n_code, 0);
43522
43523         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
43524         desret_int(ret_val);
43525         call_tests++;
43526         des_int(n_code, code, 0);
43527         xmlResetLastError();
43528         if (mem_base != xmlMemBlocks()) {
43529             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
43530                    xmlMemBlocks() - mem_base);
43531             test_ret++;
43532             printf(" %d", n_code);
43533             printf("\n");
43534         }
43535     }
43536     function_tests++;
43537 #endif
43538
43539     return(test_ret);
43540 }
43541
43542
43543 static int
43544 test_xmlUCSIsTamil(void) {
43545     int test_ret = 0;
43546
43547 #if defined(LIBXML_UNICODE_ENABLED)
43548     int mem_base;
43549     int ret_val;
43550     int code; /* UCS code point */
43551     int n_code;
43552
43553     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43554         mem_base = xmlMemBlocks();
43555         code = gen_int(n_code, 0);
43556
43557         ret_val = xmlUCSIsTamil(code);
43558         desret_int(ret_val);
43559         call_tests++;
43560         des_int(n_code, code, 0);
43561         xmlResetLastError();
43562         if (mem_base != xmlMemBlocks()) {
43563             printf("Leak of %d blocks found in xmlUCSIsTamil",
43564                    xmlMemBlocks() - mem_base);
43565             test_ret++;
43566             printf(" %d", n_code);
43567             printf("\n");
43568         }
43569     }
43570     function_tests++;
43571 #endif
43572
43573     return(test_ret);
43574 }
43575
43576
43577 static int
43578 test_xmlUCSIsTelugu(void) {
43579     int test_ret = 0;
43580
43581 #if defined(LIBXML_UNICODE_ENABLED)
43582     int mem_base;
43583     int ret_val;
43584     int code; /* UCS code point */
43585     int n_code;
43586
43587     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43588         mem_base = xmlMemBlocks();
43589         code = gen_int(n_code, 0);
43590
43591         ret_val = xmlUCSIsTelugu(code);
43592         desret_int(ret_val);
43593         call_tests++;
43594         des_int(n_code, code, 0);
43595         xmlResetLastError();
43596         if (mem_base != xmlMemBlocks()) {
43597             printf("Leak of %d blocks found in xmlUCSIsTelugu",
43598                    xmlMemBlocks() - mem_base);
43599             test_ret++;
43600             printf(" %d", n_code);
43601             printf("\n");
43602         }
43603     }
43604     function_tests++;
43605 #endif
43606
43607     return(test_ret);
43608 }
43609
43610
43611 static int
43612 test_xmlUCSIsThaana(void) {
43613     int test_ret = 0;
43614
43615 #if defined(LIBXML_UNICODE_ENABLED)
43616     int mem_base;
43617     int ret_val;
43618     int code; /* UCS code point */
43619     int n_code;
43620
43621     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43622         mem_base = xmlMemBlocks();
43623         code = gen_int(n_code, 0);
43624
43625         ret_val = xmlUCSIsThaana(code);
43626         desret_int(ret_val);
43627         call_tests++;
43628         des_int(n_code, code, 0);
43629         xmlResetLastError();
43630         if (mem_base != xmlMemBlocks()) {
43631             printf("Leak of %d blocks found in xmlUCSIsThaana",
43632                    xmlMemBlocks() - mem_base);
43633             test_ret++;
43634             printf(" %d", n_code);
43635             printf("\n");
43636         }
43637     }
43638     function_tests++;
43639 #endif
43640
43641     return(test_ret);
43642 }
43643
43644
43645 static int
43646 test_xmlUCSIsThai(void) {
43647     int test_ret = 0;
43648
43649 #if defined(LIBXML_UNICODE_ENABLED)
43650     int mem_base;
43651     int ret_val;
43652     int code; /* UCS code point */
43653     int n_code;
43654
43655     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43656         mem_base = xmlMemBlocks();
43657         code = gen_int(n_code, 0);
43658
43659         ret_val = xmlUCSIsThai(code);
43660         desret_int(ret_val);
43661         call_tests++;
43662         des_int(n_code, code, 0);
43663         xmlResetLastError();
43664         if (mem_base != xmlMemBlocks()) {
43665             printf("Leak of %d blocks found in xmlUCSIsThai",
43666                    xmlMemBlocks() - mem_base);
43667             test_ret++;
43668             printf(" %d", n_code);
43669             printf("\n");
43670         }
43671     }
43672     function_tests++;
43673 #endif
43674
43675     return(test_ret);
43676 }
43677
43678
43679 static int
43680 test_xmlUCSIsTibetan(void) {
43681     int test_ret = 0;
43682
43683 #if defined(LIBXML_UNICODE_ENABLED)
43684     int mem_base;
43685     int ret_val;
43686     int code; /* UCS code point */
43687     int n_code;
43688
43689     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43690         mem_base = xmlMemBlocks();
43691         code = gen_int(n_code, 0);
43692
43693         ret_val = xmlUCSIsTibetan(code);
43694         desret_int(ret_val);
43695         call_tests++;
43696         des_int(n_code, code, 0);
43697         xmlResetLastError();
43698         if (mem_base != xmlMemBlocks()) {
43699             printf("Leak of %d blocks found in xmlUCSIsTibetan",
43700                    xmlMemBlocks() - mem_base);
43701             test_ret++;
43702             printf(" %d", n_code);
43703             printf("\n");
43704         }
43705     }
43706     function_tests++;
43707 #endif
43708
43709     return(test_ret);
43710 }
43711
43712
43713 static int
43714 test_xmlUCSIsUgaritic(void) {
43715     int test_ret = 0;
43716
43717 #if defined(LIBXML_UNICODE_ENABLED)
43718     int mem_base;
43719     int ret_val;
43720     int code; /* UCS code point */
43721     int n_code;
43722
43723     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43724         mem_base = xmlMemBlocks();
43725         code = gen_int(n_code, 0);
43726
43727         ret_val = xmlUCSIsUgaritic(code);
43728         desret_int(ret_val);
43729         call_tests++;
43730         des_int(n_code, code, 0);
43731         xmlResetLastError();
43732         if (mem_base != xmlMemBlocks()) {
43733             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
43734                    xmlMemBlocks() - mem_base);
43735             test_ret++;
43736             printf(" %d", n_code);
43737             printf("\n");
43738         }
43739     }
43740     function_tests++;
43741 #endif
43742
43743     return(test_ret);
43744 }
43745
43746
43747 static int
43748 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
43749     int test_ret = 0;
43750
43751 #if defined(LIBXML_UNICODE_ENABLED)
43752     int mem_base;
43753     int ret_val;
43754     int code; /* UCS code point */
43755     int n_code;
43756
43757     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43758         mem_base = xmlMemBlocks();
43759         code = gen_int(n_code, 0);
43760
43761         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
43762         desret_int(ret_val);
43763         call_tests++;
43764         des_int(n_code, code, 0);
43765         xmlResetLastError();
43766         if (mem_base != xmlMemBlocks()) {
43767             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
43768                    xmlMemBlocks() - mem_base);
43769             test_ret++;
43770             printf(" %d", n_code);
43771             printf("\n");
43772         }
43773     }
43774     function_tests++;
43775 #endif
43776
43777     return(test_ret);
43778 }
43779
43780
43781 static int
43782 test_xmlUCSIsVariationSelectors(void) {
43783     int test_ret = 0;
43784
43785 #if defined(LIBXML_UNICODE_ENABLED)
43786     int mem_base;
43787     int ret_val;
43788     int code; /* UCS code point */
43789     int n_code;
43790
43791     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43792         mem_base = xmlMemBlocks();
43793         code = gen_int(n_code, 0);
43794
43795         ret_val = xmlUCSIsVariationSelectors(code);
43796         desret_int(ret_val);
43797         call_tests++;
43798         des_int(n_code, code, 0);
43799         xmlResetLastError();
43800         if (mem_base != xmlMemBlocks()) {
43801             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
43802                    xmlMemBlocks() - mem_base);
43803             test_ret++;
43804             printf(" %d", n_code);
43805             printf("\n");
43806         }
43807     }
43808     function_tests++;
43809 #endif
43810
43811     return(test_ret);
43812 }
43813
43814
43815 static int
43816 test_xmlUCSIsVariationSelectorsSupplement(void) {
43817     int test_ret = 0;
43818
43819 #if defined(LIBXML_UNICODE_ENABLED)
43820     int mem_base;
43821     int ret_val;
43822     int code; /* UCS code point */
43823     int n_code;
43824
43825     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43826         mem_base = xmlMemBlocks();
43827         code = gen_int(n_code, 0);
43828
43829         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
43830         desret_int(ret_val);
43831         call_tests++;
43832         des_int(n_code, code, 0);
43833         xmlResetLastError();
43834         if (mem_base != xmlMemBlocks()) {
43835             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
43836                    xmlMemBlocks() - mem_base);
43837             test_ret++;
43838             printf(" %d", n_code);
43839             printf("\n");
43840         }
43841     }
43842     function_tests++;
43843 #endif
43844
43845     return(test_ret);
43846 }
43847
43848
43849 static int
43850 test_xmlUCSIsYiRadicals(void) {
43851     int test_ret = 0;
43852
43853 #if defined(LIBXML_UNICODE_ENABLED)
43854     int mem_base;
43855     int ret_val;
43856     int code; /* UCS code point */
43857     int n_code;
43858
43859     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43860         mem_base = xmlMemBlocks();
43861         code = gen_int(n_code, 0);
43862
43863         ret_val = xmlUCSIsYiRadicals(code);
43864         desret_int(ret_val);
43865         call_tests++;
43866         des_int(n_code, code, 0);
43867         xmlResetLastError();
43868         if (mem_base != xmlMemBlocks()) {
43869             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
43870                    xmlMemBlocks() - mem_base);
43871             test_ret++;
43872             printf(" %d", n_code);
43873             printf("\n");
43874         }
43875     }
43876     function_tests++;
43877 #endif
43878
43879     return(test_ret);
43880 }
43881
43882
43883 static int
43884 test_xmlUCSIsYiSyllables(void) {
43885     int test_ret = 0;
43886
43887 #if defined(LIBXML_UNICODE_ENABLED)
43888     int mem_base;
43889     int ret_val;
43890     int code; /* UCS code point */
43891     int n_code;
43892
43893     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43894         mem_base = xmlMemBlocks();
43895         code = gen_int(n_code, 0);
43896
43897         ret_val = xmlUCSIsYiSyllables(code);
43898         desret_int(ret_val);
43899         call_tests++;
43900         des_int(n_code, code, 0);
43901         xmlResetLastError();
43902         if (mem_base != xmlMemBlocks()) {
43903             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
43904                    xmlMemBlocks() - mem_base);
43905             test_ret++;
43906             printf(" %d", n_code);
43907             printf("\n");
43908         }
43909     }
43910     function_tests++;
43911 #endif
43912
43913     return(test_ret);
43914 }
43915
43916
43917 static int
43918 test_xmlUCSIsYijingHexagramSymbols(void) {
43919     int test_ret = 0;
43920
43921 #if defined(LIBXML_UNICODE_ENABLED)
43922     int mem_base;
43923     int ret_val;
43924     int code; /* UCS code point */
43925     int n_code;
43926
43927     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43928         mem_base = xmlMemBlocks();
43929         code = gen_int(n_code, 0);
43930
43931         ret_val = xmlUCSIsYijingHexagramSymbols(code);
43932         desret_int(ret_val);
43933         call_tests++;
43934         des_int(n_code, code, 0);
43935         xmlResetLastError();
43936         if (mem_base != xmlMemBlocks()) {
43937             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
43938                    xmlMemBlocks() - mem_base);
43939             test_ret++;
43940             printf(" %d", n_code);
43941             printf("\n");
43942         }
43943     }
43944     function_tests++;
43945 #endif
43946
43947     return(test_ret);
43948 }
43949
43950 static int
43951 test_xmlunicode(void) {
43952     int test_ret = 0;
43953         int rc = 0;
43954
43955     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
43956     rc = test_xmlUCSIsAegeanNumbers();
43957         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43958     rc = test_xmlUCSIsAlphabeticPresentationForms();
43959         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43960     rc = test_xmlUCSIsArabic();
43961         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43962     rc = test_xmlUCSIsArabicPresentationFormsA();
43963         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43964     rc = test_xmlUCSIsArabicPresentationFormsB();
43965         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43966     rc = test_xmlUCSIsArmenian();
43967         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43968     rc = test_xmlUCSIsArrows();
43969         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43970     rc = test_xmlUCSIsBasicLatin();
43971         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43972     rc = test_xmlUCSIsBengali();
43973         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43974     rc = test_xmlUCSIsBlock();
43975         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43976     rc = test_xmlUCSIsBlockElements();
43977         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43978     rc = test_xmlUCSIsBopomofo();
43979         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43980     rc = test_xmlUCSIsBopomofoExtended();
43981         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43982     rc = test_xmlUCSIsBoxDrawing();
43983         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43984     rc = test_xmlUCSIsBraillePatterns();
43985         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43986     rc = test_xmlUCSIsBuhid();
43987         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43988     rc = test_xmlUCSIsByzantineMusicalSymbols();
43989         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43990     rc = test_xmlUCSIsCJKCompatibility();
43991         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43992     rc = test_xmlUCSIsCJKCompatibilityForms();
43993         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43994     rc = test_xmlUCSIsCJKCompatibilityIdeographs();
43995         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43996     rc = test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
43997         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
43998     rc = test_xmlUCSIsCJKRadicalsSupplement();
43999         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44000     rc = test_xmlUCSIsCJKSymbolsandPunctuation();
44001         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44002     rc = test_xmlUCSIsCJKUnifiedIdeographs();
44003         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44004     rc = test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
44005         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44006     rc = test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
44007         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44008     rc = test_xmlUCSIsCat();
44009         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44010     rc = test_xmlUCSIsCatC();
44011         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44012     rc = test_xmlUCSIsCatCc();
44013         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44014     rc = test_xmlUCSIsCatCf();
44015         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44016     rc = test_xmlUCSIsCatCo();
44017         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44018     rc = test_xmlUCSIsCatCs();
44019         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44020     rc = test_xmlUCSIsCatL();
44021         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44022     rc = test_xmlUCSIsCatLl();
44023         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44024     rc = test_xmlUCSIsCatLm();
44025         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44026     rc = test_xmlUCSIsCatLo();
44027         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44028     rc = test_xmlUCSIsCatLt();
44029         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44030     rc = test_xmlUCSIsCatLu();
44031         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44032     rc = test_xmlUCSIsCatM();
44033         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44034     rc = test_xmlUCSIsCatMc();
44035         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44036     rc = test_xmlUCSIsCatMe();
44037         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44038     rc = test_xmlUCSIsCatMn();
44039         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44040     rc = test_xmlUCSIsCatN();
44041         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44042     rc = test_xmlUCSIsCatNd();
44043         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44044     rc = test_xmlUCSIsCatNl();
44045         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44046     rc = test_xmlUCSIsCatNo();
44047         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44048     rc = test_xmlUCSIsCatP();
44049         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44050     rc = test_xmlUCSIsCatPc();
44051         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44052     rc = test_xmlUCSIsCatPd();
44053         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44054     rc = test_xmlUCSIsCatPe();
44055         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44056     rc = test_xmlUCSIsCatPf();
44057         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44058     rc = test_xmlUCSIsCatPi();
44059         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44060     rc = test_xmlUCSIsCatPo();
44061         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44062     rc = test_xmlUCSIsCatPs();
44063         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44064     rc = test_xmlUCSIsCatS();
44065         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44066     rc = test_xmlUCSIsCatSc();
44067         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44068     rc = test_xmlUCSIsCatSk();
44069         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44070     rc = test_xmlUCSIsCatSm();
44071         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44072     rc = test_xmlUCSIsCatSo();
44073         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44074     rc = test_xmlUCSIsCatZ();
44075         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44076     rc = test_xmlUCSIsCatZl();
44077         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44078     rc = test_xmlUCSIsCatZp();
44079         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44080     rc = test_xmlUCSIsCatZs();
44081         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44082     rc = test_xmlUCSIsCherokee();
44083         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44084     rc = test_xmlUCSIsCombiningDiacriticalMarks();
44085         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44086     rc = test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
44087         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44088     rc = test_xmlUCSIsCombiningHalfMarks();
44089         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44090     rc = test_xmlUCSIsCombiningMarksforSymbols();
44091         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44092     rc = test_xmlUCSIsControlPictures();
44093         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44094     rc = test_xmlUCSIsCurrencySymbols();
44095         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44096     rc = test_xmlUCSIsCypriotSyllabary();
44097         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44098     rc = test_xmlUCSIsCyrillic();
44099         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44100     rc = test_xmlUCSIsCyrillicSupplement();
44101         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44102     rc = test_xmlUCSIsDeseret();
44103         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44104     rc = test_xmlUCSIsDevanagari();
44105         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44106     rc = test_xmlUCSIsDingbats();
44107         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44108     rc = test_xmlUCSIsEnclosedAlphanumerics();
44109         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44110     rc = test_xmlUCSIsEnclosedCJKLettersandMonths();
44111         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44112     rc = test_xmlUCSIsEthiopic();
44113         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44114     rc = test_xmlUCSIsGeneralPunctuation();
44115         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44116     rc = test_xmlUCSIsGeometricShapes();
44117         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44118     rc = test_xmlUCSIsGeorgian();
44119         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44120     rc = test_xmlUCSIsGothic();
44121         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44122     rc = test_xmlUCSIsGreek();
44123         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44124     rc = test_xmlUCSIsGreekExtended();
44125         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44126     rc = test_xmlUCSIsGreekandCoptic();
44127         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44128     rc = test_xmlUCSIsGujarati();
44129         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44130     rc = test_xmlUCSIsGurmukhi();
44131         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44132     rc = test_xmlUCSIsHalfwidthandFullwidthForms();
44133         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44134     rc = test_xmlUCSIsHangulCompatibilityJamo();
44135         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44136     rc = test_xmlUCSIsHangulJamo();
44137         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44138     rc = test_xmlUCSIsHangulSyllables();
44139         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44140     rc = test_xmlUCSIsHanunoo();
44141         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44142     rc = test_xmlUCSIsHebrew();
44143         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44144     rc = test_xmlUCSIsHighPrivateUseSurrogates();
44145         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44146     rc = test_xmlUCSIsHighSurrogates();
44147         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44148     rc = test_xmlUCSIsHiragana();
44149         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44150     rc = test_xmlUCSIsIPAExtensions();
44151         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44152     rc = test_xmlUCSIsIdeographicDescriptionCharacters();
44153         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44154     rc = test_xmlUCSIsKanbun();
44155         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44156     rc = test_xmlUCSIsKangxiRadicals();
44157         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44158     rc = test_xmlUCSIsKannada();
44159         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44160     rc = test_xmlUCSIsKatakana();
44161         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44162     rc = test_xmlUCSIsKatakanaPhoneticExtensions();
44163         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44164     rc = test_xmlUCSIsKhmer();
44165         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44166     rc = test_xmlUCSIsKhmerSymbols();
44167         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44168     rc = test_xmlUCSIsLao();
44169         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44170     rc = test_xmlUCSIsLatin1Supplement();
44171         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44172     rc = test_xmlUCSIsLatinExtendedA();
44173         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44174     rc = test_xmlUCSIsLatinExtendedAdditional();
44175         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44176     rc = test_xmlUCSIsLatinExtendedB();
44177         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44178     rc = test_xmlUCSIsLetterlikeSymbols();
44179         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44180     rc = test_xmlUCSIsLimbu();
44181         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44182     rc = test_xmlUCSIsLinearBIdeograms();
44183         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44184     rc = test_xmlUCSIsLinearBSyllabary();
44185         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44186     rc = test_xmlUCSIsLowSurrogates();
44187         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44188     rc = test_xmlUCSIsMalayalam();
44189         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44190     rc = test_xmlUCSIsMathematicalAlphanumericSymbols();
44191         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44192     rc = test_xmlUCSIsMathematicalOperators();
44193         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44194     rc = test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
44195         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44196     rc = test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
44197         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44198     rc = test_xmlUCSIsMiscellaneousSymbols();
44199         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44200     rc = test_xmlUCSIsMiscellaneousSymbolsandArrows();
44201         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44202     rc = test_xmlUCSIsMiscellaneousTechnical();
44203         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44204     rc = test_xmlUCSIsMongolian();
44205         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44206     rc = test_xmlUCSIsMusicalSymbols();
44207         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44208     rc = test_xmlUCSIsMyanmar();
44209         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44210     rc = test_xmlUCSIsNumberForms();
44211         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44212     rc = test_xmlUCSIsOgham();
44213         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44214     rc = test_xmlUCSIsOldItalic();
44215         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44216     rc = test_xmlUCSIsOpticalCharacterRecognition();
44217         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44218     rc = test_xmlUCSIsOriya();
44219         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44220     rc = test_xmlUCSIsOsmanya();
44221         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44222     rc = test_xmlUCSIsPhoneticExtensions();
44223         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44224     rc = test_xmlUCSIsPrivateUse();
44225         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44226     rc = test_xmlUCSIsPrivateUseArea();
44227         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44228     rc = test_xmlUCSIsRunic();
44229         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44230     rc = test_xmlUCSIsShavian();
44231         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44232     rc = test_xmlUCSIsSinhala();
44233         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44234     rc = test_xmlUCSIsSmallFormVariants();
44235         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44236     rc = test_xmlUCSIsSpacingModifierLetters();
44237         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44238     rc = test_xmlUCSIsSpecials();
44239         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44240     rc = test_xmlUCSIsSuperscriptsandSubscripts();
44241         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44242     rc = test_xmlUCSIsSupplementalArrowsA();
44243         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44244     rc = test_xmlUCSIsSupplementalArrowsB();
44245         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44246     rc = test_xmlUCSIsSupplementalMathematicalOperators();
44247         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44248     rc = test_xmlUCSIsSupplementaryPrivateUseAreaA();
44249         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44250     rc = test_xmlUCSIsSupplementaryPrivateUseAreaB();
44251         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44252     rc = test_xmlUCSIsSyriac();
44253         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44254     rc = test_xmlUCSIsTagalog();
44255         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44256     rc = test_xmlUCSIsTagbanwa();
44257         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44258     rc = test_xmlUCSIsTags();
44259         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44260     rc = test_xmlUCSIsTaiLe();
44261         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44262     rc = test_xmlUCSIsTaiXuanJingSymbols();
44263         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44264     rc = test_xmlUCSIsTamil();
44265         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44266     rc = test_xmlUCSIsTelugu();
44267         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44268     rc = test_xmlUCSIsThaana();
44269         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44270     rc = test_xmlUCSIsThai();
44271         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44272     rc = test_xmlUCSIsTibetan();
44273         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44274     rc = test_xmlUCSIsUgaritic();
44275         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44276     rc = test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
44277         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44278     rc = test_xmlUCSIsVariationSelectors();
44279         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44280     rc = test_xmlUCSIsVariationSelectorsSupplement();
44281         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44282     rc = test_xmlUCSIsYiRadicals();
44283         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44284     rc = test_xmlUCSIsYiSyllables();
44285         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44286     rc = test_xmlUCSIsYijingHexagramSymbols();
44287         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44288
44289     if (test_ret != 0)
44290         printf("Module xmlunicode: %d errors\n", test_ret);
44291     return(test_ret);
44292 }
44293
44294 static int
44295 test_xmlNewTextWriter(void) {
44296     int test_ret = 0;
44297
44298 #if defined(LIBXML_WRITER_ENABLED)
44299     int mem_base;
44300     xmlTextWriterPtr ret_val;
44301     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
44302     int n_out;
44303
44304     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
44305         mem_base = xmlMemBlocks();
44306         out = gen_xmlOutputBufferPtr(n_out, 0);
44307
44308         ret_val = xmlNewTextWriter(out);
44309         if (ret_val != NULL) out = NULL;
44310         desret_xmlTextWriterPtr(ret_val);
44311         call_tests++;
44312         des_xmlOutputBufferPtr(n_out, out, 0);
44313         xmlResetLastError();
44314         if (mem_base != xmlMemBlocks()) {
44315             printf("Leak of %d blocks found in xmlNewTextWriter",
44316                    xmlMemBlocks() - mem_base);
44317             test_ret++;
44318             printf(" %d", n_out);
44319             printf("\n");
44320         }
44321     }
44322     function_tests++;
44323 #endif
44324
44325     return(test_ret);
44326 }
44327
44328
44329 static int
44330 test_xmlNewTextWriterFilename(void) {
44331     int test_ret = 0;
44332
44333 #if defined(LIBXML_WRITER_ENABLED)
44334     int mem_base;
44335     xmlTextWriterPtr ret_val;
44336     const char * uri; /* the URI of the resource for the output */
44337     int n_uri;
44338     int compression; /* compress the output? */
44339     int n_compression;
44340
44341     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
44342     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
44343         mem_base = xmlMemBlocks();
44344         uri = gen_fileoutput(n_uri, 0);
44345         compression = gen_int(n_compression, 1);
44346
44347         ret_val = xmlNewTextWriterFilename(uri, compression);
44348         desret_xmlTextWriterPtr(ret_val);
44349         call_tests++;
44350         des_fileoutput(n_uri, uri, 0);
44351         des_int(n_compression, compression, 1);
44352         xmlResetLastError();
44353         if (mem_base != xmlMemBlocks()) {
44354             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
44355                    xmlMemBlocks() - mem_base);
44356             test_ret++;
44357             printf(" %d", n_uri);
44358             printf(" %d", n_compression);
44359             printf("\n");
44360         }
44361     }
44362     }
44363     function_tests++;
44364 #endif
44365
44366     return(test_ret);
44367 }
44368
44369
44370 static int
44371 test_xmlNewTextWriterMemory(void) {
44372     int test_ret = 0;
44373
44374 #if defined(LIBXML_WRITER_ENABLED)
44375     int mem_base;
44376     xmlTextWriterPtr ret_val;
44377     xmlBufferPtr buf; /* xmlBufferPtr */
44378     int n_buf;
44379     int compression; /* compress the output? */
44380     int n_compression;
44381
44382     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
44383     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
44384         mem_base = xmlMemBlocks();
44385         buf = gen_xmlBufferPtr(n_buf, 0);
44386         compression = gen_int(n_compression, 1);
44387
44388         ret_val = xmlNewTextWriterMemory(buf, compression);
44389         desret_xmlTextWriterPtr(ret_val);
44390         call_tests++;
44391         des_xmlBufferPtr(n_buf, buf, 0);
44392         des_int(n_compression, compression, 1);
44393         xmlResetLastError();
44394         if (mem_base != xmlMemBlocks()) {
44395             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
44396                    xmlMemBlocks() - mem_base);
44397             test_ret++;
44398             printf(" %d", n_buf);
44399             printf(" %d", n_compression);
44400             printf("\n");
44401         }
44402     }
44403     }
44404     function_tests++;
44405 #endif
44406
44407     return(test_ret);
44408 }
44409
44410
44411 static int
44412 test_xmlNewTextWriterPushParser(void) {
44413     int test_ret = 0;
44414
44415 #if defined(LIBXML_WRITER_ENABLED)
44416     int mem_base;
44417     xmlTextWriterPtr ret_val;
44418     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
44419     int n_ctxt;
44420     int compression; /* compress the output? */
44421     int n_compression;
44422
44423     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
44424     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
44425         mem_base = xmlMemBlocks();
44426         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
44427         compression = gen_int(n_compression, 1);
44428
44429         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
44430         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
44431         desret_xmlTextWriterPtr(ret_val);
44432         call_tests++;
44433         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
44434         des_int(n_compression, compression, 1);
44435         xmlResetLastError();
44436         if (mem_base != xmlMemBlocks()) {
44437             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
44438                    xmlMemBlocks() - mem_base);
44439             test_ret++;
44440             printf(" %d", n_ctxt);
44441             printf(" %d", n_compression);
44442             printf("\n");
44443         }
44444     }
44445     }
44446     function_tests++;
44447 #endif
44448
44449     return(test_ret);
44450 }
44451
44452
44453 static int
44454 test_xmlNewTextWriterTree(void) {
44455     int test_ret = 0;
44456
44457 #if defined(LIBXML_WRITER_ENABLED)
44458     int mem_base;
44459     xmlTextWriterPtr ret_val;
44460     xmlDocPtr doc; /* xmlDocPtr */
44461     int n_doc;
44462     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
44463     int n_node;
44464     int compression; /* compress the output? */
44465     int n_compression;
44466
44467     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
44468     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
44469     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
44470         mem_base = xmlMemBlocks();
44471         doc = gen_xmlDocPtr(n_doc, 0);
44472         node = gen_xmlNodePtr(n_node, 1);
44473         compression = gen_int(n_compression, 2);
44474
44475         ret_val = xmlNewTextWriterTree(doc, node, compression);
44476         desret_xmlTextWriterPtr(ret_val);
44477         call_tests++;
44478         des_xmlDocPtr(n_doc, doc, 0);
44479         des_xmlNodePtr(n_node, node, 1);
44480         des_int(n_compression, compression, 2);
44481         xmlResetLastError();
44482         if (mem_base != xmlMemBlocks()) {
44483             printf("Leak of %d blocks found in xmlNewTextWriterTree",
44484                    xmlMemBlocks() - mem_base);
44485             test_ret++;
44486             printf(" %d", n_doc);
44487             printf(" %d", n_node);
44488             printf(" %d", n_compression);
44489             printf("\n");
44490         }
44491     }
44492     }
44493     }
44494     function_tests++;
44495 #endif
44496
44497     return(test_ret);
44498 }
44499
44500
44501 static int
44502 test_xmlTextWriterEndAttribute(void) {
44503     int test_ret = 0;
44504
44505 #if defined(LIBXML_WRITER_ENABLED)
44506     int mem_base;
44507     int ret_val;
44508     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44509     int n_writer;
44510
44511     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44512         mem_base = xmlMemBlocks();
44513         writer = gen_xmlTextWriterPtr(n_writer, 0);
44514
44515         ret_val = xmlTextWriterEndAttribute(writer);
44516         desret_int(ret_val);
44517         call_tests++;
44518         des_xmlTextWriterPtr(n_writer, writer, 0);
44519         xmlResetLastError();
44520         if (mem_base != xmlMemBlocks()) {
44521             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
44522                    xmlMemBlocks() - mem_base);
44523             test_ret++;
44524             printf(" %d", n_writer);
44525             printf("\n");
44526         }
44527     }
44528     function_tests++;
44529 #endif
44530
44531     return(test_ret);
44532 }
44533
44534
44535 static int
44536 test_xmlTextWriterEndCDATA(void) {
44537     int test_ret = 0;
44538
44539 #if defined(LIBXML_WRITER_ENABLED)
44540     int mem_base;
44541     int ret_val;
44542     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44543     int n_writer;
44544
44545     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44546         mem_base = xmlMemBlocks();
44547         writer = gen_xmlTextWriterPtr(n_writer, 0);
44548
44549         ret_val = xmlTextWriterEndCDATA(writer);
44550         desret_int(ret_val);
44551         call_tests++;
44552         des_xmlTextWriterPtr(n_writer, writer, 0);
44553         xmlResetLastError();
44554         if (mem_base != xmlMemBlocks()) {
44555             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
44556                    xmlMemBlocks() - mem_base);
44557             test_ret++;
44558             printf(" %d", n_writer);
44559             printf("\n");
44560         }
44561     }
44562     function_tests++;
44563 #endif
44564
44565     return(test_ret);
44566 }
44567
44568
44569 static int
44570 test_xmlTextWriterEndComment(void) {
44571     int test_ret = 0;
44572
44573 #if defined(LIBXML_WRITER_ENABLED)
44574     int mem_base;
44575     int ret_val;
44576     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44577     int n_writer;
44578
44579     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44580         mem_base = xmlMemBlocks();
44581         writer = gen_xmlTextWriterPtr(n_writer, 0);
44582
44583         ret_val = xmlTextWriterEndComment(writer);
44584         desret_int(ret_val);
44585         call_tests++;
44586         des_xmlTextWriterPtr(n_writer, writer, 0);
44587         xmlResetLastError();
44588         if (mem_base != xmlMemBlocks()) {
44589             printf("Leak of %d blocks found in xmlTextWriterEndComment",
44590                    xmlMemBlocks() - mem_base);
44591             test_ret++;
44592             printf(" %d", n_writer);
44593             printf("\n");
44594         }
44595     }
44596     function_tests++;
44597 #endif
44598
44599     return(test_ret);
44600 }
44601
44602
44603 static int
44604 test_xmlTextWriterEndDTD(void) {
44605     int test_ret = 0;
44606
44607 #if defined(LIBXML_WRITER_ENABLED)
44608     int mem_base;
44609     int ret_val;
44610     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44611     int n_writer;
44612
44613     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44614         mem_base = xmlMemBlocks();
44615         writer = gen_xmlTextWriterPtr(n_writer, 0);
44616
44617         ret_val = xmlTextWriterEndDTD(writer);
44618         desret_int(ret_val);
44619         call_tests++;
44620         des_xmlTextWriterPtr(n_writer, writer, 0);
44621         xmlResetLastError();
44622         if (mem_base != xmlMemBlocks()) {
44623             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
44624                    xmlMemBlocks() - mem_base);
44625             test_ret++;
44626             printf(" %d", n_writer);
44627             printf("\n");
44628         }
44629     }
44630     function_tests++;
44631 #endif
44632
44633     return(test_ret);
44634 }
44635
44636
44637 static int
44638 test_xmlTextWriterEndDTDAttlist(void) {
44639     int test_ret = 0;
44640
44641 #if defined(LIBXML_WRITER_ENABLED)
44642     int mem_base;
44643     int ret_val;
44644     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44645     int n_writer;
44646
44647     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44648         mem_base = xmlMemBlocks();
44649         writer = gen_xmlTextWriterPtr(n_writer, 0);
44650
44651         ret_val = xmlTextWriterEndDTDAttlist(writer);
44652         desret_int(ret_val);
44653         call_tests++;
44654         des_xmlTextWriterPtr(n_writer, writer, 0);
44655         xmlResetLastError();
44656         if (mem_base != xmlMemBlocks()) {
44657             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
44658                    xmlMemBlocks() - mem_base);
44659             test_ret++;
44660             printf(" %d", n_writer);
44661             printf("\n");
44662         }
44663     }
44664     function_tests++;
44665 #endif
44666
44667     return(test_ret);
44668 }
44669
44670
44671 static int
44672 test_xmlTextWriterEndDTDElement(void) {
44673     int test_ret = 0;
44674
44675 #if defined(LIBXML_WRITER_ENABLED)
44676     int mem_base;
44677     int ret_val;
44678     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44679     int n_writer;
44680
44681     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44682         mem_base = xmlMemBlocks();
44683         writer = gen_xmlTextWriterPtr(n_writer, 0);
44684
44685         ret_val = xmlTextWriterEndDTDElement(writer);
44686         desret_int(ret_val);
44687         call_tests++;
44688         des_xmlTextWriterPtr(n_writer, writer, 0);
44689         xmlResetLastError();
44690         if (mem_base != xmlMemBlocks()) {
44691             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
44692                    xmlMemBlocks() - mem_base);
44693             test_ret++;
44694             printf(" %d", n_writer);
44695             printf("\n");
44696         }
44697     }
44698     function_tests++;
44699 #endif
44700
44701     return(test_ret);
44702 }
44703
44704
44705 static int
44706 test_xmlTextWriterEndDTDEntity(void) {
44707     int test_ret = 0;
44708
44709 #if defined(LIBXML_WRITER_ENABLED)
44710     int mem_base;
44711     int ret_val;
44712     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44713     int n_writer;
44714
44715     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44716         mem_base = xmlMemBlocks();
44717         writer = gen_xmlTextWriterPtr(n_writer, 0);
44718
44719         ret_val = xmlTextWriterEndDTDEntity(writer);
44720         desret_int(ret_val);
44721         call_tests++;
44722         des_xmlTextWriterPtr(n_writer, writer, 0);
44723         xmlResetLastError();
44724         if (mem_base != xmlMemBlocks()) {
44725             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
44726                    xmlMemBlocks() - mem_base);
44727             test_ret++;
44728             printf(" %d", n_writer);
44729             printf("\n");
44730         }
44731     }
44732     function_tests++;
44733 #endif
44734
44735     return(test_ret);
44736 }
44737
44738
44739 static int
44740 test_xmlTextWriterEndDocument(void) {
44741     int test_ret = 0;
44742
44743 #if defined(LIBXML_WRITER_ENABLED)
44744     int mem_base;
44745     int ret_val;
44746     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44747     int n_writer;
44748
44749     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44750         mem_base = xmlMemBlocks();
44751         writer = gen_xmlTextWriterPtr(n_writer, 0);
44752
44753         ret_val = xmlTextWriterEndDocument(writer);
44754         desret_int(ret_val);
44755         call_tests++;
44756         des_xmlTextWriterPtr(n_writer, writer, 0);
44757         xmlResetLastError();
44758         if (mem_base != xmlMemBlocks()) {
44759             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
44760                    xmlMemBlocks() - mem_base);
44761             test_ret++;
44762             printf(" %d", n_writer);
44763             printf("\n");
44764         }
44765     }
44766     function_tests++;
44767 #endif
44768
44769     return(test_ret);
44770 }
44771
44772
44773 static int
44774 test_xmlTextWriterEndElement(void) {
44775     int test_ret = 0;
44776
44777 #if defined(LIBXML_WRITER_ENABLED)
44778     int mem_base;
44779     int ret_val;
44780     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44781     int n_writer;
44782
44783     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44784         mem_base = xmlMemBlocks();
44785         writer = gen_xmlTextWriterPtr(n_writer, 0);
44786
44787         ret_val = xmlTextWriterEndElement(writer);
44788         desret_int(ret_val);
44789         call_tests++;
44790         des_xmlTextWriterPtr(n_writer, writer, 0);
44791         xmlResetLastError();
44792         if (mem_base != xmlMemBlocks()) {
44793             printf("Leak of %d blocks found in xmlTextWriterEndElement",
44794                    xmlMemBlocks() - mem_base);
44795             test_ret++;
44796             printf(" %d", n_writer);
44797             printf("\n");
44798         }
44799     }
44800     function_tests++;
44801 #endif
44802
44803     return(test_ret);
44804 }
44805
44806
44807 static int
44808 test_xmlTextWriterEndPI(void) {
44809     int test_ret = 0;
44810
44811 #if defined(LIBXML_WRITER_ENABLED)
44812     int mem_base;
44813     int ret_val;
44814     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44815     int n_writer;
44816
44817     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44818         mem_base = xmlMemBlocks();
44819         writer = gen_xmlTextWriterPtr(n_writer, 0);
44820
44821         ret_val = xmlTextWriterEndPI(writer);
44822         desret_int(ret_val);
44823         call_tests++;
44824         des_xmlTextWriterPtr(n_writer, writer, 0);
44825         xmlResetLastError();
44826         if (mem_base != xmlMemBlocks()) {
44827             printf("Leak of %d blocks found in xmlTextWriterEndPI",
44828                    xmlMemBlocks() - mem_base);
44829             test_ret++;
44830             printf(" %d", n_writer);
44831             printf("\n");
44832         }
44833     }
44834     function_tests++;
44835 #endif
44836
44837     return(test_ret);
44838 }
44839
44840
44841 static int
44842 test_xmlTextWriterFlush(void) {
44843     int test_ret = 0;
44844
44845 #if defined(LIBXML_WRITER_ENABLED)
44846     int mem_base;
44847     int ret_val;
44848     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44849     int n_writer;
44850
44851     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44852         mem_base = xmlMemBlocks();
44853         writer = gen_xmlTextWriterPtr(n_writer, 0);
44854
44855         ret_val = xmlTextWriterFlush(writer);
44856         desret_int(ret_val);
44857         call_tests++;
44858         des_xmlTextWriterPtr(n_writer, writer, 0);
44859         xmlResetLastError();
44860         if (mem_base != xmlMemBlocks()) {
44861             printf("Leak of %d blocks found in xmlTextWriterFlush",
44862                    xmlMemBlocks() - mem_base);
44863             test_ret++;
44864             printf(" %d", n_writer);
44865             printf("\n");
44866         }
44867     }
44868     function_tests++;
44869 #endif
44870
44871     return(test_ret);
44872 }
44873
44874
44875 static int
44876 test_xmlTextWriterFullEndElement(void) {
44877     int test_ret = 0;
44878
44879 #if defined(LIBXML_WRITER_ENABLED)
44880     int mem_base;
44881     int ret_val;
44882     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44883     int n_writer;
44884
44885     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44886         mem_base = xmlMemBlocks();
44887         writer = gen_xmlTextWriterPtr(n_writer, 0);
44888
44889         ret_val = xmlTextWriterFullEndElement(writer);
44890         desret_int(ret_val);
44891         call_tests++;
44892         des_xmlTextWriterPtr(n_writer, writer, 0);
44893         xmlResetLastError();
44894         if (mem_base != xmlMemBlocks()) {
44895             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
44896                    xmlMemBlocks() - mem_base);
44897             test_ret++;
44898             printf(" %d", n_writer);
44899             printf("\n");
44900         }
44901     }
44902     function_tests++;
44903 #endif
44904
44905     return(test_ret);
44906 }
44907
44908
44909 static int
44910 test_xmlTextWriterSetIndent(void) {
44911     int test_ret = 0;
44912
44913 #if defined(LIBXML_WRITER_ENABLED)
44914     int mem_base;
44915     int ret_val;
44916     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44917     int n_writer;
44918     int indent; /* do indentation? */
44919     int n_indent;
44920
44921     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44922     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
44923         mem_base = xmlMemBlocks();
44924         writer = gen_xmlTextWriterPtr(n_writer, 0);
44925         indent = gen_int(n_indent, 1);
44926
44927         ret_val = xmlTextWriterSetIndent(writer, indent);
44928         desret_int(ret_val);
44929         call_tests++;
44930         des_xmlTextWriterPtr(n_writer, writer, 0);
44931         des_int(n_indent, indent, 1);
44932         xmlResetLastError();
44933         if (mem_base != xmlMemBlocks()) {
44934             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
44935                    xmlMemBlocks() - mem_base);
44936             test_ret++;
44937             printf(" %d", n_writer);
44938             printf(" %d", n_indent);
44939             printf("\n");
44940         }
44941     }
44942     }
44943     function_tests++;
44944 #endif
44945
44946     return(test_ret);
44947 }
44948
44949
44950 static int
44951 test_xmlTextWriterSetIndentString(void) {
44952     int test_ret = 0;
44953
44954 #if defined(LIBXML_WRITER_ENABLED)
44955     int mem_base;
44956     int ret_val;
44957     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44958     int n_writer;
44959     xmlChar * str; /* the xmlChar string */
44960     int n_str;
44961
44962     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44963     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
44964         mem_base = xmlMemBlocks();
44965         writer = gen_xmlTextWriterPtr(n_writer, 0);
44966         str = gen_const_xmlChar_ptr(n_str, 1);
44967
44968         ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
44969         desret_int(ret_val);
44970         call_tests++;
44971         des_xmlTextWriterPtr(n_writer, writer, 0);
44972         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
44973         xmlResetLastError();
44974         if (mem_base != xmlMemBlocks()) {
44975             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
44976                    xmlMemBlocks() - mem_base);
44977             test_ret++;
44978             printf(" %d", n_writer);
44979             printf(" %d", n_str);
44980             printf("\n");
44981         }
44982     }
44983     }
44984     function_tests++;
44985 #endif
44986
44987     return(test_ret);
44988 }
44989
44990
44991 static int
44992 test_xmlTextWriterSetQuoteChar(void) {
44993     int test_ret = 0;
44994
44995 #if defined(LIBXML_WRITER_ENABLED)
44996     int mem_base;
44997     int ret_val;
44998     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44999     int n_writer;
45000     xmlChar quotechar; /* the quote character */
45001     int n_quotechar;
45002
45003     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45004     for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
45005         mem_base = xmlMemBlocks();
45006         writer = gen_xmlTextWriterPtr(n_writer, 0);
45007         quotechar = gen_xmlChar(n_quotechar, 1);
45008
45009         ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
45010         desret_int(ret_val);
45011         call_tests++;
45012         des_xmlTextWriterPtr(n_writer, writer, 0);
45013         des_xmlChar(n_quotechar, quotechar, 1);
45014         xmlResetLastError();
45015         if (mem_base != xmlMemBlocks()) {
45016             printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
45017                    xmlMemBlocks() - mem_base);
45018             test_ret++;
45019             printf(" %d", n_writer);
45020             printf(" %d", n_quotechar);
45021             printf("\n");
45022         }
45023     }
45024     }
45025     function_tests++;
45026 #endif
45027
45028     return(test_ret);
45029 }
45030
45031
45032 static int
45033 test_xmlTextWriterStartAttribute(void) {
45034     int test_ret = 0;
45035
45036 #if defined(LIBXML_WRITER_ENABLED)
45037     int mem_base;
45038     int ret_val;
45039     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45040     int n_writer;
45041     xmlChar * name; /* element name */
45042     int n_name;
45043
45044     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45045     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45046         mem_base = xmlMemBlocks();
45047         writer = gen_xmlTextWriterPtr(n_writer, 0);
45048         name = gen_const_xmlChar_ptr(n_name, 1);
45049
45050         ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
45051         desret_int(ret_val);
45052         call_tests++;
45053         des_xmlTextWriterPtr(n_writer, writer, 0);
45054         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45055         xmlResetLastError();
45056         if (mem_base != xmlMemBlocks()) {
45057             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
45058                    xmlMemBlocks() - mem_base);
45059             test_ret++;
45060             printf(" %d", n_writer);
45061             printf(" %d", n_name);
45062             printf("\n");
45063         }
45064     }
45065     }
45066     function_tests++;
45067 #endif
45068
45069     return(test_ret);
45070 }
45071
45072
45073 static int
45074 test_xmlTextWriterStartAttributeNS(void) {
45075     int test_ret = 0;
45076
45077 #if defined(LIBXML_WRITER_ENABLED)
45078     int mem_base;
45079     int ret_val;
45080     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45081     int n_writer;
45082     xmlChar * prefix; /* namespace prefix or NULL */
45083     int n_prefix;
45084     xmlChar * name; /* element local name */
45085     int n_name;
45086     xmlChar * namespaceURI; /* namespace URI or NULL */
45087     int n_namespaceURI;
45088
45089     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45090     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45091     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45092     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45093         mem_base = xmlMemBlocks();
45094         writer = gen_xmlTextWriterPtr(n_writer, 0);
45095         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45096         name = gen_const_xmlChar_ptr(n_name, 2);
45097         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45098
45099         ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
45100         desret_int(ret_val);
45101         call_tests++;
45102         des_xmlTextWriterPtr(n_writer, writer, 0);
45103         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45104         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45105         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45106         xmlResetLastError();
45107         if (mem_base != xmlMemBlocks()) {
45108             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
45109                    xmlMemBlocks() - mem_base);
45110             test_ret++;
45111             printf(" %d", n_writer);
45112             printf(" %d", n_prefix);
45113             printf(" %d", n_name);
45114             printf(" %d", n_namespaceURI);
45115             printf("\n");
45116         }
45117     }
45118     }
45119     }
45120     }
45121     function_tests++;
45122 #endif
45123
45124     return(test_ret);
45125 }
45126
45127
45128 static int
45129 test_xmlTextWriterStartCDATA(void) {
45130     int test_ret = 0;
45131
45132 #if defined(LIBXML_WRITER_ENABLED)
45133     int mem_base;
45134     int ret_val;
45135     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45136     int n_writer;
45137
45138     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45139         mem_base = xmlMemBlocks();
45140         writer = gen_xmlTextWriterPtr(n_writer, 0);
45141
45142         ret_val = xmlTextWriterStartCDATA(writer);
45143         desret_int(ret_val);
45144         call_tests++;
45145         des_xmlTextWriterPtr(n_writer, writer, 0);
45146         xmlResetLastError();
45147         if (mem_base != xmlMemBlocks()) {
45148             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
45149                    xmlMemBlocks() - mem_base);
45150             test_ret++;
45151             printf(" %d", n_writer);
45152             printf("\n");
45153         }
45154     }
45155     function_tests++;
45156 #endif
45157
45158     return(test_ret);
45159 }
45160
45161
45162 static int
45163 test_xmlTextWriterStartComment(void) {
45164     int test_ret = 0;
45165
45166 #if defined(LIBXML_WRITER_ENABLED)
45167     int mem_base;
45168     int ret_val;
45169     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45170     int n_writer;
45171
45172     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45173         mem_base = xmlMemBlocks();
45174         writer = gen_xmlTextWriterPtr(n_writer, 0);
45175
45176         ret_val = xmlTextWriterStartComment(writer);
45177         desret_int(ret_val);
45178         call_tests++;
45179         des_xmlTextWriterPtr(n_writer, writer, 0);
45180         xmlResetLastError();
45181         if (mem_base != xmlMemBlocks()) {
45182             printf("Leak of %d blocks found in xmlTextWriterStartComment",
45183                    xmlMemBlocks() - mem_base);
45184             test_ret++;
45185             printf(" %d", n_writer);
45186             printf("\n");
45187         }
45188     }
45189     function_tests++;
45190 #endif
45191
45192     return(test_ret);
45193 }
45194
45195
45196 static int
45197 test_xmlTextWriterStartDTD(void) {
45198     int test_ret = 0;
45199
45200 #if defined(LIBXML_WRITER_ENABLED)
45201     int mem_base;
45202     int ret_val;
45203     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45204     int n_writer;
45205     xmlChar * name; /* the name of the DTD */
45206     int n_name;
45207     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45208     int n_pubid;
45209     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45210     int n_sysid;
45211
45212     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45213     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45214     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45215     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45216         mem_base = xmlMemBlocks();
45217         writer = gen_xmlTextWriterPtr(n_writer, 0);
45218         name = gen_const_xmlChar_ptr(n_name, 1);
45219         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45220         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45221
45222         ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
45223         desret_int(ret_val);
45224         call_tests++;
45225         des_xmlTextWriterPtr(n_writer, writer, 0);
45226         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45227         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45228         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45229         xmlResetLastError();
45230         if (mem_base != xmlMemBlocks()) {
45231             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
45232                    xmlMemBlocks() - mem_base);
45233             test_ret++;
45234             printf(" %d", n_writer);
45235             printf(" %d", n_name);
45236             printf(" %d", n_pubid);
45237             printf(" %d", n_sysid);
45238             printf("\n");
45239         }
45240     }
45241     }
45242     }
45243     }
45244     function_tests++;
45245 #endif
45246
45247     return(test_ret);
45248 }
45249
45250
45251 static int
45252 test_xmlTextWriterStartDTDAttlist(void) {
45253     int test_ret = 0;
45254
45255 #if defined(LIBXML_WRITER_ENABLED)
45256     int mem_base;
45257     int ret_val;
45258     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45259     int n_writer;
45260     xmlChar * name; /* the name of the DTD ATTLIST */
45261     int n_name;
45262
45263     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45264     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45265         mem_base = xmlMemBlocks();
45266         writer = gen_xmlTextWriterPtr(n_writer, 0);
45267         name = gen_const_xmlChar_ptr(n_name, 1);
45268
45269         ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
45270         desret_int(ret_val);
45271         call_tests++;
45272         des_xmlTextWriterPtr(n_writer, writer, 0);
45273         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45274         xmlResetLastError();
45275         if (mem_base != xmlMemBlocks()) {
45276             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
45277                    xmlMemBlocks() - mem_base);
45278             test_ret++;
45279             printf(" %d", n_writer);
45280             printf(" %d", n_name);
45281             printf("\n");
45282         }
45283     }
45284     }
45285     function_tests++;
45286 #endif
45287
45288     return(test_ret);
45289 }
45290
45291
45292 static int
45293 test_xmlTextWriterStartDTDElement(void) {
45294     int test_ret = 0;
45295
45296 #if defined(LIBXML_WRITER_ENABLED)
45297     int mem_base;
45298     int ret_val;
45299     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45300     int n_writer;
45301     xmlChar * name; /* the name of the DTD element */
45302     int n_name;
45303
45304     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45305     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45306         mem_base = xmlMemBlocks();
45307         writer = gen_xmlTextWriterPtr(n_writer, 0);
45308         name = gen_const_xmlChar_ptr(n_name, 1);
45309
45310         ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
45311         desret_int(ret_val);
45312         call_tests++;
45313         des_xmlTextWriterPtr(n_writer, writer, 0);
45314         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45315         xmlResetLastError();
45316         if (mem_base != xmlMemBlocks()) {
45317             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
45318                    xmlMemBlocks() - mem_base);
45319             test_ret++;
45320             printf(" %d", n_writer);
45321             printf(" %d", n_name);
45322             printf("\n");
45323         }
45324     }
45325     }
45326     function_tests++;
45327 #endif
45328
45329     return(test_ret);
45330 }
45331
45332
45333 static int
45334 test_xmlTextWriterStartDTDEntity(void) {
45335     int test_ret = 0;
45336
45337 #if defined(LIBXML_WRITER_ENABLED)
45338     int mem_base;
45339     int ret_val;
45340     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45341     int n_writer;
45342     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45343     int n_pe;
45344     xmlChar * name; /* the name of the DTD ATTLIST */
45345     int n_name;
45346
45347     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45348     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45349     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45350         mem_base = xmlMemBlocks();
45351         writer = gen_xmlTextWriterPtr(n_writer, 0);
45352         pe = gen_int(n_pe, 1);
45353         name = gen_const_xmlChar_ptr(n_name, 2);
45354
45355         ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
45356         desret_int(ret_val);
45357         call_tests++;
45358         des_xmlTextWriterPtr(n_writer, writer, 0);
45359         des_int(n_pe, pe, 1);
45360         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45361         xmlResetLastError();
45362         if (mem_base != xmlMemBlocks()) {
45363             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
45364                    xmlMemBlocks() - mem_base);
45365             test_ret++;
45366             printf(" %d", n_writer);
45367             printf(" %d", n_pe);
45368             printf(" %d", n_name);
45369             printf("\n");
45370         }
45371     }
45372     }
45373     }
45374     function_tests++;
45375 #endif
45376
45377     return(test_ret);
45378 }
45379
45380
45381 static int
45382 test_xmlTextWriterStartDocument(void) {
45383     int test_ret = 0;
45384
45385 #if defined(LIBXML_WRITER_ENABLED)
45386     int mem_base;
45387     int ret_val;
45388     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45389     int n_writer;
45390     char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
45391     int n_version;
45392     char * encoding; /* the encoding or NULL for default */
45393     int n_encoding;
45394     char * standalone; /* "yes" or "no" or NULL for default */
45395     int n_standalone;
45396
45397     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45398     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
45399     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
45400     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
45401         mem_base = xmlMemBlocks();
45402         writer = gen_xmlTextWriterPtr(n_writer, 0);
45403         version = gen_const_char_ptr(n_version, 1);
45404         encoding = gen_const_char_ptr(n_encoding, 2);
45405         standalone = gen_const_char_ptr(n_standalone, 3);
45406
45407         ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
45408         desret_int(ret_val);
45409         call_tests++;
45410         des_xmlTextWriterPtr(n_writer, writer, 0);
45411         des_const_char_ptr(n_version, (const char *)version, 1);
45412         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
45413         des_const_char_ptr(n_standalone, (const char *)standalone, 3);
45414         xmlResetLastError();
45415         if (mem_base != xmlMemBlocks()) {
45416             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
45417                    xmlMemBlocks() - mem_base);
45418             test_ret++;
45419             printf(" %d", n_writer);
45420             printf(" %d", n_version);
45421             printf(" %d", n_encoding);
45422             printf(" %d", n_standalone);
45423             printf("\n");
45424         }
45425     }
45426     }
45427     }
45428     }
45429     function_tests++;
45430 #endif
45431
45432     return(test_ret);
45433 }
45434
45435
45436 static int
45437 test_xmlTextWriterStartElement(void) {
45438     int test_ret = 0;
45439
45440 #if defined(LIBXML_WRITER_ENABLED)
45441     int mem_base;
45442     int ret_val;
45443     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45444     int n_writer;
45445     xmlChar * name; /* element name */
45446     int n_name;
45447
45448     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45449     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45450         mem_base = xmlMemBlocks();
45451         writer = gen_xmlTextWriterPtr(n_writer, 0);
45452         name = gen_const_xmlChar_ptr(n_name, 1);
45453
45454         ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
45455         desret_int(ret_val);
45456         call_tests++;
45457         des_xmlTextWriterPtr(n_writer, writer, 0);
45458         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45459         xmlResetLastError();
45460         if (mem_base != xmlMemBlocks()) {
45461             printf("Leak of %d blocks found in xmlTextWriterStartElement",
45462                    xmlMemBlocks() - mem_base);
45463             test_ret++;
45464             printf(" %d", n_writer);
45465             printf(" %d", n_name);
45466             printf("\n");
45467         }
45468     }
45469     }
45470     function_tests++;
45471 #endif
45472
45473     return(test_ret);
45474 }
45475
45476
45477 static int
45478 test_xmlTextWriterStartElementNS(void) {
45479     int test_ret = 0;
45480
45481 #if defined(LIBXML_WRITER_ENABLED)
45482     int mem_base;
45483     int ret_val;
45484     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45485     int n_writer;
45486     xmlChar * prefix; /* namespace prefix or NULL */
45487     int n_prefix;
45488     xmlChar * name; /* element local name */
45489     int n_name;
45490     xmlChar * namespaceURI; /* namespace URI or NULL */
45491     int n_namespaceURI;
45492
45493     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45494     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45495     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45496     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45497         mem_base = xmlMemBlocks();
45498         writer = gen_xmlTextWriterPtr(n_writer, 0);
45499         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45500         name = gen_const_xmlChar_ptr(n_name, 2);
45501         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45502
45503         ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
45504         desret_int(ret_val);
45505         call_tests++;
45506         des_xmlTextWriterPtr(n_writer, writer, 0);
45507         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45508         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45509         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45510         xmlResetLastError();
45511         if (mem_base != xmlMemBlocks()) {
45512             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
45513                    xmlMemBlocks() - mem_base);
45514             test_ret++;
45515             printf(" %d", n_writer);
45516             printf(" %d", n_prefix);
45517             printf(" %d", n_name);
45518             printf(" %d", n_namespaceURI);
45519             printf("\n");
45520         }
45521     }
45522     }
45523     }
45524     }
45525     function_tests++;
45526 #endif
45527
45528     return(test_ret);
45529 }
45530
45531
45532 static int
45533 test_xmlTextWriterStartPI(void) {
45534     int test_ret = 0;
45535
45536 #if defined(LIBXML_WRITER_ENABLED)
45537     int mem_base;
45538     int ret_val;
45539     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45540     int n_writer;
45541     xmlChar * target; /* PI target */
45542     int n_target;
45543
45544     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45545     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45546         mem_base = xmlMemBlocks();
45547         writer = gen_xmlTextWriterPtr(n_writer, 0);
45548         target = gen_const_xmlChar_ptr(n_target, 1);
45549
45550         ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
45551         desret_int(ret_val);
45552         call_tests++;
45553         des_xmlTextWriterPtr(n_writer, writer, 0);
45554         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45555         xmlResetLastError();
45556         if (mem_base != xmlMemBlocks()) {
45557             printf("Leak of %d blocks found in xmlTextWriterStartPI",
45558                    xmlMemBlocks() - mem_base);
45559             test_ret++;
45560             printf(" %d", n_writer);
45561             printf(" %d", n_target);
45562             printf("\n");
45563         }
45564     }
45565     }
45566     function_tests++;
45567 #endif
45568
45569     return(test_ret);
45570 }
45571
45572
45573 static int
45574 test_xmlTextWriterWriteAttribute(void) {
45575     int test_ret = 0;
45576
45577 #if defined(LIBXML_WRITER_ENABLED)
45578     int mem_base;
45579     int ret_val;
45580     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45581     int n_writer;
45582     xmlChar * name; /* attribute name */
45583     int n_name;
45584     xmlChar * content; /* attribute content */
45585     int n_content;
45586
45587     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45588     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45589     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45590         mem_base = xmlMemBlocks();
45591         writer = gen_xmlTextWriterPtr(n_writer, 0);
45592         name = gen_const_xmlChar_ptr(n_name, 1);
45593         content = gen_const_xmlChar_ptr(n_content, 2);
45594
45595         ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
45596         desret_int(ret_val);
45597         call_tests++;
45598         des_xmlTextWriterPtr(n_writer, writer, 0);
45599         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45600         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45601         xmlResetLastError();
45602         if (mem_base != xmlMemBlocks()) {
45603             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
45604                    xmlMemBlocks() - mem_base);
45605             test_ret++;
45606             printf(" %d", n_writer);
45607             printf(" %d", n_name);
45608             printf(" %d", n_content);
45609             printf("\n");
45610         }
45611     }
45612     }
45613     }
45614     function_tests++;
45615 #endif
45616
45617     return(test_ret);
45618 }
45619
45620
45621 static int
45622 test_xmlTextWriterWriteAttributeNS(void) {
45623     int test_ret = 0;
45624
45625 #if defined(LIBXML_WRITER_ENABLED)
45626     int mem_base;
45627     int ret_val;
45628     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45629     int n_writer;
45630     xmlChar * prefix; /* namespace prefix */
45631     int n_prefix;
45632     xmlChar * name; /* attribute local name */
45633     int n_name;
45634     xmlChar * namespaceURI; /* namespace URI */
45635     int n_namespaceURI;
45636     xmlChar * content; /* attribute content */
45637     int n_content;
45638
45639     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45640     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45641     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45642     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45643     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45644         mem_base = xmlMemBlocks();
45645         writer = gen_xmlTextWriterPtr(n_writer, 0);
45646         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45647         name = gen_const_xmlChar_ptr(n_name, 2);
45648         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45649         content = gen_const_xmlChar_ptr(n_content, 4);
45650
45651         ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
45652         desret_int(ret_val);
45653         call_tests++;
45654         des_xmlTextWriterPtr(n_writer, writer, 0);
45655         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45656         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45657         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45658         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
45659         xmlResetLastError();
45660         if (mem_base != xmlMemBlocks()) {
45661             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
45662                    xmlMemBlocks() - mem_base);
45663             test_ret++;
45664             printf(" %d", n_writer);
45665             printf(" %d", n_prefix);
45666             printf(" %d", n_name);
45667             printf(" %d", n_namespaceURI);
45668             printf(" %d", n_content);
45669             printf("\n");
45670         }
45671     }
45672     }
45673     }
45674     }
45675     }
45676     function_tests++;
45677 #endif
45678
45679     return(test_ret);
45680 }
45681
45682
45683 static int
45684 test_xmlTextWriterWriteBase64(void) {
45685     int test_ret = 0;
45686
45687 #if defined(LIBXML_WRITER_ENABLED)
45688     int mem_base;
45689     int ret_val;
45690     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45691     int n_writer;
45692     char * data; /* binary data */
45693     int n_data;
45694     int start; /* the position within the data of the first byte to encode */
45695     int n_start;
45696     int len; /* the number of bytes to encode */
45697     int n_len;
45698
45699     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45700     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
45701     for (n_start = 0;n_start < gen_nb_int;n_start++) {
45702     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45703         mem_base = xmlMemBlocks();
45704         writer = gen_xmlTextWriterPtr(n_writer, 0);
45705         data = gen_const_char_ptr(n_data, 1);
45706         start = gen_int(n_start, 2);
45707         len = gen_int(n_len, 3);
45708
45709         ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
45710         desret_int(ret_val);
45711         call_tests++;
45712         des_xmlTextWriterPtr(n_writer, writer, 0);
45713         des_const_char_ptr(n_data, (const char *)data, 1);
45714         des_int(n_start, start, 2);
45715         des_int(n_len, len, 3);
45716         xmlResetLastError();
45717         if (mem_base != xmlMemBlocks()) {
45718             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
45719                    xmlMemBlocks() - mem_base);
45720             test_ret++;
45721             printf(" %d", n_writer);
45722             printf(" %d", n_data);
45723             printf(" %d", n_start);
45724             printf(" %d", n_len);
45725             printf("\n");
45726         }
45727     }
45728     }
45729     }
45730     }
45731     function_tests++;
45732 #endif
45733
45734     return(test_ret);
45735 }
45736
45737
45738 static int
45739 test_xmlTextWriterWriteBinHex(void) {
45740     int test_ret = 0;
45741
45742 #if defined(LIBXML_WRITER_ENABLED)
45743     int mem_base;
45744     int ret_val;
45745     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45746     int n_writer;
45747     char * data; /* binary data */
45748     int n_data;
45749     int start; /* the position within the data of the first byte to encode */
45750     int n_start;
45751     int len; /* the number of bytes to encode */
45752     int n_len;
45753
45754     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45755     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
45756     for (n_start = 0;n_start < gen_nb_int;n_start++) {
45757     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45758         mem_base = xmlMemBlocks();
45759         writer = gen_xmlTextWriterPtr(n_writer, 0);
45760         data = gen_const_char_ptr(n_data, 1);
45761         start = gen_int(n_start, 2);
45762         len = gen_int(n_len, 3);
45763
45764         ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
45765         desret_int(ret_val);
45766         call_tests++;
45767         des_xmlTextWriterPtr(n_writer, writer, 0);
45768         des_const_char_ptr(n_data, (const char *)data, 1);
45769         des_int(n_start, start, 2);
45770         des_int(n_len, len, 3);
45771         xmlResetLastError();
45772         if (mem_base != xmlMemBlocks()) {
45773             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
45774                    xmlMemBlocks() - mem_base);
45775             test_ret++;
45776             printf(" %d", n_writer);
45777             printf(" %d", n_data);
45778             printf(" %d", n_start);
45779             printf(" %d", n_len);
45780             printf("\n");
45781         }
45782     }
45783     }
45784     }
45785     }
45786     function_tests++;
45787 #endif
45788
45789     return(test_ret);
45790 }
45791
45792
45793 static int
45794 test_xmlTextWriterWriteCDATA(void) {
45795     int test_ret = 0;
45796
45797 #if defined(LIBXML_WRITER_ENABLED)
45798     int mem_base;
45799     int ret_val;
45800     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45801     int n_writer;
45802     xmlChar * content; /* CDATA content */
45803     int n_content;
45804
45805     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45806     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45807         mem_base = xmlMemBlocks();
45808         writer = gen_xmlTextWriterPtr(n_writer, 0);
45809         content = gen_const_xmlChar_ptr(n_content, 1);
45810
45811         ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
45812         desret_int(ret_val);
45813         call_tests++;
45814         des_xmlTextWriterPtr(n_writer, writer, 0);
45815         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45816         xmlResetLastError();
45817         if (mem_base != xmlMemBlocks()) {
45818             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
45819                    xmlMemBlocks() - mem_base);
45820             test_ret++;
45821             printf(" %d", n_writer);
45822             printf(" %d", n_content);
45823             printf("\n");
45824         }
45825     }
45826     }
45827     function_tests++;
45828 #endif
45829
45830     return(test_ret);
45831 }
45832
45833
45834 static int
45835 test_xmlTextWriterWriteComment(void) {
45836     int test_ret = 0;
45837
45838 #if defined(LIBXML_WRITER_ENABLED)
45839     int mem_base;
45840     int ret_val;
45841     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45842     int n_writer;
45843     xmlChar * content; /* comment string */
45844     int n_content;
45845
45846     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45847     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45848         mem_base = xmlMemBlocks();
45849         writer = gen_xmlTextWriterPtr(n_writer, 0);
45850         content = gen_const_xmlChar_ptr(n_content, 1);
45851
45852         ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
45853         desret_int(ret_val);
45854         call_tests++;
45855         des_xmlTextWriterPtr(n_writer, writer, 0);
45856         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45857         xmlResetLastError();
45858         if (mem_base != xmlMemBlocks()) {
45859             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
45860                    xmlMemBlocks() - mem_base);
45861             test_ret++;
45862             printf(" %d", n_writer);
45863             printf(" %d", n_content);
45864             printf("\n");
45865         }
45866     }
45867     }
45868     function_tests++;
45869 #endif
45870
45871     return(test_ret);
45872 }
45873
45874
45875 static int
45876 test_xmlTextWriterWriteDTD(void) {
45877     int test_ret = 0;
45878
45879 #if defined(LIBXML_WRITER_ENABLED)
45880     int mem_base;
45881     int ret_val;
45882     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45883     int n_writer;
45884     xmlChar * name; /* the name of the DTD */
45885     int n_name;
45886     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45887     int n_pubid;
45888     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45889     int n_sysid;
45890     xmlChar * subset; /* string content of the DTD */
45891     int n_subset;
45892
45893     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45894     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45895     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45896     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45897     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
45898         mem_base = xmlMemBlocks();
45899         writer = gen_xmlTextWriterPtr(n_writer, 0);
45900         name = gen_const_xmlChar_ptr(n_name, 1);
45901         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45902         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45903         subset = gen_const_xmlChar_ptr(n_subset, 4);
45904
45905         ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
45906         desret_int(ret_val);
45907         call_tests++;
45908         des_xmlTextWriterPtr(n_writer, writer, 0);
45909         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45910         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45911         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45912         des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
45913         xmlResetLastError();
45914         if (mem_base != xmlMemBlocks()) {
45915             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
45916                    xmlMemBlocks() - mem_base);
45917             test_ret++;
45918             printf(" %d", n_writer);
45919             printf(" %d", n_name);
45920             printf(" %d", n_pubid);
45921             printf(" %d", n_sysid);
45922             printf(" %d", n_subset);
45923             printf("\n");
45924         }
45925     }
45926     }
45927     }
45928     }
45929     }
45930     function_tests++;
45931 #endif
45932
45933     return(test_ret);
45934 }
45935
45936
45937 static int
45938 test_xmlTextWriterWriteDTDAttlist(void) {
45939     int test_ret = 0;
45940
45941 #if defined(LIBXML_WRITER_ENABLED)
45942     int mem_base;
45943     int ret_val;
45944     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45945     int n_writer;
45946     xmlChar * name; /* the name of the DTD ATTLIST */
45947     int n_name;
45948     xmlChar * content; /* content of the ATTLIST */
45949     int n_content;
45950
45951     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45952     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45953     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45954         mem_base = xmlMemBlocks();
45955         writer = gen_xmlTextWriterPtr(n_writer, 0);
45956         name = gen_const_xmlChar_ptr(n_name, 1);
45957         content = gen_const_xmlChar_ptr(n_content, 2);
45958
45959         ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
45960         desret_int(ret_val);
45961         call_tests++;
45962         des_xmlTextWriterPtr(n_writer, writer, 0);
45963         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45964         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45965         xmlResetLastError();
45966         if (mem_base != xmlMemBlocks()) {
45967             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
45968                    xmlMemBlocks() - mem_base);
45969             test_ret++;
45970             printf(" %d", n_writer);
45971             printf(" %d", n_name);
45972             printf(" %d", n_content);
45973             printf("\n");
45974         }
45975     }
45976     }
45977     }
45978     function_tests++;
45979 #endif
45980
45981     return(test_ret);
45982 }
45983
45984
45985 static int
45986 test_xmlTextWriterWriteDTDElement(void) {
45987     int test_ret = 0;
45988
45989 #if defined(LIBXML_WRITER_ENABLED)
45990     int mem_base;
45991     int ret_val;
45992     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45993     int n_writer;
45994     xmlChar * name; /* the name of the DTD element */
45995     int n_name;
45996     xmlChar * content; /* content of the element */
45997     int n_content;
45998
45999     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46000     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46001     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46002         mem_base = xmlMemBlocks();
46003         writer = gen_xmlTextWriterPtr(n_writer, 0);
46004         name = gen_const_xmlChar_ptr(n_name, 1);
46005         content = gen_const_xmlChar_ptr(n_content, 2);
46006
46007         ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
46008         desret_int(ret_val);
46009         call_tests++;
46010         des_xmlTextWriterPtr(n_writer, writer, 0);
46011         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46012         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
46013         xmlResetLastError();
46014         if (mem_base != xmlMemBlocks()) {
46015             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
46016                    xmlMemBlocks() - mem_base);
46017             test_ret++;
46018             printf(" %d", n_writer);
46019             printf(" %d", n_name);
46020             printf(" %d", n_content);
46021             printf("\n");
46022         }
46023     }
46024     }
46025     }
46026     function_tests++;
46027 #endif
46028
46029     return(test_ret);
46030 }
46031
46032
46033 static int
46034 test_xmlTextWriterWriteDTDEntity(void) {
46035     int test_ret = 0;
46036
46037 #if defined(LIBXML_WRITER_ENABLED)
46038     int mem_base;
46039     int ret_val;
46040     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46041     int n_writer;
46042     int pe; /* TRUE if this is a parameter entity, FALSE if not */
46043     int n_pe;
46044     xmlChar * name; /* the name of the DTD entity */
46045     int n_name;
46046     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
46047     int n_pubid;
46048     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
46049     int n_sysid;
46050     xmlChar * ndataid; /* the xml notation name. */
46051     int n_ndataid;
46052     xmlChar * content; /* content of the entity */
46053     int n_content;
46054
46055     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46056     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
46057     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46058     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
46059     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
46060     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
46061     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46062         mem_base = xmlMemBlocks();
46063         writer = gen_xmlTextWriterPtr(n_writer, 0);
46064         pe = gen_int(n_pe, 1);
46065         name = gen_const_xmlChar_ptr(n_name, 2);
46066         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
46067         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
46068         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
46069         content = gen_const_xmlChar_ptr(n_content, 6);
46070
46071         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
46072         desret_int(ret_val);
46073         call_tests++;
46074         des_xmlTextWriterPtr(n_writer, writer, 0);
46075         des_int(n_pe, pe, 1);
46076         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
46077         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
46078         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
46079         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
46080         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
46081         xmlResetLastError();
46082         if (mem_base != xmlMemBlocks()) {
46083             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
46084                    xmlMemBlocks() - mem_base);
46085             test_ret++;
46086             printf(" %d", n_writer);
46087             printf(" %d", n_pe);
46088             printf(" %d", n_name);
46089             printf(" %d", n_pubid);
46090             printf(" %d", n_sysid);
46091             printf(" %d", n_ndataid);
46092             printf(" %d", n_content);
46093             printf("\n");
46094         }
46095     }
46096     }
46097     }
46098     }
46099     }
46100     }
46101     }
46102     function_tests++;
46103 #endif
46104
46105     return(test_ret);
46106 }
46107
46108
46109 static int
46110 test_xmlTextWriterWriteDTDExternalEntity(void) {
46111     int test_ret = 0;
46112
46113 #if defined(LIBXML_WRITER_ENABLED)
46114     int mem_base;
46115     int ret_val;
46116     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46117     int n_writer;
46118     int pe; /* TRUE if this is a parameter entity, FALSE if not */
46119     int n_pe;
46120     xmlChar * name; /* the name of the DTD entity */
46121     int n_name;
46122     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
46123     int n_pubid;
46124     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
46125     int n_sysid;
46126     xmlChar * ndataid; /* the xml notation name. */
46127     int n_ndataid;
46128
46129     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46130     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
46131     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46132     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
46133     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
46134     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
46135         mem_base = xmlMemBlocks();
46136         writer = gen_xmlTextWriterPtr(n_writer, 0);
46137         pe = gen_int(n_pe, 1);
46138         name = gen_const_xmlChar_ptr(n_name, 2);
46139         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
46140         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
46141         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
46142
46143         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
46144         desret_int(ret_val);
46145         call_tests++;
46146         des_xmlTextWriterPtr(n_writer, writer, 0);
46147         des_int(n_pe, pe, 1);
46148         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
46149         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
46150         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
46151         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
46152         xmlResetLastError();
46153         if (mem_base != xmlMemBlocks()) {
46154             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
46155                    xmlMemBlocks() - mem_base);
46156             test_ret++;
46157             printf(" %d", n_writer);
46158             printf(" %d", n_pe);
46159             printf(" %d", n_name);
46160             printf(" %d", n_pubid);
46161             printf(" %d", n_sysid);
46162             printf(" %d", n_ndataid);
46163             printf("\n");
46164         }
46165     }
46166     }
46167     }
46168     }
46169     }
46170     }
46171     function_tests++;
46172 #endif
46173
46174     return(test_ret);
46175 }
46176
46177
46178 static int
46179 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
46180     int test_ret = 0;
46181
46182 #if defined(LIBXML_WRITER_ENABLED)
46183     int mem_base;
46184     int ret_val;
46185     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46186     int n_writer;
46187     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
46188     int n_pubid;
46189     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
46190     int n_sysid;
46191     xmlChar * ndataid; /* the xml notation name. */
46192     int n_ndataid;
46193
46194     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46195     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
46196     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
46197     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
46198         mem_base = xmlMemBlocks();
46199         writer = gen_xmlTextWriterPtr(n_writer, 0);
46200         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
46201         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
46202         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
46203
46204         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
46205         desret_int(ret_val);
46206         call_tests++;
46207         des_xmlTextWriterPtr(n_writer, writer, 0);
46208         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
46209         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
46210         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
46211         xmlResetLastError();
46212         if (mem_base != xmlMemBlocks()) {
46213             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
46214                    xmlMemBlocks() - mem_base);
46215             test_ret++;
46216             printf(" %d", n_writer);
46217             printf(" %d", n_pubid);
46218             printf(" %d", n_sysid);
46219             printf(" %d", n_ndataid);
46220             printf("\n");
46221         }
46222     }
46223     }
46224     }
46225     }
46226     function_tests++;
46227 #endif
46228
46229     return(test_ret);
46230 }
46231
46232
46233 static int
46234 test_xmlTextWriterWriteDTDInternalEntity(void) {
46235     int test_ret = 0;
46236
46237 #if defined(LIBXML_WRITER_ENABLED)
46238     int mem_base;
46239     int ret_val;
46240     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46241     int n_writer;
46242     int pe; /* TRUE if this is a parameter entity, FALSE if not */
46243     int n_pe;
46244     xmlChar * name; /* the name of the DTD entity */
46245     int n_name;
46246     xmlChar * content; /* content of the entity */
46247     int n_content;
46248
46249     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46250     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
46251     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46252     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46253         mem_base = xmlMemBlocks();
46254         writer = gen_xmlTextWriterPtr(n_writer, 0);
46255         pe = gen_int(n_pe, 1);
46256         name = gen_const_xmlChar_ptr(n_name, 2);
46257         content = gen_const_xmlChar_ptr(n_content, 3);
46258
46259         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
46260         desret_int(ret_val);
46261         call_tests++;
46262         des_xmlTextWriterPtr(n_writer, writer, 0);
46263         des_int(n_pe, pe, 1);
46264         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
46265         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
46266         xmlResetLastError();
46267         if (mem_base != xmlMemBlocks()) {
46268             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
46269                    xmlMemBlocks() - mem_base);
46270             test_ret++;
46271             printf(" %d", n_writer);
46272             printf(" %d", n_pe);
46273             printf(" %d", n_name);
46274             printf(" %d", n_content);
46275             printf("\n");
46276         }
46277     }
46278     }
46279     }
46280     }
46281     function_tests++;
46282 #endif
46283
46284     return(test_ret);
46285 }
46286
46287
46288 static int
46289 test_xmlTextWriterWriteDTDNotation(void) {
46290     int test_ret = 0;
46291
46292 #if defined(LIBXML_WRITER_ENABLED)
46293     int mem_base;
46294     int ret_val;
46295     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46296     int n_writer;
46297     xmlChar * name; /* the name of the xml notation */
46298     int n_name;
46299     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
46300     int n_pubid;
46301     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
46302     int n_sysid;
46303
46304     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46305     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46306     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
46307     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
46308         mem_base = xmlMemBlocks();
46309         writer = gen_xmlTextWriterPtr(n_writer, 0);
46310         name = gen_const_xmlChar_ptr(n_name, 1);
46311         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
46312         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
46313
46314         ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
46315         desret_int(ret_val);
46316         call_tests++;
46317         des_xmlTextWriterPtr(n_writer, writer, 0);
46318         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46319         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
46320         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
46321         xmlResetLastError();
46322         if (mem_base != xmlMemBlocks()) {
46323             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
46324                    xmlMemBlocks() - mem_base);
46325             test_ret++;
46326             printf(" %d", n_writer);
46327             printf(" %d", n_name);
46328             printf(" %d", n_pubid);
46329             printf(" %d", n_sysid);
46330             printf("\n");
46331         }
46332     }
46333     }
46334     }
46335     }
46336     function_tests++;
46337 #endif
46338
46339     return(test_ret);
46340 }
46341
46342
46343 static int
46344 test_xmlTextWriterWriteElement(void) {
46345     int test_ret = 0;
46346
46347 #if defined(LIBXML_WRITER_ENABLED)
46348     int mem_base;
46349     int ret_val;
46350     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46351     int n_writer;
46352     xmlChar * name; /* element name */
46353     int n_name;
46354     xmlChar * content; /* element content */
46355     int n_content;
46356
46357     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46358     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46359     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46360         mem_base = xmlMemBlocks();
46361         writer = gen_xmlTextWriterPtr(n_writer, 0);
46362         name = gen_const_xmlChar_ptr(n_name, 1);
46363         content = gen_const_xmlChar_ptr(n_content, 2);
46364
46365         ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
46366         desret_int(ret_val);
46367         call_tests++;
46368         des_xmlTextWriterPtr(n_writer, writer, 0);
46369         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46370         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
46371         xmlResetLastError();
46372         if (mem_base != xmlMemBlocks()) {
46373             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
46374                    xmlMemBlocks() - mem_base);
46375             test_ret++;
46376             printf(" %d", n_writer);
46377             printf(" %d", n_name);
46378             printf(" %d", n_content);
46379             printf("\n");
46380         }
46381     }
46382     }
46383     }
46384     function_tests++;
46385 #endif
46386
46387     return(test_ret);
46388 }
46389
46390
46391 static int
46392 test_xmlTextWriterWriteElementNS(void) {
46393     int test_ret = 0;
46394
46395 #if defined(LIBXML_WRITER_ENABLED)
46396     int mem_base;
46397     int ret_val;
46398     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46399     int n_writer;
46400     xmlChar * prefix; /* namespace prefix */
46401     int n_prefix;
46402     xmlChar * name; /* element local name */
46403     int n_name;
46404     xmlChar * namespaceURI; /* namespace URI */
46405     int n_namespaceURI;
46406     xmlChar * content; /* element content */
46407     int n_content;
46408
46409     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46410     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
46411     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46412     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
46413     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46414         mem_base = xmlMemBlocks();
46415         writer = gen_xmlTextWriterPtr(n_writer, 0);
46416         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
46417         name = gen_const_xmlChar_ptr(n_name, 2);
46418         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
46419         content = gen_const_xmlChar_ptr(n_content, 4);
46420
46421         ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
46422         desret_int(ret_val);
46423         call_tests++;
46424         des_xmlTextWriterPtr(n_writer, writer, 0);
46425         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
46426         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
46427         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
46428         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
46429         xmlResetLastError();
46430         if (mem_base != xmlMemBlocks()) {
46431             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
46432                    xmlMemBlocks() - mem_base);
46433             test_ret++;
46434             printf(" %d", n_writer);
46435             printf(" %d", n_prefix);
46436             printf(" %d", n_name);
46437             printf(" %d", n_namespaceURI);
46438             printf(" %d", n_content);
46439             printf("\n");
46440         }
46441     }
46442     }
46443     }
46444     }
46445     }
46446     function_tests++;
46447 #endif
46448
46449     return(test_ret);
46450 }
46451
46452
46453 static int
46454 test_xmlTextWriterWriteFormatAttribute(void) {
46455     int test_ret = 0;
46456
46457
46458     /* missing type support */
46459     return(test_ret);
46460 }
46461
46462
46463 static int
46464 test_xmlTextWriterWriteFormatAttributeNS(void) {
46465     int test_ret = 0;
46466
46467
46468     /* missing type support */
46469     return(test_ret);
46470 }
46471
46472
46473 static int
46474 test_xmlTextWriterWriteFormatCDATA(void) {
46475     int test_ret = 0;
46476
46477
46478     /* missing type support */
46479     return(test_ret);
46480 }
46481
46482
46483 static int
46484 test_xmlTextWriterWriteFormatComment(void) {
46485     int test_ret = 0;
46486
46487
46488     /* missing type support */
46489     return(test_ret);
46490 }
46491
46492
46493 static int
46494 test_xmlTextWriterWriteFormatDTD(void) {
46495     int test_ret = 0;
46496
46497
46498     /* missing type support */
46499     return(test_ret);
46500 }
46501
46502
46503 static int
46504 test_xmlTextWriterWriteFormatDTDAttlist(void) {
46505     int test_ret = 0;
46506
46507
46508     /* missing type support */
46509     return(test_ret);
46510 }
46511
46512
46513 static int
46514 test_xmlTextWriterWriteFormatDTDElement(void) {
46515     int test_ret = 0;
46516
46517
46518     /* missing type support */
46519     return(test_ret);
46520 }
46521
46522
46523 static int
46524 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
46525     int test_ret = 0;
46526
46527
46528     /* missing type support */
46529     return(test_ret);
46530 }
46531
46532
46533 static int
46534 test_xmlTextWriterWriteFormatElement(void) {
46535     int test_ret = 0;
46536
46537
46538     /* missing type support */
46539     return(test_ret);
46540 }
46541
46542
46543 static int
46544 test_xmlTextWriterWriteFormatElementNS(void) {
46545     int test_ret = 0;
46546
46547
46548     /* missing type support */
46549     return(test_ret);
46550 }
46551
46552
46553 static int
46554 test_xmlTextWriterWriteFormatPI(void) {
46555     int test_ret = 0;
46556
46557
46558     /* missing type support */
46559     return(test_ret);
46560 }
46561
46562
46563 static int
46564 test_xmlTextWriterWriteFormatRaw(void) {
46565     int test_ret = 0;
46566
46567
46568     /* missing type support */
46569     return(test_ret);
46570 }
46571
46572
46573 static int
46574 test_xmlTextWriterWriteFormatString(void) {
46575     int test_ret = 0;
46576
46577
46578     /* missing type support */
46579     return(test_ret);
46580 }
46581
46582
46583 static int
46584 test_xmlTextWriterWritePI(void) {
46585     int test_ret = 0;
46586
46587 #if defined(LIBXML_WRITER_ENABLED)
46588     int mem_base;
46589     int ret_val;
46590     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46591     int n_writer;
46592     xmlChar * target; /* PI target */
46593     int n_target;
46594     xmlChar * content; /* PI content */
46595     int n_content;
46596
46597     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46598     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
46599     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46600         mem_base = xmlMemBlocks();
46601         writer = gen_xmlTextWriterPtr(n_writer, 0);
46602         target = gen_const_xmlChar_ptr(n_target, 1);
46603         content = gen_const_xmlChar_ptr(n_content, 2);
46604
46605         ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
46606         desret_int(ret_val);
46607         call_tests++;
46608         des_xmlTextWriterPtr(n_writer, writer, 0);
46609         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
46610         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
46611         xmlResetLastError();
46612         if (mem_base != xmlMemBlocks()) {
46613             printf("Leak of %d blocks found in xmlTextWriterWritePI",
46614                    xmlMemBlocks() - mem_base);
46615             test_ret++;
46616             printf(" %d", n_writer);
46617             printf(" %d", n_target);
46618             printf(" %d", n_content);
46619             printf("\n");
46620         }
46621     }
46622     }
46623     }
46624     function_tests++;
46625 #endif
46626
46627     return(test_ret);
46628 }
46629
46630
46631 static int
46632 test_xmlTextWriterWriteRaw(void) {
46633     int test_ret = 0;
46634
46635 #if defined(LIBXML_WRITER_ENABLED)
46636     int mem_base;
46637     int ret_val;
46638     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46639     int n_writer;
46640     xmlChar * content; /* text string */
46641     int n_content;
46642
46643     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46644     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46645         mem_base = xmlMemBlocks();
46646         writer = gen_xmlTextWriterPtr(n_writer, 0);
46647         content = gen_const_xmlChar_ptr(n_content, 1);
46648
46649         ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
46650         desret_int(ret_val);
46651         call_tests++;
46652         des_xmlTextWriterPtr(n_writer, writer, 0);
46653         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
46654         xmlResetLastError();
46655         if (mem_base != xmlMemBlocks()) {
46656             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
46657                    xmlMemBlocks() - mem_base);
46658             test_ret++;
46659             printf(" %d", n_writer);
46660             printf(" %d", n_content);
46661             printf("\n");
46662         }
46663     }
46664     }
46665     function_tests++;
46666 #endif
46667
46668     return(test_ret);
46669 }
46670
46671
46672 static int
46673 test_xmlTextWriterWriteRawLen(void) {
46674     int test_ret = 0;
46675
46676 #if defined(LIBXML_WRITER_ENABLED)
46677     int mem_base;
46678     int ret_val;
46679     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46680     int n_writer;
46681     xmlChar * content; /* text string */
46682     int n_content;
46683     int len; /* length of the text string */
46684     int n_len;
46685
46686     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46687     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46688     for (n_len = 0;n_len < gen_nb_int;n_len++) {
46689         mem_base = xmlMemBlocks();
46690         writer = gen_xmlTextWriterPtr(n_writer, 0);
46691         content = gen_const_xmlChar_ptr(n_content, 1);
46692         len = gen_int(n_len, 2);
46693
46694         ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
46695         desret_int(ret_val);
46696         call_tests++;
46697         des_xmlTextWriterPtr(n_writer, writer, 0);
46698         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
46699         des_int(n_len, len, 2);
46700         xmlResetLastError();
46701         if (mem_base != xmlMemBlocks()) {
46702             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
46703                    xmlMemBlocks() - mem_base);
46704             test_ret++;
46705             printf(" %d", n_writer);
46706             printf(" %d", n_content);
46707             printf(" %d", n_len);
46708             printf("\n");
46709         }
46710     }
46711     }
46712     }
46713     function_tests++;
46714 #endif
46715
46716     return(test_ret);
46717 }
46718
46719
46720 static int
46721 test_xmlTextWriterWriteString(void) {
46722     int test_ret = 0;
46723
46724 #if defined(LIBXML_WRITER_ENABLED)
46725     int mem_base;
46726     int ret_val;
46727     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46728     int n_writer;
46729     xmlChar * content; /* text string */
46730     int n_content;
46731
46732     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46733     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46734         mem_base = xmlMemBlocks();
46735         writer = gen_xmlTextWriterPtr(n_writer, 0);
46736         content = gen_const_xmlChar_ptr(n_content, 1);
46737
46738         ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
46739         desret_int(ret_val);
46740         call_tests++;
46741         des_xmlTextWriterPtr(n_writer, writer, 0);
46742         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
46743         xmlResetLastError();
46744         if (mem_base != xmlMemBlocks()) {
46745             printf("Leak of %d blocks found in xmlTextWriterWriteString",
46746                    xmlMemBlocks() - mem_base);
46747             test_ret++;
46748             printf(" %d", n_writer);
46749             printf(" %d", n_content);
46750             printf("\n");
46751         }
46752     }
46753     }
46754     function_tests++;
46755 #endif
46756
46757     return(test_ret);
46758 }
46759
46760
46761 static int
46762 test_xmlTextWriterWriteVFormatAttribute(void) {
46763     int test_ret = 0;
46764
46765
46766     /* missing type support */
46767     return(test_ret);
46768 }
46769
46770
46771 static int
46772 test_xmlTextWriterWriteVFormatAttributeNS(void) {
46773     int test_ret = 0;
46774
46775
46776     /* missing type support */
46777     return(test_ret);
46778 }
46779
46780
46781 static int
46782 test_xmlTextWriterWriteVFormatCDATA(void) {
46783     int test_ret = 0;
46784
46785
46786     /* missing type support */
46787     return(test_ret);
46788 }
46789
46790
46791 static int
46792 test_xmlTextWriterWriteVFormatComment(void) {
46793     int test_ret = 0;
46794
46795
46796     /* missing type support */
46797     return(test_ret);
46798 }
46799
46800
46801 static int
46802 test_xmlTextWriterWriteVFormatDTD(void) {
46803     int test_ret = 0;
46804
46805
46806     /* missing type support */
46807     return(test_ret);
46808 }
46809
46810
46811 static int
46812 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
46813     int test_ret = 0;
46814
46815
46816     /* missing type support */
46817     return(test_ret);
46818 }
46819
46820
46821 static int
46822 test_xmlTextWriterWriteVFormatDTDElement(void) {
46823     int test_ret = 0;
46824
46825
46826     /* missing type support */
46827     return(test_ret);
46828 }
46829
46830
46831 static int
46832 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
46833     int test_ret = 0;
46834
46835
46836     /* missing type support */
46837     return(test_ret);
46838 }
46839
46840
46841 static int
46842 test_xmlTextWriterWriteVFormatElement(void) {
46843     int test_ret = 0;
46844
46845
46846     /* missing type support */
46847     return(test_ret);
46848 }
46849
46850
46851 static int
46852 test_xmlTextWriterWriteVFormatElementNS(void) {
46853     int test_ret = 0;
46854
46855
46856     /* missing type support */
46857     return(test_ret);
46858 }
46859
46860
46861 static int
46862 test_xmlTextWriterWriteVFormatPI(void) {
46863     int test_ret = 0;
46864
46865
46866     /* missing type support */
46867     return(test_ret);
46868 }
46869
46870
46871 static int
46872 test_xmlTextWriterWriteVFormatRaw(void) {
46873     int test_ret = 0;
46874
46875
46876     /* missing type support */
46877     return(test_ret);
46878 }
46879
46880
46881 static int
46882 test_xmlTextWriterWriteVFormatString(void) {
46883     int test_ret = 0;
46884
46885
46886     /* missing type support */
46887     return(test_ret);
46888 }
46889
46890 static int
46891 test_xmlwriter(void) {
46892     int test_ret = 0;
46893         int rc = 0;
46894
46895     if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
46896     rc = test_xmlNewTextWriter();
46897         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46898     rc = test_xmlNewTextWriterFilename();
46899         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46900     rc = test_xmlNewTextWriterMemory();
46901         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46902     rc = test_xmlNewTextWriterPushParser();
46903         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46904     rc = test_xmlNewTextWriterTree();
46905         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46906     rc = test_xmlTextWriterEndAttribute();
46907         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46908     rc = test_xmlTextWriterEndCDATA();
46909         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46910     rc = test_xmlTextWriterEndComment();
46911         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46912     rc = test_xmlTextWriterEndDTD();
46913         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46914     rc = test_xmlTextWriterEndDTDAttlist();
46915         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46916     rc = test_xmlTextWriterEndDTDElement();
46917         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46918     rc = test_xmlTextWriterEndDTDEntity();
46919         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46920     rc = test_xmlTextWriterEndDocument();
46921         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46922     rc = test_xmlTextWriterEndElement();
46923         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46924     rc = test_xmlTextWriterEndPI();
46925         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46926     rc = test_xmlTextWriterFlush();
46927         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46928     rc = test_xmlTextWriterFullEndElement();
46929         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46930     rc = test_xmlTextWriterSetIndent();
46931         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46932     rc = test_xmlTextWriterSetIndentString();
46933         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46934     rc = test_xmlTextWriterSetQuoteChar();
46935         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46936     rc = test_xmlTextWriterStartAttribute();
46937         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46938     rc = test_xmlTextWriterStartAttributeNS();
46939         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46940     rc = test_xmlTextWriterStartCDATA();
46941         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46942     rc = test_xmlTextWriterStartComment();
46943         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46944     rc = test_xmlTextWriterStartDTD();
46945         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46946     rc = test_xmlTextWriterStartDTDAttlist();
46947         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46948     rc = test_xmlTextWriterStartDTDElement();
46949         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46950     rc = test_xmlTextWriterStartDTDEntity();
46951         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46952     rc = test_xmlTextWriterStartDocument();
46953         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46954     rc = test_xmlTextWriterStartElement();
46955         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46956     rc = test_xmlTextWriterStartElementNS();
46957         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46958     rc = test_xmlTextWriterStartPI();
46959         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46960     rc = test_xmlTextWriterWriteAttribute();
46961         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46962     rc = test_xmlTextWriterWriteAttributeNS();
46963         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46964     rc = test_xmlTextWriterWriteBase64();
46965         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46966     rc = test_xmlTextWriterWriteBinHex();
46967         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46968     rc = test_xmlTextWriterWriteCDATA();
46969         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46970     rc = test_xmlTextWriterWriteComment();
46971         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46972     rc = test_xmlTextWriterWriteDTD();
46973         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46974     rc = test_xmlTextWriterWriteDTDAttlist();
46975         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46976     rc = test_xmlTextWriterWriteDTDElement();
46977         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46978     rc = test_xmlTextWriterWriteDTDEntity();
46979         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46980     rc = test_xmlTextWriterWriteDTDExternalEntity();
46981         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46982     rc = test_xmlTextWriterWriteDTDExternalEntityContents();
46983         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46984     rc = test_xmlTextWriterWriteDTDInternalEntity();
46985         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46986     rc = test_xmlTextWriterWriteDTDNotation();
46987         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46988     rc = test_xmlTextWriterWriteElement();
46989         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46990     rc = test_xmlTextWriterWriteElementNS();
46991         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46992     rc = test_xmlTextWriterWriteFormatAttribute();
46993         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46994     rc = test_xmlTextWriterWriteFormatAttributeNS();
46995         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46996     rc = test_xmlTextWriterWriteFormatCDATA();
46997         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
46998     rc = test_xmlTextWriterWriteFormatComment();
46999         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47000     rc = test_xmlTextWriterWriteFormatDTD();
47001         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47002     rc = test_xmlTextWriterWriteFormatDTDAttlist();
47003         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47004     rc = test_xmlTextWriterWriteFormatDTDElement();
47005         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47006     rc = test_xmlTextWriterWriteFormatDTDInternalEntity();
47007         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47008     rc = test_xmlTextWriterWriteFormatElement();
47009         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47010     rc = test_xmlTextWriterWriteFormatElementNS();
47011         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47012     rc = test_xmlTextWriterWriteFormatPI();
47013         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47014     rc = test_xmlTextWriterWriteFormatRaw();
47015         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47016     rc = test_xmlTextWriterWriteFormatString();
47017         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47018     rc = test_xmlTextWriterWritePI();
47019         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47020     rc = test_xmlTextWriterWriteRaw();
47021         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47022     rc = test_xmlTextWriterWriteRawLen();
47023         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47024     rc = test_xmlTextWriterWriteString();
47025         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47026     rc = test_xmlTextWriterWriteVFormatAttribute();
47027         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47028     rc = test_xmlTextWriterWriteVFormatAttributeNS();
47029         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47030     rc = test_xmlTextWriterWriteVFormatCDATA();
47031         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47032     rc = test_xmlTextWriterWriteVFormatComment();
47033         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47034     rc = test_xmlTextWriterWriteVFormatDTD();
47035         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47036     rc = test_xmlTextWriterWriteVFormatDTDAttlist();
47037         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47038     rc = test_xmlTextWriterWriteVFormatDTDElement();
47039         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47040     rc = test_xmlTextWriterWriteVFormatDTDInternalEntity();
47041         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47042     rc = test_xmlTextWriterWriteVFormatElement();
47043         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47044     rc = test_xmlTextWriterWriteVFormatElementNS();
47045         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47046     rc = test_xmlTextWriterWriteVFormatPI();
47047         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47048     rc = test_xmlTextWriterWriteVFormatRaw();
47049         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47050     rc = test_xmlTextWriterWriteVFormatString();
47051         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47052
47053     if (test_ret != 0)
47054         printf("Module xmlwriter: %d errors\n", test_ret);
47055     return(test_ret);
47056 }
47057
47058 static int
47059 test_xmlXPathCastBooleanToNumber(void) {
47060     int test_ret = 0;
47061
47062 #if defined(LIBXML_XPATH_ENABLED)
47063     int mem_base;
47064     double ret_val;
47065     int val; /* a boolean */
47066     int n_val;
47067
47068     for (n_val = 0;n_val < gen_nb_int;n_val++) {
47069         mem_base = xmlMemBlocks();
47070         val = gen_int(n_val, 0);
47071
47072         ret_val = xmlXPathCastBooleanToNumber(val);
47073         desret_double(ret_val);
47074         call_tests++;
47075         des_int(n_val, val, 0);
47076         xmlResetLastError();
47077         if (mem_base != xmlMemBlocks()) {
47078             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
47079                    xmlMemBlocks() - mem_base);
47080             test_ret++;
47081             printf(" %d", n_val);
47082             printf("\n");
47083         }
47084     }
47085     function_tests++;
47086 #endif
47087
47088     return(test_ret);
47089 }
47090
47091
47092 static int
47093 test_xmlXPathCastBooleanToString(void) {
47094     int test_ret = 0;
47095
47096 #if defined(LIBXML_XPATH_ENABLED)
47097     int mem_base;
47098     xmlChar * ret_val;
47099     int val; /* a boolean */
47100     int n_val;
47101
47102     for (n_val = 0;n_val < gen_nb_int;n_val++) {
47103         mem_base = xmlMemBlocks();
47104         val = gen_int(n_val, 0);
47105
47106         ret_val = xmlXPathCastBooleanToString(val);
47107         desret_xmlChar_ptr(ret_val);
47108         call_tests++;
47109         des_int(n_val, val, 0);
47110         xmlResetLastError();
47111         if (mem_base != xmlMemBlocks()) {
47112             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
47113                    xmlMemBlocks() - mem_base);
47114             test_ret++;
47115             printf(" %d", n_val);
47116             printf("\n");
47117         }
47118     }
47119     function_tests++;
47120 #endif
47121
47122     return(test_ret);
47123 }
47124
47125
47126 static int
47127 test_xmlXPathCastNodeSetToBoolean(void) {
47128     int test_ret = 0;
47129
47130 #if defined(LIBXML_XPATH_ENABLED)
47131     int mem_base;
47132     int ret_val;
47133     xmlNodeSetPtr ns; /* a node-set */
47134     int n_ns;
47135
47136     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
47137         mem_base = xmlMemBlocks();
47138         ns = gen_xmlNodeSetPtr(n_ns, 0);
47139
47140         ret_val = xmlXPathCastNodeSetToBoolean(ns);
47141         desret_int(ret_val);
47142         call_tests++;
47143         des_xmlNodeSetPtr(n_ns, ns, 0);
47144         xmlResetLastError();
47145         if (mem_base != xmlMemBlocks()) {
47146             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
47147                    xmlMemBlocks() - mem_base);
47148             test_ret++;
47149             printf(" %d", n_ns);
47150             printf("\n");
47151         }
47152     }
47153     function_tests++;
47154 #endif
47155
47156     return(test_ret);
47157 }
47158
47159
47160 static int
47161 test_xmlXPathCastNodeSetToNumber(void) {
47162     int test_ret = 0;
47163
47164 #if defined(LIBXML_XPATH_ENABLED)
47165     int mem_base;
47166     double ret_val;
47167     xmlNodeSetPtr ns; /* a node-set */
47168     int n_ns;
47169
47170     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
47171         mem_base = xmlMemBlocks();
47172         ns = gen_xmlNodeSetPtr(n_ns, 0);
47173
47174         ret_val = xmlXPathCastNodeSetToNumber(ns);
47175         desret_double(ret_val);
47176         call_tests++;
47177         des_xmlNodeSetPtr(n_ns, ns, 0);
47178         xmlResetLastError();
47179         if (mem_base != xmlMemBlocks()) {
47180             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
47181                    xmlMemBlocks() - mem_base);
47182             test_ret++;
47183             printf(" %d", n_ns);
47184             printf("\n");
47185         }
47186     }
47187     function_tests++;
47188 #endif
47189
47190     return(test_ret);
47191 }
47192
47193
47194 static int
47195 test_xmlXPathCastNodeSetToString(void) {
47196     int test_ret = 0;
47197
47198 #if defined(LIBXML_XPATH_ENABLED)
47199     int mem_base;
47200     xmlChar * ret_val;
47201     xmlNodeSetPtr ns; /* a node-set */
47202     int n_ns;
47203
47204     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
47205         mem_base = xmlMemBlocks();
47206         ns = gen_xmlNodeSetPtr(n_ns, 0);
47207
47208         ret_val = xmlXPathCastNodeSetToString(ns);
47209         desret_xmlChar_ptr(ret_val);
47210         call_tests++;
47211         des_xmlNodeSetPtr(n_ns, ns, 0);
47212         xmlResetLastError();
47213         if (mem_base != xmlMemBlocks()) {
47214             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
47215                    xmlMemBlocks() - mem_base);
47216             test_ret++;
47217             printf(" %d", n_ns);
47218             printf("\n");
47219         }
47220     }
47221     function_tests++;
47222 #endif
47223
47224     return(test_ret);
47225 }
47226
47227
47228 static int
47229 test_xmlXPathCastNodeToNumber(void) {
47230     int test_ret = 0;
47231
47232 #if defined(LIBXML_XPATH_ENABLED)
47233     int mem_base;
47234     double ret_val;
47235     xmlNodePtr node; /* a node */
47236     int n_node;
47237
47238     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47239         mem_base = xmlMemBlocks();
47240         node = gen_xmlNodePtr(n_node, 0);
47241
47242         ret_val = xmlXPathCastNodeToNumber(node);
47243         desret_double(ret_val);
47244         call_tests++;
47245         des_xmlNodePtr(n_node, node, 0);
47246         xmlResetLastError();
47247         if (mem_base != xmlMemBlocks()) {
47248             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
47249                    xmlMemBlocks() - mem_base);
47250             test_ret++;
47251             printf(" %d", n_node);
47252             printf("\n");
47253         }
47254     }
47255     function_tests++;
47256 #endif
47257
47258     return(test_ret);
47259 }
47260
47261
47262 static int
47263 test_xmlXPathCastNodeToString(void) {
47264     int test_ret = 0;
47265
47266 #if defined(LIBXML_XPATH_ENABLED)
47267     int mem_base;
47268     xmlChar * ret_val;
47269     xmlNodePtr node; /* a node */
47270     int n_node;
47271
47272     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47273         mem_base = xmlMemBlocks();
47274         node = gen_xmlNodePtr(n_node, 0);
47275
47276         ret_val = xmlXPathCastNodeToString(node);
47277         desret_xmlChar_ptr(ret_val);
47278         call_tests++;
47279         des_xmlNodePtr(n_node, node, 0);
47280         xmlResetLastError();
47281         if (mem_base != xmlMemBlocks()) {
47282             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
47283                    xmlMemBlocks() - mem_base);
47284             test_ret++;
47285             printf(" %d", n_node);
47286             printf("\n");
47287         }
47288     }
47289     function_tests++;
47290 #endif
47291
47292     return(test_ret);
47293 }
47294
47295
47296 static int
47297 test_xmlXPathCastNumberToBoolean(void) {
47298     int test_ret = 0;
47299
47300 #if defined(LIBXML_XPATH_ENABLED)
47301     int mem_base;
47302     int ret_val;
47303     double val; /* a number */
47304     int n_val;
47305
47306     for (n_val = 0;n_val < gen_nb_double;n_val++) {
47307         mem_base = xmlMemBlocks();
47308         val = gen_double(n_val, 0);
47309
47310         ret_val = xmlXPathCastNumberToBoolean(val);
47311         desret_int(ret_val);
47312         call_tests++;
47313         des_double(n_val, val, 0);
47314         xmlResetLastError();
47315         if (mem_base != xmlMemBlocks()) {
47316             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
47317                    xmlMemBlocks() - mem_base);
47318             test_ret++;
47319             printf(" %d", n_val);
47320             printf("\n");
47321         }
47322     }
47323     function_tests++;
47324 #endif
47325
47326     return(test_ret);
47327 }
47328
47329
47330 static int
47331 test_xmlXPathCastNumberToString(void) {
47332     int test_ret = 0;
47333
47334 #if defined(LIBXML_XPATH_ENABLED)
47335     int mem_base;
47336     xmlChar * ret_val;
47337     double val; /* a number */
47338     int n_val;
47339
47340     for (n_val = 0;n_val < gen_nb_double;n_val++) {
47341         mem_base = xmlMemBlocks();
47342         val = gen_double(n_val, 0);
47343
47344         ret_val = xmlXPathCastNumberToString(val);
47345         desret_xmlChar_ptr(ret_val);
47346         call_tests++;
47347         des_double(n_val, val, 0);
47348         xmlResetLastError();
47349         if (mem_base != xmlMemBlocks()) {
47350             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
47351                    xmlMemBlocks() - mem_base);
47352             test_ret++;
47353             printf(" %d", n_val);
47354             printf("\n");
47355         }
47356     }
47357     function_tests++;
47358 #endif
47359
47360     return(test_ret);
47361 }
47362
47363
47364 static int
47365 test_xmlXPathCastStringToBoolean(void) {
47366     int test_ret = 0;
47367
47368 #if defined(LIBXML_XPATH_ENABLED)
47369     int mem_base;
47370     int ret_val;
47371     xmlChar * val; /* a string */
47372     int n_val;
47373
47374     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47375         mem_base = xmlMemBlocks();
47376         val = gen_const_xmlChar_ptr(n_val, 0);
47377
47378         ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
47379         desret_int(ret_val);
47380         call_tests++;
47381         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47382         xmlResetLastError();
47383         if (mem_base != xmlMemBlocks()) {
47384             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
47385                    xmlMemBlocks() - mem_base);
47386             test_ret++;
47387             printf(" %d", n_val);
47388             printf("\n");
47389         }
47390     }
47391     function_tests++;
47392 #endif
47393
47394     return(test_ret);
47395 }
47396
47397
47398 static int
47399 test_xmlXPathCastStringToNumber(void) {
47400     int test_ret = 0;
47401
47402 #if defined(LIBXML_XPATH_ENABLED)
47403     int mem_base;
47404     double ret_val;
47405     xmlChar * val; /* a string */
47406     int n_val;
47407
47408     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47409         mem_base = xmlMemBlocks();
47410         val = gen_const_xmlChar_ptr(n_val, 0);
47411
47412         ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
47413         desret_double(ret_val);
47414         call_tests++;
47415         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47416         xmlResetLastError();
47417         if (mem_base != xmlMemBlocks()) {
47418             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
47419                    xmlMemBlocks() - mem_base);
47420             test_ret++;
47421             printf(" %d", n_val);
47422             printf("\n");
47423         }
47424     }
47425     function_tests++;
47426 #endif
47427
47428     return(test_ret);
47429 }
47430
47431
47432 static int
47433 test_xmlXPathCastToBoolean(void) {
47434     int test_ret = 0;
47435
47436 #if defined(LIBXML_XPATH_ENABLED)
47437     int mem_base;
47438     int ret_val;
47439     xmlXPathObjectPtr val; /* an XPath object */
47440     int n_val;
47441
47442     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47443         mem_base = xmlMemBlocks();
47444         val = gen_xmlXPathObjectPtr(n_val, 0);
47445
47446         ret_val = xmlXPathCastToBoolean(val);
47447         desret_int(ret_val);
47448         call_tests++;
47449         des_xmlXPathObjectPtr(n_val, val, 0);
47450         xmlResetLastError();
47451         if (mem_base != xmlMemBlocks()) {
47452             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
47453                    xmlMemBlocks() - mem_base);
47454             test_ret++;
47455             printf(" %d", n_val);
47456             printf("\n");
47457         }
47458     }
47459     function_tests++;
47460 #endif
47461
47462     return(test_ret);
47463 }
47464
47465
47466 static int
47467 test_xmlXPathCastToNumber(void) {
47468     int test_ret = 0;
47469
47470 #if defined(LIBXML_XPATH_ENABLED)
47471     int mem_base;
47472     double ret_val;
47473     xmlXPathObjectPtr val; /* an XPath object */
47474     int n_val;
47475
47476     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47477         mem_base = xmlMemBlocks();
47478         val = gen_xmlXPathObjectPtr(n_val, 0);
47479
47480         ret_val = xmlXPathCastToNumber(val);
47481         desret_double(ret_val);
47482         call_tests++;
47483         des_xmlXPathObjectPtr(n_val, val, 0);
47484         xmlResetLastError();
47485         if (mem_base != xmlMemBlocks()) {
47486             printf("Leak of %d blocks found in xmlXPathCastToNumber",
47487                    xmlMemBlocks() - mem_base);
47488             test_ret++;
47489             printf(" %d", n_val);
47490             printf("\n");
47491         }
47492     }
47493     function_tests++;
47494 #endif
47495
47496     return(test_ret);
47497 }
47498
47499
47500 static int
47501 test_xmlXPathCastToString(void) {
47502     int test_ret = 0;
47503
47504 #if defined(LIBXML_XPATH_ENABLED)
47505     int mem_base;
47506     xmlChar * ret_val;
47507     xmlXPathObjectPtr val; /* an XPath object */
47508     int n_val;
47509
47510     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47511         mem_base = xmlMemBlocks();
47512         val = gen_xmlXPathObjectPtr(n_val, 0);
47513
47514         ret_val = xmlXPathCastToString(val);
47515         desret_xmlChar_ptr(ret_val);
47516         call_tests++;
47517         des_xmlXPathObjectPtr(n_val, val, 0);
47518         xmlResetLastError();
47519         if (mem_base != xmlMemBlocks()) {
47520             printf("Leak of %d blocks found in xmlXPathCastToString",
47521                    xmlMemBlocks() - mem_base);
47522             test_ret++;
47523             printf(" %d", n_val);
47524             printf("\n");
47525         }
47526     }
47527     function_tests++;
47528 #endif
47529
47530     return(test_ret);
47531 }
47532
47533
47534 static int
47535 test_xmlXPathCmpNodes(void) {
47536     int test_ret = 0;
47537
47538 #if defined(LIBXML_XPATH_ENABLED)
47539     int mem_base;
47540     int ret_val;
47541     xmlNodePtr node1; /* the first node */
47542     int n_node1;
47543     xmlNodePtr node2; /* the second node */
47544     int n_node2;
47545
47546     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
47547     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
47548         mem_base = xmlMemBlocks();
47549         node1 = gen_xmlNodePtr(n_node1, 0);
47550         node2 = gen_xmlNodePtr(n_node2, 1);
47551
47552         ret_val = xmlXPathCmpNodes(node1, node2);
47553         desret_int(ret_val);
47554         call_tests++;
47555         des_xmlNodePtr(n_node1, node1, 0);
47556         des_xmlNodePtr(n_node2, node2, 1);
47557         xmlResetLastError();
47558         if (mem_base != xmlMemBlocks()) {
47559             printf("Leak of %d blocks found in xmlXPathCmpNodes",
47560                    xmlMemBlocks() - mem_base);
47561             test_ret++;
47562             printf(" %d", n_node1);
47563             printf(" %d", n_node2);
47564             printf("\n");
47565         }
47566     }
47567     }
47568     function_tests++;
47569 #endif
47570
47571     return(test_ret);
47572 }
47573
47574
47575 static int
47576 test_xmlXPathCompile(void) {
47577     int test_ret = 0;
47578
47579
47580     /* missing type support */
47581     return(test_ret);
47582 }
47583
47584 #ifdef LIBXML_XPATH_ENABLED
47585
47586 #define gen_nb_xmlXPathCompExprPtr 1
47587 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47588     return(NULL);
47589 }
47590 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47591 }
47592 #endif
47593
47594 #ifdef LIBXML_XPATH_ENABLED
47595
47596 #define gen_nb_xmlXPathContextPtr 1
47597 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47598     return(NULL);
47599 }
47600 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47601 }
47602 #endif
47603
47604
47605 static int
47606 test_xmlXPathCompiledEval(void) {
47607     int test_ret = 0;
47608
47609 #if defined(LIBXML_XPATH_ENABLED)
47610     int mem_base;
47611     xmlXPathObjectPtr ret_val;
47612     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
47613     int n_comp;
47614     xmlXPathContextPtr ctx; /* the XPath context */
47615     int n_ctx;
47616
47617     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47618     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47619         mem_base = xmlMemBlocks();
47620         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
47621         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47622
47623         ret_val = xmlXPathCompiledEval(comp, ctx);
47624         desret_xmlXPathObjectPtr(ret_val);
47625         call_tests++;
47626         des_xmlXPathCompExprPtr(n_comp, comp, 0);
47627         des_xmlXPathContextPtr(n_ctx, ctx, 1);
47628         xmlResetLastError();
47629         if (mem_base != xmlMemBlocks()) {
47630             printf("Leak of %d blocks found in xmlXPathCompiledEval",
47631                    xmlMemBlocks() - mem_base);
47632             test_ret++;
47633             printf(" %d", n_comp);
47634             printf(" %d", n_ctx);
47635             printf("\n");
47636         }
47637     }
47638     }
47639     function_tests++;
47640 #endif
47641
47642     return(test_ret);
47643 }
47644
47645
47646 static int
47647 test_xmlXPathCompiledEvalToBoolean(void) {
47648     int test_ret = 0;
47649
47650 #if defined(LIBXML_XPATH_ENABLED)
47651     int mem_base;
47652     int ret_val;
47653     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
47654     int n_comp;
47655     xmlXPathContextPtr ctxt; /* the XPath context */
47656     int n_ctxt;
47657
47658     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47659     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47660         mem_base = xmlMemBlocks();
47661         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
47662         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
47663
47664         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
47665         desret_int(ret_val);
47666         call_tests++;
47667         des_xmlXPathCompExprPtr(n_comp, comp, 0);
47668         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
47669         xmlResetLastError();
47670         if (mem_base != xmlMemBlocks()) {
47671             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
47672                    xmlMemBlocks() - mem_base);
47673             test_ret++;
47674             printf(" %d", n_comp);
47675             printf(" %d", n_ctxt);
47676             printf("\n");
47677         }
47678     }
47679     }
47680     function_tests++;
47681 #endif
47682
47683     return(test_ret);
47684 }
47685
47686
47687 static int
47688 test_xmlXPathContextSetCache(void) {
47689     int test_ret = 0;
47690
47691 #if defined(LIBXML_XPATH_ENABLED)
47692     int mem_base;
47693     int ret_val;
47694     xmlXPathContextPtr ctxt; /* the XPath context */
47695     int n_ctxt;
47696     int active; /* enables/disables (creates/frees) the cache */
47697     int n_active;
47698     int value; /* a value with semantics dependant on @options */
47699     int n_value;
47700     int options; /* options (currently only the value 0 is used) */
47701     int n_options;
47702
47703     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47704     for (n_active = 0;n_active < gen_nb_int;n_active++) {
47705     for (n_value = 0;n_value < gen_nb_int;n_value++) {
47706     for (n_options = 0;n_options < gen_nb_int;n_options++) {
47707         mem_base = xmlMemBlocks();
47708         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47709         active = gen_int(n_active, 1);
47710         value = gen_int(n_value, 2);
47711         options = gen_int(n_options, 3);
47712
47713         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
47714         desret_int(ret_val);
47715         call_tests++;
47716         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47717         des_int(n_active, active, 1);
47718         des_int(n_value, value, 2);
47719         des_int(n_options, options, 3);
47720         xmlResetLastError();
47721         if (mem_base != xmlMemBlocks()) {
47722             printf("Leak of %d blocks found in xmlXPathContextSetCache",
47723                    xmlMemBlocks() - mem_base);
47724             test_ret++;
47725             printf(" %d", n_ctxt);
47726             printf(" %d", n_active);
47727             printf(" %d", n_value);
47728             printf(" %d", n_options);
47729             printf("\n");
47730         }
47731     }
47732     }
47733     }
47734     }
47735     function_tests++;
47736 #endif
47737
47738     return(test_ret);
47739 }
47740
47741
47742 static int
47743 test_xmlXPathConvertBoolean(void) {
47744     int test_ret = 0;
47745
47746 #if defined(LIBXML_XPATH_ENABLED)
47747     int mem_base;
47748     xmlXPathObjectPtr ret_val;
47749     xmlXPathObjectPtr val; /* an XPath object */
47750     int n_val;
47751
47752     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47753         mem_base = xmlMemBlocks();
47754         val = gen_xmlXPathObjectPtr(n_val, 0);
47755
47756         ret_val = xmlXPathConvertBoolean(val);
47757         val = NULL;
47758         desret_xmlXPathObjectPtr(ret_val);
47759         call_tests++;
47760         des_xmlXPathObjectPtr(n_val, val, 0);
47761         xmlResetLastError();
47762         if (mem_base != xmlMemBlocks()) {
47763             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
47764                    xmlMemBlocks() - mem_base);
47765             test_ret++;
47766             printf(" %d", n_val);
47767             printf("\n");
47768         }
47769     }
47770     function_tests++;
47771 #endif
47772
47773     return(test_ret);
47774 }
47775
47776
47777 static int
47778 test_xmlXPathConvertNumber(void) {
47779     int test_ret = 0;
47780
47781 #if defined(LIBXML_XPATH_ENABLED)
47782     int mem_base;
47783     xmlXPathObjectPtr ret_val;
47784     xmlXPathObjectPtr val; /* an XPath object */
47785     int n_val;
47786
47787     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47788         mem_base = xmlMemBlocks();
47789         val = gen_xmlXPathObjectPtr(n_val, 0);
47790
47791         ret_val = xmlXPathConvertNumber(val);
47792         val = NULL;
47793         desret_xmlXPathObjectPtr(ret_val);
47794         call_tests++;
47795         des_xmlXPathObjectPtr(n_val, val, 0);
47796         xmlResetLastError();
47797         if (mem_base != xmlMemBlocks()) {
47798             printf("Leak of %d blocks found in xmlXPathConvertNumber",
47799                    xmlMemBlocks() - mem_base);
47800             test_ret++;
47801             printf(" %d", n_val);
47802             printf("\n");
47803         }
47804     }
47805     function_tests++;
47806 #endif
47807
47808     return(test_ret);
47809 }
47810
47811
47812 static int
47813 test_xmlXPathConvertString(void) {
47814     int test_ret = 0;
47815
47816 #if defined(LIBXML_XPATH_ENABLED)
47817     int mem_base;
47818     xmlXPathObjectPtr ret_val;
47819     xmlXPathObjectPtr val; /* an XPath object */
47820     int n_val;
47821
47822     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47823         mem_base = xmlMemBlocks();
47824         val = gen_xmlXPathObjectPtr(n_val, 0);
47825
47826         ret_val = xmlXPathConvertString(val);
47827         val = NULL;
47828         desret_xmlXPathObjectPtr(ret_val);
47829         call_tests++;
47830         des_xmlXPathObjectPtr(n_val, val, 0);
47831         xmlResetLastError();
47832         if (mem_base != xmlMemBlocks()) {
47833             printf("Leak of %d blocks found in xmlXPathConvertString",
47834                    xmlMemBlocks() - mem_base);
47835             test_ret++;
47836             printf(" %d", n_val);
47837             printf("\n");
47838         }
47839     }
47840     function_tests++;
47841 #endif
47842
47843     return(test_ret);
47844 }
47845
47846
47847 static int
47848 test_xmlXPathCtxtCompile(void) {
47849     int test_ret = 0;
47850
47851
47852     /* missing type support */
47853     return(test_ret);
47854 }
47855
47856
47857 static int
47858 test_xmlXPathEval(void) {
47859     int test_ret = 0;
47860
47861 #if defined(LIBXML_XPATH_ENABLED)
47862     int mem_base;
47863     xmlXPathObjectPtr ret_val;
47864     xmlChar * str; /* the XPath expression */
47865     int n_str;
47866     xmlXPathContextPtr ctx; /* the XPath context */
47867     int n_ctx;
47868
47869     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
47870     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47871         mem_base = xmlMemBlocks();
47872         str = gen_const_xmlChar_ptr(n_str, 0);
47873         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47874
47875         ret_val = xmlXPathEval((const xmlChar *)str, ctx);
47876         desret_xmlXPathObjectPtr(ret_val);
47877         call_tests++;
47878         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
47879         des_xmlXPathContextPtr(n_ctx, ctx, 1);
47880         xmlResetLastError();
47881         if (mem_base != xmlMemBlocks()) {
47882             printf("Leak of %d blocks found in xmlXPathEval",
47883                    xmlMemBlocks() - mem_base);
47884             test_ret++;
47885             printf(" %d", n_str);
47886             printf(" %d", n_ctx);
47887             printf("\n");
47888         }
47889     }
47890     }
47891     function_tests++;
47892 #endif
47893
47894     return(test_ret);
47895 }
47896
47897
47898 static int
47899 test_xmlXPathEvalExpression(void) {
47900     int test_ret = 0;
47901
47902 #if defined(LIBXML_XPATH_ENABLED)
47903     int mem_base;
47904     xmlXPathObjectPtr ret_val;
47905     xmlChar * str; /* the XPath expression */
47906     int n_str;
47907     xmlXPathContextPtr ctxt; /* the XPath context */
47908     int n_ctxt;
47909
47910     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
47911     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47912         mem_base = xmlMemBlocks();
47913         str = gen_const_xmlChar_ptr(n_str, 0);
47914         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
47915
47916         ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
47917         desret_xmlXPathObjectPtr(ret_val);
47918         call_tests++;
47919         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
47920         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
47921         xmlResetLastError();
47922         if (mem_base != xmlMemBlocks()) {
47923             printf("Leak of %d blocks found in xmlXPathEvalExpression",
47924                    xmlMemBlocks() - mem_base);
47925             test_ret++;
47926             printf(" %d", n_str);
47927             printf(" %d", n_ctxt);
47928             printf("\n");
47929         }
47930     }
47931     }
47932     function_tests++;
47933 #endif
47934
47935     return(test_ret);
47936 }
47937
47938
47939 static int
47940 test_xmlXPathEvalPredicate(void) {
47941     int test_ret = 0;
47942
47943 #if defined(LIBXML_XPATH_ENABLED)
47944     int mem_base;
47945     int ret_val;
47946     xmlXPathContextPtr ctxt; /* the XPath context */
47947     int n_ctxt;
47948     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47949     int n_res;
47950
47951     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47952     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47953         mem_base = xmlMemBlocks();
47954         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47955         res = gen_xmlXPathObjectPtr(n_res, 1);
47956
47957         ret_val = xmlXPathEvalPredicate(ctxt, res);
47958         desret_int(ret_val);
47959         call_tests++;
47960         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47961         des_xmlXPathObjectPtr(n_res, res, 1);
47962         xmlResetLastError();
47963         if (mem_base != xmlMemBlocks()) {
47964             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
47965                    xmlMemBlocks() - mem_base);
47966             test_ret++;
47967             printf(" %d", n_ctxt);
47968             printf(" %d", n_res);
47969             printf("\n");
47970         }
47971     }
47972     }
47973     function_tests++;
47974 #endif
47975
47976     return(test_ret);
47977 }
47978
47979
47980 static int
47981 test_xmlXPathInit(void) {
47982     int test_ret = 0;
47983
47984 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
47985     int mem_base;
47986
47987         mem_base = xmlMemBlocks();
47988
47989         xmlXPathInit();
47990         call_tests++;
47991         xmlResetLastError();
47992         if (mem_base != xmlMemBlocks()) {
47993             printf("Leak of %d blocks found in xmlXPathInit",
47994                    xmlMemBlocks() - mem_base);
47995             test_ret++;
47996             printf("\n");
47997         }
47998     function_tests++;
47999 #endif
48000
48001     return(test_ret);
48002 }
48003
48004
48005 static int
48006 test_xmlXPathIsInf(void) {
48007     int test_ret = 0;
48008
48009 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
48010     int mem_base;
48011     int ret_val;
48012     double val; /* a double value */
48013     int n_val;
48014
48015     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48016         mem_base = xmlMemBlocks();
48017         val = gen_double(n_val, 0);
48018
48019         ret_val = xmlXPathIsInf(val);
48020         desret_int(ret_val);
48021         call_tests++;
48022         des_double(n_val, val, 0);
48023         xmlResetLastError();
48024         if (mem_base != xmlMemBlocks()) {
48025             printf("Leak of %d blocks found in xmlXPathIsInf",
48026                    xmlMemBlocks() - mem_base);
48027             test_ret++;
48028             printf(" %d", n_val);
48029             printf("\n");
48030         }
48031     }
48032     function_tests++;
48033 #endif
48034
48035     return(test_ret);
48036 }
48037
48038
48039 static int
48040 test_xmlXPathIsNaN(void) {
48041     int test_ret = 0;
48042
48043 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
48044     int mem_base;
48045     int ret_val;
48046     double val; /* a double value */
48047     int n_val;
48048
48049     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48050         mem_base = xmlMemBlocks();
48051         val = gen_double(n_val, 0);
48052
48053         ret_val = xmlXPathIsNaN(val);
48054         desret_int(ret_val);
48055         call_tests++;
48056         des_double(n_val, val, 0);
48057         xmlResetLastError();
48058         if (mem_base != xmlMemBlocks()) {
48059             printf("Leak of %d blocks found in xmlXPathIsNaN",
48060                    xmlMemBlocks() - mem_base);
48061             test_ret++;
48062             printf(" %d", n_val);
48063             printf("\n");
48064         }
48065     }
48066     function_tests++;
48067 #endif
48068
48069     return(test_ret);
48070 }
48071
48072
48073 static int
48074 test_xmlXPathNewContext(void) {
48075     int test_ret = 0;
48076
48077
48078     /* missing type support */
48079     return(test_ret);
48080 }
48081
48082
48083 static int
48084 test_xmlXPathNodeEval(void) {
48085     int test_ret = 0;
48086
48087 #if defined(LIBXML_XPATH_ENABLED)
48088     int mem_base;
48089     xmlXPathObjectPtr ret_val;
48090     xmlNodePtr node; /* the node to to use as the context node */
48091     int n_node;
48092     xmlChar * str; /* the XPath expression */
48093     int n_str;
48094     xmlXPathContextPtr ctx; /* the XPath context */
48095     int n_ctx;
48096
48097     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48098     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
48099     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
48100         mem_base = xmlMemBlocks();
48101         node = gen_xmlNodePtr(n_node, 0);
48102         str = gen_const_xmlChar_ptr(n_str, 1);
48103         ctx = gen_xmlXPathContextPtr(n_ctx, 2);
48104
48105         ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
48106         desret_xmlXPathObjectPtr(ret_val);
48107         call_tests++;
48108         des_xmlNodePtr(n_node, node, 0);
48109         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
48110         des_xmlXPathContextPtr(n_ctx, ctx, 2);
48111         xmlResetLastError();
48112         if (mem_base != xmlMemBlocks()) {
48113             printf("Leak of %d blocks found in xmlXPathNodeEval",
48114                    xmlMemBlocks() - mem_base);
48115             test_ret++;
48116             printf(" %d", n_node);
48117             printf(" %d", n_str);
48118             printf(" %d", n_ctx);
48119             printf("\n");
48120         }
48121     }
48122     }
48123     }
48124     function_tests++;
48125 #endif
48126
48127     return(test_ret);
48128 }
48129
48130
48131 static int
48132 test_xmlXPathNodeSetCreate(void) {
48133     int test_ret = 0;
48134
48135 #if defined(LIBXML_XPATH_ENABLED)
48136     int mem_base;
48137     xmlNodeSetPtr ret_val;
48138     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
48139     int n_val;
48140
48141     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48142         mem_base = xmlMemBlocks();
48143         val = gen_xmlNodePtr(n_val, 0);
48144
48145         ret_val = xmlXPathNodeSetCreate(val);
48146         desret_xmlNodeSetPtr(ret_val);
48147         call_tests++;
48148         des_xmlNodePtr(n_val, val, 0);
48149         xmlResetLastError();
48150         if (mem_base != xmlMemBlocks()) {
48151             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
48152                    xmlMemBlocks() - mem_base);
48153             test_ret++;
48154             printf(" %d", n_val);
48155             printf("\n");
48156         }
48157     }
48158     function_tests++;
48159 #endif
48160
48161     return(test_ret);
48162 }
48163
48164
48165 static int
48166 test_xmlXPathObjectCopy(void) {
48167     int test_ret = 0;
48168
48169 #if defined(LIBXML_XPATH_ENABLED)
48170     int mem_base;
48171     xmlXPathObjectPtr ret_val;
48172     xmlXPathObjectPtr val; /* the original object */
48173     int n_val;
48174
48175     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
48176         mem_base = xmlMemBlocks();
48177         val = gen_xmlXPathObjectPtr(n_val, 0);
48178
48179         ret_val = xmlXPathObjectCopy(val);
48180         desret_xmlXPathObjectPtr(ret_val);
48181         call_tests++;
48182         des_xmlXPathObjectPtr(n_val, val, 0);
48183         xmlResetLastError();
48184         if (mem_base != xmlMemBlocks()) {
48185             printf("Leak of %d blocks found in xmlXPathObjectCopy",
48186                    xmlMemBlocks() - mem_base);
48187             test_ret++;
48188             printf(" %d", n_val);
48189             printf("\n");
48190         }
48191     }
48192     function_tests++;
48193 #endif
48194
48195     return(test_ret);
48196 }
48197
48198
48199 static int
48200 test_xmlXPathOrderDocElems(void) {
48201     int test_ret = 0;
48202
48203 #if defined(LIBXML_XPATH_ENABLED)
48204     int mem_base;
48205     long ret_val;
48206     xmlDocPtr doc; /* an input document */
48207     int n_doc;
48208
48209     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
48210         mem_base = xmlMemBlocks();
48211         doc = gen_xmlDocPtr(n_doc, 0);
48212
48213         ret_val = xmlXPathOrderDocElems(doc);
48214         desret_long(ret_val);
48215         call_tests++;
48216         des_xmlDocPtr(n_doc, doc, 0);
48217         xmlResetLastError();
48218         if (mem_base != xmlMemBlocks()) {
48219             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
48220                    xmlMemBlocks() - mem_base);
48221             test_ret++;
48222             printf(" %d", n_doc);
48223             printf("\n");
48224         }
48225     }
48226     function_tests++;
48227 #endif
48228
48229     return(test_ret);
48230 }
48231
48232
48233 static int
48234 test_xmlXPathSetContextNode(void) {
48235     int test_ret = 0;
48236
48237 #if defined(LIBXML_XPATH_ENABLED)
48238     int mem_base;
48239     int ret_val;
48240     xmlNodePtr node; /* the node to to use as the context node */
48241     int n_node;
48242     xmlXPathContextPtr ctx; /* the XPath context */
48243     int n_ctx;
48244
48245     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48246     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
48247         mem_base = xmlMemBlocks();
48248         node = gen_xmlNodePtr(n_node, 0);
48249         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
48250
48251         ret_val = xmlXPathSetContextNode(node, ctx);
48252         desret_int(ret_val);
48253         call_tests++;
48254         des_xmlNodePtr(n_node, node, 0);
48255         des_xmlXPathContextPtr(n_ctx, ctx, 1);
48256         xmlResetLastError();
48257         if (mem_base != xmlMemBlocks()) {
48258             printf("Leak of %d blocks found in xmlXPathSetContextNode",
48259                    xmlMemBlocks() - mem_base);
48260             test_ret++;
48261             printf(" %d", n_node);
48262             printf(" %d", n_ctx);
48263             printf("\n");
48264         }
48265     }
48266     }
48267     function_tests++;
48268 #endif
48269
48270     return(test_ret);
48271 }
48272
48273 static int
48274 test_xpath(void) {
48275     int test_ret = 0;
48276         int rc = 0;
48277
48278     if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
48279     rc = test_xmlXPathCastBooleanToNumber();
48280         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48281     rc = test_xmlXPathCastBooleanToString();
48282         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48283     rc = test_xmlXPathCastNodeSetToBoolean();
48284         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48285     rc = test_xmlXPathCastNodeSetToNumber();
48286         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48287     rc = test_xmlXPathCastNodeSetToString();
48288         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48289     rc = test_xmlXPathCastNodeToNumber();
48290         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48291     rc = test_xmlXPathCastNodeToString();
48292         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48293     rc = test_xmlXPathCastNumberToBoolean();
48294         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48295     rc = test_xmlXPathCastNumberToString();
48296         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48297     rc = test_xmlXPathCastStringToBoolean();
48298         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48299     rc = test_xmlXPathCastStringToNumber();
48300         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48301     rc = test_xmlXPathCastToBoolean();
48302         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48303     rc = test_xmlXPathCastToNumber();
48304         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48305     rc = test_xmlXPathCastToString();
48306         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48307     rc = test_xmlXPathCmpNodes();
48308         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48309     rc = test_xmlXPathCompile();
48310         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48311     rc = test_xmlXPathCompiledEval();
48312         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48313     rc = test_xmlXPathCompiledEvalToBoolean();
48314         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48315     rc = test_xmlXPathContextSetCache();
48316         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48317     rc = test_xmlXPathConvertBoolean();
48318         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48319     rc = test_xmlXPathConvertNumber();
48320         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48321     rc = test_xmlXPathConvertString();
48322         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48323     rc = test_xmlXPathCtxtCompile();
48324         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48325     rc = test_xmlXPathEval();
48326         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48327     rc = test_xmlXPathEvalExpression();
48328         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48329     rc = test_xmlXPathEvalPredicate();
48330         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48331     rc = test_xmlXPathInit();
48332         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48333     rc = test_xmlXPathIsInf();
48334         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48335     rc = test_xmlXPathIsNaN();
48336         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48337     rc = test_xmlXPathNewContext();
48338         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48339     rc = test_xmlXPathNodeEval();
48340         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48341     rc = test_xmlXPathNodeSetCreate();
48342         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48343     rc = test_xmlXPathObjectCopy();
48344         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48345     rc = test_xmlXPathOrderDocElems();
48346         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48347     rc = test_xmlXPathSetContextNode();
48348         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48349
48350     if (test_ret != 0)
48351         printf("Module xpath: %d errors\n", test_ret);
48352     return(test_ret);
48353 }
48354 #ifdef LIBXML_XPATH_ENABLED
48355
48356 #define gen_nb_xmlXPathParserContextPtr 1
48357 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
48358     return(NULL);
48359 }
48360 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
48361 }
48362 #endif
48363
48364
48365 static int
48366 test_valuePop(void) {
48367     int test_ret = 0;
48368
48369 #if defined(LIBXML_XPATH_ENABLED)
48370     int mem_base;
48371     xmlXPathObjectPtr ret_val;
48372     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
48373     int n_ctxt;
48374
48375     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48376         mem_base = xmlMemBlocks();
48377         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48378
48379         ret_val = valuePop(ctxt);
48380         desret_xmlXPathObjectPtr(ret_val);
48381         call_tests++;
48382         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48383         xmlResetLastError();
48384         if (mem_base != xmlMemBlocks()) {
48385             printf("Leak of %d blocks found in valuePop",
48386                    xmlMemBlocks() - mem_base);
48387             test_ret++;
48388             printf(" %d", n_ctxt);
48389             printf("\n");
48390         }
48391     }
48392     function_tests++;
48393 #endif
48394
48395     return(test_ret);
48396 }
48397
48398
48399 static int
48400 test_valuePush(void) {
48401     int test_ret = 0;
48402
48403 #if defined(LIBXML_XPATH_ENABLED)
48404     int mem_base;
48405     int ret_val;
48406     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
48407     int n_ctxt;
48408     xmlXPathObjectPtr value; /* the XPath object */
48409     int n_value;
48410
48411     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48412     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
48413         mem_base = xmlMemBlocks();
48414         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48415         value = gen_xmlXPathObjectPtr(n_value, 1);
48416
48417         ret_val = valuePush(ctxt, value);
48418         desret_int(ret_val);
48419         call_tests++;
48420         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48421         des_xmlXPathObjectPtr(n_value, value, 1);
48422         xmlResetLastError();
48423         if (mem_base != xmlMemBlocks()) {
48424             printf("Leak of %d blocks found in valuePush",
48425                    xmlMemBlocks() - mem_base);
48426             test_ret++;
48427             printf(" %d", n_ctxt);
48428             printf(" %d", n_value);
48429             printf("\n");
48430         }
48431     }
48432     }
48433     function_tests++;
48434 #endif
48435
48436     return(test_ret);
48437 }
48438
48439
48440 static int
48441 test_xmlXPathAddValues(void) {
48442     int test_ret = 0;
48443
48444 #if defined(LIBXML_XPATH_ENABLED)
48445     int mem_base;
48446     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48447     int n_ctxt;
48448
48449     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48450         mem_base = xmlMemBlocks();
48451         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48452
48453         xmlXPathAddValues(ctxt);
48454         call_tests++;
48455         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48456         xmlResetLastError();
48457         if (mem_base != xmlMemBlocks()) {
48458             printf("Leak of %d blocks found in xmlXPathAddValues",
48459                    xmlMemBlocks() - mem_base);
48460             test_ret++;
48461             printf(" %d", n_ctxt);
48462             printf("\n");
48463         }
48464     }
48465     function_tests++;
48466 #endif
48467
48468     return(test_ret);
48469 }
48470
48471
48472 static int
48473 test_xmlXPathBooleanFunction(void) {
48474     int test_ret = 0;
48475
48476 #if defined(LIBXML_XPATH_ENABLED)
48477     int mem_base;
48478     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48479     int n_ctxt;
48480     int nargs; /* the number of arguments */
48481     int n_nargs;
48482
48483     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48484     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48485         mem_base = xmlMemBlocks();
48486         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48487         nargs = gen_int(n_nargs, 1);
48488
48489         xmlXPathBooleanFunction(ctxt, nargs);
48490         call_tests++;
48491         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48492         des_int(n_nargs, nargs, 1);
48493         xmlResetLastError();
48494         if (mem_base != xmlMemBlocks()) {
48495             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
48496                    xmlMemBlocks() - mem_base);
48497             test_ret++;
48498             printf(" %d", n_ctxt);
48499             printf(" %d", n_nargs);
48500             printf("\n");
48501         }
48502     }
48503     }
48504     function_tests++;
48505 #endif
48506
48507     return(test_ret);
48508 }
48509
48510
48511 static int
48512 test_xmlXPathCeilingFunction(void) {
48513     int test_ret = 0;
48514
48515 #if defined(LIBXML_XPATH_ENABLED)
48516     int mem_base;
48517     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48518     int n_ctxt;
48519     int nargs; /* the number of arguments */
48520     int n_nargs;
48521
48522     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48523     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48524         mem_base = xmlMemBlocks();
48525         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48526         nargs = gen_int(n_nargs, 1);
48527
48528         xmlXPathCeilingFunction(ctxt, nargs);
48529         call_tests++;
48530         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48531         des_int(n_nargs, nargs, 1);
48532         xmlResetLastError();
48533         if (mem_base != xmlMemBlocks()) {
48534             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
48535                    xmlMemBlocks() - mem_base);
48536             test_ret++;
48537             printf(" %d", n_ctxt);
48538             printf(" %d", n_nargs);
48539             printf("\n");
48540         }
48541     }
48542     }
48543     function_tests++;
48544 #endif
48545
48546     return(test_ret);
48547 }
48548
48549
48550 static int
48551 test_xmlXPathCompareValues(void) {
48552     int test_ret = 0;
48553
48554 #if defined(LIBXML_XPATH_ENABLED)
48555     int mem_base;
48556     int ret_val;
48557     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48558     int n_ctxt;
48559     int inf; /* less than (1) or greater than (0) */
48560     int n_inf;
48561     int strict; /* is the comparison strict */
48562     int n_strict;
48563
48564     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48565     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
48566     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
48567         mem_base = xmlMemBlocks();
48568         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48569         inf = gen_int(n_inf, 1);
48570         strict = gen_int(n_strict, 2);
48571
48572         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
48573         desret_int(ret_val);
48574         call_tests++;
48575         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48576         des_int(n_inf, inf, 1);
48577         des_int(n_strict, strict, 2);
48578         xmlResetLastError();
48579         if (mem_base != xmlMemBlocks()) {
48580             printf("Leak of %d blocks found in xmlXPathCompareValues",
48581                    xmlMemBlocks() - mem_base);
48582             test_ret++;
48583             printf(" %d", n_ctxt);
48584             printf(" %d", n_inf);
48585             printf(" %d", n_strict);
48586             printf("\n");
48587         }
48588     }
48589     }
48590     }
48591     function_tests++;
48592 #endif
48593
48594     return(test_ret);
48595 }
48596
48597
48598 static int
48599 test_xmlXPathConcatFunction(void) {
48600     int test_ret = 0;
48601
48602 #if defined(LIBXML_XPATH_ENABLED)
48603     int mem_base;
48604     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48605     int n_ctxt;
48606     int nargs; /* the number of arguments */
48607     int n_nargs;
48608
48609     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48610     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48611         mem_base = xmlMemBlocks();
48612         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48613         nargs = gen_int(n_nargs, 1);
48614
48615         xmlXPathConcatFunction(ctxt, nargs);
48616         call_tests++;
48617         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48618         des_int(n_nargs, nargs, 1);
48619         xmlResetLastError();
48620         if (mem_base != xmlMemBlocks()) {
48621             printf("Leak of %d blocks found in xmlXPathConcatFunction",
48622                    xmlMemBlocks() - mem_base);
48623             test_ret++;
48624             printf(" %d", n_ctxt);
48625             printf(" %d", n_nargs);
48626             printf("\n");
48627         }
48628     }
48629     }
48630     function_tests++;
48631 #endif
48632
48633     return(test_ret);
48634 }
48635
48636
48637 static int
48638 test_xmlXPathContainsFunction(void) {
48639     int test_ret = 0;
48640
48641 #if defined(LIBXML_XPATH_ENABLED)
48642     int mem_base;
48643     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48644     int n_ctxt;
48645     int nargs; /* the number of arguments */
48646     int n_nargs;
48647
48648     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48649     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48650         mem_base = xmlMemBlocks();
48651         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48652         nargs = gen_int(n_nargs, 1);
48653
48654         xmlXPathContainsFunction(ctxt, nargs);
48655         call_tests++;
48656         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48657         des_int(n_nargs, nargs, 1);
48658         xmlResetLastError();
48659         if (mem_base != xmlMemBlocks()) {
48660             printf("Leak of %d blocks found in xmlXPathContainsFunction",
48661                    xmlMemBlocks() - mem_base);
48662             test_ret++;
48663             printf(" %d", n_ctxt);
48664             printf(" %d", n_nargs);
48665             printf("\n");
48666         }
48667     }
48668     }
48669     function_tests++;
48670 #endif
48671
48672     return(test_ret);
48673 }
48674
48675
48676 static int
48677 test_xmlXPathCountFunction(void) {
48678     int test_ret = 0;
48679
48680 #if defined(LIBXML_XPATH_ENABLED)
48681     int mem_base;
48682     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48683     int n_ctxt;
48684     int nargs; /* the number of arguments */
48685     int n_nargs;
48686
48687     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48688     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48689         mem_base = xmlMemBlocks();
48690         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48691         nargs = gen_int(n_nargs, 1);
48692
48693         xmlXPathCountFunction(ctxt, nargs);
48694         call_tests++;
48695         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48696         des_int(n_nargs, nargs, 1);
48697         xmlResetLastError();
48698         if (mem_base != xmlMemBlocks()) {
48699             printf("Leak of %d blocks found in xmlXPathCountFunction",
48700                    xmlMemBlocks() - mem_base);
48701             test_ret++;
48702             printf(" %d", n_ctxt);
48703             printf(" %d", n_nargs);
48704             printf("\n");
48705         }
48706     }
48707     }
48708     function_tests++;
48709 #endif
48710
48711     return(test_ret);
48712 }
48713
48714
48715 static int
48716 test_xmlXPathDebugDumpCompExpr(void) {
48717     int test_ret = 0;
48718
48719 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
48720     int mem_base;
48721     FILE * output; /* the FILE * for the output */
48722     int n_output;
48723     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
48724     int n_comp;
48725     int depth; /* the indentation level. */
48726     int n_depth;
48727
48728     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
48729     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
48730     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
48731         mem_base = xmlMemBlocks();
48732         output = gen_FILE_ptr(n_output, 0);
48733         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
48734         depth = gen_int(n_depth, 2);
48735
48736         xmlXPathDebugDumpCompExpr(output, comp, depth);
48737         call_tests++;
48738         des_FILE_ptr(n_output, output, 0);
48739         des_xmlXPathCompExprPtr(n_comp, comp, 1);
48740         des_int(n_depth, depth, 2);
48741         xmlResetLastError();
48742         if (mem_base != xmlMemBlocks()) {
48743             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
48744                    xmlMemBlocks() - mem_base);
48745             test_ret++;
48746             printf(" %d", n_output);
48747             printf(" %d", n_comp);
48748             printf(" %d", n_depth);
48749             printf("\n");
48750         }
48751     }
48752     }
48753     }
48754     function_tests++;
48755 #endif
48756
48757     return(test_ret);
48758 }
48759
48760
48761 static int
48762 test_xmlXPathDebugDumpObject(void) {
48763     int test_ret = 0;
48764
48765 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
48766     int mem_base;
48767     FILE * output; /* the FILE * to dump the output */
48768     int n_output;
48769     xmlXPathObjectPtr cur; /* the object to inspect */
48770     int n_cur;
48771     int depth; /* indentation level */
48772     int n_depth;
48773
48774     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
48775     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
48776     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
48777         mem_base = xmlMemBlocks();
48778         output = gen_FILE_ptr(n_output, 0);
48779         cur = gen_xmlXPathObjectPtr(n_cur, 1);
48780         depth = gen_int(n_depth, 2);
48781
48782         xmlXPathDebugDumpObject(output, cur, depth);
48783         call_tests++;
48784         des_FILE_ptr(n_output, output, 0);
48785         des_xmlXPathObjectPtr(n_cur, cur, 1);
48786         des_int(n_depth, depth, 2);
48787         xmlResetLastError();
48788         if (mem_base != xmlMemBlocks()) {
48789             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
48790                    xmlMemBlocks() - mem_base);
48791             test_ret++;
48792             printf(" %d", n_output);
48793             printf(" %d", n_cur);
48794             printf(" %d", n_depth);
48795             printf("\n");
48796         }
48797     }
48798     }
48799     }
48800     function_tests++;
48801 #endif
48802
48803     return(test_ret);
48804 }
48805
48806
48807 static int
48808 test_xmlXPathDifference(void) {
48809     int test_ret = 0;
48810
48811 #if defined(LIBXML_XPATH_ENABLED)
48812     int mem_base;
48813     xmlNodeSetPtr ret_val;
48814     xmlNodeSetPtr nodes1; /* a node-set */
48815     int n_nodes1;
48816     xmlNodeSetPtr nodes2; /* a node-set */
48817     int n_nodes2;
48818
48819     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48820     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48821         mem_base = xmlMemBlocks();
48822         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48823         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48824
48825         ret_val = xmlXPathDifference(nodes1, nodes2);
48826         desret_xmlNodeSetPtr(ret_val);
48827         call_tests++;
48828         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48829         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48830         xmlResetLastError();
48831         if (mem_base != xmlMemBlocks()) {
48832             printf("Leak of %d blocks found in xmlXPathDifference",
48833                    xmlMemBlocks() - mem_base);
48834             test_ret++;
48835             printf(" %d", n_nodes1);
48836             printf(" %d", n_nodes2);
48837             printf("\n");
48838         }
48839     }
48840     }
48841     function_tests++;
48842 #endif
48843
48844     return(test_ret);
48845 }
48846
48847
48848 static int
48849 test_xmlXPathDistinct(void) {
48850     int test_ret = 0;
48851
48852 #if defined(LIBXML_XPATH_ENABLED)
48853     int mem_base;
48854     xmlNodeSetPtr ret_val;
48855     xmlNodeSetPtr nodes; /* a node-set */
48856     int n_nodes;
48857
48858     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48859         mem_base = xmlMemBlocks();
48860         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48861
48862         ret_val = xmlXPathDistinct(nodes);
48863         desret_xmlNodeSetPtr(ret_val);
48864         call_tests++;
48865         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48866         xmlResetLastError();
48867         if (mem_base != xmlMemBlocks()) {
48868             printf("Leak of %d blocks found in xmlXPathDistinct",
48869                    xmlMemBlocks() - mem_base);
48870             test_ret++;
48871             printf(" %d", n_nodes);
48872             printf("\n");
48873         }
48874     }
48875     function_tests++;
48876 #endif
48877
48878     return(test_ret);
48879 }
48880
48881
48882 static int
48883 test_xmlXPathDistinctSorted(void) {
48884     int test_ret = 0;
48885
48886 #if defined(LIBXML_XPATH_ENABLED)
48887     int mem_base;
48888     xmlNodeSetPtr ret_val;
48889     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48890     int n_nodes;
48891
48892     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48893         mem_base = xmlMemBlocks();
48894         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48895
48896         ret_val = xmlXPathDistinctSorted(nodes);
48897         desret_xmlNodeSetPtr(ret_val);
48898         call_tests++;
48899         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48900         xmlResetLastError();
48901         if (mem_base != xmlMemBlocks()) {
48902             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
48903                    xmlMemBlocks() - mem_base);
48904             test_ret++;
48905             printf(" %d", n_nodes);
48906             printf("\n");
48907         }
48908     }
48909     function_tests++;
48910 #endif
48911
48912     return(test_ret);
48913 }
48914
48915
48916 static int
48917 test_xmlXPathDivValues(void) {
48918     int test_ret = 0;
48919
48920 #if defined(LIBXML_XPATH_ENABLED)
48921     int mem_base;
48922     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48923     int n_ctxt;
48924
48925     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48926         mem_base = xmlMemBlocks();
48927         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48928
48929         xmlXPathDivValues(ctxt);
48930         call_tests++;
48931         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48932         xmlResetLastError();
48933         if (mem_base != xmlMemBlocks()) {
48934             printf("Leak of %d blocks found in xmlXPathDivValues",
48935                    xmlMemBlocks() - mem_base);
48936             test_ret++;
48937             printf(" %d", n_ctxt);
48938             printf("\n");
48939         }
48940     }
48941     function_tests++;
48942 #endif
48943
48944     return(test_ret);
48945 }
48946
48947
48948 static int
48949 test_xmlXPathEqualValues(void) {
48950     int test_ret = 0;
48951
48952 #if defined(LIBXML_XPATH_ENABLED)
48953     int mem_base;
48954     int ret_val;
48955     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48956     int n_ctxt;
48957
48958     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48959         mem_base = xmlMemBlocks();
48960         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48961
48962         ret_val = xmlXPathEqualValues(ctxt);
48963         desret_int(ret_val);
48964         call_tests++;
48965         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48966         xmlResetLastError();
48967         if (mem_base != xmlMemBlocks()) {
48968             printf("Leak of %d blocks found in xmlXPathEqualValues",
48969                    xmlMemBlocks() - mem_base);
48970             test_ret++;
48971             printf(" %d", n_ctxt);
48972             printf("\n");
48973         }
48974     }
48975     function_tests++;
48976 #endif
48977
48978     return(test_ret);
48979 }
48980
48981
48982 static int
48983 test_xmlXPathErr(void) {
48984     int test_ret = 0;
48985
48986 #if defined(LIBXML_XPATH_ENABLED)
48987     int mem_base;
48988     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
48989     int n_ctxt;
48990     int error; /* the error code */
48991     int n_error;
48992
48993     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48994     for (n_error = 0;n_error < gen_nb_int;n_error++) {
48995         mem_base = xmlMemBlocks();
48996         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48997         error = gen_int(n_error, 1);
48998
48999         xmlXPathErr(ctxt, error);
49000         call_tests++;
49001         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49002         des_int(n_error, error, 1);
49003         xmlResetLastError();
49004         if (mem_base != xmlMemBlocks()) {
49005             printf("Leak of %d blocks found in xmlXPathErr",
49006                    xmlMemBlocks() - mem_base);
49007             test_ret++;
49008             printf(" %d", n_ctxt);
49009             printf(" %d", n_error);
49010             printf("\n");
49011         }
49012     }
49013     }
49014     function_tests++;
49015 #endif
49016
49017     return(test_ret);
49018 }
49019
49020
49021 static int
49022 test_xmlXPathEvalExpr(void) {
49023     int test_ret = 0;
49024
49025 #if defined(LIBXML_XPATH_ENABLED)
49026     int mem_base;
49027     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49028     int n_ctxt;
49029
49030     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49031         mem_base = xmlMemBlocks();
49032         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49033
49034         xmlXPathEvalExpr(ctxt);
49035         call_tests++;
49036         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49037         xmlResetLastError();
49038         if (mem_base != xmlMemBlocks()) {
49039             printf("Leak of %d blocks found in xmlXPathEvalExpr",
49040                    xmlMemBlocks() - mem_base);
49041             test_ret++;
49042             printf(" %d", n_ctxt);
49043             printf("\n");
49044         }
49045     }
49046     function_tests++;
49047 #endif
49048
49049     return(test_ret);
49050 }
49051
49052
49053 static int
49054 test_xmlXPathEvaluatePredicateResult(void) {
49055     int test_ret = 0;
49056
49057 #if defined(LIBXML_XPATH_ENABLED)
49058     int mem_base;
49059     int ret_val;
49060     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49061     int n_ctxt;
49062     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
49063     int n_res;
49064
49065     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49066     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
49067         mem_base = xmlMemBlocks();
49068         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49069         res = gen_xmlXPathObjectPtr(n_res, 1);
49070
49071         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
49072         desret_int(ret_val);
49073         call_tests++;
49074         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49075         des_xmlXPathObjectPtr(n_res, res, 1);
49076         xmlResetLastError();
49077         if (mem_base != xmlMemBlocks()) {
49078             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
49079                    xmlMemBlocks() - mem_base);
49080             test_ret++;
49081             printf(" %d", n_ctxt);
49082             printf(" %d", n_res);
49083             printf("\n");
49084         }
49085     }
49086     }
49087     function_tests++;
49088 #endif
49089
49090     return(test_ret);
49091 }
49092
49093
49094 static int
49095 test_xmlXPathFalseFunction(void) {
49096     int test_ret = 0;
49097
49098 #if defined(LIBXML_XPATH_ENABLED)
49099     int mem_base;
49100     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49101     int n_ctxt;
49102     int nargs; /* the number of arguments */
49103     int n_nargs;
49104
49105     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49106     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49107         mem_base = xmlMemBlocks();
49108         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49109         nargs = gen_int(n_nargs, 1);
49110
49111         xmlXPathFalseFunction(ctxt, nargs);
49112         call_tests++;
49113         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49114         des_int(n_nargs, nargs, 1);
49115         xmlResetLastError();
49116         if (mem_base != xmlMemBlocks()) {
49117             printf("Leak of %d blocks found in xmlXPathFalseFunction",
49118                    xmlMemBlocks() - mem_base);
49119             test_ret++;
49120             printf(" %d", n_ctxt);
49121             printf(" %d", n_nargs);
49122             printf("\n");
49123         }
49124     }
49125     }
49126     function_tests++;
49127 #endif
49128
49129     return(test_ret);
49130 }
49131
49132
49133 static int
49134 test_xmlXPathFloorFunction(void) {
49135     int test_ret = 0;
49136
49137 #if defined(LIBXML_XPATH_ENABLED)
49138     int mem_base;
49139     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49140     int n_ctxt;
49141     int nargs; /* the number of arguments */
49142     int n_nargs;
49143
49144     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49145     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49146         mem_base = xmlMemBlocks();
49147         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49148         nargs = gen_int(n_nargs, 1);
49149
49150         xmlXPathFloorFunction(ctxt, nargs);
49151         call_tests++;
49152         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49153         des_int(n_nargs, nargs, 1);
49154         xmlResetLastError();
49155         if (mem_base != xmlMemBlocks()) {
49156             printf("Leak of %d blocks found in xmlXPathFloorFunction",
49157                    xmlMemBlocks() - mem_base);
49158             test_ret++;
49159             printf(" %d", n_ctxt);
49160             printf(" %d", n_nargs);
49161             printf("\n");
49162         }
49163     }
49164     }
49165     function_tests++;
49166 #endif
49167
49168     return(test_ret);
49169 }
49170
49171
49172 static int
49173 test_xmlXPathFunctionLookup(void) {
49174     int test_ret = 0;
49175
49176
49177     /* missing type support */
49178     return(test_ret);
49179 }
49180
49181
49182 static int
49183 test_xmlXPathFunctionLookupNS(void) {
49184     int test_ret = 0;
49185
49186
49187     /* missing type support */
49188     return(test_ret);
49189 }
49190
49191
49192 static int
49193 test_xmlXPathHasSameNodes(void) {
49194     int test_ret = 0;
49195
49196 #if defined(LIBXML_XPATH_ENABLED)
49197     int mem_base;
49198     int ret_val;
49199     xmlNodeSetPtr nodes1; /* a node-set */
49200     int n_nodes1;
49201     xmlNodeSetPtr nodes2; /* a node-set */
49202     int n_nodes2;
49203
49204     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49205     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49206         mem_base = xmlMemBlocks();
49207         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49208         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49209
49210         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
49211         desret_int(ret_val);
49212         call_tests++;
49213         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49214         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49215         xmlResetLastError();
49216         if (mem_base != xmlMemBlocks()) {
49217             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
49218                    xmlMemBlocks() - mem_base);
49219             test_ret++;
49220             printf(" %d", n_nodes1);
49221             printf(" %d", n_nodes2);
49222             printf("\n");
49223         }
49224     }
49225     }
49226     function_tests++;
49227 #endif
49228
49229     return(test_ret);
49230 }
49231
49232
49233 static int
49234 test_xmlXPathIdFunction(void) {
49235     int test_ret = 0;
49236
49237 #if defined(LIBXML_XPATH_ENABLED)
49238     int mem_base;
49239     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49240     int n_ctxt;
49241     int nargs; /* the number of arguments */
49242     int n_nargs;
49243
49244     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49245     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49246         mem_base = xmlMemBlocks();
49247         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49248         nargs = gen_int(n_nargs, 1);
49249
49250         xmlXPathIdFunction(ctxt, nargs);
49251         call_tests++;
49252         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49253         des_int(n_nargs, nargs, 1);
49254         xmlResetLastError();
49255         if (mem_base != xmlMemBlocks()) {
49256             printf("Leak of %d blocks found in xmlXPathIdFunction",
49257                    xmlMemBlocks() - mem_base);
49258             test_ret++;
49259             printf(" %d", n_ctxt);
49260             printf(" %d", n_nargs);
49261             printf("\n");
49262         }
49263     }
49264     }
49265     function_tests++;
49266 #endif
49267
49268     return(test_ret);
49269 }
49270
49271
49272 static int
49273 test_xmlXPathIntersection(void) {
49274     int test_ret = 0;
49275
49276 #if defined(LIBXML_XPATH_ENABLED)
49277     int mem_base;
49278     xmlNodeSetPtr ret_val;
49279     xmlNodeSetPtr nodes1; /* a node-set */
49280     int n_nodes1;
49281     xmlNodeSetPtr nodes2; /* a node-set */
49282     int n_nodes2;
49283
49284     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49285     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49286         mem_base = xmlMemBlocks();
49287         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49288         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49289
49290         ret_val = xmlXPathIntersection(nodes1, nodes2);
49291         desret_xmlNodeSetPtr(ret_val);
49292         call_tests++;
49293         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49294         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49295         xmlResetLastError();
49296         if (mem_base != xmlMemBlocks()) {
49297             printf("Leak of %d blocks found in xmlXPathIntersection",
49298                    xmlMemBlocks() - mem_base);
49299             test_ret++;
49300             printf(" %d", n_nodes1);
49301             printf(" %d", n_nodes2);
49302             printf("\n");
49303         }
49304     }
49305     }
49306     function_tests++;
49307 #endif
49308
49309     return(test_ret);
49310 }
49311
49312
49313 static int
49314 test_xmlXPathIsNodeType(void) {
49315     int test_ret = 0;
49316
49317 #if defined(LIBXML_XPATH_ENABLED)
49318     int mem_base;
49319     int ret_val;
49320     xmlChar * name; /* a name string */
49321     int n_name;
49322
49323     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49324         mem_base = xmlMemBlocks();
49325         name = gen_const_xmlChar_ptr(n_name, 0);
49326
49327         ret_val = xmlXPathIsNodeType((const xmlChar *)name);
49328         desret_int(ret_val);
49329         call_tests++;
49330         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
49331         xmlResetLastError();
49332         if (mem_base != xmlMemBlocks()) {
49333             printf("Leak of %d blocks found in xmlXPathIsNodeType",
49334                    xmlMemBlocks() - mem_base);
49335             test_ret++;
49336             printf(" %d", n_name);
49337             printf("\n");
49338         }
49339     }
49340     function_tests++;
49341 #endif
49342
49343     return(test_ret);
49344 }
49345
49346
49347 static int
49348 test_xmlXPathLangFunction(void) {
49349     int test_ret = 0;
49350
49351 #if defined(LIBXML_XPATH_ENABLED)
49352     int mem_base;
49353     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49354     int n_ctxt;
49355     int nargs; /* the number of arguments */
49356     int n_nargs;
49357
49358     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49359     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49360         mem_base = xmlMemBlocks();
49361         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49362         nargs = gen_int(n_nargs, 1);
49363
49364         xmlXPathLangFunction(ctxt, nargs);
49365         call_tests++;
49366         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49367         des_int(n_nargs, nargs, 1);
49368         xmlResetLastError();
49369         if (mem_base != xmlMemBlocks()) {
49370             printf("Leak of %d blocks found in xmlXPathLangFunction",
49371                    xmlMemBlocks() - mem_base);
49372             test_ret++;
49373             printf(" %d", n_ctxt);
49374             printf(" %d", n_nargs);
49375             printf("\n");
49376         }
49377     }
49378     }
49379     function_tests++;
49380 #endif
49381
49382     return(test_ret);
49383 }
49384
49385
49386 static int
49387 test_xmlXPathLastFunction(void) {
49388     int test_ret = 0;
49389
49390 #if defined(LIBXML_XPATH_ENABLED)
49391     int mem_base;
49392     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49393     int n_ctxt;
49394     int nargs; /* the number of arguments */
49395     int n_nargs;
49396
49397     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49398     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49399         mem_base = xmlMemBlocks();
49400         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49401         nargs = gen_int(n_nargs, 1);
49402
49403         xmlXPathLastFunction(ctxt, nargs);
49404         call_tests++;
49405         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49406         des_int(n_nargs, nargs, 1);
49407         xmlResetLastError();
49408         if (mem_base != xmlMemBlocks()) {
49409             printf("Leak of %d blocks found in xmlXPathLastFunction",
49410                    xmlMemBlocks() - mem_base);
49411             test_ret++;
49412             printf(" %d", n_ctxt);
49413             printf(" %d", n_nargs);
49414             printf("\n");
49415         }
49416     }
49417     }
49418     function_tests++;
49419 #endif
49420
49421     return(test_ret);
49422 }
49423
49424
49425 static int
49426 test_xmlXPathLeading(void) {
49427     int test_ret = 0;
49428
49429 #if defined(LIBXML_XPATH_ENABLED)
49430     int mem_base;
49431     xmlNodeSetPtr ret_val;
49432     xmlNodeSetPtr nodes1; /* a node-set */
49433     int n_nodes1;
49434     xmlNodeSetPtr nodes2; /* a node-set */
49435     int n_nodes2;
49436
49437     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49438     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49439         mem_base = xmlMemBlocks();
49440         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49441         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49442
49443         ret_val = xmlXPathLeading(nodes1, nodes2);
49444         desret_xmlNodeSetPtr(ret_val);
49445         call_tests++;
49446         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49447         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49448         xmlResetLastError();
49449         if (mem_base != xmlMemBlocks()) {
49450             printf("Leak of %d blocks found in xmlXPathLeading",
49451                    xmlMemBlocks() - mem_base);
49452             test_ret++;
49453             printf(" %d", n_nodes1);
49454             printf(" %d", n_nodes2);
49455             printf("\n");
49456         }
49457     }
49458     }
49459     function_tests++;
49460 #endif
49461
49462     return(test_ret);
49463 }
49464
49465
49466 static int
49467 test_xmlXPathLeadingSorted(void) {
49468     int test_ret = 0;
49469
49470 #if defined(LIBXML_XPATH_ENABLED)
49471     int mem_base;
49472     xmlNodeSetPtr ret_val;
49473     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
49474     int n_nodes1;
49475     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
49476     int n_nodes2;
49477
49478     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49479     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49480         mem_base = xmlMemBlocks();
49481         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49482         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49483
49484         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
49485         desret_xmlNodeSetPtr(ret_val);
49486         call_tests++;
49487         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49488         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49489         xmlResetLastError();
49490         if (mem_base != xmlMemBlocks()) {
49491             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
49492                    xmlMemBlocks() - mem_base);
49493             test_ret++;
49494             printf(" %d", n_nodes1);
49495             printf(" %d", n_nodes2);
49496             printf("\n");
49497         }
49498     }
49499     }
49500     function_tests++;
49501 #endif
49502
49503     return(test_ret);
49504 }
49505
49506
49507 static int
49508 test_xmlXPathLocalNameFunction(void) {
49509     int test_ret = 0;
49510
49511 #if defined(LIBXML_XPATH_ENABLED)
49512     int mem_base;
49513     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49514     int n_ctxt;
49515     int nargs; /* the number of arguments */
49516     int n_nargs;
49517
49518     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49519     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49520         mem_base = xmlMemBlocks();
49521         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49522         nargs = gen_int(n_nargs, 1);
49523
49524         xmlXPathLocalNameFunction(ctxt, nargs);
49525         call_tests++;
49526         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49527         des_int(n_nargs, nargs, 1);
49528         xmlResetLastError();
49529         if (mem_base != xmlMemBlocks()) {
49530             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
49531                    xmlMemBlocks() - mem_base);
49532             test_ret++;
49533             printf(" %d", n_ctxt);
49534             printf(" %d", n_nargs);
49535             printf("\n");
49536         }
49537     }
49538     }
49539     function_tests++;
49540 #endif
49541
49542     return(test_ret);
49543 }
49544
49545
49546 static int
49547 test_xmlXPathModValues(void) {
49548     int test_ret = 0;
49549
49550 #if defined(LIBXML_XPATH_ENABLED)
49551     int mem_base;
49552     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49553     int n_ctxt;
49554
49555     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49556         mem_base = xmlMemBlocks();
49557         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49558
49559         xmlXPathModValues(ctxt);
49560         call_tests++;
49561         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49562         xmlResetLastError();
49563         if (mem_base != xmlMemBlocks()) {
49564             printf("Leak of %d blocks found in xmlXPathModValues",
49565                    xmlMemBlocks() - mem_base);
49566             test_ret++;
49567             printf(" %d", n_ctxt);
49568             printf("\n");
49569         }
49570     }
49571     function_tests++;
49572 #endif
49573
49574     return(test_ret);
49575 }
49576
49577
49578 static int
49579 test_xmlXPathMultValues(void) {
49580     int test_ret = 0;
49581
49582 #if defined(LIBXML_XPATH_ENABLED)
49583     int mem_base;
49584     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49585     int n_ctxt;
49586
49587     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49588         mem_base = xmlMemBlocks();
49589         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49590
49591         xmlXPathMultValues(ctxt);
49592         call_tests++;
49593         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49594         xmlResetLastError();
49595         if (mem_base != xmlMemBlocks()) {
49596             printf("Leak of %d blocks found in xmlXPathMultValues",
49597                    xmlMemBlocks() - mem_base);
49598             test_ret++;
49599             printf(" %d", n_ctxt);
49600             printf("\n");
49601         }
49602     }
49603     function_tests++;
49604 #endif
49605
49606     return(test_ret);
49607 }
49608
49609
49610 static int
49611 test_xmlXPathNamespaceURIFunction(void) {
49612     int test_ret = 0;
49613
49614 #if defined(LIBXML_XPATH_ENABLED)
49615     int mem_base;
49616     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49617     int n_ctxt;
49618     int nargs; /* the number of arguments */
49619     int n_nargs;
49620
49621     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49622     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49623         mem_base = xmlMemBlocks();
49624         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49625         nargs = gen_int(n_nargs, 1);
49626
49627         xmlXPathNamespaceURIFunction(ctxt, nargs);
49628         call_tests++;
49629         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49630         des_int(n_nargs, nargs, 1);
49631         xmlResetLastError();
49632         if (mem_base != xmlMemBlocks()) {
49633             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
49634                    xmlMemBlocks() - mem_base);
49635             test_ret++;
49636             printf(" %d", n_ctxt);
49637             printf(" %d", n_nargs);
49638             printf("\n");
49639         }
49640     }
49641     }
49642     function_tests++;
49643 #endif
49644
49645     return(test_ret);
49646 }
49647
49648
49649 static int
49650 test_xmlXPathNewBoolean(void) {
49651     int test_ret = 0;
49652
49653 #if defined(LIBXML_XPATH_ENABLED)
49654     int mem_base;
49655     xmlXPathObjectPtr ret_val;
49656     int val; /* the boolean value */
49657     int n_val;
49658
49659     for (n_val = 0;n_val < gen_nb_int;n_val++) {
49660         mem_base = xmlMemBlocks();
49661         val = gen_int(n_val, 0);
49662
49663         ret_val = xmlXPathNewBoolean(val);
49664         desret_xmlXPathObjectPtr(ret_val);
49665         call_tests++;
49666         des_int(n_val, val, 0);
49667         xmlResetLastError();
49668         if (mem_base != xmlMemBlocks()) {
49669             printf("Leak of %d blocks found in xmlXPathNewBoolean",
49670                    xmlMemBlocks() - mem_base);
49671             test_ret++;
49672             printf(" %d", n_val);
49673             printf("\n");
49674         }
49675     }
49676     function_tests++;
49677 #endif
49678
49679     return(test_ret);
49680 }
49681
49682
49683 static int
49684 test_xmlXPathNewCString(void) {
49685     int test_ret = 0;
49686
49687 #if defined(LIBXML_XPATH_ENABLED)
49688     int mem_base;
49689     xmlXPathObjectPtr ret_val;
49690     char * val; /* the char * value */
49691     int n_val;
49692
49693     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
49694         mem_base = xmlMemBlocks();
49695         val = gen_const_char_ptr(n_val, 0);
49696
49697         ret_val = xmlXPathNewCString((const char *)val);
49698         desret_xmlXPathObjectPtr(ret_val);
49699         call_tests++;
49700         des_const_char_ptr(n_val, (const char *)val, 0);
49701         xmlResetLastError();
49702         if (mem_base != xmlMemBlocks()) {
49703             printf("Leak of %d blocks found in xmlXPathNewCString",
49704                    xmlMemBlocks() - mem_base);
49705             test_ret++;
49706             printf(" %d", n_val);
49707             printf("\n");
49708         }
49709     }
49710     function_tests++;
49711 #endif
49712
49713     return(test_ret);
49714 }
49715
49716
49717 static int
49718 test_xmlXPathNewFloat(void) {
49719     int test_ret = 0;
49720
49721 #if defined(LIBXML_XPATH_ENABLED)
49722     int mem_base;
49723     xmlXPathObjectPtr ret_val;
49724     double val; /* the double value */
49725     int n_val;
49726
49727     for (n_val = 0;n_val < gen_nb_double;n_val++) {
49728         mem_base = xmlMemBlocks();
49729         val = gen_double(n_val, 0);
49730
49731         ret_val = xmlXPathNewFloat(val);
49732         desret_xmlXPathObjectPtr(ret_val);
49733         call_tests++;
49734         des_double(n_val, val, 0);
49735         xmlResetLastError();
49736         if (mem_base != xmlMemBlocks()) {
49737             printf("Leak of %d blocks found in xmlXPathNewFloat",
49738                    xmlMemBlocks() - mem_base);
49739             test_ret++;
49740             printf(" %d", n_val);
49741             printf("\n");
49742         }
49743     }
49744     function_tests++;
49745 #endif
49746
49747     return(test_ret);
49748 }
49749
49750
49751 static int
49752 test_xmlXPathNewNodeSet(void) {
49753     int test_ret = 0;
49754
49755 #if defined(LIBXML_XPATH_ENABLED)
49756     int mem_base;
49757     xmlXPathObjectPtr ret_val;
49758     xmlNodePtr val; /* the NodePtr value */
49759     int n_val;
49760
49761     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49762         mem_base = xmlMemBlocks();
49763         val = gen_xmlNodePtr(n_val, 0);
49764
49765         ret_val = xmlXPathNewNodeSet(val);
49766         desret_xmlXPathObjectPtr(ret_val);
49767         call_tests++;
49768         des_xmlNodePtr(n_val, val, 0);
49769         xmlResetLastError();
49770         if (mem_base != xmlMemBlocks()) {
49771             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
49772                    xmlMemBlocks() - mem_base);
49773             test_ret++;
49774             printf(" %d", n_val);
49775             printf("\n");
49776         }
49777     }
49778     function_tests++;
49779 #endif
49780
49781     return(test_ret);
49782 }
49783
49784
49785 static int
49786 test_xmlXPathNewNodeSetList(void) {
49787     int test_ret = 0;
49788
49789 #if defined(LIBXML_XPATH_ENABLED)
49790     int mem_base;
49791     xmlXPathObjectPtr ret_val;
49792     xmlNodeSetPtr val; /* an existing NodeSet */
49793     int n_val;
49794
49795     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
49796         mem_base = xmlMemBlocks();
49797         val = gen_xmlNodeSetPtr(n_val, 0);
49798
49799         ret_val = xmlXPathNewNodeSetList(val);
49800         desret_xmlXPathObjectPtr(ret_val);
49801         call_tests++;
49802         des_xmlNodeSetPtr(n_val, val, 0);
49803         xmlResetLastError();
49804         if (mem_base != xmlMemBlocks()) {
49805             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
49806                    xmlMemBlocks() - mem_base);
49807             test_ret++;
49808             printf(" %d", n_val);
49809             printf("\n");
49810         }
49811     }
49812     function_tests++;
49813 #endif
49814
49815     return(test_ret);
49816 }
49817
49818
49819 static int
49820 test_xmlXPathNewParserContext(void) {
49821     int test_ret = 0;
49822
49823
49824     /* missing type support */
49825     return(test_ret);
49826 }
49827
49828
49829 static int
49830 test_xmlXPathNewString(void) {
49831     int test_ret = 0;
49832
49833 #if defined(LIBXML_XPATH_ENABLED)
49834     int mem_base;
49835     xmlXPathObjectPtr ret_val;
49836     xmlChar * val; /* the xmlChar * value */
49837     int n_val;
49838
49839     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
49840         mem_base = xmlMemBlocks();
49841         val = gen_const_xmlChar_ptr(n_val, 0);
49842
49843         ret_val = xmlXPathNewString((const xmlChar *)val);
49844         desret_xmlXPathObjectPtr(ret_val);
49845         call_tests++;
49846         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
49847         xmlResetLastError();
49848         if (mem_base != xmlMemBlocks()) {
49849             printf("Leak of %d blocks found in xmlXPathNewString",
49850                    xmlMemBlocks() - mem_base);
49851             test_ret++;
49852             printf(" %d", n_val);
49853             printf("\n");
49854         }
49855     }
49856     function_tests++;
49857 #endif
49858
49859     return(test_ret);
49860 }
49861
49862
49863 static int
49864 test_xmlXPathNextAncestor(void) {
49865     int test_ret = 0;
49866
49867 #if defined(LIBXML_XPATH_ENABLED)
49868     int mem_base;
49869     xmlNodePtr ret_val;
49870     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49871     int n_ctxt;
49872     xmlNodePtr cur; /* the current node in the traversal */
49873     int n_cur;
49874
49875     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49876     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49877         mem_base = xmlMemBlocks();
49878         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49879         cur = gen_xmlNodePtr(n_cur, 1);
49880
49881         ret_val = xmlXPathNextAncestor(ctxt, cur);
49882         desret_xmlNodePtr(ret_val);
49883         call_tests++;
49884         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49885         des_xmlNodePtr(n_cur, cur, 1);
49886         xmlResetLastError();
49887         if (mem_base != xmlMemBlocks()) {
49888             printf("Leak of %d blocks found in xmlXPathNextAncestor",
49889                    xmlMemBlocks() - mem_base);
49890             test_ret++;
49891             printf(" %d", n_ctxt);
49892             printf(" %d", n_cur);
49893             printf("\n");
49894         }
49895     }
49896     }
49897     function_tests++;
49898 #endif
49899
49900     return(test_ret);
49901 }
49902
49903
49904 static int
49905 test_xmlXPathNextAncestorOrSelf(void) {
49906     int test_ret = 0;
49907
49908 #if defined(LIBXML_XPATH_ENABLED)
49909     int mem_base;
49910     xmlNodePtr ret_val;
49911     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49912     int n_ctxt;
49913     xmlNodePtr cur; /* the current node in the traversal */
49914     int n_cur;
49915
49916     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49917     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49918         mem_base = xmlMemBlocks();
49919         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49920         cur = gen_xmlNodePtr(n_cur, 1);
49921
49922         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
49923         desret_xmlNodePtr(ret_val);
49924         call_tests++;
49925         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49926         des_xmlNodePtr(n_cur, cur, 1);
49927         xmlResetLastError();
49928         if (mem_base != xmlMemBlocks()) {
49929             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
49930                    xmlMemBlocks() - mem_base);
49931             test_ret++;
49932             printf(" %d", n_ctxt);
49933             printf(" %d", n_cur);
49934             printf("\n");
49935         }
49936     }
49937     }
49938     function_tests++;
49939 #endif
49940
49941     return(test_ret);
49942 }
49943
49944
49945 static int
49946 test_xmlXPathNextAttribute(void) {
49947     int test_ret = 0;
49948
49949 #if defined(LIBXML_XPATH_ENABLED)
49950     int mem_base;
49951     xmlNodePtr ret_val;
49952     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49953     int n_ctxt;
49954     xmlNodePtr cur; /* the current attribute in the traversal */
49955     int n_cur;
49956
49957     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49958     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
49959         mem_base = xmlMemBlocks();
49960         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49961         cur = gen_xmlNodePtr(n_cur, 1);
49962
49963         ret_val = xmlXPathNextAttribute(ctxt, cur);
49964         desret_xmlNodePtr(ret_val);
49965         call_tests++;
49966         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49967         des_xmlNodePtr(n_cur, cur, 1);
49968         xmlResetLastError();
49969         if (mem_base != xmlMemBlocks()) {
49970             printf("Leak of %d blocks found in xmlXPathNextAttribute",
49971                    xmlMemBlocks() - mem_base);
49972             test_ret++;
49973             printf(" %d", n_ctxt);
49974             printf(" %d", n_cur);
49975             printf("\n");
49976         }
49977     }
49978     }
49979     function_tests++;
49980 #endif
49981
49982     return(test_ret);
49983 }
49984
49985
49986 static int
49987 test_xmlXPathNextChild(void) {
49988     int test_ret = 0;
49989
49990 #if defined(LIBXML_XPATH_ENABLED)
49991     int mem_base;
49992     xmlNodePtr ret_val;
49993     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49994     int n_ctxt;
49995     xmlNodePtr cur; /* the current node in the traversal */
49996     int n_cur;
49997
49998     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49999     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50000         mem_base = xmlMemBlocks();
50001         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50002         cur = gen_xmlNodePtr(n_cur, 1);
50003
50004         ret_val = xmlXPathNextChild(ctxt, cur);
50005         desret_xmlNodePtr(ret_val);
50006         call_tests++;
50007         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50008         des_xmlNodePtr(n_cur, cur, 1);
50009         xmlResetLastError();
50010         if (mem_base != xmlMemBlocks()) {
50011             printf("Leak of %d blocks found in xmlXPathNextChild",
50012                    xmlMemBlocks() - mem_base);
50013             test_ret++;
50014             printf(" %d", n_ctxt);
50015             printf(" %d", n_cur);
50016             printf("\n");
50017         }
50018     }
50019     }
50020     function_tests++;
50021 #endif
50022
50023     return(test_ret);
50024 }
50025
50026
50027 static int
50028 test_xmlXPathNextDescendant(void) {
50029     int test_ret = 0;
50030
50031 #if defined(LIBXML_XPATH_ENABLED)
50032     int mem_base;
50033     xmlNodePtr ret_val;
50034     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50035     int n_ctxt;
50036     xmlNodePtr cur; /* the current node in the traversal */
50037     int n_cur;
50038
50039     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50040     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50041         mem_base = xmlMemBlocks();
50042         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50043         cur = gen_xmlNodePtr(n_cur, 1);
50044
50045         ret_val = xmlXPathNextDescendant(ctxt, cur);
50046         desret_xmlNodePtr(ret_val);
50047         call_tests++;
50048         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50049         des_xmlNodePtr(n_cur, cur, 1);
50050         xmlResetLastError();
50051         if (mem_base != xmlMemBlocks()) {
50052             printf("Leak of %d blocks found in xmlXPathNextDescendant",
50053                    xmlMemBlocks() - mem_base);
50054             test_ret++;
50055             printf(" %d", n_ctxt);
50056             printf(" %d", n_cur);
50057             printf("\n");
50058         }
50059     }
50060     }
50061     function_tests++;
50062 #endif
50063
50064     return(test_ret);
50065 }
50066
50067
50068 static int
50069 test_xmlXPathNextDescendantOrSelf(void) {
50070     int test_ret = 0;
50071
50072 #if defined(LIBXML_XPATH_ENABLED)
50073     int mem_base;
50074     xmlNodePtr ret_val;
50075     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50076     int n_ctxt;
50077     xmlNodePtr cur; /* the current node in the traversal */
50078     int n_cur;
50079
50080     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50081     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50082         mem_base = xmlMemBlocks();
50083         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50084         cur = gen_xmlNodePtr(n_cur, 1);
50085
50086         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
50087         desret_xmlNodePtr(ret_val);
50088         call_tests++;
50089         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50090         des_xmlNodePtr(n_cur, cur, 1);
50091         xmlResetLastError();
50092         if (mem_base != xmlMemBlocks()) {
50093             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
50094                    xmlMemBlocks() - mem_base);
50095             test_ret++;
50096             printf(" %d", n_ctxt);
50097             printf(" %d", n_cur);
50098             printf("\n");
50099         }
50100     }
50101     }
50102     function_tests++;
50103 #endif
50104
50105     return(test_ret);
50106 }
50107
50108
50109 static int
50110 test_xmlXPathNextFollowing(void) {
50111     int test_ret = 0;
50112
50113 #if defined(LIBXML_XPATH_ENABLED)
50114     int mem_base;
50115     xmlNodePtr ret_val;
50116     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50117     int n_ctxt;
50118     xmlNodePtr cur; /* the current node in the traversal */
50119     int n_cur;
50120
50121     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50122     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50123         mem_base = xmlMemBlocks();
50124         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50125         cur = gen_xmlNodePtr(n_cur, 1);
50126
50127         ret_val = xmlXPathNextFollowing(ctxt, cur);
50128         desret_xmlNodePtr(ret_val);
50129         call_tests++;
50130         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50131         des_xmlNodePtr(n_cur, cur, 1);
50132         xmlResetLastError();
50133         if (mem_base != xmlMemBlocks()) {
50134             printf("Leak of %d blocks found in xmlXPathNextFollowing",
50135                    xmlMemBlocks() - mem_base);
50136             test_ret++;
50137             printf(" %d", n_ctxt);
50138             printf(" %d", n_cur);
50139             printf("\n");
50140         }
50141     }
50142     }
50143     function_tests++;
50144 #endif
50145
50146     return(test_ret);
50147 }
50148
50149
50150 static int
50151 test_xmlXPathNextFollowingSibling(void) {
50152     int test_ret = 0;
50153
50154 #if defined(LIBXML_XPATH_ENABLED)
50155     int mem_base;
50156     xmlNodePtr ret_val;
50157     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50158     int n_ctxt;
50159     xmlNodePtr cur; /* the current node in the traversal */
50160     int n_cur;
50161
50162     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50163     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50164         mem_base = xmlMemBlocks();
50165         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50166         cur = gen_xmlNodePtr(n_cur, 1);
50167
50168         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
50169         desret_xmlNodePtr(ret_val);
50170         call_tests++;
50171         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50172         des_xmlNodePtr(n_cur, cur, 1);
50173         xmlResetLastError();
50174         if (mem_base != xmlMemBlocks()) {
50175             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
50176                    xmlMemBlocks() - mem_base);
50177             test_ret++;
50178             printf(" %d", n_ctxt);
50179             printf(" %d", n_cur);
50180             printf("\n");
50181         }
50182     }
50183     }
50184     function_tests++;
50185 #endif
50186
50187     return(test_ret);
50188 }
50189
50190
50191 static int
50192 test_xmlXPathNextNamespace(void) {
50193     int test_ret = 0;
50194
50195 #if defined(LIBXML_XPATH_ENABLED)
50196     int mem_base;
50197     xmlNodePtr ret_val;
50198     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50199     int n_ctxt;
50200     xmlNodePtr cur; /* the current attribute in the traversal */
50201     int n_cur;
50202
50203     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50204     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50205         mem_base = xmlMemBlocks();
50206         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50207         cur = gen_xmlNodePtr(n_cur, 1);
50208
50209         ret_val = xmlXPathNextNamespace(ctxt, cur);
50210         desret_xmlNodePtr(ret_val);
50211         call_tests++;
50212         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50213         des_xmlNodePtr(n_cur, cur, 1);
50214         xmlResetLastError();
50215         if (mem_base != xmlMemBlocks()) {
50216             printf("Leak of %d blocks found in xmlXPathNextNamespace",
50217                    xmlMemBlocks() - mem_base);
50218             test_ret++;
50219             printf(" %d", n_ctxt);
50220             printf(" %d", n_cur);
50221             printf("\n");
50222         }
50223     }
50224     }
50225     function_tests++;
50226 #endif
50227
50228     return(test_ret);
50229 }
50230
50231
50232 static int
50233 test_xmlXPathNextParent(void) {
50234     int test_ret = 0;
50235
50236 #if defined(LIBXML_XPATH_ENABLED)
50237     int mem_base;
50238     xmlNodePtr ret_val;
50239     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50240     int n_ctxt;
50241     xmlNodePtr cur; /* the current node in the traversal */
50242     int n_cur;
50243
50244     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50245     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50246         mem_base = xmlMemBlocks();
50247         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50248         cur = gen_xmlNodePtr(n_cur, 1);
50249
50250         ret_val = xmlXPathNextParent(ctxt, cur);
50251         desret_xmlNodePtr(ret_val);
50252         call_tests++;
50253         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50254         des_xmlNodePtr(n_cur, cur, 1);
50255         xmlResetLastError();
50256         if (mem_base != xmlMemBlocks()) {
50257             printf("Leak of %d blocks found in xmlXPathNextParent",
50258                    xmlMemBlocks() - mem_base);
50259             test_ret++;
50260             printf(" %d", n_ctxt);
50261             printf(" %d", n_cur);
50262             printf("\n");
50263         }
50264     }
50265     }
50266     function_tests++;
50267 #endif
50268
50269     return(test_ret);
50270 }
50271
50272
50273 static int
50274 test_xmlXPathNextPreceding(void) {
50275     int test_ret = 0;
50276
50277 #if defined(LIBXML_XPATH_ENABLED)
50278     int mem_base;
50279     xmlNodePtr ret_val;
50280     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50281     int n_ctxt;
50282     xmlNodePtr cur; /* the current node in the traversal */
50283     int n_cur;
50284
50285     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50286     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50287         mem_base = xmlMemBlocks();
50288         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50289         cur = gen_xmlNodePtr(n_cur, 1);
50290
50291         ret_val = xmlXPathNextPreceding(ctxt, cur);
50292         desret_xmlNodePtr(ret_val);
50293         call_tests++;
50294         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50295         des_xmlNodePtr(n_cur, cur, 1);
50296         xmlResetLastError();
50297         if (mem_base != xmlMemBlocks()) {
50298             printf("Leak of %d blocks found in xmlXPathNextPreceding",
50299                    xmlMemBlocks() - mem_base);
50300             test_ret++;
50301             printf(" %d", n_ctxt);
50302             printf(" %d", n_cur);
50303             printf("\n");
50304         }
50305     }
50306     }
50307     function_tests++;
50308 #endif
50309
50310     return(test_ret);
50311 }
50312
50313
50314 static int
50315 test_xmlXPathNextPrecedingSibling(void) {
50316     int test_ret = 0;
50317
50318 #if defined(LIBXML_XPATH_ENABLED)
50319     int mem_base;
50320     xmlNodePtr ret_val;
50321     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50322     int n_ctxt;
50323     xmlNodePtr cur; /* the current node in the traversal */
50324     int n_cur;
50325
50326     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50327     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50328         mem_base = xmlMemBlocks();
50329         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50330         cur = gen_xmlNodePtr(n_cur, 1);
50331
50332         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
50333         desret_xmlNodePtr(ret_val);
50334         call_tests++;
50335         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50336         des_xmlNodePtr(n_cur, cur, 1);
50337         xmlResetLastError();
50338         if (mem_base != xmlMemBlocks()) {
50339             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
50340                    xmlMemBlocks() - mem_base);
50341             test_ret++;
50342             printf(" %d", n_ctxt);
50343             printf(" %d", n_cur);
50344             printf("\n");
50345         }
50346     }
50347     }
50348     function_tests++;
50349 #endif
50350
50351     return(test_ret);
50352 }
50353
50354
50355 static int
50356 test_xmlXPathNextSelf(void) {
50357     int test_ret = 0;
50358
50359 #if defined(LIBXML_XPATH_ENABLED)
50360     int mem_base;
50361     xmlNodePtr ret_val;
50362     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50363     int n_ctxt;
50364     xmlNodePtr cur; /* the current node in the traversal */
50365     int n_cur;
50366
50367     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50368     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50369         mem_base = xmlMemBlocks();
50370         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50371         cur = gen_xmlNodePtr(n_cur, 1);
50372
50373         ret_val = xmlXPathNextSelf(ctxt, cur);
50374         desret_xmlNodePtr(ret_val);
50375         call_tests++;
50376         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50377         des_xmlNodePtr(n_cur, cur, 1);
50378         xmlResetLastError();
50379         if (mem_base != xmlMemBlocks()) {
50380             printf("Leak of %d blocks found in xmlXPathNextSelf",
50381                    xmlMemBlocks() - mem_base);
50382             test_ret++;
50383             printf(" %d", n_ctxt);
50384             printf(" %d", n_cur);
50385             printf("\n");
50386         }
50387     }
50388     }
50389     function_tests++;
50390 #endif
50391
50392     return(test_ret);
50393 }
50394
50395
50396 static int
50397 test_xmlXPathNodeLeading(void) {
50398     int test_ret = 0;
50399
50400 #if defined(LIBXML_XPATH_ENABLED)
50401     int mem_base;
50402     xmlNodeSetPtr ret_val;
50403     xmlNodeSetPtr nodes; /* a node-set */
50404     int n_nodes;
50405     xmlNodePtr node; /* a node */
50406     int n_node;
50407
50408     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
50409     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
50410         mem_base = xmlMemBlocks();
50411         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
50412         node = gen_xmlNodePtr(n_node, 1);
50413
50414         ret_val = xmlXPathNodeLeading(nodes, node);
50415         desret_xmlNodeSetPtr(ret_val);
50416         call_tests++;
50417         des_xmlNodeSetPtr(n_nodes, nodes, 0);
50418         des_xmlNodePtr(n_node, node, 1);
50419         xmlResetLastError();
50420         if (mem_base != xmlMemBlocks()) {
50421             printf("Leak of %d blocks found in xmlXPathNodeLeading",
50422                    xmlMemBlocks() - mem_base);
50423             test_ret++;
50424             printf(" %d", n_nodes);
50425             printf(" %d", n_node);
50426             printf("\n");
50427         }
50428     }
50429     }
50430     function_tests++;
50431 #endif
50432
50433     return(test_ret);
50434 }
50435
50436
50437 static int
50438 test_xmlXPathNodeLeadingSorted(void) {
50439     int test_ret = 0;
50440
50441 #if defined(LIBXML_XPATH_ENABLED)
50442     int mem_base;
50443     xmlNodeSetPtr ret_val;
50444     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
50445     int n_nodes;
50446     xmlNodePtr node; /* a node */
50447     int n_node;
50448
50449     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
50450     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
50451         mem_base = xmlMemBlocks();
50452         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
50453         node = gen_xmlNodePtr(n_node, 1);
50454
50455         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
50456         desret_xmlNodeSetPtr(ret_val);
50457         call_tests++;
50458         des_xmlNodeSetPtr(n_nodes, nodes, 0);
50459         des_xmlNodePtr(n_node, node, 1);
50460         xmlResetLastError();
50461         if (mem_base != xmlMemBlocks()) {
50462             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
50463                    xmlMemBlocks() - mem_base);
50464             test_ret++;
50465             printf(" %d", n_nodes);
50466             printf(" %d", n_node);
50467             printf("\n");
50468         }
50469     }
50470     }
50471     function_tests++;
50472 #endif
50473
50474     return(test_ret);
50475 }
50476
50477
50478 static int
50479 test_xmlXPathNodeSetAdd(void) {
50480     int test_ret = 0;
50481
50482 #if defined(LIBXML_XPATH_ENABLED)
50483     int mem_base;
50484     int ret_val;
50485     xmlNodeSetPtr cur; /* the initial node set */
50486     int n_cur;
50487     xmlNodePtr val; /* a new xmlNodePtr */
50488     int n_val;
50489
50490     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50491     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
50492         mem_base = xmlMemBlocks();
50493         cur = gen_xmlNodeSetPtr(n_cur, 0);
50494         val = gen_xmlNodePtr(n_val, 1);
50495
50496         ret_val = xmlXPathNodeSetAdd(cur, val);
50497         desret_int(ret_val);
50498         call_tests++;
50499         des_xmlNodeSetPtr(n_cur, cur, 0);
50500         des_xmlNodePtr(n_val, val, 1);
50501         xmlResetLastError();
50502         if (mem_base != xmlMemBlocks()) {
50503             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
50504                    xmlMemBlocks() - mem_base);
50505             test_ret++;
50506             printf(" %d", n_cur);
50507             printf(" %d", n_val);
50508             printf("\n");
50509         }
50510     }
50511     }
50512     function_tests++;
50513 #endif
50514
50515     return(test_ret);
50516 }
50517
50518
50519 static int
50520 test_xmlXPathNodeSetAddNs(void) {
50521     int test_ret = 0;
50522
50523 #if defined(LIBXML_XPATH_ENABLED)
50524     int mem_base;
50525     int ret_val;
50526     xmlNodeSetPtr cur; /* the initial node set */
50527     int n_cur;
50528     xmlNodePtr node; /* the hosting node */
50529     int n_node;
50530     xmlNsPtr ns; /* a the namespace node */
50531     int n_ns;
50532
50533     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50534     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
50535     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
50536         mem_base = xmlMemBlocks();
50537         cur = gen_xmlNodeSetPtr(n_cur, 0);
50538         node = gen_xmlNodePtr(n_node, 1);
50539         ns = gen_xmlNsPtr(n_ns, 2);
50540
50541         ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
50542         desret_int(ret_val);
50543         call_tests++;
50544         des_xmlNodeSetPtr(n_cur, cur, 0);
50545         des_xmlNodePtr(n_node, node, 1);
50546         des_xmlNsPtr(n_ns, ns, 2);
50547         xmlResetLastError();
50548         if (mem_base != xmlMemBlocks()) {
50549             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
50550                    xmlMemBlocks() - mem_base);
50551             test_ret++;
50552             printf(" %d", n_cur);
50553             printf(" %d", n_node);
50554             printf(" %d", n_ns);
50555             printf("\n");
50556         }
50557     }
50558     }
50559     }
50560     function_tests++;
50561 #endif
50562
50563     return(test_ret);
50564 }
50565
50566
50567 static int
50568 test_xmlXPathNodeSetAddUnique(void) {
50569     int test_ret = 0;
50570
50571 #if defined(LIBXML_XPATH_ENABLED)
50572     int mem_base;
50573     int ret_val;
50574     xmlNodeSetPtr cur; /* the initial node set */
50575     int n_cur;
50576     xmlNodePtr val; /* a new xmlNodePtr */
50577     int n_val;
50578
50579     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50580     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
50581         mem_base = xmlMemBlocks();
50582         cur = gen_xmlNodeSetPtr(n_cur, 0);
50583         val = gen_xmlNodePtr(n_val, 1);
50584
50585         ret_val = xmlXPathNodeSetAddUnique(cur, val);
50586         desret_int(ret_val);
50587         call_tests++;
50588         des_xmlNodeSetPtr(n_cur, cur, 0);
50589         des_xmlNodePtr(n_val, val, 1);
50590         xmlResetLastError();
50591         if (mem_base != xmlMemBlocks()) {
50592             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
50593                    xmlMemBlocks() - mem_base);
50594             test_ret++;
50595             printf(" %d", n_cur);
50596             printf(" %d", n_val);
50597             printf("\n");
50598         }
50599     }
50600     }
50601     function_tests++;
50602 #endif
50603
50604     return(test_ret);
50605 }
50606
50607
50608 static int
50609 test_xmlXPathNodeSetContains(void) {
50610     int test_ret = 0;
50611
50612 #if defined(LIBXML_XPATH_ENABLED)
50613     int mem_base;
50614     int ret_val;
50615     xmlNodeSetPtr cur; /* the node-set */
50616     int n_cur;
50617     xmlNodePtr val; /* the node */
50618     int n_val;
50619
50620     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50621     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
50622         mem_base = xmlMemBlocks();
50623         cur = gen_xmlNodeSetPtr(n_cur, 0);
50624         val = gen_xmlNodePtr(n_val, 1);
50625
50626         ret_val = xmlXPathNodeSetContains(cur, val);
50627         desret_int(ret_val);
50628         call_tests++;
50629         des_xmlNodeSetPtr(n_cur, cur, 0);
50630         des_xmlNodePtr(n_val, val, 1);
50631         xmlResetLastError();
50632         if (mem_base != xmlMemBlocks()) {
50633             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
50634                    xmlMemBlocks() - mem_base);
50635             test_ret++;
50636             printf(" %d", n_cur);
50637             printf(" %d", n_val);
50638             printf("\n");
50639         }
50640     }
50641     }
50642     function_tests++;
50643 #endif
50644
50645     return(test_ret);
50646 }
50647
50648
50649 static int
50650 test_xmlXPathNodeSetDel(void) {
50651     int test_ret = 0;
50652
50653 #if defined(LIBXML_XPATH_ENABLED)
50654     int mem_base;
50655     xmlNodeSetPtr cur; /* the initial node set */
50656     int n_cur;
50657     xmlNodePtr val; /* an xmlNodePtr */
50658     int n_val;
50659
50660     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50661     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
50662         mem_base = xmlMemBlocks();
50663         cur = gen_xmlNodeSetPtr(n_cur, 0);
50664         val = gen_xmlNodePtr(n_val, 1);
50665
50666         xmlXPathNodeSetDel(cur, val);
50667         call_tests++;
50668         des_xmlNodeSetPtr(n_cur, cur, 0);
50669         des_xmlNodePtr(n_val, val, 1);
50670         xmlResetLastError();
50671         if (mem_base != xmlMemBlocks()) {
50672             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
50673                    xmlMemBlocks() - mem_base);
50674             test_ret++;
50675             printf(" %d", n_cur);
50676             printf(" %d", n_val);
50677             printf("\n");
50678         }
50679     }
50680     }
50681     function_tests++;
50682 #endif
50683
50684     return(test_ret);
50685 }
50686
50687
50688 static int
50689 test_xmlXPathNodeSetMerge(void) {
50690     int test_ret = 0;
50691
50692 #if defined(LIBXML_XPATH_ENABLED)
50693     int mem_base;
50694     xmlNodeSetPtr ret_val;
50695     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
50696     int n_val1;
50697     xmlNodeSetPtr val2; /* the second NodeSet */
50698     int n_val2;
50699
50700     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
50701     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
50702         mem_base = xmlMemBlocks();
50703         val1 = gen_xmlNodeSetPtr(n_val1, 0);
50704         val2 = gen_xmlNodeSetPtr(n_val2, 1);
50705
50706         ret_val = xmlXPathNodeSetMerge(val1, val2);
50707         desret_xmlNodeSetPtr(ret_val);
50708         call_tests++;
50709         des_xmlNodeSetPtr(n_val1, val1, 0);
50710         des_xmlNodeSetPtr(n_val2, val2, 1);
50711         xmlResetLastError();
50712         if (mem_base != xmlMemBlocks()) {
50713             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
50714                    xmlMemBlocks() - mem_base);
50715             test_ret++;
50716             printf(" %d", n_val1);
50717             printf(" %d", n_val2);
50718             printf("\n");
50719         }
50720     }
50721     }
50722     function_tests++;
50723 #endif
50724
50725     return(test_ret);
50726 }
50727
50728
50729 static int
50730 test_xmlXPathNodeSetRemove(void) {
50731     int test_ret = 0;
50732
50733 #if defined(LIBXML_XPATH_ENABLED)
50734     int mem_base;
50735     xmlNodeSetPtr cur; /* the initial node set */
50736     int n_cur;
50737     int val; /* the index to remove */
50738     int n_val;
50739
50740     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50741     for (n_val = 0;n_val < gen_nb_int;n_val++) {
50742         mem_base = xmlMemBlocks();
50743         cur = gen_xmlNodeSetPtr(n_cur, 0);
50744         val = gen_int(n_val, 1);
50745
50746         xmlXPathNodeSetRemove(cur, val);
50747         call_tests++;
50748         des_xmlNodeSetPtr(n_cur, cur, 0);
50749         des_int(n_val, val, 1);
50750         xmlResetLastError();
50751         if (mem_base != xmlMemBlocks()) {
50752             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
50753                    xmlMemBlocks() - mem_base);
50754             test_ret++;
50755             printf(" %d", n_cur);
50756             printf(" %d", n_val);
50757             printf("\n");
50758         }
50759     }
50760     }
50761     function_tests++;
50762 #endif
50763
50764     return(test_ret);
50765 }
50766
50767
50768 static int
50769 test_xmlXPathNodeSetSort(void) {
50770     int test_ret = 0;
50771
50772 #if defined(LIBXML_XPATH_ENABLED)
50773     int mem_base;
50774     xmlNodeSetPtr set; /* the node set */
50775     int n_set;
50776
50777     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
50778         mem_base = xmlMemBlocks();
50779         set = gen_xmlNodeSetPtr(n_set, 0);
50780
50781         xmlXPathNodeSetSort(set);
50782         call_tests++;
50783         des_xmlNodeSetPtr(n_set, set, 0);
50784         xmlResetLastError();
50785         if (mem_base != xmlMemBlocks()) {
50786             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
50787                    xmlMemBlocks() - mem_base);
50788             test_ret++;
50789             printf(" %d", n_set);
50790             printf("\n");
50791         }
50792     }
50793     function_tests++;
50794 #endif
50795
50796     return(test_ret);
50797 }
50798
50799
50800 static int
50801 test_xmlXPathNodeTrailing(void) {
50802     int test_ret = 0;
50803
50804 #if defined(LIBXML_XPATH_ENABLED)
50805     int mem_base;
50806     xmlNodeSetPtr ret_val;
50807     xmlNodeSetPtr nodes; /* a node-set */
50808     int n_nodes;
50809     xmlNodePtr node; /* a node */
50810     int n_node;
50811
50812     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
50813     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
50814         mem_base = xmlMemBlocks();
50815         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
50816         node = gen_xmlNodePtr(n_node, 1);
50817
50818         ret_val = xmlXPathNodeTrailing(nodes, node);
50819         desret_xmlNodeSetPtr(ret_val);
50820         call_tests++;
50821         des_xmlNodeSetPtr(n_nodes, nodes, 0);
50822         des_xmlNodePtr(n_node, node, 1);
50823         xmlResetLastError();
50824         if (mem_base != xmlMemBlocks()) {
50825             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
50826                    xmlMemBlocks() - mem_base);
50827             test_ret++;
50828             printf(" %d", n_nodes);
50829             printf(" %d", n_node);
50830             printf("\n");
50831         }
50832     }
50833     }
50834     function_tests++;
50835 #endif
50836
50837     return(test_ret);
50838 }
50839
50840
50841 static int
50842 test_xmlXPathNodeTrailingSorted(void) {
50843     int test_ret = 0;
50844
50845 #if defined(LIBXML_XPATH_ENABLED)
50846     int mem_base;
50847     xmlNodeSetPtr ret_val;
50848     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
50849     int n_nodes;
50850     xmlNodePtr node; /* a node */
50851     int n_node;
50852
50853     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
50854     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
50855         mem_base = xmlMemBlocks();
50856         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
50857         node = gen_xmlNodePtr(n_node, 1);
50858
50859         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
50860         desret_xmlNodeSetPtr(ret_val);
50861         call_tests++;
50862         des_xmlNodeSetPtr(n_nodes, nodes, 0);
50863         des_xmlNodePtr(n_node, node, 1);
50864         xmlResetLastError();
50865         if (mem_base != xmlMemBlocks()) {
50866             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
50867                    xmlMemBlocks() - mem_base);
50868             test_ret++;
50869             printf(" %d", n_nodes);
50870             printf(" %d", n_node);
50871             printf("\n");
50872         }
50873     }
50874     }
50875     function_tests++;
50876 #endif
50877
50878     return(test_ret);
50879 }
50880
50881
50882 static int
50883 test_xmlXPathNormalizeFunction(void) {
50884     int test_ret = 0;
50885
50886 #if defined(LIBXML_XPATH_ENABLED)
50887     int mem_base;
50888     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50889     int n_ctxt;
50890     int nargs; /* the number of arguments */
50891     int n_nargs;
50892
50893     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50894     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50895         mem_base = xmlMemBlocks();
50896         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50897         nargs = gen_int(n_nargs, 1);
50898
50899         xmlXPathNormalizeFunction(ctxt, nargs);
50900         call_tests++;
50901         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50902         des_int(n_nargs, nargs, 1);
50903         xmlResetLastError();
50904         if (mem_base != xmlMemBlocks()) {
50905             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
50906                    xmlMemBlocks() - mem_base);
50907             test_ret++;
50908             printf(" %d", n_ctxt);
50909             printf(" %d", n_nargs);
50910             printf("\n");
50911         }
50912     }
50913     }
50914     function_tests++;
50915 #endif
50916
50917     return(test_ret);
50918 }
50919
50920
50921 static int
50922 test_xmlXPathNotEqualValues(void) {
50923     int test_ret = 0;
50924
50925 #if defined(LIBXML_XPATH_ENABLED)
50926     int mem_base;
50927     int ret_val;
50928     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50929     int n_ctxt;
50930
50931     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50932         mem_base = xmlMemBlocks();
50933         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50934
50935         ret_val = xmlXPathNotEqualValues(ctxt);
50936         desret_int(ret_val);
50937         call_tests++;
50938         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50939         xmlResetLastError();
50940         if (mem_base != xmlMemBlocks()) {
50941             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
50942                    xmlMemBlocks() - mem_base);
50943             test_ret++;
50944             printf(" %d", n_ctxt);
50945             printf("\n");
50946         }
50947     }
50948     function_tests++;
50949 #endif
50950
50951     return(test_ret);
50952 }
50953
50954
50955 static int
50956 test_xmlXPathNotFunction(void) {
50957     int test_ret = 0;
50958
50959 #if defined(LIBXML_XPATH_ENABLED)
50960     int mem_base;
50961     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50962     int n_ctxt;
50963     int nargs; /* the number of arguments */
50964     int n_nargs;
50965
50966     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50967     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50968         mem_base = xmlMemBlocks();
50969         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50970         nargs = gen_int(n_nargs, 1);
50971
50972         xmlXPathNotFunction(ctxt, nargs);
50973         call_tests++;
50974         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50975         des_int(n_nargs, nargs, 1);
50976         xmlResetLastError();
50977         if (mem_base != xmlMemBlocks()) {
50978             printf("Leak of %d blocks found in xmlXPathNotFunction",
50979                    xmlMemBlocks() - mem_base);
50980             test_ret++;
50981             printf(" %d", n_ctxt);
50982             printf(" %d", n_nargs);
50983             printf("\n");
50984         }
50985     }
50986     }
50987     function_tests++;
50988 #endif
50989
50990     return(test_ret);
50991 }
50992
50993
50994 static int
50995 test_xmlXPathNsLookup(void) {
50996     int test_ret = 0;
50997
50998 #if defined(LIBXML_XPATH_ENABLED)
50999     int mem_base;
51000     const xmlChar * ret_val;
51001     xmlXPathContextPtr ctxt; /* the XPath context */
51002     int n_ctxt;
51003     xmlChar * prefix; /* the namespace prefix value */
51004     int n_prefix;
51005
51006     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51007     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
51008         mem_base = xmlMemBlocks();
51009         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51010         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
51011
51012         ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
51013         desret_const_xmlChar_ptr(ret_val);
51014         call_tests++;
51015         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51016         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
51017         xmlResetLastError();
51018         if (mem_base != xmlMemBlocks()) {
51019             printf("Leak of %d blocks found in xmlXPathNsLookup",
51020                    xmlMemBlocks() - mem_base);
51021             test_ret++;
51022             printf(" %d", n_ctxt);
51023             printf(" %d", n_prefix);
51024             printf("\n");
51025         }
51026     }
51027     }
51028     function_tests++;
51029 #endif
51030
51031     return(test_ret);
51032 }
51033
51034
51035 static int
51036 test_xmlXPathNumberFunction(void) {
51037     int test_ret = 0;
51038
51039 #if defined(LIBXML_XPATH_ENABLED)
51040     int mem_base;
51041     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51042     int n_ctxt;
51043     int nargs; /* the number of arguments */
51044     int n_nargs;
51045
51046     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51047     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51048         mem_base = xmlMemBlocks();
51049         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51050         nargs = gen_int(n_nargs, 1);
51051
51052         xmlXPathNumberFunction(ctxt, nargs);
51053         call_tests++;
51054         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51055         des_int(n_nargs, nargs, 1);
51056         xmlResetLastError();
51057         if (mem_base != xmlMemBlocks()) {
51058             printf("Leak of %d blocks found in xmlXPathNumberFunction",
51059                    xmlMemBlocks() - mem_base);
51060             test_ret++;
51061             printf(" %d", n_ctxt);
51062             printf(" %d", n_nargs);
51063             printf("\n");
51064         }
51065     }
51066     }
51067     function_tests++;
51068 #endif
51069
51070     return(test_ret);
51071 }
51072
51073
51074 static int
51075 test_xmlXPathParseNCName(void) {
51076     int test_ret = 0;
51077
51078 #if defined(LIBXML_XPATH_ENABLED)
51079     int mem_base;
51080     xmlChar * ret_val;
51081     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51082     int n_ctxt;
51083
51084     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51085         mem_base = xmlMemBlocks();
51086         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51087
51088         ret_val = xmlXPathParseNCName(ctxt);
51089         desret_xmlChar_ptr(ret_val);
51090         call_tests++;
51091         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51092         xmlResetLastError();
51093         if (mem_base != xmlMemBlocks()) {
51094             printf("Leak of %d blocks found in xmlXPathParseNCName",
51095                    xmlMemBlocks() - mem_base);
51096             test_ret++;
51097             printf(" %d", n_ctxt);
51098             printf("\n");
51099         }
51100     }
51101     function_tests++;
51102 #endif
51103
51104     return(test_ret);
51105 }
51106
51107
51108 static int
51109 test_xmlXPathParseName(void) {
51110     int test_ret = 0;
51111
51112 #if defined(LIBXML_XPATH_ENABLED)
51113     int mem_base;
51114     xmlChar * ret_val;
51115     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51116     int n_ctxt;
51117
51118     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51119         mem_base = xmlMemBlocks();
51120         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51121
51122         ret_val = xmlXPathParseName(ctxt);
51123         desret_xmlChar_ptr(ret_val);
51124         call_tests++;
51125         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51126         xmlResetLastError();
51127         if (mem_base != xmlMemBlocks()) {
51128             printf("Leak of %d blocks found in xmlXPathParseName",
51129                    xmlMemBlocks() - mem_base);
51130             test_ret++;
51131             printf(" %d", n_ctxt);
51132             printf("\n");
51133         }
51134     }
51135     function_tests++;
51136 #endif
51137
51138     return(test_ret);
51139 }
51140
51141
51142 static int
51143 test_xmlXPathPopBoolean(void) {
51144     int test_ret = 0;
51145
51146 #if defined(LIBXML_XPATH_ENABLED)
51147     int mem_base;
51148     int ret_val;
51149     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51150     int n_ctxt;
51151
51152     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51153         mem_base = xmlMemBlocks();
51154         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51155
51156         ret_val = xmlXPathPopBoolean(ctxt);
51157         desret_int(ret_val);
51158         call_tests++;
51159         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51160         xmlResetLastError();
51161         if (mem_base != xmlMemBlocks()) {
51162             printf("Leak of %d blocks found in xmlXPathPopBoolean",
51163                    xmlMemBlocks() - mem_base);
51164             test_ret++;
51165             printf(" %d", n_ctxt);
51166             printf("\n");
51167         }
51168     }
51169     function_tests++;
51170 #endif
51171
51172     return(test_ret);
51173 }
51174
51175
51176 static int
51177 test_xmlXPathPopExternal(void) {
51178     int test_ret = 0;
51179
51180 #if defined(LIBXML_XPATH_ENABLED)
51181     int mem_base;
51182     void * ret_val;
51183     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51184     int n_ctxt;
51185
51186     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51187         mem_base = xmlMemBlocks();
51188         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51189
51190         ret_val = xmlXPathPopExternal(ctxt);
51191         desret_void_ptr(ret_val);
51192         call_tests++;
51193         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51194         xmlResetLastError();
51195         if (mem_base != xmlMemBlocks()) {
51196             printf("Leak of %d blocks found in xmlXPathPopExternal",
51197                    xmlMemBlocks() - mem_base);
51198             test_ret++;
51199             printf(" %d", n_ctxt);
51200             printf("\n");
51201         }
51202     }
51203     function_tests++;
51204 #endif
51205
51206     return(test_ret);
51207 }
51208
51209
51210 static int
51211 test_xmlXPathPopNodeSet(void) {
51212     int test_ret = 0;
51213
51214 #if defined(LIBXML_XPATH_ENABLED)
51215     int mem_base;
51216     xmlNodeSetPtr ret_val;
51217     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51218     int n_ctxt;
51219
51220     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51221         mem_base = xmlMemBlocks();
51222         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51223
51224         ret_val = xmlXPathPopNodeSet(ctxt);
51225         desret_xmlNodeSetPtr(ret_val);
51226         call_tests++;
51227         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51228         xmlResetLastError();
51229         if (mem_base != xmlMemBlocks()) {
51230             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
51231                    xmlMemBlocks() - mem_base);
51232             test_ret++;
51233             printf(" %d", n_ctxt);
51234             printf("\n");
51235         }
51236     }
51237     function_tests++;
51238 #endif
51239
51240     return(test_ret);
51241 }
51242
51243
51244 static int
51245 test_xmlXPathPopNumber(void) {
51246     int test_ret = 0;
51247
51248 #if defined(LIBXML_XPATH_ENABLED)
51249     int mem_base;
51250     double ret_val;
51251     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51252     int n_ctxt;
51253
51254     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51255         mem_base = xmlMemBlocks();
51256         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51257
51258         ret_val = xmlXPathPopNumber(ctxt);
51259         desret_double(ret_val);
51260         call_tests++;
51261         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51262         xmlResetLastError();
51263         if (mem_base != xmlMemBlocks()) {
51264             printf("Leak of %d blocks found in xmlXPathPopNumber",
51265                    xmlMemBlocks() - mem_base);
51266             test_ret++;
51267             printf(" %d", n_ctxt);
51268             printf("\n");
51269         }
51270     }
51271     function_tests++;
51272 #endif
51273
51274     return(test_ret);
51275 }
51276
51277
51278 static int
51279 test_xmlXPathPopString(void) {
51280     int test_ret = 0;
51281
51282 #if defined(LIBXML_XPATH_ENABLED)
51283     int mem_base;
51284     xmlChar * ret_val;
51285     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51286     int n_ctxt;
51287
51288     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51289         mem_base = xmlMemBlocks();
51290         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51291
51292         ret_val = xmlXPathPopString(ctxt);
51293         desret_xmlChar_ptr(ret_val);
51294         call_tests++;
51295         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51296         xmlResetLastError();
51297         if (mem_base != xmlMemBlocks()) {
51298             printf("Leak of %d blocks found in xmlXPathPopString",
51299                    xmlMemBlocks() - mem_base);
51300             test_ret++;
51301             printf(" %d", n_ctxt);
51302             printf("\n");
51303         }
51304     }
51305     function_tests++;
51306 #endif
51307
51308     return(test_ret);
51309 }
51310
51311
51312 static int
51313 test_xmlXPathPositionFunction(void) {
51314     int test_ret = 0;
51315
51316 #if defined(LIBXML_XPATH_ENABLED)
51317     int mem_base;
51318     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51319     int n_ctxt;
51320     int nargs; /* the number of arguments */
51321     int n_nargs;
51322
51323     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51324     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51325         mem_base = xmlMemBlocks();
51326         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51327         nargs = gen_int(n_nargs, 1);
51328
51329         xmlXPathPositionFunction(ctxt, nargs);
51330         call_tests++;
51331         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51332         des_int(n_nargs, nargs, 1);
51333         xmlResetLastError();
51334         if (mem_base != xmlMemBlocks()) {
51335             printf("Leak of %d blocks found in xmlXPathPositionFunction",
51336                    xmlMemBlocks() - mem_base);
51337             test_ret++;
51338             printf(" %d", n_ctxt);
51339             printf(" %d", n_nargs);
51340             printf("\n");
51341         }
51342     }
51343     }
51344     function_tests++;
51345 #endif
51346
51347     return(test_ret);
51348 }
51349
51350
51351 static int
51352 test_xmlXPathRegisterAllFunctions(void) {
51353     int test_ret = 0;
51354
51355 #if defined(LIBXML_XPATH_ENABLED)
51356     int mem_base;
51357     xmlXPathContextPtr ctxt; /* the XPath context */
51358     int n_ctxt;
51359
51360     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51361         mem_base = xmlMemBlocks();
51362         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51363
51364         xmlXPathRegisterAllFunctions(ctxt);
51365         call_tests++;
51366         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51367         xmlResetLastError();
51368         if (mem_base != xmlMemBlocks()) {
51369             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
51370                    xmlMemBlocks() - mem_base);
51371             test_ret++;
51372             printf(" %d", n_ctxt);
51373             printf("\n");
51374         }
51375     }
51376     function_tests++;
51377 #endif
51378
51379     return(test_ret);
51380 }
51381
51382
51383 static int
51384 test_xmlXPathRegisterFunc(void) {
51385     int test_ret = 0;
51386
51387
51388     /* missing type support */
51389     return(test_ret);
51390 }
51391
51392
51393 static int
51394 test_xmlXPathRegisterFuncLookup(void) {
51395     int test_ret = 0;
51396
51397
51398     /* missing type support */
51399     return(test_ret);
51400 }
51401
51402
51403 static int
51404 test_xmlXPathRegisterFuncNS(void) {
51405     int test_ret = 0;
51406
51407
51408     /* missing type support */
51409     return(test_ret);
51410 }
51411
51412
51413 static int
51414 test_xmlXPathRegisterNs(void) {
51415     int test_ret = 0;
51416
51417 #if defined(LIBXML_XPATH_ENABLED)
51418     int mem_base;
51419     int ret_val;
51420     xmlXPathContextPtr ctxt; /* the XPath context */
51421     int n_ctxt;
51422     xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
51423     int n_prefix;
51424     xmlChar * ns_uri; /* the namespace name */
51425     int n_ns_uri;
51426
51427     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51428     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
51429     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51430         mem_base = xmlMemBlocks();
51431         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51432         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
51433         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51434
51435         ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
51436         desret_int(ret_val);
51437         call_tests++;
51438         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51439         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
51440         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51441         xmlResetLastError();
51442         if (mem_base != xmlMemBlocks()) {
51443             printf("Leak of %d blocks found in xmlXPathRegisterNs",
51444                    xmlMemBlocks() - mem_base);
51445             test_ret++;
51446             printf(" %d", n_ctxt);
51447             printf(" %d", n_prefix);
51448             printf(" %d", n_ns_uri);
51449             printf("\n");
51450         }
51451     }
51452     }
51453     }
51454     function_tests++;
51455 #endif
51456
51457     return(test_ret);
51458 }
51459
51460
51461 static int
51462 test_xmlXPathRegisterVariable(void) {
51463     int test_ret = 0;
51464
51465 #if defined(LIBXML_XPATH_ENABLED)
51466     int mem_base;
51467     int ret_val;
51468     xmlXPathContextPtr ctxt; /* the XPath context */
51469     int n_ctxt;
51470     xmlChar * name; /* the variable name */
51471     int n_name;
51472     xmlXPathObjectPtr value; /* the variable value or NULL */
51473     int n_value;
51474
51475     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51476     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51477     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
51478         mem_base = xmlMemBlocks();
51479         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51480         name = gen_const_xmlChar_ptr(n_name, 1);
51481         value = gen_xmlXPathObjectPtr(n_value, 2);
51482
51483         ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
51484         desret_int(ret_val);
51485         call_tests++;
51486         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51487         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51488         des_xmlXPathObjectPtr(n_value, value, 2);
51489         xmlResetLastError();
51490         if (mem_base != xmlMemBlocks()) {
51491             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
51492                    xmlMemBlocks() - mem_base);
51493             test_ret++;
51494             printf(" %d", n_ctxt);
51495             printf(" %d", n_name);
51496             printf(" %d", n_value);
51497             printf("\n");
51498         }
51499     }
51500     }
51501     }
51502     function_tests++;
51503 #endif
51504
51505     return(test_ret);
51506 }
51507
51508
51509 static int
51510 test_xmlXPathRegisterVariableLookup(void) {
51511     int test_ret = 0;
51512
51513
51514     /* missing type support */
51515     return(test_ret);
51516 }
51517
51518
51519 static int
51520 test_xmlXPathRegisterVariableNS(void) {
51521     int test_ret = 0;
51522
51523 #if defined(LIBXML_XPATH_ENABLED)
51524     int mem_base;
51525     int ret_val;
51526     xmlXPathContextPtr ctxt; /* the XPath context */
51527     int n_ctxt;
51528     xmlChar * name; /* the variable name */
51529     int n_name;
51530     xmlChar * ns_uri; /* the variable namespace URI */
51531     int n_ns_uri;
51532     xmlXPathObjectPtr value; /* the variable value or NULL */
51533     int n_value;
51534
51535     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51536     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51537     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51538     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
51539         mem_base = xmlMemBlocks();
51540         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51541         name = gen_const_xmlChar_ptr(n_name, 1);
51542         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51543         value = gen_xmlXPathObjectPtr(n_value, 3);
51544
51545         ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
51546         desret_int(ret_val);
51547         call_tests++;
51548         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51549         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51550         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51551         des_xmlXPathObjectPtr(n_value, value, 3);
51552         xmlResetLastError();
51553         if (mem_base != xmlMemBlocks()) {
51554             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
51555                    xmlMemBlocks() - mem_base);
51556             test_ret++;
51557             printf(" %d", n_ctxt);
51558             printf(" %d", n_name);
51559             printf(" %d", n_ns_uri);
51560             printf(" %d", n_value);
51561             printf("\n");
51562         }
51563     }
51564     }
51565     }
51566     }
51567     function_tests++;
51568 #endif
51569
51570     return(test_ret);
51571 }
51572
51573
51574 static int
51575 test_xmlXPathRegisteredFuncsCleanup(void) {
51576     int test_ret = 0;
51577
51578 #if defined(LIBXML_XPATH_ENABLED)
51579     int mem_base;
51580     xmlXPathContextPtr ctxt; /* the XPath context */
51581     int n_ctxt;
51582
51583     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51584         mem_base = xmlMemBlocks();
51585         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51586
51587         xmlXPathRegisteredFuncsCleanup(ctxt);
51588         call_tests++;
51589         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51590         xmlResetLastError();
51591         if (mem_base != xmlMemBlocks()) {
51592             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
51593                    xmlMemBlocks() - mem_base);
51594             test_ret++;
51595             printf(" %d", n_ctxt);
51596             printf("\n");
51597         }
51598     }
51599     function_tests++;
51600 #endif
51601
51602     return(test_ret);
51603 }
51604
51605
51606 static int
51607 test_xmlXPathRegisteredNsCleanup(void) {
51608     int test_ret = 0;
51609
51610 #if defined(LIBXML_XPATH_ENABLED)
51611     int mem_base;
51612     xmlXPathContextPtr ctxt; /* the XPath context */
51613     int n_ctxt;
51614
51615     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51616         mem_base = xmlMemBlocks();
51617         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51618
51619         xmlXPathRegisteredNsCleanup(ctxt);
51620         call_tests++;
51621         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51622         xmlResetLastError();
51623         if (mem_base != xmlMemBlocks()) {
51624             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
51625                    xmlMemBlocks() - mem_base);
51626             test_ret++;
51627             printf(" %d", n_ctxt);
51628             printf("\n");
51629         }
51630     }
51631     function_tests++;
51632 #endif
51633
51634     return(test_ret);
51635 }
51636
51637
51638 static int
51639 test_xmlXPathRegisteredVariablesCleanup(void) {
51640     int test_ret = 0;
51641
51642 #if defined(LIBXML_XPATH_ENABLED)
51643     int mem_base;
51644     xmlXPathContextPtr ctxt; /* the XPath context */
51645     int n_ctxt;
51646
51647     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51648         mem_base = xmlMemBlocks();
51649         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51650
51651         xmlXPathRegisteredVariablesCleanup(ctxt);
51652         call_tests++;
51653         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51654         xmlResetLastError();
51655         if (mem_base != xmlMemBlocks()) {
51656             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
51657                    xmlMemBlocks() - mem_base);
51658             test_ret++;
51659             printf(" %d", n_ctxt);
51660             printf("\n");
51661         }
51662     }
51663     function_tests++;
51664 #endif
51665
51666     return(test_ret);
51667 }
51668
51669
51670 static int
51671 test_xmlXPathRoot(void) {
51672     int test_ret = 0;
51673
51674 #if defined(LIBXML_XPATH_ENABLED)
51675     int mem_base;
51676     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51677     int n_ctxt;
51678
51679     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51680         mem_base = xmlMemBlocks();
51681         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51682
51683         xmlXPathRoot(ctxt);
51684         call_tests++;
51685         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51686         xmlResetLastError();
51687         if (mem_base != xmlMemBlocks()) {
51688             printf("Leak of %d blocks found in xmlXPathRoot",
51689                    xmlMemBlocks() - mem_base);
51690             test_ret++;
51691             printf(" %d", n_ctxt);
51692             printf("\n");
51693         }
51694     }
51695     function_tests++;
51696 #endif
51697
51698     return(test_ret);
51699 }
51700
51701
51702 static int
51703 test_xmlXPathRoundFunction(void) {
51704     int test_ret = 0;
51705
51706 #if defined(LIBXML_XPATH_ENABLED)
51707     int mem_base;
51708     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51709     int n_ctxt;
51710     int nargs; /* the number of arguments */
51711     int n_nargs;
51712
51713     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51714     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51715         mem_base = xmlMemBlocks();
51716         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51717         nargs = gen_int(n_nargs, 1);
51718
51719         xmlXPathRoundFunction(ctxt, nargs);
51720         call_tests++;
51721         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51722         des_int(n_nargs, nargs, 1);
51723         xmlResetLastError();
51724         if (mem_base != xmlMemBlocks()) {
51725             printf("Leak of %d blocks found in xmlXPathRoundFunction",
51726                    xmlMemBlocks() - mem_base);
51727             test_ret++;
51728             printf(" %d", n_ctxt);
51729             printf(" %d", n_nargs);
51730             printf("\n");
51731         }
51732     }
51733     }
51734     function_tests++;
51735 #endif
51736
51737     return(test_ret);
51738 }
51739
51740
51741 static int
51742 test_xmlXPathStartsWithFunction(void) {
51743     int test_ret = 0;
51744
51745 #if defined(LIBXML_XPATH_ENABLED)
51746     int mem_base;
51747     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51748     int n_ctxt;
51749     int nargs; /* the number of arguments */
51750     int n_nargs;
51751
51752     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51753     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51754         mem_base = xmlMemBlocks();
51755         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51756         nargs = gen_int(n_nargs, 1);
51757
51758         xmlXPathStartsWithFunction(ctxt, nargs);
51759         call_tests++;
51760         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51761         des_int(n_nargs, nargs, 1);
51762         xmlResetLastError();
51763         if (mem_base != xmlMemBlocks()) {
51764             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
51765                    xmlMemBlocks() - mem_base);
51766             test_ret++;
51767             printf(" %d", n_ctxt);
51768             printf(" %d", n_nargs);
51769             printf("\n");
51770         }
51771     }
51772     }
51773     function_tests++;
51774 #endif
51775
51776     return(test_ret);
51777 }
51778
51779
51780 static int
51781 test_xmlXPathStringEvalNumber(void) {
51782     int test_ret = 0;
51783
51784 #if defined(LIBXML_XPATH_ENABLED)
51785     int mem_base;
51786     double ret_val;
51787     xmlChar * str; /* A string to scan */
51788     int n_str;
51789
51790     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51791         mem_base = xmlMemBlocks();
51792         str = gen_const_xmlChar_ptr(n_str, 0);
51793
51794         ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
51795         desret_double(ret_val);
51796         call_tests++;
51797         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51798         xmlResetLastError();
51799         if (mem_base != xmlMemBlocks()) {
51800             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
51801                    xmlMemBlocks() - mem_base);
51802             test_ret++;
51803             printf(" %d", n_str);
51804             printf("\n");
51805         }
51806     }
51807     function_tests++;
51808 #endif
51809
51810     return(test_ret);
51811 }
51812
51813
51814 static int
51815 test_xmlXPathStringFunction(void) {
51816     int test_ret = 0;
51817
51818 #if defined(LIBXML_XPATH_ENABLED)
51819     int mem_base;
51820     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51821     int n_ctxt;
51822     int nargs; /* the number of arguments */
51823     int n_nargs;
51824
51825     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51826     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51827         mem_base = xmlMemBlocks();
51828         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51829         nargs = gen_int(n_nargs, 1);
51830
51831         xmlXPathStringFunction(ctxt, nargs);
51832         call_tests++;
51833         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51834         des_int(n_nargs, nargs, 1);
51835         xmlResetLastError();
51836         if (mem_base != xmlMemBlocks()) {
51837             printf("Leak of %d blocks found in xmlXPathStringFunction",
51838                    xmlMemBlocks() - mem_base);
51839             test_ret++;
51840             printf(" %d", n_ctxt);
51841             printf(" %d", n_nargs);
51842             printf("\n");
51843         }
51844     }
51845     }
51846     function_tests++;
51847 #endif
51848
51849     return(test_ret);
51850 }
51851
51852
51853 static int
51854 test_xmlXPathStringLengthFunction(void) {
51855     int test_ret = 0;
51856
51857 #if defined(LIBXML_XPATH_ENABLED)
51858     int mem_base;
51859     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51860     int n_ctxt;
51861     int nargs; /* the number of arguments */
51862     int n_nargs;
51863
51864     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51865     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51866         mem_base = xmlMemBlocks();
51867         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51868         nargs = gen_int(n_nargs, 1);
51869
51870         xmlXPathStringLengthFunction(ctxt, nargs);
51871         call_tests++;
51872         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51873         des_int(n_nargs, nargs, 1);
51874         xmlResetLastError();
51875         if (mem_base != xmlMemBlocks()) {
51876             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
51877                    xmlMemBlocks() - mem_base);
51878             test_ret++;
51879             printf(" %d", n_ctxt);
51880             printf(" %d", n_nargs);
51881             printf("\n");
51882         }
51883     }
51884     }
51885     function_tests++;
51886 #endif
51887
51888     return(test_ret);
51889 }
51890
51891
51892 static int
51893 test_xmlXPathSubValues(void) {
51894     int test_ret = 0;
51895
51896 #if defined(LIBXML_XPATH_ENABLED)
51897     int mem_base;
51898     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51899     int n_ctxt;
51900
51901     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51902         mem_base = xmlMemBlocks();
51903         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51904
51905         xmlXPathSubValues(ctxt);
51906         call_tests++;
51907         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51908         xmlResetLastError();
51909         if (mem_base != xmlMemBlocks()) {
51910             printf("Leak of %d blocks found in xmlXPathSubValues",
51911                    xmlMemBlocks() - mem_base);
51912             test_ret++;
51913             printf(" %d", n_ctxt);
51914             printf("\n");
51915         }
51916     }
51917     function_tests++;
51918 #endif
51919
51920     return(test_ret);
51921 }
51922
51923
51924 static int
51925 test_xmlXPathSubstringAfterFunction(void) {
51926     int test_ret = 0;
51927
51928 #if defined(LIBXML_XPATH_ENABLED)
51929     int mem_base;
51930     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51931     int n_ctxt;
51932     int nargs; /* the number of arguments */
51933     int n_nargs;
51934
51935     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51936     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51937         mem_base = xmlMemBlocks();
51938         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51939         nargs = gen_int(n_nargs, 1);
51940
51941         xmlXPathSubstringAfterFunction(ctxt, nargs);
51942         call_tests++;
51943         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51944         des_int(n_nargs, nargs, 1);
51945         xmlResetLastError();
51946         if (mem_base != xmlMemBlocks()) {
51947             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
51948                    xmlMemBlocks() - mem_base);
51949             test_ret++;
51950             printf(" %d", n_ctxt);
51951             printf(" %d", n_nargs);
51952             printf("\n");
51953         }
51954     }
51955     }
51956     function_tests++;
51957 #endif
51958
51959     return(test_ret);
51960 }
51961
51962
51963 static int
51964 test_xmlXPathSubstringBeforeFunction(void) {
51965     int test_ret = 0;
51966
51967 #if defined(LIBXML_XPATH_ENABLED)
51968     int mem_base;
51969     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51970     int n_ctxt;
51971     int nargs; /* the number of arguments */
51972     int n_nargs;
51973
51974     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51975     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51976         mem_base = xmlMemBlocks();
51977         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51978         nargs = gen_int(n_nargs, 1);
51979
51980         xmlXPathSubstringBeforeFunction(ctxt, nargs);
51981         call_tests++;
51982         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51983         des_int(n_nargs, nargs, 1);
51984         xmlResetLastError();
51985         if (mem_base != xmlMemBlocks()) {
51986             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
51987                    xmlMemBlocks() - mem_base);
51988             test_ret++;
51989             printf(" %d", n_ctxt);
51990             printf(" %d", n_nargs);
51991             printf("\n");
51992         }
51993     }
51994     }
51995     function_tests++;
51996 #endif
51997
51998     return(test_ret);
51999 }
52000
52001
52002 static int
52003 test_xmlXPathSubstringFunction(void) {
52004     int test_ret = 0;
52005
52006 #if defined(LIBXML_XPATH_ENABLED)
52007     int mem_base;
52008     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52009     int n_ctxt;
52010     int nargs; /* the number of arguments */
52011     int n_nargs;
52012
52013     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52014     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52015         mem_base = xmlMemBlocks();
52016         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52017         nargs = gen_int(n_nargs, 1);
52018
52019         xmlXPathSubstringFunction(ctxt, nargs);
52020         call_tests++;
52021         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52022         des_int(n_nargs, nargs, 1);
52023         xmlResetLastError();
52024         if (mem_base != xmlMemBlocks()) {
52025             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
52026                    xmlMemBlocks() - mem_base);
52027             test_ret++;
52028             printf(" %d", n_ctxt);
52029             printf(" %d", n_nargs);
52030             printf("\n");
52031         }
52032     }
52033     }
52034     function_tests++;
52035 #endif
52036
52037     return(test_ret);
52038 }
52039
52040
52041 static int
52042 test_xmlXPathSumFunction(void) {
52043     int test_ret = 0;
52044
52045 #if defined(LIBXML_XPATH_ENABLED)
52046     int mem_base;
52047     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52048     int n_ctxt;
52049     int nargs; /* the number of arguments */
52050     int n_nargs;
52051
52052     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52053     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52054         mem_base = xmlMemBlocks();
52055         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52056         nargs = gen_int(n_nargs, 1);
52057
52058         xmlXPathSumFunction(ctxt, nargs);
52059         call_tests++;
52060         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52061         des_int(n_nargs, nargs, 1);
52062         xmlResetLastError();
52063         if (mem_base != xmlMemBlocks()) {
52064             printf("Leak of %d blocks found in xmlXPathSumFunction",
52065                    xmlMemBlocks() - mem_base);
52066             test_ret++;
52067             printf(" %d", n_ctxt);
52068             printf(" %d", n_nargs);
52069             printf("\n");
52070         }
52071     }
52072     }
52073     function_tests++;
52074 #endif
52075
52076     return(test_ret);
52077 }
52078
52079
52080 static int
52081 test_xmlXPathTrailing(void) {
52082     int test_ret = 0;
52083
52084 #if defined(LIBXML_XPATH_ENABLED)
52085     int mem_base;
52086     xmlNodeSetPtr ret_val;
52087     xmlNodeSetPtr nodes1; /* a node-set */
52088     int n_nodes1;
52089     xmlNodeSetPtr nodes2; /* a node-set */
52090     int n_nodes2;
52091
52092     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
52093     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
52094         mem_base = xmlMemBlocks();
52095         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
52096         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
52097
52098         ret_val = xmlXPathTrailing(nodes1, nodes2);
52099         desret_xmlNodeSetPtr(ret_val);
52100         call_tests++;
52101         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
52102         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
52103         xmlResetLastError();
52104         if (mem_base != xmlMemBlocks()) {
52105             printf("Leak of %d blocks found in xmlXPathTrailing",
52106                    xmlMemBlocks() - mem_base);
52107             test_ret++;
52108             printf(" %d", n_nodes1);
52109             printf(" %d", n_nodes2);
52110             printf("\n");
52111         }
52112     }
52113     }
52114     function_tests++;
52115 #endif
52116
52117     return(test_ret);
52118 }
52119
52120
52121 static int
52122 test_xmlXPathTrailingSorted(void) {
52123     int test_ret = 0;
52124
52125 #if defined(LIBXML_XPATH_ENABLED)
52126     int mem_base;
52127     xmlNodeSetPtr ret_val;
52128     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
52129     int n_nodes1;
52130     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
52131     int n_nodes2;
52132
52133     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
52134     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
52135         mem_base = xmlMemBlocks();
52136         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
52137         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
52138
52139         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
52140         desret_xmlNodeSetPtr(ret_val);
52141         call_tests++;
52142         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
52143         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
52144         xmlResetLastError();
52145         if (mem_base != xmlMemBlocks()) {
52146             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
52147                    xmlMemBlocks() - mem_base);
52148             test_ret++;
52149             printf(" %d", n_nodes1);
52150             printf(" %d", n_nodes2);
52151             printf("\n");
52152         }
52153     }
52154     }
52155     function_tests++;
52156 #endif
52157
52158     return(test_ret);
52159 }
52160
52161
52162 static int
52163 test_xmlXPathTranslateFunction(void) {
52164     int test_ret = 0;
52165
52166 #if defined(LIBXML_XPATH_ENABLED)
52167     int mem_base;
52168     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52169     int n_ctxt;
52170     int nargs; /* the number of arguments */
52171     int n_nargs;
52172
52173     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52174     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52175         mem_base = xmlMemBlocks();
52176         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52177         nargs = gen_int(n_nargs, 1);
52178
52179         xmlXPathTranslateFunction(ctxt, nargs);
52180         call_tests++;
52181         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52182         des_int(n_nargs, nargs, 1);
52183         xmlResetLastError();
52184         if (mem_base != xmlMemBlocks()) {
52185             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
52186                    xmlMemBlocks() - mem_base);
52187             test_ret++;
52188             printf(" %d", n_ctxt);
52189             printf(" %d", n_nargs);
52190             printf("\n");
52191         }
52192     }
52193     }
52194     function_tests++;
52195 #endif
52196
52197     return(test_ret);
52198 }
52199
52200
52201 static int
52202 test_xmlXPathTrueFunction(void) {
52203     int test_ret = 0;
52204
52205 #if defined(LIBXML_XPATH_ENABLED)
52206     int mem_base;
52207     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52208     int n_ctxt;
52209     int nargs; /* the number of arguments */
52210     int n_nargs;
52211
52212     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52213     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52214         mem_base = xmlMemBlocks();
52215         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52216         nargs = gen_int(n_nargs, 1);
52217
52218         xmlXPathTrueFunction(ctxt, nargs);
52219         call_tests++;
52220         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52221         des_int(n_nargs, nargs, 1);
52222         xmlResetLastError();
52223         if (mem_base != xmlMemBlocks()) {
52224             printf("Leak of %d blocks found in xmlXPathTrueFunction",
52225                    xmlMemBlocks() - mem_base);
52226             test_ret++;
52227             printf(" %d", n_ctxt);
52228             printf(" %d", n_nargs);
52229             printf("\n");
52230         }
52231     }
52232     }
52233     function_tests++;
52234 #endif
52235
52236     return(test_ret);
52237 }
52238
52239
52240 static int
52241 test_xmlXPathValueFlipSign(void) {
52242     int test_ret = 0;
52243
52244 #if defined(LIBXML_XPATH_ENABLED)
52245     int mem_base;
52246     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52247     int n_ctxt;
52248
52249     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52250         mem_base = xmlMemBlocks();
52251         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52252
52253         xmlXPathValueFlipSign(ctxt);
52254         call_tests++;
52255         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52256         xmlResetLastError();
52257         if (mem_base != xmlMemBlocks()) {
52258             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
52259                    xmlMemBlocks() - mem_base);
52260             test_ret++;
52261             printf(" %d", n_ctxt);
52262             printf("\n");
52263         }
52264     }
52265     function_tests++;
52266 #endif
52267
52268     return(test_ret);
52269 }
52270
52271
52272 static int
52273 test_xmlXPathVariableLookup(void) {
52274     int test_ret = 0;
52275
52276 #if defined(LIBXML_XPATH_ENABLED)
52277     int mem_base;
52278     xmlXPathObjectPtr ret_val;
52279     xmlXPathContextPtr ctxt; /* the XPath context */
52280     int n_ctxt;
52281     xmlChar * name; /* the variable name */
52282     int n_name;
52283
52284     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
52285     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
52286         mem_base = xmlMemBlocks();
52287         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
52288         name = gen_const_xmlChar_ptr(n_name, 1);
52289
52290         ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
52291         desret_xmlXPathObjectPtr(ret_val);
52292         call_tests++;
52293         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
52294         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
52295         xmlResetLastError();
52296         if (mem_base != xmlMemBlocks()) {
52297             printf("Leak of %d blocks found in xmlXPathVariableLookup",
52298                    xmlMemBlocks() - mem_base);
52299             test_ret++;
52300             printf(" %d", n_ctxt);
52301             printf(" %d", n_name);
52302             printf("\n");
52303         }
52304     }
52305     }
52306     function_tests++;
52307 #endif
52308
52309     return(test_ret);
52310 }
52311
52312
52313 static int
52314 test_xmlXPathVariableLookupNS(void) {
52315     int test_ret = 0;
52316
52317 #if defined(LIBXML_XPATH_ENABLED)
52318     int mem_base;
52319     xmlXPathObjectPtr ret_val;
52320     xmlXPathContextPtr ctxt; /* the XPath context */
52321     int n_ctxt;
52322     xmlChar * name; /* the variable name */
52323     int n_name;
52324     xmlChar * ns_uri; /* the variable namespace URI */
52325     int n_ns_uri;
52326
52327     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
52328     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
52329     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
52330         mem_base = xmlMemBlocks();
52331         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
52332         name = gen_const_xmlChar_ptr(n_name, 1);
52333         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
52334
52335         ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
52336         desret_xmlXPathObjectPtr(ret_val);
52337         call_tests++;
52338         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
52339         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
52340         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
52341         xmlResetLastError();
52342         if (mem_base != xmlMemBlocks()) {
52343             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
52344                    xmlMemBlocks() - mem_base);
52345             test_ret++;
52346             printf(" %d", n_ctxt);
52347             printf(" %d", n_name);
52348             printf(" %d", n_ns_uri);
52349             printf("\n");
52350         }
52351     }
52352     }
52353     }
52354     function_tests++;
52355 #endif
52356
52357     return(test_ret);
52358 }
52359
52360
52361 static int
52362 test_xmlXPathWrapCString(void) {
52363     int test_ret = 0;
52364
52365 #if defined(LIBXML_XPATH_ENABLED)
52366     int mem_base;
52367     xmlXPathObjectPtr ret_val;
52368     char * val; /* the char * value */
52369     int n_val;
52370
52371     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
52372         mem_base = xmlMemBlocks();
52373         val = gen_char_ptr(n_val, 0);
52374
52375         ret_val = xmlXPathWrapCString(val);
52376         desret_xmlXPathObjectPtr(ret_val);
52377         call_tests++;
52378         des_char_ptr(n_val, val, 0);
52379         xmlResetLastError();
52380         if (mem_base != xmlMemBlocks()) {
52381             printf("Leak of %d blocks found in xmlXPathWrapCString",
52382                    xmlMemBlocks() - mem_base);
52383             test_ret++;
52384             printf(" %d", n_val);
52385             printf("\n");
52386         }
52387     }
52388     function_tests++;
52389 #endif
52390
52391     return(test_ret);
52392 }
52393
52394
52395 static int
52396 test_xmlXPathWrapExternal(void) {
52397     int test_ret = 0;
52398
52399 #if defined(LIBXML_XPATH_ENABLED)
52400     int mem_base;
52401     xmlXPathObjectPtr ret_val;
52402     void * val; /* the user data */
52403     int n_val;
52404
52405     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
52406         mem_base = xmlMemBlocks();
52407         val = gen_void_ptr(n_val, 0);
52408
52409         ret_val = xmlXPathWrapExternal(val);
52410         desret_xmlXPathObjectPtr(ret_val);
52411         call_tests++;
52412         des_void_ptr(n_val, val, 0);
52413         xmlResetLastError();
52414         if (mem_base != xmlMemBlocks()) {
52415             printf("Leak of %d blocks found in xmlXPathWrapExternal",
52416                    xmlMemBlocks() - mem_base);
52417             test_ret++;
52418             printf(" %d", n_val);
52419             printf("\n");
52420         }
52421     }
52422     function_tests++;
52423 #endif
52424
52425     return(test_ret);
52426 }
52427
52428
52429 static int
52430 test_xmlXPathWrapNodeSet(void) {
52431     int test_ret = 0;
52432
52433 #if defined(LIBXML_XPATH_ENABLED)
52434     int mem_base;
52435     xmlXPathObjectPtr ret_val;
52436     xmlNodeSetPtr val; /* the NodePtr value */
52437     int n_val;
52438
52439     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
52440         mem_base = xmlMemBlocks();
52441         val = gen_xmlNodeSetPtr(n_val, 0);
52442
52443         ret_val = xmlXPathWrapNodeSet(val);
52444         desret_xmlXPathObjectPtr(ret_val);
52445         call_tests++;
52446         des_xmlNodeSetPtr(n_val, val, 0);
52447         xmlResetLastError();
52448         if (mem_base != xmlMemBlocks()) {
52449             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
52450                    xmlMemBlocks() - mem_base);
52451             test_ret++;
52452             printf(" %d", n_val);
52453             printf("\n");
52454         }
52455     }
52456     function_tests++;
52457 #endif
52458
52459     return(test_ret);
52460 }
52461
52462
52463 static int
52464 test_xmlXPatherror(void) {
52465     int test_ret = 0;
52466
52467 #if defined(LIBXML_XPATH_ENABLED)
52468     int mem_base;
52469     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52470     int n_ctxt;
52471     const char * file; /* the file name */
52472     int n_file;
52473     int line; /* the line number */
52474     int n_line;
52475     int no; /* the error number */
52476     int n_no;
52477
52478     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52479     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
52480     for (n_line = 0;n_line < gen_nb_int;n_line++) {
52481     for (n_no = 0;n_no < gen_nb_int;n_no++) {
52482         mem_base = xmlMemBlocks();
52483         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52484         file = gen_filepath(n_file, 1);
52485         line = gen_int(n_line, 2);
52486         no = gen_int(n_no, 3);
52487
52488         xmlXPatherror(ctxt, file, line, no);
52489         call_tests++;
52490         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52491         des_filepath(n_file, file, 1);
52492         des_int(n_line, line, 2);
52493         des_int(n_no, no, 3);
52494         xmlResetLastError();
52495         if (mem_base != xmlMemBlocks()) {
52496             printf("Leak of %d blocks found in xmlXPatherror",
52497                    xmlMemBlocks() - mem_base);
52498             test_ret++;
52499             printf(" %d", n_ctxt);
52500             printf(" %d", n_file);
52501             printf(" %d", n_line);
52502             printf(" %d", n_no);
52503             printf("\n");
52504         }
52505     }
52506     }
52507     }
52508     }
52509     function_tests++;
52510 #endif
52511
52512     return(test_ret);
52513 }
52514
52515 static int
52516 test_xpathInternals(void) {
52517     int test_ret = 0;
52518         int rc = 0;
52519
52520     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
52521     rc = test_valuePop();
52522         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52523     rc = test_valuePush();
52524         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52525     rc = test_xmlXPathAddValues();
52526         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52527     rc = test_xmlXPathBooleanFunction();
52528         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52529     rc = test_xmlXPathCeilingFunction();
52530         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52531     rc = test_xmlXPathCompareValues();
52532         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52533     rc = test_xmlXPathConcatFunction();
52534         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52535     rc = test_xmlXPathContainsFunction();
52536         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52537     rc = test_xmlXPathCountFunction();
52538         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52539     rc = test_xmlXPathDebugDumpCompExpr();
52540         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52541     rc = test_xmlXPathDebugDumpObject();
52542         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52543     rc = test_xmlXPathDifference();
52544         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52545     rc = test_xmlXPathDistinct();
52546         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52547     rc = test_xmlXPathDistinctSorted();
52548         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52549     rc = test_xmlXPathDivValues();
52550         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52551     rc = test_xmlXPathEqualValues();
52552         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52553     rc = test_xmlXPathErr();
52554         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52555     rc = test_xmlXPathEvalExpr();
52556         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52557     rc = test_xmlXPathEvaluatePredicateResult();
52558         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52559     rc = test_xmlXPathFalseFunction();
52560         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52561     rc = test_xmlXPathFloorFunction();
52562         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52563     rc = test_xmlXPathFunctionLookup();
52564         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52565     rc = test_xmlXPathFunctionLookupNS();
52566         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52567     rc = test_xmlXPathHasSameNodes();
52568         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52569     rc = test_xmlXPathIdFunction();
52570         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52571     rc = test_xmlXPathIntersection();
52572         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52573     rc = test_xmlXPathIsNodeType();
52574         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52575     rc = test_xmlXPathLangFunction();
52576         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52577     rc = test_xmlXPathLastFunction();
52578         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52579     rc = test_xmlXPathLeading();
52580         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52581     rc = test_xmlXPathLeadingSorted();
52582         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52583     rc = test_xmlXPathLocalNameFunction();
52584         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52585     rc = test_xmlXPathModValues();
52586         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52587     rc = test_xmlXPathMultValues();
52588         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52589     rc = test_xmlXPathNamespaceURIFunction();
52590         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52591     rc = test_xmlXPathNewBoolean();
52592         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52593     rc = test_xmlXPathNewCString();
52594         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52595     rc = test_xmlXPathNewFloat();
52596         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52597     rc = test_xmlXPathNewNodeSet();
52598         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52599     rc = test_xmlXPathNewNodeSetList();
52600         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52601     rc = test_xmlXPathNewParserContext();
52602         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52603     rc = test_xmlXPathNewString();
52604         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52605     rc = test_xmlXPathNextAncestor();
52606         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52607     rc = test_xmlXPathNextAncestorOrSelf();
52608         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52609     rc = test_xmlXPathNextAttribute();
52610         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52611     rc = test_xmlXPathNextChild();
52612         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52613     rc = test_xmlXPathNextDescendant();
52614         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52615     rc = test_xmlXPathNextDescendantOrSelf();
52616         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52617     rc = test_xmlXPathNextFollowing();
52618         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52619     rc = test_xmlXPathNextFollowingSibling();
52620         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52621     rc = test_xmlXPathNextNamespace();
52622         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52623     rc = test_xmlXPathNextParent();
52624         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52625     rc = test_xmlXPathNextPreceding();
52626         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52627     rc = test_xmlXPathNextPrecedingSibling();
52628         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52629     rc = test_xmlXPathNextSelf();
52630         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52631     rc = test_xmlXPathNodeLeading();
52632         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52633     rc = test_xmlXPathNodeLeadingSorted();
52634         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52635     rc = test_xmlXPathNodeSetAdd();
52636         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52637     rc = test_xmlXPathNodeSetAddNs();
52638         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52639     rc = test_xmlXPathNodeSetAddUnique();
52640         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52641     rc = test_xmlXPathNodeSetContains();
52642         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52643     rc = test_xmlXPathNodeSetDel();
52644         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52645     rc = test_xmlXPathNodeSetMerge();
52646         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52647     rc = test_xmlXPathNodeSetRemove();
52648         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52649     rc = test_xmlXPathNodeSetSort();
52650         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52651     rc = test_xmlXPathNodeTrailing();
52652         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52653     rc = test_xmlXPathNodeTrailingSorted();
52654         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52655     rc = test_xmlXPathNormalizeFunction();
52656         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52657     rc = test_xmlXPathNotEqualValues();
52658         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52659     rc = test_xmlXPathNotFunction();
52660         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52661     rc = test_xmlXPathNsLookup();
52662         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52663     rc = test_xmlXPathNumberFunction();
52664         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52665     rc = test_xmlXPathParseNCName();
52666         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52667     rc = test_xmlXPathParseName();
52668         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52669     rc = test_xmlXPathPopBoolean();
52670         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52671     rc = test_xmlXPathPopExternal();
52672         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52673     rc = test_xmlXPathPopNodeSet();
52674         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52675     rc = test_xmlXPathPopNumber();
52676         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52677     rc = test_xmlXPathPopString();
52678         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52679     rc = test_xmlXPathPositionFunction();
52680         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52681     rc = test_xmlXPathRegisterAllFunctions();
52682         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52683     rc = test_xmlXPathRegisterFunc();
52684         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52685     rc = test_xmlXPathRegisterFuncLookup();
52686         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52687     rc = test_xmlXPathRegisterFuncNS();
52688         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52689     rc = test_xmlXPathRegisterNs();
52690         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52691     rc = test_xmlXPathRegisterVariable();
52692         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52693     rc = test_xmlXPathRegisterVariableLookup();
52694         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52695     rc = test_xmlXPathRegisterVariableNS();
52696         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52697     rc = test_xmlXPathRegisteredFuncsCleanup();
52698         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52699     rc = test_xmlXPathRegisteredNsCleanup();
52700         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52701     rc = test_xmlXPathRegisteredVariablesCleanup();
52702         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52703     rc = test_xmlXPathRoot();
52704         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52705     rc = test_xmlXPathRoundFunction();
52706         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52707     rc = test_xmlXPathStartsWithFunction();
52708         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52709     rc = test_xmlXPathStringEvalNumber();
52710         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52711     rc = test_xmlXPathStringFunction();
52712         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52713     rc = test_xmlXPathStringLengthFunction();
52714         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52715     rc = test_xmlXPathSubValues();
52716         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52717     rc = test_xmlXPathSubstringAfterFunction();
52718         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52719     rc = test_xmlXPathSubstringBeforeFunction();
52720         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52721     rc = test_xmlXPathSubstringFunction();
52722         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52723     rc = test_xmlXPathSumFunction();
52724         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52725     rc = test_xmlXPathTrailing();
52726         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52727     rc = test_xmlXPathTrailingSorted();
52728         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52729     rc = test_xmlXPathTranslateFunction();
52730         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52731     rc = test_xmlXPathTrueFunction();
52732         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52733     rc = test_xmlXPathValueFlipSign();
52734         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52735     rc = test_xmlXPathVariableLookup();
52736         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52737     rc = test_xmlXPathVariableLookupNS();
52738         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52739     rc = test_xmlXPathWrapCString();
52740         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52741     rc = test_xmlXPathWrapExternal();
52742         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52743     rc = test_xmlXPathWrapNodeSet();
52744         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52745     rc = test_xmlXPatherror();
52746         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52747
52748     if (test_ret != 0)
52749         printf("Module xpathInternals: %d errors\n", test_ret);
52750     return(test_ret);
52751 }
52752
52753 static int
52754 test_xmlXPtrBuildNodeList(void) {
52755     int test_ret = 0;
52756
52757 #if defined(LIBXML_XPTR_ENABLED)
52758     int mem_base;
52759     xmlNodePtr ret_val;
52760     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
52761     int n_obj;
52762
52763     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
52764         mem_base = xmlMemBlocks();
52765         obj = gen_xmlXPathObjectPtr(n_obj, 0);
52766
52767         ret_val = xmlXPtrBuildNodeList(obj);
52768         desret_xmlNodePtr(ret_val);
52769         call_tests++;
52770         des_xmlXPathObjectPtr(n_obj, obj, 0);
52771         xmlResetLastError();
52772         if (mem_base != xmlMemBlocks()) {
52773             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
52774                    xmlMemBlocks() - mem_base);
52775             test_ret++;
52776             printf(" %d", n_obj);
52777             printf("\n");
52778         }
52779     }
52780     function_tests++;
52781 #endif
52782
52783     return(test_ret);
52784 }
52785
52786
52787 static int
52788 test_xmlXPtrEval(void) {
52789     int test_ret = 0;
52790
52791 #if defined(LIBXML_XPTR_ENABLED)
52792     int mem_base;
52793     xmlXPathObjectPtr ret_val;
52794     xmlChar * str; /* the XPointer expression */
52795     int n_str;
52796     xmlXPathContextPtr ctx; /* the XPointer context */
52797     int n_ctx;
52798
52799     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
52800     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
52801         mem_base = xmlMemBlocks();
52802         str = gen_const_xmlChar_ptr(n_str, 0);
52803         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
52804
52805         ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
52806         desret_xmlXPathObjectPtr(ret_val);
52807         call_tests++;
52808         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
52809         des_xmlXPathContextPtr(n_ctx, ctx, 1);
52810         xmlResetLastError();
52811         if (mem_base != xmlMemBlocks()) {
52812             printf("Leak of %d blocks found in xmlXPtrEval",
52813                    xmlMemBlocks() - mem_base);
52814             test_ret++;
52815             printf(" %d", n_str);
52816             printf(" %d", n_ctx);
52817             printf("\n");
52818         }
52819     }
52820     }
52821     function_tests++;
52822 #endif
52823
52824     return(test_ret);
52825 }
52826
52827
52828 static int
52829 test_xmlXPtrEvalRangePredicate(void) {
52830     int test_ret = 0;
52831
52832 #if defined(LIBXML_XPTR_ENABLED)
52833     int mem_base;
52834     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
52835     int n_ctxt;
52836
52837     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52838         mem_base = xmlMemBlocks();
52839         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52840
52841         xmlXPtrEvalRangePredicate(ctxt);
52842         call_tests++;
52843         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52844         xmlResetLastError();
52845         if (mem_base != xmlMemBlocks()) {
52846             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
52847                    xmlMemBlocks() - mem_base);
52848             test_ret++;
52849             printf(" %d", n_ctxt);
52850             printf("\n");
52851         }
52852     }
52853     function_tests++;
52854 #endif
52855
52856     return(test_ret);
52857 }
52858
52859 #ifdef LIBXML_XPTR_ENABLED
52860
52861 #define gen_nb_xmlLocationSetPtr 1
52862 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
52863     return(NULL);
52864 }
52865 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
52866 }
52867 #endif
52868
52869
52870 static int
52871 test_xmlXPtrLocationSetAdd(void) {
52872     int test_ret = 0;
52873
52874 #if defined(LIBXML_XPTR_ENABLED)
52875     int mem_base;
52876     xmlLocationSetPtr cur; /* the initial range set */
52877     int n_cur;
52878     xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
52879     int n_val;
52880
52881     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
52882     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
52883         mem_base = xmlMemBlocks();
52884         cur = gen_xmlLocationSetPtr(n_cur, 0);
52885         val = gen_xmlXPathObjectPtr(n_val, 1);
52886
52887         xmlXPtrLocationSetAdd(cur, val);
52888         call_tests++;
52889         des_xmlLocationSetPtr(n_cur, cur, 0);
52890         des_xmlXPathObjectPtr(n_val, val, 1);
52891         xmlResetLastError();
52892         if (mem_base != xmlMemBlocks()) {
52893             printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
52894                    xmlMemBlocks() - mem_base);
52895             test_ret++;
52896             printf(" %d", n_cur);
52897             printf(" %d", n_val);
52898             printf("\n");
52899         }
52900     }
52901     }
52902     function_tests++;
52903 #endif
52904
52905     return(test_ret);
52906 }
52907
52908
52909 static int
52910 test_xmlXPtrLocationSetCreate(void) {
52911     int test_ret = 0;
52912
52913
52914     /* missing type support */
52915     return(test_ret);
52916 }
52917
52918
52919 static int
52920 test_xmlXPtrLocationSetDel(void) {
52921     int test_ret = 0;
52922
52923 #if defined(LIBXML_XPTR_ENABLED)
52924     int mem_base;
52925     xmlLocationSetPtr cur; /* the initial range set */
52926     int n_cur;
52927     xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
52928     int n_val;
52929
52930     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
52931     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
52932         mem_base = xmlMemBlocks();
52933         cur = gen_xmlLocationSetPtr(n_cur, 0);
52934         val = gen_xmlXPathObjectPtr(n_val, 1);
52935
52936         xmlXPtrLocationSetDel(cur, val);
52937         call_tests++;
52938         des_xmlLocationSetPtr(n_cur, cur, 0);
52939         des_xmlXPathObjectPtr(n_val, val, 1);
52940         xmlResetLastError();
52941         if (mem_base != xmlMemBlocks()) {
52942             printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
52943                    xmlMemBlocks() - mem_base);
52944             test_ret++;
52945             printf(" %d", n_cur);
52946             printf(" %d", n_val);
52947             printf("\n");
52948         }
52949     }
52950     }
52951     function_tests++;
52952 #endif
52953
52954     return(test_ret);
52955 }
52956
52957
52958 static int
52959 test_xmlXPtrLocationSetMerge(void) {
52960     int test_ret = 0;
52961
52962
52963     /* missing type support */
52964     return(test_ret);
52965 }
52966
52967
52968 static int
52969 test_xmlXPtrLocationSetRemove(void) {
52970     int test_ret = 0;
52971
52972 #if defined(LIBXML_XPTR_ENABLED)
52973     int mem_base;
52974     xmlLocationSetPtr cur; /* the initial range set */
52975     int n_cur;
52976     int val; /* the index to remove */
52977     int n_val;
52978
52979     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
52980     for (n_val = 0;n_val < gen_nb_int;n_val++) {
52981         mem_base = xmlMemBlocks();
52982         cur = gen_xmlLocationSetPtr(n_cur, 0);
52983         val = gen_int(n_val, 1);
52984
52985         xmlXPtrLocationSetRemove(cur, val);
52986         call_tests++;
52987         des_xmlLocationSetPtr(n_cur, cur, 0);
52988         des_int(n_val, val, 1);
52989         xmlResetLastError();
52990         if (mem_base != xmlMemBlocks()) {
52991             printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
52992                    xmlMemBlocks() - mem_base);
52993             test_ret++;
52994             printf(" %d", n_cur);
52995             printf(" %d", n_val);
52996             printf("\n");
52997         }
52998     }
52999     }
53000     function_tests++;
53001 #endif
53002
53003     return(test_ret);
53004 }
53005
53006
53007 static int
53008 test_xmlXPtrNewCollapsedRange(void) {
53009     int test_ret = 0;
53010
53011 #if defined(LIBXML_XPTR_ENABLED)
53012     int mem_base;
53013     xmlXPathObjectPtr ret_val;
53014     xmlNodePtr start; /* the starting and ending node */
53015     int n_start;
53016
53017     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53018         mem_base = xmlMemBlocks();
53019         start = gen_xmlNodePtr(n_start, 0);
53020
53021         ret_val = xmlXPtrNewCollapsedRange(start);
53022         desret_xmlXPathObjectPtr(ret_val);
53023         call_tests++;
53024         des_xmlNodePtr(n_start, start, 0);
53025         xmlResetLastError();
53026         if (mem_base != xmlMemBlocks()) {
53027             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
53028                    xmlMemBlocks() - mem_base);
53029             test_ret++;
53030             printf(" %d", n_start);
53031             printf("\n");
53032         }
53033     }
53034     function_tests++;
53035 #endif
53036
53037     return(test_ret);
53038 }
53039
53040
53041 static int
53042 test_xmlXPtrNewContext(void) {
53043     int test_ret = 0;
53044
53045
53046     /* missing type support */
53047     return(test_ret);
53048 }
53049
53050
53051 static int
53052 test_xmlXPtrNewLocationSetNodeSet(void) {
53053     int test_ret = 0;
53054
53055 #if defined(LIBXML_XPTR_ENABLED)
53056     int mem_base;
53057     xmlXPathObjectPtr ret_val;
53058     xmlNodeSetPtr set; /* a node set */
53059     int n_set;
53060
53061     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
53062         mem_base = xmlMemBlocks();
53063         set = gen_xmlNodeSetPtr(n_set, 0);
53064
53065         ret_val = xmlXPtrNewLocationSetNodeSet(set);
53066         desret_xmlXPathObjectPtr(ret_val);
53067         call_tests++;
53068         des_xmlNodeSetPtr(n_set, set, 0);
53069         xmlResetLastError();
53070         if (mem_base != xmlMemBlocks()) {
53071             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
53072                    xmlMemBlocks() - mem_base);
53073             test_ret++;
53074             printf(" %d", n_set);
53075             printf("\n");
53076         }
53077     }
53078     function_tests++;
53079 #endif
53080
53081     return(test_ret);
53082 }
53083
53084
53085 static int
53086 test_xmlXPtrNewLocationSetNodes(void) {
53087     int test_ret = 0;
53088
53089 #if defined(LIBXML_XPTR_ENABLED)
53090     int mem_base;
53091     xmlXPathObjectPtr ret_val;
53092     xmlNodePtr start; /* the start NodePtr value */
53093     int n_start;
53094     xmlNodePtr end; /* the end NodePtr value or NULL */
53095     int n_end;
53096
53097     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53098     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
53099         mem_base = xmlMemBlocks();
53100         start = gen_xmlNodePtr(n_start, 0);
53101         end = gen_xmlNodePtr(n_end, 1);
53102
53103         ret_val = xmlXPtrNewLocationSetNodes(start, end);
53104         desret_xmlXPathObjectPtr(ret_val);
53105         call_tests++;
53106         des_xmlNodePtr(n_start, start, 0);
53107         des_xmlNodePtr(n_end, end, 1);
53108         xmlResetLastError();
53109         if (mem_base != xmlMemBlocks()) {
53110             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
53111                    xmlMemBlocks() - mem_base);
53112             test_ret++;
53113             printf(" %d", n_start);
53114             printf(" %d", n_end);
53115             printf("\n");
53116         }
53117     }
53118     }
53119     function_tests++;
53120 #endif
53121
53122     return(test_ret);
53123 }
53124
53125
53126 static int
53127 test_xmlXPtrNewRange(void) {
53128     int test_ret = 0;
53129
53130 #if defined(LIBXML_XPTR_ENABLED)
53131     int mem_base;
53132     xmlXPathObjectPtr ret_val;
53133     xmlNodePtr start; /* the starting node */
53134     int n_start;
53135     int startindex; /* the start index */
53136     int n_startindex;
53137     xmlNodePtr end; /* the ending point */
53138     int n_end;
53139     int endindex; /* the ending index */
53140     int n_endindex;
53141
53142     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53143     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
53144     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
53145     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
53146         mem_base = xmlMemBlocks();
53147         start = gen_xmlNodePtr(n_start, 0);
53148         startindex = gen_int(n_startindex, 1);
53149         end = gen_xmlNodePtr(n_end, 2);
53150         endindex = gen_int(n_endindex, 3);
53151
53152         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
53153         desret_xmlXPathObjectPtr(ret_val);
53154         call_tests++;
53155         des_xmlNodePtr(n_start, start, 0);
53156         des_int(n_startindex, startindex, 1);
53157         des_xmlNodePtr(n_end, end, 2);
53158         des_int(n_endindex, endindex, 3);
53159         xmlResetLastError();
53160         if (mem_base != xmlMemBlocks()) {
53161             printf("Leak of %d blocks found in xmlXPtrNewRange",
53162                    xmlMemBlocks() - mem_base);
53163             test_ret++;
53164             printf(" %d", n_start);
53165             printf(" %d", n_startindex);
53166             printf(" %d", n_end);
53167             printf(" %d", n_endindex);
53168             printf("\n");
53169         }
53170     }
53171     }
53172     }
53173     }
53174     function_tests++;
53175 #endif
53176
53177     return(test_ret);
53178 }
53179
53180
53181 static int
53182 test_xmlXPtrNewRangeNodeObject(void) {
53183     int test_ret = 0;
53184
53185 #if defined(LIBXML_XPTR_ENABLED)
53186     int mem_base;
53187     xmlXPathObjectPtr ret_val;
53188     xmlNodePtr start; /* the starting node */
53189     int n_start;
53190     xmlXPathObjectPtr end; /* the ending object */
53191     int n_end;
53192
53193     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53194     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
53195         mem_base = xmlMemBlocks();
53196         start = gen_xmlNodePtr(n_start, 0);
53197         end = gen_xmlXPathObjectPtr(n_end, 1);
53198
53199         ret_val = xmlXPtrNewRangeNodeObject(start, end);
53200         desret_xmlXPathObjectPtr(ret_val);
53201         call_tests++;
53202         des_xmlNodePtr(n_start, start, 0);
53203         des_xmlXPathObjectPtr(n_end, end, 1);
53204         xmlResetLastError();
53205         if (mem_base != xmlMemBlocks()) {
53206             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
53207                    xmlMemBlocks() - mem_base);
53208             test_ret++;
53209             printf(" %d", n_start);
53210             printf(" %d", n_end);
53211             printf("\n");
53212         }
53213     }
53214     }
53215     function_tests++;
53216 #endif
53217
53218     return(test_ret);
53219 }
53220
53221
53222 static int
53223 test_xmlXPtrNewRangeNodePoint(void) {
53224     int test_ret = 0;
53225
53226 #if defined(LIBXML_XPTR_ENABLED)
53227     int mem_base;
53228     xmlXPathObjectPtr ret_val;
53229     xmlNodePtr start; /* the starting node */
53230     int n_start;
53231     xmlXPathObjectPtr end; /* the ending point */
53232     int n_end;
53233
53234     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53235     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
53236         mem_base = xmlMemBlocks();
53237         start = gen_xmlNodePtr(n_start, 0);
53238         end = gen_xmlXPathObjectPtr(n_end, 1);
53239
53240         ret_val = xmlXPtrNewRangeNodePoint(start, end);
53241         desret_xmlXPathObjectPtr(ret_val);
53242         call_tests++;
53243         des_xmlNodePtr(n_start, start, 0);
53244         des_xmlXPathObjectPtr(n_end, end, 1);
53245         xmlResetLastError();
53246         if (mem_base != xmlMemBlocks()) {
53247             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
53248                    xmlMemBlocks() - mem_base);
53249             test_ret++;
53250             printf(" %d", n_start);
53251             printf(" %d", n_end);
53252             printf("\n");
53253         }
53254     }
53255     }
53256     function_tests++;
53257 #endif
53258
53259     return(test_ret);
53260 }
53261
53262
53263 static int
53264 test_xmlXPtrNewRangeNodes(void) {
53265     int test_ret = 0;
53266
53267 #if defined(LIBXML_XPTR_ENABLED)
53268     int mem_base;
53269     xmlXPathObjectPtr ret_val;
53270     xmlNodePtr start; /* the starting node */
53271     int n_start;
53272     xmlNodePtr end; /* the ending node */
53273     int n_end;
53274
53275     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53276     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
53277         mem_base = xmlMemBlocks();
53278         start = gen_xmlNodePtr(n_start, 0);
53279         end = gen_xmlNodePtr(n_end, 1);
53280
53281         ret_val = xmlXPtrNewRangeNodes(start, end);
53282         desret_xmlXPathObjectPtr(ret_val);
53283         call_tests++;
53284         des_xmlNodePtr(n_start, start, 0);
53285         des_xmlNodePtr(n_end, end, 1);
53286         xmlResetLastError();
53287         if (mem_base != xmlMemBlocks()) {
53288             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
53289                    xmlMemBlocks() - mem_base);
53290             test_ret++;
53291             printf(" %d", n_start);
53292             printf(" %d", n_end);
53293             printf("\n");
53294         }
53295     }
53296     }
53297     function_tests++;
53298 #endif
53299
53300     return(test_ret);
53301 }
53302
53303
53304 static int
53305 test_xmlXPtrNewRangePointNode(void) {
53306     int test_ret = 0;
53307
53308 #if defined(LIBXML_XPTR_ENABLED)
53309     int mem_base;
53310     xmlXPathObjectPtr ret_val;
53311     xmlXPathObjectPtr start; /* the starting point */
53312     int n_start;
53313     xmlNodePtr end; /* the ending node */
53314     int n_end;
53315
53316     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
53317     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
53318         mem_base = xmlMemBlocks();
53319         start = gen_xmlXPathObjectPtr(n_start, 0);
53320         end = gen_xmlNodePtr(n_end, 1);
53321
53322         ret_val = xmlXPtrNewRangePointNode(start, end);
53323         desret_xmlXPathObjectPtr(ret_val);
53324         call_tests++;
53325         des_xmlXPathObjectPtr(n_start, start, 0);
53326         des_xmlNodePtr(n_end, end, 1);
53327         xmlResetLastError();
53328         if (mem_base != xmlMemBlocks()) {
53329             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
53330                    xmlMemBlocks() - mem_base);
53331             test_ret++;
53332             printf(" %d", n_start);
53333             printf(" %d", n_end);
53334             printf("\n");
53335         }
53336     }
53337     }
53338     function_tests++;
53339 #endif
53340
53341     return(test_ret);
53342 }
53343
53344
53345 static int
53346 test_xmlXPtrNewRangePoints(void) {
53347     int test_ret = 0;
53348
53349 #if defined(LIBXML_XPTR_ENABLED)
53350     int mem_base;
53351     xmlXPathObjectPtr ret_val;
53352     xmlXPathObjectPtr start; /* the starting point */
53353     int n_start;
53354     xmlXPathObjectPtr end; /* the ending point */
53355     int n_end;
53356
53357     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
53358     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
53359         mem_base = xmlMemBlocks();
53360         start = gen_xmlXPathObjectPtr(n_start, 0);
53361         end = gen_xmlXPathObjectPtr(n_end, 1);
53362
53363         ret_val = xmlXPtrNewRangePoints(start, end);
53364         desret_xmlXPathObjectPtr(ret_val);
53365         call_tests++;
53366         des_xmlXPathObjectPtr(n_start, start, 0);
53367         des_xmlXPathObjectPtr(n_end, end, 1);
53368         xmlResetLastError();
53369         if (mem_base != xmlMemBlocks()) {
53370             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
53371                    xmlMemBlocks() - mem_base);
53372             test_ret++;
53373             printf(" %d", n_start);
53374             printf(" %d", n_end);
53375             printf("\n");
53376         }
53377     }
53378     }
53379     function_tests++;
53380 #endif
53381
53382     return(test_ret);
53383 }
53384
53385
53386 static int
53387 test_xmlXPtrRangeToFunction(void) {
53388     int test_ret = 0;
53389
53390 #if defined(LIBXML_XPTR_ENABLED)
53391     int mem_base;
53392     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
53393     int n_ctxt;
53394     int nargs; /* the number of args */
53395     int n_nargs;
53396
53397     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
53398     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
53399         mem_base = xmlMemBlocks();
53400         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
53401         nargs = gen_int(n_nargs, 1);
53402
53403         xmlXPtrRangeToFunction(ctxt, nargs);
53404         call_tests++;
53405         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
53406         des_int(n_nargs, nargs, 1);
53407         xmlResetLastError();
53408         if (mem_base != xmlMemBlocks()) {
53409             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
53410                    xmlMemBlocks() - mem_base);
53411             test_ret++;
53412             printf(" %d", n_ctxt);
53413             printf(" %d", n_nargs);
53414             printf("\n");
53415         }
53416     }
53417     }
53418     function_tests++;
53419 #endif
53420
53421     return(test_ret);
53422 }
53423
53424
53425 static int
53426 test_xmlXPtrWrapLocationSet(void) {
53427     int test_ret = 0;
53428
53429 #if defined(LIBXML_XPTR_ENABLED)
53430     int mem_base;
53431     xmlXPathObjectPtr ret_val;
53432     xmlLocationSetPtr val; /* the LocationSet value */
53433     int n_val;
53434
53435     for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
53436         mem_base = xmlMemBlocks();
53437         val = gen_xmlLocationSetPtr(n_val, 0);
53438
53439         ret_val = xmlXPtrWrapLocationSet(val);
53440         desret_xmlXPathObjectPtr(ret_val);
53441         call_tests++;
53442         des_xmlLocationSetPtr(n_val, val, 0);
53443         xmlResetLastError();
53444         if (mem_base != xmlMemBlocks()) {
53445             printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
53446                    xmlMemBlocks() - mem_base);
53447             test_ret++;
53448             printf(" %d", n_val);
53449             printf("\n");
53450         }
53451     }
53452     function_tests++;
53453 #endif
53454
53455     return(test_ret);
53456 }
53457
53458 static int
53459 test_xpointer(void) {
53460     int test_ret = 0;
53461         int rc = 0;
53462
53463     if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
53464     rc = test_xmlXPtrBuildNodeList();
53465         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53466     rc = test_xmlXPtrEval();
53467         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53468     rc = test_xmlXPtrEvalRangePredicate();
53469         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53470     rc = test_xmlXPtrLocationSetAdd();
53471         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53472     rc = test_xmlXPtrLocationSetCreate();
53473         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53474     rc = test_xmlXPtrLocationSetDel();
53475         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53476     rc = test_xmlXPtrLocationSetMerge();
53477         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53478     rc = test_xmlXPtrLocationSetRemove();
53479         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53480     rc = test_xmlXPtrNewCollapsedRange();
53481         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53482     rc = test_xmlXPtrNewContext();
53483         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53484     rc = test_xmlXPtrNewLocationSetNodeSet();
53485         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53486     rc = test_xmlXPtrNewLocationSetNodes();
53487         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53488     rc = test_xmlXPtrNewRange();
53489         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53490     rc = test_xmlXPtrNewRangeNodeObject();
53491         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53492     rc = test_xmlXPtrNewRangeNodePoint();
53493         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53494     rc = test_xmlXPtrNewRangeNodes();
53495         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53496     rc = test_xmlXPtrNewRangePointNode();
53497         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53498     rc = test_xmlXPtrNewRangePoints();
53499         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53500     rc = test_xmlXPtrRangeToFunction();
53501         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53502     rc = test_xmlXPtrWrapLocationSet();
53503         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53504
53505     if (test_ret != 0)
53506         printf("Module xpointer: %d errors\n", test_ret);
53507     return(test_ret);
53508 }
53509 static int
53510 test_module(const char *module) {
53511     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
53512     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
53513     if (!strcmp(module, "SAX2")) return(test_SAX2());
53514     if (!strcmp(module, "c14n")) return(test_c14n());
53515     if (!strcmp(module, "catalog")) return(test_catalog());
53516     if (!strcmp(module, "chvalid")) return(test_chvalid());
53517     if (!strcmp(module, "debugXML")) return(test_debugXML());
53518     if (!strcmp(module, "dict")) return(test_dict());
53519     if (!strcmp(module, "encoding")) return(test_encoding());
53520     if (!strcmp(module, "entities")) return(test_entities());
53521     if (!strcmp(module, "hash")) return(test_hash());
53522     if (!strcmp(module, "list")) return(test_list());
53523     if (!strcmp(module, "nanoftp")) return(test_nanoftp());
53524     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
53525     if (!strcmp(module, "parser")) return(test_parser());
53526     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
53527     if (!strcmp(module, "pattern")) return(test_pattern());
53528     if (!strcmp(module, "relaxng")) return(test_relaxng());
53529     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
53530     if (!strcmp(module, "schematron")) return(test_schematron());
53531     if (!strcmp(module, "tree")) return(test_tree());
53532     if (!strcmp(module, "uri")) return(test_uri());
53533     if (!strcmp(module, "valid")) return(test_valid());
53534     if (!strcmp(module, "xinclude")) return(test_xinclude());
53535     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
53536     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
53537     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
53538     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
53539     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
53540     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
53541     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
53542     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
53543     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
53544     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
53545     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
53546     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
53547     if (!strcmp(module, "xpath")) return(test_xpath());
53548     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
53549     if (!strcmp(module, "xpointer")) return(test_xpointer());
53550     return(0);
53551 }