Imported Upstream version 2.8.0
[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 #ifdef HAVE_CONFIG_H
12 #include "libxml.h"
13 #else
14 #include <stdio.h>
15 #endif
16
17 #include <stdlib.h> /* for putenv() */
18 #include <string.h>
19 #include <libxml/xmlerror.h>
20 #include <libxml/relaxng.h>
21
22 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
23 #define snprintf _snprintf
24 #endif
25
26 static int testlibxml2(void);
27 static int test_module(const char *module);
28
29 static int generic_errors = 0;
30 static int call_tests = 0;
31 static int function_tests = 0;
32
33 static xmlChar chartab[1024];
34 static int inttab[1024];
35 static unsigned long longtab[1024];
36
37 static xmlDocPtr api_doc = NULL;
38 static xmlDtdPtr api_dtd = NULL;
39 static xmlNodePtr api_root = NULL;
40 static xmlAttrPtr api_attr = NULL;
41 static xmlNsPtr api_ns = NULL;
42
43 static void
44 structured_errors(void *userData ATTRIBUTE_UNUSED,
45                   xmlErrorPtr error ATTRIBUTE_UNUSED) {
46     generic_errors++;
47 }
48
49 static void
50 free_api_doc(void) {
51     xmlFreeDoc(api_doc);
52     api_doc = NULL;
53     api_dtd = NULL;
54     api_root = NULL;
55     api_attr = NULL;
56     api_ns = NULL;
57 }
58
59 static xmlDocPtr
60 get_api_doc(void) {
61     if (api_doc == NULL) {
62         api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
63         api_root = NULL;
64         api_attr = NULL;
65     }
66     return(api_doc);
67 }
68
69 static xmlDtdPtr
70 get_api_dtd(void) {
71     if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
72         get_api_doc();
73         if ((api_doc != NULL) && (api_doc->children != NULL) &&
74             (api_doc->children->type == XML_DTD_NODE))
75             api_dtd = (xmlDtdPtr) api_doc->children;
76     }
77     return(api_dtd);
78 }
79
80 static xmlNodePtr
81 get_api_root(void) {
82     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
83         get_api_doc();
84         if ((api_doc != NULL) && (api_doc->children != NULL) &&
85             (api_doc->children->next != NULL) &&
86             (api_doc->children->next->type == XML_ELEMENT_NODE))
87             api_root = api_doc->children->next;
88     }
89     return(api_root);
90 }
91
92 static xmlNsPtr
93 get_api_ns(void) {
94     get_api_root();
95     if (api_root != NULL)
96         api_ns = api_root->nsDef;
97     return(api_ns);
98 }
99
100 static xmlAttrPtr
101 get_api_attr(void) {
102 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
103     static int nr = 0;
104     xmlChar name[20];
105 #endif
106
107     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
108         get_api_root();
109     }
110     if (api_root == NULL) 
111         return(NULL);
112     if (api_root->properties != NULL) {
113         api_attr = api_root->properties;
114         return(api_root->properties);
115     }
116     api_attr = NULL;
117 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
118     snprintf((char *) name, 20, "foo%d", nr++);
119     api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
120 #endif
121     return(api_attr);
122 }
123
124 static int quiet = 0;
125
126 int main(int argc, char **argv) {
127     int ret;
128     int blocks, mem;
129
130     /* access to the proxy can slow up regression tests a lot */
131     putenv((char *) "http_proxy=");
132
133     memset(chartab, 0, sizeof(chartab));
134     strncpy((char *) chartab, "  chartab\n", 20);
135     memset(inttab, 0, sizeof(inttab));
136     memset(longtab, 0, sizeof(longtab));
137
138     xmlInitParser();
139 #ifdef LIBXML_SCHEMAS_ENABLED
140     xmlRelaxNGInitTypes();
141 #endif
142
143     LIBXML_TEST_VERSION
144
145     xmlSetStructuredErrorFunc(NULL, structured_errors);
146
147     if (argc >= 2) {
148         if (!strcmp(argv[1], "-q")) {
149             quiet = 1;
150             if (argc >= 3)
151                 ret = test_module(argv[2]);
152             else
153                 ret = testlibxml2();
154         } else {
155            ret = test_module(argv[1]);
156         }
157     } else
158         ret = testlibxml2();
159
160     xmlCleanupParser();
161     blocks = xmlMemBlocks();
162     mem = xmlMemUsed();
163     if ((blocks != 0) || (mem != 0)) {
164         printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
165     }
166     xmlMemoryDump();
167
168     return (ret != 0);
169 }
170
171 #include <libxml/HTMLparser.h>
172 #include <libxml/HTMLtree.h>
173 #include <libxml/catalog.h>
174 #include <libxml/chvalid.h>
175 #include <libxml/dict.h>
176 #include <libxml/encoding.h>
177 #include <libxml/entities.h>
178 #include <libxml/hash.h>
179 #include <libxml/list.h>
180 #include <libxml/nanoftp.h>
181 #include <libxml/nanohttp.h>
182 #include <libxml/parser.h>
183 #include <libxml/parserInternals.h>
184 #include <libxml/pattern.h>
185 #include <libxml/relaxng.h>
186 #include <libxml/schemasInternals.h>
187 #include <libxml/schematron.h>
188 #include <libxml/tree.h>
189 #include <libxml/uri.h>
190 #include <libxml/valid.h>
191 #include <libxml/xinclude.h>
192 #include <libxml/xmlIO.h>
193 #include <libxml/xmlerror.h>
194 #include <libxml/xmlreader.h>
195 #include <libxml/xmlsave.h>
196 #include <libxml/xmlschemas.h>
197 #include <libxml/xmlschemastypes.h>
198 #include <libxml/xmlstring.h>
199 #include <libxml/xmlwriter.h>
200 #include <libxml/xpath.h>
201 #include <libxml/xpointer.h>
202 #include <libxml/debugXML.h>
203
204 /* 
205   We manually define xmlErrMemory because it's normal declaration
206   is "hidden" by #ifdef IN_LIBXML
207 */
208 void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
209
210 /*
211  We need some "remote" addresses, but want to avoid getting into
212  name resolution delays, so we use these
213 */
214 #define REMOTE1GOOD     "http://localhost/"
215 #define REMOTE1BAD      "http:http://http"
216 #define REMOTE2GOOD     "ftp://localhost/foo"
217
218 #define gen_nb_void_ptr 2
219
220 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
221     return(NULL);
222 }
223 static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
224 }
225
226 #if 0
227 #define gen_nb_const_void_ptr 2
228
229 static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
230     if (no == 0) return((const void *) "immutable string");
231     return(NULL);
232 }
233 static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
234 }
235 #endif
236
237 #define gen_nb_userdata 3
238
239 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
240     if (no == 0) return((void *) &call_tests);
241     if (no == 1) return((void *) -1);
242     return(NULL);
243 }
244 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
245 }
246
247
248 #define gen_nb_int 4
249
250 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
251     if (no == 0) return(0);
252     if (no == 1) return(1);
253     if (no == 2) return(-1);
254     if (no == 3) return(122);
255     return(-1);
256 }
257
258 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
259 }
260
261 #define gen_nb_parseroptions 5
262
263 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
264     if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
265     if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
266     if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
267     if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
268     return(XML_PARSE_SAX1);
269 }
270
271 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
272 }
273
274 #if 0
275 #define gen_nb_long 5
276
277 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
278     if (no == 0) return(0);
279     if (no == 1) return(1);
280     if (no == 2) return(-1);
281     if (no == 3) return(122);
282     return(-1);
283 }
284
285 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
286 }
287 #endif
288
289 #define gen_nb_xmlChar 4
290
291 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
292     if (no == 0) return('a');
293     if (no == 1) return(' ');
294     if (no == 2) return((xmlChar) 'ø');
295     return(0);
296 }
297
298 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
299 }
300
301 #define gen_nb_unsigned_int 3
302
303 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
304     if (no == 0) return(0);
305     if (no == 1) return(1);
306     if (no == 2) return(122);
307     return((unsigned int) -1);
308 }
309
310 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
311 }
312
313 #define gen_nb_unsigned_long 4
314
315 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
316     if (no == 0) return(0);
317     if (no == 1) return(1);
318     if (no == 2) return(122);
319     return((unsigned long) -1);
320 }
321
322 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
323 }
324
325 #define gen_nb_double 4
326
327 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
328     if (no == 0) return(0);
329     if (no == 1) return(-1.1);
330 #if defined(LIBXML_XPATH_ENABLED)
331     if (no == 2) return(xmlXPathNAN);
332 #endif
333     return(-1);
334 }
335
336 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
337 }
338
339 #define gen_nb_unsigned_long_ptr 2
340
341 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
342     if (no == 0) return(&longtab[nr]);
343     return(NULL);
344 }
345
346 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
347 }
348
349 #define gen_nb_int_ptr 2
350
351 static int *gen_int_ptr(int no, int nr) {
352     if (no == 0) return(&inttab[nr]);
353     return(NULL);
354 }
355
356 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
357 }
358
359 #define gen_nb_const_char_ptr 4
360
361 static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
362     if (no == 0) return((char *) "foo");
363     if (no == 1) return((char *) "<foo/>");
364     if (no == 2) return((char *) "test/ent2");
365     return(NULL);
366 }
367 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
368 }
369
370 #define gen_nb_xmlChar_ptr 2
371
372 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
373     if (no == 0) return(&chartab[0]);
374     return(NULL);
375 }
376 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
377 }
378
379 #define gen_nb_FILE_ptr 2
380
381 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
382     if (no == 0) return(fopen("test.out", "a+"));
383     return(NULL);
384 }
385 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
386     if (val != NULL) fclose(val);
387 }
388
389 #define gen_nb_debug_FILE_ptr 2
390 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
391     return(fopen("test.out", "a+"));
392 }
393 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
394     if (val != NULL) fclose(val);
395 }
396
397 #define gen_nb_const_xmlChar_ptr 5
398
399 static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
400     if (no == 0) return((xmlChar *) "foo");
401     if (no == 1) return((xmlChar *) "<foo/>");
402     if (no == 2) return((xmlChar *) "nøne");
403     if (no == 3) return((xmlChar *) " 2ab ");
404     return(NULL);
405 }
406 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
407 }
408
409 #define gen_nb_filepath 8
410
411 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
412     if (no == 0) return("missing.xml");
413     if (no == 1) return("<foo/>");
414     if (no == 2) return("test/ent2");
415     if (no == 3) return("test/valid/REC-xml-19980210.xml");
416     if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
417     if (no == 5) return(REMOTE1GOOD);
418     if (no == 6) return(REMOTE1BAD);
419     return(NULL);
420 }
421 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
422 }
423
424 #define gen_nb_eaten_name 2
425
426 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
427     if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
428     return(NULL);
429 }
430 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
431 }
432
433 #define gen_nb_fileoutput 6
434
435 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
436     if (no == 0) return("/missing.xml");
437     if (no == 1) return("<foo/>");
438     if (no == 2) return(REMOTE2GOOD);
439     if (no == 3) return(REMOTE1GOOD);
440     if (no == 4) return(REMOTE1BAD);
441     return(NULL);
442 }
443 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
444 }
445
446 #define gen_nb_xmlParserCtxtPtr 3
447 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
448     if (no == 0) return(xmlNewParserCtxt());
449     if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
450     return(NULL);
451 }
452 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
453     if (val != NULL)
454         xmlFreeParserCtxt(val);
455 }
456
457 #define gen_nb_xmlSAXHandlerPtr 2
458 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
459 #ifdef LIBXML_SAX1_ENABLED
460     if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
461 #endif
462     return(NULL);
463 }
464 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
465 }
466
467 #define gen_nb_xmlValidCtxtPtr 2
468 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
469 #ifdef LIBXML_VALID_ENABLED
470     if (no == 0) return(xmlNewValidCtxt());
471 #endif
472     return(NULL);
473 }
474 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
475 #ifdef LIBXML_VALID_ENABLED
476     if (val != NULL)
477         xmlFreeValidCtxt(val);
478 #endif
479 }
480
481 #define gen_nb_xmlParserInputBufferPtr 8
482
483 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
484     if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
485     if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
486     if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
487     if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
488     if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
489     if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
490     if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
491     return(NULL);
492 }
493 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
494     xmlFreeParserInputBuffer(val);
495 }
496
497 #define gen_nb_xmlDocPtr 4
498 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
499     if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
500     if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
501     if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
502     return(NULL);
503 }
504 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
505     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
506         xmlFreeDoc(val);
507 }
508
509 #define gen_nb_xmlAttrPtr 2
510 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
511     if (no == 0) return(get_api_attr());
512     return(NULL);
513 }
514 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
515     if (no == 0) free_api_doc();
516 }
517
518 #define gen_nb_xmlDictPtr 2
519 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
520     if (no == 0) return(xmlDictCreate());
521     return(NULL);
522 }
523 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
524     if (val != NULL)
525         xmlDictFree(val);
526 }
527
528 #define gen_nb_xmlNodePtr 3
529 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
530     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
531     if (no == 1) return(get_api_root());
532     return(NULL);
533 /*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
534 }
535 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
536     if (no == 1) {
537         free_api_doc();
538     } else if (val != NULL) {
539         xmlUnlinkNode(val);
540         xmlFreeNode(val);
541     }
542 }
543
544 #define gen_nb_xmlDtdPtr 3
545 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
546     if (no == 0) 
547         return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
548     if (no == 1) return(get_api_dtd());
549     return(NULL);
550 }
551 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
552     if (no == 1) free_api_doc();
553     else if (val != NULL) {
554         xmlUnlinkNode((xmlNodePtr) val);
555         xmlFreeNode((xmlNodePtr) val);
556     }
557 }
558
559 #define gen_nb_xmlNsPtr 2
560 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
561     if (no == 0) return(get_api_ns());
562     return(NULL);
563 }
564 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
565     if (no == 0) free_api_doc();
566 }
567
568 #define gen_nb_xmlNodePtr_in 3
569 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
570     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
571     if (no == 0) return(xmlNewText(BAD_CAST "text"));
572     return(NULL);
573 }
574 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
575 }
576
577 #ifdef LIBXML_WRITER_ENABLED
578 #define gen_nb_xmlTextWriterPtr 2
579 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
580     if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
581     return(NULL);
582 }
583 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
584     if (val != NULL) xmlFreeTextWriter(val);
585 }
586 #endif
587
588 #ifdef LIBXML_READER_ENABLED
589 #define gen_nb_xmlTextReaderPtr 4
590 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
591     if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
592     if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
593     if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
594     return(NULL);
595 }
596 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
597     if (val != NULL) xmlFreeTextReader(val);
598 }
599 #endif
600
601 #define gen_nb_xmlBufferPtr 3
602 static const xmlChar *static_buf_content = (xmlChar *)"a static buffer";
603 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
604     if (no == 0) return(xmlBufferCreate());
605     if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
606     return(NULL);
607 }
608 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
609     if (val != NULL) {
610         xmlBufferFree(val);
611     }
612 }
613
614 #define gen_nb_xmlListPtr 2
615 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
616     if (no == 0) return(xmlListCreate(NULL, NULL));
617     return(NULL);
618 }
619 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
620     if (val != NULL) {
621         xmlListDelete(val);
622     }
623 }
624
625 #define gen_nb_xmlHashTablePtr 2
626 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
627     if (no == 0) return(xmlHashCreate(10));
628     return(NULL);
629 }
630 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
631     if (val != NULL) {
632         xmlHashFree(val, NULL);
633     }
634 }
635
636 #include <libxml/xpathInternals.h>
637
638 #ifdef LIBXML_XPATH_ENABLED
639 #define gen_nb_xmlXPathObjectPtr 5
640 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
641     if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
642     if (no == 1) return(xmlXPathNewFloat(1.1));
643     if (no == 2) return(xmlXPathNewBoolean(1));
644     if (no == 3) return(xmlXPathNewNodeSet(NULL));
645     return(NULL);
646 }
647 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
648     if (val != NULL) {
649         xmlXPathFreeObject(val);
650     }
651 }
652 #endif
653
654 #ifdef LIBXML_OUTPUT_ENABLED
655 #define gen_nb_xmlOutputBufferPtr 2
656 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
657     if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
658     return(NULL);
659 }
660 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
661     if (val != NULL) {
662         xmlOutputBufferClose(val);
663     }
664 }
665 #endif
666
667 #ifdef LIBXML_FTP_ENABLED
668 #define gen_nb_xmlNanoFTPCtxtPtr 4
669 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
670     if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
671     if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
672     if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
673     return(NULL);
674 }
675 static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
676     if (val != NULL) {
677         xmlNanoFTPFreeCtxt(val);
678     }
679 }
680 #endif
681
682 #ifdef LIBXML_HTTP_ENABLED
683 #define gen_nb_xmlNanoHTTPCtxtPtr 1
684 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
685     if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
686     if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
687     if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
688     return(NULL);
689 }
690 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
691     if (val != NULL) {
692         xmlNanoHTTPClose(val);
693     }
694 }
695 #endif
696
697 #define gen_nb_xmlCharEncoding 4
698 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
699     if (no == 0) return(XML_CHAR_ENCODING_UTF8);
700     if (no == 1) return(XML_CHAR_ENCODING_NONE);
701     if (no == 2) return(XML_CHAR_ENCODING_8859_1);
702     return(XML_CHAR_ENCODING_ERROR);
703 }
704 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
705 }
706
707 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
708
709 #define gen_nb_xmlExpCtxtPtr 1
710 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
711     return(NULL);
712 }
713 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
714 }
715
716 #define gen_nb_xmlExpNodePtr 1
717 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
718     return(NULL);
719 }
720 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
721 }
722
723 #endif
724
725 #if defined(LIBXML_SCHEMAS_ENABLED)
726 #define gen_nb_xmlSchemaPtr 1
727 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
728     return(NULL);
729 }
730 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
731 }
732
733 #define gen_nb_xmlSchemaValidCtxtPtr 1
734 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
735     return(NULL);
736 }
737 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
738 }
739
740 #endif /* LIBXML_SCHEMAS_ENABLED */
741
742 #define gen_nb_xmlHashDeallocator 2
743 static void 
744 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
745 }
746
747 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
748     if (no == 0) return(test_xmlHashDeallocator);
749     return(NULL);
750 }
751 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
752 }
753
754
755 static void desret_int(int val ATTRIBUTE_UNUSED) {
756 }
757 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
758 }
759 static void desret_long(long val ATTRIBUTE_UNUSED) {
760 }
761 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
762 }
763 static void desret_double(double val ATTRIBUTE_UNUSED) {
764 }
765 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
766 }
767 #if 0
768 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
769 }
770 #endif
771 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
772 }
773 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
774 }
775 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
776 }
777 static void desret_xmlChar_ptr(xmlChar *val) {
778     if (val != NULL)
779         xmlFree(val);
780 }
781 static void desret_xmlDocPtr(xmlDocPtr val) {
782     if (val != api_doc)
783         xmlFreeDoc(val);
784 }
785 static void desret_xmlDictPtr(xmlDictPtr val) {
786     xmlDictFree(val);
787 }
788 #ifdef LIBXML_OUTPUT_ENABLED
789 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
790     xmlOutputBufferClose(val);
791 }
792 #endif
793 #ifdef LIBXML_READER_ENABLED
794 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
795     xmlFreeTextReader(val);
796 }
797 #endif
798 static void desret_xmlNodePtr(xmlNodePtr val) {
799     if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
800         xmlUnlinkNode(val);
801         xmlFreeNode(val);
802     }
803 }
804 static void desret_xmlAttrPtr(xmlAttrPtr val) {
805     if (val != NULL) {
806         xmlUnlinkNode((xmlNodePtr) val);
807         xmlFreeNode((xmlNodePtr) val);
808     }
809 }
810 static void desret_xmlEntityPtr(xmlEntityPtr val) {
811     if (val != NULL) {
812         xmlUnlinkNode((xmlNodePtr) val);
813         xmlFreeNode((xmlNodePtr) val);
814     }
815 }
816 static void desret_xmlElementPtr(xmlElementPtr val) {
817     if (val != NULL) {
818         xmlUnlinkNode((xmlNodePtr) val);
819     }
820 }
821 static void desret_xmlAttributePtr(xmlAttributePtr val) {
822     if (val != NULL) {
823         xmlUnlinkNode((xmlNodePtr) val);
824     }
825 }
826 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
827 }
828 static void desret_xmlDtdPtr(xmlDtdPtr val) {
829     desret_xmlNodePtr((xmlNodePtr)val);
830 }
831 #ifdef LIBXML_XPATH_ENABLED
832 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
833     xmlXPathFreeObject(val);
834 }
835 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
836     xmlXPathFreeNodeSet(val);
837 }
838 #endif
839 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
840     xmlFreeParserCtxt(val);
841 }
842 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
843     xmlFreeParserInputBuffer(val);
844 }
845 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
846     xmlFreeInputStream(val);
847 }
848 #ifdef LIBXML_WRITER_ENABLED
849 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
850     xmlFreeTextWriter(val);
851 }
852 #endif
853 static void desret_xmlBufferPtr(xmlBufferPtr val) {
854     xmlBufferFree(val);
855 }
856 #ifdef LIBXML_SCHEMAS_ENABLED
857 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
858     xmlSchemaFreeParserCtxt(val);
859 }
860 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
861 }
862 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
863     xmlRelaxNGFreeParserCtxt(val);
864 }
865 #endif
866 #ifdef LIBXML_HTML_ENABLED
867 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
868 }
869 #endif
870 #ifdef LIBXML_HTTP_ENABLED
871 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
872     xmlNanoHTTPClose(val);
873 }
874 #endif
875 #ifdef LIBXML_FTP_ENABLED
876 static void desret_xmlNanoFTPCtxtPtr(void *val) {
877     xmlNanoFTPClose(val);
878 }
879 #endif
880 /* cut and pasted from autogenerated to avoid troubles */
881 #define gen_nb_const_xmlChar_ptr_ptr 1
882 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
883     return(NULL);
884 }
885 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
886 }
887
888 #define gen_nb_unsigned_char_ptr 1
889 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
890     return(NULL);
891 }
892 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
893 }
894
895 #define gen_nb_const_unsigned_char_ptr 1
896 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
897     return(NULL);
898 }
899 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
900 }
901
902 #ifdef LIBXML_HTML_ENABLED
903 #define gen_nb_const_htmlNodePtr 1
904 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
905     return(NULL);
906 }
907 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
908 }
909 #endif
910
911 #ifdef LIBXML_HTML_ENABLED
912 #define gen_nb_htmlDocPtr 3
913 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
914     if (no == 0) return(htmlNewDoc(NULL, NULL));
915     if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
916     return(NULL);
917 }
918 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
919     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
920         xmlFreeDoc(val);
921 }
922 static void desret_htmlDocPtr(htmlDocPtr val) {
923     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
924         xmlFreeDoc(val);
925 }
926 #define gen_nb_htmlParserCtxtPtr 3
927 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
928     if (no == 0) return(xmlNewParserCtxt());
929     if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
930     return(NULL);
931 }
932 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
933     if (val != NULL)
934         htmlFreeParserCtxt(val);
935 }
936 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
937     if (val != NULL)
938         htmlFreeParserCtxt(val);
939 }
940 #endif
941
942 #ifdef LIBXML_XPATH_ENABLED
943 #define gen_nb_xmlNodeSetPtr 1
944 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
945     return(NULL);
946 }
947 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
948 }
949 #endif
950
951 #ifdef LIBXML_DEBUG_ENABLED
952 #ifdef LIBXML_XPATH_ENABLED
953 #define gen_nb_xmlShellCtxtPtr 1
954 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
955     return(NULL);
956 }
957 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
958 }
959 #endif
960 #endif
961
962 #ifdef LIBXML_PATTERN_ENABLED
963 #define gen_nb_xmlPatternPtr 1
964 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
965     return(NULL);
966 }
967 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
968 }
969 #endif
970
971 #define gen_nb_xmlElementContentPtr 1
972 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
973     return(NULL);
974 }
975 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
976     if (val != NULL)
977         xmlFreeElementContent(val);
978 }
979 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
980     if (val != NULL)
981         xmlFreeElementContent(val);
982 }
983
984 #define gen_nb_xmlParserNodeInfoSeqPtr 1
985 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
986     return(NULL);
987 }
988 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
989 }
990
991 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
992 }
993
994 #define gen_nb_void_ptr_ptr 1
995 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
996     return(NULL);
997 }
998 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
999 }
1000
1001 /************************************************************************
1002  *                                                                      *
1003  *   WARNING: end of the manually maintained part of the test code      *
1004  *            do not remove or alter the CUT HERE line                  *
1005  *                                                                      *
1006  ************************************************************************/
1007
1008 /* CUT HERE: everything below that line is generated */
1009 #ifdef LIBXML_HTML_ENABLED
1010 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1011 }
1012
1013 #endif
1014
1015 #define gen_nb_xmlAttributeDefault 4
1016 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1017     if (no == 1) return(XML_ATTRIBUTE_FIXED);
1018     if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1019     if (no == 3) return(XML_ATTRIBUTE_NONE);
1020     if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1021     return(0);
1022 }
1023
1024 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1025 }
1026
1027 #define gen_nb_xmlAttributeType 4
1028 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1029     if (no == 1) return(XML_ATTRIBUTE_CDATA);
1030     if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1031     if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1032     if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1033     return(0);
1034 }
1035
1036 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1037 }
1038
1039 #define gen_nb_xmlBufferAllocationScheme 4
1040 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1041     if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1042     if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1043     if (no == 3) return(XML_BUFFER_ALLOC_HYBRID);
1044     if (no == 4) return(XML_BUFFER_ALLOC_IMMUTABLE);
1045     return(0);
1046 }
1047
1048 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1049 }
1050
1051 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1052 }
1053
1054 #ifdef LIBXML_CATALOG_ENABLED
1055 #define gen_nb_xmlCatalogAllow 4
1056 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1057     if (no == 1) return(XML_CATA_ALLOW_ALL);
1058     if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1059     if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1060     if (no == 4) return(XML_CATA_ALLOW_NONE);
1061     return(0);
1062 }
1063
1064 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1065 }
1066
1067 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1068 }
1069
1070 #endif
1071
1072 #ifdef LIBXML_CATALOG_ENABLED
1073 #define gen_nb_xmlCatalogPrefer 3
1074 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1075     if (no == 1) return(XML_CATA_PREFER_NONE);
1076     if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1077     if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1078     return(0);
1079 }
1080
1081 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1082 }
1083
1084 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1085 }
1086
1087 #endif
1088
1089 #define gen_nb_xmlElementContentType 4
1090 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1091     if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1092     if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1093     if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1094     if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1095     return(0);
1096 }
1097
1098 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1099 }
1100
1101 #define gen_nb_xmlElementTypeVal 4
1102 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1103     if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1104     if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1105     if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1106     if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1107     return(0);
1108 }
1109
1110 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1111 }
1112
1113 #define gen_nb_xmlFeature 4
1114 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1115     if (no == 1) return(XML_WITH_AUTOMATA);
1116     if (no == 2) return(XML_WITH_C14N);
1117     if (no == 3) return(XML_WITH_CATALOG);
1118     if (no == 4) return(XML_WITH_DEBUG);
1119     return(0);
1120 }
1121
1122 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1123 }
1124
1125 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1126 }
1127
1128 #ifdef LIBXML_SCHEMAS_ENABLED
1129 #define gen_nb_xmlSchemaValType 4
1130 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1131     if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1132     if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1133     if (no == 3) return(XML_SCHEMAS_ANYURI);
1134     if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1135     return(0);
1136 }
1137
1138 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1139 }
1140
1141 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1142 }
1143
1144 #endif
1145
1146 #ifdef LIBXML_SCHEMAS_ENABLED
1147 #define gen_nb_xmlSchemaWhitespaceValueType 4
1148 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1149     if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1150     if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1151     if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1152     if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1153     return(0);
1154 }
1155
1156 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1157 }
1158
1159 #endif
1160
1161 #include <libxml/HTMLparser.h>
1162 #include <libxml/HTMLtree.h>
1163 #include <libxml/SAX2.h>
1164 #include <libxml/c14n.h>
1165 #include <libxml/catalog.h>
1166 #include <libxml/chvalid.h>
1167 #include <libxml/debugXML.h>
1168 #include <libxml/dict.h>
1169 #include <libxml/encoding.h>
1170 #include <libxml/entities.h>
1171 #include <libxml/hash.h>
1172 #include <libxml/list.h>
1173 #include <libxml/nanoftp.h>
1174 #include <libxml/nanohttp.h>
1175 #include <libxml/parser.h>
1176 #include <libxml/parserInternals.h>
1177 #include <libxml/pattern.h>
1178 #include <libxml/relaxng.h>
1179 #include <libxml/schemasInternals.h>
1180 #include <libxml/schematron.h>
1181 #include <libxml/tree.h>
1182 #include <libxml/uri.h>
1183 #include <libxml/valid.h>
1184 #include <libxml/xinclude.h>
1185 #include <libxml/xmlIO.h>
1186 #include <libxml/xmlautomata.h>
1187 #include <libxml/xmlerror.h>
1188 #include <libxml/xmlmodule.h>
1189 #include <libxml/xmlreader.h>
1190 #include <libxml/xmlregexp.h>
1191 #include <libxml/xmlsave.h>
1192 #include <libxml/xmlschemas.h>
1193 #include <libxml/xmlschemastypes.h>
1194 #include <libxml/xmlstring.h>
1195 #include <libxml/xmlunicode.h>
1196 #include <libxml/xmlwriter.h>
1197 #include <libxml/xpath.h>
1198 #include <libxml/xpathInternals.h>
1199 #include <libxml/xpointer.h>
1200 static int test_HTMLparser(void);
1201 static int test_HTMLtree(void);
1202 static int test_SAX2(void);
1203 static int test_c14n(void);
1204 static int test_catalog(void);
1205 static int test_chvalid(void);
1206 static int test_debugXML(void);
1207 static int test_dict(void);
1208 static int test_encoding(void);
1209 static int test_entities(void);
1210 static int test_hash(void);
1211 static int test_list(void);
1212 static int test_nanoftp(void);
1213 static int test_nanohttp(void);
1214 static int test_parser(void);
1215 static int test_parserInternals(void);
1216 static int test_pattern(void);
1217 static int test_relaxng(void);
1218 static int test_schemasInternals(void);
1219 static int test_schematron(void);
1220 static int test_tree(void);
1221 static int test_uri(void);
1222 static int test_valid(void);
1223 static int test_xinclude(void);
1224 static int test_xmlIO(void);
1225 static int test_xmlautomata(void);
1226 static int test_xmlerror(void);
1227 static int test_xmlmodule(void);
1228 static int test_xmlreader(void);
1229 static int test_xmlregexp(void);
1230 static int test_xmlsave(void);
1231 static int test_xmlschemas(void);
1232 static int test_xmlschemastypes(void);
1233 static int test_xmlstring(void);
1234 static int test_xmlunicode(void);
1235 static int test_xmlwriter(void);
1236 static int test_xpath(void);
1237 static int test_xpathInternals(void);
1238 static int test_xpointer(void);
1239
1240 /**
1241  * testlibxml2:
1242  *
1243  * Main entry point of the tester for the full libxml2 module,
1244  * it calls all the tester entry point for each module.
1245  *
1246  * Returns the number of error found
1247  */
1248 static int
1249 testlibxml2(void)
1250 {
1251     int test_ret = 0;
1252
1253     test_ret += test_HTMLparser();
1254     test_ret += test_HTMLtree();
1255     test_ret += test_SAX2();
1256     test_ret += test_c14n();
1257     test_ret += test_catalog();
1258     test_ret += test_chvalid();
1259     test_ret += test_debugXML();
1260     test_ret += test_dict();
1261     test_ret += test_encoding();
1262     test_ret += test_entities();
1263     test_ret += test_hash();
1264     test_ret += test_list();
1265     test_ret += test_nanoftp();
1266     test_ret += test_nanohttp();
1267     test_ret += test_parser();
1268     test_ret += test_parserInternals();
1269     test_ret += test_pattern();
1270     test_ret += test_relaxng();
1271     test_ret += test_schemasInternals();
1272     test_ret += test_schematron();
1273     test_ret += test_tree();
1274     test_ret += test_uri();
1275     test_ret += test_valid();
1276     test_ret += test_xinclude();
1277     test_ret += test_xmlIO();
1278     test_ret += test_xmlautomata();
1279     test_ret += test_xmlerror();
1280     test_ret += test_xmlmodule();
1281     test_ret += test_xmlreader();
1282     test_ret += test_xmlregexp();
1283     test_ret += test_xmlsave();
1284     test_ret += test_xmlschemas();
1285     test_ret += test_xmlschemastypes();
1286     test_ret += test_xmlstring();
1287     test_ret += test_xmlunicode();
1288     test_ret += test_xmlwriter();
1289     test_ret += test_xpath();
1290     test_ret += test_xpathInternals();
1291     test_ret += test_xpointer();
1292
1293     printf("Total: %d functions, %d tests, %d errors\n",
1294            function_tests, call_tests, test_ret);
1295     return(test_ret);
1296 }
1297
1298
1299 static int
1300 test_UTF8ToHtml(void) {
1301     int test_ret = 0;
1302
1303 #if defined(LIBXML_HTML_ENABLED)
1304     int mem_base;
1305     int ret_val;
1306     unsigned char * out; /* a pointer to an array of bytes to store the result */
1307     int n_out;
1308     int * outlen; /* the length of @out */
1309     int n_outlen;
1310     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1311     int n_in;
1312     int * inlen; /* the length of @in */
1313     int n_inlen;
1314
1315     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1316     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1317     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1318     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1319         mem_base = xmlMemBlocks();
1320         out = gen_unsigned_char_ptr(n_out, 0);
1321         outlen = gen_int_ptr(n_outlen, 1);
1322         in = gen_const_unsigned_char_ptr(n_in, 2);
1323         inlen = gen_int_ptr(n_inlen, 3);
1324
1325         ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1326         desret_int(ret_val);
1327         call_tests++;
1328         des_unsigned_char_ptr(n_out, out, 0);
1329         des_int_ptr(n_outlen, outlen, 1);
1330         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1331         des_int_ptr(n_inlen, inlen, 3);
1332         xmlResetLastError();
1333         if (mem_base != xmlMemBlocks()) {
1334             printf("Leak of %d blocks found in UTF8ToHtml",
1335                    xmlMemBlocks() - mem_base);
1336             test_ret++;
1337             printf(" %d", n_out);
1338             printf(" %d", n_outlen);
1339             printf(" %d", n_in);
1340             printf(" %d", n_inlen);
1341             printf("\n");
1342         }
1343     }
1344     }
1345     }
1346     }
1347     function_tests++;
1348 #endif
1349
1350     return(test_ret);
1351 }
1352
1353 #ifdef LIBXML_HTML_ENABLED
1354
1355 #define gen_nb_const_htmlElemDesc_ptr 1
1356 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1357     return(NULL);
1358 }
1359 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1360 }
1361 #endif
1362
1363
1364 static int
1365 test_htmlAttrAllowed(void) {
1366     int test_ret = 0;
1367
1368 #if defined(LIBXML_HTML_ENABLED)
1369     int mem_base;
1370     htmlStatus ret_val;
1371     htmlElemDesc * elt; /* HTML element */
1372     int n_elt;
1373     xmlChar * attr; /* HTML attribute */
1374     int n_attr;
1375     int legacy; /* whether to allow deprecated attributes */
1376     int n_legacy;
1377
1378     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1379     for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1380     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1381         mem_base = xmlMemBlocks();
1382         elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1383         attr = gen_const_xmlChar_ptr(n_attr, 1);
1384         legacy = gen_int(n_legacy, 2);
1385
1386         ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1387         desret_htmlStatus(ret_val);
1388         call_tests++;
1389         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1390         des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1391         des_int(n_legacy, legacy, 2);
1392         xmlResetLastError();
1393         if (mem_base != xmlMemBlocks()) {
1394             printf("Leak of %d blocks found in htmlAttrAllowed",
1395                    xmlMemBlocks() - mem_base);
1396             test_ret++;
1397             printf(" %d", n_elt);
1398             printf(" %d", n_attr);
1399             printf(" %d", n_legacy);
1400             printf("\n");
1401         }
1402     }
1403     }
1404     }
1405     function_tests++;
1406 #endif
1407
1408     return(test_ret);
1409 }
1410
1411 #ifdef LIBXML_HTML_ENABLED
1412
1413 #define gen_nb_htmlNodePtr 1
1414 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1415     return(NULL);
1416 }
1417 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1418 }
1419 #endif
1420
1421
1422 static int
1423 test_htmlAutoCloseTag(void) {
1424     int test_ret = 0;
1425
1426 #if defined(LIBXML_HTML_ENABLED)
1427     int mem_base;
1428     int ret_val;
1429     htmlDocPtr doc; /* the HTML document */
1430     int n_doc;
1431     xmlChar * name; /* The tag name */
1432     int n_name;
1433     htmlNodePtr elem; /* the HTML element */
1434     int n_elem;
1435
1436     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1437     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1438     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1439         mem_base = xmlMemBlocks();
1440         doc = gen_htmlDocPtr(n_doc, 0);
1441         name = gen_const_xmlChar_ptr(n_name, 1);
1442         elem = gen_htmlNodePtr(n_elem, 2);
1443
1444         ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1445         desret_int(ret_val);
1446         call_tests++;
1447         des_htmlDocPtr(n_doc, doc, 0);
1448         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1449         des_htmlNodePtr(n_elem, elem, 2);
1450         xmlResetLastError();
1451         if (mem_base != xmlMemBlocks()) {
1452             printf("Leak of %d blocks found in htmlAutoCloseTag",
1453                    xmlMemBlocks() - mem_base);
1454             test_ret++;
1455             printf(" %d", n_doc);
1456             printf(" %d", n_name);
1457             printf(" %d", n_elem);
1458             printf("\n");
1459         }
1460     }
1461     }
1462     }
1463     function_tests++;
1464 #endif
1465
1466     return(test_ret);
1467 }
1468
1469
1470 static int
1471 test_htmlCreateMemoryParserCtxt(void) {
1472     int test_ret = 0;
1473
1474 #if defined(LIBXML_HTML_ENABLED)
1475     int mem_base;
1476     htmlParserCtxtPtr ret_val;
1477     char * buffer; /* a pointer to a char array */
1478     int n_buffer;
1479     int size; /* the size of the array */
1480     int n_size;
1481
1482     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1483     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1484         mem_base = xmlMemBlocks();
1485         buffer = gen_const_char_ptr(n_buffer, 0);
1486         size = gen_int(n_size, 1);
1487
1488         ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1489         desret_htmlParserCtxtPtr(ret_val);
1490         call_tests++;
1491         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1492         des_int(n_size, size, 1);
1493         xmlResetLastError();
1494         if (mem_base != xmlMemBlocks()) {
1495             printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1496                    xmlMemBlocks() - mem_base);
1497             test_ret++;
1498             printf(" %d", n_buffer);
1499             printf(" %d", n_size);
1500             printf("\n");
1501         }
1502     }
1503     }
1504     function_tests++;
1505 #endif
1506
1507     return(test_ret);
1508 }
1509
1510 #ifdef LIBXML_HTML_ENABLED
1511
1512 #define gen_nb_htmlSAXHandlerPtr 1
1513 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1514     return(NULL);
1515 }
1516 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1517 }
1518 #endif
1519
1520
1521 static int
1522 test_htmlCreatePushParserCtxt(void) {
1523     int test_ret = 0;
1524
1525 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1526     int mem_base;
1527     htmlParserCtxtPtr ret_val;
1528     htmlSAXHandlerPtr sax; /* a SAX handler */
1529     int n_sax;
1530     void * user_data; /* The user data returned on SAX callbacks */
1531     int n_user_data;
1532     char * chunk; /* a pointer to an array of chars */
1533     int n_chunk;
1534     int size; /* number of chars in the array */
1535     int n_size;
1536     const char * filename; /* an optional file name or URI */
1537     int n_filename;
1538     xmlCharEncoding enc; /* an optional encoding */
1539     int n_enc;
1540
1541     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1542     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1543     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1544     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1545     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1546     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1547         mem_base = xmlMemBlocks();
1548         sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1549         user_data = gen_userdata(n_user_data, 1);
1550         chunk = gen_const_char_ptr(n_chunk, 2);
1551         size = gen_int(n_size, 3);
1552         filename = gen_fileoutput(n_filename, 4);
1553         enc = gen_xmlCharEncoding(n_enc, 5);
1554
1555         ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1556         desret_htmlParserCtxtPtr(ret_val);
1557         call_tests++;
1558         des_htmlSAXHandlerPtr(n_sax, sax, 0);
1559         des_userdata(n_user_data, user_data, 1);
1560         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1561         des_int(n_size, size, 3);
1562         des_fileoutput(n_filename, filename, 4);
1563         des_xmlCharEncoding(n_enc, enc, 5);
1564         xmlResetLastError();
1565         if (mem_base != xmlMemBlocks()) {
1566             printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1567                    xmlMemBlocks() - mem_base);
1568             test_ret++;
1569             printf(" %d", n_sax);
1570             printf(" %d", n_user_data);
1571             printf(" %d", n_chunk);
1572             printf(" %d", n_size);
1573             printf(" %d", n_filename);
1574             printf(" %d", n_enc);
1575             printf("\n");
1576         }
1577     }
1578     }
1579     }
1580     }
1581     }
1582     }
1583     function_tests++;
1584 #endif
1585
1586     return(test_ret);
1587 }
1588
1589
1590 static int
1591 test_htmlCtxtReadDoc(void) {
1592     int test_ret = 0;
1593
1594 #if defined(LIBXML_HTML_ENABLED)
1595     int mem_base;
1596     htmlDocPtr ret_val;
1597     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1598     int n_ctxt;
1599     xmlChar * cur; /* a pointer to a zero terminated string */
1600     int n_cur;
1601     const char * URL; /* the base URL to use for the document */
1602     int n_URL;
1603     char * encoding; /* the document encoding, or NULL */
1604     int n_encoding;
1605     int options; /* a combination of htmlParserOption(s) */
1606     int n_options;
1607
1608     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1609     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1610     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1611     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1612     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1613         mem_base = xmlMemBlocks();
1614         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1615         cur = gen_const_xmlChar_ptr(n_cur, 1);
1616         URL = gen_filepath(n_URL, 2);
1617         encoding = gen_const_char_ptr(n_encoding, 3);
1618         options = gen_int(n_options, 4);
1619
1620         ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1621         desret_htmlDocPtr(ret_val);
1622         call_tests++;
1623         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1624         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1625         des_filepath(n_URL, URL, 2);
1626         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1627         des_int(n_options, options, 4);
1628         xmlResetLastError();
1629         if (mem_base != xmlMemBlocks()) {
1630             printf("Leak of %d blocks found in htmlCtxtReadDoc",
1631                    xmlMemBlocks() - mem_base);
1632             test_ret++;
1633             printf(" %d", n_ctxt);
1634             printf(" %d", n_cur);
1635             printf(" %d", n_URL);
1636             printf(" %d", n_encoding);
1637             printf(" %d", n_options);
1638             printf("\n");
1639         }
1640     }
1641     }
1642     }
1643     }
1644     }
1645     function_tests++;
1646 #endif
1647
1648     return(test_ret);
1649 }
1650
1651
1652 static int
1653 test_htmlCtxtReadFile(void) {
1654     int test_ret = 0;
1655
1656 #if defined(LIBXML_HTML_ENABLED)
1657     htmlDocPtr ret_val;
1658     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1659     int n_ctxt;
1660     const char * filename; /* a file or URL */
1661     int n_filename;
1662     char * encoding; /* the document encoding, or NULL */
1663     int n_encoding;
1664     int options; /* a combination of htmlParserOption(s) */
1665     int n_options;
1666
1667     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1668     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1669     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1670     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1671         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1672         filename = gen_filepath(n_filename, 1);
1673         encoding = gen_const_char_ptr(n_encoding, 2);
1674         options = gen_int(n_options, 3);
1675
1676         ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1677         desret_htmlDocPtr(ret_val);
1678         call_tests++;
1679         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1680         des_filepath(n_filename, filename, 1);
1681         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1682         des_int(n_options, options, 3);
1683         xmlResetLastError();
1684     }
1685     }
1686     }
1687     }
1688     function_tests++;
1689 #endif
1690
1691     return(test_ret);
1692 }
1693
1694
1695 static int
1696 test_htmlCtxtReadMemory(void) {
1697     int test_ret = 0;
1698
1699 #if defined(LIBXML_HTML_ENABLED)
1700     int mem_base;
1701     htmlDocPtr ret_val;
1702     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1703     int n_ctxt;
1704     char * buffer; /* a pointer to a char array */
1705     int n_buffer;
1706     int size; /* the size of the array */
1707     int n_size;
1708     const char * URL; /* the base URL to use for the document */
1709     int n_URL;
1710     char * encoding; /* the document encoding, or NULL */
1711     int n_encoding;
1712     int options; /* a combination of htmlParserOption(s) */
1713     int n_options;
1714
1715     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1716     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1717     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1718     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1719     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1720     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1721         mem_base = xmlMemBlocks();
1722         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1723         buffer = gen_const_char_ptr(n_buffer, 1);
1724         size = gen_int(n_size, 2);
1725         URL = gen_filepath(n_URL, 3);
1726         encoding = gen_const_char_ptr(n_encoding, 4);
1727         options = gen_int(n_options, 5);
1728
1729         ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1730         desret_htmlDocPtr(ret_val);
1731         call_tests++;
1732         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1733         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1734         des_int(n_size, size, 2);
1735         des_filepath(n_URL, URL, 3);
1736         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1737         des_int(n_options, options, 5);
1738         xmlResetLastError();
1739         if (mem_base != xmlMemBlocks()) {
1740             printf("Leak of %d blocks found in htmlCtxtReadMemory",
1741                    xmlMemBlocks() - mem_base);
1742             test_ret++;
1743             printf(" %d", n_ctxt);
1744             printf(" %d", n_buffer);
1745             printf(" %d", n_size);
1746             printf(" %d", n_URL);
1747             printf(" %d", n_encoding);
1748             printf(" %d", n_options);
1749             printf("\n");
1750         }
1751     }
1752     }
1753     }
1754     }
1755     }
1756     }
1757     function_tests++;
1758 #endif
1759
1760     return(test_ret);
1761 }
1762
1763
1764 static int
1765 test_htmlCtxtReset(void) {
1766     int test_ret = 0;
1767
1768 #if defined(LIBXML_HTML_ENABLED)
1769     int mem_base;
1770     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1771     int n_ctxt;
1772
1773     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1774         mem_base = xmlMemBlocks();
1775         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1776
1777         htmlCtxtReset(ctxt);
1778         call_tests++;
1779         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1780         xmlResetLastError();
1781         if (mem_base != xmlMemBlocks()) {
1782             printf("Leak of %d blocks found in htmlCtxtReset",
1783                    xmlMemBlocks() - mem_base);
1784             test_ret++;
1785             printf(" %d", n_ctxt);
1786             printf("\n");
1787         }
1788     }
1789     function_tests++;
1790 #endif
1791
1792     return(test_ret);
1793 }
1794
1795
1796 static int
1797 test_htmlCtxtUseOptions(void) {
1798     int test_ret = 0;
1799
1800 #if defined(LIBXML_HTML_ENABLED)
1801     int mem_base;
1802     int ret_val;
1803     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1804     int n_ctxt;
1805     int options; /* a combination of htmlParserOption(s) */
1806     int n_options;
1807
1808     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1809     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1810         mem_base = xmlMemBlocks();
1811         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1812         options = gen_int(n_options, 1);
1813
1814         ret_val = htmlCtxtUseOptions(ctxt, options);
1815         desret_int(ret_val);
1816         call_tests++;
1817         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1818         des_int(n_options, options, 1);
1819         xmlResetLastError();
1820         if (mem_base != xmlMemBlocks()) {
1821             printf("Leak of %d blocks found in htmlCtxtUseOptions",
1822                    xmlMemBlocks() - mem_base);
1823             test_ret++;
1824             printf(" %d", n_ctxt);
1825             printf(" %d", n_options);
1826             printf("\n");
1827         }
1828     }
1829     }
1830     function_tests++;
1831 #endif
1832
1833     return(test_ret);
1834 }
1835
1836
1837 static int
1838 test_htmlElementAllowedHere(void) {
1839     int test_ret = 0;
1840
1841 #if defined(LIBXML_HTML_ENABLED)
1842     int mem_base;
1843     int ret_val;
1844     htmlElemDesc * parent; /* HTML parent element */
1845     int n_parent;
1846     xmlChar * elt; /* HTML element */
1847     int n_elt;
1848
1849     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1850     for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1851         mem_base = xmlMemBlocks();
1852         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1853         elt = gen_const_xmlChar_ptr(n_elt, 1);
1854
1855         ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1856         desret_int(ret_val);
1857         call_tests++;
1858         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1859         des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1860         xmlResetLastError();
1861         if (mem_base != xmlMemBlocks()) {
1862             printf("Leak of %d blocks found in htmlElementAllowedHere",
1863                    xmlMemBlocks() - mem_base);
1864             test_ret++;
1865             printf(" %d", n_parent);
1866             printf(" %d", n_elt);
1867             printf("\n");
1868         }
1869     }
1870     }
1871     function_tests++;
1872 #endif
1873
1874     return(test_ret);
1875 }
1876
1877
1878 static int
1879 test_htmlElementStatusHere(void) {
1880     int test_ret = 0;
1881
1882 #if defined(LIBXML_HTML_ENABLED)
1883     int mem_base;
1884     htmlStatus ret_val;
1885     htmlElemDesc * parent; /* HTML parent element */
1886     int n_parent;
1887     htmlElemDesc * elt; /* HTML element */
1888     int n_elt;
1889
1890     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1891     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1892         mem_base = xmlMemBlocks();
1893         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1894         elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1895
1896         ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1897         desret_htmlStatus(ret_val);
1898         call_tests++;
1899         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1900         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1901         xmlResetLastError();
1902         if (mem_base != xmlMemBlocks()) {
1903             printf("Leak of %d blocks found in htmlElementStatusHere",
1904                    xmlMemBlocks() - mem_base);
1905             test_ret++;
1906             printf(" %d", n_parent);
1907             printf(" %d", n_elt);
1908             printf("\n");
1909         }
1910     }
1911     }
1912     function_tests++;
1913 #endif
1914
1915     return(test_ret);
1916 }
1917
1918
1919 static int
1920 test_htmlEncodeEntities(void) {
1921     int test_ret = 0;
1922
1923 #if defined(LIBXML_HTML_ENABLED)
1924     int mem_base;
1925     int ret_val;
1926     unsigned char * out; /* a pointer to an array of bytes to store the result */
1927     int n_out;
1928     int * outlen; /* the length of @out */
1929     int n_outlen;
1930     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1931     int n_in;
1932     int * inlen; /* the length of @in */
1933     int n_inlen;
1934     int quoteChar; /* the quote character to escape (' or ") or zero. */
1935     int n_quoteChar;
1936
1937     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1938     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1939     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1940     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1941     for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1942         mem_base = xmlMemBlocks();
1943         out = gen_unsigned_char_ptr(n_out, 0);
1944         outlen = gen_int_ptr(n_outlen, 1);
1945         in = gen_const_unsigned_char_ptr(n_in, 2);
1946         inlen = gen_int_ptr(n_inlen, 3);
1947         quoteChar = gen_int(n_quoteChar, 4);
1948
1949         ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1950         desret_int(ret_val);
1951         call_tests++;
1952         des_unsigned_char_ptr(n_out, out, 0);
1953         des_int_ptr(n_outlen, outlen, 1);
1954         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1955         des_int_ptr(n_inlen, inlen, 3);
1956         des_int(n_quoteChar, quoteChar, 4);
1957         xmlResetLastError();
1958         if (mem_base != xmlMemBlocks()) {
1959             printf("Leak of %d blocks found in htmlEncodeEntities",
1960                    xmlMemBlocks() - mem_base);
1961             test_ret++;
1962             printf(" %d", n_out);
1963             printf(" %d", n_outlen);
1964             printf(" %d", n_in);
1965             printf(" %d", n_inlen);
1966             printf(" %d", n_quoteChar);
1967             printf("\n");
1968         }
1969     }
1970     }
1971     }
1972     }
1973     }
1974     function_tests++;
1975 #endif
1976
1977     return(test_ret);
1978 }
1979
1980
1981 static int
1982 test_htmlEntityLookup(void) {
1983     int test_ret = 0;
1984
1985 #if defined(LIBXML_HTML_ENABLED)
1986     int mem_base;
1987     const htmlEntityDesc * ret_val;
1988     xmlChar * name; /* the entity name */
1989     int n_name;
1990
1991     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1992         mem_base = xmlMemBlocks();
1993         name = gen_const_xmlChar_ptr(n_name, 0);
1994
1995         ret_val = htmlEntityLookup((const xmlChar *)name);
1996         desret_const_htmlEntityDesc_ptr(ret_val);
1997         call_tests++;
1998         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1999         xmlResetLastError();
2000         if (mem_base != xmlMemBlocks()) {
2001             printf("Leak of %d blocks found in htmlEntityLookup",
2002                    xmlMemBlocks() - mem_base);
2003             test_ret++;
2004             printf(" %d", n_name);
2005             printf("\n");
2006         }
2007     }
2008     function_tests++;
2009 #endif
2010
2011     return(test_ret);
2012 }
2013
2014
2015 static int
2016 test_htmlEntityValueLookup(void) {
2017     int test_ret = 0;
2018
2019 #if defined(LIBXML_HTML_ENABLED)
2020     int mem_base;
2021     const htmlEntityDesc * ret_val;
2022     unsigned int value; /* the entity's unicode value */
2023     int n_value;
2024
2025     for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2026         mem_base = xmlMemBlocks();
2027         value = gen_unsigned_int(n_value, 0);
2028
2029         ret_val = htmlEntityValueLookup(value);
2030         desret_const_htmlEntityDesc_ptr(ret_val);
2031         call_tests++;
2032         des_unsigned_int(n_value, value, 0);
2033         xmlResetLastError();
2034         if (mem_base != xmlMemBlocks()) {
2035             printf("Leak of %d blocks found in htmlEntityValueLookup",
2036                    xmlMemBlocks() - mem_base);
2037             test_ret++;
2038             printf(" %d", n_value);
2039             printf("\n");
2040         }
2041     }
2042     function_tests++;
2043 #endif
2044
2045     return(test_ret);
2046 }
2047
2048
2049 static int
2050 test_htmlHandleOmittedElem(void) {
2051     int test_ret = 0;
2052
2053 #if defined(LIBXML_HTML_ENABLED)
2054     int mem_base;
2055     int ret_val;
2056     int val; /* int 0 or 1 */
2057     int n_val;
2058
2059     for (n_val = 0;n_val < gen_nb_int;n_val++) {
2060         mem_base = xmlMemBlocks();
2061         val = gen_int(n_val, 0);
2062
2063         ret_val = htmlHandleOmittedElem(val);
2064         desret_int(ret_val);
2065         call_tests++;
2066         des_int(n_val, val, 0);
2067         xmlResetLastError();
2068         if (mem_base != xmlMemBlocks()) {
2069             printf("Leak of %d blocks found in htmlHandleOmittedElem",
2070                    xmlMemBlocks() - mem_base);
2071             test_ret++;
2072             printf(" %d", n_val);
2073             printf("\n");
2074         }
2075     }
2076     function_tests++;
2077 #endif
2078
2079     return(test_ret);
2080 }
2081
2082
2083 static int
2084 test_htmlIsAutoClosed(void) {
2085     int test_ret = 0;
2086
2087 #if defined(LIBXML_HTML_ENABLED)
2088     int mem_base;
2089     int ret_val;
2090     htmlDocPtr doc; /* the HTML document */
2091     int n_doc;
2092     htmlNodePtr elem; /* the HTML element */
2093     int n_elem;
2094
2095     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2096     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2097         mem_base = xmlMemBlocks();
2098         doc = gen_htmlDocPtr(n_doc, 0);
2099         elem = gen_htmlNodePtr(n_elem, 1);
2100
2101         ret_val = htmlIsAutoClosed(doc, elem);
2102         desret_int(ret_val);
2103         call_tests++;
2104         des_htmlDocPtr(n_doc, doc, 0);
2105         des_htmlNodePtr(n_elem, elem, 1);
2106         xmlResetLastError();
2107         if (mem_base != xmlMemBlocks()) {
2108             printf("Leak of %d blocks found in htmlIsAutoClosed",
2109                    xmlMemBlocks() - mem_base);
2110             test_ret++;
2111             printf(" %d", n_doc);
2112             printf(" %d", n_elem);
2113             printf("\n");
2114         }
2115     }
2116     }
2117     function_tests++;
2118 #endif
2119
2120     return(test_ret);
2121 }
2122
2123
2124 static int
2125 test_htmlIsScriptAttribute(void) {
2126     int test_ret = 0;
2127
2128 #if defined(LIBXML_HTML_ENABLED)
2129     int mem_base;
2130     int ret_val;
2131     xmlChar * name; /* an attribute name */
2132     int n_name;
2133
2134     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2135         mem_base = xmlMemBlocks();
2136         name = gen_const_xmlChar_ptr(n_name, 0);
2137
2138         ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2139         desret_int(ret_val);
2140         call_tests++;
2141         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2142         xmlResetLastError();
2143         if (mem_base != xmlMemBlocks()) {
2144             printf("Leak of %d blocks found in htmlIsScriptAttribute",
2145                    xmlMemBlocks() - mem_base);
2146             test_ret++;
2147             printf(" %d", n_name);
2148             printf("\n");
2149         }
2150     }
2151     function_tests++;
2152 #endif
2153
2154     return(test_ret);
2155 }
2156
2157
2158 static int
2159 test_htmlNewParserCtxt(void) {
2160     int test_ret = 0;
2161
2162 #if defined(LIBXML_HTML_ENABLED)
2163     int mem_base;
2164     htmlParserCtxtPtr ret_val;
2165
2166         mem_base = xmlMemBlocks();
2167
2168         ret_val = htmlNewParserCtxt();
2169         desret_htmlParserCtxtPtr(ret_val);
2170         call_tests++;
2171         xmlResetLastError();
2172         if (mem_base != xmlMemBlocks()) {
2173             printf("Leak of %d blocks found in htmlNewParserCtxt",
2174                    xmlMemBlocks() - mem_base);
2175             test_ret++;
2176             printf("\n");
2177         }
2178     function_tests++;
2179 #endif
2180
2181     return(test_ret);
2182 }
2183
2184
2185 static int
2186 test_htmlNodeStatus(void) {
2187     int test_ret = 0;
2188
2189 #if defined(LIBXML_HTML_ENABLED)
2190     int mem_base;
2191     htmlStatus ret_val;
2192     htmlNodePtr node; /* an htmlNodePtr in a tree */
2193     int n_node;
2194     int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2195     int n_legacy;
2196
2197     for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2198     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2199         mem_base = xmlMemBlocks();
2200         node = gen_const_htmlNodePtr(n_node, 0);
2201         legacy = gen_int(n_legacy, 1);
2202
2203         ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2204         desret_htmlStatus(ret_val);
2205         call_tests++;
2206         des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2207         des_int(n_legacy, legacy, 1);
2208         xmlResetLastError();
2209         if (mem_base != xmlMemBlocks()) {
2210             printf("Leak of %d blocks found in htmlNodeStatus",
2211                    xmlMemBlocks() - mem_base);
2212             test_ret++;
2213             printf(" %d", n_node);
2214             printf(" %d", n_legacy);
2215             printf("\n");
2216         }
2217     }
2218     }
2219     function_tests++;
2220 #endif
2221
2222     return(test_ret);
2223 }
2224
2225
2226 static int
2227 test_htmlParseCharRef(void) {
2228     int test_ret = 0;
2229
2230 #if defined(LIBXML_HTML_ENABLED)
2231     int mem_base;
2232     int ret_val;
2233     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2234     int n_ctxt;
2235
2236     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2237         mem_base = xmlMemBlocks();
2238         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2239
2240         ret_val = htmlParseCharRef(ctxt);
2241         desret_int(ret_val);
2242         call_tests++;
2243         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2244         xmlResetLastError();
2245         if (mem_base != xmlMemBlocks()) {
2246             printf("Leak of %d blocks found in htmlParseCharRef",
2247                    xmlMemBlocks() - mem_base);
2248             test_ret++;
2249             printf(" %d", n_ctxt);
2250             printf("\n");
2251         }
2252     }
2253     function_tests++;
2254 #endif
2255
2256     return(test_ret);
2257 }
2258
2259
2260 static int
2261 test_htmlParseChunk(void) {
2262     int test_ret = 0;
2263
2264 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2265     int mem_base;
2266     int ret_val;
2267     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2268     int n_ctxt;
2269     char * chunk; /* an char array */
2270     int n_chunk;
2271     int size; /* the size in byte of the chunk */
2272     int n_size;
2273     int terminate; /* last chunk indicator */
2274     int n_terminate;
2275
2276     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2277     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2278     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2279     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2280         mem_base = xmlMemBlocks();
2281         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2282         chunk = gen_const_char_ptr(n_chunk, 1);
2283         size = gen_int(n_size, 2);
2284         terminate = gen_int(n_terminate, 3);
2285
2286         ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2287         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2288         desret_int(ret_val);
2289         call_tests++;
2290         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2291         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2292         des_int(n_size, size, 2);
2293         des_int(n_terminate, terminate, 3);
2294         xmlResetLastError();
2295         if (mem_base != xmlMemBlocks()) {
2296             printf("Leak of %d blocks found in htmlParseChunk",
2297                    xmlMemBlocks() - mem_base);
2298             test_ret++;
2299             printf(" %d", n_ctxt);
2300             printf(" %d", n_chunk);
2301             printf(" %d", n_size);
2302             printf(" %d", n_terminate);
2303             printf("\n");
2304         }
2305     }
2306     }
2307     }
2308     }
2309     function_tests++;
2310 #endif
2311
2312     return(test_ret);
2313 }
2314
2315
2316 static int
2317 test_htmlParseDoc(void) {
2318     int test_ret = 0;
2319
2320 #if defined(LIBXML_HTML_ENABLED)
2321     int mem_base;
2322     htmlDocPtr ret_val;
2323     xmlChar * cur; /* a pointer to an array of xmlChar */
2324     int n_cur;
2325     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2326     int n_encoding;
2327
2328     for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2329     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2330         mem_base = xmlMemBlocks();
2331         cur = gen_xmlChar_ptr(n_cur, 0);
2332         encoding = gen_const_char_ptr(n_encoding, 1);
2333
2334         ret_val = htmlParseDoc(cur, (const char *)encoding);
2335         desret_htmlDocPtr(ret_val);
2336         call_tests++;
2337         des_xmlChar_ptr(n_cur, cur, 0);
2338         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2339         xmlResetLastError();
2340         if (mem_base != xmlMemBlocks()) {
2341             printf("Leak of %d blocks found in htmlParseDoc",
2342                    xmlMemBlocks() - mem_base);
2343             test_ret++;
2344             printf(" %d", n_cur);
2345             printf(" %d", n_encoding);
2346             printf("\n");
2347         }
2348     }
2349     }
2350     function_tests++;
2351 #endif
2352
2353     return(test_ret);
2354 }
2355
2356
2357 static int
2358 test_htmlParseDocument(void) {
2359     int test_ret = 0;
2360
2361 #if defined(LIBXML_HTML_ENABLED)
2362     int mem_base;
2363     int ret_val;
2364     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2365     int n_ctxt;
2366
2367     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2368         mem_base = xmlMemBlocks();
2369         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2370
2371         ret_val = htmlParseDocument(ctxt);
2372         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2373         desret_int(ret_val);
2374         call_tests++;
2375         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2376         xmlResetLastError();
2377         if (mem_base != xmlMemBlocks()) {
2378             printf("Leak of %d blocks found in htmlParseDocument",
2379                    xmlMemBlocks() - mem_base);
2380             test_ret++;
2381             printf(" %d", n_ctxt);
2382             printf("\n");
2383         }
2384     }
2385     function_tests++;
2386 #endif
2387
2388     return(test_ret);
2389 }
2390
2391
2392 static int
2393 test_htmlParseElement(void) {
2394     int test_ret = 0;
2395
2396 #if defined(LIBXML_HTML_ENABLED)
2397     int mem_base;
2398     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2399     int n_ctxt;
2400
2401     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2402         mem_base = xmlMemBlocks();
2403         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2404
2405         htmlParseElement(ctxt);
2406         call_tests++;
2407         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2408         xmlResetLastError();
2409         if (mem_base != xmlMemBlocks()) {
2410             printf("Leak of %d blocks found in htmlParseElement",
2411                    xmlMemBlocks() - mem_base);
2412             test_ret++;
2413             printf(" %d", n_ctxt);
2414             printf("\n");
2415         }
2416     }
2417     function_tests++;
2418 #endif
2419
2420     return(test_ret);
2421 }
2422
2423
2424 static int
2425 test_htmlParseEntityRef(void) {
2426     int test_ret = 0;
2427
2428 #if defined(LIBXML_HTML_ENABLED)
2429     int mem_base;
2430     const htmlEntityDesc * ret_val;
2431     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2432     int n_ctxt;
2433     xmlChar ** str; /* location to store the entity name */
2434     int n_str;
2435
2436     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2437     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2438         mem_base = xmlMemBlocks();
2439         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2440         str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2441
2442         ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2443         desret_const_htmlEntityDesc_ptr(ret_val);
2444         call_tests++;
2445         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2446         des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2447         xmlResetLastError();
2448         if (mem_base != xmlMemBlocks()) {
2449             printf("Leak of %d blocks found in htmlParseEntityRef",
2450                    xmlMemBlocks() - mem_base);
2451             test_ret++;
2452             printf(" %d", n_ctxt);
2453             printf(" %d", n_str);
2454             printf("\n");
2455         }
2456     }
2457     }
2458     function_tests++;
2459 #endif
2460
2461     return(test_ret);
2462 }
2463
2464
2465 static int
2466 test_htmlParseFile(void) {
2467     int test_ret = 0;
2468
2469 #if defined(LIBXML_HTML_ENABLED)
2470     htmlDocPtr ret_val;
2471     const char * filename; /* the filename */
2472     int n_filename;
2473     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2474     int n_encoding;
2475
2476     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2477     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2478         filename = gen_filepath(n_filename, 0);
2479         encoding = gen_const_char_ptr(n_encoding, 1);
2480
2481         ret_val = htmlParseFile(filename, (const char *)encoding);
2482         desret_htmlDocPtr(ret_val);
2483         call_tests++;
2484         des_filepath(n_filename, filename, 0);
2485         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2486         xmlResetLastError();
2487     }
2488     }
2489     function_tests++;
2490 #endif
2491
2492     return(test_ret);
2493 }
2494
2495
2496 static int
2497 test_htmlReadDoc(void) {
2498     int test_ret = 0;
2499
2500 #if defined(LIBXML_HTML_ENABLED)
2501     int mem_base;
2502     htmlDocPtr ret_val;
2503     xmlChar * cur; /* a pointer to a zero terminated string */
2504     int n_cur;
2505     const char * URL; /* the base URL to use for the document */
2506     int n_URL;
2507     char * encoding; /* the document encoding, or NULL */
2508     int n_encoding;
2509     int options; /* a combination of htmlParserOption(s) */
2510     int n_options;
2511
2512     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2513     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2514     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2515     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2516         mem_base = xmlMemBlocks();
2517         cur = gen_const_xmlChar_ptr(n_cur, 0);
2518         URL = gen_filepath(n_URL, 1);
2519         encoding = gen_const_char_ptr(n_encoding, 2);
2520         options = gen_int(n_options, 3);
2521
2522         ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2523         desret_htmlDocPtr(ret_val);
2524         call_tests++;
2525         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2526         des_filepath(n_URL, URL, 1);
2527         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2528         des_int(n_options, options, 3);
2529         xmlResetLastError();
2530         if (mem_base != xmlMemBlocks()) {
2531             printf("Leak of %d blocks found in htmlReadDoc",
2532                    xmlMemBlocks() - mem_base);
2533             test_ret++;
2534             printf(" %d", n_cur);
2535             printf(" %d", n_URL);
2536             printf(" %d", n_encoding);
2537             printf(" %d", n_options);
2538             printf("\n");
2539         }
2540     }
2541     }
2542     }
2543     }
2544     function_tests++;
2545 #endif
2546
2547     return(test_ret);
2548 }
2549
2550
2551 static int
2552 test_htmlReadFile(void) {
2553     int test_ret = 0;
2554
2555 #if defined(LIBXML_HTML_ENABLED)
2556     int mem_base;
2557     htmlDocPtr ret_val;
2558     const char * filename; /* a file or URL */
2559     int n_filename;
2560     char * encoding; /* the document encoding, or NULL */
2561     int n_encoding;
2562     int options; /* a combination of htmlParserOption(s) */
2563     int n_options;
2564
2565     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2566     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2567     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2568         mem_base = xmlMemBlocks();
2569         filename = gen_filepath(n_filename, 0);
2570         encoding = gen_const_char_ptr(n_encoding, 1);
2571         options = gen_int(n_options, 2);
2572
2573         ret_val = htmlReadFile(filename, (const char *)encoding, options);
2574         desret_htmlDocPtr(ret_val);
2575         call_tests++;
2576         des_filepath(n_filename, filename, 0);
2577         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2578         des_int(n_options, options, 2);
2579         xmlResetLastError();
2580         if (mem_base != xmlMemBlocks()) {
2581             printf("Leak of %d blocks found in htmlReadFile",
2582                    xmlMemBlocks() - mem_base);
2583             test_ret++;
2584             printf(" %d", n_filename);
2585             printf(" %d", n_encoding);
2586             printf(" %d", n_options);
2587             printf("\n");
2588         }
2589     }
2590     }
2591     }
2592     function_tests++;
2593 #endif
2594
2595     return(test_ret);
2596 }
2597
2598
2599 static int
2600 test_htmlReadMemory(void) {
2601     int test_ret = 0;
2602
2603 #if defined(LIBXML_HTML_ENABLED)
2604     int mem_base;
2605     htmlDocPtr ret_val;
2606     char * buffer; /* a pointer to a char array */
2607     int n_buffer;
2608     int size; /* the size of the array */
2609     int n_size;
2610     const char * URL; /* the base URL to use for the document */
2611     int n_URL;
2612     char * encoding; /* the document encoding, or NULL */
2613     int n_encoding;
2614     int options; /* a combination of htmlParserOption(s) */
2615     int n_options;
2616
2617     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2618     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2619     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2620     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2621     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2622         mem_base = xmlMemBlocks();
2623         buffer = gen_const_char_ptr(n_buffer, 0);
2624         size = gen_int(n_size, 1);
2625         URL = gen_filepath(n_URL, 2);
2626         encoding = gen_const_char_ptr(n_encoding, 3);
2627         options = gen_int(n_options, 4);
2628
2629         ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2630         desret_htmlDocPtr(ret_val);
2631         call_tests++;
2632         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2633         des_int(n_size, size, 1);
2634         des_filepath(n_URL, URL, 2);
2635         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2636         des_int(n_options, options, 4);
2637         xmlResetLastError();
2638         if (mem_base != xmlMemBlocks()) {
2639             printf("Leak of %d blocks found in htmlReadMemory",
2640                    xmlMemBlocks() - mem_base);
2641             test_ret++;
2642             printf(" %d", n_buffer);
2643             printf(" %d", n_size);
2644             printf(" %d", n_URL);
2645             printf(" %d", n_encoding);
2646             printf(" %d", n_options);
2647             printf("\n");
2648         }
2649     }
2650     }
2651     }
2652     }
2653     }
2654     function_tests++;
2655 #endif
2656
2657     return(test_ret);
2658 }
2659
2660
2661 static int
2662 test_htmlSAXParseDoc(void) {
2663     int test_ret = 0;
2664
2665 #if defined(LIBXML_HTML_ENABLED)
2666     int mem_base;
2667     htmlDocPtr ret_val;
2668     xmlChar * cur; /* a pointer to an array of xmlChar */
2669     int n_cur;
2670     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2671     int n_encoding;
2672     htmlSAXHandlerPtr sax; /* the SAX handler block */
2673     int n_sax;
2674     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2675     int n_userData;
2676
2677     for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2678     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2679     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2680     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2681         mem_base = xmlMemBlocks();
2682         cur = gen_xmlChar_ptr(n_cur, 0);
2683         encoding = gen_const_char_ptr(n_encoding, 1);
2684         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2685         userData = gen_userdata(n_userData, 3);
2686
2687         ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2688         desret_htmlDocPtr(ret_val);
2689         call_tests++;
2690         des_xmlChar_ptr(n_cur, cur, 0);
2691         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2692         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2693         des_userdata(n_userData, userData, 3);
2694         xmlResetLastError();
2695         if (mem_base != xmlMemBlocks()) {
2696             printf("Leak of %d blocks found in htmlSAXParseDoc",
2697                    xmlMemBlocks() - mem_base);
2698             test_ret++;
2699             printf(" %d", n_cur);
2700             printf(" %d", n_encoding);
2701             printf(" %d", n_sax);
2702             printf(" %d", n_userData);
2703             printf("\n");
2704         }
2705     }
2706     }
2707     }
2708     }
2709     function_tests++;
2710 #endif
2711
2712     return(test_ret);
2713 }
2714
2715
2716 static int
2717 test_htmlSAXParseFile(void) {
2718     int test_ret = 0;
2719
2720 #if defined(LIBXML_HTML_ENABLED)
2721     int mem_base;
2722     htmlDocPtr ret_val;
2723     const char * filename; /* the filename */
2724     int n_filename;
2725     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2726     int n_encoding;
2727     htmlSAXHandlerPtr sax; /* the SAX handler block */
2728     int n_sax;
2729     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2730     int n_userData;
2731
2732     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2733     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2734     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2735     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2736         mem_base = xmlMemBlocks();
2737         filename = gen_filepath(n_filename, 0);
2738         encoding = gen_const_char_ptr(n_encoding, 1);
2739         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2740         userData = gen_userdata(n_userData, 3);
2741
2742         ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2743         desret_htmlDocPtr(ret_val);
2744         call_tests++;
2745         des_filepath(n_filename, filename, 0);
2746         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2747         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2748         des_userdata(n_userData, userData, 3);
2749         xmlResetLastError();
2750         if (mem_base != xmlMemBlocks()) {
2751             printf("Leak of %d blocks found in htmlSAXParseFile",
2752                    xmlMemBlocks() - mem_base);
2753             test_ret++;
2754             printf(" %d", n_filename);
2755             printf(" %d", n_encoding);
2756             printf(" %d", n_sax);
2757             printf(" %d", n_userData);
2758             printf("\n");
2759         }
2760     }
2761     }
2762     }
2763     }
2764     function_tests++;
2765 #endif
2766
2767     return(test_ret);
2768 }
2769
2770
2771 static int
2772 test_htmlTagLookup(void) {
2773     int test_ret = 0;
2774
2775
2776     /* missing type support */
2777     return(test_ret);
2778 }
2779
2780 static int
2781 test_HTMLparser(void) {
2782     int test_ret = 0;
2783
2784     if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2785     test_ret += test_UTF8ToHtml();
2786     test_ret += test_htmlAttrAllowed();
2787     test_ret += test_htmlAutoCloseTag();
2788     test_ret += test_htmlCreateMemoryParserCtxt();
2789     test_ret += test_htmlCreatePushParserCtxt();
2790     test_ret += test_htmlCtxtReadDoc();
2791     test_ret += test_htmlCtxtReadFile();
2792     test_ret += test_htmlCtxtReadMemory();
2793     test_ret += test_htmlCtxtReset();
2794     test_ret += test_htmlCtxtUseOptions();
2795     test_ret += test_htmlElementAllowedHere();
2796     test_ret += test_htmlElementStatusHere();
2797     test_ret += test_htmlEncodeEntities();
2798     test_ret += test_htmlEntityLookup();
2799     test_ret += test_htmlEntityValueLookup();
2800     test_ret += test_htmlHandleOmittedElem();
2801     test_ret += test_htmlIsAutoClosed();
2802     test_ret += test_htmlIsScriptAttribute();
2803     test_ret += test_htmlNewParserCtxt();
2804     test_ret += test_htmlNodeStatus();
2805     test_ret += test_htmlParseCharRef();
2806     test_ret += test_htmlParseChunk();
2807     test_ret += test_htmlParseDoc();
2808     test_ret += test_htmlParseDocument();
2809     test_ret += test_htmlParseElement();
2810     test_ret += test_htmlParseEntityRef();
2811     test_ret += test_htmlParseFile();
2812     test_ret += test_htmlReadDoc();
2813     test_ret += test_htmlReadFile();
2814     test_ret += test_htmlReadMemory();
2815     test_ret += test_htmlSAXParseDoc();
2816     test_ret += test_htmlSAXParseFile();
2817     test_ret += test_htmlTagLookup();
2818
2819     if (test_ret != 0)
2820         printf("Module HTMLparser: %d errors\n", test_ret);
2821     return(test_ret);
2822 }
2823
2824 static int
2825 test_htmlDocContentDumpFormatOutput(void) {
2826     int test_ret = 0;
2827
2828 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2829     int mem_base;
2830     xmlOutputBufferPtr buf; /* the HTML buffer output */
2831     int n_buf;
2832     xmlDocPtr cur; /* the document */
2833     int n_cur;
2834     char * encoding; /* the encoding string */
2835     int n_encoding;
2836     int format; /* should formatting spaces been added */
2837     int n_format;
2838
2839     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2840     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2841     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2842     for (n_format = 0;n_format < gen_nb_int;n_format++) {
2843         mem_base = xmlMemBlocks();
2844         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2845         cur = gen_xmlDocPtr(n_cur, 1);
2846         encoding = gen_const_char_ptr(n_encoding, 2);
2847         format = gen_int(n_format, 3);
2848
2849         htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2850         call_tests++;
2851         des_xmlOutputBufferPtr(n_buf, buf, 0);
2852         des_xmlDocPtr(n_cur, cur, 1);
2853         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2854         des_int(n_format, format, 3);
2855         xmlResetLastError();
2856         if (mem_base != xmlMemBlocks()) {
2857             printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2858                    xmlMemBlocks() - mem_base);
2859             test_ret++;
2860             printf(" %d", n_buf);
2861             printf(" %d", n_cur);
2862             printf(" %d", n_encoding);
2863             printf(" %d", n_format);
2864             printf("\n");
2865         }
2866     }
2867     }
2868     }
2869     }
2870     function_tests++;
2871 #endif
2872
2873     return(test_ret);
2874 }
2875
2876
2877 static int
2878 test_htmlDocContentDumpOutput(void) {
2879     int test_ret = 0;
2880
2881 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2882     int mem_base;
2883     xmlOutputBufferPtr buf; /* the HTML buffer output */
2884     int n_buf;
2885     xmlDocPtr cur; /* the document */
2886     int n_cur;
2887     char * encoding; /* the encoding string */
2888     int n_encoding;
2889
2890     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2891     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2892     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2893         mem_base = xmlMemBlocks();
2894         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2895         cur = gen_xmlDocPtr(n_cur, 1);
2896         encoding = gen_const_char_ptr(n_encoding, 2);
2897
2898         htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2899         call_tests++;
2900         des_xmlOutputBufferPtr(n_buf, buf, 0);
2901         des_xmlDocPtr(n_cur, cur, 1);
2902         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2903         xmlResetLastError();
2904         if (mem_base != xmlMemBlocks()) {
2905             printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2906                    xmlMemBlocks() - mem_base);
2907             test_ret++;
2908             printf(" %d", n_buf);
2909             printf(" %d", n_cur);
2910             printf(" %d", n_encoding);
2911             printf("\n");
2912         }
2913     }
2914     }
2915     }
2916     function_tests++;
2917 #endif
2918
2919     return(test_ret);
2920 }
2921
2922
2923 static int
2924 test_htmlDocDump(void) {
2925     int test_ret = 0;
2926
2927 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2928     int mem_base;
2929     int ret_val;
2930     FILE * f; /* the FILE* */
2931     int n_f;
2932     xmlDocPtr cur; /* the document */
2933     int n_cur;
2934
2935     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2936     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2937         mem_base = xmlMemBlocks();
2938         f = gen_FILE_ptr(n_f, 0);
2939         cur = gen_xmlDocPtr(n_cur, 1);
2940
2941         ret_val = htmlDocDump(f, cur);
2942         desret_int(ret_val);
2943         call_tests++;
2944         des_FILE_ptr(n_f, f, 0);
2945         des_xmlDocPtr(n_cur, cur, 1);
2946         xmlResetLastError();
2947         if (mem_base != xmlMemBlocks()) {
2948             printf("Leak of %d blocks found in htmlDocDump",
2949                    xmlMemBlocks() - mem_base);
2950             test_ret++;
2951             printf(" %d", n_f);
2952             printf(" %d", n_cur);
2953             printf("\n");
2954         }
2955     }
2956     }
2957     function_tests++;
2958 #endif
2959
2960     return(test_ret);
2961 }
2962
2963
2964 #define gen_nb_xmlChar_ptr_ptr 1
2965 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2966     return(NULL);
2967 }
2968 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2969 }
2970
2971 static int
2972 test_htmlDocDumpMemory(void) {
2973     int test_ret = 0;
2974
2975 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2976     int mem_base;
2977     xmlDocPtr cur; /* the document */
2978     int n_cur;
2979     xmlChar ** mem; /* OUT: the memory pointer */
2980     int n_mem;
2981     int * size; /* OUT: the memory length */
2982     int n_size;
2983
2984     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2985     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2986     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2987         mem_base = xmlMemBlocks();
2988         cur = gen_xmlDocPtr(n_cur, 0);
2989         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2990         size = gen_int_ptr(n_size, 2);
2991
2992         htmlDocDumpMemory(cur, mem, size);
2993         call_tests++;
2994         des_xmlDocPtr(n_cur, cur, 0);
2995         des_xmlChar_ptr_ptr(n_mem, mem, 1);
2996         des_int_ptr(n_size, size, 2);
2997         xmlResetLastError();
2998         if (mem_base != xmlMemBlocks()) {
2999             printf("Leak of %d blocks found in htmlDocDumpMemory",
3000                    xmlMemBlocks() - mem_base);
3001             test_ret++;
3002             printf(" %d", n_cur);
3003             printf(" %d", n_mem);
3004             printf(" %d", n_size);
3005             printf("\n");
3006         }
3007     }
3008     }
3009     }
3010     function_tests++;
3011 #endif
3012
3013     return(test_ret);
3014 }
3015
3016
3017 static int
3018 test_htmlDocDumpMemoryFormat(void) {
3019     int test_ret = 0;
3020
3021 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3022     int mem_base;
3023     xmlDocPtr cur; /* the document */
3024     int n_cur;
3025     xmlChar ** mem; /* OUT: the memory pointer */
3026     int n_mem;
3027     int * size; /* OUT: the memory length */
3028     int n_size;
3029     int format; /* should formatting spaces been added */
3030     int n_format;
3031
3032     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3033     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3034     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3035     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3036         mem_base = xmlMemBlocks();
3037         cur = gen_xmlDocPtr(n_cur, 0);
3038         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3039         size = gen_int_ptr(n_size, 2);
3040         format = gen_int(n_format, 3);
3041
3042         htmlDocDumpMemoryFormat(cur, mem, size, format);
3043         call_tests++;
3044         des_xmlDocPtr(n_cur, cur, 0);
3045         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3046         des_int_ptr(n_size, size, 2);
3047         des_int(n_format, format, 3);
3048         xmlResetLastError();
3049         if (mem_base != xmlMemBlocks()) {
3050             printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3051                    xmlMemBlocks() - mem_base);
3052             test_ret++;
3053             printf(" %d", n_cur);
3054             printf(" %d", n_mem);
3055             printf(" %d", n_size);
3056             printf(" %d", n_format);
3057             printf("\n");
3058         }
3059     }
3060     }
3061     }
3062     }
3063     function_tests++;
3064 #endif
3065
3066     return(test_ret);
3067 }
3068
3069
3070 static int
3071 test_htmlGetMetaEncoding(void) {
3072     int test_ret = 0;
3073
3074 #if defined(LIBXML_HTML_ENABLED)
3075     int mem_base;
3076     const xmlChar * ret_val;
3077     htmlDocPtr doc; /* the document */
3078     int n_doc;
3079
3080     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3081         mem_base = xmlMemBlocks();
3082         doc = gen_htmlDocPtr(n_doc, 0);
3083
3084         ret_val = htmlGetMetaEncoding(doc);
3085         desret_const_xmlChar_ptr(ret_val);
3086         call_tests++;
3087         des_htmlDocPtr(n_doc, doc, 0);
3088         xmlResetLastError();
3089         if (mem_base != xmlMemBlocks()) {
3090             printf("Leak of %d blocks found in htmlGetMetaEncoding",
3091                    xmlMemBlocks() - mem_base);
3092             test_ret++;
3093             printf(" %d", n_doc);
3094             printf("\n");
3095         }
3096     }
3097     function_tests++;
3098 #endif
3099
3100     return(test_ret);
3101 }
3102
3103
3104 static int
3105 test_htmlIsBooleanAttr(void) {
3106     int test_ret = 0;
3107
3108 #if defined(LIBXML_HTML_ENABLED)
3109     int mem_base;
3110     int ret_val;
3111     xmlChar * name; /* the name of the attribute to check */
3112     int n_name;
3113
3114     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3115         mem_base = xmlMemBlocks();
3116         name = gen_const_xmlChar_ptr(n_name, 0);
3117
3118         ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3119         desret_int(ret_val);
3120         call_tests++;
3121         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3122         xmlResetLastError();
3123         if (mem_base != xmlMemBlocks()) {
3124             printf("Leak of %d blocks found in htmlIsBooleanAttr",
3125                    xmlMemBlocks() - mem_base);
3126             test_ret++;
3127             printf(" %d", n_name);
3128             printf("\n");
3129         }
3130     }
3131     function_tests++;
3132 #endif
3133
3134     return(test_ret);
3135 }
3136
3137
3138 static int
3139 test_htmlNewDoc(void) {
3140     int test_ret = 0;
3141
3142 #if defined(LIBXML_HTML_ENABLED)
3143     int mem_base;
3144     htmlDocPtr ret_val;
3145     xmlChar * URI; /* URI for the dtd, or NULL */
3146     int n_URI;
3147     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3148     int n_ExternalID;
3149
3150     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3151     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3152         mem_base = xmlMemBlocks();
3153         URI = gen_const_xmlChar_ptr(n_URI, 0);
3154         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3155
3156         ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3157         desret_htmlDocPtr(ret_val);
3158         call_tests++;
3159         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3160         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3161         xmlResetLastError();
3162         if (mem_base != xmlMemBlocks()) {
3163             printf("Leak of %d blocks found in htmlNewDoc",
3164                    xmlMemBlocks() - mem_base);
3165             test_ret++;
3166             printf(" %d", n_URI);
3167             printf(" %d", n_ExternalID);
3168             printf("\n");
3169         }
3170     }
3171     }
3172     function_tests++;
3173 #endif
3174
3175     return(test_ret);
3176 }
3177
3178
3179 static int
3180 test_htmlNewDocNoDtD(void) {
3181     int test_ret = 0;
3182
3183 #if defined(LIBXML_HTML_ENABLED)
3184     int mem_base;
3185     htmlDocPtr ret_val;
3186     xmlChar * URI; /* URI for the dtd, or NULL */
3187     int n_URI;
3188     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3189     int n_ExternalID;
3190
3191     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3192     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3193         mem_base = xmlMemBlocks();
3194         URI = gen_const_xmlChar_ptr(n_URI, 0);
3195         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3196
3197         ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3198         desret_htmlDocPtr(ret_val);
3199         call_tests++;
3200         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3201         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3202         xmlResetLastError();
3203         if (mem_base != xmlMemBlocks()) {
3204             printf("Leak of %d blocks found in htmlNewDocNoDtD",
3205                    xmlMemBlocks() - mem_base);
3206             test_ret++;
3207             printf(" %d", n_URI);
3208             printf(" %d", n_ExternalID);
3209             printf("\n");
3210         }
3211     }
3212     }
3213     function_tests++;
3214 #endif
3215
3216     return(test_ret);
3217 }
3218
3219
3220 static int
3221 test_htmlNodeDump(void) {
3222     int test_ret = 0;
3223
3224 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3225     int mem_base;
3226     int ret_val;
3227     xmlBufferPtr buf; /* the HTML buffer output */
3228     int n_buf;
3229     xmlDocPtr doc; /* the document */
3230     int n_doc;
3231     xmlNodePtr cur; /* the current node */
3232     int n_cur;
3233
3234     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3235     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3236     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3237         mem_base = xmlMemBlocks();
3238         buf = gen_xmlBufferPtr(n_buf, 0);
3239         doc = gen_xmlDocPtr(n_doc, 1);
3240         cur = gen_xmlNodePtr(n_cur, 2);
3241
3242         ret_val = htmlNodeDump(buf, doc, cur);
3243         desret_int(ret_val);
3244         call_tests++;
3245         des_xmlBufferPtr(n_buf, buf, 0);
3246         des_xmlDocPtr(n_doc, doc, 1);
3247         des_xmlNodePtr(n_cur, cur, 2);
3248         xmlResetLastError();
3249         if (mem_base != xmlMemBlocks()) {
3250             printf("Leak of %d blocks found in htmlNodeDump",
3251                    xmlMemBlocks() - mem_base);
3252             test_ret++;
3253             printf(" %d", n_buf);
3254             printf(" %d", n_doc);
3255             printf(" %d", n_cur);
3256             printf("\n");
3257         }
3258     }
3259     }
3260     }
3261     function_tests++;
3262 #endif
3263
3264     return(test_ret);
3265 }
3266
3267
3268 static int
3269 test_htmlNodeDumpFile(void) {
3270     int test_ret = 0;
3271
3272 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3273     int mem_base;
3274     FILE * out; /* the FILE pointer */
3275     int n_out;
3276     xmlDocPtr doc; /* the document */
3277     int n_doc;
3278     xmlNodePtr cur; /* the current node */
3279     int n_cur;
3280
3281     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3282     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3283     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3284         mem_base = xmlMemBlocks();
3285         out = gen_FILE_ptr(n_out, 0);
3286         doc = gen_xmlDocPtr(n_doc, 1);
3287         cur = gen_xmlNodePtr(n_cur, 2);
3288
3289         htmlNodeDumpFile(out, doc, cur);
3290         call_tests++;
3291         des_FILE_ptr(n_out, out, 0);
3292         des_xmlDocPtr(n_doc, doc, 1);
3293         des_xmlNodePtr(n_cur, cur, 2);
3294         xmlResetLastError();
3295         if (mem_base != xmlMemBlocks()) {
3296             printf("Leak of %d blocks found in htmlNodeDumpFile",
3297                    xmlMemBlocks() - mem_base);
3298             test_ret++;
3299             printf(" %d", n_out);
3300             printf(" %d", n_doc);
3301             printf(" %d", n_cur);
3302             printf("\n");
3303         }
3304     }
3305     }
3306     }
3307     function_tests++;
3308 #endif
3309
3310     return(test_ret);
3311 }
3312
3313
3314 static int
3315 test_htmlNodeDumpFileFormat(void) {
3316     int test_ret = 0;
3317
3318 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3319     int mem_base;
3320     int ret_val;
3321     FILE * out; /* the FILE pointer */
3322     int n_out;
3323     xmlDocPtr doc; /* the document */
3324     int n_doc;
3325     xmlNodePtr cur; /* the current node */
3326     int n_cur;
3327     char * encoding; /* the document encoding */
3328     int n_encoding;
3329     int format; /* should formatting spaces been added */
3330     int n_format;
3331
3332     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3333     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3334     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3335     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3336     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3337         mem_base = xmlMemBlocks();
3338         out = gen_FILE_ptr(n_out, 0);
3339         doc = gen_xmlDocPtr(n_doc, 1);
3340         cur = gen_xmlNodePtr(n_cur, 2);
3341         encoding = gen_const_char_ptr(n_encoding, 3);
3342         format = gen_int(n_format, 4);
3343
3344         ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3345         desret_int(ret_val);
3346         call_tests++;
3347         des_FILE_ptr(n_out, out, 0);
3348         des_xmlDocPtr(n_doc, doc, 1);
3349         des_xmlNodePtr(n_cur, cur, 2);
3350         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3351         des_int(n_format, format, 4);
3352         xmlResetLastError();
3353         if (mem_base != xmlMemBlocks()) {
3354             printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3355                    xmlMemBlocks() - mem_base);
3356             test_ret++;
3357             printf(" %d", n_out);
3358             printf(" %d", n_doc);
3359             printf(" %d", n_cur);
3360             printf(" %d", n_encoding);
3361             printf(" %d", n_format);
3362             printf("\n");
3363         }
3364     }
3365     }
3366     }
3367     }
3368     }
3369     function_tests++;
3370 #endif
3371
3372     return(test_ret);
3373 }
3374
3375
3376 static int
3377 test_htmlNodeDumpFormatOutput(void) {
3378     int test_ret = 0;
3379
3380 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3381     int mem_base;
3382     xmlOutputBufferPtr buf; /* the HTML buffer output */
3383     int n_buf;
3384     xmlDocPtr doc; /* the document */
3385     int n_doc;
3386     xmlNodePtr cur; /* the current node */
3387     int n_cur;
3388     char * encoding; /* the encoding string */
3389     int n_encoding;
3390     int format; /* should formatting spaces been added */
3391     int n_format;
3392
3393     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3394     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3395     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3396     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3397     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3398         mem_base = xmlMemBlocks();
3399         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3400         doc = gen_xmlDocPtr(n_doc, 1);
3401         cur = gen_xmlNodePtr(n_cur, 2);
3402         encoding = gen_const_char_ptr(n_encoding, 3);
3403         format = gen_int(n_format, 4);
3404
3405         htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3406         call_tests++;
3407         des_xmlOutputBufferPtr(n_buf, buf, 0);
3408         des_xmlDocPtr(n_doc, doc, 1);
3409         des_xmlNodePtr(n_cur, cur, 2);
3410         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3411         des_int(n_format, format, 4);
3412         xmlResetLastError();
3413         if (mem_base != xmlMemBlocks()) {
3414             printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3415                    xmlMemBlocks() - mem_base);
3416             test_ret++;
3417             printf(" %d", n_buf);
3418             printf(" %d", n_doc);
3419             printf(" %d", n_cur);
3420             printf(" %d", n_encoding);
3421             printf(" %d", n_format);
3422             printf("\n");
3423         }
3424     }
3425     }
3426     }
3427     }
3428     }
3429     function_tests++;
3430 #endif
3431
3432     return(test_ret);
3433 }
3434
3435
3436 static int
3437 test_htmlNodeDumpOutput(void) {
3438     int test_ret = 0;
3439
3440 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3441     int mem_base;
3442     xmlOutputBufferPtr buf; /* the HTML buffer output */
3443     int n_buf;
3444     xmlDocPtr doc; /* the document */
3445     int n_doc;
3446     xmlNodePtr cur; /* the current node */
3447     int n_cur;
3448     char * encoding; /* the encoding string */
3449     int n_encoding;
3450
3451     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3452     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3453     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3454     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3455         mem_base = xmlMemBlocks();
3456         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3457         doc = gen_xmlDocPtr(n_doc, 1);
3458         cur = gen_xmlNodePtr(n_cur, 2);
3459         encoding = gen_const_char_ptr(n_encoding, 3);
3460
3461         htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3462         call_tests++;
3463         des_xmlOutputBufferPtr(n_buf, buf, 0);
3464         des_xmlDocPtr(n_doc, doc, 1);
3465         des_xmlNodePtr(n_cur, cur, 2);
3466         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3467         xmlResetLastError();
3468         if (mem_base != xmlMemBlocks()) {
3469             printf("Leak of %d blocks found in htmlNodeDumpOutput",
3470                    xmlMemBlocks() - mem_base);
3471             test_ret++;
3472             printf(" %d", n_buf);
3473             printf(" %d", n_doc);
3474             printf(" %d", n_cur);
3475             printf(" %d", n_encoding);
3476             printf("\n");
3477         }
3478     }
3479     }
3480     }
3481     }
3482     function_tests++;
3483 #endif
3484
3485     return(test_ret);
3486 }
3487
3488
3489 static int
3490 test_htmlSaveFile(void) {
3491     int test_ret = 0;
3492
3493 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3494     int mem_base;
3495     int ret_val;
3496     const char * filename; /* the filename (or URL) */
3497     int n_filename;
3498     xmlDocPtr cur; /* the document */
3499     int n_cur;
3500
3501     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3502     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3503         mem_base = xmlMemBlocks();
3504         filename = gen_fileoutput(n_filename, 0);
3505         cur = gen_xmlDocPtr(n_cur, 1);
3506
3507         ret_val = htmlSaveFile(filename, cur);
3508         desret_int(ret_val);
3509         call_tests++;
3510         des_fileoutput(n_filename, filename, 0);
3511         des_xmlDocPtr(n_cur, cur, 1);
3512         xmlResetLastError();
3513         if (mem_base != xmlMemBlocks()) {
3514             printf("Leak of %d blocks found in htmlSaveFile",
3515                    xmlMemBlocks() - mem_base);
3516             test_ret++;
3517             printf(" %d", n_filename);
3518             printf(" %d", n_cur);
3519             printf("\n");
3520         }
3521     }
3522     }
3523     function_tests++;
3524 #endif
3525
3526     return(test_ret);
3527 }
3528
3529
3530 static int
3531 test_htmlSaveFileEnc(void) {
3532     int test_ret = 0;
3533
3534 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3535     int mem_base;
3536     int ret_val;
3537     const char * filename; /* the filename */
3538     int n_filename;
3539     xmlDocPtr cur; /* the document */
3540     int n_cur;
3541     char * encoding; /* the document encoding */
3542     int n_encoding;
3543
3544     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3545     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3546     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3547         mem_base = xmlMemBlocks();
3548         filename = gen_fileoutput(n_filename, 0);
3549         cur = gen_xmlDocPtr(n_cur, 1);
3550         encoding = gen_const_char_ptr(n_encoding, 2);
3551
3552         ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3553         desret_int(ret_val);
3554         call_tests++;
3555         des_fileoutput(n_filename, filename, 0);
3556         des_xmlDocPtr(n_cur, cur, 1);
3557         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3558         xmlResetLastError();
3559         if (mem_base != xmlMemBlocks()) {
3560             printf("Leak of %d blocks found in htmlSaveFileEnc",
3561                    xmlMemBlocks() - mem_base);
3562             test_ret++;
3563             printf(" %d", n_filename);
3564             printf(" %d", n_cur);
3565             printf(" %d", n_encoding);
3566             printf("\n");
3567         }
3568     }
3569     }
3570     }
3571     function_tests++;
3572 #endif
3573
3574     return(test_ret);
3575 }
3576
3577
3578 static int
3579 test_htmlSaveFileFormat(void) {
3580     int test_ret = 0;
3581
3582 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3583     int mem_base;
3584     int ret_val;
3585     const char * filename; /* the filename */
3586     int n_filename;
3587     xmlDocPtr cur; /* the document */
3588     int n_cur;
3589     char * encoding; /* the document encoding */
3590     int n_encoding;
3591     int format; /* should formatting spaces been added */
3592     int n_format;
3593
3594     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3595     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3596     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3597     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3598         mem_base = xmlMemBlocks();
3599         filename = gen_fileoutput(n_filename, 0);
3600         cur = gen_xmlDocPtr(n_cur, 1);
3601         encoding = gen_const_char_ptr(n_encoding, 2);
3602         format = gen_int(n_format, 3);
3603
3604         ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3605         desret_int(ret_val);
3606         call_tests++;
3607         des_fileoutput(n_filename, filename, 0);
3608         des_xmlDocPtr(n_cur, cur, 1);
3609         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3610         des_int(n_format, format, 3);
3611         xmlResetLastError();
3612         if (mem_base != xmlMemBlocks()) {
3613             printf("Leak of %d blocks found in htmlSaveFileFormat",
3614                    xmlMemBlocks() - mem_base);
3615             test_ret++;
3616             printf(" %d", n_filename);
3617             printf(" %d", n_cur);
3618             printf(" %d", n_encoding);
3619             printf(" %d", n_format);
3620             printf("\n");
3621         }
3622     }
3623     }
3624     }
3625     }
3626     function_tests++;
3627 #endif
3628
3629     return(test_ret);
3630 }
3631
3632
3633 static int
3634 test_htmlSetMetaEncoding(void) {
3635     int test_ret = 0;
3636
3637 #if defined(LIBXML_HTML_ENABLED)
3638     int mem_base;
3639     int ret_val;
3640     htmlDocPtr doc; /* the document */
3641     int n_doc;
3642     xmlChar * encoding; /* the encoding string */
3643     int n_encoding;
3644
3645     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3646     for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3647         mem_base = xmlMemBlocks();
3648         doc = gen_htmlDocPtr(n_doc, 0);
3649         encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3650
3651         ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3652         desret_int(ret_val);
3653         call_tests++;
3654         des_htmlDocPtr(n_doc, doc, 0);
3655         des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3656         xmlResetLastError();
3657         if (mem_base != xmlMemBlocks()) {
3658             printf("Leak of %d blocks found in htmlSetMetaEncoding",
3659                    xmlMemBlocks() - mem_base);
3660             test_ret++;
3661             printf(" %d", n_doc);
3662             printf(" %d", n_encoding);
3663             printf("\n");
3664         }
3665     }
3666     }
3667     function_tests++;
3668 #endif
3669
3670     return(test_ret);
3671 }
3672
3673 static int
3674 test_HTMLtree(void) {
3675     int test_ret = 0;
3676
3677     if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3678     test_ret += test_htmlDocContentDumpFormatOutput();
3679     test_ret += test_htmlDocContentDumpOutput();
3680     test_ret += test_htmlDocDump();
3681     test_ret += test_htmlDocDumpMemory();
3682     test_ret += test_htmlDocDumpMemoryFormat();
3683     test_ret += test_htmlGetMetaEncoding();
3684     test_ret += test_htmlIsBooleanAttr();
3685     test_ret += test_htmlNewDoc();
3686     test_ret += test_htmlNewDocNoDtD();
3687     test_ret += test_htmlNodeDump();
3688     test_ret += test_htmlNodeDumpFile();
3689     test_ret += test_htmlNodeDumpFileFormat();
3690     test_ret += test_htmlNodeDumpFormatOutput();
3691     test_ret += test_htmlNodeDumpOutput();
3692     test_ret += test_htmlSaveFile();
3693     test_ret += test_htmlSaveFileEnc();
3694     test_ret += test_htmlSaveFileFormat();
3695     test_ret += test_htmlSetMetaEncoding();
3696
3697     if (test_ret != 0)
3698         printf("Module HTMLtree: %d errors\n", test_ret);
3699     return(test_ret);
3700 }
3701
3702 static int
3703 test_docbDefaultSAXHandlerInit(void) {
3704     int test_ret = 0;
3705
3706 #if defined(LIBXML_DOCB_ENABLED)
3707 #ifdef LIBXML_DOCB_ENABLED
3708     int mem_base;
3709
3710         mem_base = xmlMemBlocks();
3711
3712         docbDefaultSAXHandlerInit();
3713         call_tests++;
3714         xmlResetLastError();
3715         if (mem_base != xmlMemBlocks()) {
3716             printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3717                    xmlMemBlocks() - mem_base);
3718             test_ret++;
3719             printf("\n");
3720         }
3721     function_tests++;
3722 #endif
3723 #endif
3724
3725     return(test_ret);
3726 }
3727
3728
3729 static int
3730 test_htmlDefaultSAXHandlerInit(void) {
3731     int test_ret = 0;
3732
3733 #if defined(LIBXML_HTML_ENABLED)
3734 #ifdef LIBXML_HTML_ENABLED
3735     int mem_base;
3736
3737         mem_base = xmlMemBlocks();
3738
3739         htmlDefaultSAXHandlerInit();
3740         call_tests++;
3741         xmlResetLastError();
3742         if (mem_base != xmlMemBlocks()) {
3743             printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3744                    xmlMemBlocks() - mem_base);
3745             test_ret++;
3746             printf("\n");
3747         }
3748     function_tests++;
3749 #endif
3750 #endif
3751
3752     return(test_ret);
3753 }
3754
3755
3756 static int
3757 test_xmlDefaultSAXHandlerInit(void) {
3758     int test_ret = 0;
3759
3760     int mem_base;
3761
3762         mem_base = xmlMemBlocks();
3763
3764         xmlDefaultSAXHandlerInit();
3765         call_tests++;
3766         xmlResetLastError();
3767         if (mem_base != xmlMemBlocks()) {
3768             printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3769                    xmlMemBlocks() - mem_base);
3770             test_ret++;
3771             printf("\n");
3772         }
3773     function_tests++;
3774
3775     return(test_ret);
3776 }
3777
3778
3779 #define gen_nb_xmlEnumerationPtr 1
3780 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3781     return(NULL);
3782 }
3783 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3784 }
3785
3786 static int
3787 test_xmlSAX2AttributeDecl(void) {
3788     int test_ret = 0;
3789
3790     int mem_base;
3791     void * ctx; /* the user data (XML parser context) */
3792     int n_ctx;
3793     xmlChar * elem; /* the name of the element */
3794     int n_elem;
3795     xmlChar * fullname; /* the attribute name */
3796     int n_fullname;
3797     int type; /* the attribute type */
3798     int n_type;
3799     int def; /* the type of default value */
3800     int n_def;
3801     xmlChar * defaultValue; /* the attribute default value */
3802     int n_defaultValue;
3803     xmlEnumerationPtr tree; /* the tree of enumerated value set */
3804     int n_tree;
3805
3806     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3807     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3808     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3809     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3810     for (n_def = 0;n_def < gen_nb_int;n_def++) {
3811     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3812     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3813         mem_base = xmlMemBlocks();
3814         ctx = gen_void_ptr(n_ctx, 0);
3815         elem = gen_const_xmlChar_ptr(n_elem, 1);
3816         fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3817         type = gen_int(n_type, 3);
3818         def = gen_int(n_def, 4);
3819         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3820         tree = gen_xmlEnumerationPtr(n_tree, 6);
3821
3822         xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3823         call_tests++;
3824         des_void_ptr(n_ctx, ctx, 0);
3825         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3826         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3827         des_int(n_type, type, 3);
3828         des_int(n_def, def, 4);
3829         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3830         des_xmlEnumerationPtr(n_tree, tree, 6);
3831         xmlResetLastError();
3832         if (mem_base != xmlMemBlocks()) {
3833             printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3834                    xmlMemBlocks() - mem_base);
3835             test_ret++;
3836             printf(" %d", n_ctx);
3837             printf(" %d", n_elem);
3838             printf(" %d", n_fullname);
3839             printf(" %d", n_type);
3840             printf(" %d", n_def);
3841             printf(" %d", n_defaultValue);
3842             printf(" %d", n_tree);
3843             printf("\n");
3844         }
3845     }
3846     }
3847     }
3848     }
3849     }
3850     }
3851     }
3852     function_tests++;
3853
3854     return(test_ret);
3855 }
3856
3857
3858 static int
3859 test_xmlSAX2CDataBlock(void) {
3860     int test_ret = 0;
3861
3862     int mem_base;
3863     void * ctx; /* the user data (XML parser context) */
3864     int n_ctx;
3865     xmlChar * value; /* The pcdata content */
3866     int n_value;
3867     int len; /* the block length */
3868     int n_len;
3869
3870     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3871     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3872     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3873         mem_base = xmlMemBlocks();
3874         ctx = gen_void_ptr(n_ctx, 0);
3875         value = gen_const_xmlChar_ptr(n_value, 1);
3876         len = gen_int(n_len, 2);
3877
3878         xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3879         call_tests++;
3880         des_void_ptr(n_ctx, ctx, 0);
3881         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3882         des_int(n_len, len, 2);
3883         xmlResetLastError();
3884         if (mem_base != xmlMemBlocks()) {
3885             printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3886                    xmlMemBlocks() - mem_base);
3887             test_ret++;
3888             printf(" %d", n_ctx);
3889             printf(" %d", n_value);
3890             printf(" %d", n_len);
3891             printf("\n");
3892         }
3893     }
3894     }
3895     }
3896     function_tests++;
3897
3898     return(test_ret);
3899 }
3900
3901
3902 static int
3903 test_xmlSAX2Characters(void) {
3904     int test_ret = 0;
3905
3906     int mem_base;
3907     void * ctx; /* the user data (XML parser context) */
3908     int n_ctx;
3909     xmlChar * ch; /* a xmlChar string */
3910     int n_ch;
3911     int len; /* the number of xmlChar */
3912     int n_len;
3913
3914     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3915     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3916     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3917         mem_base = xmlMemBlocks();
3918         ctx = gen_void_ptr(n_ctx, 0);
3919         ch = gen_const_xmlChar_ptr(n_ch, 1);
3920         len = gen_int(n_len, 2);
3921
3922         xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3923         call_tests++;
3924         des_void_ptr(n_ctx, ctx, 0);
3925         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3926         des_int(n_len, len, 2);
3927         xmlResetLastError();
3928         if (mem_base != xmlMemBlocks()) {
3929             printf("Leak of %d blocks found in xmlSAX2Characters",
3930                    xmlMemBlocks() - mem_base);
3931             test_ret++;
3932             printf(" %d", n_ctx);
3933             printf(" %d", n_ch);
3934             printf(" %d", n_len);
3935             printf("\n");
3936         }
3937     }
3938     }
3939     }
3940     function_tests++;
3941
3942     return(test_ret);
3943 }
3944
3945
3946 static int
3947 test_xmlSAX2Comment(void) {
3948     int test_ret = 0;
3949
3950     int mem_base;
3951     void * ctx; /* the user data (XML parser context) */
3952     int n_ctx;
3953     xmlChar * value; /* the xmlSAX2Comment content */
3954     int n_value;
3955
3956     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3957     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3958         mem_base = xmlMemBlocks();
3959         ctx = gen_void_ptr(n_ctx, 0);
3960         value = gen_const_xmlChar_ptr(n_value, 1);
3961
3962         xmlSAX2Comment(ctx, (const xmlChar *)value);
3963         call_tests++;
3964         des_void_ptr(n_ctx, ctx, 0);
3965         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3966         xmlResetLastError();
3967         if (mem_base != xmlMemBlocks()) {
3968             printf("Leak of %d blocks found in xmlSAX2Comment",
3969                    xmlMemBlocks() - mem_base);
3970             test_ret++;
3971             printf(" %d", n_ctx);
3972             printf(" %d", n_value);
3973             printf("\n");
3974         }
3975     }
3976     }
3977     function_tests++;
3978
3979     return(test_ret);
3980 }
3981
3982
3983 static int
3984 test_xmlSAX2ElementDecl(void) {
3985     int test_ret = 0;
3986
3987     int mem_base;
3988     void * ctx; /* the user data (XML parser context) */
3989     int n_ctx;
3990     xmlChar * name; /* the element name */
3991     int n_name;
3992     int type; /* the element type */
3993     int n_type;
3994     xmlElementContentPtr content; /* the element value tree */
3995     int n_content;
3996
3997     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3998     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3999     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4000     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4001         mem_base = xmlMemBlocks();
4002         ctx = gen_void_ptr(n_ctx, 0);
4003         name = gen_const_xmlChar_ptr(n_name, 1);
4004         type = gen_int(n_type, 2);
4005         content = gen_xmlElementContentPtr(n_content, 3);
4006
4007         xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4008         call_tests++;
4009         des_void_ptr(n_ctx, ctx, 0);
4010         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4011         des_int(n_type, type, 2);
4012         des_xmlElementContentPtr(n_content, content, 3);
4013         xmlResetLastError();
4014         if (mem_base != xmlMemBlocks()) {
4015             printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4016                    xmlMemBlocks() - mem_base);
4017             test_ret++;
4018             printf(" %d", n_ctx);
4019             printf(" %d", n_name);
4020             printf(" %d", n_type);
4021             printf(" %d", n_content);
4022             printf("\n");
4023         }
4024     }
4025     }
4026     }
4027     }
4028     function_tests++;
4029
4030     return(test_ret);
4031 }
4032
4033
4034 static int
4035 test_xmlSAX2EndDocument(void) {
4036     int test_ret = 0;
4037
4038     int mem_base;
4039     void * ctx; /* the user data (XML parser context) */
4040     int n_ctx;
4041
4042     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4043         mem_base = xmlMemBlocks();
4044         ctx = gen_void_ptr(n_ctx, 0);
4045
4046         xmlSAX2EndDocument(ctx);
4047         call_tests++;
4048         des_void_ptr(n_ctx, ctx, 0);
4049         xmlResetLastError();
4050         if (mem_base != xmlMemBlocks()) {
4051             printf("Leak of %d blocks found in xmlSAX2EndDocument",
4052                    xmlMemBlocks() - mem_base);
4053             test_ret++;
4054             printf(" %d", n_ctx);
4055             printf("\n");
4056         }
4057     }
4058     function_tests++;
4059
4060     return(test_ret);
4061 }
4062
4063
4064 static int
4065 test_xmlSAX2EndElement(void) {
4066     int test_ret = 0;
4067
4068 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4069 #ifdef LIBXML_SAX1_ENABLED
4070     int mem_base;
4071     void * ctx; /* the user data (XML parser context) */
4072     int n_ctx;
4073     xmlChar * name; /* The element name */
4074     int n_name;
4075
4076     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4077     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4078         mem_base = xmlMemBlocks();
4079         ctx = gen_void_ptr(n_ctx, 0);
4080         name = gen_const_xmlChar_ptr(n_name, 1);
4081
4082         xmlSAX2EndElement(ctx, (const xmlChar *)name);
4083         call_tests++;
4084         des_void_ptr(n_ctx, ctx, 0);
4085         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4086         xmlResetLastError();
4087         if (mem_base != xmlMemBlocks()) {
4088             printf("Leak of %d blocks found in xmlSAX2EndElement",
4089                    xmlMemBlocks() - mem_base);
4090             test_ret++;
4091             printf(" %d", n_ctx);
4092             printf(" %d", n_name);
4093             printf("\n");
4094         }
4095     }
4096     }
4097     function_tests++;
4098 #endif
4099 #endif
4100
4101     return(test_ret);
4102 }
4103
4104
4105 static int
4106 test_xmlSAX2EndElementNs(void) {
4107     int test_ret = 0;
4108
4109     int mem_base;
4110     void * ctx; /* the user data (XML parser context) */
4111     int n_ctx;
4112     xmlChar * localname; /* the local name of the element */
4113     int n_localname;
4114     xmlChar * prefix; /* the element namespace prefix if available */
4115     int n_prefix;
4116     xmlChar * URI; /* the element namespace name if available */
4117     int n_URI;
4118
4119     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4120     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4121     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4122     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4123         mem_base = xmlMemBlocks();
4124         ctx = gen_void_ptr(n_ctx, 0);
4125         localname = gen_const_xmlChar_ptr(n_localname, 1);
4126         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4127         URI = gen_const_xmlChar_ptr(n_URI, 3);
4128
4129         xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4130         call_tests++;
4131         des_void_ptr(n_ctx, ctx, 0);
4132         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4133         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4134         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4135         xmlResetLastError();
4136         if (mem_base != xmlMemBlocks()) {
4137             printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4138                    xmlMemBlocks() - mem_base);
4139             test_ret++;
4140             printf(" %d", n_ctx);
4141             printf(" %d", n_localname);
4142             printf(" %d", n_prefix);
4143             printf(" %d", n_URI);
4144             printf("\n");
4145         }
4146     }
4147     }
4148     }
4149     }
4150     function_tests++;
4151
4152     return(test_ret);
4153 }
4154
4155
4156 static int
4157 test_xmlSAX2EntityDecl(void) {
4158     int test_ret = 0;
4159
4160     int mem_base;
4161     void * ctx; /* the user data (XML parser context) */
4162     int n_ctx;
4163     xmlChar * name; /* the entity name */
4164     int n_name;
4165     int type; /* the entity type */
4166     int n_type;
4167     xmlChar * publicId; /* The public ID of the entity */
4168     int n_publicId;
4169     xmlChar * systemId; /* The system ID of the entity */
4170     int n_systemId;
4171     xmlChar * content; /* the entity value (without processing). */
4172     int n_content;
4173
4174     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4175     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4176     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4177     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4178     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4179     for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4180         mem_base = xmlMemBlocks();
4181         ctx = gen_void_ptr(n_ctx, 0);
4182         name = gen_const_xmlChar_ptr(n_name, 1);
4183         type = gen_int(n_type, 2);
4184         publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4185         systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4186         content = gen_xmlChar_ptr(n_content, 5);
4187
4188         xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4189         call_tests++;
4190         des_void_ptr(n_ctx, ctx, 0);
4191         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4192         des_int(n_type, type, 2);
4193         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4194         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4195         des_xmlChar_ptr(n_content, content, 5);
4196         xmlResetLastError();
4197         if (mem_base != xmlMemBlocks()) {
4198             printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4199                    xmlMemBlocks() - mem_base);
4200             test_ret++;
4201             printf(" %d", n_ctx);
4202             printf(" %d", n_name);
4203             printf(" %d", n_type);
4204             printf(" %d", n_publicId);
4205             printf(" %d", n_systemId);
4206             printf(" %d", n_content);
4207             printf("\n");
4208         }
4209     }
4210     }
4211     }
4212     }
4213     }
4214     }
4215     function_tests++;
4216
4217     return(test_ret);
4218 }
4219
4220
4221 static int
4222 test_xmlSAX2ExternalSubset(void) {
4223     int test_ret = 0;
4224
4225     int mem_base;
4226     void * ctx; /* the user data (XML parser context) */
4227     int n_ctx;
4228     xmlChar * name; /* the root element name */
4229     int n_name;
4230     xmlChar * ExternalID; /* the external ID */
4231     int n_ExternalID;
4232     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4233     int n_SystemID;
4234
4235     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4236     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4237     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4238     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4239         mem_base = xmlMemBlocks();
4240         ctx = gen_void_ptr(n_ctx, 0);
4241         name = gen_const_xmlChar_ptr(n_name, 1);
4242         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4243         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4244
4245         xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4246         call_tests++;
4247         des_void_ptr(n_ctx, ctx, 0);
4248         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4249         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4250         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4251         xmlResetLastError();
4252         if (mem_base != xmlMemBlocks()) {
4253             printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4254                    xmlMemBlocks() - mem_base);
4255             test_ret++;
4256             printf(" %d", n_ctx);
4257             printf(" %d", n_name);
4258             printf(" %d", n_ExternalID);
4259             printf(" %d", n_SystemID);
4260             printf("\n");
4261         }
4262     }
4263     }
4264     }
4265     }
4266     function_tests++;
4267
4268     return(test_ret);
4269 }
4270
4271
4272 static int
4273 test_xmlSAX2GetColumnNumber(void) {
4274     int test_ret = 0;
4275
4276     int mem_base;
4277     int ret_val;
4278     void * ctx; /* the user data (XML parser context) */
4279     int n_ctx;
4280
4281     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4282         mem_base = xmlMemBlocks();
4283         ctx = gen_void_ptr(n_ctx, 0);
4284
4285         ret_val = xmlSAX2GetColumnNumber(ctx);
4286         desret_int(ret_val);
4287         call_tests++;
4288         des_void_ptr(n_ctx, ctx, 0);
4289         xmlResetLastError();
4290         if (mem_base != xmlMemBlocks()) {
4291             printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4292                    xmlMemBlocks() - mem_base);
4293             test_ret++;
4294             printf(" %d", n_ctx);
4295             printf("\n");
4296         }
4297     }
4298     function_tests++;
4299
4300     return(test_ret);
4301 }
4302
4303
4304 static int
4305 test_xmlSAX2GetEntity(void) {
4306     int test_ret = 0;
4307
4308     int mem_base;
4309     xmlEntityPtr ret_val;
4310     void * ctx; /* the user data (XML parser context) */
4311     int n_ctx;
4312     xmlChar * name; /* The entity name */
4313     int n_name;
4314
4315     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4316     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4317         mem_base = xmlMemBlocks();
4318         ctx = gen_void_ptr(n_ctx, 0);
4319         name = gen_const_xmlChar_ptr(n_name, 1);
4320
4321         ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4322         desret_xmlEntityPtr(ret_val);
4323         call_tests++;
4324         des_void_ptr(n_ctx, ctx, 0);
4325         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4326         xmlResetLastError();
4327         if (mem_base != xmlMemBlocks()) {
4328             printf("Leak of %d blocks found in xmlSAX2GetEntity",
4329                    xmlMemBlocks() - mem_base);
4330             test_ret++;
4331             printf(" %d", n_ctx);
4332             printf(" %d", n_name);
4333             printf("\n");
4334         }
4335     }
4336     }
4337     function_tests++;
4338
4339     return(test_ret);
4340 }
4341
4342
4343 static int
4344 test_xmlSAX2GetLineNumber(void) {
4345     int test_ret = 0;
4346
4347     int mem_base;
4348     int ret_val;
4349     void * ctx; /* the user data (XML parser context) */
4350     int n_ctx;
4351
4352     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4353         mem_base = xmlMemBlocks();
4354         ctx = gen_void_ptr(n_ctx, 0);
4355
4356         ret_val = xmlSAX2GetLineNumber(ctx);
4357         desret_int(ret_val);
4358         call_tests++;
4359         des_void_ptr(n_ctx, ctx, 0);
4360         xmlResetLastError();
4361         if (mem_base != xmlMemBlocks()) {
4362             printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4363                    xmlMemBlocks() - mem_base);
4364             test_ret++;
4365             printf(" %d", n_ctx);
4366             printf("\n");
4367         }
4368     }
4369     function_tests++;
4370
4371     return(test_ret);
4372 }
4373
4374
4375 static int
4376 test_xmlSAX2GetParameterEntity(void) {
4377     int test_ret = 0;
4378
4379     int mem_base;
4380     xmlEntityPtr ret_val;
4381     void * ctx; /* the user data (XML parser context) */
4382     int n_ctx;
4383     xmlChar * name; /* The entity name */
4384     int n_name;
4385
4386     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4387     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4388         mem_base = xmlMemBlocks();
4389         ctx = gen_void_ptr(n_ctx, 0);
4390         name = gen_const_xmlChar_ptr(n_name, 1);
4391
4392         ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4393         desret_xmlEntityPtr(ret_val);
4394         call_tests++;
4395         des_void_ptr(n_ctx, ctx, 0);
4396         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4397         xmlResetLastError();
4398         if (mem_base != xmlMemBlocks()) {
4399             printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4400                    xmlMemBlocks() - mem_base);
4401             test_ret++;
4402             printf(" %d", n_ctx);
4403             printf(" %d", n_name);
4404             printf("\n");
4405         }
4406     }
4407     }
4408     function_tests++;
4409
4410     return(test_ret);
4411 }
4412
4413
4414 static int
4415 test_xmlSAX2GetPublicId(void) {
4416     int test_ret = 0;
4417
4418     int mem_base;
4419     const xmlChar * ret_val;
4420     void * ctx; /* the user data (XML parser context) */
4421     int n_ctx;
4422
4423     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4424         mem_base = xmlMemBlocks();
4425         ctx = gen_void_ptr(n_ctx, 0);
4426
4427         ret_val = xmlSAX2GetPublicId(ctx);
4428         desret_const_xmlChar_ptr(ret_val);
4429         call_tests++;
4430         des_void_ptr(n_ctx, ctx, 0);
4431         xmlResetLastError();
4432         if (mem_base != xmlMemBlocks()) {
4433             printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4434                    xmlMemBlocks() - mem_base);
4435             test_ret++;
4436             printf(" %d", n_ctx);
4437             printf("\n");
4438         }
4439     }
4440     function_tests++;
4441
4442     return(test_ret);
4443 }
4444
4445
4446 static int
4447 test_xmlSAX2GetSystemId(void) {
4448     int test_ret = 0;
4449
4450     int mem_base;
4451     const xmlChar * ret_val;
4452     void * ctx; /* the user data (XML parser context) */
4453     int n_ctx;
4454
4455     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4456         mem_base = xmlMemBlocks();
4457         ctx = gen_void_ptr(n_ctx, 0);
4458
4459         ret_val = xmlSAX2GetSystemId(ctx);
4460         desret_const_xmlChar_ptr(ret_val);
4461         call_tests++;
4462         des_void_ptr(n_ctx, ctx, 0);
4463         xmlResetLastError();
4464         if (mem_base != xmlMemBlocks()) {
4465             printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4466                    xmlMemBlocks() - mem_base);
4467             test_ret++;
4468             printf(" %d", n_ctx);
4469             printf("\n");
4470         }
4471     }
4472     function_tests++;
4473
4474     return(test_ret);
4475 }
4476
4477
4478 static int
4479 test_xmlSAX2HasExternalSubset(void) {
4480     int test_ret = 0;
4481
4482     int mem_base;
4483     int ret_val;
4484     void * ctx; /* the user data (XML parser context) */
4485     int n_ctx;
4486
4487     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4488         mem_base = xmlMemBlocks();
4489         ctx = gen_void_ptr(n_ctx, 0);
4490
4491         ret_val = xmlSAX2HasExternalSubset(ctx);
4492         desret_int(ret_val);
4493         call_tests++;
4494         des_void_ptr(n_ctx, ctx, 0);
4495         xmlResetLastError();
4496         if (mem_base != xmlMemBlocks()) {
4497             printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4498                    xmlMemBlocks() - mem_base);
4499             test_ret++;
4500             printf(" %d", n_ctx);
4501             printf("\n");
4502         }
4503     }
4504     function_tests++;
4505
4506     return(test_ret);
4507 }
4508
4509
4510 static int
4511 test_xmlSAX2HasInternalSubset(void) {
4512     int test_ret = 0;
4513
4514     int mem_base;
4515     int ret_val;
4516     void * ctx; /* the user data (XML parser context) */
4517     int n_ctx;
4518
4519     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4520         mem_base = xmlMemBlocks();
4521         ctx = gen_void_ptr(n_ctx, 0);
4522
4523         ret_val = xmlSAX2HasInternalSubset(ctx);
4524         desret_int(ret_val);
4525         call_tests++;
4526         des_void_ptr(n_ctx, ctx, 0);
4527         xmlResetLastError();
4528         if (mem_base != xmlMemBlocks()) {
4529             printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4530                    xmlMemBlocks() - mem_base);
4531             test_ret++;
4532             printf(" %d", n_ctx);
4533             printf("\n");
4534         }
4535     }
4536     function_tests++;
4537
4538     return(test_ret);
4539 }
4540
4541
4542 static int
4543 test_xmlSAX2IgnorableWhitespace(void) {
4544     int test_ret = 0;
4545
4546     int mem_base;
4547     void * ctx; /* the user data (XML parser context) */
4548     int n_ctx;
4549     xmlChar * ch; /* a xmlChar string */
4550     int n_ch;
4551     int len; /* the number of xmlChar */
4552     int n_len;
4553
4554     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4555     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4556     for (n_len = 0;n_len < gen_nb_int;n_len++) {
4557         mem_base = xmlMemBlocks();
4558         ctx = gen_void_ptr(n_ctx, 0);
4559         ch = gen_const_xmlChar_ptr(n_ch, 1);
4560         len = gen_int(n_len, 2);
4561
4562         xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4563         call_tests++;
4564         des_void_ptr(n_ctx, ctx, 0);
4565         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4566         des_int(n_len, len, 2);
4567         xmlResetLastError();
4568         if (mem_base != xmlMemBlocks()) {
4569             printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4570                    xmlMemBlocks() - mem_base);
4571             test_ret++;
4572             printf(" %d", n_ctx);
4573             printf(" %d", n_ch);
4574             printf(" %d", n_len);
4575             printf("\n");
4576         }
4577     }
4578     }
4579     }
4580     function_tests++;
4581
4582     return(test_ret);
4583 }
4584
4585
4586 #define gen_nb_xmlSAXHandler_ptr 1
4587 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4588     return(NULL);
4589 }
4590 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4591 }
4592
4593 static int
4594 test_xmlSAX2InitDefaultSAXHandler(void) {
4595     int test_ret = 0;
4596
4597     int mem_base;
4598     xmlSAXHandler * hdlr; /* the SAX handler */
4599     int n_hdlr;
4600     int warning; /* flag if non-zero sets the handler warning procedure */
4601     int n_warning;
4602
4603     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4604     for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4605         mem_base = xmlMemBlocks();
4606         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4607         warning = gen_int(n_warning, 1);
4608
4609         xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4610         call_tests++;
4611         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4612         des_int(n_warning, warning, 1);
4613         xmlResetLastError();
4614         if (mem_base != xmlMemBlocks()) {
4615             printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4616                    xmlMemBlocks() - mem_base);
4617             test_ret++;
4618             printf(" %d", n_hdlr);
4619             printf(" %d", n_warning);
4620             printf("\n");
4621         }
4622     }
4623     }
4624     function_tests++;
4625
4626     return(test_ret);
4627 }
4628
4629
4630 static int
4631 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4632     int test_ret = 0;
4633
4634 #if defined(LIBXML_DOCB_ENABLED)
4635     int mem_base;
4636     xmlSAXHandler * hdlr; /* the SAX handler */
4637     int n_hdlr;
4638
4639     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4640         mem_base = xmlMemBlocks();
4641         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4642
4643         xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4644         call_tests++;
4645         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4646         xmlResetLastError();
4647         if (mem_base != xmlMemBlocks()) {
4648             printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4649                    xmlMemBlocks() - mem_base);
4650             test_ret++;
4651             printf(" %d", n_hdlr);
4652             printf("\n");
4653         }
4654     }
4655     function_tests++;
4656 #endif
4657
4658     return(test_ret);
4659 }
4660
4661
4662 static int
4663 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4664     int test_ret = 0;
4665
4666 #if defined(LIBXML_HTML_ENABLED)
4667     int mem_base;
4668     xmlSAXHandler * hdlr; /* the SAX handler */
4669     int n_hdlr;
4670
4671     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4672         mem_base = xmlMemBlocks();
4673         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4674
4675         xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4676         call_tests++;
4677         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4678         xmlResetLastError();
4679         if (mem_base != xmlMemBlocks()) {
4680             printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4681                    xmlMemBlocks() - mem_base);
4682             test_ret++;
4683             printf(" %d", n_hdlr);
4684             printf("\n");
4685         }
4686     }
4687     function_tests++;
4688 #endif
4689
4690     return(test_ret);
4691 }
4692
4693
4694 static int
4695 test_xmlSAX2InternalSubset(void) {
4696     int test_ret = 0;
4697
4698     int mem_base;
4699     void * ctx; /* the user data (XML parser context) */
4700     int n_ctx;
4701     xmlChar * name; /* the root element name */
4702     int n_name;
4703     xmlChar * ExternalID; /* the external ID */
4704     int n_ExternalID;
4705     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4706     int n_SystemID;
4707
4708     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4709     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4710     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4711     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4712         mem_base = xmlMemBlocks();
4713         ctx = gen_void_ptr(n_ctx, 0);
4714         name = gen_const_xmlChar_ptr(n_name, 1);
4715         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4716         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4717
4718         xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4719         call_tests++;
4720         des_void_ptr(n_ctx, ctx, 0);
4721         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4722         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4723         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4724         xmlResetLastError();
4725         if (mem_base != xmlMemBlocks()) {
4726             printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4727                    xmlMemBlocks() - mem_base);
4728             test_ret++;
4729             printf(" %d", n_ctx);
4730             printf(" %d", n_name);
4731             printf(" %d", n_ExternalID);
4732             printf(" %d", n_SystemID);
4733             printf("\n");
4734         }
4735     }
4736     }
4737     }
4738     }
4739     function_tests++;
4740
4741     return(test_ret);
4742 }
4743
4744
4745 static int
4746 test_xmlSAX2IsStandalone(void) {
4747     int test_ret = 0;
4748
4749     int mem_base;
4750     int ret_val;
4751     void * ctx; /* the user data (XML parser context) */
4752     int n_ctx;
4753
4754     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4755         mem_base = xmlMemBlocks();
4756         ctx = gen_void_ptr(n_ctx, 0);
4757
4758         ret_val = xmlSAX2IsStandalone(ctx);
4759         desret_int(ret_val);
4760         call_tests++;
4761         des_void_ptr(n_ctx, ctx, 0);
4762         xmlResetLastError();
4763         if (mem_base != xmlMemBlocks()) {
4764             printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4765                    xmlMemBlocks() - mem_base);
4766             test_ret++;
4767             printf(" %d", n_ctx);
4768             printf("\n");
4769         }
4770     }
4771     function_tests++;
4772
4773     return(test_ret);
4774 }
4775
4776
4777 static int
4778 test_xmlSAX2NotationDecl(void) {
4779     int test_ret = 0;
4780
4781     int mem_base;
4782     void * ctx; /* the user data (XML parser context) */
4783     int n_ctx;
4784     xmlChar * name; /* The name of the notation */
4785     int n_name;
4786     xmlChar * publicId; /* The public ID of the entity */
4787     int n_publicId;
4788     xmlChar * systemId; /* The system ID of the entity */
4789     int n_systemId;
4790
4791     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4792     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4793     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4794     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4795         mem_base = xmlMemBlocks();
4796         ctx = gen_void_ptr(n_ctx, 0);
4797         name = gen_const_xmlChar_ptr(n_name, 1);
4798         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4799         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4800
4801         xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4802         call_tests++;
4803         des_void_ptr(n_ctx, ctx, 0);
4804         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4805         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4806         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4807         xmlResetLastError();
4808         if (mem_base != xmlMemBlocks()) {
4809             printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4810                    xmlMemBlocks() - mem_base);
4811             test_ret++;
4812             printf(" %d", n_ctx);
4813             printf(" %d", n_name);
4814             printf(" %d", n_publicId);
4815             printf(" %d", n_systemId);
4816             printf("\n");
4817         }
4818     }
4819     }
4820     }
4821     }
4822     function_tests++;
4823
4824     return(test_ret);
4825 }
4826
4827
4828 static int
4829 test_xmlSAX2ProcessingInstruction(void) {
4830     int test_ret = 0;
4831
4832     int mem_base;
4833     void * ctx; /* the user data (XML parser context) */
4834     int n_ctx;
4835     xmlChar * target; /* the target name */
4836     int n_target;
4837     xmlChar * data; /* the PI data's */
4838     int n_data;
4839
4840     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4841     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4842     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4843         mem_base = xmlMemBlocks();
4844         ctx = gen_void_ptr(n_ctx, 0);
4845         target = gen_const_xmlChar_ptr(n_target, 1);
4846         data = gen_const_xmlChar_ptr(n_data, 2);
4847
4848         xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4849         call_tests++;
4850         des_void_ptr(n_ctx, ctx, 0);
4851         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4852         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4853         xmlResetLastError();
4854         if (mem_base != xmlMemBlocks()) {
4855             printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4856                    xmlMemBlocks() - mem_base);
4857             test_ret++;
4858             printf(" %d", n_ctx);
4859             printf(" %d", n_target);
4860             printf(" %d", n_data);
4861             printf("\n");
4862         }
4863     }
4864     }
4865     }
4866     function_tests++;
4867
4868     return(test_ret);
4869 }
4870
4871
4872 static int
4873 test_xmlSAX2Reference(void) {
4874     int test_ret = 0;
4875
4876     int mem_base;
4877     void * ctx; /* the user data (XML parser context) */
4878     int n_ctx;
4879     xmlChar * name; /* The entity name */
4880     int n_name;
4881
4882     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4883     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4884         mem_base = xmlMemBlocks();
4885         ctx = gen_void_ptr(n_ctx, 0);
4886         name = gen_const_xmlChar_ptr(n_name, 1);
4887
4888         xmlSAX2Reference(ctx, (const xmlChar *)name);
4889         call_tests++;
4890         des_void_ptr(n_ctx, ctx, 0);
4891         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4892         xmlResetLastError();
4893         if (mem_base != xmlMemBlocks()) {
4894             printf("Leak of %d blocks found in xmlSAX2Reference",
4895                    xmlMemBlocks() - mem_base);
4896             test_ret++;
4897             printf(" %d", n_ctx);
4898             printf(" %d", n_name);
4899             printf("\n");
4900         }
4901     }
4902     }
4903     function_tests++;
4904
4905     return(test_ret);
4906 }
4907
4908
4909 static int
4910 test_xmlSAX2ResolveEntity(void) {
4911     int test_ret = 0;
4912
4913     int mem_base;
4914     xmlParserInputPtr ret_val;
4915     void * ctx; /* the user data (XML parser context) */
4916     int n_ctx;
4917     xmlChar * publicId; /* The public ID of the entity */
4918     int n_publicId;
4919     xmlChar * systemId; /* The system ID of the entity */
4920     int n_systemId;
4921
4922     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4923     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4924     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4925         mem_base = xmlMemBlocks();
4926         ctx = gen_void_ptr(n_ctx, 0);
4927         publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4928         systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4929
4930         ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4931         desret_xmlParserInputPtr(ret_val);
4932         call_tests++;
4933         des_void_ptr(n_ctx, ctx, 0);
4934         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4935         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4936         xmlResetLastError();
4937         if (mem_base != xmlMemBlocks()) {
4938             printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4939                    xmlMemBlocks() - mem_base);
4940             test_ret++;
4941             printf(" %d", n_ctx);
4942             printf(" %d", n_publicId);
4943             printf(" %d", n_systemId);
4944             printf("\n");
4945         }
4946     }
4947     }
4948     }
4949     function_tests++;
4950
4951     return(test_ret);
4952 }
4953
4954
4955 #define gen_nb_xmlSAXLocatorPtr 1
4956 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4957     return(NULL);
4958 }
4959 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4960 }
4961
4962 static int
4963 test_xmlSAX2SetDocumentLocator(void) {
4964     int test_ret = 0;
4965
4966     int mem_base;
4967     void * ctx; /* the user data (XML parser context) */
4968     int n_ctx;
4969     xmlSAXLocatorPtr loc; /* A SAX Locator */
4970     int n_loc;
4971
4972     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4973     for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4974         mem_base = xmlMemBlocks();
4975         ctx = gen_void_ptr(n_ctx, 0);
4976         loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4977
4978         xmlSAX2SetDocumentLocator(ctx, loc);
4979         call_tests++;
4980         des_void_ptr(n_ctx, ctx, 0);
4981         des_xmlSAXLocatorPtr(n_loc, loc, 1);
4982         xmlResetLastError();
4983         if (mem_base != xmlMemBlocks()) {
4984             printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4985                    xmlMemBlocks() - mem_base);
4986             test_ret++;
4987             printf(" %d", n_ctx);
4988             printf(" %d", n_loc);
4989             printf("\n");
4990         }
4991     }
4992     }
4993     function_tests++;
4994
4995     return(test_ret);
4996 }
4997
4998
4999 static int
5000 test_xmlSAX2StartDocument(void) {
5001     int test_ret = 0;
5002
5003     int mem_base;
5004     void * ctx; /* the user data (XML parser context) */
5005     int n_ctx;
5006
5007     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5008         mem_base = xmlMemBlocks();
5009         ctx = gen_void_ptr(n_ctx, 0);
5010
5011         xmlSAX2StartDocument(ctx);
5012         call_tests++;
5013         des_void_ptr(n_ctx, ctx, 0);
5014         xmlResetLastError();
5015         if (mem_base != xmlMemBlocks()) {
5016             printf("Leak of %d blocks found in xmlSAX2StartDocument",
5017                    xmlMemBlocks() - mem_base);
5018             test_ret++;
5019             printf(" %d", n_ctx);
5020             printf("\n");
5021         }
5022     }
5023     function_tests++;
5024
5025     return(test_ret);
5026 }
5027
5028
5029 static int
5030 test_xmlSAX2StartElement(void) {
5031     int test_ret = 0;
5032
5033 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
5034 #ifdef LIBXML_SAX1_ENABLED
5035     int mem_base;
5036     void * ctx; /* the user data (XML parser context) */
5037     int n_ctx;
5038     xmlChar * fullname; /* The element name, including namespace prefix */
5039     int n_fullname;
5040     xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5041     int n_atts;
5042
5043     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5044     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5045     for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5046         mem_base = xmlMemBlocks();
5047         ctx = gen_void_ptr(n_ctx, 0);
5048         fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5049         atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5050
5051         xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5052         call_tests++;
5053         des_void_ptr(n_ctx, ctx, 0);
5054         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5055         des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5056         xmlResetLastError();
5057         if (mem_base != xmlMemBlocks()) {
5058             printf("Leak of %d blocks found in xmlSAX2StartElement",
5059                    xmlMemBlocks() - mem_base);
5060             test_ret++;
5061             printf(" %d", n_ctx);
5062             printf(" %d", n_fullname);
5063             printf(" %d", n_atts);
5064             printf("\n");
5065         }
5066     }
5067     }
5068     }
5069     function_tests++;
5070 #endif
5071 #endif
5072
5073     return(test_ret);
5074 }
5075
5076
5077 static int
5078 test_xmlSAX2StartElementNs(void) {
5079     int test_ret = 0;
5080
5081     int mem_base;
5082     void * ctx; /* the user data (XML parser context) */
5083     int n_ctx;
5084     xmlChar * localname; /* the local name of the element */
5085     int n_localname;
5086     xmlChar * prefix; /* the element namespace prefix if available */
5087     int n_prefix;
5088     xmlChar * URI; /* the element namespace name if available */
5089     int n_URI;
5090     int nb_namespaces; /* number of namespace definitions on that node */
5091     int n_nb_namespaces;
5092     xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5093     int n_namespaces;
5094     int nb_attributes; /* the number of attributes on that node */
5095     int n_nb_attributes;
5096     int nb_defaulted; /* the number of defaulted attributes. */
5097     int n_nb_defaulted;
5098     xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5099     int n_attributes;
5100
5101     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5102     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5103     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5104     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5105     for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5106     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5107     for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5108     for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5109     for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5110         mem_base = xmlMemBlocks();
5111         ctx = gen_void_ptr(n_ctx, 0);
5112         localname = gen_const_xmlChar_ptr(n_localname, 1);
5113         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5114         URI = gen_const_xmlChar_ptr(n_URI, 3);
5115         nb_namespaces = gen_int(n_nb_namespaces, 4);
5116         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5117         nb_attributes = gen_int(n_nb_attributes, 6);
5118         nb_defaulted = gen_int(n_nb_defaulted, 7);
5119         attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5120
5121         xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5122         call_tests++;
5123         des_void_ptr(n_ctx, ctx, 0);
5124         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5125         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5126         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5127         des_int(n_nb_namespaces, nb_namespaces, 4);
5128         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5129         des_int(n_nb_attributes, nb_attributes, 6);
5130         des_int(n_nb_defaulted, nb_defaulted, 7);
5131         des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5132         xmlResetLastError();
5133         if (mem_base != xmlMemBlocks()) {
5134             printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5135                    xmlMemBlocks() - mem_base);
5136             test_ret++;
5137             printf(" %d", n_ctx);
5138             printf(" %d", n_localname);
5139             printf(" %d", n_prefix);
5140             printf(" %d", n_URI);
5141             printf(" %d", n_nb_namespaces);
5142             printf(" %d", n_namespaces);
5143             printf(" %d", n_nb_attributes);
5144             printf(" %d", n_nb_defaulted);
5145             printf(" %d", n_attributes);
5146             printf("\n");
5147         }
5148     }
5149     }
5150     }
5151     }
5152     }
5153     }
5154     }
5155     }
5156     }
5157     function_tests++;
5158
5159     return(test_ret);
5160 }
5161
5162
5163 static int
5164 test_xmlSAX2UnparsedEntityDecl(void) {
5165     int test_ret = 0;
5166
5167     int mem_base;
5168     void * ctx; /* the user data (XML parser context) */
5169     int n_ctx;
5170     xmlChar * name; /* The name of the entity */
5171     int n_name;
5172     xmlChar * publicId; /* The public ID of the entity */
5173     int n_publicId;
5174     xmlChar * systemId; /* The system ID of the entity */
5175     int n_systemId;
5176     xmlChar * notationName; /* the name of the notation */
5177     int n_notationName;
5178
5179     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5180     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5181     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5182     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5183     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5184         mem_base = xmlMemBlocks();
5185         ctx = gen_void_ptr(n_ctx, 0);
5186         name = gen_const_xmlChar_ptr(n_name, 1);
5187         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5188         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5189         notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5190
5191         xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5192         call_tests++;
5193         des_void_ptr(n_ctx, ctx, 0);
5194         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5195         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5196         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5197         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5198         xmlResetLastError();
5199         if (mem_base != xmlMemBlocks()) {
5200             printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5201                    xmlMemBlocks() - mem_base);
5202             test_ret++;
5203             printf(" %d", n_ctx);
5204             printf(" %d", n_name);
5205             printf(" %d", n_publicId);
5206             printf(" %d", n_systemId);
5207             printf(" %d", n_notationName);
5208             printf("\n");
5209         }
5210     }
5211     }
5212     }
5213     }
5214     }
5215     function_tests++;
5216
5217     return(test_ret);
5218 }
5219
5220
5221 static int
5222 test_xmlSAXDefaultVersion(void) {
5223     int test_ret = 0;
5224
5225 #if defined(LIBXML_SAX1_ENABLED)
5226 #ifdef LIBXML_SAX1_ENABLED
5227     int mem_base;
5228     int ret_val;
5229     int version; /* the version, 1 or 2 */
5230     int n_version;
5231
5232     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5233         mem_base = xmlMemBlocks();
5234         version = gen_int(n_version, 0);
5235
5236         ret_val = xmlSAXDefaultVersion(version);
5237         desret_int(ret_val);
5238         call_tests++;
5239         des_int(n_version, version, 0);
5240         xmlResetLastError();
5241         if (mem_base != xmlMemBlocks()) {
5242             printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5243                    xmlMemBlocks() - mem_base);
5244             test_ret++;
5245             printf(" %d", n_version);
5246             printf("\n");
5247         }
5248     }
5249     function_tests++;
5250 #endif
5251 #endif
5252
5253     return(test_ret);
5254 }
5255
5256
5257 static int
5258 test_xmlSAXVersion(void) {
5259     int test_ret = 0;
5260
5261     int mem_base;
5262     int ret_val;
5263     xmlSAXHandler * hdlr; /* the SAX handler */
5264     int n_hdlr;
5265     int version; /* the version, 1 or 2 */
5266     int n_version;
5267
5268     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5269     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5270         mem_base = xmlMemBlocks();
5271         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5272         version = gen_int(n_version, 1);
5273
5274         ret_val = xmlSAXVersion(hdlr, version);
5275         desret_int(ret_val);
5276         call_tests++;
5277         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5278         des_int(n_version, version, 1);
5279         xmlResetLastError();
5280         if (mem_base != xmlMemBlocks()) {
5281             printf("Leak of %d blocks found in xmlSAXVersion",
5282                    xmlMemBlocks() - mem_base);
5283             test_ret++;
5284             printf(" %d", n_hdlr);
5285             printf(" %d", n_version);
5286             printf("\n");
5287         }
5288     }
5289     }
5290     function_tests++;
5291
5292     return(test_ret);
5293 }
5294
5295 static int
5296 test_SAX2(void) {
5297     int test_ret = 0;
5298
5299     if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5300     test_ret += test_docbDefaultSAXHandlerInit();
5301     test_ret += test_htmlDefaultSAXHandlerInit();
5302     test_ret += test_xmlDefaultSAXHandlerInit();
5303     test_ret += test_xmlSAX2AttributeDecl();
5304     test_ret += test_xmlSAX2CDataBlock();
5305     test_ret += test_xmlSAX2Characters();
5306     test_ret += test_xmlSAX2Comment();
5307     test_ret += test_xmlSAX2ElementDecl();
5308     test_ret += test_xmlSAX2EndDocument();
5309     test_ret += test_xmlSAX2EndElement();
5310     test_ret += test_xmlSAX2EndElementNs();
5311     test_ret += test_xmlSAX2EntityDecl();
5312     test_ret += test_xmlSAX2ExternalSubset();
5313     test_ret += test_xmlSAX2GetColumnNumber();
5314     test_ret += test_xmlSAX2GetEntity();
5315     test_ret += test_xmlSAX2GetLineNumber();
5316     test_ret += test_xmlSAX2GetParameterEntity();
5317     test_ret += test_xmlSAX2GetPublicId();
5318     test_ret += test_xmlSAX2GetSystemId();
5319     test_ret += test_xmlSAX2HasExternalSubset();
5320     test_ret += test_xmlSAX2HasInternalSubset();
5321     test_ret += test_xmlSAX2IgnorableWhitespace();
5322     test_ret += test_xmlSAX2InitDefaultSAXHandler();
5323     test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5324     test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5325     test_ret += test_xmlSAX2InternalSubset();
5326     test_ret += test_xmlSAX2IsStandalone();
5327     test_ret += test_xmlSAX2NotationDecl();
5328     test_ret += test_xmlSAX2ProcessingInstruction();
5329     test_ret += test_xmlSAX2Reference();
5330     test_ret += test_xmlSAX2ResolveEntity();
5331     test_ret += test_xmlSAX2SetDocumentLocator();
5332     test_ret += test_xmlSAX2StartDocument();
5333     test_ret += test_xmlSAX2StartElement();
5334     test_ret += test_xmlSAX2StartElementNs();
5335     test_ret += test_xmlSAX2UnparsedEntityDecl();
5336     test_ret += test_xmlSAXDefaultVersion();
5337     test_ret += test_xmlSAXVersion();
5338
5339     if (test_ret != 0)
5340         printf("Module SAX2: %d errors\n", test_ret);
5341     return(test_ret);
5342 }
5343
5344 static int
5345 test_xmlC14NDocDumpMemory(void) {
5346     int test_ret = 0;
5347
5348 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5349     int mem_base;
5350     int ret_val;
5351     xmlDocPtr doc; /* the XML document for canonization */
5352     int n_doc;
5353     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5354     int n_nodes;
5355     int mode; /* the c14n mode (see @xmlC14NMode) */
5356     int n_mode;
5357     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) */
5358     int n_inclusive_ns_prefixes;
5359     int with_comments; /* include comments in the result (!=0) or not (==0) */
5360     int n_with_comments;
5361     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 */
5362     int n_doc_txt_ptr;
5363
5364     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5365     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5366     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5367     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5368     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5369     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5370         mem_base = xmlMemBlocks();
5371         doc = gen_xmlDocPtr(n_doc, 0);
5372         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5373         mode = gen_int(n_mode, 2);
5374         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5375         with_comments = gen_int(n_with_comments, 4);
5376         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5377
5378         ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5379         desret_int(ret_val);
5380         call_tests++;
5381         des_xmlDocPtr(n_doc, doc, 0);
5382         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5383         des_int(n_mode, mode, 2);
5384         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5385         des_int(n_with_comments, with_comments, 4);
5386         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5387         xmlResetLastError();
5388         if (mem_base != xmlMemBlocks()) {
5389             printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5390                    xmlMemBlocks() - mem_base);
5391             test_ret++;
5392             printf(" %d", n_doc);
5393             printf(" %d", n_nodes);
5394             printf(" %d", n_mode);
5395             printf(" %d", n_inclusive_ns_prefixes);
5396             printf(" %d", n_with_comments);
5397             printf(" %d", n_doc_txt_ptr);
5398             printf("\n");
5399         }
5400     }
5401     }
5402     }
5403     }
5404     }
5405     }
5406     function_tests++;
5407 #endif
5408
5409     return(test_ret);
5410 }
5411
5412
5413 static int
5414 test_xmlC14NDocSave(void) {
5415     int test_ret = 0;
5416
5417 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5418     int mem_base;
5419     int ret_val;
5420     xmlDocPtr doc; /* the XML document for canonization */
5421     int n_doc;
5422     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5423     int n_nodes;
5424     int mode; /* the c14n mode (see @xmlC14NMode) */
5425     int n_mode;
5426     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) */
5427     int n_inclusive_ns_prefixes;
5428     int with_comments; /* include comments in the result (!=0) or not (==0) */
5429     int n_with_comments;
5430     const char * filename; /* the filename to store canonical XML image */
5431     int n_filename;
5432     int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5433     int n_compression;
5434
5435     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5436     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5437     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5438     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5439     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5440     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5441     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5442         mem_base = xmlMemBlocks();
5443         doc = gen_xmlDocPtr(n_doc, 0);
5444         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5445         mode = gen_int(n_mode, 2);
5446         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5447         with_comments = gen_int(n_with_comments, 4);
5448         filename = gen_fileoutput(n_filename, 5);
5449         compression = gen_int(n_compression, 6);
5450
5451         ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5452         desret_int(ret_val);
5453         call_tests++;
5454         des_xmlDocPtr(n_doc, doc, 0);
5455         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5456         des_int(n_mode, mode, 2);
5457         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5458         des_int(n_with_comments, with_comments, 4);
5459         des_fileoutput(n_filename, filename, 5);
5460         des_int(n_compression, compression, 6);
5461         xmlResetLastError();
5462         if (mem_base != xmlMemBlocks()) {
5463             printf("Leak of %d blocks found in xmlC14NDocSave",
5464                    xmlMemBlocks() - mem_base);
5465             test_ret++;
5466             printf(" %d", n_doc);
5467             printf(" %d", n_nodes);
5468             printf(" %d", n_mode);
5469             printf(" %d", n_inclusive_ns_prefixes);
5470             printf(" %d", n_with_comments);
5471             printf(" %d", n_filename);
5472             printf(" %d", n_compression);
5473             printf("\n");
5474         }
5475     }
5476     }
5477     }
5478     }
5479     }
5480     }
5481     }
5482     function_tests++;
5483 #endif
5484
5485     return(test_ret);
5486 }
5487
5488
5489 static int
5490 test_xmlC14NDocSaveTo(void) {
5491     int test_ret = 0;
5492
5493 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5494     int mem_base;
5495     int ret_val;
5496     xmlDocPtr doc; /* the XML document for canonization */
5497     int n_doc;
5498     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5499     int n_nodes;
5500     int mode; /* the c14n mode (see @xmlC14NMode) */
5501     int n_mode;
5502     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) */
5503     int n_inclusive_ns_prefixes;
5504     int with_comments; /* include comments in the result (!=0) or not (==0) */
5505     int n_with_comments;
5506     xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5507     int n_buf;
5508
5509     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5510     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5511     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5512     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5513     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5514     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5515         mem_base = xmlMemBlocks();
5516         doc = gen_xmlDocPtr(n_doc, 0);
5517         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5518         mode = gen_int(n_mode, 2);
5519         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5520         with_comments = gen_int(n_with_comments, 4);
5521         buf = gen_xmlOutputBufferPtr(n_buf, 5);
5522
5523         ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5524         desret_int(ret_val);
5525         call_tests++;
5526         des_xmlDocPtr(n_doc, doc, 0);
5527         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5528         des_int(n_mode, mode, 2);
5529         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5530         des_int(n_with_comments, with_comments, 4);
5531         des_xmlOutputBufferPtr(n_buf, buf, 5);
5532         xmlResetLastError();
5533         if (mem_base != xmlMemBlocks()) {
5534             printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5535                    xmlMemBlocks() - mem_base);
5536             test_ret++;
5537             printf(" %d", n_doc);
5538             printf(" %d", n_nodes);
5539             printf(" %d", n_mode);
5540             printf(" %d", n_inclusive_ns_prefixes);
5541             printf(" %d", n_with_comments);
5542             printf(" %d", n_buf);
5543             printf("\n");
5544         }
5545     }
5546     }
5547     }
5548     }
5549     }
5550     }
5551     function_tests++;
5552 #endif
5553
5554     return(test_ret);
5555 }
5556
5557
5558 static int
5559 test_xmlC14NExecute(void) {
5560     int test_ret = 0;
5561
5562
5563     /* missing type support */
5564     return(test_ret);
5565 }
5566
5567 static int
5568 test_c14n(void) {
5569     int test_ret = 0;
5570
5571     if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5572     test_ret += test_xmlC14NDocDumpMemory();
5573     test_ret += test_xmlC14NDocSave();
5574     test_ret += test_xmlC14NDocSaveTo();
5575     test_ret += test_xmlC14NExecute();
5576
5577     if (test_ret != 0)
5578         printf("Module c14n: %d errors\n", test_ret);
5579     return(test_ret);
5580 }
5581 #ifdef LIBXML_CATALOG_ENABLED
5582
5583 #define gen_nb_xmlCatalogPtr 1
5584 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5585     return(NULL);
5586 }
5587 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5588 }
5589 #endif
5590
5591
5592 static int
5593 test_xmlACatalogAdd(void) {
5594     int test_ret = 0;
5595
5596 #if defined(LIBXML_CATALOG_ENABLED)
5597     int mem_base;
5598     int ret_val;
5599     xmlCatalogPtr catal; /* a Catalog */
5600     int n_catal;
5601     xmlChar * type; /* the type of record to add to the catalog */
5602     int n_type;
5603     xmlChar * orig; /* the system, public or prefix to match */
5604     int n_orig;
5605     xmlChar * replace; /* the replacement value for the match */
5606     int n_replace;
5607
5608     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5609     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5610     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5611     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5612         mem_base = xmlMemBlocks();
5613         catal = gen_xmlCatalogPtr(n_catal, 0);
5614         type = gen_const_xmlChar_ptr(n_type, 1);
5615         orig = gen_const_xmlChar_ptr(n_orig, 2);
5616         replace = gen_const_xmlChar_ptr(n_replace, 3);
5617
5618         ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5619         desret_int(ret_val);
5620         call_tests++;
5621         des_xmlCatalogPtr(n_catal, catal, 0);
5622         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5623         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5624         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5625         xmlResetLastError();
5626         if (mem_base != xmlMemBlocks()) {
5627             printf("Leak of %d blocks found in xmlACatalogAdd",
5628                    xmlMemBlocks() - mem_base);
5629             test_ret++;
5630             printf(" %d", n_catal);
5631             printf(" %d", n_type);
5632             printf(" %d", n_orig);
5633             printf(" %d", n_replace);
5634             printf("\n");
5635         }
5636     }
5637     }
5638     }
5639     }
5640     function_tests++;
5641 #endif
5642
5643     return(test_ret);
5644 }
5645
5646
5647 static int
5648 test_xmlACatalogDump(void) {
5649     int test_ret = 0;
5650
5651 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5652     int mem_base;
5653     xmlCatalogPtr catal; /* a Catalog */
5654     int n_catal;
5655     FILE * out; /* the file. */
5656     int n_out;
5657
5658     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5659     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5660         mem_base = xmlMemBlocks();
5661         catal = gen_xmlCatalogPtr(n_catal, 0);
5662         out = gen_FILE_ptr(n_out, 1);
5663
5664         xmlACatalogDump(catal, out);
5665         call_tests++;
5666         des_xmlCatalogPtr(n_catal, catal, 0);
5667         des_FILE_ptr(n_out, out, 1);
5668         xmlResetLastError();
5669         if (mem_base != xmlMemBlocks()) {
5670             printf("Leak of %d blocks found in xmlACatalogDump",
5671                    xmlMemBlocks() - mem_base);
5672             test_ret++;
5673             printf(" %d", n_catal);
5674             printf(" %d", n_out);
5675             printf("\n");
5676         }
5677     }
5678     }
5679     function_tests++;
5680 #endif
5681
5682     return(test_ret);
5683 }
5684
5685
5686 static int
5687 test_xmlACatalogRemove(void) {
5688     int test_ret = 0;
5689
5690 #if defined(LIBXML_CATALOG_ENABLED)
5691     int mem_base;
5692     int ret_val;
5693     xmlCatalogPtr catal; /* a Catalog */
5694     int n_catal;
5695     xmlChar * value; /* the value to remove */
5696     int n_value;
5697
5698     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5699     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5700         mem_base = xmlMemBlocks();
5701         catal = gen_xmlCatalogPtr(n_catal, 0);
5702         value = gen_const_xmlChar_ptr(n_value, 1);
5703
5704         ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5705         desret_int(ret_val);
5706         call_tests++;
5707         des_xmlCatalogPtr(n_catal, catal, 0);
5708         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5709         xmlResetLastError();
5710         if (mem_base != xmlMemBlocks()) {
5711             printf("Leak of %d blocks found in xmlACatalogRemove",
5712                    xmlMemBlocks() - mem_base);
5713             test_ret++;
5714             printf(" %d", n_catal);
5715             printf(" %d", n_value);
5716             printf("\n");
5717         }
5718     }
5719     }
5720     function_tests++;
5721 #endif
5722
5723     return(test_ret);
5724 }
5725
5726
5727 static int
5728 test_xmlACatalogResolve(void) {
5729     int test_ret = 0;
5730
5731 #if defined(LIBXML_CATALOG_ENABLED)
5732     int mem_base;
5733     xmlChar * ret_val;
5734     xmlCatalogPtr catal; /* a Catalog */
5735     int n_catal;
5736     xmlChar * pubID; /* the public ID string */
5737     int n_pubID;
5738     xmlChar * sysID; /* the system ID string */
5739     int n_sysID;
5740
5741     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5742     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5743     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5744         mem_base = xmlMemBlocks();
5745         catal = gen_xmlCatalogPtr(n_catal, 0);
5746         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5747         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5748
5749         ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5750         desret_xmlChar_ptr(ret_val);
5751         call_tests++;
5752         des_xmlCatalogPtr(n_catal, catal, 0);
5753         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5754         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5755         xmlResetLastError();
5756         if (mem_base != xmlMemBlocks()) {
5757             printf("Leak of %d blocks found in xmlACatalogResolve",
5758                    xmlMemBlocks() - mem_base);
5759             test_ret++;
5760             printf(" %d", n_catal);
5761             printf(" %d", n_pubID);
5762             printf(" %d", n_sysID);
5763             printf("\n");
5764         }
5765     }
5766     }
5767     }
5768     function_tests++;
5769 #endif
5770
5771     return(test_ret);
5772 }
5773
5774
5775 static int
5776 test_xmlACatalogResolvePublic(void) {
5777     int test_ret = 0;
5778
5779 #if defined(LIBXML_CATALOG_ENABLED)
5780     int mem_base;
5781     xmlChar * ret_val;
5782     xmlCatalogPtr catal; /* a Catalog */
5783     int n_catal;
5784     xmlChar * pubID; /* the public ID string */
5785     int n_pubID;
5786
5787     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5788     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5789         mem_base = xmlMemBlocks();
5790         catal = gen_xmlCatalogPtr(n_catal, 0);
5791         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5792
5793         ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5794         desret_xmlChar_ptr(ret_val);
5795         call_tests++;
5796         des_xmlCatalogPtr(n_catal, catal, 0);
5797         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5798         xmlResetLastError();
5799         if (mem_base != xmlMemBlocks()) {
5800             printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5801                    xmlMemBlocks() - mem_base);
5802             test_ret++;
5803             printf(" %d", n_catal);
5804             printf(" %d", n_pubID);
5805             printf("\n");
5806         }
5807     }
5808     }
5809     function_tests++;
5810 #endif
5811
5812     return(test_ret);
5813 }
5814
5815
5816 static int
5817 test_xmlACatalogResolveSystem(void) {
5818     int test_ret = 0;
5819
5820 #if defined(LIBXML_CATALOG_ENABLED)
5821     int mem_base;
5822     xmlChar * ret_val;
5823     xmlCatalogPtr catal; /* a Catalog */
5824     int n_catal;
5825     xmlChar * sysID; /* the system ID string */
5826     int n_sysID;
5827
5828     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5829     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5830         mem_base = xmlMemBlocks();
5831         catal = gen_xmlCatalogPtr(n_catal, 0);
5832         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5833
5834         ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5835         desret_xmlChar_ptr(ret_val);
5836         call_tests++;
5837         des_xmlCatalogPtr(n_catal, catal, 0);
5838         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5839         xmlResetLastError();
5840         if (mem_base != xmlMemBlocks()) {
5841             printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5842                    xmlMemBlocks() - mem_base);
5843             test_ret++;
5844             printf(" %d", n_catal);
5845             printf(" %d", n_sysID);
5846             printf("\n");
5847         }
5848     }
5849     }
5850     function_tests++;
5851 #endif
5852
5853     return(test_ret);
5854 }
5855
5856
5857 static int
5858 test_xmlACatalogResolveURI(void) {
5859     int test_ret = 0;
5860
5861 #if defined(LIBXML_CATALOG_ENABLED)
5862     int mem_base;
5863     xmlChar * ret_val;
5864     xmlCatalogPtr catal; /* a Catalog */
5865     int n_catal;
5866     xmlChar * URI; /* the URI */
5867     int n_URI;
5868
5869     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5870     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5871         mem_base = xmlMemBlocks();
5872         catal = gen_xmlCatalogPtr(n_catal, 0);
5873         URI = gen_const_xmlChar_ptr(n_URI, 1);
5874
5875         ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5876         desret_xmlChar_ptr(ret_val);
5877         call_tests++;
5878         des_xmlCatalogPtr(n_catal, catal, 0);
5879         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5880         xmlResetLastError();
5881         if (mem_base != xmlMemBlocks()) {
5882             printf("Leak of %d blocks found in xmlACatalogResolveURI",
5883                    xmlMemBlocks() - mem_base);
5884             test_ret++;
5885             printf(" %d", n_catal);
5886             printf(" %d", n_URI);
5887             printf("\n");
5888         }
5889     }
5890     }
5891     function_tests++;
5892 #endif
5893
5894     return(test_ret);
5895 }
5896
5897
5898 static int
5899 test_xmlCatalogAdd(void) {
5900     int test_ret = 0;
5901
5902 #if defined(LIBXML_CATALOG_ENABLED)
5903     int mem_base;
5904     int ret_val;
5905     xmlChar * type; /* the type of record to add to the catalog */
5906     int n_type;
5907     xmlChar * orig; /* the system, public or prefix to match */
5908     int n_orig;
5909     xmlChar * replace; /* the replacement value for the match */
5910     int n_replace;
5911
5912     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5913     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5914     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5915         mem_base = xmlMemBlocks();
5916         type = gen_const_xmlChar_ptr(n_type, 0);
5917         orig = gen_const_xmlChar_ptr(n_orig, 1);
5918         replace = gen_const_xmlChar_ptr(n_replace, 2);
5919
5920         ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5921         desret_int(ret_val);
5922         call_tests++;
5923         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5924         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5925         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5926         xmlResetLastError();
5927         if (mem_base != xmlMemBlocks()) {
5928             printf("Leak of %d blocks found in xmlCatalogAdd",
5929                    xmlMemBlocks() - mem_base);
5930             test_ret++;
5931             printf(" %d", n_type);
5932             printf(" %d", n_orig);
5933             printf(" %d", n_replace);
5934             printf("\n");
5935         }
5936     }
5937     }
5938     }
5939     function_tests++;
5940 #endif
5941
5942     return(test_ret);
5943 }
5944
5945
5946 static int
5947 test_xmlCatalogCleanup(void) {
5948     int test_ret = 0;
5949
5950 #if defined(LIBXML_CATALOG_ENABLED)
5951
5952
5953         xmlCatalogCleanup();
5954         call_tests++;
5955         xmlResetLastError();
5956     function_tests++;
5957 #endif
5958
5959     return(test_ret);
5960 }
5961
5962
5963 static int
5964 test_xmlCatalogConvert(void) {
5965     int test_ret = 0;
5966
5967 #if defined(LIBXML_CATALOG_ENABLED)
5968     int ret_val;
5969
5970
5971         ret_val = xmlCatalogConvert();
5972         desret_int(ret_val);
5973         call_tests++;
5974         xmlResetLastError();
5975     function_tests++;
5976 #endif
5977
5978     return(test_ret);
5979 }
5980
5981
5982 static int
5983 test_xmlCatalogDump(void) {
5984     int test_ret = 0;
5985
5986 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5987     int mem_base;
5988     FILE * out; /* the file. */
5989     int n_out;
5990
5991     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5992         mem_base = xmlMemBlocks();
5993         out = gen_FILE_ptr(n_out, 0);
5994
5995         xmlCatalogDump(out);
5996         call_tests++;
5997         des_FILE_ptr(n_out, out, 0);
5998         xmlResetLastError();
5999         if (mem_base != xmlMemBlocks()) {
6000             printf("Leak of %d blocks found in xmlCatalogDump",
6001                    xmlMemBlocks() - mem_base);
6002             test_ret++;
6003             printf(" %d", n_out);
6004             printf("\n");
6005         }
6006     }
6007     function_tests++;
6008 #endif
6009
6010     return(test_ret);
6011 }
6012
6013
6014 static int
6015 test_xmlCatalogGetDefaults(void) {
6016     int test_ret = 0;
6017
6018 #if defined(LIBXML_CATALOG_ENABLED)
6019     int mem_base;
6020     xmlCatalogAllow ret_val;
6021
6022         mem_base = xmlMemBlocks();
6023
6024         ret_val = xmlCatalogGetDefaults();
6025         desret_xmlCatalogAllow(ret_val);
6026         call_tests++;
6027         xmlResetLastError();
6028         if (mem_base != xmlMemBlocks()) {
6029             printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6030                    xmlMemBlocks() - mem_base);
6031             test_ret++;
6032             printf("\n");
6033         }
6034     function_tests++;
6035 #endif
6036
6037     return(test_ret);
6038 }
6039
6040
6041 static int
6042 test_xmlCatalogIsEmpty(void) {
6043     int test_ret = 0;
6044
6045 #if defined(LIBXML_CATALOG_ENABLED)
6046     int mem_base;
6047     int ret_val;
6048     xmlCatalogPtr catal; /* should this create an SGML catalog */
6049     int n_catal;
6050
6051     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6052         mem_base = xmlMemBlocks();
6053         catal = gen_xmlCatalogPtr(n_catal, 0);
6054
6055         ret_val = xmlCatalogIsEmpty(catal);
6056         desret_int(ret_val);
6057         call_tests++;
6058         des_xmlCatalogPtr(n_catal, catal, 0);
6059         xmlResetLastError();
6060         if (mem_base != xmlMemBlocks()) {
6061             printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6062                    xmlMemBlocks() - mem_base);
6063             test_ret++;
6064             printf(" %d", n_catal);
6065             printf("\n");
6066         }
6067     }
6068     function_tests++;
6069 #endif
6070
6071     return(test_ret);
6072 }
6073
6074
6075 static int
6076 test_xmlCatalogLocalResolve(void) {
6077     int test_ret = 0;
6078
6079 #if defined(LIBXML_CATALOG_ENABLED)
6080     int mem_base;
6081     xmlChar * ret_val;
6082     void * catalogs; /* a document's list of catalogs */
6083     int n_catalogs;
6084     xmlChar * pubID; /* the public ID string */
6085     int n_pubID;
6086     xmlChar * sysID; /* the system ID string */
6087     int n_sysID;
6088
6089     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6090     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6091     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6092         mem_base = xmlMemBlocks();
6093         catalogs = gen_void_ptr(n_catalogs, 0);
6094         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6095         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6096
6097         ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6098         desret_xmlChar_ptr(ret_val);
6099         call_tests++;
6100         des_void_ptr(n_catalogs, catalogs, 0);
6101         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6102         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6103         xmlResetLastError();
6104         if (mem_base != xmlMemBlocks()) {
6105             printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6106                    xmlMemBlocks() - mem_base);
6107             test_ret++;
6108             printf(" %d", n_catalogs);
6109             printf(" %d", n_pubID);
6110             printf(" %d", n_sysID);
6111             printf("\n");
6112         }
6113     }
6114     }
6115     }
6116     function_tests++;
6117 #endif
6118
6119     return(test_ret);
6120 }
6121
6122
6123 static int
6124 test_xmlCatalogLocalResolveURI(void) {
6125     int test_ret = 0;
6126
6127 #if defined(LIBXML_CATALOG_ENABLED)
6128     int mem_base;
6129     xmlChar * ret_val;
6130     void * catalogs; /* a document's list of catalogs */
6131     int n_catalogs;
6132     xmlChar * URI; /* the URI */
6133     int n_URI;
6134
6135     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6136     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6137         mem_base = xmlMemBlocks();
6138         catalogs = gen_void_ptr(n_catalogs, 0);
6139         URI = gen_const_xmlChar_ptr(n_URI, 1);
6140
6141         ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6142         desret_xmlChar_ptr(ret_val);
6143         call_tests++;
6144         des_void_ptr(n_catalogs, catalogs, 0);
6145         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6146         xmlResetLastError();
6147         if (mem_base != xmlMemBlocks()) {
6148             printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6149                    xmlMemBlocks() - mem_base);
6150             test_ret++;
6151             printf(" %d", n_catalogs);
6152             printf(" %d", n_URI);
6153             printf("\n");
6154         }
6155     }
6156     }
6157     function_tests++;
6158 #endif
6159
6160     return(test_ret);
6161 }
6162
6163
6164 static int
6165 test_xmlCatalogRemove(void) {
6166     int test_ret = 0;
6167
6168 #if defined(LIBXML_CATALOG_ENABLED)
6169     int ret_val;
6170     xmlChar * value; /* the value to remove */
6171     int n_value;
6172
6173     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6174         value = gen_const_xmlChar_ptr(n_value, 0);
6175
6176         ret_val = xmlCatalogRemove((const xmlChar *)value);
6177         desret_int(ret_val);
6178         call_tests++;
6179         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6180         xmlResetLastError();
6181     }
6182     function_tests++;
6183 #endif
6184
6185     return(test_ret);
6186 }
6187
6188
6189 static int
6190 test_xmlCatalogResolve(void) {
6191     int test_ret = 0;
6192
6193 #if defined(LIBXML_CATALOG_ENABLED)
6194     xmlChar * ret_val;
6195     xmlChar * pubID; /* the public ID string */
6196     int n_pubID;
6197     xmlChar * sysID; /* the system ID string */
6198     int n_sysID;
6199
6200     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6201     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6202         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6203         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6204
6205         ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6206         desret_xmlChar_ptr(ret_val);
6207         call_tests++;
6208         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6209         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6210         xmlResetLastError();
6211     }
6212     }
6213     function_tests++;
6214 #endif
6215
6216     return(test_ret);
6217 }
6218
6219
6220 static int
6221 test_xmlCatalogResolvePublic(void) {
6222     int test_ret = 0;
6223
6224 #if defined(LIBXML_CATALOG_ENABLED)
6225     int mem_base;
6226     xmlChar * ret_val;
6227     xmlChar * pubID; /* the public ID string */
6228     int n_pubID;
6229
6230     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6231         mem_base = xmlMemBlocks();
6232         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6233
6234         ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6235         desret_xmlChar_ptr(ret_val);
6236         call_tests++;
6237         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6238         xmlResetLastError();
6239         if (mem_base != xmlMemBlocks()) {
6240             printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6241                    xmlMemBlocks() - mem_base);
6242             test_ret++;
6243             printf(" %d", n_pubID);
6244             printf("\n");
6245         }
6246     }
6247     function_tests++;
6248 #endif
6249
6250     return(test_ret);
6251 }
6252
6253
6254 static int
6255 test_xmlCatalogResolveSystem(void) {
6256     int test_ret = 0;
6257
6258 #if defined(LIBXML_CATALOG_ENABLED)
6259     int mem_base;
6260     xmlChar * ret_val;
6261     xmlChar * sysID; /* the system ID string */
6262     int n_sysID;
6263
6264     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6265         mem_base = xmlMemBlocks();
6266         sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6267
6268         ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6269         desret_xmlChar_ptr(ret_val);
6270         call_tests++;
6271         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6272         xmlResetLastError();
6273         if (mem_base != xmlMemBlocks()) {
6274             printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6275                    xmlMemBlocks() - mem_base);
6276             test_ret++;
6277             printf(" %d", n_sysID);
6278             printf("\n");
6279         }
6280     }
6281     function_tests++;
6282 #endif
6283
6284     return(test_ret);
6285 }
6286
6287
6288 static int
6289 test_xmlCatalogResolveURI(void) {
6290     int test_ret = 0;
6291
6292 #if defined(LIBXML_CATALOG_ENABLED)
6293     int mem_base;
6294     xmlChar * ret_val;
6295     xmlChar * URI; /* the URI */
6296     int n_URI;
6297
6298     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6299         mem_base = xmlMemBlocks();
6300         URI = gen_const_xmlChar_ptr(n_URI, 0);
6301
6302         ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6303         desret_xmlChar_ptr(ret_val);
6304         call_tests++;
6305         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6306         xmlResetLastError();
6307         if (mem_base != xmlMemBlocks()) {
6308             printf("Leak of %d blocks found in xmlCatalogResolveURI",
6309                    xmlMemBlocks() - mem_base);
6310             test_ret++;
6311             printf(" %d", n_URI);
6312             printf("\n");
6313         }
6314     }
6315     function_tests++;
6316 #endif
6317
6318     return(test_ret);
6319 }
6320
6321
6322 static int
6323 test_xmlCatalogSetDefaultPrefer(void) {
6324     int test_ret = 0;
6325
6326 #if defined(LIBXML_CATALOG_ENABLED)
6327     int mem_base;
6328     xmlCatalogPrefer ret_val;
6329     xmlCatalogPrefer prefer; /* the default preference for delegation */
6330     int n_prefer;
6331
6332     for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6333         mem_base = xmlMemBlocks();
6334         prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6335
6336         ret_val = xmlCatalogSetDefaultPrefer(prefer);
6337         desret_xmlCatalogPrefer(ret_val);
6338         call_tests++;
6339         des_xmlCatalogPrefer(n_prefer, prefer, 0);
6340         xmlResetLastError();
6341         if (mem_base != xmlMemBlocks()) {
6342             printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6343                    xmlMemBlocks() - mem_base);
6344             test_ret++;
6345             printf(" %d", n_prefer);
6346             printf("\n");
6347         }
6348     }
6349     function_tests++;
6350 #endif
6351
6352     return(test_ret);
6353 }
6354
6355
6356 static int
6357 test_xmlCatalogSetDefaults(void) {
6358     int test_ret = 0;
6359
6360 #if defined(LIBXML_CATALOG_ENABLED)
6361     int mem_base;
6362     xmlCatalogAllow allow; /* what catalogs should be accepted */
6363     int n_allow;
6364
6365     for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6366         mem_base = xmlMemBlocks();
6367         allow = gen_xmlCatalogAllow(n_allow, 0);
6368
6369         xmlCatalogSetDefaults(allow);
6370         call_tests++;
6371         des_xmlCatalogAllow(n_allow, allow, 0);
6372         xmlResetLastError();
6373         if (mem_base != xmlMemBlocks()) {
6374             printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6375                    xmlMemBlocks() - mem_base);
6376             test_ret++;
6377             printf(" %d", n_allow);
6378             printf("\n");
6379         }
6380     }
6381     function_tests++;
6382 #endif
6383
6384     return(test_ret);
6385 }
6386
6387
6388 static int
6389 test_xmlConvertSGMLCatalog(void) {
6390     int test_ret = 0;
6391
6392 #if defined(LIBXML_CATALOG_ENABLED)
6393     int mem_base;
6394     int ret_val;
6395     xmlCatalogPtr catal; /* the catalog */
6396     int n_catal;
6397
6398     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6399         mem_base = xmlMemBlocks();
6400         catal = gen_xmlCatalogPtr(n_catal, 0);
6401
6402         ret_val = xmlConvertSGMLCatalog(catal);
6403         desret_int(ret_val);
6404         call_tests++;
6405         des_xmlCatalogPtr(n_catal, catal, 0);
6406         xmlResetLastError();
6407         if (mem_base != xmlMemBlocks()) {
6408             printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6409                    xmlMemBlocks() - mem_base);
6410             test_ret++;
6411             printf(" %d", n_catal);
6412             printf("\n");
6413         }
6414     }
6415     function_tests++;
6416 #endif
6417
6418     return(test_ret);
6419 }
6420
6421
6422 static int
6423 test_xmlInitializeCatalog(void) {
6424     int test_ret = 0;
6425
6426 #if defined(LIBXML_CATALOG_ENABLED)
6427     int mem_base;
6428
6429         mem_base = xmlMemBlocks();
6430
6431         xmlInitializeCatalog();
6432         call_tests++;
6433         xmlResetLastError();
6434         if (mem_base != xmlMemBlocks()) {
6435             printf("Leak of %d blocks found in xmlInitializeCatalog",
6436                    xmlMemBlocks() - mem_base);
6437             test_ret++;
6438             printf("\n");
6439         }
6440     function_tests++;
6441 #endif
6442
6443     return(test_ret);
6444 }
6445
6446
6447 static int
6448 test_xmlLoadACatalog(void) {
6449     int test_ret = 0;
6450
6451
6452     /* missing type support */
6453     return(test_ret);
6454 }
6455
6456
6457 static int
6458 test_xmlLoadCatalog(void) {
6459     int test_ret = 0;
6460
6461 #if defined(LIBXML_CATALOG_ENABLED)
6462     int ret_val;
6463     const char * filename; /* a file path */
6464     int n_filename;
6465
6466     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6467         filename = gen_filepath(n_filename, 0);
6468
6469         ret_val = xmlLoadCatalog(filename);
6470         desret_int(ret_val);
6471         call_tests++;
6472         des_filepath(n_filename, filename, 0);
6473         xmlResetLastError();
6474     }
6475     function_tests++;
6476 #endif
6477
6478     return(test_ret);
6479 }
6480
6481
6482 static int
6483 test_xmlLoadCatalogs(void) {
6484     int test_ret = 0;
6485
6486 #if defined(LIBXML_CATALOG_ENABLED)
6487     char * pathss; /* a list of directories separated by a colon or a space. */
6488     int n_pathss;
6489
6490     for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6491         pathss = gen_const_char_ptr(n_pathss, 0);
6492
6493         xmlLoadCatalogs((const char *)pathss);
6494         call_tests++;
6495         des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6496         xmlResetLastError();
6497     }
6498     function_tests++;
6499 #endif
6500
6501     return(test_ret);
6502 }
6503
6504
6505 static int
6506 test_xmlLoadSGMLSuperCatalog(void) {
6507     int test_ret = 0;
6508
6509
6510     /* missing type support */
6511     return(test_ret);
6512 }
6513
6514
6515 static int
6516 test_xmlNewCatalog(void) {
6517     int test_ret = 0;
6518
6519
6520     /* missing type support */
6521     return(test_ret);
6522 }
6523
6524
6525 static int
6526 test_xmlParseCatalogFile(void) {
6527     int test_ret = 0;
6528
6529 #if defined(LIBXML_CATALOG_ENABLED)
6530     int mem_base;
6531     xmlDocPtr ret_val;
6532     const char * filename; /* the filename */
6533     int n_filename;
6534
6535     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6536         mem_base = xmlMemBlocks();
6537         filename = gen_filepath(n_filename, 0);
6538
6539         ret_val = xmlParseCatalogFile(filename);
6540         desret_xmlDocPtr(ret_val);
6541         call_tests++;
6542         des_filepath(n_filename, filename, 0);
6543         xmlResetLastError();
6544         if (mem_base != xmlMemBlocks()) {
6545             printf("Leak of %d blocks found in xmlParseCatalogFile",
6546                    xmlMemBlocks() - mem_base);
6547             test_ret++;
6548             printf(" %d", n_filename);
6549             printf("\n");
6550         }
6551     }
6552     function_tests++;
6553 #endif
6554
6555     return(test_ret);
6556 }
6557
6558 static int
6559 test_catalog(void) {
6560     int test_ret = 0;
6561
6562     if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6563     test_ret += test_xmlACatalogAdd();
6564     test_ret += test_xmlACatalogDump();
6565     test_ret += test_xmlACatalogRemove();
6566     test_ret += test_xmlACatalogResolve();
6567     test_ret += test_xmlACatalogResolvePublic();
6568     test_ret += test_xmlACatalogResolveSystem();
6569     test_ret += test_xmlACatalogResolveURI();
6570     test_ret += test_xmlCatalogAdd();
6571     test_ret += test_xmlCatalogCleanup();
6572     test_ret += test_xmlCatalogConvert();
6573     test_ret += test_xmlCatalogDump();
6574     test_ret += test_xmlCatalogGetDefaults();
6575     test_ret += test_xmlCatalogIsEmpty();
6576     test_ret += test_xmlCatalogLocalResolve();
6577     test_ret += test_xmlCatalogLocalResolveURI();
6578     test_ret += test_xmlCatalogRemove();
6579     test_ret += test_xmlCatalogResolve();
6580     test_ret += test_xmlCatalogResolvePublic();
6581     test_ret += test_xmlCatalogResolveSystem();
6582     test_ret += test_xmlCatalogResolveURI();
6583     test_ret += test_xmlCatalogSetDefaultPrefer();
6584     test_ret += test_xmlCatalogSetDefaults();
6585     test_ret += test_xmlConvertSGMLCatalog();
6586     test_ret += test_xmlInitializeCatalog();
6587     test_ret += test_xmlLoadACatalog();
6588     test_ret += test_xmlLoadCatalog();
6589     test_ret += test_xmlLoadCatalogs();
6590     test_ret += test_xmlLoadSGMLSuperCatalog();
6591     test_ret += test_xmlNewCatalog();
6592     test_ret += test_xmlParseCatalogFile();
6593
6594     if (test_ret != 0)
6595         printf("Module catalog: %d errors\n", test_ret);
6596     return(test_ret);
6597 }
6598
6599 #define gen_nb_const_xmlChRangeGroup_ptr 1
6600 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6601     return(NULL);
6602 }
6603 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6604 }
6605
6606 static int
6607 test_xmlCharInRange(void) {
6608     int test_ret = 0;
6609
6610     int mem_base;
6611     int ret_val;
6612     unsigned int val; /* character to be validated */
6613     int n_val;
6614     xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6615     int n_rptr;
6616
6617     for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6618     for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6619         mem_base = xmlMemBlocks();
6620         val = gen_unsigned_int(n_val, 0);
6621         rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6622
6623         ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6624         desret_int(ret_val);
6625         call_tests++;
6626         des_unsigned_int(n_val, val, 0);
6627         des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6628         xmlResetLastError();
6629         if (mem_base != xmlMemBlocks()) {
6630             printf("Leak of %d blocks found in xmlCharInRange",
6631                    xmlMemBlocks() - mem_base);
6632             test_ret++;
6633             printf(" %d", n_val);
6634             printf(" %d", n_rptr);
6635             printf("\n");
6636         }
6637     }
6638     }
6639     function_tests++;
6640
6641     return(test_ret);
6642 }
6643
6644
6645 static int
6646 test_xmlIsBaseChar(void) {
6647     int test_ret = 0;
6648
6649     int mem_base;
6650     int ret_val;
6651     unsigned int ch; /* character to validate */
6652     int n_ch;
6653
6654     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6655         mem_base = xmlMemBlocks();
6656         ch = gen_unsigned_int(n_ch, 0);
6657
6658         ret_val = xmlIsBaseChar(ch);
6659         desret_int(ret_val);
6660         call_tests++;
6661         des_unsigned_int(n_ch, ch, 0);
6662         xmlResetLastError();
6663         if (mem_base != xmlMemBlocks()) {
6664             printf("Leak of %d blocks found in xmlIsBaseChar",
6665                    xmlMemBlocks() - mem_base);
6666             test_ret++;
6667             printf(" %d", n_ch);
6668             printf("\n");
6669         }
6670     }
6671     function_tests++;
6672
6673     return(test_ret);
6674 }
6675
6676
6677 static int
6678 test_xmlIsBlank(void) {
6679     int test_ret = 0;
6680
6681     int mem_base;
6682     int ret_val;
6683     unsigned int ch; /* character to validate */
6684     int n_ch;
6685
6686     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6687         mem_base = xmlMemBlocks();
6688         ch = gen_unsigned_int(n_ch, 0);
6689
6690         ret_val = xmlIsBlank(ch);
6691         desret_int(ret_val);
6692         call_tests++;
6693         des_unsigned_int(n_ch, ch, 0);
6694         xmlResetLastError();
6695         if (mem_base != xmlMemBlocks()) {
6696             printf("Leak of %d blocks found in xmlIsBlank",
6697                    xmlMemBlocks() - mem_base);
6698             test_ret++;
6699             printf(" %d", n_ch);
6700             printf("\n");
6701         }
6702     }
6703     function_tests++;
6704
6705     return(test_ret);
6706 }
6707
6708
6709 static int
6710 test_xmlIsChar(void) {
6711     int test_ret = 0;
6712
6713     int mem_base;
6714     int ret_val;
6715     unsigned int ch; /* character to validate */
6716     int n_ch;
6717
6718     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6719         mem_base = xmlMemBlocks();
6720         ch = gen_unsigned_int(n_ch, 0);
6721
6722         ret_val = xmlIsChar(ch);
6723         desret_int(ret_val);
6724         call_tests++;
6725         des_unsigned_int(n_ch, ch, 0);
6726         xmlResetLastError();
6727         if (mem_base != xmlMemBlocks()) {
6728             printf("Leak of %d blocks found in xmlIsChar",
6729                    xmlMemBlocks() - mem_base);
6730             test_ret++;
6731             printf(" %d", n_ch);
6732             printf("\n");
6733         }
6734     }
6735     function_tests++;
6736
6737     return(test_ret);
6738 }
6739
6740
6741 static int
6742 test_xmlIsCombining(void) {
6743     int test_ret = 0;
6744
6745     int mem_base;
6746     int ret_val;
6747     unsigned int ch; /* character to validate */
6748     int n_ch;
6749
6750     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6751         mem_base = xmlMemBlocks();
6752         ch = gen_unsigned_int(n_ch, 0);
6753
6754         ret_val = xmlIsCombining(ch);
6755         desret_int(ret_val);
6756         call_tests++;
6757         des_unsigned_int(n_ch, ch, 0);
6758         xmlResetLastError();
6759         if (mem_base != xmlMemBlocks()) {
6760             printf("Leak of %d blocks found in xmlIsCombining",
6761                    xmlMemBlocks() - mem_base);
6762             test_ret++;
6763             printf(" %d", n_ch);
6764             printf("\n");
6765         }
6766     }
6767     function_tests++;
6768
6769     return(test_ret);
6770 }
6771
6772
6773 static int
6774 test_xmlIsDigit(void) {
6775     int test_ret = 0;
6776
6777     int mem_base;
6778     int ret_val;
6779     unsigned int ch; /* character to validate */
6780     int n_ch;
6781
6782     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6783         mem_base = xmlMemBlocks();
6784         ch = gen_unsigned_int(n_ch, 0);
6785
6786         ret_val = xmlIsDigit(ch);
6787         desret_int(ret_val);
6788         call_tests++;
6789         des_unsigned_int(n_ch, ch, 0);
6790         xmlResetLastError();
6791         if (mem_base != xmlMemBlocks()) {
6792             printf("Leak of %d blocks found in xmlIsDigit",
6793                    xmlMemBlocks() - mem_base);
6794             test_ret++;
6795             printf(" %d", n_ch);
6796             printf("\n");
6797         }
6798     }
6799     function_tests++;
6800
6801     return(test_ret);
6802 }
6803
6804
6805 static int
6806 test_xmlIsExtender(void) {
6807     int test_ret = 0;
6808
6809     int mem_base;
6810     int ret_val;
6811     unsigned int ch; /* character to validate */
6812     int n_ch;
6813
6814     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6815         mem_base = xmlMemBlocks();
6816         ch = gen_unsigned_int(n_ch, 0);
6817
6818         ret_val = xmlIsExtender(ch);
6819         desret_int(ret_val);
6820         call_tests++;
6821         des_unsigned_int(n_ch, ch, 0);
6822         xmlResetLastError();
6823         if (mem_base != xmlMemBlocks()) {
6824             printf("Leak of %d blocks found in xmlIsExtender",
6825                    xmlMemBlocks() - mem_base);
6826             test_ret++;
6827             printf(" %d", n_ch);
6828             printf("\n");
6829         }
6830     }
6831     function_tests++;
6832
6833     return(test_ret);
6834 }
6835
6836
6837 static int
6838 test_xmlIsIdeographic(void) {
6839     int test_ret = 0;
6840
6841     int mem_base;
6842     int ret_val;
6843     unsigned int ch; /* character to validate */
6844     int n_ch;
6845
6846     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6847         mem_base = xmlMemBlocks();
6848         ch = gen_unsigned_int(n_ch, 0);
6849
6850         ret_val = xmlIsIdeographic(ch);
6851         desret_int(ret_val);
6852         call_tests++;
6853         des_unsigned_int(n_ch, ch, 0);
6854         xmlResetLastError();
6855         if (mem_base != xmlMemBlocks()) {
6856             printf("Leak of %d blocks found in xmlIsIdeographic",
6857                    xmlMemBlocks() - mem_base);
6858             test_ret++;
6859             printf(" %d", n_ch);
6860             printf("\n");
6861         }
6862     }
6863     function_tests++;
6864
6865     return(test_ret);
6866 }
6867
6868
6869 static int
6870 test_xmlIsPubidChar(void) {
6871     int test_ret = 0;
6872
6873     int mem_base;
6874     int ret_val;
6875     unsigned int ch; /* character to validate */
6876     int n_ch;
6877
6878     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6879         mem_base = xmlMemBlocks();
6880         ch = gen_unsigned_int(n_ch, 0);
6881
6882         ret_val = xmlIsPubidChar(ch);
6883         desret_int(ret_val);
6884         call_tests++;
6885         des_unsigned_int(n_ch, ch, 0);
6886         xmlResetLastError();
6887         if (mem_base != xmlMemBlocks()) {
6888             printf("Leak of %d blocks found in xmlIsPubidChar",
6889                    xmlMemBlocks() - mem_base);
6890             test_ret++;
6891             printf(" %d", n_ch);
6892             printf("\n");
6893         }
6894     }
6895     function_tests++;
6896
6897     return(test_ret);
6898 }
6899
6900 static int
6901 test_chvalid(void) {
6902     int test_ret = 0;
6903
6904     if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6905     test_ret += test_xmlCharInRange();
6906     test_ret += test_xmlIsBaseChar();
6907     test_ret += test_xmlIsBlank();
6908     test_ret += test_xmlIsChar();
6909     test_ret += test_xmlIsCombining();
6910     test_ret += test_xmlIsDigit();
6911     test_ret += test_xmlIsExtender();
6912     test_ret += test_xmlIsIdeographic();
6913     test_ret += test_xmlIsPubidChar();
6914
6915     if (test_ret != 0)
6916         printf("Module chvalid: %d errors\n", test_ret);
6917     return(test_ret);
6918 }
6919
6920 static int
6921 test_xmlBoolToText(void) {
6922     int test_ret = 0;
6923
6924 #if defined(LIBXML_DEBUG_ENABLED)
6925     int mem_base;
6926     const char * ret_val;
6927     int boolval; /* a bool to turn into text */
6928     int n_boolval;
6929
6930     for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6931         mem_base = xmlMemBlocks();
6932         boolval = gen_int(n_boolval, 0);
6933
6934         ret_val = xmlBoolToText(boolval);
6935         desret_const_char_ptr(ret_val);
6936         call_tests++;
6937         des_int(n_boolval, boolval, 0);
6938         xmlResetLastError();
6939         if (mem_base != xmlMemBlocks()) {
6940             printf("Leak of %d blocks found in xmlBoolToText",
6941                    xmlMemBlocks() - mem_base);
6942             test_ret++;
6943             printf(" %d", n_boolval);
6944             printf("\n");
6945         }
6946     }
6947     function_tests++;
6948 #endif
6949
6950     return(test_ret);
6951 }
6952
6953
6954 static int
6955 test_xmlDebugCheckDocument(void) {
6956     int test_ret = 0;
6957
6958 #if defined(LIBXML_DEBUG_ENABLED)
6959     int mem_base;
6960     int ret_val;
6961     FILE * output; /* the FILE * for the output */
6962     int n_output;
6963     xmlDocPtr doc; /* the document */
6964     int n_doc;
6965
6966     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6967     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6968         mem_base = xmlMemBlocks();
6969         output = gen_debug_FILE_ptr(n_output, 0);
6970         doc = gen_xmlDocPtr(n_doc, 1);
6971
6972         ret_val = xmlDebugCheckDocument(output, doc);
6973         desret_int(ret_val);
6974         call_tests++;
6975         des_debug_FILE_ptr(n_output, output, 0);
6976         des_xmlDocPtr(n_doc, doc, 1);
6977         xmlResetLastError();
6978         if (mem_base != xmlMemBlocks()) {
6979             printf("Leak of %d blocks found in xmlDebugCheckDocument",
6980                    xmlMemBlocks() - mem_base);
6981             test_ret++;
6982             printf(" %d", n_output);
6983             printf(" %d", n_doc);
6984             printf("\n");
6985         }
6986     }
6987     }
6988     function_tests++;
6989 #endif
6990
6991     return(test_ret);
6992 }
6993
6994
6995 static int
6996 test_xmlDebugDumpAttr(void) {
6997     int test_ret = 0;
6998
6999 #if defined(LIBXML_DEBUG_ENABLED)
7000     int mem_base;
7001     FILE * output; /* the FILE * for the output */
7002     int n_output;
7003     xmlAttrPtr attr; /* the attribute */
7004     int n_attr;
7005     int depth; /* the indentation level. */
7006     int n_depth;
7007
7008     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7009     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7010     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7011         mem_base = xmlMemBlocks();
7012         output = gen_debug_FILE_ptr(n_output, 0);
7013         attr = gen_xmlAttrPtr(n_attr, 1);
7014         depth = gen_int(n_depth, 2);
7015
7016         xmlDebugDumpAttr(output, attr, depth);
7017         call_tests++;
7018         des_debug_FILE_ptr(n_output, output, 0);
7019         des_xmlAttrPtr(n_attr, attr, 1);
7020         des_int(n_depth, depth, 2);
7021         xmlResetLastError();
7022         if (mem_base != xmlMemBlocks()) {
7023             printf("Leak of %d blocks found in xmlDebugDumpAttr",
7024                    xmlMemBlocks() - mem_base);
7025             test_ret++;
7026             printf(" %d", n_output);
7027             printf(" %d", n_attr);
7028             printf(" %d", n_depth);
7029             printf("\n");
7030         }
7031     }
7032     }
7033     }
7034     function_tests++;
7035 #endif
7036
7037     return(test_ret);
7038 }
7039
7040
7041 static int
7042 test_xmlDebugDumpAttrList(void) {
7043     int test_ret = 0;
7044
7045 #if defined(LIBXML_DEBUG_ENABLED)
7046     int mem_base;
7047     FILE * output; /* the FILE * for the output */
7048     int n_output;
7049     xmlAttrPtr attr; /* the attribute list */
7050     int n_attr;
7051     int depth; /* the indentation level. */
7052     int n_depth;
7053
7054     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7055     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7056     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7057         mem_base = xmlMemBlocks();
7058         output = gen_debug_FILE_ptr(n_output, 0);
7059         attr = gen_xmlAttrPtr(n_attr, 1);
7060         depth = gen_int(n_depth, 2);
7061
7062         xmlDebugDumpAttrList(output, attr, depth);
7063         call_tests++;
7064         des_debug_FILE_ptr(n_output, output, 0);
7065         des_xmlAttrPtr(n_attr, attr, 1);
7066         des_int(n_depth, depth, 2);
7067         xmlResetLastError();
7068         if (mem_base != xmlMemBlocks()) {
7069             printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7070                    xmlMemBlocks() - mem_base);
7071             test_ret++;
7072             printf(" %d", n_output);
7073             printf(" %d", n_attr);
7074             printf(" %d", n_depth);
7075             printf("\n");
7076         }
7077     }
7078     }
7079     }
7080     function_tests++;
7081 #endif
7082
7083     return(test_ret);
7084 }
7085
7086
7087 static int
7088 test_xmlDebugDumpDTD(void) {
7089     int test_ret = 0;
7090
7091 #if defined(LIBXML_DEBUG_ENABLED)
7092     int mem_base;
7093     FILE * output; /* the FILE * for the output */
7094     int n_output;
7095     xmlDtdPtr dtd; /* the DTD */
7096     int n_dtd;
7097
7098     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7099     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7100         mem_base = xmlMemBlocks();
7101         output = gen_debug_FILE_ptr(n_output, 0);
7102         dtd = gen_xmlDtdPtr(n_dtd, 1);
7103
7104         xmlDebugDumpDTD(output, dtd);
7105         call_tests++;
7106         des_debug_FILE_ptr(n_output, output, 0);
7107         des_xmlDtdPtr(n_dtd, dtd, 1);
7108         xmlResetLastError();
7109         if (mem_base != xmlMemBlocks()) {
7110             printf("Leak of %d blocks found in xmlDebugDumpDTD",
7111                    xmlMemBlocks() - mem_base);
7112             test_ret++;
7113             printf(" %d", n_output);
7114             printf(" %d", n_dtd);
7115             printf("\n");
7116         }
7117     }
7118     }
7119     function_tests++;
7120 #endif
7121
7122     return(test_ret);
7123 }
7124
7125
7126 static int
7127 test_xmlDebugDumpDocument(void) {
7128     int test_ret = 0;
7129
7130 #if defined(LIBXML_DEBUG_ENABLED)
7131     int mem_base;
7132     FILE * output; /* the FILE * for the output */
7133     int n_output;
7134     xmlDocPtr doc; /* the document */
7135     int n_doc;
7136
7137     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7138     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7139         mem_base = xmlMemBlocks();
7140         output = gen_debug_FILE_ptr(n_output, 0);
7141         doc = gen_xmlDocPtr(n_doc, 1);
7142
7143         xmlDebugDumpDocument(output, doc);
7144         call_tests++;
7145         des_debug_FILE_ptr(n_output, output, 0);
7146         des_xmlDocPtr(n_doc, doc, 1);
7147         xmlResetLastError();
7148         if (mem_base != xmlMemBlocks()) {
7149             printf("Leak of %d blocks found in xmlDebugDumpDocument",
7150                    xmlMemBlocks() - mem_base);
7151             test_ret++;
7152             printf(" %d", n_output);
7153             printf(" %d", n_doc);
7154             printf("\n");
7155         }
7156     }
7157     }
7158     function_tests++;
7159 #endif
7160
7161     return(test_ret);
7162 }
7163
7164
7165 static int
7166 test_xmlDebugDumpDocumentHead(void) {
7167     int test_ret = 0;
7168
7169 #if defined(LIBXML_DEBUG_ENABLED)
7170     int mem_base;
7171     FILE * output; /* the FILE * for the output */
7172     int n_output;
7173     xmlDocPtr doc; /* the document */
7174     int n_doc;
7175
7176     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7177     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7178         mem_base = xmlMemBlocks();
7179         output = gen_debug_FILE_ptr(n_output, 0);
7180         doc = gen_xmlDocPtr(n_doc, 1);
7181
7182         xmlDebugDumpDocumentHead(output, doc);
7183         call_tests++;
7184         des_debug_FILE_ptr(n_output, output, 0);
7185         des_xmlDocPtr(n_doc, doc, 1);
7186         xmlResetLastError();
7187         if (mem_base != xmlMemBlocks()) {
7188             printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7189                    xmlMemBlocks() - mem_base);
7190             test_ret++;
7191             printf(" %d", n_output);
7192             printf(" %d", n_doc);
7193             printf("\n");
7194         }
7195     }
7196     }
7197     function_tests++;
7198 #endif
7199
7200     return(test_ret);
7201 }
7202
7203
7204 static int
7205 test_xmlDebugDumpEntities(void) {
7206     int test_ret = 0;
7207
7208 #if defined(LIBXML_DEBUG_ENABLED)
7209     int mem_base;
7210     FILE * output; /* the FILE * for the output */
7211     int n_output;
7212     xmlDocPtr doc; /* the document */
7213     int n_doc;
7214
7215     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7216     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7217         mem_base = xmlMemBlocks();
7218         output = gen_debug_FILE_ptr(n_output, 0);
7219         doc = gen_xmlDocPtr(n_doc, 1);
7220
7221         xmlDebugDumpEntities(output, doc);
7222         call_tests++;
7223         des_debug_FILE_ptr(n_output, output, 0);
7224         des_xmlDocPtr(n_doc, doc, 1);
7225         xmlResetLastError();
7226         if (mem_base != xmlMemBlocks()) {
7227             printf("Leak of %d blocks found in xmlDebugDumpEntities",
7228                    xmlMemBlocks() - mem_base);
7229             test_ret++;
7230             printf(" %d", n_output);
7231             printf(" %d", n_doc);
7232             printf("\n");
7233         }
7234     }
7235     }
7236     function_tests++;
7237 #endif
7238
7239     return(test_ret);
7240 }
7241
7242
7243 static int
7244 test_xmlDebugDumpNode(void) {
7245     int test_ret = 0;
7246
7247 #if defined(LIBXML_DEBUG_ENABLED)
7248     int mem_base;
7249     FILE * output; /* the FILE * for the output */
7250     int n_output;
7251     xmlNodePtr node; /* the node */
7252     int n_node;
7253     int depth; /* the indentation level. */
7254     int n_depth;
7255
7256     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7257     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7258     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7259         mem_base = xmlMemBlocks();
7260         output = gen_debug_FILE_ptr(n_output, 0);
7261         node = gen_xmlNodePtr(n_node, 1);
7262         depth = gen_int(n_depth, 2);
7263
7264         xmlDebugDumpNode(output, node, depth);
7265         call_tests++;
7266         des_debug_FILE_ptr(n_output, output, 0);
7267         des_xmlNodePtr(n_node, node, 1);
7268         des_int(n_depth, depth, 2);
7269         xmlResetLastError();
7270         if (mem_base != xmlMemBlocks()) {
7271             printf("Leak of %d blocks found in xmlDebugDumpNode",
7272                    xmlMemBlocks() - mem_base);
7273             test_ret++;
7274             printf(" %d", n_output);
7275             printf(" %d", n_node);
7276             printf(" %d", n_depth);
7277             printf("\n");
7278         }
7279     }
7280     }
7281     }
7282     function_tests++;
7283 #endif
7284
7285     return(test_ret);
7286 }
7287
7288
7289 static int
7290 test_xmlDebugDumpNodeList(void) {
7291     int test_ret = 0;
7292
7293 #if defined(LIBXML_DEBUG_ENABLED)
7294     int mem_base;
7295     FILE * output; /* the FILE * for the output */
7296     int n_output;
7297     xmlNodePtr node; /* the node list */
7298     int n_node;
7299     int depth; /* the indentation level. */
7300     int n_depth;
7301
7302     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7303     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7304     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7305         mem_base = xmlMemBlocks();
7306         output = gen_debug_FILE_ptr(n_output, 0);
7307         node = gen_xmlNodePtr(n_node, 1);
7308         depth = gen_int(n_depth, 2);
7309
7310         xmlDebugDumpNodeList(output, node, depth);
7311         call_tests++;
7312         des_debug_FILE_ptr(n_output, output, 0);
7313         des_xmlNodePtr(n_node, node, 1);
7314         des_int(n_depth, depth, 2);
7315         xmlResetLastError();
7316         if (mem_base != xmlMemBlocks()) {
7317             printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7318                    xmlMemBlocks() - mem_base);
7319             test_ret++;
7320             printf(" %d", n_output);
7321             printf(" %d", n_node);
7322             printf(" %d", n_depth);
7323             printf("\n");
7324         }
7325     }
7326     }
7327     }
7328     function_tests++;
7329 #endif
7330
7331     return(test_ret);
7332 }
7333
7334
7335 static int
7336 test_xmlDebugDumpOneNode(void) {
7337     int test_ret = 0;
7338
7339 #if defined(LIBXML_DEBUG_ENABLED)
7340     int mem_base;
7341     FILE * output; /* the FILE * for the output */
7342     int n_output;
7343     xmlNodePtr node; /* the node */
7344     int n_node;
7345     int depth; /* the indentation level. */
7346     int n_depth;
7347
7348     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7349     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7350     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7351         mem_base = xmlMemBlocks();
7352         output = gen_debug_FILE_ptr(n_output, 0);
7353         node = gen_xmlNodePtr(n_node, 1);
7354         depth = gen_int(n_depth, 2);
7355
7356         xmlDebugDumpOneNode(output, node, depth);
7357         call_tests++;
7358         des_debug_FILE_ptr(n_output, output, 0);
7359         des_xmlNodePtr(n_node, node, 1);
7360         des_int(n_depth, depth, 2);
7361         xmlResetLastError();
7362         if (mem_base != xmlMemBlocks()) {
7363             printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7364                    xmlMemBlocks() - mem_base);
7365             test_ret++;
7366             printf(" %d", n_output);
7367             printf(" %d", n_node);
7368             printf(" %d", n_depth);
7369             printf("\n");
7370         }
7371     }
7372     }
7373     }
7374     function_tests++;
7375 #endif
7376
7377     return(test_ret);
7378 }
7379
7380
7381 static int
7382 test_xmlDebugDumpString(void) {
7383     int test_ret = 0;
7384
7385 #if defined(LIBXML_DEBUG_ENABLED)
7386     int mem_base;
7387     FILE * output; /* the FILE * for the output */
7388     int n_output;
7389     xmlChar * str; /* the string */
7390     int n_str;
7391
7392     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7393     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7394         mem_base = xmlMemBlocks();
7395         output = gen_debug_FILE_ptr(n_output, 0);
7396         str = gen_const_xmlChar_ptr(n_str, 1);
7397
7398         xmlDebugDumpString(output, (const xmlChar *)str);
7399         call_tests++;
7400         des_debug_FILE_ptr(n_output, output, 0);
7401         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7402         xmlResetLastError();
7403         if (mem_base != xmlMemBlocks()) {
7404             printf("Leak of %d blocks found in xmlDebugDumpString",
7405                    xmlMemBlocks() - mem_base);
7406             test_ret++;
7407             printf(" %d", n_output);
7408             printf(" %d", n_str);
7409             printf("\n");
7410         }
7411     }
7412     }
7413     function_tests++;
7414 #endif
7415
7416     return(test_ret);
7417 }
7418
7419
7420 static int
7421 test_xmlLsCountNode(void) {
7422     int test_ret = 0;
7423
7424 #if defined(LIBXML_DEBUG_ENABLED)
7425     int mem_base;
7426     int ret_val;
7427     xmlNodePtr node; /* the node to count */
7428     int n_node;
7429
7430     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7431         mem_base = xmlMemBlocks();
7432         node = gen_xmlNodePtr(n_node, 0);
7433
7434         ret_val = xmlLsCountNode(node);
7435         desret_int(ret_val);
7436         call_tests++;
7437         des_xmlNodePtr(n_node, node, 0);
7438         xmlResetLastError();
7439         if (mem_base != xmlMemBlocks()) {
7440             printf("Leak of %d blocks found in xmlLsCountNode",
7441                    xmlMemBlocks() - mem_base);
7442             test_ret++;
7443             printf(" %d", n_node);
7444             printf("\n");
7445         }
7446     }
7447     function_tests++;
7448 #endif
7449
7450     return(test_ret);
7451 }
7452
7453
7454 static int
7455 test_xmlLsOneNode(void) {
7456     int test_ret = 0;
7457
7458 #if defined(LIBXML_DEBUG_ENABLED)
7459     int mem_base;
7460     FILE * output; /* the FILE * for the output */
7461     int n_output;
7462     xmlNodePtr node; /* the node to dump */
7463     int n_node;
7464
7465     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7466     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7467         mem_base = xmlMemBlocks();
7468         output = gen_debug_FILE_ptr(n_output, 0);
7469         node = gen_xmlNodePtr(n_node, 1);
7470
7471         xmlLsOneNode(output, node);
7472         call_tests++;
7473         des_debug_FILE_ptr(n_output, output, 0);
7474         des_xmlNodePtr(n_node, node, 1);
7475         xmlResetLastError();
7476         if (mem_base != xmlMemBlocks()) {
7477             printf("Leak of %d blocks found in xmlLsOneNode",
7478                    xmlMemBlocks() - mem_base);
7479             test_ret++;
7480             printf(" %d", n_output);
7481             printf(" %d", n_node);
7482             printf("\n");
7483         }
7484     }
7485     }
7486     function_tests++;
7487 #endif
7488
7489     return(test_ret);
7490 }
7491
7492
7493 #define gen_nb_char_ptr 1
7494 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7495     return(NULL);
7496 }
7497 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7498 }
7499
7500 static int
7501 test_xmlShell(void) {
7502     int test_ret = 0;
7503
7504
7505     /* missing type support */
7506     return(test_ret);
7507 }
7508
7509
7510 static int
7511 test_xmlShellBase(void) {
7512     int test_ret = 0;
7513
7514 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7515     int mem_base;
7516     int ret_val;
7517     xmlShellCtxtPtr ctxt; /* the shell context */
7518     int n_ctxt;
7519     char * arg; /* unused */
7520     int n_arg;
7521     xmlNodePtr node; /* a node */
7522     int n_node;
7523     xmlNodePtr node2; /* unused */
7524     int n_node2;
7525
7526     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7527     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7528     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7529     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7530         mem_base = xmlMemBlocks();
7531         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7532         arg = gen_char_ptr(n_arg, 1);
7533         node = gen_xmlNodePtr(n_node, 2);
7534         node2 = gen_xmlNodePtr(n_node2, 3);
7535
7536         ret_val = xmlShellBase(ctxt, arg, node, node2);
7537         desret_int(ret_val);
7538         call_tests++;
7539         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7540         des_char_ptr(n_arg, arg, 1);
7541         des_xmlNodePtr(n_node, node, 2);
7542         des_xmlNodePtr(n_node2, node2, 3);
7543         xmlResetLastError();
7544         if (mem_base != xmlMemBlocks()) {
7545             printf("Leak of %d blocks found in xmlShellBase",
7546                    xmlMemBlocks() - mem_base);
7547             test_ret++;
7548             printf(" %d", n_ctxt);
7549             printf(" %d", n_arg);
7550             printf(" %d", n_node);
7551             printf(" %d", n_node2);
7552             printf("\n");
7553         }
7554     }
7555     }
7556     }
7557     }
7558     function_tests++;
7559 #endif
7560
7561     return(test_ret);
7562 }
7563
7564
7565 static int
7566 test_xmlShellCat(void) {
7567     int test_ret = 0;
7568
7569 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7570     int mem_base;
7571     int ret_val;
7572     xmlShellCtxtPtr ctxt; /* the shell context */
7573     int n_ctxt;
7574     char * arg; /* unused */
7575     int n_arg;
7576     xmlNodePtr node; /* a node */
7577     int n_node;
7578     xmlNodePtr node2; /* unused */
7579     int n_node2;
7580
7581     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7582     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7583     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7584     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7585         mem_base = xmlMemBlocks();
7586         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7587         arg = gen_char_ptr(n_arg, 1);
7588         node = gen_xmlNodePtr(n_node, 2);
7589         node2 = gen_xmlNodePtr(n_node2, 3);
7590
7591         ret_val = xmlShellCat(ctxt, arg, node, node2);
7592         desret_int(ret_val);
7593         call_tests++;
7594         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7595         des_char_ptr(n_arg, arg, 1);
7596         des_xmlNodePtr(n_node, node, 2);
7597         des_xmlNodePtr(n_node2, node2, 3);
7598         xmlResetLastError();
7599         if (mem_base != xmlMemBlocks()) {
7600             printf("Leak of %d blocks found in xmlShellCat",
7601                    xmlMemBlocks() - mem_base);
7602             test_ret++;
7603             printf(" %d", n_ctxt);
7604             printf(" %d", n_arg);
7605             printf(" %d", n_node);
7606             printf(" %d", n_node2);
7607             printf("\n");
7608         }
7609     }
7610     }
7611     }
7612     }
7613     function_tests++;
7614 #endif
7615
7616     return(test_ret);
7617 }
7618
7619
7620 static int
7621 test_xmlShellDir(void) {
7622     int test_ret = 0;
7623
7624 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7625     int mem_base;
7626     int ret_val;
7627     xmlShellCtxtPtr ctxt; /* the shell context */
7628     int n_ctxt;
7629     char * arg; /* unused */
7630     int n_arg;
7631     xmlNodePtr node; /* a node */
7632     int n_node;
7633     xmlNodePtr node2; /* unused */
7634     int n_node2;
7635
7636     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7637     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7638     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7639     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7640         mem_base = xmlMemBlocks();
7641         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7642         arg = gen_char_ptr(n_arg, 1);
7643         node = gen_xmlNodePtr(n_node, 2);
7644         node2 = gen_xmlNodePtr(n_node2, 3);
7645
7646         ret_val = xmlShellDir(ctxt, arg, node, node2);
7647         desret_int(ret_val);
7648         call_tests++;
7649         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7650         des_char_ptr(n_arg, arg, 1);
7651         des_xmlNodePtr(n_node, node, 2);
7652         des_xmlNodePtr(n_node2, node2, 3);
7653         xmlResetLastError();
7654         if (mem_base != xmlMemBlocks()) {
7655             printf("Leak of %d blocks found in xmlShellDir",
7656                    xmlMemBlocks() - mem_base);
7657             test_ret++;
7658             printf(" %d", n_ctxt);
7659             printf(" %d", n_arg);
7660             printf(" %d", n_node);
7661             printf(" %d", n_node2);
7662             printf("\n");
7663         }
7664     }
7665     }
7666     }
7667     }
7668     function_tests++;
7669 #endif
7670
7671     return(test_ret);
7672 }
7673
7674
7675 static int
7676 test_xmlShellDu(void) {
7677     int test_ret = 0;
7678
7679 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7680     int mem_base;
7681     int ret_val;
7682     xmlShellCtxtPtr ctxt; /* the shell context */
7683     int n_ctxt;
7684     char * arg; /* unused */
7685     int n_arg;
7686     xmlNodePtr tree; /* a node defining a subtree */
7687     int n_tree;
7688     xmlNodePtr node2; /* unused */
7689     int n_node2;
7690
7691     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7692     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7693     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7694     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7695         mem_base = xmlMemBlocks();
7696         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7697         arg = gen_char_ptr(n_arg, 1);
7698         tree = gen_xmlNodePtr(n_tree, 2);
7699         node2 = gen_xmlNodePtr(n_node2, 3);
7700
7701         ret_val = xmlShellDu(ctxt, arg, tree, node2);
7702         desret_int(ret_val);
7703         call_tests++;
7704         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7705         des_char_ptr(n_arg, arg, 1);
7706         des_xmlNodePtr(n_tree, tree, 2);
7707         des_xmlNodePtr(n_node2, node2, 3);
7708         xmlResetLastError();
7709         if (mem_base != xmlMemBlocks()) {
7710             printf("Leak of %d blocks found in xmlShellDu",
7711                    xmlMemBlocks() - mem_base);
7712             test_ret++;
7713             printf(" %d", n_ctxt);
7714             printf(" %d", n_arg);
7715             printf(" %d", n_tree);
7716             printf(" %d", n_node2);
7717             printf("\n");
7718         }
7719     }
7720     }
7721     }
7722     }
7723     function_tests++;
7724 #endif
7725
7726     return(test_ret);
7727 }
7728
7729
7730 static int
7731 test_xmlShellList(void) {
7732     int test_ret = 0;
7733
7734 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7735     int mem_base;
7736     int ret_val;
7737     xmlShellCtxtPtr ctxt; /* the shell context */
7738     int n_ctxt;
7739     char * arg; /* unused */
7740     int n_arg;
7741     xmlNodePtr node; /* a node */
7742     int n_node;
7743     xmlNodePtr node2; /* unused */
7744     int n_node2;
7745
7746     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7747     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7748     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7749     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7750         mem_base = xmlMemBlocks();
7751         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7752         arg = gen_char_ptr(n_arg, 1);
7753         node = gen_xmlNodePtr(n_node, 2);
7754         node2 = gen_xmlNodePtr(n_node2, 3);
7755
7756         ret_val = xmlShellList(ctxt, arg, node, node2);
7757         desret_int(ret_val);
7758         call_tests++;
7759         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7760         des_char_ptr(n_arg, arg, 1);
7761         des_xmlNodePtr(n_node, node, 2);
7762         des_xmlNodePtr(n_node2, node2, 3);
7763         xmlResetLastError();
7764         if (mem_base != xmlMemBlocks()) {
7765             printf("Leak of %d blocks found in xmlShellList",
7766                    xmlMemBlocks() - mem_base);
7767             test_ret++;
7768             printf(" %d", n_ctxt);
7769             printf(" %d", n_arg);
7770             printf(" %d", n_node);
7771             printf(" %d", n_node2);
7772             printf("\n");
7773         }
7774     }
7775     }
7776     }
7777     }
7778     function_tests++;
7779 #endif
7780
7781     return(test_ret);
7782 }
7783
7784
7785 static int
7786 test_xmlShellLoad(void) {
7787     int test_ret = 0;
7788
7789 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7790     int mem_base;
7791     int ret_val;
7792     xmlShellCtxtPtr ctxt; /* the shell context */
7793     int n_ctxt;
7794     char * filename; /* the file name */
7795     int n_filename;
7796     xmlNodePtr node; /* unused */
7797     int n_node;
7798     xmlNodePtr node2; /* unused */
7799     int n_node2;
7800
7801     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7802     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7803     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7804     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7805         mem_base = xmlMemBlocks();
7806         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7807         filename = gen_char_ptr(n_filename, 1);
7808         node = gen_xmlNodePtr(n_node, 2);
7809         node2 = gen_xmlNodePtr(n_node2, 3);
7810
7811         ret_val = xmlShellLoad(ctxt, filename, node, node2);
7812         desret_int(ret_val);
7813         call_tests++;
7814         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7815         des_char_ptr(n_filename, filename, 1);
7816         des_xmlNodePtr(n_node, node, 2);
7817         des_xmlNodePtr(n_node2, node2, 3);
7818         xmlResetLastError();
7819         if (mem_base != xmlMemBlocks()) {
7820             printf("Leak of %d blocks found in xmlShellLoad",
7821                    xmlMemBlocks() - mem_base);
7822             test_ret++;
7823             printf(" %d", n_ctxt);
7824             printf(" %d", n_filename);
7825             printf(" %d", n_node);
7826             printf(" %d", n_node2);
7827             printf("\n");
7828         }
7829     }
7830     }
7831     }
7832     }
7833     function_tests++;
7834 #endif
7835
7836     return(test_ret);
7837 }
7838
7839
7840 static int
7841 test_xmlShellPrintXPathResult(void) {
7842     int test_ret = 0;
7843
7844 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7845     int mem_base;
7846     xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7847     int n_list;
7848
7849     for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7850         mem_base = xmlMemBlocks();
7851         list = gen_xmlXPathObjectPtr(n_list, 0);
7852
7853         xmlShellPrintXPathResult(list);
7854         call_tests++;
7855         des_xmlXPathObjectPtr(n_list, list, 0);
7856         xmlResetLastError();
7857         if (mem_base != xmlMemBlocks()) {
7858             printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7859                    xmlMemBlocks() - mem_base);
7860             test_ret++;
7861             printf(" %d", n_list);
7862             printf("\n");
7863         }
7864     }
7865     function_tests++;
7866 #endif
7867
7868     return(test_ret);
7869 }
7870
7871
7872 static int
7873 test_xmlShellPwd(void) {
7874     int test_ret = 0;
7875
7876 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7877     int mem_base;
7878     int ret_val;
7879     xmlShellCtxtPtr ctxt; /* the shell context */
7880     int n_ctxt;
7881     char * buffer; /* the output buffer */
7882     int n_buffer;
7883     xmlNodePtr node; /* a node */
7884     int n_node;
7885     xmlNodePtr node2; /* unused */
7886     int n_node2;
7887
7888     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7889     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7890     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7891     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7892         mem_base = xmlMemBlocks();
7893         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7894         buffer = gen_char_ptr(n_buffer, 1);
7895         node = gen_xmlNodePtr(n_node, 2);
7896         node2 = gen_xmlNodePtr(n_node2, 3);
7897
7898         ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7899         desret_int(ret_val);
7900         call_tests++;
7901         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7902         des_char_ptr(n_buffer, buffer, 1);
7903         des_xmlNodePtr(n_node, node, 2);
7904         des_xmlNodePtr(n_node2, node2, 3);
7905         xmlResetLastError();
7906         if (mem_base != xmlMemBlocks()) {
7907             printf("Leak of %d blocks found in xmlShellPwd",
7908                    xmlMemBlocks() - mem_base);
7909             test_ret++;
7910             printf(" %d", n_ctxt);
7911             printf(" %d", n_buffer);
7912             printf(" %d", n_node);
7913             printf(" %d", n_node2);
7914             printf("\n");
7915         }
7916     }
7917     }
7918     }
7919     }
7920     function_tests++;
7921 #endif
7922
7923     return(test_ret);
7924 }
7925
7926
7927 static int
7928 test_xmlShellSave(void) {
7929     int test_ret = 0;
7930
7931 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7932     int mem_base;
7933     int ret_val;
7934     xmlShellCtxtPtr ctxt; /* the shell context */
7935     int n_ctxt;
7936     char * filename; /* the file name (optional) */
7937     int n_filename;
7938     xmlNodePtr node; /* unused */
7939     int n_node;
7940     xmlNodePtr node2; /* unused */
7941     int n_node2;
7942
7943     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7944     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7945     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7946     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7947         mem_base = xmlMemBlocks();
7948         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7949         filename = gen_char_ptr(n_filename, 1);
7950         node = gen_xmlNodePtr(n_node, 2);
7951         node2 = gen_xmlNodePtr(n_node2, 3);
7952
7953         ret_val = xmlShellSave(ctxt, filename, node, node2);
7954         desret_int(ret_val);
7955         call_tests++;
7956         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7957         des_char_ptr(n_filename, filename, 1);
7958         des_xmlNodePtr(n_node, node, 2);
7959         des_xmlNodePtr(n_node2, node2, 3);
7960         xmlResetLastError();
7961         if (mem_base != xmlMemBlocks()) {
7962             printf("Leak of %d blocks found in xmlShellSave",
7963                    xmlMemBlocks() - mem_base);
7964             test_ret++;
7965             printf(" %d", n_ctxt);
7966             printf(" %d", n_filename);
7967             printf(" %d", n_node);
7968             printf(" %d", n_node2);
7969             printf("\n");
7970         }
7971     }
7972     }
7973     }
7974     }
7975     function_tests++;
7976 #endif
7977
7978     return(test_ret);
7979 }
7980
7981
7982 static int
7983 test_xmlShellValidate(void) {
7984     int test_ret = 0;
7985
7986 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7987     int mem_base;
7988     int ret_val;
7989     xmlShellCtxtPtr ctxt; /* the shell context */
7990     int n_ctxt;
7991     char * dtd; /* the DTD URI (optional) */
7992     int n_dtd;
7993     xmlNodePtr node; /* unused */
7994     int n_node;
7995     xmlNodePtr node2; /* unused */
7996     int n_node2;
7997
7998     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7999     for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8000     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8001     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8002         mem_base = xmlMemBlocks();
8003         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8004         dtd = gen_char_ptr(n_dtd, 1);
8005         node = gen_xmlNodePtr(n_node, 2);
8006         node2 = gen_xmlNodePtr(n_node2, 3);
8007
8008         ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8009         desret_int(ret_val);
8010         call_tests++;
8011         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8012         des_char_ptr(n_dtd, dtd, 1);
8013         des_xmlNodePtr(n_node, node, 2);
8014         des_xmlNodePtr(n_node2, node2, 3);
8015         xmlResetLastError();
8016         if (mem_base != xmlMemBlocks()) {
8017             printf("Leak of %d blocks found in xmlShellValidate",
8018                    xmlMemBlocks() - mem_base);
8019             test_ret++;
8020             printf(" %d", n_ctxt);
8021             printf(" %d", n_dtd);
8022             printf(" %d", n_node);
8023             printf(" %d", n_node2);
8024             printf("\n");
8025         }
8026     }
8027     }
8028     }
8029     }
8030     function_tests++;
8031 #endif
8032
8033     return(test_ret);
8034 }
8035
8036
8037 static int
8038 test_xmlShellWrite(void) {
8039     int test_ret = 0;
8040
8041 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8042     int mem_base;
8043     int ret_val;
8044     xmlShellCtxtPtr ctxt; /* the shell context */
8045     int n_ctxt;
8046     char * filename; /* the file name */
8047     int n_filename;
8048     xmlNodePtr node; /* a node in the tree */
8049     int n_node;
8050     xmlNodePtr node2; /* unused */
8051     int n_node2;
8052
8053     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8054     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8055     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8056     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8057         mem_base = xmlMemBlocks();
8058         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8059         filename = gen_char_ptr(n_filename, 1);
8060         node = gen_xmlNodePtr(n_node, 2);
8061         node2 = gen_xmlNodePtr(n_node2, 3);
8062
8063         ret_val = xmlShellWrite(ctxt, filename, node, node2);
8064         desret_int(ret_val);
8065         call_tests++;
8066         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8067         des_char_ptr(n_filename, filename, 1);
8068         des_xmlNodePtr(n_node, node, 2);
8069         des_xmlNodePtr(n_node2, node2, 3);
8070         xmlResetLastError();
8071         if (mem_base != xmlMemBlocks()) {
8072             printf("Leak of %d blocks found in xmlShellWrite",
8073                    xmlMemBlocks() - mem_base);
8074             test_ret++;
8075             printf(" %d", n_ctxt);
8076             printf(" %d", n_filename);
8077             printf(" %d", n_node);
8078             printf(" %d", n_node2);
8079             printf("\n");
8080         }
8081     }
8082     }
8083     }
8084     }
8085     function_tests++;
8086 #endif
8087
8088     return(test_ret);
8089 }
8090
8091 static int
8092 test_debugXML(void) {
8093     int test_ret = 0;
8094
8095     if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8096     test_ret += test_xmlBoolToText();
8097     test_ret += test_xmlDebugCheckDocument();
8098     test_ret += test_xmlDebugDumpAttr();
8099     test_ret += test_xmlDebugDumpAttrList();
8100     test_ret += test_xmlDebugDumpDTD();
8101     test_ret += test_xmlDebugDumpDocument();
8102     test_ret += test_xmlDebugDumpDocumentHead();
8103     test_ret += test_xmlDebugDumpEntities();
8104     test_ret += test_xmlDebugDumpNode();
8105     test_ret += test_xmlDebugDumpNodeList();
8106     test_ret += test_xmlDebugDumpOneNode();
8107     test_ret += test_xmlDebugDumpString();
8108     test_ret += test_xmlLsCountNode();
8109     test_ret += test_xmlLsOneNode();
8110     test_ret += test_xmlShell();
8111     test_ret += test_xmlShellBase();
8112     test_ret += test_xmlShellCat();
8113     test_ret += test_xmlShellDir();
8114     test_ret += test_xmlShellDu();
8115     test_ret += test_xmlShellList();
8116     test_ret += test_xmlShellLoad();
8117     test_ret += test_xmlShellPrintXPathResult();
8118     test_ret += test_xmlShellPwd();
8119     test_ret += test_xmlShellSave();
8120     test_ret += test_xmlShellValidate();
8121     test_ret += test_xmlShellWrite();
8122
8123     if (test_ret != 0)
8124         printf("Module debugXML: %d errors\n", test_ret);
8125     return(test_ret);
8126 }
8127
8128 static int
8129 test_xmlDictCleanup(void) {
8130     int test_ret = 0;
8131
8132     int mem_base;
8133
8134         mem_base = xmlMemBlocks();
8135
8136         xmlDictCleanup();
8137         call_tests++;
8138         xmlResetLastError();
8139         if (mem_base != xmlMemBlocks()) {
8140             printf("Leak of %d blocks found in xmlDictCleanup",
8141                    xmlMemBlocks() - mem_base);
8142             test_ret++;
8143             printf("\n");
8144         }
8145     function_tests++;
8146
8147     return(test_ret);
8148 }
8149
8150
8151 static int
8152 test_xmlDictCreate(void) {
8153     int test_ret = 0;
8154
8155     int mem_base;
8156     xmlDictPtr ret_val;
8157
8158         mem_base = xmlMemBlocks();
8159
8160         ret_val = xmlDictCreate();
8161         desret_xmlDictPtr(ret_val);
8162         call_tests++;
8163         xmlResetLastError();
8164         if (mem_base != xmlMemBlocks()) {
8165             printf("Leak of %d blocks found in xmlDictCreate",
8166                    xmlMemBlocks() - mem_base);
8167             test_ret++;
8168             printf("\n");
8169         }
8170     function_tests++;
8171
8172     return(test_ret);
8173 }
8174
8175
8176 static int
8177 test_xmlDictCreateSub(void) {
8178     int test_ret = 0;
8179
8180     int mem_base;
8181     xmlDictPtr ret_val;
8182     xmlDictPtr sub; /* an existing dictionnary */
8183     int n_sub;
8184
8185     for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8186         mem_base = xmlMemBlocks();
8187         sub = gen_xmlDictPtr(n_sub, 0);
8188
8189         ret_val = xmlDictCreateSub(sub);
8190         desret_xmlDictPtr(ret_val);
8191         call_tests++;
8192         des_xmlDictPtr(n_sub, sub, 0);
8193         xmlResetLastError();
8194         if (mem_base != xmlMemBlocks()) {
8195             printf("Leak of %d blocks found in xmlDictCreateSub",
8196                    xmlMemBlocks() - mem_base);
8197             test_ret++;
8198             printf(" %d", n_sub);
8199             printf("\n");
8200         }
8201     }
8202     function_tests++;
8203
8204     return(test_ret);
8205 }
8206
8207
8208 static int
8209 test_xmlDictExists(void) {
8210     int test_ret = 0;
8211
8212     int mem_base;
8213     const xmlChar * ret_val;
8214     xmlDictPtr dict; /* the dictionnary */
8215     int n_dict;
8216     xmlChar * name; /* the name of the userdata */
8217     int n_name;
8218     int len; /* the length of the name, if -1 it is recomputed */
8219     int n_len;
8220
8221     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8222     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8223     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8224         mem_base = xmlMemBlocks();
8225         dict = gen_xmlDictPtr(n_dict, 0);
8226         name = gen_const_xmlChar_ptr(n_name, 1);
8227         len = gen_int(n_len, 2);
8228
8229         ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8230         desret_const_xmlChar_ptr(ret_val);
8231         call_tests++;
8232         des_xmlDictPtr(n_dict, dict, 0);
8233         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8234         des_int(n_len, len, 2);
8235         xmlResetLastError();
8236         if (mem_base != xmlMemBlocks()) {
8237             printf("Leak of %d blocks found in xmlDictExists",
8238                    xmlMemBlocks() - mem_base);
8239             test_ret++;
8240             printf(" %d", n_dict);
8241             printf(" %d", n_name);
8242             printf(" %d", n_len);
8243             printf("\n");
8244         }
8245     }
8246     }
8247     }
8248     function_tests++;
8249
8250     return(test_ret);
8251 }
8252
8253
8254 static int
8255 test_xmlDictLookup(void) {
8256     int test_ret = 0;
8257
8258     int mem_base;
8259     const xmlChar * ret_val;
8260     xmlDictPtr dict; /* the dictionnary */
8261     int n_dict;
8262     xmlChar * name; /* the name of the userdata */
8263     int n_name;
8264     int len; /* the length of the name, if -1 it is recomputed */
8265     int n_len;
8266
8267     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8268     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8269     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8270         mem_base = xmlMemBlocks();
8271         dict = gen_xmlDictPtr(n_dict, 0);
8272         name = gen_const_xmlChar_ptr(n_name, 1);
8273         len = gen_int(n_len, 2);
8274
8275         ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8276         desret_const_xmlChar_ptr(ret_val);
8277         call_tests++;
8278         des_xmlDictPtr(n_dict, dict, 0);
8279         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8280         des_int(n_len, len, 2);
8281         xmlResetLastError();
8282         if (mem_base != xmlMemBlocks()) {
8283             printf("Leak of %d blocks found in xmlDictLookup",
8284                    xmlMemBlocks() - mem_base);
8285             test_ret++;
8286             printf(" %d", n_dict);
8287             printf(" %d", n_name);
8288             printf(" %d", n_len);
8289             printf("\n");
8290         }
8291     }
8292     }
8293     }
8294     function_tests++;
8295
8296     return(test_ret);
8297 }
8298
8299
8300 static int
8301 test_xmlDictOwns(void) {
8302     int test_ret = 0;
8303
8304     int mem_base;
8305     int ret_val;
8306     xmlDictPtr dict; /* the dictionnary */
8307     int n_dict;
8308     xmlChar * str; /* the string */
8309     int n_str;
8310
8311     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8312     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8313         mem_base = xmlMemBlocks();
8314         dict = gen_xmlDictPtr(n_dict, 0);
8315         str = gen_const_xmlChar_ptr(n_str, 1);
8316
8317         ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8318         desret_int(ret_val);
8319         call_tests++;
8320         des_xmlDictPtr(n_dict, dict, 0);
8321         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8322         xmlResetLastError();
8323         if (mem_base != xmlMemBlocks()) {
8324             printf("Leak of %d blocks found in xmlDictOwns",
8325                    xmlMemBlocks() - mem_base);
8326             test_ret++;
8327             printf(" %d", n_dict);
8328             printf(" %d", n_str);
8329             printf("\n");
8330         }
8331     }
8332     }
8333     function_tests++;
8334
8335     return(test_ret);
8336 }
8337
8338
8339 static int
8340 test_xmlDictQLookup(void) {
8341     int test_ret = 0;
8342
8343     int mem_base;
8344     const xmlChar * ret_val;
8345     xmlDictPtr dict; /* the dictionnary */
8346     int n_dict;
8347     xmlChar * prefix; /* the prefix */
8348     int n_prefix;
8349     xmlChar * name; /* the name */
8350     int n_name;
8351
8352     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8353     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8354     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8355         mem_base = xmlMemBlocks();
8356         dict = gen_xmlDictPtr(n_dict, 0);
8357         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8358         name = gen_const_xmlChar_ptr(n_name, 2);
8359
8360         ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8361         desret_const_xmlChar_ptr(ret_val);
8362         call_tests++;
8363         des_xmlDictPtr(n_dict, dict, 0);
8364         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8365         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8366         xmlResetLastError();
8367         if (mem_base != xmlMemBlocks()) {
8368             printf("Leak of %d blocks found in xmlDictQLookup",
8369                    xmlMemBlocks() - mem_base);
8370             test_ret++;
8371             printf(" %d", n_dict);
8372             printf(" %d", n_prefix);
8373             printf(" %d", n_name);
8374             printf("\n");
8375         }
8376     }
8377     }
8378     }
8379     function_tests++;
8380
8381     return(test_ret);
8382 }
8383
8384
8385 static int
8386 test_xmlDictReference(void) {
8387     int test_ret = 0;
8388
8389     int mem_base;
8390     int ret_val;
8391     xmlDictPtr dict; /* the dictionnary */
8392     int n_dict;
8393
8394     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8395         mem_base = xmlMemBlocks();
8396         dict = gen_xmlDictPtr(n_dict, 0);
8397
8398         ret_val = xmlDictReference(dict);
8399         xmlDictFree(dict);
8400         desret_int(ret_val);
8401         call_tests++;
8402         des_xmlDictPtr(n_dict, dict, 0);
8403         xmlResetLastError();
8404         if (mem_base != xmlMemBlocks()) {
8405             printf("Leak of %d blocks found in xmlDictReference",
8406                    xmlMemBlocks() - mem_base);
8407             test_ret++;
8408             printf(" %d", n_dict);
8409             printf("\n");
8410         }
8411     }
8412     function_tests++;
8413
8414     return(test_ret);
8415 }
8416
8417
8418 static int
8419 test_xmlDictSize(void) {
8420     int test_ret = 0;
8421
8422     int mem_base;
8423     int ret_val;
8424     xmlDictPtr dict; /* the dictionnary */
8425     int n_dict;
8426
8427     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8428         mem_base = xmlMemBlocks();
8429         dict = gen_xmlDictPtr(n_dict, 0);
8430
8431         ret_val = xmlDictSize(dict);
8432         desret_int(ret_val);
8433         call_tests++;
8434         des_xmlDictPtr(n_dict, dict, 0);
8435         xmlResetLastError();
8436         if (mem_base != xmlMemBlocks()) {
8437             printf("Leak of %d blocks found in xmlDictSize",
8438                    xmlMemBlocks() - mem_base);
8439             test_ret++;
8440             printf(" %d", n_dict);
8441             printf("\n");
8442         }
8443     }
8444     function_tests++;
8445
8446     return(test_ret);
8447 }
8448
8449
8450 static int
8451 test_xmlInitializeDict(void) {
8452     int test_ret = 0;
8453
8454     int mem_base;
8455     int ret_val;
8456
8457         mem_base = xmlMemBlocks();
8458
8459         ret_val = xmlInitializeDict();
8460         desret_int(ret_val);
8461         call_tests++;
8462         xmlResetLastError();
8463         if (mem_base != xmlMemBlocks()) {
8464             printf("Leak of %d blocks found in xmlInitializeDict",
8465                    xmlMemBlocks() - mem_base);
8466             test_ret++;
8467             printf("\n");
8468         }
8469     function_tests++;
8470
8471     return(test_ret);
8472 }
8473
8474 static int
8475 test_dict(void) {
8476     int test_ret = 0;
8477
8478     if (quiet == 0) printf("Testing dict : 10 of 11 functions ...\n");
8479     test_ret += test_xmlDictCleanup();
8480     test_ret += test_xmlDictCreate();
8481     test_ret += test_xmlDictCreateSub();
8482     test_ret += test_xmlDictExists();
8483     test_ret += test_xmlDictLookup();
8484     test_ret += test_xmlDictOwns();
8485     test_ret += test_xmlDictQLookup();
8486     test_ret += test_xmlDictReference();
8487     test_ret += test_xmlDictSize();
8488     test_ret += test_xmlInitializeDict();
8489
8490     if (test_ret != 0)
8491         printf("Module dict: %d errors\n", test_ret);
8492     return(test_ret);
8493 }
8494
8495 static int
8496 test_UTF8Toisolat1(void) {
8497     int test_ret = 0;
8498
8499 #if defined(LIBXML_OUTPUT_ENABLED)
8500 #ifdef LIBXML_OUTPUT_ENABLED
8501     int mem_base;
8502     int ret_val;
8503     unsigned char * out; /* a pointer to an array of bytes to store the result */
8504     int n_out;
8505     int * outlen; /* the length of @out */
8506     int n_outlen;
8507     unsigned char * in; /* a pointer to an array of UTF-8 chars */
8508     int n_in;
8509     int * inlen; /* the length of @in */
8510     int n_inlen;
8511
8512     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8513     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8514     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8515     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8516         mem_base = xmlMemBlocks();
8517         out = gen_unsigned_char_ptr(n_out, 0);
8518         outlen = gen_int_ptr(n_outlen, 1);
8519         in = gen_const_unsigned_char_ptr(n_in, 2);
8520         inlen = gen_int_ptr(n_inlen, 3);
8521
8522         ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8523         desret_int(ret_val);
8524         call_tests++;
8525         des_unsigned_char_ptr(n_out, out, 0);
8526         des_int_ptr(n_outlen, outlen, 1);
8527         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8528         des_int_ptr(n_inlen, inlen, 3);
8529         xmlResetLastError();
8530         if (mem_base != xmlMemBlocks()) {
8531             printf("Leak of %d blocks found in UTF8Toisolat1",
8532                    xmlMemBlocks() - mem_base);
8533             test_ret++;
8534             printf(" %d", n_out);
8535             printf(" %d", n_outlen);
8536             printf(" %d", n_in);
8537             printf(" %d", n_inlen);
8538             printf("\n");
8539         }
8540     }
8541     }
8542     }
8543     }
8544     function_tests++;
8545 #endif
8546 #endif
8547
8548     return(test_ret);
8549 }
8550
8551
8552 static int
8553 test_isolat1ToUTF8(void) {
8554     int test_ret = 0;
8555
8556     int mem_base;
8557     int ret_val;
8558     unsigned char * out; /* a pointer to an array of bytes to store the result */
8559     int n_out;
8560     int * outlen; /* the length of @out */
8561     int n_outlen;
8562     unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8563     int n_in;
8564     int * inlen; /* the length of @in */
8565     int n_inlen;
8566
8567     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8568     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8569     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8570     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8571         mem_base = xmlMemBlocks();
8572         out = gen_unsigned_char_ptr(n_out, 0);
8573         outlen = gen_int_ptr(n_outlen, 1);
8574         in = gen_const_unsigned_char_ptr(n_in, 2);
8575         inlen = gen_int_ptr(n_inlen, 3);
8576
8577         ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8578         desret_int(ret_val);
8579         call_tests++;
8580         des_unsigned_char_ptr(n_out, out, 0);
8581         des_int_ptr(n_outlen, outlen, 1);
8582         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8583         des_int_ptr(n_inlen, inlen, 3);
8584         xmlResetLastError();
8585         if (mem_base != xmlMemBlocks()) {
8586             printf("Leak of %d blocks found in isolat1ToUTF8",
8587                    xmlMemBlocks() - mem_base);
8588             test_ret++;
8589             printf(" %d", n_out);
8590             printf(" %d", n_outlen);
8591             printf(" %d", n_in);
8592             printf(" %d", n_inlen);
8593             printf("\n");
8594         }
8595     }
8596     }
8597     }
8598     }
8599     function_tests++;
8600
8601     return(test_ret);
8602 }
8603
8604
8605 static int
8606 test_xmlAddEncodingAlias(void) {
8607     int test_ret = 0;
8608
8609     int ret_val;
8610     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8611     int n_name;
8612     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8613     int n_alias;
8614
8615     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8616     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8617         name = gen_const_char_ptr(n_name, 0);
8618         alias = gen_const_char_ptr(n_alias, 1);
8619
8620         ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8621         desret_int(ret_val);
8622         call_tests++;
8623         des_const_char_ptr(n_name, (const char *)name, 0);
8624         des_const_char_ptr(n_alias, (const char *)alias, 1);
8625         xmlResetLastError();
8626     }
8627     }
8628     function_tests++;
8629
8630     return(test_ret);
8631 }
8632
8633
8634 #define gen_nb_xmlCharEncodingHandler_ptr 1
8635 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8636     return(NULL);
8637 }
8638 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8639 }
8640
8641 static int
8642 test_xmlCharEncCloseFunc(void) {
8643     int test_ret = 0;
8644
8645     int mem_base;
8646     int ret_val;
8647     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8648     int n_handler;
8649
8650     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8651         mem_base = xmlMemBlocks();
8652         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8653
8654         ret_val = xmlCharEncCloseFunc(handler);
8655         desret_int(ret_val);
8656         call_tests++;
8657         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8658         xmlResetLastError();
8659         if (mem_base != xmlMemBlocks()) {
8660             printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8661                    xmlMemBlocks() - mem_base);
8662             test_ret++;
8663             printf(" %d", n_handler);
8664             printf("\n");
8665         }
8666     }
8667     function_tests++;
8668
8669     return(test_ret);
8670 }
8671
8672
8673 static int
8674 test_xmlCharEncFirstLine(void) {
8675     int test_ret = 0;
8676
8677     int mem_base;
8678     int ret_val;
8679     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8680     int n_handler;
8681     xmlBufferPtr out; /* an xmlBuffer for the output. */
8682     int n_out;
8683     xmlBufferPtr in; /* an xmlBuffer for the input */
8684     int n_in;
8685
8686     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8687     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8688     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8689         mem_base = xmlMemBlocks();
8690         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8691         out = gen_xmlBufferPtr(n_out, 1);
8692         in = gen_xmlBufferPtr(n_in, 2);
8693
8694         ret_val = xmlCharEncFirstLine(handler, out, in);
8695         desret_int(ret_val);
8696         call_tests++;
8697         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8698         des_xmlBufferPtr(n_out, out, 1);
8699         des_xmlBufferPtr(n_in, in, 2);
8700         xmlResetLastError();
8701         if (mem_base != xmlMemBlocks()) {
8702             printf("Leak of %d blocks found in xmlCharEncFirstLine",
8703                    xmlMemBlocks() - mem_base);
8704             test_ret++;
8705             printf(" %d", n_handler);
8706             printf(" %d", n_out);
8707             printf(" %d", n_in);
8708             printf("\n");
8709         }
8710     }
8711     }
8712     }
8713     function_tests++;
8714
8715     return(test_ret);
8716 }
8717
8718
8719 static int
8720 test_xmlCharEncInFunc(void) {
8721     int test_ret = 0;
8722
8723     int mem_base;
8724     int ret_val;
8725     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8726     int n_handler;
8727     xmlBufferPtr out; /* an xmlBuffer for the output. */
8728     int n_out;
8729     xmlBufferPtr in; /* an xmlBuffer for the input */
8730     int n_in;
8731
8732     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8733     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8734     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8735         mem_base = xmlMemBlocks();
8736         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8737         out = gen_xmlBufferPtr(n_out, 1);
8738         in = gen_xmlBufferPtr(n_in, 2);
8739
8740         ret_val = xmlCharEncInFunc(handler, out, in);
8741         desret_int(ret_val);
8742         call_tests++;
8743         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8744         des_xmlBufferPtr(n_out, out, 1);
8745         des_xmlBufferPtr(n_in, in, 2);
8746         xmlResetLastError();
8747         if (mem_base != xmlMemBlocks()) {
8748             printf("Leak of %d blocks found in xmlCharEncInFunc",
8749                    xmlMemBlocks() - mem_base);
8750             test_ret++;
8751             printf(" %d", n_handler);
8752             printf(" %d", n_out);
8753             printf(" %d", n_in);
8754             printf("\n");
8755         }
8756     }
8757     }
8758     }
8759     function_tests++;
8760
8761     return(test_ret);
8762 }
8763
8764
8765 static int
8766 test_xmlCharEncOutFunc(void) {
8767     int test_ret = 0;
8768
8769     int mem_base;
8770     int ret_val;
8771     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8772     int n_handler;
8773     xmlBufferPtr out; /* an xmlBuffer for the output. */
8774     int n_out;
8775     xmlBufferPtr in; /* an xmlBuffer for the input */
8776     int n_in;
8777
8778     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8779     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8780     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8781         mem_base = xmlMemBlocks();
8782         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8783         out = gen_xmlBufferPtr(n_out, 1);
8784         in = gen_xmlBufferPtr(n_in, 2);
8785
8786         ret_val = xmlCharEncOutFunc(handler, out, in);
8787         desret_int(ret_val);
8788         call_tests++;
8789         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8790         des_xmlBufferPtr(n_out, out, 1);
8791         des_xmlBufferPtr(n_in, in, 2);
8792         xmlResetLastError();
8793         if (mem_base != xmlMemBlocks()) {
8794             printf("Leak of %d blocks found in xmlCharEncOutFunc",
8795                    xmlMemBlocks() - mem_base);
8796             test_ret++;
8797             printf(" %d", n_handler);
8798             printf(" %d", n_out);
8799             printf(" %d", n_in);
8800             printf("\n");
8801         }
8802     }
8803     }
8804     }
8805     function_tests++;
8806
8807     return(test_ret);
8808 }
8809
8810
8811 static int
8812 test_xmlCleanupCharEncodingHandlers(void) {
8813     int test_ret = 0;
8814
8815
8816
8817         xmlCleanupCharEncodingHandlers();
8818         call_tests++;
8819         xmlResetLastError();
8820     function_tests++;
8821
8822     return(test_ret);
8823 }
8824
8825
8826 static int
8827 test_xmlCleanupEncodingAliases(void) {
8828     int test_ret = 0;
8829
8830     int mem_base;
8831
8832         mem_base = xmlMemBlocks();
8833
8834         xmlCleanupEncodingAliases();
8835         call_tests++;
8836         xmlResetLastError();
8837         if (mem_base != xmlMemBlocks()) {
8838             printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8839                    xmlMemBlocks() - mem_base);
8840             test_ret++;
8841             printf("\n");
8842         }
8843     function_tests++;
8844
8845     return(test_ret);
8846 }
8847
8848
8849 static int
8850 test_xmlDelEncodingAlias(void) {
8851     int test_ret = 0;
8852
8853     int mem_base;
8854     int ret_val;
8855     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8856     int n_alias;
8857
8858     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8859         mem_base = xmlMemBlocks();
8860         alias = gen_const_char_ptr(n_alias, 0);
8861
8862         ret_val = xmlDelEncodingAlias((const char *)alias);
8863         desret_int(ret_val);
8864         call_tests++;
8865         des_const_char_ptr(n_alias, (const char *)alias, 0);
8866         xmlResetLastError();
8867         if (mem_base != xmlMemBlocks()) {
8868             printf("Leak of %d blocks found in xmlDelEncodingAlias",
8869                    xmlMemBlocks() - mem_base);
8870             test_ret++;
8871             printf(" %d", n_alias);
8872             printf("\n");
8873         }
8874     }
8875     function_tests++;
8876
8877     return(test_ret);
8878 }
8879
8880
8881 static int
8882 test_xmlDetectCharEncoding(void) {
8883     int test_ret = 0;
8884
8885     int mem_base;
8886     xmlCharEncoding ret_val;
8887     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). */
8888     int n_in;
8889     int len; /* pointer to the length of the buffer */
8890     int n_len;
8891
8892     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8893     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8894         mem_base = xmlMemBlocks();
8895         in = gen_const_unsigned_char_ptr(n_in, 0);
8896         len = gen_int(n_len, 1);
8897
8898         ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8899         desret_xmlCharEncoding(ret_val);
8900         call_tests++;
8901         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8902         des_int(n_len, len, 1);
8903         xmlResetLastError();
8904         if (mem_base != xmlMemBlocks()) {
8905             printf("Leak of %d blocks found in xmlDetectCharEncoding",
8906                    xmlMemBlocks() - mem_base);
8907             test_ret++;
8908             printf(" %d", n_in);
8909             printf(" %d", n_len);
8910             printf("\n");
8911         }
8912     }
8913     }
8914     function_tests++;
8915
8916     return(test_ret);
8917 }
8918
8919
8920 static int
8921 test_xmlFindCharEncodingHandler(void) {
8922     int test_ret = 0;
8923
8924
8925     /* missing type support */
8926     return(test_ret);
8927 }
8928
8929
8930 static int
8931 test_xmlGetCharEncodingHandler(void) {
8932     int test_ret = 0;
8933
8934
8935     /* missing type support */
8936     return(test_ret);
8937 }
8938
8939
8940 static int
8941 test_xmlGetCharEncodingName(void) {
8942     int test_ret = 0;
8943
8944     int mem_base;
8945     const char * ret_val;
8946     xmlCharEncoding enc; /* the encoding */
8947     int n_enc;
8948
8949     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8950         mem_base = xmlMemBlocks();
8951         enc = gen_xmlCharEncoding(n_enc, 0);
8952
8953         ret_val = xmlGetCharEncodingName(enc);
8954         desret_const_char_ptr(ret_val);
8955         call_tests++;
8956         des_xmlCharEncoding(n_enc, enc, 0);
8957         xmlResetLastError();
8958         if (mem_base != xmlMemBlocks()) {
8959             printf("Leak of %d blocks found in xmlGetCharEncodingName",
8960                    xmlMemBlocks() - mem_base);
8961             test_ret++;
8962             printf(" %d", n_enc);
8963             printf("\n");
8964         }
8965     }
8966     function_tests++;
8967
8968     return(test_ret);
8969 }
8970
8971
8972 static int
8973 test_xmlGetEncodingAlias(void) {
8974     int test_ret = 0;
8975
8976     int mem_base;
8977     const char * ret_val;
8978     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8979     int n_alias;
8980
8981     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8982         mem_base = xmlMemBlocks();
8983         alias = gen_const_char_ptr(n_alias, 0);
8984
8985         ret_val = xmlGetEncodingAlias((const char *)alias);
8986         desret_const_char_ptr(ret_val);
8987         call_tests++;
8988         des_const_char_ptr(n_alias, (const char *)alias, 0);
8989         xmlResetLastError();
8990         if (mem_base != xmlMemBlocks()) {
8991             printf("Leak of %d blocks found in xmlGetEncodingAlias",
8992                    xmlMemBlocks() - mem_base);
8993             test_ret++;
8994             printf(" %d", n_alias);
8995             printf("\n");
8996         }
8997     }
8998     function_tests++;
8999
9000     return(test_ret);
9001 }
9002
9003
9004 static int
9005 test_xmlInitCharEncodingHandlers(void) {
9006     int test_ret = 0;
9007
9008
9009
9010         xmlInitCharEncodingHandlers();
9011         call_tests++;
9012         xmlResetLastError();
9013     function_tests++;
9014
9015     return(test_ret);
9016 }
9017
9018
9019 static int
9020 test_xmlNewCharEncodingHandler(void) {
9021     int test_ret = 0;
9022
9023
9024     /* missing type support */
9025     return(test_ret);
9026 }
9027
9028
9029 static int
9030 test_xmlParseCharEncoding(void) {
9031     int test_ret = 0;
9032
9033     int mem_base;
9034     xmlCharEncoding ret_val;
9035     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9036     int n_name;
9037
9038     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9039         mem_base = xmlMemBlocks();
9040         name = gen_const_char_ptr(n_name, 0);
9041
9042         ret_val = xmlParseCharEncoding((const char *)name);
9043         desret_xmlCharEncoding(ret_val);
9044         call_tests++;
9045         des_const_char_ptr(n_name, (const char *)name, 0);
9046         xmlResetLastError();
9047         if (mem_base != xmlMemBlocks()) {
9048             printf("Leak of %d blocks found in xmlParseCharEncoding",
9049                    xmlMemBlocks() - mem_base);
9050             test_ret++;
9051             printf(" %d", n_name);
9052             printf("\n");
9053         }
9054     }
9055     function_tests++;
9056
9057     return(test_ret);
9058 }
9059
9060
9061 #define gen_nb_xmlCharEncodingHandlerPtr 1
9062 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9063     return(NULL);
9064 }
9065 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9066 }
9067
9068 static int
9069 test_xmlRegisterCharEncodingHandler(void) {
9070     int test_ret = 0;
9071
9072     int mem_base;
9073     xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9074     int n_handler;
9075
9076     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9077         mem_base = xmlMemBlocks();
9078         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9079
9080         xmlRegisterCharEncodingHandler(handler);
9081         call_tests++;
9082         des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9083         xmlResetLastError();
9084         if (mem_base != xmlMemBlocks()) {
9085             printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9086                    xmlMemBlocks() - mem_base);
9087             test_ret++;
9088             printf(" %d", n_handler);
9089             printf("\n");
9090         }
9091     }
9092     function_tests++;
9093
9094     return(test_ret);
9095 }
9096
9097 static int
9098 test_encoding(void) {
9099     int test_ret = 0;
9100
9101     if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9102     test_ret += test_UTF8Toisolat1();
9103     test_ret += test_isolat1ToUTF8();
9104     test_ret += test_xmlAddEncodingAlias();
9105     test_ret += test_xmlCharEncCloseFunc();
9106     test_ret += test_xmlCharEncFirstLine();
9107     test_ret += test_xmlCharEncInFunc();
9108     test_ret += test_xmlCharEncOutFunc();
9109     test_ret += test_xmlCleanupCharEncodingHandlers();
9110     test_ret += test_xmlCleanupEncodingAliases();
9111     test_ret += test_xmlDelEncodingAlias();
9112     test_ret += test_xmlDetectCharEncoding();
9113     test_ret += test_xmlFindCharEncodingHandler();
9114     test_ret += test_xmlGetCharEncodingHandler();
9115     test_ret += test_xmlGetCharEncodingName();
9116     test_ret += test_xmlGetEncodingAlias();
9117     test_ret += test_xmlInitCharEncodingHandlers();
9118     test_ret += test_xmlNewCharEncodingHandler();
9119     test_ret += test_xmlParseCharEncoding();
9120     test_ret += test_xmlRegisterCharEncodingHandler();
9121
9122     if (test_ret != 0)
9123         printf("Module encoding: %d errors\n", test_ret);
9124     return(test_ret);
9125 }
9126
9127 static int
9128 test_xmlAddDocEntity(void) {
9129     int test_ret = 0;
9130
9131     int mem_base;
9132     xmlEntityPtr ret_val;
9133     xmlDocPtr doc; /* the document */
9134     int n_doc;
9135     xmlChar * name; /* the entity name */
9136     int n_name;
9137     int type; /* the entity type XML_xxx_yyy_ENTITY */
9138     int n_type;
9139     xmlChar * ExternalID; /* the entity external ID if available */
9140     int n_ExternalID;
9141     xmlChar * SystemID; /* the entity system ID if available */
9142     int n_SystemID;
9143     xmlChar * content; /* the entity content */
9144     int n_content;
9145
9146     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9147     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9148     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9149     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9150     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9151     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9152         mem_base = xmlMemBlocks();
9153         doc = gen_xmlDocPtr(n_doc, 0);
9154         name = gen_const_xmlChar_ptr(n_name, 1);
9155         type = gen_int(n_type, 2);
9156         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9157         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9158         content = gen_const_xmlChar_ptr(n_content, 5);
9159
9160         ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9161         desret_xmlEntityPtr(ret_val);
9162         call_tests++;
9163         des_xmlDocPtr(n_doc, doc, 0);
9164         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9165         des_int(n_type, type, 2);
9166         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9167         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9168         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9169         xmlResetLastError();
9170         if (mem_base != xmlMemBlocks()) {
9171             printf("Leak of %d blocks found in xmlAddDocEntity",
9172                    xmlMemBlocks() - mem_base);
9173             test_ret++;
9174             printf(" %d", n_doc);
9175             printf(" %d", n_name);
9176             printf(" %d", n_type);
9177             printf(" %d", n_ExternalID);
9178             printf(" %d", n_SystemID);
9179             printf(" %d", n_content);
9180             printf("\n");
9181         }
9182     }
9183     }
9184     }
9185     }
9186     }
9187     }
9188     function_tests++;
9189
9190     return(test_ret);
9191 }
9192
9193
9194 static int
9195 test_xmlAddDtdEntity(void) {
9196     int test_ret = 0;
9197
9198     int mem_base;
9199     xmlEntityPtr ret_val;
9200     xmlDocPtr doc; /* the document */
9201     int n_doc;
9202     xmlChar * name; /* the entity name */
9203     int n_name;
9204     int type; /* the entity type XML_xxx_yyy_ENTITY */
9205     int n_type;
9206     xmlChar * ExternalID; /* the entity external ID if available */
9207     int n_ExternalID;
9208     xmlChar * SystemID; /* the entity system ID if available */
9209     int n_SystemID;
9210     xmlChar * content; /* the entity content */
9211     int n_content;
9212
9213     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9214     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9215     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9216     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9217     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9218     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9219         mem_base = xmlMemBlocks();
9220         doc = gen_xmlDocPtr(n_doc, 0);
9221         name = gen_const_xmlChar_ptr(n_name, 1);
9222         type = gen_int(n_type, 2);
9223         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9224         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9225         content = gen_const_xmlChar_ptr(n_content, 5);
9226
9227         ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9228         desret_xmlEntityPtr(ret_val);
9229         call_tests++;
9230         des_xmlDocPtr(n_doc, doc, 0);
9231         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9232         des_int(n_type, type, 2);
9233         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9234         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9235         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9236         xmlResetLastError();
9237         if (mem_base != xmlMemBlocks()) {
9238             printf("Leak of %d blocks found in xmlAddDtdEntity",
9239                    xmlMemBlocks() - mem_base);
9240             test_ret++;
9241             printf(" %d", n_doc);
9242             printf(" %d", n_name);
9243             printf(" %d", n_type);
9244             printf(" %d", n_ExternalID);
9245             printf(" %d", n_SystemID);
9246             printf(" %d", n_content);
9247             printf("\n");
9248         }
9249     }
9250     }
9251     }
9252     }
9253     }
9254     }
9255     function_tests++;
9256
9257     return(test_ret);
9258 }
9259
9260
9261 static int
9262 test_xmlCleanupPredefinedEntities(void) {
9263     int test_ret = 0;
9264
9265 #if defined(LIBXML_LEGACY_ENABLED)
9266 #ifdef LIBXML_LEGACY_ENABLED
9267     int mem_base;
9268
9269         mem_base = xmlMemBlocks();
9270
9271         xmlCleanupPredefinedEntities();
9272         call_tests++;
9273         xmlResetLastError();
9274         if (mem_base != xmlMemBlocks()) {
9275             printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9276                    xmlMemBlocks() - mem_base);
9277             test_ret++;
9278             printf("\n");
9279         }
9280     function_tests++;
9281 #endif
9282 #endif
9283
9284     return(test_ret);
9285 }
9286
9287
9288 #define gen_nb_xmlEntitiesTablePtr 1
9289 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9290     return(NULL);
9291 }
9292 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9293 }
9294
9295 static int
9296 test_xmlCopyEntitiesTable(void) {
9297     int test_ret = 0;
9298
9299
9300     /* missing type support */
9301     return(test_ret);
9302 }
9303
9304
9305 static int
9306 test_xmlCreateEntitiesTable(void) {
9307     int test_ret = 0;
9308
9309
9310     /* missing type support */
9311     return(test_ret);
9312 }
9313
9314
9315 static int
9316 test_xmlDumpEntitiesTable(void) {
9317     int test_ret = 0;
9318
9319 #if defined(LIBXML_OUTPUT_ENABLED)
9320     int mem_base;
9321     xmlBufferPtr buf; /* An XML buffer. */
9322     int n_buf;
9323     xmlEntitiesTablePtr table; /* An entity table */
9324     int n_table;
9325
9326     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9327     for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9328         mem_base = xmlMemBlocks();
9329         buf = gen_xmlBufferPtr(n_buf, 0);
9330         table = gen_xmlEntitiesTablePtr(n_table, 1);
9331
9332         xmlDumpEntitiesTable(buf, table);
9333         call_tests++;
9334         des_xmlBufferPtr(n_buf, buf, 0);
9335         des_xmlEntitiesTablePtr(n_table, table, 1);
9336         xmlResetLastError();
9337         if (mem_base != xmlMemBlocks()) {
9338             printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9339                    xmlMemBlocks() - mem_base);
9340             test_ret++;
9341             printf(" %d", n_buf);
9342             printf(" %d", n_table);
9343             printf("\n");
9344         }
9345     }
9346     }
9347     function_tests++;
9348 #endif
9349
9350     return(test_ret);
9351 }
9352
9353
9354 #define gen_nb_xmlEntityPtr 1
9355 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9356     return(NULL);
9357 }
9358 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9359 }
9360
9361 static int
9362 test_xmlDumpEntityDecl(void) {
9363     int test_ret = 0;
9364
9365 #if defined(LIBXML_OUTPUT_ENABLED)
9366     int mem_base;
9367     xmlBufferPtr buf; /* An XML buffer. */
9368     int n_buf;
9369     xmlEntityPtr ent; /* An entity table */
9370     int n_ent;
9371
9372     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9373     for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9374         mem_base = xmlMemBlocks();
9375         buf = gen_xmlBufferPtr(n_buf, 0);
9376         ent = gen_xmlEntityPtr(n_ent, 1);
9377
9378         xmlDumpEntityDecl(buf, ent);
9379         call_tests++;
9380         des_xmlBufferPtr(n_buf, buf, 0);
9381         des_xmlEntityPtr(n_ent, ent, 1);
9382         xmlResetLastError();
9383         if (mem_base != xmlMemBlocks()) {
9384             printf("Leak of %d blocks found in xmlDumpEntityDecl",
9385                    xmlMemBlocks() - mem_base);
9386             test_ret++;
9387             printf(" %d", n_buf);
9388             printf(" %d", n_ent);
9389             printf("\n");
9390         }
9391     }
9392     }
9393     function_tests++;
9394 #endif
9395
9396     return(test_ret);
9397 }
9398
9399
9400 static int
9401 test_xmlEncodeEntitiesReentrant(void) {
9402     int test_ret = 0;
9403
9404     int mem_base;
9405     xmlChar * ret_val;
9406     xmlDocPtr doc; /* the document containing the string */
9407     int n_doc;
9408     xmlChar * input; /* A string to convert to XML. */
9409     int n_input;
9410
9411     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9412     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9413         mem_base = xmlMemBlocks();
9414         doc = gen_xmlDocPtr(n_doc, 0);
9415         input = gen_const_xmlChar_ptr(n_input, 1);
9416
9417         ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9418         desret_xmlChar_ptr(ret_val);
9419         call_tests++;
9420         des_xmlDocPtr(n_doc, doc, 0);
9421         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9422         xmlResetLastError();
9423         if (mem_base != xmlMemBlocks()) {
9424             printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9425                    xmlMemBlocks() - mem_base);
9426             test_ret++;
9427             printf(" %d", n_doc);
9428             printf(" %d", n_input);
9429             printf("\n");
9430         }
9431     }
9432     }
9433     function_tests++;
9434
9435     return(test_ret);
9436 }
9437
9438
9439 static int
9440 test_xmlEncodeSpecialChars(void) {
9441     int test_ret = 0;
9442
9443     int mem_base;
9444     xmlChar * ret_val;
9445     xmlDocPtr doc; /* the document containing the string */
9446     int n_doc;
9447     xmlChar * input; /* A string to convert to XML. */
9448     int n_input;
9449
9450     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9451     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9452         mem_base = xmlMemBlocks();
9453         doc = gen_xmlDocPtr(n_doc, 0);
9454         input = gen_const_xmlChar_ptr(n_input, 1);
9455
9456         ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9457         desret_xmlChar_ptr(ret_val);
9458         call_tests++;
9459         des_xmlDocPtr(n_doc, doc, 0);
9460         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9461         xmlResetLastError();
9462         if (mem_base != xmlMemBlocks()) {
9463             printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9464                    xmlMemBlocks() - mem_base);
9465             test_ret++;
9466             printf(" %d", n_doc);
9467             printf(" %d", n_input);
9468             printf("\n");
9469         }
9470     }
9471     }
9472     function_tests++;
9473
9474     return(test_ret);
9475 }
9476
9477
9478 static int
9479 test_xmlGetDocEntity(void) {
9480     int test_ret = 0;
9481
9482     int mem_base;
9483     xmlEntityPtr ret_val;
9484     xmlDocPtr doc; /* the document referencing the entity */
9485     int n_doc;
9486     xmlChar * name; /* the entity name */
9487     int n_name;
9488
9489     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9490     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9491         mem_base = xmlMemBlocks();
9492         doc = gen_xmlDocPtr(n_doc, 0);
9493         name = gen_const_xmlChar_ptr(n_name, 1);
9494
9495         ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9496         desret_xmlEntityPtr(ret_val);
9497         call_tests++;
9498         des_xmlDocPtr(n_doc, doc, 0);
9499         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9500         xmlResetLastError();
9501         if (mem_base != xmlMemBlocks()) {
9502             printf("Leak of %d blocks found in xmlGetDocEntity",
9503                    xmlMemBlocks() - mem_base);
9504             test_ret++;
9505             printf(" %d", n_doc);
9506             printf(" %d", n_name);
9507             printf("\n");
9508         }
9509     }
9510     }
9511     function_tests++;
9512
9513     return(test_ret);
9514 }
9515
9516
9517 static int
9518 test_xmlGetDtdEntity(void) {
9519     int test_ret = 0;
9520
9521     int mem_base;
9522     xmlEntityPtr ret_val;
9523     xmlDocPtr doc; /* the document referencing the entity */
9524     int n_doc;
9525     xmlChar * name; /* the entity name */
9526     int n_name;
9527
9528     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9529     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9530         mem_base = xmlMemBlocks();
9531         doc = gen_xmlDocPtr(n_doc, 0);
9532         name = gen_const_xmlChar_ptr(n_name, 1);
9533
9534         ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9535         desret_xmlEntityPtr(ret_val);
9536         call_tests++;
9537         des_xmlDocPtr(n_doc, doc, 0);
9538         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9539         xmlResetLastError();
9540         if (mem_base != xmlMemBlocks()) {
9541             printf("Leak of %d blocks found in xmlGetDtdEntity",
9542                    xmlMemBlocks() - mem_base);
9543             test_ret++;
9544             printf(" %d", n_doc);
9545             printf(" %d", n_name);
9546             printf("\n");
9547         }
9548     }
9549     }
9550     function_tests++;
9551
9552     return(test_ret);
9553 }
9554
9555
9556 static int
9557 test_xmlGetParameterEntity(void) {
9558     int test_ret = 0;
9559
9560     int mem_base;
9561     xmlEntityPtr ret_val;
9562     xmlDocPtr doc; /* the document referencing the entity */
9563     int n_doc;
9564     xmlChar * name; /* the entity name */
9565     int n_name;
9566
9567     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9568     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9569         mem_base = xmlMemBlocks();
9570         doc = gen_xmlDocPtr(n_doc, 0);
9571         name = gen_const_xmlChar_ptr(n_name, 1);
9572
9573         ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9574         desret_xmlEntityPtr(ret_val);
9575         call_tests++;
9576         des_xmlDocPtr(n_doc, doc, 0);
9577         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9578         xmlResetLastError();
9579         if (mem_base != xmlMemBlocks()) {
9580             printf("Leak of %d blocks found in xmlGetParameterEntity",
9581                    xmlMemBlocks() - mem_base);
9582             test_ret++;
9583             printf(" %d", n_doc);
9584             printf(" %d", n_name);
9585             printf("\n");
9586         }
9587     }
9588     }
9589     function_tests++;
9590
9591     return(test_ret);
9592 }
9593
9594
9595 static int
9596 test_xmlGetPredefinedEntity(void) {
9597     int test_ret = 0;
9598
9599     int mem_base;
9600     xmlEntityPtr ret_val;
9601     xmlChar * name; /* the entity name */
9602     int n_name;
9603
9604     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9605         mem_base = xmlMemBlocks();
9606         name = gen_const_xmlChar_ptr(n_name, 0);
9607
9608         ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9609         desret_xmlEntityPtr(ret_val);
9610         call_tests++;
9611         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9612         xmlResetLastError();
9613         if (mem_base != xmlMemBlocks()) {
9614             printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9615                    xmlMemBlocks() - mem_base);
9616             test_ret++;
9617             printf(" %d", n_name);
9618             printf("\n");
9619         }
9620     }
9621     function_tests++;
9622
9623     return(test_ret);
9624 }
9625
9626
9627 static int
9628 test_xmlInitializePredefinedEntities(void) {
9629     int test_ret = 0;
9630
9631 #if defined(LIBXML_LEGACY_ENABLED)
9632 #ifdef LIBXML_LEGACY_ENABLED
9633     int mem_base;
9634
9635         mem_base = xmlMemBlocks();
9636
9637         xmlInitializePredefinedEntities();
9638         call_tests++;
9639         xmlResetLastError();
9640         if (mem_base != xmlMemBlocks()) {
9641             printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9642                    xmlMemBlocks() - mem_base);
9643             test_ret++;
9644             printf("\n");
9645         }
9646     function_tests++;
9647 #endif
9648 #endif
9649
9650     return(test_ret);
9651 }
9652
9653
9654 static int
9655 test_xmlNewEntity(void) {
9656     int test_ret = 0;
9657
9658     int mem_base;
9659     xmlEntityPtr ret_val;
9660     xmlDocPtr doc; /* the document */
9661     int n_doc;
9662     xmlChar * name; /* the entity name */
9663     int n_name;
9664     int type; /* the entity type XML_xxx_yyy_ENTITY */
9665     int n_type;
9666     xmlChar * ExternalID; /* the entity external ID if available */
9667     int n_ExternalID;
9668     xmlChar * SystemID; /* the entity system ID if available */
9669     int n_SystemID;
9670     xmlChar * content; /* the entity content */
9671     int n_content;
9672
9673     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9674     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9675     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9676     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9677     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9678     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9679         mem_base = xmlMemBlocks();
9680         doc = gen_xmlDocPtr(n_doc, 0);
9681         name = gen_const_xmlChar_ptr(n_name, 1);
9682         type = gen_int(n_type, 2);
9683         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9684         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9685         content = gen_const_xmlChar_ptr(n_content, 5);
9686
9687         ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9688         desret_xmlEntityPtr(ret_val);
9689         call_tests++;
9690         des_xmlDocPtr(n_doc, doc, 0);
9691         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9692         des_int(n_type, type, 2);
9693         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9694         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9695         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9696         xmlResetLastError();
9697         if (mem_base != xmlMemBlocks()) {
9698             printf("Leak of %d blocks found in xmlNewEntity",
9699                    xmlMemBlocks() - mem_base);
9700             test_ret++;
9701             printf(" %d", n_doc);
9702             printf(" %d", n_name);
9703             printf(" %d", n_type);
9704             printf(" %d", n_ExternalID);
9705             printf(" %d", n_SystemID);
9706             printf(" %d", n_content);
9707             printf("\n");
9708         }
9709     }
9710     }
9711     }
9712     }
9713     }
9714     }
9715     function_tests++;
9716
9717     return(test_ret);
9718 }
9719
9720 static int
9721 test_entities(void) {
9722     int test_ret = 0;
9723
9724     if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9725     test_ret += test_xmlAddDocEntity();
9726     test_ret += test_xmlAddDtdEntity();
9727     test_ret += test_xmlCleanupPredefinedEntities();
9728     test_ret += test_xmlCopyEntitiesTable();
9729     test_ret += test_xmlCreateEntitiesTable();
9730     test_ret += test_xmlDumpEntitiesTable();
9731     test_ret += test_xmlDumpEntityDecl();
9732     test_ret += test_xmlEncodeEntitiesReentrant();
9733     test_ret += test_xmlEncodeSpecialChars();
9734     test_ret += test_xmlGetDocEntity();
9735     test_ret += test_xmlGetDtdEntity();
9736     test_ret += test_xmlGetParameterEntity();
9737     test_ret += test_xmlGetPredefinedEntity();
9738     test_ret += test_xmlInitializePredefinedEntities();
9739     test_ret += test_xmlNewEntity();
9740
9741     if (test_ret != 0)
9742         printf("Module entities: %d errors\n", test_ret);
9743     return(test_ret);
9744 }
9745
9746 static int
9747 test_xmlHashAddEntry(void) {
9748     int test_ret = 0;
9749
9750     int mem_base;
9751     int ret_val;
9752     xmlHashTablePtr table; /* the hash table */
9753     int n_table;
9754     xmlChar * name; /* the name of the userdata */
9755     int n_name;
9756     void * userdata; /* a pointer to the userdata */
9757     int n_userdata;
9758
9759     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9760     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9761     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9762         mem_base = xmlMemBlocks();
9763         table = gen_xmlHashTablePtr(n_table, 0);
9764         name = gen_const_xmlChar_ptr(n_name, 1);
9765         userdata = gen_userdata(n_userdata, 2);
9766
9767         ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9768         desret_int(ret_val);
9769         call_tests++;
9770         des_xmlHashTablePtr(n_table, table, 0);
9771         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9772         des_userdata(n_userdata, userdata, 2);
9773         xmlResetLastError();
9774         if (mem_base != xmlMemBlocks()) {
9775             printf("Leak of %d blocks found in xmlHashAddEntry",
9776                    xmlMemBlocks() - mem_base);
9777             test_ret++;
9778             printf(" %d", n_table);
9779             printf(" %d", n_name);
9780             printf(" %d", n_userdata);
9781             printf("\n");
9782         }
9783     }
9784     }
9785     }
9786     function_tests++;
9787
9788     return(test_ret);
9789 }
9790
9791
9792 static int
9793 test_xmlHashAddEntry2(void) {
9794     int test_ret = 0;
9795
9796     int mem_base;
9797     int ret_val;
9798     xmlHashTablePtr table; /* the hash table */
9799     int n_table;
9800     xmlChar * name; /* the name of the userdata */
9801     int n_name;
9802     xmlChar * name2; /* a second name of the userdata */
9803     int n_name2;
9804     void * userdata; /* a pointer to the userdata */
9805     int n_userdata;
9806
9807     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9808     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9809     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9810     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9811         mem_base = xmlMemBlocks();
9812         table = gen_xmlHashTablePtr(n_table, 0);
9813         name = gen_const_xmlChar_ptr(n_name, 1);
9814         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9815         userdata = gen_userdata(n_userdata, 3);
9816
9817         ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9818         desret_int(ret_val);
9819         call_tests++;
9820         des_xmlHashTablePtr(n_table, table, 0);
9821         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9822         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9823         des_userdata(n_userdata, userdata, 3);
9824         xmlResetLastError();
9825         if (mem_base != xmlMemBlocks()) {
9826             printf("Leak of %d blocks found in xmlHashAddEntry2",
9827                    xmlMemBlocks() - mem_base);
9828             test_ret++;
9829             printf(" %d", n_table);
9830             printf(" %d", n_name);
9831             printf(" %d", n_name2);
9832             printf(" %d", n_userdata);
9833             printf("\n");
9834         }
9835     }
9836     }
9837     }
9838     }
9839     function_tests++;
9840
9841     return(test_ret);
9842 }
9843
9844
9845 static int
9846 test_xmlHashAddEntry3(void) {
9847     int test_ret = 0;
9848
9849     int mem_base;
9850     int ret_val;
9851     xmlHashTablePtr table; /* the hash table */
9852     int n_table;
9853     xmlChar * name; /* the name of the userdata */
9854     int n_name;
9855     xmlChar * name2; /* a second name of the userdata */
9856     int n_name2;
9857     xmlChar * name3; /* a third name of the userdata */
9858     int n_name3;
9859     void * userdata; /* a pointer to the userdata */
9860     int n_userdata;
9861
9862     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9863     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9864     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9865     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9866     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9867         mem_base = xmlMemBlocks();
9868         table = gen_xmlHashTablePtr(n_table, 0);
9869         name = gen_const_xmlChar_ptr(n_name, 1);
9870         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9871         name3 = gen_const_xmlChar_ptr(n_name3, 3);
9872         userdata = gen_userdata(n_userdata, 4);
9873
9874         ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9875         desret_int(ret_val);
9876         call_tests++;
9877         des_xmlHashTablePtr(n_table, table, 0);
9878         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9879         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9880         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9881         des_userdata(n_userdata, userdata, 4);
9882         xmlResetLastError();
9883         if (mem_base != xmlMemBlocks()) {
9884             printf("Leak of %d blocks found in xmlHashAddEntry3",
9885                    xmlMemBlocks() - mem_base);
9886             test_ret++;
9887             printf(" %d", n_table);
9888             printf(" %d", n_name);
9889             printf(" %d", n_name2);
9890             printf(" %d", n_name3);
9891             printf(" %d", n_userdata);
9892             printf("\n");
9893         }
9894     }
9895     }
9896     }
9897     }
9898     }
9899     function_tests++;
9900
9901     return(test_ret);
9902 }
9903
9904
9905 static int
9906 test_xmlHashCopy(void) {
9907     int test_ret = 0;
9908
9909
9910     /* missing type support */
9911     return(test_ret);
9912 }
9913
9914
9915 static int
9916 test_xmlHashCreate(void) {
9917     int test_ret = 0;
9918
9919
9920     /* missing type support */
9921     return(test_ret);
9922 }
9923
9924
9925 static int
9926 test_xmlHashCreateDict(void) {
9927     int test_ret = 0;
9928
9929
9930     /* missing type support */
9931     return(test_ret);
9932 }
9933
9934
9935 static int
9936 test_xmlHashLookup(void) {
9937     int test_ret = 0;
9938
9939     int mem_base;
9940     void * ret_val;
9941     xmlHashTablePtr table; /* the hash table */
9942     int n_table;
9943     xmlChar * name; /* the name of the userdata */
9944     int n_name;
9945
9946     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9947     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9948         mem_base = xmlMemBlocks();
9949         table = gen_xmlHashTablePtr(n_table, 0);
9950         name = gen_const_xmlChar_ptr(n_name, 1);
9951
9952         ret_val = xmlHashLookup(table, (const xmlChar *)name);
9953         desret_void_ptr(ret_val);
9954         call_tests++;
9955         des_xmlHashTablePtr(n_table, table, 0);
9956         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9957         xmlResetLastError();
9958         if (mem_base != xmlMemBlocks()) {
9959             printf("Leak of %d blocks found in xmlHashLookup",
9960                    xmlMemBlocks() - mem_base);
9961             test_ret++;
9962             printf(" %d", n_table);
9963             printf(" %d", n_name);
9964             printf("\n");
9965         }
9966     }
9967     }
9968     function_tests++;
9969
9970     return(test_ret);
9971 }
9972
9973
9974 static int
9975 test_xmlHashLookup2(void) {
9976     int test_ret = 0;
9977
9978     int mem_base;
9979     void * ret_val;
9980     xmlHashTablePtr table; /* the hash table */
9981     int n_table;
9982     xmlChar * name; /* the name of the userdata */
9983     int n_name;
9984     xmlChar * name2; /* a second name of the userdata */
9985     int n_name2;
9986
9987     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9988     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9989     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9990         mem_base = xmlMemBlocks();
9991         table = gen_xmlHashTablePtr(n_table, 0);
9992         name = gen_const_xmlChar_ptr(n_name, 1);
9993         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9994
9995         ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9996         desret_void_ptr(ret_val);
9997         call_tests++;
9998         des_xmlHashTablePtr(n_table, table, 0);
9999         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10000         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10001         xmlResetLastError();
10002         if (mem_base != xmlMemBlocks()) {
10003             printf("Leak of %d blocks found in xmlHashLookup2",
10004                    xmlMemBlocks() - mem_base);
10005             test_ret++;
10006             printf(" %d", n_table);
10007             printf(" %d", n_name);
10008             printf(" %d", n_name2);
10009             printf("\n");
10010         }
10011     }
10012     }
10013     }
10014     function_tests++;
10015
10016     return(test_ret);
10017 }
10018
10019
10020 static int
10021 test_xmlHashLookup3(void) {
10022     int test_ret = 0;
10023
10024     int mem_base;
10025     void * ret_val;
10026     xmlHashTablePtr table; /* the hash table */
10027     int n_table;
10028     xmlChar * name; /* the name of the userdata */
10029     int n_name;
10030     xmlChar * name2; /* a second name of the userdata */
10031     int n_name2;
10032     xmlChar * name3; /* a third name of the userdata */
10033     int n_name3;
10034
10035     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10036     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10037     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10038     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10039         mem_base = xmlMemBlocks();
10040         table = gen_xmlHashTablePtr(n_table, 0);
10041         name = gen_const_xmlChar_ptr(n_name, 1);
10042         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10043         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10044
10045         ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10046         desret_void_ptr(ret_val);
10047         call_tests++;
10048         des_xmlHashTablePtr(n_table, table, 0);
10049         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10050         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10051         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10052         xmlResetLastError();
10053         if (mem_base != xmlMemBlocks()) {
10054             printf("Leak of %d blocks found in xmlHashLookup3",
10055                    xmlMemBlocks() - mem_base);
10056             test_ret++;
10057             printf(" %d", n_table);
10058             printf(" %d", n_name);
10059             printf(" %d", n_name2);
10060             printf(" %d", n_name3);
10061             printf("\n");
10062         }
10063     }
10064     }
10065     }
10066     }
10067     function_tests++;
10068
10069     return(test_ret);
10070 }
10071
10072
10073 static int
10074 test_xmlHashQLookup(void) {
10075     int test_ret = 0;
10076
10077     int mem_base;
10078     void * ret_val;
10079     xmlHashTablePtr table; /* the hash table */
10080     int n_table;
10081     xmlChar * prefix; /* the prefix of the userdata */
10082     int n_prefix;
10083     xmlChar * name; /* the name of the userdata */
10084     int n_name;
10085
10086     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10087     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10088     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10089         mem_base = xmlMemBlocks();
10090         table = gen_xmlHashTablePtr(n_table, 0);
10091         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10092         name = gen_const_xmlChar_ptr(n_name, 2);
10093
10094         ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10095         desret_void_ptr(ret_val);
10096         call_tests++;
10097         des_xmlHashTablePtr(n_table, table, 0);
10098         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10099         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10100         xmlResetLastError();
10101         if (mem_base != xmlMemBlocks()) {
10102             printf("Leak of %d blocks found in xmlHashQLookup",
10103                    xmlMemBlocks() - mem_base);
10104             test_ret++;
10105             printf(" %d", n_table);
10106             printf(" %d", n_prefix);
10107             printf(" %d", n_name);
10108             printf("\n");
10109         }
10110     }
10111     }
10112     }
10113     function_tests++;
10114
10115     return(test_ret);
10116 }
10117
10118
10119 static int
10120 test_xmlHashQLookup2(void) {
10121     int test_ret = 0;
10122
10123     int mem_base;
10124     void * ret_val;
10125     xmlHashTablePtr table; /* the hash table */
10126     int n_table;
10127     xmlChar * prefix; /* the prefix of the userdata */
10128     int n_prefix;
10129     xmlChar * name; /* the name of the userdata */
10130     int n_name;
10131     xmlChar * prefix2; /* the second prefix of the userdata */
10132     int n_prefix2;
10133     xmlChar * name2; /* a second name of the userdata */
10134     int n_name2;
10135
10136     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10137     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10138     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10139     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10140     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10141         mem_base = xmlMemBlocks();
10142         table = gen_xmlHashTablePtr(n_table, 0);
10143         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10144         name = gen_const_xmlChar_ptr(n_name, 2);
10145         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10146         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10147
10148         ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10149         desret_void_ptr(ret_val);
10150         call_tests++;
10151         des_xmlHashTablePtr(n_table, table, 0);
10152         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10153         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10154         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10155         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10156         xmlResetLastError();
10157         if (mem_base != xmlMemBlocks()) {
10158             printf("Leak of %d blocks found in xmlHashQLookup2",
10159                    xmlMemBlocks() - mem_base);
10160             test_ret++;
10161             printf(" %d", n_table);
10162             printf(" %d", n_prefix);
10163             printf(" %d", n_name);
10164             printf(" %d", n_prefix2);
10165             printf(" %d", n_name2);
10166             printf("\n");
10167         }
10168     }
10169     }
10170     }
10171     }
10172     }
10173     function_tests++;
10174
10175     return(test_ret);
10176 }
10177
10178
10179 static int
10180 test_xmlHashQLookup3(void) {
10181     int test_ret = 0;
10182
10183     int mem_base;
10184     void * ret_val;
10185     xmlHashTablePtr table; /* the hash table */
10186     int n_table;
10187     xmlChar * prefix; /* the prefix of the userdata */
10188     int n_prefix;
10189     xmlChar * name; /* the name of the userdata */
10190     int n_name;
10191     xmlChar * prefix2; /* the second prefix of the userdata */
10192     int n_prefix2;
10193     xmlChar * name2; /* a second name of the userdata */
10194     int n_name2;
10195     xmlChar * prefix3; /* the third prefix of the userdata */
10196     int n_prefix3;
10197     xmlChar * name3; /* a third name of the userdata */
10198     int n_name3;
10199
10200     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10201     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10202     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10203     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10204     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10205     for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10206     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10207         mem_base = xmlMemBlocks();
10208         table = gen_xmlHashTablePtr(n_table, 0);
10209         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10210         name = gen_const_xmlChar_ptr(n_name, 2);
10211         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10212         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10213         prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10214         name3 = gen_const_xmlChar_ptr(n_name3, 6);
10215
10216         ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10217         desret_void_ptr(ret_val);
10218         call_tests++;
10219         des_xmlHashTablePtr(n_table, table, 0);
10220         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10221         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10222         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10223         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10224         des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10225         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10226         xmlResetLastError();
10227         if (mem_base != xmlMemBlocks()) {
10228             printf("Leak of %d blocks found in xmlHashQLookup3",
10229                    xmlMemBlocks() - mem_base);
10230             test_ret++;
10231             printf(" %d", n_table);
10232             printf(" %d", n_prefix);
10233             printf(" %d", n_name);
10234             printf(" %d", n_prefix2);
10235             printf(" %d", n_name2);
10236             printf(" %d", n_prefix3);
10237             printf(" %d", n_name3);
10238             printf("\n");
10239         }
10240     }
10241     }
10242     }
10243     }
10244     }
10245     }
10246     }
10247     function_tests++;
10248
10249     return(test_ret);
10250 }
10251
10252
10253 static int
10254 test_xmlHashRemoveEntry(void) {
10255     int test_ret = 0;
10256
10257     int mem_base;
10258     int ret_val;
10259     xmlHashTablePtr table; /* the hash table */
10260     int n_table;
10261     xmlChar * name; /* the name of the userdata */
10262     int n_name;
10263     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10264     int n_f;
10265
10266     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10267     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10268     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10269         mem_base = xmlMemBlocks();
10270         table = gen_xmlHashTablePtr(n_table, 0);
10271         name = gen_const_xmlChar_ptr(n_name, 1);
10272         f = gen_xmlHashDeallocator(n_f, 2);
10273
10274         ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10275         desret_int(ret_val);
10276         call_tests++;
10277         des_xmlHashTablePtr(n_table, table, 0);
10278         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10279         des_xmlHashDeallocator(n_f, f, 2);
10280         xmlResetLastError();
10281         if (mem_base != xmlMemBlocks()) {
10282             printf("Leak of %d blocks found in xmlHashRemoveEntry",
10283                    xmlMemBlocks() - mem_base);
10284             test_ret++;
10285             printf(" %d", n_table);
10286             printf(" %d", n_name);
10287             printf(" %d", n_f);
10288             printf("\n");
10289         }
10290     }
10291     }
10292     }
10293     function_tests++;
10294
10295     return(test_ret);
10296 }
10297
10298
10299 static int
10300 test_xmlHashRemoveEntry2(void) {
10301     int test_ret = 0;
10302
10303     int mem_base;
10304     int ret_val;
10305     xmlHashTablePtr table; /* the hash table */
10306     int n_table;
10307     xmlChar * name; /* the name of the userdata */
10308     int n_name;
10309     xmlChar * name2; /* a second name of the userdata */
10310     int n_name2;
10311     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10312     int n_f;
10313
10314     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10315     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10316     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10317     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10318         mem_base = xmlMemBlocks();
10319         table = gen_xmlHashTablePtr(n_table, 0);
10320         name = gen_const_xmlChar_ptr(n_name, 1);
10321         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10322         f = gen_xmlHashDeallocator(n_f, 3);
10323
10324         ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10325         desret_int(ret_val);
10326         call_tests++;
10327         des_xmlHashTablePtr(n_table, table, 0);
10328         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10329         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10330         des_xmlHashDeallocator(n_f, f, 3);
10331         xmlResetLastError();
10332         if (mem_base != xmlMemBlocks()) {
10333             printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10334                    xmlMemBlocks() - mem_base);
10335             test_ret++;
10336             printf(" %d", n_table);
10337             printf(" %d", n_name);
10338             printf(" %d", n_name2);
10339             printf(" %d", n_f);
10340             printf("\n");
10341         }
10342     }
10343     }
10344     }
10345     }
10346     function_tests++;
10347
10348     return(test_ret);
10349 }
10350
10351
10352 static int
10353 test_xmlHashRemoveEntry3(void) {
10354     int test_ret = 0;
10355
10356     int mem_base;
10357     int ret_val;
10358     xmlHashTablePtr table; /* the hash table */
10359     int n_table;
10360     xmlChar * name; /* the name of the userdata */
10361     int n_name;
10362     xmlChar * name2; /* a second name of the userdata */
10363     int n_name2;
10364     xmlChar * name3; /* a third name of the userdata */
10365     int n_name3;
10366     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10367     int n_f;
10368
10369     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10370     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10371     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10372     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10373     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10374         mem_base = xmlMemBlocks();
10375         table = gen_xmlHashTablePtr(n_table, 0);
10376         name = gen_const_xmlChar_ptr(n_name, 1);
10377         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10378         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10379         f = gen_xmlHashDeallocator(n_f, 4);
10380
10381         ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10382         desret_int(ret_val);
10383         call_tests++;
10384         des_xmlHashTablePtr(n_table, table, 0);
10385         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10386         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10387         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10388         des_xmlHashDeallocator(n_f, f, 4);
10389         xmlResetLastError();
10390         if (mem_base != xmlMemBlocks()) {
10391             printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10392                    xmlMemBlocks() - mem_base);
10393             test_ret++;
10394             printf(" %d", n_table);
10395             printf(" %d", n_name);
10396             printf(" %d", n_name2);
10397             printf(" %d", n_name3);
10398             printf(" %d", n_f);
10399             printf("\n");
10400         }
10401     }
10402     }
10403     }
10404     }
10405     }
10406     function_tests++;
10407
10408     return(test_ret);
10409 }
10410
10411
10412 static int
10413 test_xmlHashScan(void) {
10414     int test_ret = 0;
10415
10416
10417     /* missing type support */
10418     return(test_ret);
10419 }
10420
10421
10422 static int
10423 test_xmlHashScan3(void) {
10424     int test_ret = 0;
10425
10426
10427     /* missing type support */
10428     return(test_ret);
10429 }
10430
10431
10432 static int
10433 test_xmlHashScanFull(void) {
10434     int test_ret = 0;
10435
10436
10437     /* missing type support */
10438     return(test_ret);
10439 }
10440
10441
10442 static int
10443 test_xmlHashScanFull3(void) {
10444     int test_ret = 0;
10445
10446
10447     /* missing type support */
10448     return(test_ret);
10449 }
10450
10451
10452 static int
10453 test_xmlHashSize(void) {
10454     int test_ret = 0;
10455
10456     int mem_base;
10457     int ret_val;
10458     xmlHashTablePtr table; /* the hash table */
10459     int n_table;
10460
10461     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10462         mem_base = xmlMemBlocks();
10463         table = gen_xmlHashTablePtr(n_table, 0);
10464
10465         ret_val = xmlHashSize(table);
10466         desret_int(ret_val);
10467         call_tests++;
10468         des_xmlHashTablePtr(n_table, table, 0);
10469         xmlResetLastError();
10470         if (mem_base != xmlMemBlocks()) {
10471             printf("Leak of %d blocks found in xmlHashSize",
10472                    xmlMemBlocks() - mem_base);
10473             test_ret++;
10474             printf(" %d", n_table);
10475             printf("\n");
10476         }
10477     }
10478     function_tests++;
10479
10480     return(test_ret);
10481 }
10482
10483
10484 static int
10485 test_xmlHashUpdateEntry(void) {
10486     int test_ret = 0;
10487
10488     int mem_base;
10489     int ret_val;
10490     xmlHashTablePtr table; /* the hash table */
10491     int n_table;
10492     xmlChar * name; /* the name of the userdata */
10493     int n_name;
10494     void * userdata; /* a pointer to the userdata */
10495     int n_userdata;
10496     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10497     int n_f;
10498
10499     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10500     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10501     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10502     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10503         mem_base = xmlMemBlocks();
10504         table = gen_xmlHashTablePtr(n_table, 0);
10505         name = gen_const_xmlChar_ptr(n_name, 1);
10506         userdata = gen_userdata(n_userdata, 2);
10507         f = gen_xmlHashDeallocator(n_f, 3);
10508
10509         ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10510         desret_int(ret_val);
10511         call_tests++;
10512         des_xmlHashTablePtr(n_table, table, 0);
10513         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10514         des_userdata(n_userdata, userdata, 2);
10515         des_xmlHashDeallocator(n_f, f, 3);
10516         xmlResetLastError();
10517         if (mem_base != xmlMemBlocks()) {
10518             printf("Leak of %d blocks found in xmlHashUpdateEntry",
10519                    xmlMemBlocks() - mem_base);
10520             test_ret++;
10521             printf(" %d", n_table);
10522             printf(" %d", n_name);
10523             printf(" %d", n_userdata);
10524             printf(" %d", n_f);
10525             printf("\n");
10526         }
10527     }
10528     }
10529     }
10530     }
10531     function_tests++;
10532
10533     return(test_ret);
10534 }
10535
10536
10537 static int
10538 test_xmlHashUpdateEntry2(void) {
10539     int test_ret = 0;
10540
10541     int mem_base;
10542     int ret_val;
10543     xmlHashTablePtr table; /* the hash table */
10544     int n_table;
10545     xmlChar * name; /* the name of the userdata */
10546     int n_name;
10547     xmlChar * name2; /* a second name of the userdata */
10548     int n_name2;
10549     void * userdata; /* a pointer to the userdata */
10550     int n_userdata;
10551     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10552     int n_f;
10553
10554     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10555     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10556     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10557     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10558     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10559         mem_base = xmlMemBlocks();
10560         table = gen_xmlHashTablePtr(n_table, 0);
10561         name = gen_const_xmlChar_ptr(n_name, 1);
10562         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10563         userdata = gen_userdata(n_userdata, 3);
10564         f = gen_xmlHashDeallocator(n_f, 4);
10565
10566         ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10567         desret_int(ret_val);
10568         call_tests++;
10569         des_xmlHashTablePtr(n_table, table, 0);
10570         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10571         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10572         des_userdata(n_userdata, userdata, 3);
10573         des_xmlHashDeallocator(n_f, f, 4);
10574         xmlResetLastError();
10575         if (mem_base != xmlMemBlocks()) {
10576             printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10577                    xmlMemBlocks() - mem_base);
10578             test_ret++;
10579             printf(" %d", n_table);
10580             printf(" %d", n_name);
10581             printf(" %d", n_name2);
10582             printf(" %d", n_userdata);
10583             printf(" %d", n_f);
10584             printf("\n");
10585         }
10586     }
10587     }
10588     }
10589     }
10590     }
10591     function_tests++;
10592
10593     return(test_ret);
10594 }
10595
10596
10597 static int
10598 test_xmlHashUpdateEntry3(void) {
10599     int test_ret = 0;
10600
10601     int mem_base;
10602     int ret_val;
10603     xmlHashTablePtr table; /* the hash table */
10604     int n_table;
10605     xmlChar * name; /* the name of the userdata */
10606     int n_name;
10607     xmlChar * name2; /* a second name of the userdata */
10608     int n_name2;
10609     xmlChar * name3; /* a third name of the userdata */
10610     int n_name3;
10611     void * userdata; /* a pointer to the userdata */
10612     int n_userdata;
10613     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10614     int n_f;
10615
10616     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10617     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10618     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10619     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10620     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10621     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10622         mem_base = xmlMemBlocks();
10623         table = gen_xmlHashTablePtr(n_table, 0);
10624         name = gen_const_xmlChar_ptr(n_name, 1);
10625         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10626         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10627         userdata = gen_userdata(n_userdata, 4);
10628         f = gen_xmlHashDeallocator(n_f, 5);
10629
10630         ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10631         desret_int(ret_val);
10632         call_tests++;
10633         des_xmlHashTablePtr(n_table, table, 0);
10634         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10635         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10636         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10637         des_userdata(n_userdata, userdata, 4);
10638         des_xmlHashDeallocator(n_f, f, 5);
10639         xmlResetLastError();
10640         if (mem_base != xmlMemBlocks()) {
10641             printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10642                    xmlMemBlocks() - mem_base);
10643             test_ret++;
10644             printf(" %d", n_table);
10645             printf(" %d", n_name);
10646             printf(" %d", n_name2);
10647             printf(" %d", n_name3);
10648             printf(" %d", n_userdata);
10649             printf(" %d", n_f);
10650             printf("\n");
10651         }
10652     }
10653     }
10654     }
10655     }
10656     }
10657     }
10658     function_tests++;
10659
10660     return(test_ret);
10661 }
10662
10663 static int
10664 test_hash(void) {
10665     int test_ret = 0;
10666
10667     if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10668     test_ret += test_xmlHashAddEntry();
10669     test_ret += test_xmlHashAddEntry2();
10670     test_ret += test_xmlHashAddEntry3();
10671     test_ret += test_xmlHashCopy();
10672     test_ret += test_xmlHashCreate();
10673     test_ret += test_xmlHashCreateDict();
10674     test_ret += test_xmlHashLookup();
10675     test_ret += test_xmlHashLookup2();
10676     test_ret += test_xmlHashLookup3();
10677     test_ret += test_xmlHashQLookup();
10678     test_ret += test_xmlHashQLookup2();
10679     test_ret += test_xmlHashQLookup3();
10680     test_ret += test_xmlHashRemoveEntry();
10681     test_ret += test_xmlHashRemoveEntry2();
10682     test_ret += test_xmlHashRemoveEntry3();
10683     test_ret += test_xmlHashScan();
10684     test_ret += test_xmlHashScan3();
10685     test_ret += test_xmlHashScanFull();
10686     test_ret += test_xmlHashScanFull3();
10687     test_ret += test_xmlHashSize();
10688     test_ret += test_xmlHashUpdateEntry();
10689     test_ret += test_xmlHashUpdateEntry2();
10690     test_ret += test_xmlHashUpdateEntry3();
10691
10692     if (test_ret != 0)
10693         printf("Module hash: %d errors\n", test_ret);
10694     return(test_ret);
10695 }
10696
10697 #define gen_nb_xmlLinkPtr 1
10698 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10699     return(NULL);
10700 }
10701 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10702 }
10703
10704 static int
10705 test_xmlLinkGetData(void) {
10706     int test_ret = 0;
10707
10708     int mem_base;
10709     void * ret_val;
10710     xmlLinkPtr lk; /* a link */
10711     int n_lk;
10712
10713     for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10714         mem_base = xmlMemBlocks();
10715         lk = gen_xmlLinkPtr(n_lk, 0);
10716
10717         ret_val = xmlLinkGetData(lk);
10718         desret_void_ptr(ret_val);
10719         call_tests++;
10720         des_xmlLinkPtr(n_lk, lk, 0);
10721         xmlResetLastError();
10722         if (mem_base != xmlMemBlocks()) {
10723             printf("Leak of %d blocks found in xmlLinkGetData",
10724                    xmlMemBlocks() - mem_base);
10725             test_ret++;
10726             printf(" %d", n_lk);
10727             printf("\n");
10728         }
10729     }
10730     function_tests++;
10731
10732     return(test_ret);
10733 }
10734
10735
10736 static int
10737 test_xmlListAppend(void) {
10738     int test_ret = 0;
10739
10740     int mem_base;
10741     int ret_val;
10742     xmlListPtr l; /* a list */
10743     int n_l;
10744     void * data; /* the data */
10745     int n_data;
10746
10747     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10748     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10749         mem_base = xmlMemBlocks();
10750         l = gen_xmlListPtr(n_l, 0);
10751         data = gen_userdata(n_data, 1);
10752
10753         ret_val = xmlListAppend(l, data);
10754         desret_int(ret_val);
10755         call_tests++;
10756         des_xmlListPtr(n_l, l, 0);
10757         des_userdata(n_data, data, 1);
10758         xmlResetLastError();
10759         if (mem_base != xmlMemBlocks()) {
10760             printf("Leak of %d blocks found in xmlListAppend",
10761                    xmlMemBlocks() - mem_base);
10762             test_ret++;
10763             printf(" %d", n_l);
10764             printf(" %d", n_data);
10765             printf("\n");
10766         }
10767     }
10768     }
10769     function_tests++;
10770
10771     return(test_ret);
10772 }
10773
10774
10775 static int
10776 test_xmlListClear(void) {
10777     int test_ret = 0;
10778
10779     int mem_base;
10780     xmlListPtr l; /* a list */
10781     int n_l;
10782
10783     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10784         mem_base = xmlMemBlocks();
10785         l = gen_xmlListPtr(n_l, 0);
10786
10787         xmlListClear(l);
10788         call_tests++;
10789         des_xmlListPtr(n_l, l, 0);
10790         xmlResetLastError();
10791         if (mem_base != xmlMemBlocks()) {
10792             printf("Leak of %d blocks found in xmlListClear",
10793                    xmlMemBlocks() - mem_base);
10794             test_ret++;
10795             printf(" %d", n_l);
10796             printf("\n");
10797         }
10798     }
10799     function_tests++;
10800
10801     return(test_ret);
10802 }
10803
10804
10805 #define gen_nb_const_xmlListPtr 1
10806 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10807     return(NULL);
10808 }
10809 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10810 }
10811
10812 static int
10813 test_xmlListCopy(void) {
10814     int test_ret = 0;
10815
10816     int mem_base;
10817     int ret_val;
10818     xmlListPtr cur; /* the new list */
10819     int n_cur;
10820     xmlListPtr old; /* the old list */
10821     int n_old;
10822
10823     for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10824     for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10825         mem_base = xmlMemBlocks();
10826         cur = gen_xmlListPtr(n_cur, 0);
10827         old = gen_const_xmlListPtr(n_old, 1);
10828
10829         ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10830         desret_int(ret_val);
10831         call_tests++;
10832         des_xmlListPtr(n_cur, cur, 0);
10833         des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10834         xmlResetLastError();
10835         if (mem_base != xmlMemBlocks()) {
10836             printf("Leak of %d blocks found in xmlListCopy",
10837                    xmlMemBlocks() - mem_base);
10838             test_ret++;
10839             printf(" %d", n_cur);
10840             printf(" %d", n_old);
10841             printf("\n");
10842         }
10843     }
10844     }
10845     function_tests++;
10846
10847     return(test_ret);
10848 }
10849
10850
10851 static int
10852 test_xmlListCreate(void) {
10853     int test_ret = 0;
10854
10855
10856     /* missing type support */
10857     return(test_ret);
10858 }
10859
10860
10861 static int
10862 test_xmlListDup(void) {
10863     int test_ret = 0;
10864
10865
10866     /* missing type support */
10867     return(test_ret);
10868 }
10869
10870
10871 static int
10872 test_xmlListEmpty(void) {
10873     int test_ret = 0;
10874
10875     int mem_base;
10876     int ret_val;
10877     xmlListPtr l; /* a list */
10878     int n_l;
10879
10880     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10881         mem_base = xmlMemBlocks();
10882         l = gen_xmlListPtr(n_l, 0);
10883
10884         ret_val = xmlListEmpty(l);
10885         desret_int(ret_val);
10886         call_tests++;
10887         des_xmlListPtr(n_l, l, 0);
10888         xmlResetLastError();
10889         if (mem_base != xmlMemBlocks()) {
10890             printf("Leak of %d blocks found in xmlListEmpty",
10891                    xmlMemBlocks() - mem_base);
10892             test_ret++;
10893             printf(" %d", n_l);
10894             printf("\n");
10895         }
10896     }
10897     function_tests++;
10898
10899     return(test_ret);
10900 }
10901
10902
10903 static int
10904 test_xmlListEnd(void) {
10905     int test_ret = 0;
10906
10907
10908     /* missing type support */
10909     return(test_ret);
10910 }
10911
10912
10913 static int
10914 test_xmlListFront(void) {
10915     int test_ret = 0;
10916
10917
10918     /* missing type support */
10919     return(test_ret);
10920 }
10921
10922
10923 static int
10924 test_xmlListInsert(void) {
10925     int test_ret = 0;
10926
10927     int mem_base;
10928     int ret_val;
10929     xmlListPtr l; /* a list */
10930     int n_l;
10931     void * data; /* the data */
10932     int n_data;
10933
10934     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10935     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10936         mem_base = xmlMemBlocks();
10937         l = gen_xmlListPtr(n_l, 0);
10938         data = gen_userdata(n_data, 1);
10939
10940         ret_val = xmlListInsert(l, data);
10941         desret_int(ret_val);
10942         call_tests++;
10943         des_xmlListPtr(n_l, l, 0);
10944         des_userdata(n_data, data, 1);
10945         xmlResetLastError();
10946         if (mem_base != xmlMemBlocks()) {
10947             printf("Leak of %d blocks found in xmlListInsert",
10948                    xmlMemBlocks() - mem_base);
10949             test_ret++;
10950             printf(" %d", n_l);
10951             printf(" %d", n_data);
10952             printf("\n");
10953         }
10954     }
10955     }
10956     function_tests++;
10957
10958     return(test_ret);
10959 }
10960
10961
10962 static int
10963 test_xmlListMerge(void) {
10964     int test_ret = 0;
10965
10966     int mem_base;
10967     xmlListPtr l1; /* the original list */
10968     int n_l1;
10969     xmlListPtr l2; /* the new list */
10970     int n_l2;
10971
10972     for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10973     for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10974         mem_base = xmlMemBlocks();
10975         l1 = gen_xmlListPtr(n_l1, 0);
10976         l2 = gen_xmlListPtr(n_l2, 1);
10977
10978         xmlListMerge(l1, l2);
10979         call_tests++;
10980         des_xmlListPtr(n_l1, l1, 0);
10981         des_xmlListPtr(n_l2, l2, 1);
10982         xmlResetLastError();
10983         if (mem_base != xmlMemBlocks()) {
10984             printf("Leak of %d blocks found in xmlListMerge",
10985                    xmlMemBlocks() - mem_base);
10986             test_ret++;
10987             printf(" %d", n_l1);
10988             printf(" %d", n_l2);
10989             printf("\n");
10990         }
10991     }
10992     }
10993     function_tests++;
10994
10995     return(test_ret);
10996 }
10997
10998
10999 static int
11000 test_xmlListPopBack(void) {
11001     int test_ret = 0;
11002
11003     int mem_base;
11004     xmlListPtr l; /* a list */
11005     int n_l;
11006
11007     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11008         mem_base = xmlMemBlocks();
11009         l = gen_xmlListPtr(n_l, 0);
11010
11011         xmlListPopBack(l);
11012         call_tests++;
11013         des_xmlListPtr(n_l, l, 0);
11014         xmlResetLastError();
11015         if (mem_base != xmlMemBlocks()) {
11016             printf("Leak of %d blocks found in xmlListPopBack",
11017                    xmlMemBlocks() - mem_base);
11018             test_ret++;
11019             printf(" %d", n_l);
11020             printf("\n");
11021         }
11022     }
11023     function_tests++;
11024
11025     return(test_ret);
11026 }
11027
11028
11029 static int
11030 test_xmlListPopFront(void) {
11031     int test_ret = 0;
11032
11033     int mem_base;
11034     xmlListPtr l; /* a list */
11035     int n_l;
11036
11037     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11038         mem_base = xmlMemBlocks();
11039         l = gen_xmlListPtr(n_l, 0);
11040
11041         xmlListPopFront(l);
11042         call_tests++;
11043         des_xmlListPtr(n_l, l, 0);
11044         xmlResetLastError();
11045         if (mem_base != xmlMemBlocks()) {
11046             printf("Leak of %d blocks found in xmlListPopFront",
11047                    xmlMemBlocks() - mem_base);
11048             test_ret++;
11049             printf(" %d", n_l);
11050             printf("\n");
11051         }
11052     }
11053     function_tests++;
11054
11055     return(test_ret);
11056 }
11057
11058
11059 static int
11060 test_xmlListPushBack(void) {
11061     int test_ret = 0;
11062
11063     int mem_base;
11064     int ret_val;
11065     xmlListPtr l; /* a list */
11066     int n_l;
11067     void * data; /* new data */
11068     int n_data;
11069
11070     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11071     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11072         mem_base = xmlMemBlocks();
11073         l = gen_xmlListPtr(n_l, 0);
11074         data = gen_userdata(n_data, 1);
11075
11076         ret_val = xmlListPushBack(l, data);
11077         desret_int(ret_val);
11078         call_tests++;
11079         des_xmlListPtr(n_l, l, 0);
11080         des_userdata(n_data, data, 1);
11081         xmlResetLastError();
11082         if (mem_base != xmlMemBlocks()) {
11083             printf("Leak of %d blocks found in xmlListPushBack",
11084                    xmlMemBlocks() - mem_base);
11085             test_ret++;
11086             printf(" %d", n_l);
11087             printf(" %d", n_data);
11088             printf("\n");
11089         }
11090     }
11091     }
11092     function_tests++;
11093
11094     return(test_ret);
11095 }
11096
11097
11098 static int
11099 test_xmlListPushFront(void) {
11100     int test_ret = 0;
11101
11102     int mem_base;
11103     int ret_val;
11104     xmlListPtr l; /* a list */
11105     int n_l;
11106     void * data; /* new data */
11107     int n_data;
11108
11109     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11110     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11111         mem_base = xmlMemBlocks();
11112         l = gen_xmlListPtr(n_l, 0);
11113         data = gen_userdata(n_data, 1);
11114
11115         ret_val = xmlListPushFront(l, data);
11116         desret_int(ret_val);
11117         call_tests++;
11118         des_xmlListPtr(n_l, l, 0);
11119         des_userdata(n_data, data, 1);
11120         xmlResetLastError();
11121         if (mem_base != xmlMemBlocks()) {
11122             printf("Leak of %d blocks found in xmlListPushFront",
11123                    xmlMemBlocks() - mem_base);
11124             test_ret++;
11125             printf(" %d", n_l);
11126             printf(" %d", n_data);
11127             printf("\n");
11128         }
11129     }
11130     }
11131     function_tests++;
11132
11133     return(test_ret);
11134 }
11135
11136
11137 static int
11138 test_xmlListRemoveAll(void) {
11139     int test_ret = 0;
11140
11141     int mem_base;
11142     int ret_val;
11143     xmlListPtr l; /* a list */
11144     int n_l;
11145     void * data; /* list data */
11146     int n_data;
11147
11148     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11149     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11150         mem_base = xmlMemBlocks();
11151         l = gen_xmlListPtr(n_l, 0);
11152         data = gen_userdata(n_data, 1);
11153
11154         ret_val = xmlListRemoveAll(l, data);
11155         desret_int(ret_val);
11156         call_tests++;
11157         des_xmlListPtr(n_l, l, 0);
11158         des_userdata(n_data, data, 1);
11159         xmlResetLastError();
11160         if (mem_base != xmlMemBlocks()) {
11161             printf("Leak of %d blocks found in xmlListRemoveAll",
11162                    xmlMemBlocks() - mem_base);
11163             test_ret++;
11164             printf(" %d", n_l);
11165             printf(" %d", n_data);
11166             printf("\n");
11167         }
11168     }
11169     }
11170     function_tests++;
11171
11172     return(test_ret);
11173 }
11174
11175
11176 static int
11177 test_xmlListRemoveFirst(void) {
11178     int test_ret = 0;
11179
11180     int mem_base;
11181     int ret_val;
11182     xmlListPtr l; /* a list */
11183     int n_l;
11184     void * data; /* list data */
11185     int n_data;
11186
11187     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11188     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11189         mem_base = xmlMemBlocks();
11190         l = gen_xmlListPtr(n_l, 0);
11191         data = gen_userdata(n_data, 1);
11192
11193         ret_val = xmlListRemoveFirst(l, data);
11194         desret_int(ret_val);
11195         call_tests++;
11196         des_xmlListPtr(n_l, l, 0);
11197         des_userdata(n_data, data, 1);
11198         xmlResetLastError();
11199         if (mem_base != xmlMemBlocks()) {
11200             printf("Leak of %d blocks found in xmlListRemoveFirst",
11201                    xmlMemBlocks() - mem_base);
11202             test_ret++;
11203             printf(" %d", n_l);
11204             printf(" %d", n_data);
11205             printf("\n");
11206         }
11207     }
11208     }
11209     function_tests++;
11210
11211     return(test_ret);
11212 }
11213
11214
11215 static int
11216 test_xmlListRemoveLast(void) {
11217     int test_ret = 0;
11218
11219     int mem_base;
11220     int ret_val;
11221     xmlListPtr l; /* a list */
11222     int n_l;
11223     void * data; /* list data */
11224     int n_data;
11225
11226     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11227     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11228         mem_base = xmlMemBlocks();
11229         l = gen_xmlListPtr(n_l, 0);
11230         data = gen_userdata(n_data, 1);
11231
11232         ret_val = xmlListRemoveLast(l, data);
11233         desret_int(ret_val);
11234         call_tests++;
11235         des_xmlListPtr(n_l, l, 0);
11236         des_userdata(n_data, data, 1);
11237         xmlResetLastError();
11238         if (mem_base != xmlMemBlocks()) {
11239             printf("Leak of %d blocks found in xmlListRemoveLast",
11240                    xmlMemBlocks() - mem_base);
11241             test_ret++;
11242             printf(" %d", n_l);
11243             printf(" %d", n_data);
11244             printf("\n");
11245         }
11246     }
11247     }
11248     function_tests++;
11249
11250     return(test_ret);
11251 }
11252
11253
11254 static int
11255 test_xmlListReverse(void) {
11256     int test_ret = 0;
11257
11258     int mem_base;
11259     xmlListPtr l; /* a list */
11260     int n_l;
11261
11262     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11263         mem_base = xmlMemBlocks();
11264         l = gen_xmlListPtr(n_l, 0);
11265
11266         xmlListReverse(l);
11267         call_tests++;
11268         des_xmlListPtr(n_l, l, 0);
11269         xmlResetLastError();
11270         if (mem_base != xmlMemBlocks()) {
11271             printf("Leak of %d blocks found in xmlListReverse",
11272                    xmlMemBlocks() - mem_base);
11273             test_ret++;
11274             printf(" %d", n_l);
11275             printf("\n");
11276         }
11277     }
11278     function_tests++;
11279
11280     return(test_ret);
11281 }
11282
11283
11284 static int
11285 test_xmlListReverseSearch(void) {
11286     int test_ret = 0;
11287
11288     int mem_base;
11289     void * ret_val;
11290     xmlListPtr l; /* a list */
11291     int n_l;
11292     void * data; /* a search value */
11293     int n_data;
11294
11295     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11296     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11297         mem_base = xmlMemBlocks();
11298         l = gen_xmlListPtr(n_l, 0);
11299         data = gen_userdata(n_data, 1);
11300
11301         ret_val = xmlListReverseSearch(l, data);
11302         desret_void_ptr(ret_val);
11303         call_tests++;
11304         des_xmlListPtr(n_l, l, 0);
11305         des_userdata(n_data, data, 1);
11306         xmlResetLastError();
11307         if (mem_base != xmlMemBlocks()) {
11308             printf("Leak of %d blocks found in xmlListReverseSearch",
11309                    xmlMemBlocks() - mem_base);
11310             test_ret++;
11311             printf(" %d", n_l);
11312             printf(" %d", n_data);
11313             printf("\n");
11314         }
11315     }
11316     }
11317     function_tests++;
11318
11319     return(test_ret);
11320 }
11321
11322
11323 static int
11324 test_xmlListReverseWalk(void) {
11325     int test_ret = 0;
11326
11327
11328     /* missing type support */
11329     return(test_ret);
11330 }
11331
11332
11333 static int
11334 test_xmlListSearch(void) {
11335     int test_ret = 0;
11336
11337     int mem_base;
11338     void * ret_val;
11339     xmlListPtr l; /* a list */
11340     int n_l;
11341     void * data; /* a search value */
11342     int n_data;
11343
11344     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11345     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11346         mem_base = xmlMemBlocks();
11347         l = gen_xmlListPtr(n_l, 0);
11348         data = gen_userdata(n_data, 1);
11349
11350         ret_val = xmlListSearch(l, data);
11351         desret_void_ptr(ret_val);
11352         call_tests++;
11353         des_xmlListPtr(n_l, l, 0);
11354         des_userdata(n_data, data, 1);
11355         xmlResetLastError();
11356         if (mem_base != xmlMemBlocks()) {
11357             printf("Leak of %d blocks found in xmlListSearch",
11358                    xmlMemBlocks() - mem_base);
11359             test_ret++;
11360             printf(" %d", n_l);
11361             printf(" %d", n_data);
11362             printf("\n");
11363         }
11364     }
11365     }
11366     function_tests++;
11367
11368     return(test_ret);
11369 }
11370
11371
11372 static int
11373 test_xmlListSize(void) {
11374     int test_ret = 0;
11375
11376     int mem_base;
11377     int ret_val;
11378     xmlListPtr l; /* a list */
11379     int n_l;
11380
11381     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11382         mem_base = xmlMemBlocks();
11383         l = gen_xmlListPtr(n_l, 0);
11384
11385         ret_val = xmlListSize(l);
11386         desret_int(ret_val);
11387         call_tests++;
11388         des_xmlListPtr(n_l, l, 0);
11389         xmlResetLastError();
11390         if (mem_base != xmlMemBlocks()) {
11391             printf("Leak of %d blocks found in xmlListSize",
11392                    xmlMemBlocks() - mem_base);
11393             test_ret++;
11394             printf(" %d", n_l);
11395             printf("\n");
11396         }
11397     }
11398     function_tests++;
11399
11400     return(test_ret);
11401 }
11402
11403
11404 static int
11405 test_xmlListSort(void) {
11406     int test_ret = 0;
11407
11408     int mem_base;
11409     xmlListPtr l; /* a list */
11410     int n_l;
11411
11412     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11413         mem_base = xmlMemBlocks();
11414         l = gen_xmlListPtr(n_l, 0);
11415
11416         xmlListSort(l);
11417         call_tests++;
11418         des_xmlListPtr(n_l, l, 0);
11419         xmlResetLastError();
11420         if (mem_base != xmlMemBlocks()) {
11421             printf("Leak of %d blocks found in xmlListSort",
11422                    xmlMemBlocks() - mem_base);
11423             test_ret++;
11424             printf(" %d", n_l);
11425             printf("\n");
11426         }
11427     }
11428     function_tests++;
11429
11430     return(test_ret);
11431 }
11432
11433
11434 static int
11435 test_xmlListWalk(void) {
11436     int test_ret = 0;
11437
11438
11439     /* missing type support */
11440     return(test_ret);
11441 }
11442
11443 static int
11444 test_list(void) {
11445     int test_ret = 0;
11446
11447     if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11448     test_ret += test_xmlLinkGetData();
11449     test_ret += test_xmlListAppend();
11450     test_ret += test_xmlListClear();
11451     test_ret += test_xmlListCopy();
11452     test_ret += test_xmlListCreate();
11453     test_ret += test_xmlListDup();
11454     test_ret += test_xmlListEmpty();
11455     test_ret += test_xmlListEnd();
11456     test_ret += test_xmlListFront();
11457     test_ret += test_xmlListInsert();
11458     test_ret += test_xmlListMerge();
11459     test_ret += test_xmlListPopBack();
11460     test_ret += test_xmlListPopFront();
11461     test_ret += test_xmlListPushBack();
11462     test_ret += test_xmlListPushFront();
11463     test_ret += test_xmlListRemoveAll();
11464     test_ret += test_xmlListRemoveFirst();
11465     test_ret += test_xmlListRemoveLast();
11466     test_ret += test_xmlListReverse();
11467     test_ret += test_xmlListReverseSearch();
11468     test_ret += test_xmlListReverseWalk();
11469     test_ret += test_xmlListSearch();
11470     test_ret += test_xmlListSize();
11471     test_ret += test_xmlListSort();
11472     test_ret += test_xmlListWalk();
11473
11474     if (test_ret != 0)
11475         printf("Module list: %d errors\n", test_ret);
11476     return(test_ret);
11477 }
11478
11479 static int
11480 test_xmlNanoFTPCheckResponse(void) {
11481     int test_ret = 0;
11482
11483 #if defined(LIBXML_FTP_ENABLED)
11484     int mem_base;
11485     int ret_val;
11486     void * ctx; /* an FTP context */
11487     int n_ctx;
11488
11489     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11490         mem_base = xmlMemBlocks();
11491         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11492
11493         ret_val = xmlNanoFTPCheckResponse(ctx);
11494         desret_int(ret_val);
11495         call_tests++;
11496         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11497         xmlResetLastError();
11498         if (mem_base != xmlMemBlocks()) {
11499             printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11500                    xmlMemBlocks() - mem_base);
11501             test_ret++;
11502             printf(" %d", n_ctx);
11503             printf("\n");
11504         }
11505     }
11506     function_tests++;
11507 #endif
11508
11509     return(test_ret);
11510 }
11511
11512
11513 static int
11514 test_xmlNanoFTPCleanup(void) {
11515     int test_ret = 0;
11516
11517 #if defined(LIBXML_FTP_ENABLED)
11518     int mem_base;
11519
11520         mem_base = xmlMemBlocks();
11521
11522         xmlNanoFTPCleanup();
11523         call_tests++;
11524         xmlResetLastError();
11525         if (mem_base != xmlMemBlocks()) {
11526             printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11527                    xmlMemBlocks() - mem_base);
11528             test_ret++;
11529             printf("\n");
11530         }
11531     function_tests++;
11532 #endif
11533
11534     return(test_ret);
11535 }
11536
11537
11538 static int
11539 test_xmlNanoFTPCloseConnection(void) {
11540     int test_ret = 0;
11541
11542 #if defined(LIBXML_FTP_ENABLED)
11543     int mem_base;
11544     int ret_val;
11545     void * ctx; /* an FTP context */
11546     int n_ctx;
11547
11548     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11549         mem_base = xmlMemBlocks();
11550         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11551
11552         ret_val = xmlNanoFTPCloseConnection(ctx);
11553         desret_int(ret_val);
11554         call_tests++;
11555         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11556         xmlResetLastError();
11557         if (mem_base != xmlMemBlocks()) {
11558             printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11559                    xmlMemBlocks() - mem_base);
11560             test_ret++;
11561             printf(" %d", n_ctx);
11562             printf("\n");
11563         }
11564     }
11565     function_tests++;
11566 #endif
11567
11568     return(test_ret);
11569 }
11570
11571
11572 static int
11573 test_xmlNanoFTPCwd(void) {
11574     int test_ret = 0;
11575
11576 #if defined(LIBXML_FTP_ENABLED)
11577     int mem_base;
11578     int ret_val;
11579     void * ctx; /* an FTP context */
11580     int n_ctx;
11581     char * directory; /* a directory on the server */
11582     int n_directory;
11583
11584     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11585     for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11586         mem_base = xmlMemBlocks();
11587         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11588         directory = gen_const_char_ptr(n_directory, 1);
11589
11590         ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11591         desret_int(ret_val);
11592         call_tests++;
11593         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11594         des_const_char_ptr(n_directory, (const char *)directory, 1);
11595         xmlResetLastError();
11596         if (mem_base != xmlMemBlocks()) {
11597             printf("Leak of %d blocks found in xmlNanoFTPCwd",
11598                    xmlMemBlocks() - mem_base);
11599             test_ret++;
11600             printf(" %d", n_ctx);
11601             printf(" %d", n_directory);
11602             printf("\n");
11603         }
11604     }
11605     }
11606     function_tests++;
11607 #endif
11608
11609     return(test_ret);
11610 }
11611
11612
11613 static int
11614 test_xmlNanoFTPDele(void) {
11615     int test_ret = 0;
11616
11617 #if defined(LIBXML_FTP_ENABLED)
11618     int mem_base;
11619     int ret_val;
11620     void * ctx; /* an FTP context */
11621     int n_ctx;
11622     const char * file; /* a file or directory on the server */
11623     int n_file;
11624
11625     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11626     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11627         mem_base = xmlMemBlocks();
11628         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11629         file = gen_filepath(n_file, 1);
11630
11631         ret_val = xmlNanoFTPDele(ctx, file);
11632         desret_int(ret_val);
11633         call_tests++;
11634         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11635         des_filepath(n_file, file, 1);
11636         xmlResetLastError();
11637         if (mem_base != xmlMemBlocks()) {
11638             printf("Leak of %d blocks found in xmlNanoFTPDele",
11639                    xmlMemBlocks() - mem_base);
11640             test_ret++;
11641             printf(" %d", n_ctx);
11642             printf(" %d", n_file);
11643             printf("\n");
11644         }
11645     }
11646     }
11647     function_tests++;
11648 #endif
11649
11650     return(test_ret);
11651 }
11652
11653
11654 static int
11655 test_xmlNanoFTPGet(void) {
11656     int test_ret = 0;
11657
11658
11659     /* missing type support */
11660     return(test_ret);
11661 }
11662
11663
11664 static int
11665 test_xmlNanoFTPGetConnection(void) {
11666     int test_ret = 0;
11667
11668
11669     /* missing type support */
11670     return(test_ret);
11671 }
11672
11673
11674 static int
11675 test_xmlNanoFTPGetResponse(void) {
11676     int test_ret = 0;
11677
11678 #if defined(LIBXML_FTP_ENABLED)
11679     int mem_base;
11680     int ret_val;
11681     void * ctx; /* an FTP context */
11682     int n_ctx;
11683
11684     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11685         mem_base = xmlMemBlocks();
11686         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11687
11688         ret_val = xmlNanoFTPGetResponse(ctx);
11689         desret_int(ret_val);
11690         call_tests++;
11691         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11692         xmlResetLastError();
11693         if (mem_base != xmlMemBlocks()) {
11694             printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11695                    xmlMemBlocks() - mem_base);
11696             test_ret++;
11697             printf(" %d", n_ctx);
11698             printf("\n");
11699         }
11700     }
11701     function_tests++;
11702 #endif
11703
11704     return(test_ret);
11705 }
11706
11707
11708 static int
11709 test_xmlNanoFTPGetSocket(void) {
11710     int test_ret = 0;
11711
11712
11713     /* missing type support */
11714     return(test_ret);
11715 }
11716
11717
11718 static int
11719 test_xmlNanoFTPInit(void) {
11720     int test_ret = 0;
11721
11722 #if defined(LIBXML_FTP_ENABLED)
11723     int mem_base;
11724
11725         mem_base = xmlMemBlocks();
11726
11727         xmlNanoFTPInit();
11728         call_tests++;
11729         xmlResetLastError();
11730         if (mem_base != xmlMemBlocks()) {
11731             printf("Leak of %d blocks found in xmlNanoFTPInit",
11732                    xmlMemBlocks() - mem_base);
11733             test_ret++;
11734             printf("\n");
11735         }
11736     function_tests++;
11737 #endif
11738
11739     return(test_ret);
11740 }
11741
11742
11743 static int
11744 test_xmlNanoFTPList(void) {
11745     int test_ret = 0;
11746
11747
11748     /* missing type support */
11749     return(test_ret);
11750 }
11751
11752
11753 static int
11754 test_xmlNanoFTPNewCtxt(void) {
11755     int test_ret = 0;
11756
11757 #if defined(LIBXML_FTP_ENABLED)
11758     int mem_base;
11759     void * ret_val;
11760     const char * URL; /* The URL used to initialize the context */
11761     int n_URL;
11762
11763     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11764         mem_base = xmlMemBlocks();
11765         URL = gen_filepath(n_URL, 0);
11766
11767         ret_val = xmlNanoFTPNewCtxt(URL);
11768         desret_xmlNanoFTPCtxtPtr(ret_val);
11769         call_tests++;
11770         des_filepath(n_URL, URL, 0);
11771         xmlResetLastError();
11772         if (mem_base != xmlMemBlocks()) {
11773             printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11774                    xmlMemBlocks() - mem_base);
11775             test_ret++;
11776             printf(" %d", n_URL);
11777             printf("\n");
11778         }
11779     }
11780     function_tests++;
11781 #endif
11782
11783     return(test_ret);
11784 }
11785
11786
11787 static int
11788 test_xmlNanoFTPOpen(void) {
11789     int test_ret = 0;
11790
11791 #if defined(LIBXML_FTP_ENABLED)
11792     int mem_base;
11793     void * ret_val;
11794     const char * URL; /* the URL to the resource */
11795     int n_URL;
11796
11797     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11798         mem_base = xmlMemBlocks();
11799         URL = gen_filepath(n_URL, 0);
11800
11801         ret_val = xmlNanoFTPOpen(URL);
11802         desret_xmlNanoFTPCtxtPtr(ret_val);
11803         call_tests++;
11804         des_filepath(n_URL, URL, 0);
11805         xmlResetLastError();
11806         if (mem_base != xmlMemBlocks()) {
11807             printf("Leak of %d blocks found in xmlNanoFTPOpen",
11808                    xmlMemBlocks() - mem_base);
11809             test_ret++;
11810             printf(" %d", n_URL);
11811             printf("\n");
11812         }
11813     }
11814     function_tests++;
11815 #endif
11816
11817     return(test_ret);
11818 }
11819
11820
11821 static int
11822 test_xmlNanoFTPProxy(void) {
11823     int test_ret = 0;
11824
11825 #if defined(LIBXML_FTP_ENABLED)
11826     char * host; /* the proxy host name */
11827     int n_host;
11828     int port; /* the proxy port */
11829     int n_port;
11830     char * user; /* the proxy user name */
11831     int n_user;
11832     char * passwd; /* the proxy password */
11833     int n_passwd;
11834     int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11835     int n_type;
11836
11837     for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11838     for (n_port = 0;n_port < gen_nb_int;n_port++) {
11839     for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11840     for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11841     for (n_type = 0;n_type < gen_nb_int;n_type++) {
11842         host = gen_const_char_ptr(n_host, 0);
11843         port = gen_int(n_port, 1);
11844         user = gen_const_char_ptr(n_user, 2);
11845         passwd = gen_const_char_ptr(n_passwd, 3);
11846         type = gen_int(n_type, 4);
11847
11848         xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11849         call_tests++;
11850         des_const_char_ptr(n_host, (const char *)host, 0);
11851         des_int(n_port, port, 1);
11852         des_const_char_ptr(n_user, (const char *)user, 2);
11853         des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11854         des_int(n_type, type, 4);
11855         xmlResetLastError();
11856     }
11857     }
11858     }
11859     }
11860     }
11861     function_tests++;
11862 #endif
11863
11864     return(test_ret);
11865 }
11866
11867
11868 static int
11869 test_xmlNanoFTPQuit(void) {
11870     int test_ret = 0;
11871
11872 #if defined(LIBXML_FTP_ENABLED)
11873     int mem_base;
11874     int ret_val;
11875     void * ctx; /* an FTP context */
11876     int n_ctx;
11877
11878     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11879         mem_base = xmlMemBlocks();
11880         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11881
11882         ret_val = xmlNanoFTPQuit(ctx);
11883         desret_int(ret_val);
11884         call_tests++;
11885         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11886         xmlResetLastError();
11887         if (mem_base != xmlMemBlocks()) {
11888             printf("Leak of %d blocks found in xmlNanoFTPQuit",
11889                    xmlMemBlocks() - mem_base);
11890             test_ret++;
11891             printf(" %d", n_ctx);
11892             printf("\n");
11893         }
11894     }
11895     function_tests++;
11896 #endif
11897
11898     return(test_ret);
11899 }
11900
11901
11902 static int
11903 test_xmlNanoFTPRead(void) {
11904     int test_ret = 0;
11905
11906 #if defined(LIBXML_FTP_ENABLED)
11907     int mem_base;
11908     int ret_val;
11909     void * ctx; /* the FTP context */
11910     int n_ctx;
11911     void * dest; /* a buffer */
11912     int n_dest;
11913     int len; /* the buffer length */
11914     int n_len;
11915
11916     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11917     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11918     for (n_len = 0;n_len < gen_nb_int;n_len++) {
11919         mem_base = xmlMemBlocks();
11920         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11921         dest = gen_void_ptr(n_dest, 1);
11922         len = gen_int(n_len, 2);
11923
11924         ret_val = xmlNanoFTPRead(ctx, dest, len);
11925         desret_int(ret_val);
11926         call_tests++;
11927         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11928         des_void_ptr(n_dest, dest, 1);
11929         des_int(n_len, len, 2);
11930         xmlResetLastError();
11931         if (mem_base != xmlMemBlocks()) {
11932             printf("Leak of %d blocks found in xmlNanoFTPRead",
11933                    xmlMemBlocks() - mem_base);
11934             test_ret++;
11935             printf(" %d", n_ctx);
11936             printf(" %d", n_dest);
11937             printf(" %d", n_len);
11938             printf("\n");
11939         }
11940     }
11941     }
11942     }
11943     function_tests++;
11944 #endif
11945
11946     return(test_ret);
11947 }
11948
11949
11950 static int
11951 test_xmlNanoFTPScanProxy(void) {
11952     int test_ret = 0;
11953
11954 #if defined(LIBXML_FTP_ENABLED)
11955     const char * URL; /* The proxy URL used to initialize the proxy context */
11956     int n_URL;
11957
11958     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11959         URL = gen_filepath(n_URL, 0);
11960
11961         xmlNanoFTPScanProxy(URL);
11962         call_tests++;
11963         des_filepath(n_URL, URL, 0);
11964         xmlResetLastError();
11965     }
11966     function_tests++;
11967 #endif
11968
11969     return(test_ret);
11970 }
11971
11972
11973 static int
11974 test_xmlNanoFTPUpdateURL(void) {
11975     int test_ret = 0;
11976
11977 #if defined(LIBXML_FTP_ENABLED)
11978     int mem_base;
11979     int ret_val;
11980     void * ctx; /* an FTP context */
11981     int n_ctx;
11982     const char * URL; /* The URL used to update the context */
11983     int n_URL;
11984
11985     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11986     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11987         mem_base = xmlMemBlocks();
11988         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11989         URL = gen_filepath(n_URL, 1);
11990
11991         ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11992         desret_int(ret_val);
11993         call_tests++;
11994         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11995         des_filepath(n_URL, URL, 1);
11996         xmlResetLastError();
11997         if (mem_base != xmlMemBlocks()) {
11998             printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11999                    xmlMemBlocks() - mem_base);
12000             test_ret++;
12001             printf(" %d", n_ctx);
12002             printf(" %d", n_URL);
12003             printf("\n");
12004         }
12005     }
12006     }
12007     function_tests++;
12008 #endif
12009
12010     return(test_ret);
12011 }
12012
12013 static int
12014 test_nanoftp(void) {
12015     int test_ret = 0;
12016
12017     if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12018     test_ret += test_xmlNanoFTPCheckResponse();
12019     test_ret += test_xmlNanoFTPCleanup();
12020     test_ret += test_xmlNanoFTPCloseConnection();
12021     test_ret += test_xmlNanoFTPCwd();
12022     test_ret += test_xmlNanoFTPDele();
12023     test_ret += test_xmlNanoFTPGet();
12024     test_ret += test_xmlNanoFTPGetConnection();
12025     test_ret += test_xmlNanoFTPGetResponse();
12026     test_ret += test_xmlNanoFTPGetSocket();
12027     test_ret += test_xmlNanoFTPInit();
12028     test_ret += test_xmlNanoFTPList();
12029     test_ret += test_xmlNanoFTPNewCtxt();
12030     test_ret += test_xmlNanoFTPOpen();
12031     test_ret += test_xmlNanoFTPProxy();
12032     test_ret += test_xmlNanoFTPQuit();
12033     test_ret += test_xmlNanoFTPRead();
12034     test_ret += test_xmlNanoFTPScanProxy();
12035     test_ret += test_xmlNanoFTPUpdateURL();
12036
12037     if (test_ret != 0)
12038         printf("Module nanoftp: %d errors\n", test_ret);
12039     return(test_ret);
12040 }
12041
12042 static int
12043 test_xmlNanoHTTPAuthHeader(void) {
12044     int test_ret = 0;
12045
12046 #if defined(LIBXML_HTTP_ENABLED)
12047     int mem_base;
12048     const char * ret_val;
12049     void * ctx; /* the HTTP context */
12050     int n_ctx;
12051
12052     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12053         mem_base = xmlMemBlocks();
12054         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12055
12056         ret_val = xmlNanoHTTPAuthHeader(ctx);
12057         desret_const_char_ptr(ret_val);
12058         call_tests++;
12059         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12060         xmlResetLastError();
12061         if (mem_base != xmlMemBlocks()) {
12062             printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12063                    xmlMemBlocks() - mem_base);
12064             test_ret++;
12065             printf(" %d", n_ctx);
12066             printf("\n");
12067         }
12068     }
12069     function_tests++;
12070 #endif
12071
12072     return(test_ret);
12073 }
12074
12075
12076 static int
12077 test_xmlNanoHTTPCleanup(void) {
12078     int test_ret = 0;
12079
12080 #if defined(LIBXML_HTTP_ENABLED)
12081     int mem_base;
12082
12083         mem_base = xmlMemBlocks();
12084
12085         xmlNanoHTTPCleanup();
12086         call_tests++;
12087         xmlResetLastError();
12088         if (mem_base != xmlMemBlocks()) {
12089             printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12090                    xmlMemBlocks() - mem_base);
12091             test_ret++;
12092             printf("\n");
12093         }
12094     function_tests++;
12095 #endif
12096
12097     return(test_ret);
12098 }
12099
12100
12101 static int
12102 test_xmlNanoHTTPContentLength(void) {
12103     int test_ret = 0;
12104
12105 #if defined(LIBXML_HTTP_ENABLED)
12106     int mem_base;
12107     int ret_val;
12108     void * ctx; /* the HTTP context */
12109     int n_ctx;
12110
12111     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12112         mem_base = xmlMemBlocks();
12113         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12114
12115         ret_val = xmlNanoHTTPContentLength(ctx);
12116         desret_int(ret_val);
12117         call_tests++;
12118         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12119         xmlResetLastError();
12120         if (mem_base != xmlMemBlocks()) {
12121             printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12122                    xmlMemBlocks() - mem_base);
12123             test_ret++;
12124             printf(" %d", n_ctx);
12125             printf("\n");
12126         }
12127     }
12128     function_tests++;
12129 #endif
12130
12131     return(test_ret);
12132 }
12133
12134
12135 static int
12136 test_xmlNanoHTTPEncoding(void) {
12137     int test_ret = 0;
12138
12139 #if defined(LIBXML_HTTP_ENABLED)
12140     int mem_base;
12141     const char * ret_val;
12142     void * ctx; /* the HTTP context */
12143     int n_ctx;
12144
12145     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12146         mem_base = xmlMemBlocks();
12147         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12148
12149         ret_val = xmlNanoHTTPEncoding(ctx);
12150         desret_const_char_ptr(ret_val);
12151         call_tests++;
12152         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12153         xmlResetLastError();
12154         if (mem_base != xmlMemBlocks()) {
12155             printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12156                    xmlMemBlocks() - mem_base);
12157             test_ret++;
12158             printf(" %d", n_ctx);
12159             printf("\n");
12160         }
12161     }
12162     function_tests++;
12163 #endif
12164
12165     return(test_ret);
12166 }
12167
12168
12169 #define gen_nb_char_ptr_ptr 1
12170 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12171     return(NULL);
12172 }
12173 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12174 }
12175
12176 static int
12177 test_xmlNanoHTTPFetch(void) {
12178     int test_ret = 0;
12179
12180 #if defined(LIBXML_HTTP_ENABLED)
12181     int mem_base;
12182     int ret_val;
12183     const char * URL; /* The URL to load */
12184     int n_URL;
12185     const char * filename; /* the filename where the content should be saved */
12186     int n_filename;
12187     char ** contentType; /* if available the Content-Type information will be returned at that location */
12188     int n_contentType;
12189
12190     for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12191     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12192     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12193         mem_base = xmlMemBlocks();
12194         URL = gen_fileoutput(n_URL, 0);
12195         filename = gen_fileoutput(n_filename, 1);
12196         contentType = gen_char_ptr_ptr(n_contentType, 2);
12197
12198         ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12199         desret_int(ret_val);
12200         call_tests++;
12201         des_fileoutput(n_URL, URL, 0);
12202         des_fileoutput(n_filename, filename, 1);
12203         des_char_ptr_ptr(n_contentType, contentType, 2);
12204         xmlResetLastError();
12205         if (mem_base != xmlMemBlocks()) {
12206             printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12207                    xmlMemBlocks() - mem_base);
12208             test_ret++;
12209             printf(" %d", n_URL);
12210             printf(" %d", n_filename);
12211             printf(" %d", n_contentType);
12212             printf("\n");
12213         }
12214     }
12215     }
12216     }
12217     function_tests++;
12218 #endif
12219
12220     return(test_ret);
12221 }
12222
12223
12224 static int
12225 test_xmlNanoHTTPInit(void) {
12226     int test_ret = 0;
12227
12228 #if defined(LIBXML_HTTP_ENABLED)
12229     int mem_base;
12230
12231         mem_base = xmlMemBlocks();
12232
12233         xmlNanoHTTPInit();
12234         call_tests++;
12235         xmlResetLastError();
12236         if (mem_base != xmlMemBlocks()) {
12237             printf("Leak of %d blocks found in xmlNanoHTTPInit",
12238                    xmlMemBlocks() - mem_base);
12239             test_ret++;
12240             printf("\n");
12241         }
12242     function_tests++;
12243 #endif
12244
12245     return(test_ret);
12246 }
12247
12248
12249 static int
12250 test_xmlNanoHTTPMimeType(void) {
12251     int test_ret = 0;
12252
12253 #if defined(LIBXML_HTTP_ENABLED)
12254     int mem_base;
12255     const char * ret_val;
12256     void * ctx; /* the HTTP context */
12257     int n_ctx;
12258
12259     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12260         mem_base = xmlMemBlocks();
12261         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12262
12263         ret_val = xmlNanoHTTPMimeType(ctx);
12264         desret_const_char_ptr(ret_val);
12265         call_tests++;
12266         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12267         xmlResetLastError();
12268         if (mem_base != xmlMemBlocks()) {
12269             printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12270                    xmlMemBlocks() - mem_base);
12271             test_ret++;
12272             printf(" %d", n_ctx);
12273             printf("\n");
12274         }
12275     }
12276     function_tests++;
12277 #endif
12278
12279     return(test_ret);
12280 }
12281
12282
12283 static int
12284 test_xmlNanoHTTPOpen(void) {
12285     int test_ret = 0;
12286
12287 #if defined(LIBXML_HTTP_ENABLED)
12288     int mem_base;
12289     void * ret_val;
12290     const char * URL; /* The URL to load */
12291     int n_URL;
12292     char ** contentType; /* if available the Content-Type information will be returned at that location */
12293     int n_contentType;
12294
12295     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12296     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12297         mem_base = xmlMemBlocks();
12298         URL = gen_filepath(n_URL, 0);
12299         contentType = gen_char_ptr_ptr(n_contentType, 1);
12300
12301         ret_val = xmlNanoHTTPOpen(URL, contentType);
12302         desret_xmlNanoHTTPCtxtPtr(ret_val);
12303         call_tests++;
12304         des_filepath(n_URL, URL, 0);
12305         des_char_ptr_ptr(n_contentType, contentType, 1);
12306         xmlResetLastError();
12307         if (mem_base != xmlMemBlocks()) {
12308             printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12309                    xmlMemBlocks() - mem_base);
12310             test_ret++;
12311             printf(" %d", n_URL);
12312             printf(" %d", n_contentType);
12313             printf("\n");
12314         }
12315     }
12316     }
12317     function_tests++;
12318 #endif
12319
12320     return(test_ret);
12321 }
12322
12323
12324 static int
12325 test_xmlNanoHTTPOpenRedir(void) {
12326     int test_ret = 0;
12327
12328 #if defined(LIBXML_HTTP_ENABLED)
12329     int mem_base;
12330     void * ret_val;
12331     const char * URL; /* The URL to load */
12332     int n_URL;
12333     char ** contentType; /* if available the Content-Type information will be returned at that location */
12334     int n_contentType;
12335     char ** redir; /* if available the redirected URL will be returned */
12336     int n_redir;
12337
12338     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12339     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12340     for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12341         mem_base = xmlMemBlocks();
12342         URL = gen_filepath(n_URL, 0);
12343         contentType = gen_char_ptr_ptr(n_contentType, 1);
12344         redir = gen_char_ptr_ptr(n_redir, 2);
12345
12346         ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12347         desret_xmlNanoHTTPCtxtPtr(ret_val);
12348         call_tests++;
12349         des_filepath(n_URL, URL, 0);
12350         des_char_ptr_ptr(n_contentType, contentType, 1);
12351         des_char_ptr_ptr(n_redir, redir, 2);
12352         xmlResetLastError();
12353         if (mem_base != xmlMemBlocks()) {
12354             printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12355                    xmlMemBlocks() - mem_base);
12356             test_ret++;
12357             printf(" %d", n_URL);
12358             printf(" %d", n_contentType);
12359             printf(" %d", n_redir);
12360             printf("\n");
12361         }
12362     }
12363     }
12364     }
12365     function_tests++;
12366 #endif
12367
12368     return(test_ret);
12369 }
12370
12371
12372 static int
12373 test_xmlNanoHTTPRead(void) {
12374     int test_ret = 0;
12375
12376 #if defined(LIBXML_HTTP_ENABLED)
12377     int mem_base;
12378     int ret_val;
12379     void * ctx; /* the HTTP context */
12380     int n_ctx;
12381     void * dest; /* a buffer */
12382     int n_dest;
12383     int len; /* the buffer length */
12384     int n_len;
12385
12386     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12387     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12388     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12389         mem_base = xmlMemBlocks();
12390         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12391         dest = gen_void_ptr(n_dest, 1);
12392         len = gen_int(n_len, 2);
12393
12394         ret_val = xmlNanoHTTPRead(ctx, dest, len);
12395         desret_int(ret_val);
12396         call_tests++;
12397         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12398         des_void_ptr(n_dest, dest, 1);
12399         des_int(n_len, len, 2);
12400         xmlResetLastError();
12401         if (mem_base != xmlMemBlocks()) {
12402             printf("Leak of %d blocks found in xmlNanoHTTPRead",
12403                    xmlMemBlocks() - mem_base);
12404             test_ret++;
12405             printf(" %d", n_ctx);
12406             printf(" %d", n_dest);
12407             printf(" %d", n_len);
12408             printf("\n");
12409         }
12410     }
12411     }
12412     }
12413     function_tests++;
12414 #endif
12415
12416     return(test_ret);
12417 }
12418
12419
12420 static int
12421 test_xmlNanoHTTPRedir(void) {
12422     int test_ret = 0;
12423
12424
12425     /* missing type support */
12426     return(test_ret);
12427 }
12428
12429
12430 static int
12431 test_xmlNanoHTTPReturnCode(void) {
12432     int test_ret = 0;
12433
12434 #if defined(LIBXML_HTTP_ENABLED)
12435     int mem_base;
12436     int ret_val;
12437     void * ctx; /* the HTTP context */
12438     int n_ctx;
12439
12440     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12441         mem_base = xmlMemBlocks();
12442         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12443
12444         ret_val = xmlNanoHTTPReturnCode(ctx);
12445         desret_int(ret_val);
12446         call_tests++;
12447         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12448         xmlResetLastError();
12449         if (mem_base != xmlMemBlocks()) {
12450             printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12451                    xmlMemBlocks() - mem_base);
12452             test_ret++;
12453             printf(" %d", n_ctx);
12454             printf("\n");
12455         }
12456     }
12457     function_tests++;
12458 #endif
12459
12460     return(test_ret);
12461 }
12462
12463
12464 static int
12465 test_xmlNanoHTTPSave(void) {
12466     int test_ret = 0;
12467
12468 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12469     int mem_base;
12470     int ret_val;
12471     void * ctxt; /* the HTTP context */
12472     int n_ctxt;
12473     const char * filename; /* the filename where the content should be saved */
12474     int n_filename;
12475
12476     for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12477     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12478         mem_base = xmlMemBlocks();
12479         ctxt = gen_void_ptr(n_ctxt, 0);
12480         filename = gen_fileoutput(n_filename, 1);
12481
12482         ret_val = xmlNanoHTTPSave(ctxt, filename);
12483         desret_int(ret_val);
12484         call_tests++;
12485         des_void_ptr(n_ctxt, ctxt, 0);
12486         des_fileoutput(n_filename, filename, 1);
12487         xmlResetLastError();
12488         if (mem_base != xmlMemBlocks()) {
12489             printf("Leak of %d blocks found in xmlNanoHTTPSave",
12490                    xmlMemBlocks() - mem_base);
12491             test_ret++;
12492             printf(" %d", n_ctxt);
12493             printf(" %d", n_filename);
12494             printf("\n");
12495         }
12496     }
12497     }
12498     function_tests++;
12499 #endif
12500
12501     return(test_ret);
12502 }
12503
12504
12505 static int
12506 test_xmlNanoHTTPScanProxy(void) {
12507     int test_ret = 0;
12508
12509 #if defined(LIBXML_HTTP_ENABLED)
12510     const char * URL; /* The proxy URL used to initialize the proxy context */
12511     int n_URL;
12512
12513     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12514         URL = gen_filepath(n_URL, 0);
12515
12516         xmlNanoHTTPScanProxy(URL);
12517         call_tests++;
12518         des_filepath(n_URL, URL, 0);
12519         xmlResetLastError();
12520     }
12521     function_tests++;
12522 #endif
12523
12524     return(test_ret);
12525 }
12526
12527 static int
12528 test_nanohttp(void) {
12529     int test_ret = 0;
12530
12531     if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12532     test_ret += test_xmlNanoHTTPAuthHeader();
12533     test_ret += test_xmlNanoHTTPCleanup();
12534     test_ret += test_xmlNanoHTTPContentLength();
12535     test_ret += test_xmlNanoHTTPEncoding();
12536     test_ret += test_xmlNanoHTTPFetch();
12537     test_ret += test_xmlNanoHTTPInit();
12538     test_ret += test_xmlNanoHTTPMimeType();
12539     test_ret += test_xmlNanoHTTPOpen();
12540     test_ret += test_xmlNanoHTTPOpenRedir();
12541     test_ret += test_xmlNanoHTTPRead();
12542     test_ret += test_xmlNanoHTTPRedir();
12543     test_ret += test_xmlNanoHTTPReturnCode();
12544     test_ret += test_xmlNanoHTTPSave();
12545     test_ret += test_xmlNanoHTTPScanProxy();
12546
12547     if (test_ret != 0)
12548         printf("Module nanohttp: %d errors\n", test_ret);
12549     return(test_ret);
12550 }
12551
12552 static int
12553 test_xmlByteConsumed(void) {
12554     int test_ret = 0;
12555
12556     int mem_base;
12557     long ret_val;
12558     xmlParserCtxtPtr ctxt; /* an XML parser context */
12559     int n_ctxt;
12560
12561     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12562         mem_base = xmlMemBlocks();
12563         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12564
12565         ret_val = xmlByteConsumed(ctxt);
12566         desret_long(ret_val);
12567         call_tests++;
12568         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12569         xmlResetLastError();
12570         if (mem_base != xmlMemBlocks()) {
12571             printf("Leak of %d blocks found in xmlByteConsumed",
12572                    xmlMemBlocks() - mem_base);
12573             test_ret++;
12574             printf(" %d", n_ctxt);
12575             printf("\n");
12576         }
12577     }
12578     function_tests++;
12579
12580     return(test_ret);
12581 }
12582
12583
12584 static int
12585 test_xmlClearNodeInfoSeq(void) {
12586     int test_ret = 0;
12587
12588     int mem_base;
12589     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12590     int n_seq;
12591
12592     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12593         mem_base = xmlMemBlocks();
12594         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12595
12596         xmlClearNodeInfoSeq(seq);
12597         call_tests++;
12598         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12599         xmlResetLastError();
12600         if (mem_base != xmlMemBlocks()) {
12601             printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12602                    xmlMemBlocks() - mem_base);
12603             test_ret++;
12604             printf(" %d", n_seq);
12605             printf("\n");
12606         }
12607     }
12608     function_tests++;
12609
12610     return(test_ret);
12611 }
12612
12613
12614 static int
12615 test_xmlClearParserCtxt(void) {
12616     int test_ret = 0;
12617
12618     int mem_base;
12619     xmlParserCtxtPtr ctxt; /* an XML parser context */
12620     int n_ctxt;
12621
12622     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12623         mem_base = xmlMemBlocks();
12624         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12625
12626         xmlClearParserCtxt(ctxt);
12627         call_tests++;
12628         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12629         xmlResetLastError();
12630         if (mem_base != xmlMemBlocks()) {
12631             printf("Leak of %d blocks found in xmlClearParserCtxt",
12632                    xmlMemBlocks() - mem_base);
12633             test_ret++;
12634             printf(" %d", n_ctxt);
12635             printf("\n");
12636         }
12637     }
12638     function_tests++;
12639
12640     return(test_ret);
12641 }
12642
12643
12644 static int
12645 test_xmlCreateDocParserCtxt(void) {
12646     int test_ret = 0;
12647
12648     int mem_base;
12649     xmlParserCtxtPtr ret_val;
12650     xmlChar * cur; /* a pointer to an array of xmlChar */
12651     int n_cur;
12652
12653     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12654         mem_base = xmlMemBlocks();
12655         cur = gen_const_xmlChar_ptr(n_cur, 0);
12656
12657         ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12658         desret_xmlParserCtxtPtr(ret_val);
12659         call_tests++;
12660         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12661         xmlResetLastError();
12662         if (mem_base != xmlMemBlocks()) {
12663             printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12664                    xmlMemBlocks() - mem_base);
12665             test_ret++;
12666             printf(" %d", n_cur);
12667             printf("\n");
12668         }
12669     }
12670     function_tests++;
12671
12672     return(test_ret);
12673 }
12674
12675
12676 static int
12677 test_xmlCreatePushParserCtxt(void) {
12678     int test_ret = 0;
12679
12680 #if defined(LIBXML_PUSH_ENABLED)
12681     int mem_base;
12682     xmlParserCtxtPtr ret_val;
12683     xmlSAXHandlerPtr sax; /* a SAX handler */
12684     int n_sax;
12685     void * user_data; /* The user data returned on SAX callbacks */
12686     int n_user_data;
12687     char * chunk; /* a pointer to an array of chars */
12688     int n_chunk;
12689     int size; /* number of chars in the array */
12690     int n_size;
12691     const char * filename; /* an optional file name or URI */
12692     int n_filename;
12693
12694     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12695     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12696     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12697     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12698     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12699         mem_base = xmlMemBlocks();
12700         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12701         user_data = gen_userdata(n_user_data, 1);
12702         chunk = gen_const_char_ptr(n_chunk, 2);
12703         size = gen_int(n_size, 3);
12704         filename = gen_fileoutput(n_filename, 4);
12705
12706         ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12707         desret_xmlParserCtxtPtr(ret_val);
12708         call_tests++;
12709         des_xmlSAXHandlerPtr(n_sax, sax, 0);
12710         des_userdata(n_user_data, user_data, 1);
12711         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12712         des_int(n_size, size, 3);
12713         des_fileoutput(n_filename, filename, 4);
12714         xmlResetLastError();
12715         if (mem_base != xmlMemBlocks()) {
12716             printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12717                    xmlMemBlocks() - mem_base);
12718             test_ret++;
12719             printf(" %d", n_sax);
12720             printf(" %d", n_user_data);
12721             printf(" %d", n_chunk);
12722             printf(" %d", n_size);
12723             printf(" %d", n_filename);
12724             printf("\n");
12725         }
12726     }
12727     }
12728     }
12729     }
12730     }
12731     function_tests++;
12732 #endif
12733
12734     return(test_ret);
12735 }
12736
12737
12738 static int
12739 test_xmlCtxtReadDoc(void) {
12740     int test_ret = 0;
12741
12742     int mem_base;
12743     xmlDocPtr ret_val;
12744     xmlParserCtxtPtr ctxt; /* an XML parser context */
12745     int n_ctxt;
12746     xmlChar * cur; /* a pointer to a zero terminated string */
12747     int n_cur;
12748     const char * URL; /* the base URL to use for the document */
12749     int n_URL;
12750     char * encoding; /* the document encoding, or NULL */
12751     int n_encoding;
12752     int options; /* a combination of xmlParserOption */
12753     int n_options;
12754
12755     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12756     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12757     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12758     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12759     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12760         mem_base = xmlMemBlocks();
12761         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12762         cur = gen_const_xmlChar_ptr(n_cur, 1);
12763         URL = gen_filepath(n_URL, 2);
12764         encoding = gen_const_char_ptr(n_encoding, 3);
12765         options = gen_parseroptions(n_options, 4);
12766
12767         ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12768         desret_xmlDocPtr(ret_val);
12769         call_tests++;
12770         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12771         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12772         des_filepath(n_URL, URL, 2);
12773         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12774         des_parseroptions(n_options, options, 4);
12775         xmlResetLastError();
12776         if (mem_base != xmlMemBlocks()) {
12777             printf("Leak of %d blocks found in xmlCtxtReadDoc",
12778                    xmlMemBlocks() - mem_base);
12779             test_ret++;
12780             printf(" %d", n_ctxt);
12781             printf(" %d", n_cur);
12782             printf(" %d", n_URL);
12783             printf(" %d", n_encoding);
12784             printf(" %d", n_options);
12785             printf("\n");
12786         }
12787     }
12788     }
12789     }
12790     }
12791     }
12792     function_tests++;
12793
12794     return(test_ret);
12795 }
12796
12797
12798 static int
12799 test_xmlCtxtReadFile(void) {
12800     int test_ret = 0;
12801
12802     int mem_base;
12803     xmlDocPtr ret_val;
12804     xmlParserCtxtPtr ctxt; /* an XML parser context */
12805     int n_ctxt;
12806     const char * filename; /* a file or URL */
12807     int n_filename;
12808     char * encoding; /* the document encoding, or NULL */
12809     int n_encoding;
12810     int options; /* a combination of xmlParserOption */
12811     int n_options;
12812
12813     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12814     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12815     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12816     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12817         mem_base = xmlMemBlocks();
12818         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12819         filename = gen_filepath(n_filename, 1);
12820         encoding = gen_const_char_ptr(n_encoding, 2);
12821         options = gen_parseroptions(n_options, 3);
12822
12823         ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12824         desret_xmlDocPtr(ret_val);
12825         call_tests++;
12826         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12827         des_filepath(n_filename, filename, 1);
12828         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12829         des_parseroptions(n_options, options, 3);
12830         xmlResetLastError();
12831         if (mem_base != xmlMemBlocks()) {
12832             printf("Leak of %d blocks found in xmlCtxtReadFile",
12833                    xmlMemBlocks() - mem_base);
12834             test_ret++;
12835             printf(" %d", n_ctxt);
12836             printf(" %d", n_filename);
12837             printf(" %d", n_encoding);
12838             printf(" %d", n_options);
12839             printf("\n");
12840         }
12841     }
12842     }
12843     }
12844     }
12845     function_tests++;
12846
12847     return(test_ret);
12848 }
12849
12850
12851 static int
12852 test_xmlCtxtReadMemory(void) {
12853     int test_ret = 0;
12854
12855     int mem_base;
12856     xmlDocPtr ret_val;
12857     xmlParserCtxtPtr ctxt; /* an XML parser context */
12858     int n_ctxt;
12859     char * buffer; /* a pointer to a char array */
12860     int n_buffer;
12861     int size; /* the size of the array */
12862     int n_size;
12863     const char * URL; /* the base URL to use for the document */
12864     int n_URL;
12865     char * encoding; /* the document encoding, or NULL */
12866     int n_encoding;
12867     int options; /* a combination of xmlParserOption */
12868     int n_options;
12869
12870     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12871     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12872     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12873     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12874     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12875     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12876         mem_base = xmlMemBlocks();
12877         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12878         buffer = gen_const_char_ptr(n_buffer, 1);
12879         size = gen_int(n_size, 2);
12880         URL = gen_filepath(n_URL, 3);
12881         encoding = gen_const_char_ptr(n_encoding, 4);
12882         options = gen_parseroptions(n_options, 5);
12883
12884         ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12885         desret_xmlDocPtr(ret_val);
12886         call_tests++;
12887         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12888         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12889         des_int(n_size, size, 2);
12890         des_filepath(n_URL, URL, 3);
12891         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12892         des_parseroptions(n_options, options, 5);
12893         xmlResetLastError();
12894         if (mem_base != xmlMemBlocks()) {
12895             printf("Leak of %d blocks found in xmlCtxtReadMemory",
12896                    xmlMemBlocks() - mem_base);
12897             test_ret++;
12898             printf(" %d", n_ctxt);
12899             printf(" %d", n_buffer);
12900             printf(" %d", n_size);
12901             printf(" %d", n_URL);
12902             printf(" %d", n_encoding);
12903             printf(" %d", n_options);
12904             printf("\n");
12905         }
12906     }
12907     }
12908     }
12909     }
12910     }
12911     }
12912     function_tests++;
12913
12914     return(test_ret);
12915 }
12916
12917
12918 static int
12919 test_xmlCtxtReset(void) {
12920     int test_ret = 0;
12921
12922     int mem_base;
12923     xmlParserCtxtPtr ctxt; /* an XML parser context */
12924     int n_ctxt;
12925
12926     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12927         mem_base = xmlMemBlocks();
12928         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12929
12930         xmlCtxtReset(ctxt);
12931         call_tests++;
12932         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12933         xmlResetLastError();
12934         if (mem_base != xmlMemBlocks()) {
12935             printf("Leak of %d blocks found in xmlCtxtReset",
12936                    xmlMemBlocks() - mem_base);
12937             test_ret++;
12938             printf(" %d", n_ctxt);
12939             printf("\n");
12940         }
12941     }
12942     function_tests++;
12943
12944     return(test_ret);
12945 }
12946
12947
12948 static int
12949 test_xmlCtxtResetPush(void) {
12950     int test_ret = 0;
12951
12952     int mem_base;
12953     int ret_val;
12954     xmlParserCtxtPtr ctxt; /* an XML parser context */
12955     int n_ctxt;
12956     char * chunk; /* a pointer to an array of chars */
12957     int n_chunk;
12958     int size; /* number of chars in the array */
12959     int n_size;
12960     const char * filename; /* an optional file name or URI */
12961     int n_filename;
12962     char * encoding; /* the document encoding, or NULL */
12963     int n_encoding;
12964
12965     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12966     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12967     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12968     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12969     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12970         mem_base = xmlMemBlocks();
12971         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12972         chunk = gen_const_char_ptr(n_chunk, 1);
12973         size = gen_int(n_size, 2);
12974         filename = gen_filepath(n_filename, 3);
12975         encoding = gen_const_char_ptr(n_encoding, 4);
12976
12977         ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12978         desret_int(ret_val);
12979         call_tests++;
12980         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12981         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12982         des_int(n_size, size, 2);
12983         des_filepath(n_filename, filename, 3);
12984         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12985         xmlResetLastError();
12986         if (mem_base != xmlMemBlocks()) {
12987             printf("Leak of %d blocks found in xmlCtxtResetPush",
12988                    xmlMemBlocks() - mem_base);
12989             test_ret++;
12990             printf(" %d", n_ctxt);
12991             printf(" %d", n_chunk);
12992             printf(" %d", n_size);
12993             printf(" %d", n_filename);
12994             printf(" %d", n_encoding);
12995             printf("\n");
12996         }
12997     }
12998     }
12999     }
13000     }
13001     }
13002     function_tests++;
13003
13004     return(test_ret);
13005 }
13006
13007
13008 static int
13009 test_xmlCtxtUseOptions(void) {
13010     int test_ret = 0;
13011
13012     int mem_base;
13013     int ret_val;
13014     xmlParserCtxtPtr ctxt; /* an XML parser context */
13015     int n_ctxt;
13016     int options; /* a combination of xmlParserOption */
13017     int n_options;
13018
13019     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13020     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13021         mem_base = xmlMemBlocks();
13022         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13023         options = gen_parseroptions(n_options, 1);
13024
13025         ret_val = xmlCtxtUseOptions(ctxt, options);
13026         desret_int(ret_val);
13027         call_tests++;
13028         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13029         des_parseroptions(n_options, options, 1);
13030         xmlResetLastError();
13031         if (mem_base != xmlMemBlocks()) {
13032             printf("Leak of %d blocks found in xmlCtxtUseOptions",
13033                    xmlMemBlocks() - mem_base);
13034             test_ret++;
13035             printf(" %d", n_ctxt);
13036             printf(" %d", n_options);
13037             printf("\n");
13038         }
13039     }
13040     }
13041     function_tests++;
13042
13043     return(test_ret);
13044 }
13045
13046
13047 static int
13048 test_xmlGetExternalEntityLoader(void) {
13049     int test_ret = 0;
13050
13051
13052     /* missing type support */
13053     return(test_ret);
13054 }
13055
13056
13057 static int
13058 test_xmlGetFeature(void) {
13059     int test_ret = 0;
13060
13061 #if defined(LIBXML_LEGACY_ENABLED)
13062 #ifdef LIBXML_LEGACY_ENABLED
13063     int mem_base;
13064     int ret_val;
13065     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13066     int n_ctxt;
13067     char * name; /* the feature name */
13068     int n_name;
13069     void * result; /* location to store the result */
13070     int n_result;
13071
13072     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13073     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13074     for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13075         mem_base = xmlMemBlocks();
13076         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13077         name = gen_const_char_ptr(n_name, 1);
13078         result = gen_void_ptr(n_result, 2);
13079
13080         ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13081         desret_int(ret_val);
13082         call_tests++;
13083         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13084         des_const_char_ptr(n_name, (const char *)name, 1);
13085         des_void_ptr(n_result, result, 2);
13086         xmlResetLastError();
13087         if (mem_base != xmlMemBlocks()) {
13088             printf("Leak of %d blocks found in xmlGetFeature",
13089                    xmlMemBlocks() - mem_base);
13090             test_ret++;
13091             printf(" %d", n_ctxt);
13092             printf(" %d", n_name);
13093             printf(" %d", n_result);
13094             printf("\n");
13095         }
13096     }
13097     }
13098     }
13099     function_tests++;
13100 #endif
13101 #endif
13102
13103     return(test_ret);
13104 }
13105
13106
13107 #define gen_nb_const_char_ptr_ptr 1
13108 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13109     return(NULL);
13110 }
13111 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13112 }
13113
13114 static int
13115 test_xmlGetFeaturesList(void) {
13116     int test_ret = 0;
13117
13118 #if defined(LIBXML_LEGACY_ENABLED)
13119 #ifdef LIBXML_LEGACY_ENABLED
13120     int mem_base;
13121     int ret_val;
13122     int * len; /* the length of the features name array (input/output) */
13123     int n_len;
13124     char ** result; /* an array of string to be filled with the features name. */
13125     int n_result;
13126
13127     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13128     for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13129         mem_base = xmlMemBlocks();
13130         len = gen_int_ptr(n_len, 0);
13131         result = gen_const_char_ptr_ptr(n_result, 1);
13132
13133         ret_val = xmlGetFeaturesList(len, (const char **)result);
13134         desret_int(ret_val);
13135         call_tests++;
13136         des_int_ptr(n_len, len, 0);
13137         des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13138         xmlResetLastError();
13139         if (mem_base != xmlMemBlocks()) {
13140             printf("Leak of %d blocks found in xmlGetFeaturesList",
13141                    xmlMemBlocks() - mem_base);
13142             test_ret++;
13143             printf(" %d", n_len);
13144             printf(" %d", n_result);
13145             printf("\n");
13146         }
13147     }
13148     }
13149     function_tests++;
13150 #endif
13151 #endif
13152
13153     return(test_ret);
13154 }
13155
13156
13157 static int
13158 test_xmlHasFeature(void) {
13159     int test_ret = 0;
13160
13161     int mem_base;
13162     int ret_val;
13163     xmlFeature feature; /* the feature to be examined */
13164     int n_feature;
13165
13166     for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13167         mem_base = xmlMemBlocks();
13168         feature = gen_xmlFeature(n_feature, 0);
13169
13170         ret_val = xmlHasFeature(feature);
13171         desret_int(ret_val);
13172         call_tests++;
13173         des_xmlFeature(n_feature, feature, 0);
13174         xmlResetLastError();
13175         if (mem_base != xmlMemBlocks()) {
13176             printf("Leak of %d blocks found in xmlHasFeature",
13177                    xmlMemBlocks() - mem_base);
13178             test_ret++;
13179             printf(" %d", n_feature);
13180             printf("\n");
13181         }
13182     }
13183     function_tests++;
13184
13185     return(test_ret);
13186 }
13187
13188
13189 static int
13190 test_xmlIOParseDTD(void) {
13191     int test_ret = 0;
13192
13193 #if defined(LIBXML_VALID_ENABLED)
13194 #ifdef LIBXML_VALID_ENABLED
13195     xmlDtdPtr ret_val;
13196     xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13197     int n_sax;
13198     xmlParserInputBufferPtr input; /* an Input Buffer */
13199     int n_input;
13200     xmlCharEncoding enc; /* the charset encoding if known */
13201     int n_enc;
13202
13203     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13204     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13205     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13206         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13207         input = gen_xmlParserInputBufferPtr(n_input, 1);
13208         enc = gen_xmlCharEncoding(n_enc, 2);
13209
13210         ret_val = xmlIOParseDTD(sax, input, enc);
13211         input = NULL;
13212         desret_xmlDtdPtr(ret_val);
13213         call_tests++;
13214         des_xmlSAXHandlerPtr(n_sax, sax, 0);
13215         des_xmlParserInputBufferPtr(n_input, input, 1);
13216         des_xmlCharEncoding(n_enc, enc, 2);
13217         xmlResetLastError();
13218     }
13219     }
13220     }
13221     function_tests++;
13222 #endif
13223 #endif
13224
13225     return(test_ret);
13226 }
13227
13228
13229 static int
13230 test_xmlInitNodeInfoSeq(void) {
13231     int test_ret = 0;
13232
13233     int mem_base;
13234     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13235     int n_seq;
13236
13237     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13238         mem_base = xmlMemBlocks();
13239         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13240
13241         xmlInitNodeInfoSeq(seq);
13242         call_tests++;
13243         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13244         xmlResetLastError();
13245         if (mem_base != xmlMemBlocks()) {
13246             printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13247                    xmlMemBlocks() - mem_base);
13248             test_ret++;
13249             printf(" %d", n_seq);
13250             printf("\n");
13251         }
13252     }
13253     function_tests++;
13254
13255     return(test_ret);
13256 }
13257
13258
13259 static int
13260 test_xmlInitParser(void) {
13261     int test_ret = 0;
13262
13263     int mem_base;
13264
13265         mem_base = xmlMemBlocks();
13266
13267         xmlInitParser();
13268         call_tests++;
13269         xmlResetLastError();
13270         if (mem_base != xmlMemBlocks()) {
13271             printf("Leak of %d blocks found in xmlInitParser",
13272                    xmlMemBlocks() - mem_base);
13273             test_ret++;
13274             printf("\n");
13275         }
13276     function_tests++;
13277
13278     return(test_ret);
13279 }
13280
13281
13282 static int
13283 test_xmlInitParserCtxt(void) {
13284     int test_ret = 0;
13285
13286     int mem_base;
13287     int ret_val;
13288     xmlParserCtxtPtr ctxt; /* an XML parser context */
13289     int n_ctxt;
13290
13291     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13292         mem_base = xmlMemBlocks();
13293         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13294
13295         ret_val = xmlInitParserCtxt(ctxt);
13296         desret_int(ret_val);
13297         call_tests++;
13298         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13299         xmlResetLastError();
13300         if (mem_base != xmlMemBlocks()) {
13301             printf("Leak of %d blocks found in xmlInitParserCtxt",
13302                    xmlMemBlocks() - mem_base);
13303             test_ret++;
13304             printf(" %d", n_ctxt);
13305             printf("\n");
13306         }
13307     }
13308     function_tests++;
13309
13310     return(test_ret);
13311 }
13312
13313
13314 static int
13315 test_xmlKeepBlanksDefault(void) {
13316     int test_ret = 0;
13317
13318     int mem_base;
13319     int ret_val;
13320     int val; /* int 0 or 1 */
13321     int n_val;
13322
13323     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13324         mem_base = xmlMemBlocks();
13325         val = gen_int(n_val, 0);
13326
13327         ret_val = xmlKeepBlanksDefault(val);
13328         desret_int(ret_val);
13329         call_tests++;
13330         des_int(n_val, val, 0);
13331         xmlResetLastError();
13332         if (mem_base != xmlMemBlocks()) {
13333             printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13334                    xmlMemBlocks() - mem_base);
13335             test_ret++;
13336             printf(" %d", n_val);
13337             printf("\n");
13338         }
13339     }
13340     function_tests++;
13341
13342     return(test_ret);
13343 }
13344
13345
13346 static int
13347 test_xmlLineNumbersDefault(void) {
13348     int test_ret = 0;
13349
13350     int mem_base;
13351     int ret_val;
13352     int val; /* int 0 or 1 */
13353     int n_val;
13354
13355     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13356         mem_base = xmlMemBlocks();
13357         val = gen_int(n_val, 0);
13358
13359         ret_val = xmlLineNumbersDefault(val);
13360         desret_int(ret_val);
13361         call_tests++;
13362         des_int(n_val, val, 0);
13363         xmlResetLastError();
13364         if (mem_base != xmlMemBlocks()) {
13365             printf("Leak of %d blocks found in xmlLineNumbersDefault",
13366                    xmlMemBlocks() - mem_base);
13367             test_ret++;
13368             printf(" %d", n_val);
13369             printf("\n");
13370         }
13371     }
13372     function_tests++;
13373
13374     return(test_ret);
13375 }
13376
13377
13378 static int
13379 test_xmlLoadExternalEntity(void) {
13380     int test_ret = 0;
13381
13382     int mem_base;
13383     xmlParserInputPtr ret_val;
13384     const char * URL; /* the URL for the entity to load */
13385     int n_URL;
13386     char * ID; /* the Public ID for the entity to load */
13387     int n_ID;
13388     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13389     int n_ctxt;
13390
13391     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13392     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13393     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13394         mem_base = xmlMemBlocks();
13395         URL = gen_filepath(n_URL, 0);
13396         ID = gen_const_char_ptr(n_ID, 1);
13397         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13398
13399         ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13400         desret_xmlParserInputPtr(ret_val);
13401         call_tests++;
13402         des_filepath(n_URL, URL, 0);
13403         des_const_char_ptr(n_ID, (const char *)ID, 1);
13404         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13405         xmlResetLastError();
13406         if (mem_base != xmlMemBlocks()) {
13407             printf("Leak of %d blocks found in xmlLoadExternalEntity",
13408                    xmlMemBlocks() - mem_base);
13409             test_ret++;
13410             printf(" %d", n_URL);
13411             printf(" %d", n_ID);
13412             printf(" %d", n_ctxt);
13413             printf("\n");
13414         }
13415     }
13416     }
13417     }
13418     function_tests++;
13419
13420     return(test_ret);
13421 }
13422
13423
13424 static int
13425 test_xmlNewIOInputStream(void) {
13426     int test_ret = 0;
13427
13428     int mem_base;
13429     xmlParserInputPtr ret_val;
13430     xmlParserCtxtPtr ctxt; /* an XML parser context */
13431     int n_ctxt;
13432     xmlParserInputBufferPtr input; /* an I/O Input */
13433     int n_input;
13434     xmlCharEncoding enc; /* the charset encoding if known */
13435     int n_enc;
13436
13437     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13438     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13439     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13440         mem_base = xmlMemBlocks();
13441         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13442         input = gen_xmlParserInputBufferPtr(n_input, 1);
13443         enc = gen_xmlCharEncoding(n_enc, 2);
13444
13445         ret_val = xmlNewIOInputStream(ctxt, input, enc);
13446         if (ret_val != NULL) input = NULL;
13447         desret_xmlParserInputPtr(ret_val);
13448         call_tests++;
13449         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13450         des_xmlParserInputBufferPtr(n_input, input, 1);
13451         des_xmlCharEncoding(n_enc, enc, 2);
13452         xmlResetLastError();
13453         if (mem_base != xmlMemBlocks()) {
13454             printf("Leak of %d blocks found in xmlNewIOInputStream",
13455                    xmlMemBlocks() - mem_base);
13456             test_ret++;
13457             printf(" %d", n_ctxt);
13458             printf(" %d", n_input);
13459             printf(" %d", n_enc);
13460             printf("\n");
13461         }
13462     }
13463     }
13464     }
13465     function_tests++;
13466
13467     return(test_ret);
13468 }
13469
13470
13471 static int
13472 test_xmlNewParserCtxt(void) {
13473     int test_ret = 0;
13474
13475     int mem_base;
13476     xmlParserCtxtPtr ret_val;
13477
13478         mem_base = xmlMemBlocks();
13479
13480         ret_val = xmlNewParserCtxt();
13481         desret_xmlParserCtxtPtr(ret_val);
13482         call_tests++;
13483         xmlResetLastError();
13484         if (mem_base != xmlMemBlocks()) {
13485             printf("Leak of %d blocks found in xmlNewParserCtxt",
13486                    xmlMemBlocks() - mem_base);
13487             test_ret++;
13488             printf("\n");
13489         }
13490     function_tests++;
13491
13492     return(test_ret);
13493 }
13494
13495
13496 #define gen_nb_xmlNodePtr_ptr 1
13497 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13498     return(NULL);
13499 }
13500 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13501 }
13502
13503 static int
13504 test_xmlParseBalancedChunkMemory(void) {
13505     int test_ret = 0;
13506
13507 #if defined(LIBXML_SAX1_ENABLED)
13508 #ifdef LIBXML_SAX1_ENABLED
13509     int mem_base;
13510     int ret_val;
13511     xmlDocPtr doc; /* the document the chunk pertains to */
13512     int n_doc;
13513     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13514     int n_sax;
13515     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13516     int n_user_data;
13517     int depth; /* Used for loop detection, use 0 */
13518     int n_depth;
13519     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13520     int n_string;
13521     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13522     int n_lst;
13523
13524     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13525     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13526     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13527     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13528     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13529     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13530         mem_base = xmlMemBlocks();
13531         doc = gen_xmlDocPtr(n_doc, 0);
13532         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13533         user_data = gen_userdata(n_user_data, 2);
13534         depth = gen_int(n_depth, 3);
13535         string = gen_const_xmlChar_ptr(n_string, 4);
13536         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13537         
13538 #ifdef LIBXML_SAX1_ENABLED
13539         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13540 #endif
13541
13542
13543         ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13544         desret_int(ret_val);
13545         call_tests++;
13546         des_xmlDocPtr(n_doc, doc, 0);
13547         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13548         des_userdata(n_user_data, user_data, 2);
13549         des_int(n_depth, depth, 3);
13550         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13551         des_xmlNodePtr_ptr(n_lst, lst, 5);
13552         xmlResetLastError();
13553         if (mem_base != xmlMemBlocks()) {
13554             printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13555                    xmlMemBlocks() - mem_base);
13556             test_ret++;
13557             printf(" %d", n_doc);
13558             printf(" %d", n_sax);
13559             printf(" %d", n_user_data);
13560             printf(" %d", n_depth);
13561             printf(" %d", n_string);
13562             printf(" %d", n_lst);
13563             printf("\n");
13564         }
13565     }
13566     }
13567     }
13568     }
13569     }
13570     }
13571     function_tests++;
13572 #endif
13573 #endif
13574
13575     return(test_ret);
13576 }
13577
13578
13579 static int
13580 test_xmlParseBalancedChunkMemoryRecover(void) {
13581     int test_ret = 0;
13582
13583 #if defined(LIBXML_SAX1_ENABLED)
13584 #ifdef LIBXML_SAX1_ENABLED
13585     int mem_base;
13586     int ret_val;
13587     xmlDocPtr doc; /* the document the chunk pertains to */
13588     int n_doc;
13589     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13590     int n_sax;
13591     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13592     int n_user_data;
13593     int depth; /* Used for loop detection, use 0 */
13594     int n_depth;
13595     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13596     int n_string;
13597     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13598     int n_lst;
13599     int recover; /* return nodes even if the data is broken (use 0) */
13600     int n_recover;
13601
13602     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13603     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13604     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13605     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13606     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13607     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13608     for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13609         mem_base = xmlMemBlocks();
13610         doc = gen_xmlDocPtr(n_doc, 0);
13611         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13612         user_data = gen_userdata(n_user_data, 2);
13613         depth = gen_int(n_depth, 3);
13614         string = gen_const_xmlChar_ptr(n_string, 4);
13615         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13616         recover = gen_int(n_recover, 6);
13617         
13618 #ifdef LIBXML_SAX1_ENABLED
13619         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13620 #endif
13621
13622
13623         ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13624         desret_int(ret_val);
13625         call_tests++;
13626         des_xmlDocPtr(n_doc, doc, 0);
13627         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13628         des_userdata(n_user_data, user_data, 2);
13629         des_int(n_depth, depth, 3);
13630         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13631         des_xmlNodePtr_ptr(n_lst, lst, 5);
13632         des_int(n_recover, recover, 6);
13633         xmlResetLastError();
13634         if (mem_base != xmlMemBlocks()) {
13635             printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13636                    xmlMemBlocks() - mem_base);
13637             test_ret++;
13638             printf(" %d", n_doc);
13639             printf(" %d", n_sax);
13640             printf(" %d", n_user_data);
13641             printf(" %d", n_depth);
13642             printf(" %d", n_string);
13643             printf(" %d", n_lst);
13644             printf(" %d", n_recover);
13645             printf("\n");
13646         }
13647     }
13648     }
13649     }
13650     }
13651     }
13652     }
13653     }
13654     function_tests++;
13655 #endif
13656 #endif
13657
13658     return(test_ret);
13659 }
13660
13661
13662 static int
13663 test_xmlParseChunk(void) {
13664     int test_ret = 0;
13665
13666 #if defined(LIBXML_PUSH_ENABLED)
13667     int mem_base;
13668     int ret_val;
13669     xmlParserCtxtPtr ctxt; /* an XML parser context */
13670     int n_ctxt;
13671     char * chunk; /* an char array */
13672     int n_chunk;
13673     int size; /* the size in byte of the chunk */
13674     int n_size;
13675     int terminate; /* last chunk indicator */
13676     int n_terminate;
13677
13678     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13679     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13680     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13681     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13682         mem_base = xmlMemBlocks();
13683         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13684         chunk = gen_const_char_ptr(n_chunk, 1);
13685         size = gen_int(n_size, 2);
13686         terminate = gen_int(n_terminate, 3);
13687
13688         ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13689         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13690         desret_int(ret_val);
13691         call_tests++;
13692         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13693         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13694         des_int(n_size, size, 2);
13695         des_int(n_terminate, terminate, 3);
13696         xmlResetLastError();
13697         if (mem_base != xmlMemBlocks()) {
13698             printf("Leak of %d blocks found in xmlParseChunk",
13699                    xmlMemBlocks() - mem_base);
13700             test_ret++;
13701             printf(" %d", n_ctxt);
13702             printf(" %d", n_chunk);
13703             printf(" %d", n_size);
13704             printf(" %d", n_terminate);
13705             printf("\n");
13706         }
13707     }
13708     }
13709     }
13710     }
13711     function_tests++;
13712 #endif
13713
13714     return(test_ret);
13715 }
13716
13717
13718 static int
13719 test_xmlParseCtxtExternalEntity(void) {
13720     int test_ret = 0;
13721
13722     int mem_base;
13723     int ret_val;
13724     xmlParserCtxtPtr ctx; /* the existing parsing context */
13725     int n_ctx;
13726     xmlChar * URL; /* the URL for the entity to load */
13727     int n_URL;
13728     xmlChar * ID; /* the System ID for the entity to load */
13729     int n_ID;
13730     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13731     int n_lst;
13732
13733     for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13734     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13735     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13736     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13737         mem_base = xmlMemBlocks();
13738         ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13739         URL = gen_const_xmlChar_ptr(n_URL, 1);
13740         ID = gen_const_xmlChar_ptr(n_ID, 2);
13741         lst = gen_xmlNodePtr_ptr(n_lst, 3);
13742
13743         ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13744         desret_int(ret_val);
13745         call_tests++;
13746         des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13747         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13748         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13749         des_xmlNodePtr_ptr(n_lst, lst, 3);
13750         xmlResetLastError();
13751         if (mem_base != xmlMemBlocks()) {
13752             printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13753                    xmlMemBlocks() - mem_base);
13754             test_ret++;
13755             printf(" %d", n_ctx);
13756             printf(" %d", n_URL);
13757             printf(" %d", n_ID);
13758             printf(" %d", n_lst);
13759             printf("\n");
13760         }
13761     }
13762     }
13763     }
13764     }
13765     function_tests++;
13766
13767     return(test_ret);
13768 }
13769
13770
13771 static int
13772 test_xmlParseDTD(void) {
13773     int test_ret = 0;
13774
13775 #if defined(LIBXML_VALID_ENABLED)
13776 #ifdef LIBXML_VALID_ENABLED
13777     int mem_base;
13778     xmlDtdPtr ret_val;
13779     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13780     int n_ExternalID;
13781     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13782     int n_SystemID;
13783
13784     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13785     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13786         mem_base = xmlMemBlocks();
13787         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13788         SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13789
13790         ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13791         desret_xmlDtdPtr(ret_val);
13792         call_tests++;
13793         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13794         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13795         xmlResetLastError();
13796         if (mem_base != xmlMemBlocks()) {
13797             printf("Leak of %d blocks found in xmlParseDTD",
13798                    xmlMemBlocks() - mem_base);
13799             test_ret++;
13800             printf(" %d", n_ExternalID);
13801             printf(" %d", n_SystemID);
13802             printf("\n");
13803         }
13804     }
13805     }
13806     function_tests++;
13807 #endif
13808 #endif
13809
13810     return(test_ret);
13811 }
13812
13813
13814 static int
13815 test_xmlParseDoc(void) {
13816     int test_ret = 0;
13817
13818 #if defined(LIBXML_SAX1_ENABLED)
13819 #ifdef LIBXML_SAX1_ENABLED
13820     int mem_base;
13821     xmlDocPtr ret_val;
13822     xmlChar * cur; /* a pointer to an array of xmlChar */
13823     int n_cur;
13824
13825     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13826         mem_base = xmlMemBlocks();
13827         cur = gen_const_xmlChar_ptr(n_cur, 0);
13828
13829         ret_val = xmlParseDoc((const xmlChar *)cur);
13830         desret_xmlDocPtr(ret_val);
13831         call_tests++;
13832         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13833         xmlResetLastError();
13834         if (mem_base != xmlMemBlocks()) {
13835             printf("Leak of %d blocks found in xmlParseDoc",
13836                    xmlMemBlocks() - mem_base);
13837             test_ret++;
13838             printf(" %d", n_cur);
13839             printf("\n");
13840         }
13841     }
13842     function_tests++;
13843 #endif
13844 #endif
13845
13846     return(test_ret);
13847 }
13848
13849
13850 static int
13851 test_xmlParseDocument(void) {
13852     int test_ret = 0;
13853
13854     int mem_base;
13855     int ret_val;
13856     xmlParserCtxtPtr ctxt; /* an XML parser context */
13857     int n_ctxt;
13858
13859     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13860         mem_base = xmlMemBlocks();
13861         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13862
13863         ret_val = xmlParseDocument(ctxt);
13864         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13865         desret_int(ret_val);
13866         call_tests++;
13867         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13868         xmlResetLastError();
13869         if (mem_base != xmlMemBlocks()) {
13870             printf("Leak of %d blocks found in xmlParseDocument",
13871                    xmlMemBlocks() - mem_base);
13872             test_ret++;
13873             printf(" %d", n_ctxt);
13874             printf("\n");
13875         }
13876     }
13877     function_tests++;
13878
13879     return(test_ret);
13880 }
13881
13882
13883 static int
13884 test_xmlParseEntity(void) {
13885     int test_ret = 0;
13886
13887 #if defined(LIBXML_SAX1_ENABLED)
13888 #ifdef LIBXML_SAX1_ENABLED
13889     int mem_base;
13890     xmlDocPtr ret_val;
13891     const char * filename; /* the filename */
13892     int n_filename;
13893
13894     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13895         mem_base = xmlMemBlocks();
13896         filename = gen_filepath(n_filename, 0);
13897
13898         ret_val = xmlParseEntity(filename);
13899         desret_xmlDocPtr(ret_val);
13900         call_tests++;
13901         des_filepath(n_filename, filename, 0);
13902         xmlResetLastError();
13903         if (mem_base != xmlMemBlocks()) {
13904             printf("Leak of %d blocks found in xmlParseEntity",
13905                    xmlMemBlocks() - mem_base);
13906             test_ret++;
13907             printf(" %d", n_filename);
13908             printf("\n");
13909         }
13910     }
13911     function_tests++;
13912 #endif
13913 #endif
13914
13915     return(test_ret);
13916 }
13917
13918
13919 static int
13920 test_xmlParseExtParsedEnt(void) {
13921     int test_ret = 0;
13922
13923     int mem_base;
13924     int ret_val;
13925     xmlParserCtxtPtr ctxt; /* an XML parser context */
13926     int n_ctxt;
13927
13928     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13929         mem_base = xmlMemBlocks();
13930         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13931
13932         ret_val = xmlParseExtParsedEnt(ctxt);
13933         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13934         desret_int(ret_val);
13935         call_tests++;
13936         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13937         xmlResetLastError();
13938         if (mem_base != xmlMemBlocks()) {
13939             printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13940                    xmlMemBlocks() - mem_base);
13941             test_ret++;
13942             printf(" %d", n_ctxt);
13943             printf("\n");
13944         }
13945     }
13946     function_tests++;
13947
13948     return(test_ret);
13949 }
13950
13951
13952 static int
13953 test_xmlParseExternalEntity(void) {
13954     int test_ret = 0;
13955
13956 #if defined(LIBXML_SAX1_ENABLED)
13957 #ifdef LIBXML_SAX1_ENABLED
13958     int mem_base;
13959     int ret_val;
13960     xmlDocPtr doc; /* the document the chunk pertains to */
13961     int n_doc;
13962     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13963     int n_sax;
13964     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13965     int n_user_data;
13966     int depth; /* Used for loop detection, use 0 */
13967     int n_depth;
13968     xmlChar * URL; /* the URL for the entity to load */
13969     int n_URL;
13970     xmlChar * ID; /* the System ID for the entity to load */
13971     int n_ID;
13972     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13973     int n_lst;
13974
13975     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13976     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13977     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13978     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13979     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13980     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13981     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13982         mem_base = xmlMemBlocks();
13983         doc = gen_xmlDocPtr(n_doc, 0);
13984         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13985         user_data = gen_userdata(n_user_data, 2);
13986         depth = gen_int(n_depth, 3);
13987         URL = gen_const_xmlChar_ptr(n_URL, 4);
13988         ID = gen_const_xmlChar_ptr(n_ID, 5);
13989         lst = gen_xmlNodePtr_ptr(n_lst, 6);
13990
13991         ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13992         desret_int(ret_val);
13993         call_tests++;
13994         des_xmlDocPtr(n_doc, doc, 0);
13995         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13996         des_userdata(n_user_data, user_data, 2);
13997         des_int(n_depth, depth, 3);
13998         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13999         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14000         des_xmlNodePtr_ptr(n_lst, lst, 6);
14001         xmlResetLastError();
14002         if (mem_base != xmlMemBlocks()) {
14003             printf("Leak of %d blocks found in xmlParseExternalEntity",
14004                    xmlMemBlocks() - mem_base);
14005             test_ret++;
14006             printf(" %d", n_doc);
14007             printf(" %d", n_sax);
14008             printf(" %d", n_user_data);
14009             printf(" %d", n_depth);
14010             printf(" %d", n_URL);
14011             printf(" %d", n_ID);
14012             printf(" %d", n_lst);
14013             printf("\n");
14014         }
14015     }
14016     }
14017     }
14018     }
14019     }
14020     }
14021     }
14022     function_tests++;
14023 #endif
14024 #endif
14025
14026     return(test_ret);
14027 }
14028
14029
14030 static int
14031 test_xmlParseFile(void) {
14032     int test_ret = 0;
14033
14034 #if defined(LIBXML_SAX1_ENABLED)
14035 #ifdef LIBXML_SAX1_ENABLED
14036     int mem_base;
14037     xmlDocPtr ret_val;
14038     const char * filename; /* the filename */
14039     int n_filename;
14040
14041     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14042         mem_base = xmlMemBlocks();
14043         filename = gen_filepath(n_filename, 0);
14044
14045         ret_val = xmlParseFile(filename);
14046         desret_xmlDocPtr(ret_val);
14047         call_tests++;
14048         des_filepath(n_filename, filename, 0);
14049         xmlResetLastError();
14050         if (mem_base != xmlMemBlocks()) {
14051             printf("Leak of %d blocks found in xmlParseFile",
14052                    xmlMemBlocks() - mem_base);
14053             test_ret++;
14054             printf(" %d", n_filename);
14055             printf("\n");
14056         }
14057     }
14058     function_tests++;
14059 #endif
14060 #endif
14061
14062     return(test_ret);
14063 }
14064
14065
14066 static int
14067 test_xmlParseInNodeContext(void) {
14068     int test_ret = 0;
14069
14070     int mem_base;
14071     xmlParserErrors ret_val;
14072     xmlNodePtr node; /* the context node */
14073     int n_node;
14074     char * data; /* the input string */
14075     int n_data;
14076     int datalen; /* the input string length in bytes */
14077     int n_datalen;
14078     int options; /* a combination of xmlParserOption */
14079     int n_options;
14080     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14081     int n_lst;
14082
14083     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14084     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14085     for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14086     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14087     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14088         mem_base = xmlMemBlocks();
14089         node = gen_xmlNodePtr(n_node, 0);
14090         data = gen_const_char_ptr(n_data, 1);
14091         datalen = gen_int(n_datalen, 2);
14092         options = gen_parseroptions(n_options, 3);
14093         lst = gen_xmlNodePtr_ptr(n_lst, 4);
14094
14095         ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14096         desret_xmlParserErrors(ret_val);
14097         call_tests++;
14098         des_xmlNodePtr(n_node, node, 0);
14099         des_const_char_ptr(n_data, (const char *)data, 1);
14100         des_int(n_datalen, datalen, 2);
14101         des_parseroptions(n_options, options, 3);
14102         des_xmlNodePtr_ptr(n_lst, lst, 4);
14103         xmlResetLastError();
14104         if (mem_base != xmlMemBlocks()) {
14105             printf("Leak of %d blocks found in xmlParseInNodeContext",
14106                    xmlMemBlocks() - mem_base);
14107             test_ret++;
14108             printf(" %d", n_node);
14109             printf(" %d", n_data);
14110             printf(" %d", n_datalen);
14111             printf(" %d", n_options);
14112             printf(" %d", n_lst);
14113             printf("\n");
14114         }
14115     }
14116     }
14117     }
14118     }
14119     }
14120     function_tests++;
14121
14122     return(test_ret);
14123 }
14124
14125
14126 static int
14127 test_xmlParseMemory(void) {
14128     int test_ret = 0;
14129
14130 #if defined(LIBXML_SAX1_ENABLED)
14131 #ifdef LIBXML_SAX1_ENABLED
14132     int mem_base;
14133     xmlDocPtr ret_val;
14134     char * buffer; /* an pointer to a char array */
14135     int n_buffer;
14136     int size; /* the size of the array */
14137     int n_size;
14138
14139     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14140     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14141         mem_base = xmlMemBlocks();
14142         buffer = gen_const_char_ptr(n_buffer, 0);
14143         size = gen_int(n_size, 1);
14144
14145         ret_val = xmlParseMemory((const char *)buffer, size);
14146         desret_xmlDocPtr(ret_val);
14147         call_tests++;
14148         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14149         des_int(n_size, size, 1);
14150         xmlResetLastError();
14151         if (mem_base != xmlMemBlocks()) {
14152             printf("Leak of %d blocks found in xmlParseMemory",
14153                    xmlMemBlocks() - mem_base);
14154             test_ret++;
14155             printf(" %d", n_buffer);
14156             printf(" %d", n_size);
14157             printf("\n");
14158         }
14159     }
14160     }
14161     function_tests++;
14162 #endif
14163 #endif
14164
14165     return(test_ret);
14166 }
14167
14168
14169 #define gen_nb_const_xmlParserNodeInfoPtr 1
14170 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14171     return(NULL);
14172 }
14173 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14174 }
14175
14176 static int
14177 test_xmlParserAddNodeInfo(void) {
14178     int test_ret = 0;
14179
14180     int mem_base;
14181     xmlParserCtxtPtr ctxt; /* an XML parser context */
14182     int n_ctxt;
14183     xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14184     int n_info;
14185
14186     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14187     for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14188         mem_base = xmlMemBlocks();
14189         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14190         info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14191
14192         xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14193         call_tests++;
14194         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14195         des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14196         xmlResetLastError();
14197         if (mem_base != xmlMemBlocks()) {
14198             printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14199                    xmlMemBlocks() - mem_base);
14200             test_ret++;
14201             printf(" %d", n_ctxt);
14202             printf(" %d", n_info);
14203             printf("\n");
14204         }
14205     }
14206     }
14207     function_tests++;
14208
14209     return(test_ret);
14210 }
14211
14212
14213 #define gen_nb_const_xmlParserCtxtPtr 1
14214 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14215     return(NULL);
14216 }
14217 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14218 }
14219
14220 #define gen_nb_const_xmlNodePtr 1
14221 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14222     return(NULL);
14223 }
14224 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14225 }
14226
14227 static int
14228 test_xmlParserFindNodeInfo(void) {
14229     int test_ret = 0;
14230
14231     int mem_base;
14232     const xmlParserNodeInfo * ret_val;
14233     xmlParserCtxtPtr ctx; /* an XML parser context */
14234     int n_ctx;
14235     xmlNodePtr node; /* an XML node within the tree */
14236     int n_node;
14237
14238     for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14239     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14240         mem_base = xmlMemBlocks();
14241         ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14242         node = gen_const_xmlNodePtr(n_node, 1);
14243
14244         ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14245         desret_const_xmlParserNodeInfo_ptr(ret_val);
14246         call_tests++;
14247         des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14248         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14249         xmlResetLastError();
14250         if (mem_base != xmlMemBlocks()) {
14251             printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14252                    xmlMemBlocks() - mem_base);
14253             test_ret++;
14254             printf(" %d", n_ctx);
14255             printf(" %d", n_node);
14256             printf("\n");
14257         }
14258     }
14259     }
14260     function_tests++;
14261
14262     return(test_ret);
14263 }
14264
14265
14266 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14267 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14268     return(NULL);
14269 }
14270 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14271 }
14272
14273 static int
14274 test_xmlParserFindNodeInfoIndex(void) {
14275     int test_ret = 0;
14276
14277     int mem_base;
14278     unsigned long ret_val;
14279     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14280     int n_seq;
14281     xmlNodePtr node; /* an XML node pointer */
14282     int n_node;
14283
14284     for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14285     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14286         mem_base = xmlMemBlocks();
14287         seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14288         node = gen_const_xmlNodePtr(n_node, 1);
14289
14290         ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14291         desret_unsigned_long(ret_val);
14292         call_tests++;
14293         des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14294         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14295         xmlResetLastError();
14296         if (mem_base != xmlMemBlocks()) {
14297             printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14298                    xmlMemBlocks() - mem_base);
14299             test_ret++;
14300             printf(" %d", n_seq);
14301             printf(" %d", n_node);
14302             printf("\n");
14303         }
14304     }
14305     }
14306     function_tests++;
14307
14308     return(test_ret);
14309 }
14310
14311
14312 #define gen_nb_xmlParserInputPtr 1
14313 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14314     return(NULL);
14315 }
14316 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14317 }
14318
14319 static int
14320 test_xmlParserInputGrow(void) {
14321     int test_ret = 0;
14322
14323     int mem_base;
14324     int ret_val;
14325     xmlParserInputPtr in; /* an XML parser input */
14326     int n_in;
14327     int len; /* an indicative size for the lookahead */
14328     int n_len;
14329
14330     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14331     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14332         mem_base = xmlMemBlocks();
14333         in = gen_xmlParserInputPtr(n_in, 0);
14334         len = gen_int(n_len, 1);
14335
14336         ret_val = xmlParserInputGrow(in, len);
14337         desret_int(ret_val);
14338         call_tests++;
14339         des_xmlParserInputPtr(n_in, in, 0);
14340         des_int(n_len, len, 1);
14341         xmlResetLastError();
14342         if (mem_base != xmlMemBlocks()) {
14343             printf("Leak of %d blocks found in xmlParserInputGrow",
14344                    xmlMemBlocks() - mem_base);
14345             test_ret++;
14346             printf(" %d", n_in);
14347             printf(" %d", n_len);
14348             printf("\n");
14349         }
14350     }
14351     }
14352     function_tests++;
14353
14354     return(test_ret);
14355 }
14356
14357
14358 static int
14359 test_xmlParserInputRead(void) {
14360     int test_ret = 0;
14361
14362     int mem_base;
14363     int ret_val;
14364     xmlParserInputPtr in; /* an XML parser input */
14365     int n_in;
14366     int len; /* an indicative size for the lookahead */
14367     int n_len;
14368
14369     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14370     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14371         mem_base = xmlMemBlocks();
14372         in = gen_xmlParserInputPtr(n_in, 0);
14373         len = gen_int(n_len, 1);
14374
14375         ret_val = xmlParserInputRead(in, len);
14376         desret_int(ret_val);
14377         call_tests++;
14378         des_xmlParserInputPtr(n_in, in, 0);
14379         des_int(n_len, len, 1);
14380         xmlResetLastError();
14381         if (mem_base != xmlMemBlocks()) {
14382             printf("Leak of %d blocks found in xmlParserInputRead",
14383                    xmlMemBlocks() - mem_base);
14384             test_ret++;
14385             printf(" %d", n_in);
14386             printf(" %d", n_len);
14387             printf("\n");
14388         }
14389     }
14390     }
14391     function_tests++;
14392
14393     return(test_ret);
14394 }
14395
14396
14397 static int
14398 test_xmlPedanticParserDefault(void) {
14399     int test_ret = 0;
14400
14401     int mem_base;
14402     int ret_val;
14403     int val; /* int 0 or 1 */
14404     int n_val;
14405
14406     for (n_val = 0;n_val < gen_nb_int;n_val++) {
14407         mem_base = xmlMemBlocks();
14408         val = gen_int(n_val, 0);
14409
14410         ret_val = xmlPedanticParserDefault(val);
14411         desret_int(ret_val);
14412         call_tests++;
14413         des_int(n_val, val, 0);
14414         xmlResetLastError();
14415         if (mem_base != xmlMemBlocks()) {
14416             printf("Leak of %d blocks found in xmlPedanticParserDefault",
14417                    xmlMemBlocks() - mem_base);
14418             test_ret++;
14419             printf(" %d", n_val);
14420             printf("\n");
14421         }
14422     }
14423     function_tests++;
14424
14425     return(test_ret);
14426 }
14427
14428
14429 static int
14430 test_xmlReadDoc(void) {
14431     int test_ret = 0;
14432
14433     int mem_base;
14434     xmlDocPtr ret_val;
14435     xmlChar * cur; /* a pointer to a zero terminated string */
14436     int n_cur;
14437     const char * URL; /* the base URL to use for the document */
14438     int n_URL;
14439     char * encoding; /* the document encoding, or NULL */
14440     int n_encoding;
14441     int options; /* a combination of xmlParserOption */
14442     int n_options;
14443
14444     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14445     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14446     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14447     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14448         mem_base = xmlMemBlocks();
14449         cur = gen_const_xmlChar_ptr(n_cur, 0);
14450         URL = gen_filepath(n_URL, 1);
14451         encoding = gen_const_char_ptr(n_encoding, 2);
14452         options = gen_parseroptions(n_options, 3);
14453
14454         ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14455         desret_xmlDocPtr(ret_val);
14456         call_tests++;
14457         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14458         des_filepath(n_URL, URL, 1);
14459         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14460         des_parseroptions(n_options, options, 3);
14461         xmlResetLastError();
14462         if (mem_base != xmlMemBlocks()) {
14463             printf("Leak of %d blocks found in xmlReadDoc",
14464                    xmlMemBlocks() - mem_base);
14465             test_ret++;
14466             printf(" %d", n_cur);
14467             printf(" %d", n_URL);
14468             printf(" %d", n_encoding);
14469             printf(" %d", n_options);
14470             printf("\n");
14471         }
14472     }
14473     }
14474     }
14475     }
14476     function_tests++;
14477
14478     return(test_ret);
14479 }
14480
14481
14482 static int
14483 test_xmlReadFile(void) {
14484     int test_ret = 0;
14485
14486     int mem_base;
14487     xmlDocPtr ret_val;
14488     const char * filename; /* a file or URL */
14489     int n_filename;
14490     char * encoding; /* the document encoding, or NULL */
14491     int n_encoding;
14492     int options; /* a combination of xmlParserOption */
14493     int n_options;
14494
14495     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14496     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14497     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14498         mem_base = xmlMemBlocks();
14499         filename = gen_filepath(n_filename, 0);
14500         encoding = gen_const_char_ptr(n_encoding, 1);
14501         options = gen_parseroptions(n_options, 2);
14502
14503         ret_val = xmlReadFile(filename, (const char *)encoding, options);
14504         desret_xmlDocPtr(ret_val);
14505         call_tests++;
14506         des_filepath(n_filename, filename, 0);
14507         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14508         des_parseroptions(n_options, options, 2);
14509         xmlResetLastError();
14510         if (mem_base != xmlMemBlocks()) {
14511             printf("Leak of %d blocks found in xmlReadFile",
14512                    xmlMemBlocks() - mem_base);
14513             test_ret++;
14514             printf(" %d", n_filename);
14515             printf(" %d", n_encoding);
14516             printf(" %d", n_options);
14517             printf("\n");
14518         }
14519     }
14520     }
14521     }
14522     function_tests++;
14523
14524     return(test_ret);
14525 }
14526
14527
14528 static int
14529 test_xmlReadMemory(void) {
14530     int test_ret = 0;
14531
14532     int mem_base;
14533     xmlDocPtr ret_val;
14534     char * buffer; /* a pointer to a char array */
14535     int n_buffer;
14536     int size; /* the size of the array */
14537     int n_size;
14538     const char * URL; /* the base URL to use for the document */
14539     int n_URL;
14540     char * encoding; /* the document encoding, or NULL */
14541     int n_encoding;
14542     int options; /* a combination of xmlParserOption */
14543     int n_options;
14544
14545     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14546     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14547     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14548     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14549     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14550         mem_base = xmlMemBlocks();
14551         buffer = gen_const_char_ptr(n_buffer, 0);
14552         size = gen_int(n_size, 1);
14553         URL = gen_filepath(n_URL, 2);
14554         encoding = gen_const_char_ptr(n_encoding, 3);
14555         options = gen_parseroptions(n_options, 4);
14556
14557         ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14558         desret_xmlDocPtr(ret_val);
14559         call_tests++;
14560         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14561         des_int(n_size, size, 1);
14562         des_filepath(n_URL, URL, 2);
14563         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14564         des_parseroptions(n_options, options, 4);
14565         xmlResetLastError();
14566         if (mem_base != xmlMemBlocks()) {
14567             printf("Leak of %d blocks found in xmlReadMemory",
14568                    xmlMemBlocks() - mem_base);
14569             test_ret++;
14570             printf(" %d", n_buffer);
14571             printf(" %d", n_size);
14572             printf(" %d", n_URL);
14573             printf(" %d", n_encoding);
14574             printf(" %d", n_options);
14575             printf("\n");
14576         }
14577     }
14578     }
14579     }
14580     }
14581     }
14582     function_tests++;
14583
14584     return(test_ret);
14585 }
14586
14587
14588 static int
14589 test_xmlRecoverDoc(void) {
14590     int test_ret = 0;
14591
14592 #if defined(LIBXML_SAX1_ENABLED)
14593 #ifdef LIBXML_SAX1_ENABLED
14594     int mem_base;
14595     xmlDocPtr ret_val;
14596     xmlChar * cur; /* a pointer to an array of xmlChar */
14597     int n_cur;
14598
14599     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14600         mem_base = xmlMemBlocks();
14601         cur = gen_const_xmlChar_ptr(n_cur, 0);
14602
14603         ret_val = xmlRecoverDoc((const xmlChar *)cur);
14604         desret_xmlDocPtr(ret_val);
14605         call_tests++;
14606         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14607         xmlResetLastError();
14608         if (mem_base != xmlMemBlocks()) {
14609             printf("Leak of %d blocks found in xmlRecoverDoc",
14610                    xmlMemBlocks() - mem_base);
14611             test_ret++;
14612             printf(" %d", n_cur);
14613             printf("\n");
14614         }
14615     }
14616     function_tests++;
14617 #endif
14618 #endif
14619
14620     return(test_ret);
14621 }
14622
14623
14624 static int
14625 test_xmlRecoverFile(void) {
14626     int test_ret = 0;
14627
14628 #if defined(LIBXML_SAX1_ENABLED)
14629 #ifdef LIBXML_SAX1_ENABLED
14630     int mem_base;
14631     xmlDocPtr ret_val;
14632     const char * filename; /* the filename */
14633     int n_filename;
14634
14635     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14636         mem_base = xmlMemBlocks();
14637         filename = gen_filepath(n_filename, 0);
14638
14639         ret_val = xmlRecoverFile(filename);
14640         desret_xmlDocPtr(ret_val);
14641         call_tests++;
14642         des_filepath(n_filename, filename, 0);
14643         xmlResetLastError();
14644         if (mem_base != xmlMemBlocks()) {
14645             printf("Leak of %d blocks found in xmlRecoverFile",
14646                    xmlMemBlocks() - mem_base);
14647             test_ret++;
14648             printf(" %d", n_filename);
14649             printf("\n");
14650         }
14651     }
14652     function_tests++;
14653 #endif
14654 #endif
14655
14656     return(test_ret);
14657 }
14658
14659
14660 static int
14661 test_xmlRecoverMemory(void) {
14662     int test_ret = 0;
14663
14664 #if defined(LIBXML_SAX1_ENABLED)
14665 #ifdef LIBXML_SAX1_ENABLED
14666     int mem_base;
14667     xmlDocPtr ret_val;
14668     char * buffer; /* an pointer to a char array */
14669     int n_buffer;
14670     int size; /* the size of the array */
14671     int n_size;
14672
14673     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14674     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14675         mem_base = xmlMemBlocks();
14676         buffer = gen_const_char_ptr(n_buffer, 0);
14677         size = gen_int(n_size, 1);
14678
14679         ret_val = xmlRecoverMemory((const char *)buffer, size);
14680         desret_xmlDocPtr(ret_val);
14681         call_tests++;
14682         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14683         des_int(n_size, size, 1);
14684         xmlResetLastError();
14685         if (mem_base != xmlMemBlocks()) {
14686             printf("Leak of %d blocks found in xmlRecoverMemory",
14687                    xmlMemBlocks() - mem_base);
14688             test_ret++;
14689             printf(" %d", n_buffer);
14690             printf(" %d", n_size);
14691             printf("\n");
14692         }
14693     }
14694     }
14695     function_tests++;
14696 #endif
14697 #endif
14698
14699     return(test_ret);
14700 }
14701
14702
14703 static int
14704 test_xmlSAXParseDTD(void) {
14705     int test_ret = 0;
14706
14707 #if defined(LIBXML_VALID_ENABLED)
14708 #ifdef LIBXML_SAX1_ENABLED
14709     int mem_base;
14710     xmlDtdPtr ret_val;
14711     xmlSAXHandlerPtr sax; /* the SAX handler block */
14712     int n_sax;
14713     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14714     int n_ExternalID;
14715     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14716     int n_SystemID;
14717
14718     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14719     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14720     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14721         mem_base = xmlMemBlocks();
14722         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14723         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14724         SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14725
14726         ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14727         desret_xmlDtdPtr(ret_val);
14728         call_tests++;
14729         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14730         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14731         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14732         xmlResetLastError();
14733         if (mem_base != xmlMemBlocks()) {
14734             printf("Leak of %d blocks found in xmlSAXParseDTD",
14735                    xmlMemBlocks() - mem_base);
14736             test_ret++;
14737             printf(" %d", n_sax);
14738             printf(" %d", n_ExternalID);
14739             printf(" %d", n_SystemID);
14740             printf("\n");
14741         }
14742     }
14743     }
14744     }
14745     function_tests++;
14746 #endif
14747 #endif
14748
14749     return(test_ret);
14750 }
14751
14752
14753 static int
14754 test_xmlSAXParseDoc(void) {
14755     int test_ret = 0;
14756
14757 #if defined(LIBXML_SAX1_ENABLED)
14758 #ifdef LIBXML_SAX1_ENABLED
14759     int mem_base;
14760     xmlDocPtr ret_val;
14761     xmlSAXHandlerPtr sax; /* the SAX handler block */
14762     int n_sax;
14763     xmlChar * cur; /* a pointer to an array of xmlChar */
14764     int n_cur;
14765     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14766     int n_recovery;
14767
14768     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14769     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14770     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14771         mem_base = xmlMemBlocks();
14772         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14773         cur = gen_const_xmlChar_ptr(n_cur, 1);
14774         recovery = gen_int(n_recovery, 2);
14775
14776         ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14777         desret_xmlDocPtr(ret_val);
14778         call_tests++;
14779         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14780         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14781         des_int(n_recovery, recovery, 2);
14782         xmlResetLastError();
14783         if (mem_base != xmlMemBlocks()) {
14784             printf("Leak of %d blocks found in xmlSAXParseDoc",
14785                    xmlMemBlocks() - mem_base);
14786             test_ret++;
14787             printf(" %d", n_sax);
14788             printf(" %d", n_cur);
14789             printf(" %d", n_recovery);
14790             printf("\n");
14791         }
14792     }
14793     }
14794     }
14795     function_tests++;
14796 #endif
14797 #endif
14798
14799     return(test_ret);
14800 }
14801
14802
14803 static int
14804 test_xmlSAXParseEntity(void) {
14805     int test_ret = 0;
14806
14807 #if defined(LIBXML_SAX1_ENABLED)
14808 #ifdef LIBXML_SAX1_ENABLED
14809     int mem_base;
14810     xmlDocPtr ret_val;
14811     xmlSAXHandlerPtr sax; /* the SAX handler block */
14812     int n_sax;
14813     const char * filename; /* the filename */
14814     int n_filename;
14815
14816     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14817     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14818         mem_base = xmlMemBlocks();
14819         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14820         filename = gen_filepath(n_filename, 1);
14821
14822         ret_val = xmlSAXParseEntity(sax, filename);
14823         desret_xmlDocPtr(ret_val);
14824         call_tests++;
14825         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14826         des_filepath(n_filename, filename, 1);
14827         xmlResetLastError();
14828         if (mem_base != xmlMemBlocks()) {
14829             printf("Leak of %d blocks found in xmlSAXParseEntity",
14830                    xmlMemBlocks() - mem_base);
14831             test_ret++;
14832             printf(" %d", n_sax);
14833             printf(" %d", n_filename);
14834             printf("\n");
14835         }
14836     }
14837     }
14838     function_tests++;
14839 #endif
14840 #endif
14841
14842     return(test_ret);
14843 }
14844
14845
14846 static int
14847 test_xmlSAXParseFile(void) {
14848     int test_ret = 0;
14849
14850 #if defined(LIBXML_SAX1_ENABLED)
14851 #ifdef LIBXML_SAX1_ENABLED
14852     int mem_base;
14853     xmlDocPtr ret_val;
14854     xmlSAXHandlerPtr sax; /* the SAX handler block */
14855     int n_sax;
14856     const char * filename; /* the filename */
14857     int n_filename;
14858     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14859     int n_recovery;
14860
14861     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14862     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14863     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14864         mem_base = xmlMemBlocks();
14865         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14866         filename = gen_filepath(n_filename, 1);
14867         recovery = gen_int(n_recovery, 2);
14868
14869         ret_val = xmlSAXParseFile(sax, filename, recovery);
14870         desret_xmlDocPtr(ret_val);
14871         call_tests++;
14872         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14873         des_filepath(n_filename, filename, 1);
14874         des_int(n_recovery, recovery, 2);
14875         xmlResetLastError();
14876         if (mem_base != xmlMemBlocks()) {
14877             printf("Leak of %d blocks found in xmlSAXParseFile",
14878                    xmlMemBlocks() - mem_base);
14879             test_ret++;
14880             printf(" %d", n_sax);
14881             printf(" %d", n_filename);
14882             printf(" %d", n_recovery);
14883             printf("\n");
14884         }
14885     }
14886     }
14887     }
14888     function_tests++;
14889 #endif
14890 #endif
14891
14892     return(test_ret);
14893 }
14894
14895
14896 static int
14897 test_xmlSAXParseFileWithData(void) {
14898     int test_ret = 0;
14899
14900 #if defined(LIBXML_SAX1_ENABLED)
14901 #ifdef LIBXML_SAX1_ENABLED
14902     int mem_base;
14903     xmlDocPtr ret_val;
14904     xmlSAXHandlerPtr sax; /* the SAX handler block */
14905     int n_sax;
14906     const char * filename; /* the filename */
14907     int n_filename;
14908     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14909     int n_recovery;
14910     void * data; /* the userdata */
14911     int n_data;
14912
14913     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14914     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14915     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14916     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14917         mem_base = xmlMemBlocks();
14918         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14919         filename = gen_filepath(n_filename, 1);
14920         recovery = gen_int(n_recovery, 2);
14921         data = gen_userdata(n_data, 3);
14922
14923         ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14924         desret_xmlDocPtr(ret_val);
14925         call_tests++;
14926         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14927         des_filepath(n_filename, filename, 1);
14928         des_int(n_recovery, recovery, 2);
14929         des_userdata(n_data, data, 3);
14930         xmlResetLastError();
14931         if (mem_base != xmlMemBlocks()) {
14932             printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14933                    xmlMemBlocks() - mem_base);
14934             test_ret++;
14935             printf(" %d", n_sax);
14936             printf(" %d", n_filename);
14937             printf(" %d", n_recovery);
14938             printf(" %d", n_data);
14939             printf("\n");
14940         }
14941     }
14942     }
14943     }
14944     }
14945     function_tests++;
14946 #endif
14947 #endif
14948
14949     return(test_ret);
14950 }
14951
14952
14953 static int
14954 test_xmlSAXParseMemory(void) {
14955     int test_ret = 0;
14956
14957 #if defined(LIBXML_SAX1_ENABLED)
14958 #ifdef LIBXML_SAX1_ENABLED
14959     int mem_base;
14960     xmlDocPtr ret_val;
14961     xmlSAXHandlerPtr sax; /* the SAX handler block */
14962     int n_sax;
14963     char * buffer; /* an pointer to a char array */
14964     int n_buffer;
14965     int size; /* the size of the array */
14966     int n_size;
14967     int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14968     int n_recovery;
14969
14970     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14971     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14972     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14973     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14974         mem_base = xmlMemBlocks();
14975         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14976         buffer = gen_const_char_ptr(n_buffer, 1);
14977         size = gen_int(n_size, 2);
14978         recovery = gen_int(n_recovery, 3);
14979
14980         ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14981         desret_xmlDocPtr(ret_val);
14982         call_tests++;
14983         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14984         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14985         des_int(n_size, size, 2);
14986         des_int(n_recovery, recovery, 3);
14987         xmlResetLastError();
14988         if (mem_base != xmlMemBlocks()) {
14989             printf("Leak of %d blocks found in xmlSAXParseMemory",
14990                    xmlMemBlocks() - mem_base);
14991             test_ret++;
14992             printf(" %d", n_sax);
14993             printf(" %d", n_buffer);
14994             printf(" %d", n_size);
14995             printf(" %d", n_recovery);
14996             printf("\n");
14997         }
14998     }
14999     }
15000     }
15001     }
15002     function_tests++;
15003 #endif
15004 #endif
15005
15006     return(test_ret);
15007 }
15008
15009
15010 static int
15011 test_xmlSAXParseMemoryWithData(void) {
15012     int test_ret = 0;
15013
15014 #if defined(LIBXML_SAX1_ENABLED)
15015 #ifdef LIBXML_SAX1_ENABLED
15016     int mem_base;
15017     xmlDocPtr ret_val;
15018     xmlSAXHandlerPtr sax; /* the SAX handler block */
15019     int n_sax;
15020     char * buffer; /* an pointer to a char array */
15021     int n_buffer;
15022     int size; /* the size of the array */
15023     int n_size;
15024     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15025     int n_recovery;
15026     void * data; /* the userdata */
15027     int n_data;
15028
15029     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15030     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15031     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15032     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15033     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15034         mem_base = xmlMemBlocks();
15035         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15036         buffer = gen_const_char_ptr(n_buffer, 1);
15037         size = gen_int(n_size, 2);
15038         recovery = gen_int(n_recovery, 3);
15039         data = gen_userdata(n_data, 4);
15040
15041         ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15042         desret_xmlDocPtr(ret_val);
15043         call_tests++;
15044         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15045         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15046         des_int(n_size, size, 2);
15047         des_int(n_recovery, recovery, 3);
15048         des_userdata(n_data, data, 4);
15049         xmlResetLastError();
15050         if (mem_base != xmlMemBlocks()) {
15051             printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15052                    xmlMemBlocks() - mem_base);
15053             test_ret++;
15054             printf(" %d", n_sax);
15055             printf(" %d", n_buffer);
15056             printf(" %d", n_size);
15057             printf(" %d", n_recovery);
15058             printf(" %d", n_data);
15059             printf("\n");
15060         }
15061     }
15062     }
15063     }
15064     }
15065     }
15066     function_tests++;
15067 #endif
15068 #endif
15069
15070     return(test_ret);
15071 }
15072
15073
15074 static int
15075 test_xmlSAXUserParseFile(void) {
15076     int test_ret = 0;
15077
15078 #if defined(LIBXML_SAX1_ENABLED)
15079 #ifdef LIBXML_SAX1_ENABLED
15080     int mem_base;
15081     int ret_val;
15082     xmlSAXHandlerPtr sax; /* a SAX handler */
15083     int n_sax;
15084     void * user_data; /* The user data returned on SAX callbacks */
15085     int n_user_data;
15086     const char * filename; /* a file name */
15087     int n_filename;
15088
15089     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15090     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15091     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15092         mem_base = xmlMemBlocks();
15093         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15094         user_data = gen_userdata(n_user_data, 1);
15095         filename = gen_filepath(n_filename, 2);
15096         
15097 #ifdef LIBXML_SAX1_ENABLED
15098         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15099 #endif
15100
15101
15102         ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15103         desret_int(ret_val);
15104         call_tests++;
15105         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15106         des_userdata(n_user_data, user_data, 1);
15107         des_filepath(n_filename, filename, 2);
15108         xmlResetLastError();
15109         if (mem_base != xmlMemBlocks()) {
15110             printf("Leak of %d blocks found in xmlSAXUserParseFile",
15111                    xmlMemBlocks() - mem_base);
15112             test_ret++;
15113             printf(" %d", n_sax);
15114             printf(" %d", n_user_data);
15115             printf(" %d", n_filename);
15116             printf("\n");
15117         }
15118     }
15119     }
15120     }
15121     function_tests++;
15122 #endif
15123 #endif
15124
15125     return(test_ret);
15126 }
15127
15128
15129 static int
15130 test_xmlSAXUserParseMemory(void) {
15131     int test_ret = 0;
15132
15133 #if defined(LIBXML_SAX1_ENABLED)
15134 #ifdef LIBXML_SAX1_ENABLED
15135     int mem_base;
15136     int ret_val;
15137     xmlSAXHandlerPtr sax; /* a SAX handler */
15138     int n_sax;
15139     void * user_data; /* The user data returned on SAX callbacks */
15140     int n_user_data;
15141     char * buffer; /* an in-memory XML document input */
15142     int n_buffer;
15143     int size; /* the length of the XML document in bytes */
15144     int n_size;
15145
15146     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15147     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15148     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15149     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15150         mem_base = xmlMemBlocks();
15151         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15152         user_data = gen_userdata(n_user_data, 1);
15153         buffer = gen_const_char_ptr(n_buffer, 2);
15154         size = gen_int(n_size, 3);
15155         
15156 #ifdef LIBXML_SAX1_ENABLED
15157         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15158 #endif
15159
15160
15161         ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15162         desret_int(ret_val);
15163         call_tests++;
15164         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15165         des_userdata(n_user_data, user_data, 1);
15166         des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15167         des_int(n_size, size, 3);
15168         xmlResetLastError();
15169         if (mem_base != xmlMemBlocks()) {
15170             printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15171                    xmlMemBlocks() - mem_base);
15172             test_ret++;
15173             printf(" %d", n_sax);
15174             printf(" %d", n_user_data);
15175             printf(" %d", n_buffer);
15176             printf(" %d", n_size);
15177             printf("\n");
15178         }
15179     }
15180     }
15181     }
15182     }
15183     function_tests++;
15184 #endif
15185 #endif
15186
15187     return(test_ret);
15188 }
15189
15190
15191 static int
15192 test_xmlSetExternalEntityLoader(void) {
15193     int test_ret = 0;
15194
15195
15196     /* missing type support */
15197     return(test_ret);
15198 }
15199
15200
15201 static int
15202 test_xmlSetFeature(void) {
15203     int test_ret = 0;
15204
15205 #if defined(LIBXML_LEGACY_ENABLED)
15206 #ifdef LIBXML_LEGACY_ENABLED
15207     int mem_base;
15208     int ret_val;
15209     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15210     int n_ctxt;
15211     char * name; /* the feature name */
15212     int n_name;
15213     void * value; /* pointer to the location of the new value */
15214     int n_value;
15215
15216     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15217     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15218     for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15219         mem_base = xmlMemBlocks();
15220         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15221         name = gen_const_char_ptr(n_name, 1);
15222         value = gen_void_ptr(n_value, 2);
15223
15224         ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15225         desret_int(ret_val);
15226         call_tests++;
15227         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15228         des_const_char_ptr(n_name, (const char *)name, 1);
15229         des_void_ptr(n_value, value, 2);
15230         xmlResetLastError();
15231         if (mem_base != xmlMemBlocks()) {
15232             printf("Leak of %d blocks found in xmlSetFeature",
15233                    xmlMemBlocks() - mem_base);
15234             test_ret++;
15235             printf(" %d", n_ctxt);
15236             printf(" %d", n_name);
15237             printf(" %d", n_value);
15238             printf("\n");
15239         }
15240     }
15241     }
15242     }
15243     function_tests++;
15244 #endif
15245 #endif
15246
15247     return(test_ret);
15248 }
15249
15250
15251 static int
15252 test_xmlSetupParserForBuffer(void) {
15253     int test_ret = 0;
15254
15255 #if defined(LIBXML_SAX1_ENABLED)
15256 #ifdef LIBXML_SAX1_ENABLED
15257     int mem_base;
15258     xmlParserCtxtPtr ctxt; /* an XML parser context */
15259     int n_ctxt;
15260     xmlChar * buffer; /* a xmlChar * buffer */
15261     int n_buffer;
15262     const char * filename; /* a file name */
15263     int n_filename;
15264
15265     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15266     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15267     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15268         mem_base = xmlMemBlocks();
15269         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15270         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15271         filename = gen_filepath(n_filename, 2);
15272
15273         xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15274         call_tests++;
15275         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15276         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15277         des_filepath(n_filename, filename, 2);
15278         xmlResetLastError();
15279         if (mem_base != xmlMemBlocks()) {
15280             printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15281                    xmlMemBlocks() - mem_base);
15282             test_ret++;
15283             printf(" %d", n_ctxt);
15284             printf(" %d", n_buffer);
15285             printf(" %d", n_filename);
15286             printf("\n");
15287         }
15288     }
15289     }
15290     }
15291     function_tests++;
15292 #endif
15293 #endif
15294
15295     return(test_ret);
15296 }
15297
15298
15299 static int
15300 test_xmlStopParser(void) {
15301     int test_ret = 0;
15302
15303 #ifdef LIBXML_PUSH_ENABLED
15304     int mem_base;
15305     xmlParserCtxtPtr ctxt; /* an XML parser context */
15306     int n_ctxt;
15307
15308     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15309         mem_base = xmlMemBlocks();
15310         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15311
15312         xmlStopParser(ctxt);
15313         call_tests++;
15314         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15315         xmlResetLastError();
15316         if (mem_base != xmlMemBlocks()) {
15317             printf("Leak of %d blocks found in xmlStopParser",
15318                    xmlMemBlocks() - mem_base);
15319             test_ret++;
15320             printf(" %d", n_ctxt);
15321             printf("\n");
15322         }
15323     }
15324     function_tests++;
15325 #endif
15326
15327     return(test_ret);
15328 }
15329
15330
15331 static int
15332 test_xmlSubstituteEntitiesDefault(void) {
15333     int test_ret = 0;
15334
15335     int mem_base;
15336     int ret_val;
15337     int val; /* int 0 or 1 */
15338     int n_val;
15339
15340     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15341         mem_base = xmlMemBlocks();
15342         val = gen_int(n_val, 0);
15343
15344         ret_val = xmlSubstituteEntitiesDefault(val);
15345         desret_int(ret_val);
15346         call_tests++;
15347         des_int(n_val, val, 0);
15348         xmlResetLastError();
15349         if (mem_base != xmlMemBlocks()) {
15350             printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15351                    xmlMemBlocks() - mem_base);
15352             test_ret++;
15353             printf(" %d", n_val);
15354             printf("\n");
15355         }
15356     }
15357     function_tests++;
15358
15359     return(test_ret);
15360 }
15361
15362 static int
15363 test_parser(void) {
15364     int test_ret = 0;
15365
15366     if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15367     test_ret += test_xmlByteConsumed();
15368     test_ret += test_xmlClearNodeInfoSeq();
15369     test_ret += test_xmlClearParserCtxt();
15370     test_ret += test_xmlCreateDocParserCtxt();
15371     test_ret += test_xmlCreatePushParserCtxt();
15372     test_ret += test_xmlCtxtReadDoc();
15373     test_ret += test_xmlCtxtReadFile();
15374     test_ret += test_xmlCtxtReadMemory();
15375     test_ret += test_xmlCtxtReset();
15376     test_ret += test_xmlCtxtResetPush();
15377     test_ret += test_xmlCtxtUseOptions();
15378     test_ret += test_xmlGetExternalEntityLoader();
15379     test_ret += test_xmlGetFeature();
15380     test_ret += test_xmlGetFeaturesList();
15381     test_ret += test_xmlHasFeature();
15382     test_ret += test_xmlIOParseDTD();
15383     test_ret += test_xmlInitNodeInfoSeq();
15384     test_ret += test_xmlInitParser();
15385     test_ret += test_xmlInitParserCtxt();
15386     test_ret += test_xmlKeepBlanksDefault();
15387     test_ret += test_xmlLineNumbersDefault();
15388     test_ret += test_xmlLoadExternalEntity();
15389     test_ret += test_xmlNewIOInputStream();
15390     test_ret += test_xmlNewParserCtxt();
15391     test_ret += test_xmlParseBalancedChunkMemory();
15392     test_ret += test_xmlParseBalancedChunkMemoryRecover();
15393     test_ret += test_xmlParseChunk();
15394     test_ret += test_xmlParseCtxtExternalEntity();
15395     test_ret += test_xmlParseDTD();
15396     test_ret += test_xmlParseDoc();
15397     test_ret += test_xmlParseDocument();
15398     test_ret += test_xmlParseEntity();
15399     test_ret += test_xmlParseExtParsedEnt();
15400     test_ret += test_xmlParseExternalEntity();
15401     test_ret += test_xmlParseFile();
15402     test_ret += test_xmlParseInNodeContext();
15403     test_ret += test_xmlParseMemory();
15404     test_ret += test_xmlParserAddNodeInfo();
15405     test_ret += test_xmlParserFindNodeInfo();
15406     test_ret += test_xmlParserFindNodeInfoIndex();
15407     test_ret += test_xmlParserInputGrow();
15408     test_ret += test_xmlParserInputRead();
15409     test_ret += test_xmlPedanticParserDefault();
15410     test_ret += test_xmlReadDoc();
15411     test_ret += test_xmlReadFile();
15412     test_ret += test_xmlReadMemory();
15413     test_ret += test_xmlRecoverDoc();
15414     test_ret += test_xmlRecoverFile();
15415     test_ret += test_xmlRecoverMemory();
15416     test_ret += test_xmlSAXParseDTD();
15417     test_ret += test_xmlSAXParseDoc();
15418     test_ret += test_xmlSAXParseEntity();
15419     test_ret += test_xmlSAXParseFile();
15420     test_ret += test_xmlSAXParseFileWithData();
15421     test_ret += test_xmlSAXParseMemory();
15422     test_ret += test_xmlSAXParseMemoryWithData();
15423     test_ret += test_xmlSAXUserParseFile();
15424     test_ret += test_xmlSAXUserParseMemory();
15425     test_ret += test_xmlSetExternalEntityLoader();
15426     test_ret += test_xmlSetFeature();
15427     test_ret += test_xmlSetupParserForBuffer();
15428     test_ret += test_xmlStopParser();
15429     test_ret += test_xmlSubstituteEntitiesDefault();
15430
15431     if (test_ret != 0)
15432         printf("Module parser: %d errors\n", test_ret);
15433     return(test_ret);
15434 }
15435
15436 static int
15437 test_htmlCreateFileParserCtxt(void) {
15438     int test_ret = 0;
15439
15440 #if defined(LIBXML_HTML_ENABLED)
15441     int mem_base;
15442     htmlParserCtxtPtr ret_val;
15443     const char * filename; /* the filename */
15444     int n_filename;
15445     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15446     int n_encoding;
15447
15448     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15449     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15450         mem_base = xmlMemBlocks();
15451         filename = gen_fileoutput(n_filename, 0);
15452         encoding = gen_const_char_ptr(n_encoding, 1);
15453
15454         ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15455         desret_htmlParserCtxtPtr(ret_val);
15456         call_tests++;
15457         des_fileoutput(n_filename, filename, 0);
15458         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15459         xmlResetLastError();
15460         if (mem_base != xmlMemBlocks()) {
15461             printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15462                    xmlMemBlocks() - mem_base);
15463             test_ret++;
15464             printf(" %d", n_filename);
15465             printf(" %d", n_encoding);
15466             printf("\n");
15467         }
15468     }
15469     }
15470     function_tests++;
15471 #endif
15472
15473     return(test_ret);
15474 }
15475
15476
15477 static int
15478 test_htmlInitAutoClose(void) {
15479     int test_ret = 0;
15480
15481 #if defined(LIBXML_HTML_ENABLED)
15482     int mem_base;
15483
15484         mem_base = xmlMemBlocks();
15485
15486         htmlInitAutoClose();
15487         call_tests++;
15488         xmlResetLastError();
15489         if (mem_base != xmlMemBlocks()) {
15490             printf("Leak of %d blocks found in htmlInitAutoClose",
15491                    xmlMemBlocks() - mem_base);
15492             test_ret++;
15493             printf("\n");
15494         }
15495     function_tests++;
15496 #endif
15497
15498     return(test_ret);
15499 }
15500
15501
15502 static int
15503 test_inputPop(void) {
15504     int test_ret = 0;
15505
15506     int mem_base;
15507     xmlParserInputPtr ret_val;
15508     xmlParserCtxtPtr ctxt; /* an XML parser context */
15509     int n_ctxt;
15510
15511     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15512         mem_base = xmlMemBlocks();
15513         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15514
15515         ret_val = inputPop(ctxt);
15516         desret_xmlParserInputPtr(ret_val);
15517         call_tests++;
15518         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15519         xmlResetLastError();
15520         if (mem_base != xmlMemBlocks()) {
15521             printf("Leak of %d blocks found in inputPop",
15522                    xmlMemBlocks() - mem_base);
15523             test_ret++;
15524             printf(" %d", n_ctxt);
15525             printf("\n");
15526         }
15527     }
15528     function_tests++;
15529
15530     return(test_ret);
15531 }
15532
15533
15534 static int
15535 test_inputPush(void) {
15536     int test_ret = 0;
15537
15538     int mem_base;
15539     int ret_val;
15540     xmlParserCtxtPtr ctxt; /* an XML parser context */
15541     int n_ctxt;
15542     xmlParserInputPtr value; /* the parser input */
15543     int n_value;
15544
15545     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15546     for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15547         mem_base = xmlMemBlocks();
15548         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15549         value = gen_xmlParserInputPtr(n_value, 1);
15550
15551         ret_val = inputPush(ctxt, value);
15552         desret_int(ret_val);
15553         call_tests++;
15554         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15555         des_xmlParserInputPtr(n_value, value, 1);
15556         xmlResetLastError();
15557         if (mem_base != xmlMemBlocks()) {
15558             printf("Leak of %d blocks found in inputPush",
15559                    xmlMemBlocks() - mem_base);
15560             test_ret++;
15561             printf(" %d", n_ctxt);
15562             printf(" %d", n_value);
15563             printf("\n");
15564         }
15565     }
15566     }
15567     function_tests++;
15568
15569     return(test_ret);
15570 }
15571
15572
15573 static int
15574 test_namePop(void) {
15575     int test_ret = 0;
15576
15577     int mem_base;
15578     const xmlChar * ret_val;
15579     xmlParserCtxtPtr ctxt; /* an XML parser context */
15580     int n_ctxt;
15581
15582     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15583         mem_base = xmlMemBlocks();
15584         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15585
15586         ret_val = namePop(ctxt);
15587         desret_const_xmlChar_ptr(ret_val);
15588         call_tests++;
15589         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15590         xmlResetLastError();
15591         if (mem_base != xmlMemBlocks()) {
15592             printf("Leak of %d blocks found in namePop",
15593                    xmlMemBlocks() - mem_base);
15594             test_ret++;
15595             printf(" %d", n_ctxt);
15596             printf("\n");
15597         }
15598     }
15599     function_tests++;
15600
15601     return(test_ret);
15602 }
15603
15604
15605 static int
15606 test_namePush(void) {
15607     int test_ret = 0;
15608
15609     int mem_base;
15610     int ret_val;
15611     xmlParserCtxtPtr ctxt; /* an XML parser context */
15612     int n_ctxt;
15613     xmlChar * value; /* the element name */
15614     int n_value;
15615
15616     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15617     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15618         mem_base = xmlMemBlocks();
15619         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15620         value = gen_const_xmlChar_ptr(n_value, 1);
15621
15622         ret_val = namePush(ctxt, (const xmlChar *)value);
15623         desret_int(ret_val);
15624         call_tests++;
15625         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15626         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15627         xmlResetLastError();
15628         if (mem_base != xmlMemBlocks()) {
15629             printf("Leak of %d blocks found in namePush",
15630                    xmlMemBlocks() - mem_base);
15631             test_ret++;
15632             printf(" %d", n_ctxt);
15633             printf(" %d", n_value);
15634             printf("\n");
15635         }
15636     }
15637     }
15638     function_tests++;
15639
15640     return(test_ret);
15641 }
15642
15643
15644 static int
15645 test_nodePop(void) {
15646     int test_ret = 0;
15647
15648     int mem_base;
15649     xmlNodePtr ret_val;
15650     xmlParserCtxtPtr ctxt; /* an XML parser context */
15651     int n_ctxt;
15652
15653     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15654         mem_base = xmlMemBlocks();
15655         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15656
15657         ret_val = nodePop(ctxt);
15658         desret_xmlNodePtr(ret_val);
15659         call_tests++;
15660         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15661         xmlResetLastError();
15662         if (mem_base != xmlMemBlocks()) {
15663             printf("Leak of %d blocks found in nodePop",
15664                    xmlMemBlocks() - mem_base);
15665             test_ret++;
15666             printf(" %d", n_ctxt);
15667             printf("\n");
15668         }
15669     }
15670     function_tests++;
15671
15672     return(test_ret);
15673 }
15674
15675
15676 static int
15677 test_nodePush(void) {
15678     int test_ret = 0;
15679
15680     int mem_base;
15681     int ret_val;
15682     xmlParserCtxtPtr ctxt; /* an XML parser context */
15683     int n_ctxt;
15684     xmlNodePtr value; /* the element node */
15685     int n_value;
15686
15687     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15688     for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15689         mem_base = xmlMemBlocks();
15690         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15691         value = gen_xmlNodePtr(n_value, 1);
15692
15693         ret_val = nodePush(ctxt, value);
15694         desret_int(ret_val);
15695         call_tests++;
15696         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15697         des_xmlNodePtr(n_value, value, 1);
15698         xmlResetLastError();
15699         if (mem_base != xmlMemBlocks()) {
15700             printf("Leak of %d blocks found in nodePush",
15701                    xmlMemBlocks() - mem_base);
15702             test_ret++;
15703             printf(" %d", n_ctxt);
15704             printf(" %d", n_value);
15705             printf("\n");
15706         }
15707     }
15708     }
15709     function_tests++;
15710
15711     return(test_ret);
15712 }
15713
15714
15715 static int
15716 test_xmlCheckLanguageID(void) {
15717     int test_ret = 0;
15718
15719     int mem_base;
15720     int ret_val;
15721     xmlChar * lang; /* pointer to the string value */
15722     int n_lang;
15723
15724     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15725         mem_base = xmlMemBlocks();
15726         lang = gen_const_xmlChar_ptr(n_lang, 0);
15727
15728         ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15729         desret_int(ret_val);
15730         call_tests++;
15731         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15732         xmlResetLastError();
15733         if (mem_base != xmlMemBlocks()) {
15734             printf("Leak of %d blocks found in xmlCheckLanguageID",
15735                    xmlMemBlocks() - mem_base);
15736             test_ret++;
15737             printf(" %d", n_lang);
15738             printf("\n");
15739         }
15740     }
15741     function_tests++;
15742
15743     return(test_ret);
15744 }
15745
15746
15747 static int
15748 test_xmlCopyChar(void) {
15749     int test_ret = 0;
15750
15751     int mem_base;
15752     int ret_val;
15753     int len; /* Ignored, compatibility */
15754     int n_len;
15755     xmlChar * out; /* pointer to an array of xmlChar */
15756     int n_out;
15757     int val; /* the char value */
15758     int n_val;
15759
15760     for (n_len = 0;n_len < gen_nb_int;n_len++) {
15761     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15762     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15763         mem_base = xmlMemBlocks();
15764         len = gen_int(n_len, 0);
15765         out = gen_xmlChar_ptr(n_out, 1);
15766         val = gen_int(n_val, 2);
15767
15768         ret_val = xmlCopyChar(len, out, val);
15769         desret_int(ret_val);
15770         call_tests++;
15771         des_int(n_len, len, 0);
15772         des_xmlChar_ptr(n_out, out, 1);
15773         des_int(n_val, val, 2);
15774         xmlResetLastError();
15775         if (mem_base != xmlMemBlocks()) {
15776             printf("Leak of %d blocks found in xmlCopyChar",
15777                    xmlMemBlocks() - mem_base);
15778             test_ret++;
15779             printf(" %d", n_len);
15780             printf(" %d", n_out);
15781             printf(" %d", n_val);
15782             printf("\n");
15783         }
15784     }
15785     }
15786     }
15787     function_tests++;
15788
15789     return(test_ret);
15790 }
15791
15792
15793 static int
15794 test_xmlCopyCharMultiByte(void) {
15795     int test_ret = 0;
15796
15797     int mem_base;
15798     int ret_val;
15799     xmlChar * out; /* pointer to an array of xmlChar */
15800     int n_out;
15801     int val; /* the char value */
15802     int n_val;
15803
15804     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15805     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15806         mem_base = xmlMemBlocks();
15807         out = gen_xmlChar_ptr(n_out, 0);
15808         val = gen_int(n_val, 1);
15809
15810         ret_val = xmlCopyCharMultiByte(out, val);
15811         desret_int(ret_val);
15812         call_tests++;
15813         des_xmlChar_ptr(n_out, out, 0);
15814         des_int(n_val, val, 1);
15815         xmlResetLastError();
15816         if (mem_base != xmlMemBlocks()) {
15817             printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15818                    xmlMemBlocks() - mem_base);
15819             test_ret++;
15820             printf(" %d", n_out);
15821             printf(" %d", n_val);
15822             printf("\n");
15823         }
15824     }
15825     }
15826     function_tests++;
15827
15828     return(test_ret);
15829 }
15830
15831
15832 static int
15833 test_xmlCreateEntityParserCtxt(void) {
15834     int test_ret = 0;
15835
15836     int mem_base;
15837     xmlParserCtxtPtr ret_val;
15838     xmlChar * URL; /* the entity URL */
15839     int n_URL;
15840     xmlChar * ID; /* the entity PUBLIC ID */
15841     int n_ID;
15842     xmlChar * base; /* a possible base for the target URI */
15843     int n_base;
15844
15845     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15846     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15847     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15848         mem_base = xmlMemBlocks();
15849         URL = gen_const_xmlChar_ptr(n_URL, 0);
15850         ID = gen_const_xmlChar_ptr(n_ID, 1);
15851         base = gen_const_xmlChar_ptr(n_base, 2);
15852
15853         ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15854         desret_xmlParserCtxtPtr(ret_val);
15855         call_tests++;
15856         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15857         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15858         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15859         xmlResetLastError();
15860         if (mem_base != xmlMemBlocks()) {
15861             printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15862                    xmlMemBlocks() - mem_base);
15863             test_ret++;
15864             printf(" %d", n_URL);
15865             printf(" %d", n_ID);
15866             printf(" %d", n_base);
15867             printf("\n");
15868         }
15869     }
15870     }
15871     }
15872     function_tests++;
15873
15874     return(test_ret);
15875 }
15876
15877
15878 static int
15879 test_xmlCreateFileParserCtxt(void) {
15880     int test_ret = 0;
15881
15882     int mem_base;
15883     xmlParserCtxtPtr ret_val;
15884     const char * filename; /* the filename */
15885     int n_filename;
15886
15887     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15888         mem_base = xmlMemBlocks();
15889         filename = gen_fileoutput(n_filename, 0);
15890
15891         ret_val = xmlCreateFileParserCtxt(filename);
15892         desret_xmlParserCtxtPtr(ret_val);
15893         call_tests++;
15894         des_fileoutput(n_filename, filename, 0);
15895         xmlResetLastError();
15896         if (mem_base != xmlMemBlocks()) {
15897             printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15898                    xmlMemBlocks() - mem_base);
15899             test_ret++;
15900             printf(" %d", n_filename);
15901             printf("\n");
15902         }
15903     }
15904     function_tests++;
15905
15906     return(test_ret);
15907 }
15908
15909
15910 static int
15911 test_xmlCreateMemoryParserCtxt(void) {
15912     int test_ret = 0;
15913
15914     int mem_base;
15915     xmlParserCtxtPtr ret_val;
15916     char * buffer; /* a pointer to a char array */
15917     int n_buffer;
15918     int size; /* the size of the array */
15919     int n_size;
15920
15921     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15922     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15923         mem_base = xmlMemBlocks();
15924         buffer = gen_const_char_ptr(n_buffer, 0);
15925         size = gen_int(n_size, 1);
15926
15927         ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15928         desret_xmlParserCtxtPtr(ret_val);
15929         call_tests++;
15930         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15931         des_int(n_size, size, 1);
15932         xmlResetLastError();
15933         if (mem_base != xmlMemBlocks()) {
15934             printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15935                    xmlMemBlocks() - mem_base);
15936             test_ret++;
15937             printf(" %d", n_buffer);
15938             printf(" %d", n_size);
15939             printf("\n");
15940         }
15941     }
15942     }
15943     function_tests++;
15944
15945     return(test_ret);
15946 }
15947
15948
15949 static int
15950 test_xmlCreateURLParserCtxt(void) {
15951     int test_ret = 0;
15952
15953     int mem_base;
15954     xmlParserCtxtPtr ret_val;
15955     const char * filename; /* the filename or URL */
15956     int n_filename;
15957     int options; /* a combination of xmlParserOption */
15958     int n_options;
15959
15960     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15961     for (n_options = 0;n_options < gen_nb_int;n_options++) {
15962         mem_base = xmlMemBlocks();
15963         filename = gen_fileoutput(n_filename, 0);
15964         options = gen_int(n_options, 1);
15965
15966         ret_val = xmlCreateURLParserCtxt(filename, options);
15967         desret_xmlParserCtxtPtr(ret_val);
15968         call_tests++;
15969         des_fileoutput(n_filename, filename, 0);
15970         des_int(n_options, options, 1);
15971         xmlResetLastError();
15972         if (mem_base != xmlMemBlocks()) {
15973             printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15974                    xmlMemBlocks() - mem_base);
15975             test_ret++;
15976             printf(" %d", n_filename);
15977             printf(" %d", n_options);
15978             printf("\n");
15979         }
15980     }
15981     }
15982     function_tests++;
15983
15984     return(test_ret);
15985 }
15986
15987
15988 static int
15989 test_xmlCurrentChar(void) {
15990     int test_ret = 0;
15991
15992     int mem_base;
15993     int ret_val;
15994     xmlParserCtxtPtr ctxt; /* the XML parser context */
15995     int n_ctxt;
15996     int * len; /* pointer to the length of the char read */
15997     int n_len;
15998
15999     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16000     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16001         mem_base = xmlMemBlocks();
16002         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16003         len = gen_int_ptr(n_len, 1);
16004
16005         ret_val = xmlCurrentChar(ctxt, len);
16006         desret_int(ret_val);
16007         call_tests++;
16008         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16009         des_int_ptr(n_len, len, 1);
16010         xmlResetLastError();
16011         if (mem_base != xmlMemBlocks()) {
16012             printf("Leak of %d blocks found in xmlCurrentChar",
16013                    xmlMemBlocks() - mem_base);
16014             test_ret++;
16015             printf(" %d", n_ctxt);
16016             printf(" %d", n_len);
16017             printf("\n");
16018         }
16019     }
16020     }
16021     function_tests++;
16022
16023     return(test_ret);
16024 }
16025
16026
16027 static int
16028 test_xmlErrMemory(void) {
16029     int test_ret = 0;
16030
16031     int mem_base;
16032     xmlParserCtxtPtr ctxt; /* an XML parser context */
16033     int n_ctxt;
16034     char * extra; /* extra informations */
16035     int n_extra;
16036
16037     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16038     for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16039         mem_base = xmlMemBlocks();
16040         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16041         extra = gen_const_char_ptr(n_extra, 1);
16042
16043         xmlErrMemory(ctxt, (const char *)extra);
16044         call_tests++;
16045         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16046         des_const_char_ptr(n_extra, (const char *)extra, 1);
16047         xmlResetLastError();
16048         if (mem_base != xmlMemBlocks()) {
16049             printf("Leak of %d blocks found in xmlErrMemory",
16050                    xmlMemBlocks() - mem_base);
16051             test_ret++;
16052             printf(" %d", n_ctxt);
16053             printf(" %d", n_extra);
16054             printf("\n");
16055         }
16056     }
16057     }
16058     function_tests++;
16059
16060     return(test_ret);
16061 }
16062
16063
16064 static int
16065 test_xmlIsLetter(void) {
16066     int test_ret = 0;
16067
16068     int mem_base;
16069     int ret_val;
16070     int c; /* an unicode character (int) */
16071     int n_c;
16072
16073     for (n_c = 0;n_c < gen_nb_int;n_c++) {
16074         mem_base = xmlMemBlocks();
16075         c = gen_int(n_c, 0);
16076
16077         ret_val = xmlIsLetter(c);
16078         desret_int(ret_val);
16079         call_tests++;
16080         des_int(n_c, c, 0);
16081         xmlResetLastError();
16082         if (mem_base != xmlMemBlocks()) {
16083             printf("Leak of %d blocks found in xmlIsLetter",
16084                    xmlMemBlocks() - mem_base);
16085             test_ret++;
16086             printf(" %d", n_c);
16087             printf("\n");
16088         }
16089     }
16090     function_tests++;
16091
16092     return(test_ret);
16093 }
16094
16095
16096 static int
16097 test_xmlNewEntityInputStream(void) {
16098     int test_ret = 0;
16099
16100     int mem_base;
16101     xmlParserInputPtr ret_val;
16102     xmlParserCtxtPtr ctxt; /* an XML parser context */
16103     int n_ctxt;
16104     xmlEntityPtr entity; /* an Entity pointer */
16105     int n_entity;
16106
16107     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16108     for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16109         mem_base = xmlMemBlocks();
16110         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16111         entity = gen_xmlEntityPtr(n_entity, 1);
16112
16113         ret_val = xmlNewEntityInputStream(ctxt, entity);
16114         desret_xmlParserInputPtr(ret_val);
16115         call_tests++;
16116         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16117         des_xmlEntityPtr(n_entity, entity, 1);
16118         xmlResetLastError();
16119         if (mem_base != xmlMemBlocks()) {
16120             printf("Leak of %d blocks found in xmlNewEntityInputStream",
16121                    xmlMemBlocks() - mem_base);
16122             test_ret++;
16123             printf(" %d", n_ctxt);
16124             printf(" %d", n_entity);
16125             printf("\n");
16126         }
16127     }
16128     }
16129     function_tests++;
16130
16131     return(test_ret);
16132 }
16133
16134
16135 static int
16136 test_xmlNewInputFromFile(void) {
16137     int test_ret = 0;
16138
16139     int mem_base;
16140     xmlParserInputPtr ret_val;
16141     xmlParserCtxtPtr ctxt; /* an XML parser context */
16142     int n_ctxt;
16143     const char * filename; /* the filename to use as entity */
16144     int n_filename;
16145
16146     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16147     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16148         mem_base = xmlMemBlocks();
16149         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16150         filename = gen_filepath(n_filename, 1);
16151
16152         ret_val = xmlNewInputFromFile(ctxt, filename);
16153         desret_xmlParserInputPtr(ret_val);
16154         call_tests++;
16155         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16156         des_filepath(n_filename, filename, 1);
16157         xmlResetLastError();
16158         if (mem_base != xmlMemBlocks()) {
16159             printf("Leak of %d blocks found in xmlNewInputFromFile",
16160                    xmlMemBlocks() - mem_base);
16161             test_ret++;
16162             printf(" %d", n_ctxt);
16163             printf(" %d", n_filename);
16164             printf("\n");
16165         }
16166     }
16167     }
16168     function_tests++;
16169
16170     return(test_ret);
16171 }
16172
16173
16174 static int
16175 test_xmlNewInputStream(void) {
16176     int test_ret = 0;
16177
16178     int mem_base;
16179     xmlParserInputPtr ret_val;
16180     xmlParserCtxtPtr ctxt; /* an XML parser context */
16181     int n_ctxt;
16182
16183     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16184         mem_base = xmlMemBlocks();
16185         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16186
16187         ret_val = xmlNewInputStream(ctxt);
16188         desret_xmlParserInputPtr(ret_val);
16189         call_tests++;
16190         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16191         xmlResetLastError();
16192         if (mem_base != xmlMemBlocks()) {
16193             printf("Leak of %d blocks found in xmlNewInputStream",
16194                    xmlMemBlocks() - mem_base);
16195             test_ret++;
16196             printf(" %d", n_ctxt);
16197             printf("\n");
16198         }
16199     }
16200     function_tests++;
16201
16202     return(test_ret);
16203 }
16204
16205
16206 static int
16207 test_xmlNewStringInputStream(void) {
16208     int test_ret = 0;
16209
16210     int mem_base;
16211     xmlParserInputPtr ret_val;
16212     xmlParserCtxtPtr ctxt; /* an XML parser context */
16213     int n_ctxt;
16214     xmlChar * buffer; /* an memory buffer */
16215     int n_buffer;
16216
16217     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16218     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16219         mem_base = xmlMemBlocks();
16220         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16221         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16222
16223         ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16224         desret_xmlParserInputPtr(ret_val);
16225         call_tests++;
16226         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16227         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16228         xmlResetLastError();
16229         if (mem_base != xmlMemBlocks()) {
16230             printf("Leak of %d blocks found in xmlNewStringInputStream",
16231                    xmlMemBlocks() - mem_base);
16232             test_ret++;
16233             printf(" %d", n_ctxt);
16234             printf(" %d", n_buffer);
16235             printf("\n");
16236         }
16237     }
16238     }
16239     function_tests++;
16240
16241     return(test_ret);
16242 }
16243
16244
16245 static int
16246 test_xmlNextChar(void) {
16247     int test_ret = 0;
16248
16249     int mem_base;
16250     xmlParserCtxtPtr ctxt; /* the XML parser context */
16251     int n_ctxt;
16252
16253     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16254         mem_base = xmlMemBlocks();
16255         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16256
16257         xmlNextChar(ctxt);
16258         call_tests++;
16259         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16260         xmlResetLastError();
16261         if (mem_base != xmlMemBlocks()) {
16262             printf("Leak of %d blocks found in xmlNextChar",
16263                    xmlMemBlocks() - mem_base);
16264             test_ret++;
16265             printf(" %d", n_ctxt);
16266             printf("\n");
16267         }
16268     }
16269     function_tests++;
16270
16271     return(test_ret);
16272 }
16273
16274
16275 static int
16276 test_xmlParserInputShrink(void) {
16277     int test_ret = 0;
16278
16279     int mem_base;
16280     xmlParserInputPtr in; /* an XML parser input */
16281     int n_in;
16282
16283     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16284         mem_base = xmlMemBlocks();
16285         in = gen_xmlParserInputPtr(n_in, 0);
16286
16287         xmlParserInputShrink(in);
16288         call_tests++;
16289         des_xmlParserInputPtr(n_in, in, 0);
16290         xmlResetLastError();
16291         if (mem_base != xmlMemBlocks()) {
16292             printf("Leak of %d blocks found in xmlParserInputShrink",
16293                    xmlMemBlocks() - mem_base);
16294             test_ret++;
16295             printf(" %d", n_in);
16296             printf("\n");
16297         }
16298     }
16299     function_tests++;
16300
16301     return(test_ret);
16302 }
16303
16304
16305 static int
16306 test_xmlPopInput(void) {
16307     int test_ret = 0;
16308
16309     int mem_base;
16310     xmlChar ret_val;
16311     xmlParserCtxtPtr ctxt; /* an XML parser context */
16312     int n_ctxt;
16313
16314     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16315         mem_base = xmlMemBlocks();
16316         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16317
16318         ret_val = xmlPopInput(ctxt);
16319         desret_xmlChar(ret_val);
16320         call_tests++;
16321         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16322         xmlResetLastError();
16323         if (mem_base != xmlMemBlocks()) {
16324             printf("Leak of %d blocks found in xmlPopInput",
16325                    xmlMemBlocks() - mem_base);
16326             test_ret++;
16327             printf(" %d", n_ctxt);
16328             printf("\n");
16329         }
16330     }
16331     function_tests++;
16332
16333     return(test_ret);
16334 }
16335
16336
16337 static int
16338 test_xmlPushInput(void) {
16339     int test_ret = 0;
16340
16341     int mem_base;
16342     int ret_val;
16343     xmlParserCtxtPtr ctxt; /* an XML parser context */
16344     int n_ctxt;
16345     xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16346     int n_input;
16347
16348     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16349     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16350         mem_base = xmlMemBlocks();
16351         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16352         input = gen_xmlParserInputPtr(n_input, 1);
16353
16354         ret_val = xmlPushInput(ctxt, input);
16355         desret_int(ret_val);
16356         call_tests++;
16357         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16358         des_xmlParserInputPtr(n_input, input, 1);
16359         xmlResetLastError();
16360         if (mem_base != xmlMemBlocks()) {
16361             printf("Leak of %d blocks found in xmlPushInput",
16362                    xmlMemBlocks() - mem_base);
16363             test_ret++;
16364             printf(" %d", n_ctxt);
16365             printf(" %d", n_input);
16366             printf("\n");
16367         }
16368     }
16369     }
16370     function_tests++;
16371
16372     return(test_ret);
16373 }
16374
16375
16376 static int
16377 test_xmlSetEntityReferenceFunc(void) {
16378     int test_ret = 0;
16379
16380
16381     /* missing type support */
16382     return(test_ret);
16383 }
16384
16385
16386 static int
16387 test_xmlSplitQName(void) {
16388     int test_ret = 0;
16389
16390     int mem_base;
16391     xmlChar * ret_val;
16392     xmlParserCtxtPtr ctxt; /* an XML parser context */
16393     int n_ctxt;
16394     xmlChar * name; /* an XML parser context */
16395     int n_name;
16396     xmlChar ** prefix; /* a xmlChar ** */
16397     int n_prefix;
16398
16399     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16400     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16401     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16402         mem_base = xmlMemBlocks();
16403         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16404         name = gen_const_xmlChar_ptr(n_name, 1);
16405         prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16406
16407         ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16408         desret_xmlChar_ptr(ret_val);
16409         call_tests++;
16410         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16411         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16412         des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16413         xmlResetLastError();
16414         if (mem_base != xmlMemBlocks()) {
16415             printf("Leak of %d blocks found in xmlSplitQName",
16416                    xmlMemBlocks() - mem_base);
16417             test_ret++;
16418             printf(" %d", n_ctxt);
16419             printf(" %d", n_name);
16420             printf(" %d", n_prefix);
16421             printf("\n");
16422         }
16423     }
16424     }
16425     }
16426     function_tests++;
16427
16428     return(test_ret);
16429 }
16430
16431
16432 static int
16433 test_xmlStringCurrentChar(void) {
16434     int test_ret = 0;
16435
16436     int mem_base;
16437     int ret_val;
16438     xmlParserCtxtPtr ctxt; /* the XML parser context */
16439     int n_ctxt;
16440     xmlChar * cur; /* pointer to the beginning of the char */
16441     int n_cur;
16442     int * len; /* pointer to the length of the char read */
16443     int n_len;
16444
16445     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16446     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16447     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16448         mem_base = xmlMemBlocks();
16449         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16450         cur = gen_const_xmlChar_ptr(n_cur, 1);
16451         len = gen_int_ptr(n_len, 2);
16452
16453         ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16454         desret_int(ret_val);
16455         call_tests++;
16456         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16457         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16458         des_int_ptr(n_len, len, 2);
16459         xmlResetLastError();
16460         if (mem_base != xmlMemBlocks()) {
16461             printf("Leak of %d blocks found in xmlStringCurrentChar",
16462                    xmlMemBlocks() - mem_base);
16463             test_ret++;
16464             printf(" %d", n_ctxt);
16465             printf(" %d", n_cur);
16466             printf(" %d", n_len);
16467             printf("\n");
16468         }
16469     }
16470     }
16471     }
16472     function_tests++;
16473
16474     return(test_ret);
16475 }
16476
16477
16478 static int
16479 test_xmlStringDecodeEntities(void) {
16480     int test_ret = 0;
16481
16482     int mem_base;
16483     xmlChar * ret_val;
16484     xmlParserCtxtPtr ctxt; /* the parser context */
16485     int n_ctxt;
16486     xmlChar * str; /* the input string */
16487     int n_str;
16488     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16489     int n_what;
16490     xmlChar end; /* an end marker xmlChar, 0 if none */
16491     int n_end;
16492     xmlChar end2; /* an end marker xmlChar, 0 if none */
16493     int n_end2;
16494     xmlChar end3; /* an end marker xmlChar, 0 if none */
16495     int n_end3;
16496
16497     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16498     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16499     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16500     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16501     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16502     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16503         mem_base = xmlMemBlocks();
16504         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16505         str = gen_const_xmlChar_ptr(n_str, 1);
16506         what = gen_int(n_what, 2);
16507         end = gen_xmlChar(n_end, 3);
16508         end2 = gen_xmlChar(n_end2, 4);
16509         end3 = gen_xmlChar(n_end3, 5);
16510
16511         ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16512         desret_xmlChar_ptr(ret_val);
16513         call_tests++;
16514         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16515         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16516         des_int(n_what, what, 2);
16517         des_xmlChar(n_end, end, 3);
16518         des_xmlChar(n_end2, end2, 4);
16519         des_xmlChar(n_end3, end3, 5);
16520         xmlResetLastError();
16521         if (mem_base != xmlMemBlocks()) {
16522             printf("Leak of %d blocks found in xmlStringDecodeEntities",
16523                    xmlMemBlocks() - mem_base);
16524             test_ret++;
16525             printf(" %d", n_ctxt);
16526             printf(" %d", n_str);
16527             printf(" %d", n_what);
16528             printf(" %d", n_end);
16529             printf(" %d", n_end2);
16530             printf(" %d", n_end3);
16531             printf("\n");
16532         }
16533     }
16534     }
16535     }
16536     }
16537     }
16538     }
16539     function_tests++;
16540
16541     return(test_ret);
16542 }
16543
16544
16545 static int
16546 test_xmlStringLenDecodeEntities(void) {
16547     int test_ret = 0;
16548
16549     int mem_base;
16550     xmlChar * ret_val;
16551     xmlParserCtxtPtr ctxt; /* the parser context */
16552     int n_ctxt;
16553     xmlChar * str; /* the input string */
16554     int n_str;
16555     int len; /* the string length */
16556     int n_len;
16557     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16558     int n_what;
16559     xmlChar end; /* an end marker xmlChar, 0 if none */
16560     int n_end;
16561     xmlChar end2; /* an end marker xmlChar, 0 if none */
16562     int n_end2;
16563     xmlChar end3; /* an end marker xmlChar, 0 if none */
16564     int n_end3;
16565
16566     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16567     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16568     for (n_len = 0;n_len < gen_nb_int;n_len++) {
16569     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16570     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16571     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16572     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16573         mem_base = xmlMemBlocks();
16574         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16575         str = gen_const_xmlChar_ptr(n_str, 1);
16576         len = gen_int(n_len, 2);
16577         what = gen_int(n_what, 3);
16578         end = gen_xmlChar(n_end, 4);
16579         end2 = gen_xmlChar(n_end2, 5);
16580         end3 = gen_xmlChar(n_end3, 6);
16581
16582         ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16583         desret_xmlChar_ptr(ret_val);
16584         call_tests++;
16585         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16586         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16587         des_int(n_len, len, 2);
16588         des_int(n_what, what, 3);
16589         des_xmlChar(n_end, end, 4);
16590         des_xmlChar(n_end2, end2, 5);
16591         des_xmlChar(n_end3, end3, 6);
16592         xmlResetLastError();
16593         if (mem_base != xmlMemBlocks()) {
16594             printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16595                    xmlMemBlocks() - mem_base);
16596             test_ret++;
16597             printf(" %d", n_ctxt);
16598             printf(" %d", n_str);
16599             printf(" %d", n_len);
16600             printf(" %d", n_what);
16601             printf(" %d", n_end);
16602             printf(" %d", n_end2);
16603             printf(" %d", n_end3);
16604             printf("\n");
16605         }
16606     }
16607     }
16608     }
16609     }
16610     }
16611     }
16612     }
16613     function_tests++;
16614
16615     return(test_ret);
16616 }
16617
16618
16619 static int
16620 test_xmlSwitchEncoding(void) {
16621     int test_ret = 0;
16622
16623     int mem_base;
16624     int ret_val;
16625     xmlParserCtxtPtr ctxt; /* the parser context */
16626     int n_ctxt;
16627     xmlCharEncoding enc; /* the encoding value (number) */
16628     int n_enc;
16629
16630     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16631     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16632         mem_base = xmlMemBlocks();
16633         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16634         enc = gen_xmlCharEncoding(n_enc, 1);
16635
16636         ret_val = xmlSwitchEncoding(ctxt, enc);
16637         desret_int(ret_val);
16638         call_tests++;
16639         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16640         des_xmlCharEncoding(n_enc, enc, 1);
16641         xmlResetLastError();
16642         if (mem_base != xmlMemBlocks()) {
16643             printf("Leak of %d blocks found in xmlSwitchEncoding",
16644                    xmlMemBlocks() - mem_base);
16645             test_ret++;
16646             printf(" %d", n_ctxt);
16647             printf(" %d", n_enc);
16648             printf("\n");
16649         }
16650     }
16651     }
16652     function_tests++;
16653
16654     return(test_ret);
16655 }
16656
16657
16658 static int
16659 test_xmlSwitchInputEncoding(void) {
16660     int test_ret = 0;
16661
16662     int mem_base;
16663     int ret_val;
16664     xmlParserCtxtPtr ctxt; /* the parser context */
16665     int n_ctxt;
16666     xmlParserInputPtr input; /* the input stream */
16667     int n_input;
16668     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16669     int n_handler;
16670
16671     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16672     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16673     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16674         mem_base = xmlMemBlocks();
16675         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16676         input = gen_xmlParserInputPtr(n_input, 1);
16677         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16678
16679         ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16680         desret_int(ret_val);
16681         call_tests++;
16682         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16683         des_xmlParserInputPtr(n_input, input, 1);
16684         des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16685         xmlResetLastError();
16686         if (mem_base != xmlMemBlocks()) {
16687             printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16688                    xmlMemBlocks() - mem_base);
16689             test_ret++;
16690             printf(" %d", n_ctxt);
16691             printf(" %d", n_input);
16692             printf(" %d", n_handler);
16693             printf("\n");
16694         }
16695     }
16696     }
16697     }
16698     function_tests++;
16699
16700     return(test_ret);
16701 }
16702
16703
16704 static int
16705 test_xmlSwitchToEncoding(void) {
16706     int test_ret = 0;
16707
16708     int mem_base;
16709     int ret_val;
16710     xmlParserCtxtPtr ctxt; /* the parser context */
16711     int n_ctxt;
16712     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16713     int n_handler;
16714
16715     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16716     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16717         mem_base = xmlMemBlocks();
16718         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16719         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16720
16721         ret_val = xmlSwitchToEncoding(ctxt, handler);
16722         desret_int(ret_val);
16723         call_tests++;
16724         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16725         des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16726         xmlResetLastError();
16727         if (mem_base != xmlMemBlocks()) {
16728             printf("Leak of %d blocks found in xmlSwitchToEncoding",
16729                    xmlMemBlocks() - mem_base);
16730             test_ret++;
16731             printf(" %d", n_ctxt);
16732             printf(" %d", n_handler);
16733             printf("\n");
16734         }
16735     }
16736     }
16737     function_tests++;
16738
16739     return(test_ret);
16740 }
16741
16742 static int
16743 test_parserInternals(void) {
16744     int test_ret = 0;
16745
16746     if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16747     test_ret += test_htmlCreateFileParserCtxt();
16748     test_ret += test_htmlInitAutoClose();
16749     test_ret += test_inputPop();
16750     test_ret += test_inputPush();
16751     test_ret += test_namePop();
16752     test_ret += test_namePush();
16753     test_ret += test_nodePop();
16754     test_ret += test_nodePush();
16755     test_ret += test_xmlCheckLanguageID();
16756     test_ret += test_xmlCopyChar();
16757     test_ret += test_xmlCopyCharMultiByte();
16758     test_ret += test_xmlCreateEntityParserCtxt();
16759     test_ret += test_xmlCreateFileParserCtxt();
16760     test_ret += test_xmlCreateMemoryParserCtxt();
16761     test_ret += test_xmlCreateURLParserCtxt();
16762     test_ret += test_xmlCurrentChar();
16763     test_ret += test_xmlErrMemory();
16764     test_ret += test_xmlIsLetter();
16765     test_ret += test_xmlNewEntityInputStream();
16766     test_ret += test_xmlNewInputFromFile();
16767     test_ret += test_xmlNewInputStream();
16768     test_ret += test_xmlNewStringInputStream();
16769     test_ret += test_xmlNextChar();
16770     test_ret += test_xmlParserInputShrink();
16771     test_ret += test_xmlPopInput();
16772     test_ret += test_xmlPushInput();
16773     test_ret += test_xmlSetEntityReferenceFunc();
16774     test_ret += test_xmlSplitQName();
16775     test_ret += test_xmlStringCurrentChar();
16776     test_ret += test_xmlStringDecodeEntities();
16777     test_ret += test_xmlStringLenDecodeEntities();
16778     test_ret += test_xmlSwitchEncoding();
16779     test_ret += test_xmlSwitchInputEncoding();
16780     test_ret += test_xmlSwitchToEncoding();
16781
16782     if (test_ret != 0)
16783         printf("Module parserInternals: %d errors\n", test_ret);
16784     return(test_ret);
16785 }
16786
16787 static int
16788 test_xmlPatternFromRoot(void) {
16789     int test_ret = 0;
16790
16791 #if defined(LIBXML_PATTERN_ENABLED)
16792     int mem_base;
16793     int ret_val;
16794     xmlPatternPtr comp; /* the precompiled pattern */
16795     int n_comp;
16796
16797     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16798         mem_base = xmlMemBlocks();
16799         comp = gen_xmlPatternPtr(n_comp, 0);
16800
16801         ret_val = xmlPatternFromRoot(comp);
16802         desret_int(ret_val);
16803         call_tests++;
16804         des_xmlPatternPtr(n_comp, comp, 0);
16805         xmlResetLastError();
16806         if (mem_base != xmlMemBlocks()) {
16807             printf("Leak of %d blocks found in xmlPatternFromRoot",
16808                    xmlMemBlocks() - mem_base);
16809             test_ret++;
16810             printf(" %d", n_comp);
16811             printf("\n");
16812         }
16813     }
16814     function_tests++;
16815 #endif
16816
16817     return(test_ret);
16818 }
16819
16820
16821 static int
16822 test_xmlPatternGetStreamCtxt(void) {
16823     int test_ret = 0;
16824
16825
16826     /* missing type support */
16827     return(test_ret);
16828 }
16829
16830
16831 static int
16832 test_xmlPatternMatch(void) {
16833     int test_ret = 0;
16834
16835 #if defined(LIBXML_PATTERN_ENABLED)
16836     int mem_base;
16837     int ret_val;
16838     xmlPatternPtr comp; /* the precompiled pattern */
16839     int n_comp;
16840     xmlNodePtr node; /* a node */
16841     int n_node;
16842
16843     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16844     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16845         mem_base = xmlMemBlocks();
16846         comp = gen_xmlPatternPtr(n_comp, 0);
16847         node = gen_xmlNodePtr(n_node, 1);
16848
16849         ret_val = xmlPatternMatch(comp, node);
16850         desret_int(ret_val);
16851         call_tests++;
16852         des_xmlPatternPtr(n_comp, comp, 0);
16853         des_xmlNodePtr(n_node, node, 1);
16854         xmlResetLastError();
16855         if (mem_base != xmlMemBlocks()) {
16856             printf("Leak of %d blocks found in xmlPatternMatch",
16857                    xmlMemBlocks() - mem_base);
16858             test_ret++;
16859             printf(" %d", n_comp);
16860             printf(" %d", n_node);
16861             printf("\n");
16862         }
16863     }
16864     }
16865     function_tests++;
16866 #endif
16867
16868     return(test_ret);
16869 }
16870
16871
16872 static int
16873 test_xmlPatternMaxDepth(void) {
16874     int test_ret = 0;
16875
16876 #if defined(LIBXML_PATTERN_ENABLED)
16877     int mem_base;
16878     int ret_val;
16879     xmlPatternPtr comp; /* the precompiled pattern */
16880     int n_comp;
16881
16882     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16883         mem_base = xmlMemBlocks();
16884         comp = gen_xmlPatternPtr(n_comp, 0);
16885
16886         ret_val = xmlPatternMaxDepth(comp);
16887         desret_int(ret_val);
16888         call_tests++;
16889         des_xmlPatternPtr(n_comp, comp, 0);
16890         xmlResetLastError();
16891         if (mem_base != xmlMemBlocks()) {
16892             printf("Leak of %d blocks found in xmlPatternMaxDepth",
16893                    xmlMemBlocks() - mem_base);
16894             test_ret++;
16895             printf(" %d", n_comp);
16896             printf("\n");
16897         }
16898     }
16899     function_tests++;
16900 #endif
16901
16902     return(test_ret);
16903 }
16904
16905
16906 static int
16907 test_xmlPatternMinDepth(void) {
16908     int test_ret = 0;
16909
16910 #if defined(LIBXML_PATTERN_ENABLED)
16911     int mem_base;
16912     int ret_val;
16913     xmlPatternPtr comp; /* the precompiled pattern */
16914     int n_comp;
16915
16916     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16917         mem_base = xmlMemBlocks();
16918         comp = gen_xmlPatternPtr(n_comp, 0);
16919
16920         ret_val = xmlPatternMinDepth(comp);
16921         desret_int(ret_val);
16922         call_tests++;
16923         des_xmlPatternPtr(n_comp, comp, 0);
16924         xmlResetLastError();
16925         if (mem_base != xmlMemBlocks()) {
16926             printf("Leak of %d blocks found in xmlPatternMinDepth",
16927                    xmlMemBlocks() - mem_base);
16928             test_ret++;
16929             printf(" %d", n_comp);
16930             printf("\n");
16931         }
16932     }
16933     function_tests++;
16934 #endif
16935
16936     return(test_ret);
16937 }
16938
16939
16940 static int
16941 test_xmlPatternStreamable(void) {
16942     int test_ret = 0;
16943
16944 #if defined(LIBXML_PATTERN_ENABLED)
16945     int mem_base;
16946     int ret_val;
16947     xmlPatternPtr comp; /* the precompiled pattern */
16948     int n_comp;
16949
16950     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16951         mem_base = xmlMemBlocks();
16952         comp = gen_xmlPatternPtr(n_comp, 0);
16953
16954         ret_val = xmlPatternStreamable(comp);
16955         desret_int(ret_val);
16956         call_tests++;
16957         des_xmlPatternPtr(n_comp, comp, 0);
16958         xmlResetLastError();
16959         if (mem_base != xmlMemBlocks()) {
16960             printf("Leak of %d blocks found in xmlPatternStreamable",
16961                    xmlMemBlocks() - mem_base);
16962             test_ret++;
16963             printf(" %d", n_comp);
16964             printf("\n");
16965         }
16966     }
16967     function_tests++;
16968 #endif
16969
16970     return(test_ret);
16971 }
16972
16973
16974 static int
16975 test_xmlPatterncompile(void) {
16976     int test_ret = 0;
16977
16978
16979     /* missing type support */
16980     return(test_ret);
16981 }
16982
16983 #ifdef LIBXML_PATTERN_ENABLED
16984
16985 #define gen_nb_xmlStreamCtxtPtr 1
16986 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16987     return(NULL);
16988 }
16989 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16990 }
16991 #endif
16992
16993
16994 static int
16995 test_xmlStreamPop(void) {
16996     int test_ret = 0;
16997
16998 #if defined(LIBXML_PATTERN_ENABLED)
16999     int mem_base;
17000     int ret_val;
17001     xmlStreamCtxtPtr stream; /* the stream context */
17002     int n_stream;
17003
17004     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17005         mem_base = xmlMemBlocks();
17006         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17007
17008         ret_val = xmlStreamPop(stream);
17009         desret_int(ret_val);
17010         call_tests++;
17011         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17012         xmlResetLastError();
17013         if (mem_base != xmlMemBlocks()) {
17014             printf("Leak of %d blocks found in xmlStreamPop",
17015                    xmlMemBlocks() - mem_base);
17016             test_ret++;
17017             printf(" %d", n_stream);
17018             printf("\n");
17019         }
17020     }
17021     function_tests++;
17022 #endif
17023
17024     return(test_ret);
17025 }
17026
17027
17028 static int
17029 test_xmlStreamPush(void) {
17030     int test_ret = 0;
17031
17032 #if defined(LIBXML_PATTERN_ENABLED)
17033     int mem_base;
17034     int ret_val;
17035     xmlStreamCtxtPtr stream; /* the stream context */
17036     int n_stream;
17037     xmlChar * name; /* the current name */
17038     int n_name;
17039     xmlChar * ns; /* the namespace name */
17040     int n_ns;
17041
17042     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17043     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17044     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17045         mem_base = xmlMemBlocks();
17046         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17047         name = gen_const_xmlChar_ptr(n_name, 1);
17048         ns = gen_const_xmlChar_ptr(n_ns, 2);
17049
17050         ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17051         desret_int(ret_val);
17052         call_tests++;
17053         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17054         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17055         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17056         xmlResetLastError();
17057         if (mem_base != xmlMemBlocks()) {
17058             printf("Leak of %d blocks found in xmlStreamPush",
17059                    xmlMemBlocks() - mem_base);
17060             test_ret++;
17061             printf(" %d", n_stream);
17062             printf(" %d", n_name);
17063             printf(" %d", n_ns);
17064             printf("\n");
17065         }
17066     }
17067     }
17068     }
17069     function_tests++;
17070 #endif
17071
17072     return(test_ret);
17073 }
17074
17075
17076 static int
17077 test_xmlStreamPushAttr(void) {
17078     int test_ret = 0;
17079
17080 #if defined(LIBXML_PATTERN_ENABLED)
17081     int mem_base;
17082     int ret_val;
17083     xmlStreamCtxtPtr stream; /* the stream context */
17084     int n_stream;
17085     xmlChar * name; /* the current name */
17086     int n_name;
17087     xmlChar * ns; /* the namespace name */
17088     int n_ns;
17089
17090     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17091     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17092     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17093         mem_base = xmlMemBlocks();
17094         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17095         name = gen_const_xmlChar_ptr(n_name, 1);
17096         ns = gen_const_xmlChar_ptr(n_ns, 2);
17097
17098         ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17099         desret_int(ret_val);
17100         call_tests++;
17101         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17102         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17103         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17104         xmlResetLastError();
17105         if (mem_base != xmlMemBlocks()) {
17106             printf("Leak of %d blocks found in xmlStreamPushAttr",
17107                    xmlMemBlocks() - mem_base);
17108             test_ret++;
17109             printf(" %d", n_stream);
17110             printf(" %d", n_name);
17111             printf(" %d", n_ns);
17112             printf("\n");
17113         }
17114     }
17115     }
17116     }
17117     function_tests++;
17118 #endif
17119
17120     return(test_ret);
17121 }
17122
17123
17124 static int
17125 test_xmlStreamPushNode(void) {
17126     int test_ret = 0;
17127
17128 #if defined(LIBXML_PATTERN_ENABLED)
17129     int mem_base;
17130     int ret_val;
17131     xmlStreamCtxtPtr stream; /* the stream context */
17132     int n_stream;
17133     xmlChar * name; /* the current name */
17134     int n_name;
17135     xmlChar * ns; /* the namespace name */
17136     int n_ns;
17137     int nodeType; /* the type of the node being pushed */
17138     int n_nodeType;
17139
17140     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17141     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17142     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17143     for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17144         mem_base = xmlMemBlocks();
17145         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17146         name = gen_const_xmlChar_ptr(n_name, 1);
17147         ns = gen_const_xmlChar_ptr(n_ns, 2);
17148         nodeType = gen_int(n_nodeType, 3);
17149
17150         ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17151         desret_int(ret_val);
17152         call_tests++;
17153         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17154         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17155         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17156         des_int(n_nodeType, nodeType, 3);
17157         xmlResetLastError();
17158         if (mem_base != xmlMemBlocks()) {
17159             printf("Leak of %d blocks found in xmlStreamPushNode",
17160                    xmlMemBlocks() - mem_base);
17161             test_ret++;
17162             printf(" %d", n_stream);
17163             printf(" %d", n_name);
17164             printf(" %d", n_ns);
17165             printf(" %d", n_nodeType);
17166             printf("\n");
17167         }
17168     }
17169     }
17170     }
17171     }
17172     function_tests++;
17173 #endif
17174
17175     return(test_ret);
17176 }
17177
17178
17179 static int
17180 test_xmlStreamWantsAnyNode(void) {
17181     int test_ret = 0;
17182
17183 #if defined(LIBXML_PATTERN_ENABLED)
17184     int mem_base;
17185     int ret_val;
17186     xmlStreamCtxtPtr streamCtxt; /* the stream context */
17187     int n_streamCtxt;
17188
17189     for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17190         mem_base = xmlMemBlocks();
17191         streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17192
17193         ret_val = xmlStreamWantsAnyNode(streamCtxt);
17194         desret_int(ret_val);
17195         call_tests++;
17196         des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17197         xmlResetLastError();
17198         if (mem_base != xmlMemBlocks()) {
17199             printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17200                    xmlMemBlocks() - mem_base);
17201             test_ret++;
17202             printf(" %d", n_streamCtxt);
17203             printf("\n");
17204         }
17205     }
17206     function_tests++;
17207 #endif
17208
17209     return(test_ret);
17210 }
17211
17212 static int
17213 test_pattern(void) {
17214     int test_ret = 0;
17215
17216     if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17217     test_ret += test_xmlPatternFromRoot();
17218     test_ret += test_xmlPatternGetStreamCtxt();
17219     test_ret += test_xmlPatternMatch();
17220     test_ret += test_xmlPatternMaxDepth();
17221     test_ret += test_xmlPatternMinDepth();
17222     test_ret += test_xmlPatternStreamable();
17223     test_ret += test_xmlPatterncompile();
17224     test_ret += test_xmlStreamPop();
17225     test_ret += test_xmlStreamPush();
17226     test_ret += test_xmlStreamPushAttr();
17227     test_ret += test_xmlStreamPushNode();
17228     test_ret += test_xmlStreamWantsAnyNode();
17229
17230     if (test_ret != 0)
17231         printf("Module pattern: %d errors\n", test_ret);
17232     return(test_ret);
17233 }
17234 #ifdef LIBXML_SCHEMAS_ENABLED
17235
17236 #define gen_nb_xmlRelaxNGPtr 1
17237 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17238     return(NULL);
17239 }
17240 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17241 }
17242 #endif
17243
17244
17245 static int
17246 test_xmlRelaxNGDump(void) {
17247     int test_ret = 0;
17248
17249 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17250     int mem_base;
17251     FILE * output; /* the file output */
17252     int n_output;
17253     xmlRelaxNGPtr schema; /* a schema structure */
17254     int n_schema;
17255
17256     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17257     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17258         mem_base = xmlMemBlocks();
17259         output = gen_FILE_ptr(n_output, 0);
17260         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17261
17262         xmlRelaxNGDump(output, schema);
17263         call_tests++;
17264         des_FILE_ptr(n_output, output, 0);
17265         des_xmlRelaxNGPtr(n_schema, schema, 1);
17266         xmlResetLastError();
17267         if (mem_base != xmlMemBlocks()) {
17268             printf("Leak of %d blocks found in xmlRelaxNGDump",
17269                    xmlMemBlocks() - mem_base);
17270             test_ret++;
17271             printf(" %d", n_output);
17272             printf(" %d", n_schema);
17273             printf("\n");
17274         }
17275     }
17276     }
17277     function_tests++;
17278 #endif
17279
17280     return(test_ret);
17281 }
17282
17283
17284 static int
17285 test_xmlRelaxNGDumpTree(void) {
17286     int test_ret = 0;
17287
17288 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17289     int mem_base;
17290     FILE * output; /* the file output */
17291     int n_output;
17292     xmlRelaxNGPtr schema; /* a schema structure */
17293     int n_schema;
17294
17295     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17296     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17297         mem_base = xmlMemBlocks();
17298         output = gen_FILE_ptr(n_output, 0);
17299         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17300
17301         xmlRelaxNGDumpTree(output, schema);
17302         call_tests++;
17303         des_FILE_ptr(n_output, output, 0);
17304         des_xmlRelaxNGPtr(n_schema, schema, 1);
17305         xmlResetLastError();
17306         if (mem_base != xmlMemBlocks()) {
17307             printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17308                    xmlMemBlocks() - mem_base);
17309             test_ret++;
17310             printf(" %d", n_output);
17311             printf(" %d", n_schema);
17312             printf("\n");
17313         }
17314     }
17315     }
17316     function_tests++;
17317 #endif
17318
17319     return(test_ret);
17320 }
17321
17322 #ifdef LIBXML_SCHEMAS_ENABLED
17323
17324 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17325 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17326     return(NULL);
17327 }
17328 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17329 }
17330 #endif
17331
17332 #ifdef LIBXML_SCHEMAS_ENABLED
17333
17334 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17335 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17336     return(NULL);
17337 }
17338 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17339 }
17340 #endif
17341
17342 #ifdef LIBXML_SCHEMAS_ENABLED
17343
17344 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17345 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17346     return(NULL);
17347 }
17348 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17349 }
17350 #endif
17351
17352
17353 static int
17354 test_xmlRelaxNGGetParserErrors(void) {
17355     int test_ret = 0;
17356
17357 #if defined(LIBXML_SCHEMAS_ENABLED)
17358     int mem_base;
17359     int ret_val;
17360     xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17361     int n_ctxt;
17362     xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17363     int n_err;
17364     xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17365     int n_warn;
17366     void ** ctx; /* contextual data for the callbacks result */
17367     int n_ctx;
17368
17369     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17370     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17371     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17372     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17373         mem_base = xmlMemBlocks();
17374         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17375         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17376         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17377         ctx = gen_void_ptr_ptr(n_ctx, 3);
17378
17379         ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17380         desret_int(ret_val);
17381         call_tests++;
17382         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17383         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17384         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17385         des_void_ptr_ptr(n_ctx, ctx, 3);
17386         xmlResetLastError();
17387         if (mem_base != xmlMemBlocks()) {
17388             printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17389                    xmlMemBlocks() - mem_base);
17390             test_ret++;
17391             printf(" %d", n_ctxt);
17392             printf(" %d", n_err);
17393             printf(" %d", n_warn);
17394             printf(" %d", n_ctx);
17395             printf("\n");
17396         }
17397     }
17398     }
17399     }
17400     }
17401     function_tests++;
17402 #endif
17403
17404     return(test_ret);
17405 }
17406
17407 #ifdef LIBXML_SCHEMAS_ENABLED
17408
17409 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17410 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17411     return(NULL);
17412 }
17413 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17414 }
17415 #endif
17416
17417
17418 static int
17419 test_xmlRelaxNGGetValidErrors(void) {
17420     int test_ret = 0;
17421
17422 #if defined(LIBXML_SCHEMAS_ENABLED)
17423     int mem_base;
17424     int ret_val;
17425     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17426     int n_ctxt;
17427     xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17428     int n_err;
17429     xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17430     int n_warn;
17431     void ** ctx; /* the functions context result */
17432     int n_ctx;
17433
17434     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17435     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17436     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17437     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17438         mem_base = xmlMemBlocks();
17439         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17440         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17441         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17442         ctx = gen_void_ptr_ptr(n_ctx, 3);
17443
17444         ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17445         desret_int(ret_val);
17446         call_tests++;
17447         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17448         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17449         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17450         des_void_ptr_ptr(n_ctx, ctx, 3);
17451         xmlResetLastError();
17452         if (mem_base != xmlMemBlocks()) {
17453             printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17454                    xmlMemBlocks() - mem_base);
17455             test_ret++;
17456             printf(" %d", n_ctxt);
17457             printf(" %d", n_err);
17458             printf(" %d", n_warn);
17459             printf(" %d", n_ctx);
17460             printf("\n");
17461         }
17462     }
17463     }
17464     }
17465     }
17466     function_tests++;
17467 #endif
17468
17469     return(test_ret);
17470 }
17471
17472
17473 static int
17474 test_xmlRelaxNGInitTypes(void) {
17475     int test_ret = 0;
17476
17477 #if defined(LIBXML_SCHEMAS_ENABLED)
17478     int mem_base;
17479     int ret_val;
17480
17481         mem_base = xmlMemBlocks();
17482
17483         ret_val = xmlRelaxNGInitTypes();
17484         desret_int(ret_val);
17485         call_tests++;
17486         xmlResetLastError();
17487         if (mem_base != xmlMemBlocks()) {
17488             printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17489                    xmlMemBlocks() - mem_base);
17490             test_ret++;
17491             printf("\n");
17492         }
17493     function_tests++;
17494 #endif
17495
17496     return(test_ret);
17497 }
17498
17499
17500 static int
17501 test_xmlRelaxNGNewDocParserCtxt(void) {
17502     int test_ret = 0;
17503
17504 #if defined(LIBXML_SCHEMAS_ENABLED)
17505     int mem_base;
17506     xmlRelaxNGParserCtxtPtr ret_val;
17507     xmlDocPtr doc; /* a preparsed document tree */
17508     int n_doc;
17509
17510     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17511         mem_base = xmlMemBlocks();
17512         doc = gen_xmlDocPtr(n_doc, 0);
17513
17514         ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17515         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17516         call_tests++;
17517         des_xmlDocPtr(n_doc, doc, 0);
17518         xmlResetLastError();
17519         if (mem_base != xmlMemBlocks()) {
17520             printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17521                    xmlMemBlocks() - mem_base);
17522             test_ret++;
17523             printf(" %d", n_doc);
17524             printf("\n");
17525         }
17526     }
17527     function_tests++;
17528 #endif
17529
17530     return(test_ret);
17531 }
17532
17533
17534 static int
17535 test_xmlRelaxNGNewMemParserCtxt(void) {
17536     int test_ret = 0;
17537
17538 #if defined(LIBXML_SCHEMAS_ENABLED)
17539     int mem_base;
17540     xmlRelaxNGParserCtxtPtr ret_val;
17541     char * buffer; /* a pointer to a char array containing the schemas */
17542     int n_buffer;
17543     int size; /* the size of the array */
17544     int n_size;
17545
17546     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17547     for (n_size = 0;n_size < gen_nb_int;n_size++) {
17548         mem_base = xmlMemBlocks();
17549         buffer = gen_const_char_ptr(n_buffer, 0);
17550         size = gen_int(n_size, 1);
17551
17552         ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17553         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17554         call_tests++;
17555         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17556         des_int(n_size, size, 1);
17557         xmlResetLastError();
17558         if (mem_base != xmlMemBlocks()) {
17559             printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17560                    xmlMemBlocks() - mem_base);
17561             test_ret++;
17562             printf(" %d", n_buffer);
17563             printf(" %d", n_size);
17564             printf("\n");
17565         }
17566     }
17567     }
17568     function_tests++;
17569 #endif
17570
17571     return(test_ret);
17572 }
17573
17574
17575 static int
17576 test_xmlRelaxNGNewParserCtxt(void) {
17577     int test_ret = 0;
17578
17579 #if defined(LIBXML_SCHEMAS_ENABLED)
17580     int mem_base;
17581     xmlRelaxNGParserCtxtPtr ret_val;
17582     char * URL; /* the location of the schema */
17583     int n_URL;
17584
17585     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17586         mem_base = xmlMemBlocks();
17587         URL = gen_const_char_ptr(n_URL, 0);
17588
17589         ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17590         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17591         call_tests++;
17592         des_const_char_ptr(n_URL, (const char *)URL, 0);
17593         xmlResetLastError();
17594         if (mem_base != xmlMemBlocks()) {
17595             printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17596                    xmlMemBlocks() - mem_base);
17597             test_ret++;
17598             printf(" %d", n_URL);
17599             printf("\n");
17600         }
17601     }
17602     function_tests++;
17603 #endif
17604
17605     return(test_ret);
17606 }
17607
17608
17609 static int
17610 test_xmlRelaxNGNewValidCtxt(void) {
17611     int test_ret = 0;
17612
17613
17614     /* missing type support */
17615     return(test_ret);
17616 }
17617
17618
17619 static int
17620 test_xmlRelaxNGParse(void) {
17621     int test_ret = 0;
17622
17623
17624     /* missing type support */
17625     return(test_ret);
17626 }
17627
17628
17629 static int
17630 test_xmlRelaxNGSetParserErrors(void) {
17631     int test_ret = 0;
17632
17633
17634     /* missing type support */
17635     return(test_ret);
17636 }
17637
17638
17639 static int
17640 test_xmlRelaxNGSetParserStructuredErrors(void) {
17641     int test_ret = 0;
17642
17643
17644     /* missing type support */
17645     return(test_ret);
17646 }
17647
17648
17649 static int
17650 test_xmlRelaxNGSetValidErrors(void) {
17651     int test_ret = 0;
17652
17653
17654     /* missing type support */
17655     return(test_ret);
17656 }
17657
17658
17659 static int
17660 test_xmlRelaxNGSetValidStructuredErrors(void) {
17661     int test_ret = 0;
17662
17663
17664     /* missing type support */
17665     return(test_ret);
17666 }
17667
17668
17669 static int
17670 test_xmlRelaxNGValidateDoc(void) {
17671     int test_ret = 0;
17672
17673 #if defined(LIBXML_SCHEMAS_ENABLED)
17674     int mem_base;
17675     int ret_val;
17676     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17677     int n_ctxt;
17678     xmlDocPtr doc; /* a parsed document tree */
17679     int n_doc;
17680
17681     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17682     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17683         mem_base = xmlMemBlocks();
17684         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17685         doc = gen_xmlDocPtr(n_doc, 1);
17686
17687         ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17688         desret_int(ret_val);
17689         call_tests++;
17690         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17691         des_xmlDocPtr(n_doc, doc, 1);
17692         xmlResetLastError();
17693         if (mem_base != xmlMemBlocks()) {
17694             printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17695                    xmlMemBlocks() - mem_base);
17696             test_ret++;
17697             printf(" %d", n_ctxt);
17698             printf(" %d", n_doc);
17699             printf("\n");
17700         }
17701     }
17702     }
17703     function_tests++;
17704 #endif
17705
17706     return(test_ret);
17707 }
17708
17709
17710 static int
17711 test_xmlRelaxNGValidateFullElement(void) {
17712     int test_ret = 0;
17713
17714 #if defined(LIBXML_SCHEMAS_ENABLED)
17715     int mem_base;
17716     int ret_val;
17717     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17718     int n_ctxt;
17719     xmlDocPtr doc; /* a document instance */
17720     int n_doc;
17721     xmlNodePtr elem; /* an element instance */
17722     int n_elem;
17723
17724     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17725     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17726     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17727         mem_base = xmlMemBlocks();
17728         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17729         doc = gen_xmlDocPtr(n_doc, 1);
17730         elem = gen_xmlNodePtr(n_elem, 2);
17731
17732         ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17733         desret_int(ret_val);
17734         call_tests++;
17735         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17736         des_xmlDocPtr(n_doc, doc, 1);
17737         des_xmlNodePtr(n_elem, elem, 2);
17738         xmlResetLastError();
17739         if (mem_base != xmlMemBlocks()) {
17740             printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17741                    xmlMemBlocks() - mem_base);
17742             test_ret++;
17743             printf(" %d", n_ctxt);
17744             printf(" %d", n_doc);
17745             printf(" %d", n_elem);
17746             printf("\n");
17747         }
17748     }
17749     }
17750     }
17751     function_tests++;
17752 #endif
17753
17754     return(test_ret);
17755 }
17756
17757
17758 static int
17759 test_xmlRelaxNGValidatePopElement(void) {
17760     int test_ret = 0;
17761
17762 #if defined(LIBXML_SCHEMAS_ENABLED)
17763     int mem_base;
17764     int ret_val;
17765     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17766     int n_ctxt;
17767     xmlDocPtr doc; /* a document instance */
17768     int n_doc;
17769     xmlNodePtr elem; /* an element instance */
17770     int n_elem;
17771
17772     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17773     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17774     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17775         mem_base = xmlMemBlocks();
17776         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17777         doc = gen_xmlDocPtr(n_doc, 1);
17778         elem = gen_xmlNodePtr(n_elem, 2);
17779
17780         ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17781         desret_int(ret_val);
17782         call_tests++;
17783         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17784         des_xmlDocPtr(n_doc, doc, 1);
17785         des_xmlNodePtr(n_elem, elem, 2);
17786         xmlResetLastError();
17787         if (mem_base != xmlMemBlocks()) {
17788             printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17789                    xmlMemBlocks() - mem_base);
17790             test_ret++;
17791             printf(" %d", n_ctxt);
17792             printf(" %d", n_doc);
17793             printf(" %d", n_elem);
17794             printf("\n");
17795         }
17796     }
17797     }
17798     }
17799     function_tests++;
17800 #endif
17801
17802     return(test_ret);
17803 }
17804
17805
17806 static int
17807 test_xmlRelaxNGValidatePushCData(void) {
17808     int test_ret = 0;
17809
17810 #if defined(LIBXML_SCHEMAS_ENABLED)
17811     int mem_base;
17812     int ret_val;
17813     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17814     int n_ctxt;
17815     xmlChar * data; /* some character data read */
17816     int n_data;
17817     int len; /* the lenght of the data */
17818     int n_len;
17819
17820     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17821     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17822     for (n_len = 0;n_len < gen_nb_int;n_len++) {
17823         mem_base = xmlMemBlocks();
17824         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17825         data = gen_const_xmlChar_ptr(n_data, 1);
17826         len = gen_int(n_len, 2);
17827
17828         ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17829         desret_int(ret_val);
17830         call_tests++;
17831         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17832         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17833         des_int(n_len, len, 2);
17834         xmlResetLastError();
17835         if (mem_base != xmlMemBlocks()) {
17836             printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17837                    xmlMemBlocks() - mem_base);
17838             test_ret++;
17839             printf(" %d", n_ctxt);
17840             printf(" %d", n_data);
17841             printf(" %d", n_len);
17842             printf("\n");
17843         }
17844     }
17845     }
17846     }
17847     function_tests++;
17848 #endif
17849
17850     return(test_ret);
17851 }
17852
17853
17854 static int
17855 test_xmlRelaxNGValidatePushElement(void) {
17856     int test_ret = 0;
17857
17858 #if defined(LIBXML_SCHEMAS_ENABLED)
17859     int mem_base;
17860     int ret_val;
17861     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17862     int n_ctxt;
17863     xmlDocPtr doc; /* a document instance */
17864     int n_doc;
17865     xmlNodePtr elem; /* an element instance */
17866     int n_elem;
17867
17868     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17869     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17870     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17871         mem_base = xmlMemBlocks();
17872         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17873         doc = gen_xmlDocPtr(n_doc, 1);
17874         elem = gen_xmlNodePtr(n_elem, 2);
17875
17876         ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17877         desret_int(ret_val);
17878         call_tests++;
17879         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17880         des_xmlDocPtr(n_doc, doc, 1);
17881         des_xmlNodePtr(n_elem, elem, 2);
17882         xmlResetLastError();
17883         if (mem_base != xmlMemBlocks()) {
17884             printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17885                    xmlMemBlocks() - mem_base);
17886             test_ret++;
17887             printf(" %d", n_ctxt);
17888             printf(" %d", n_doc);
17889             printf(" %d", n_elem);
17890             printf("\n");
17891         }
17892     }
17893     }
17894     }
17895     function_tests++;
17896 #endif
17897
17898     return(test_ret);
17899 }
17900
17901
17902 static int
17903 test_xmlRelaxParserSetFlag(void) {
17904     int test_ret = 0;
17905
17906 #if defined(LIBXML_SCHEMAS_ENABLED)
17907     int mem_base;
17908     int ret_val;
17909     xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17910     int n_ctxt;
17911     int flags; /* a set of flags values */
17912     int n_flags;
17913
17914     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17915     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17916         mem_base = xmlMemBlocks();
17917         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17918         flags = gen_int(n_flags, 1);
17919
17920         ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17921         desret_int(ret_val);
17922         call_tests++;
17923         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17924         des_int(n_flags, flags, 1);
17925         xmlResetLastError();
17926         if (mem_base != xmlMemBlocks()) {
17927             printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17928                    xmlMemBlocks() - mem_base);
17929             test_ret++;
17930             printf(" %d", n_ctxt);
17931             printf(" %d", n_flags);
17932             printf("\n");
17933         }
17934     }
17935     }
17936     function_tests++;
17937 #endif
17938
17939     return(test_ret);
17940 }
17941
17942 static int
17943 test_relaxng(void) {
17944     int test_ret = 0;
17945
17946     if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17947     test_ret += test_xmlRelaxNGDump();
17948     test_ret += test_xmlRelaxNGDumpTree();
17949     test_ret += test_xmlRelaxNGGetParserErrors();
17950     test_ret += test_xmlRelaxNGGetValidErrors();
17951     test_ret += test_xmlRelaxNGInitTypes();
17952     test_ret += test_xmlRelaxNGNewDocParserCtxt();
17953     test_ret += test_xmlRelaxNGNewMemParserCtxt();
17954     test_ret += test_xmlRelaxNGNewParserCtxt();
17955     test_ret += test_xmlRelaxNGNewValidCtxt();
17956     test_ret += test_xmlRelaxNGParse();
17957     test_ret += test_xmlRelaxNGSetParserErrors();
17958     test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17959     test_ret += test_xmlRelaxNGSetValidErrors();
17960     test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17961     test_ret += test_xmlRelaxNGValidateDoc();
17962     test_ret += test_xmlRelaxNGValidateFullElement();
17963     test_ret += test_xmlRelaxNGValidatePopElement();
17964     test_ret += test_xmlRelaxNGValidatePushCData();
17965     test_ret += test_xmlRelaxNGValidatePushElement();
17966     test_ret += test_xmlRelaxParserSetFlag();
17967
17968     if (test_ret != 0)
17969         printf("Module relaxng: %d errors\n", test_ret);
17970     return(test_ret);
17971 }
17972 static int
17973 test_schemasInternals(void) {
17974     int test_ret = 0;
17975
17976     if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17977
17978     if (test_ret != 0)
17979         printf("Module schemasInternals: %d errors\n", test_ret);
17980     return(test_ret);
17981 }
17982
17983 static int
17984 test_xmlSchematronNewDocParserCtxt(void) {
17985     int test_ret = 0;
17986
17987
17988     /* missing type support */
17989     return(test_ret);
17990 }
17991
17992
17993 static int
17994 test_xmlSchematronNewMemParserCtxt(void) {
17995     int test_ret = 0;
17996
17997
17998     /* missing type support */
17999     return(test_ret);
18000 }
18001
18002
18003 static int
18004 test_xmlSchematronNewParserCtxt(void) {
18005     int test_ret = 0;
18006
18007
18008     /* missing type support */
18009     return(test_ret);
18010 }
18011
18012 #ifdef LIBXML_SCHEMATRON_ENABLED
18013
18014 #define gen_nb_xmlSchematronPtr 1
18015 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18016     return(NULL);
18017 }
18018 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18019 }
18020 #endif
18021
18022
18023 static int
18024 test_xmlSchematronNewValidCtxt(void) {
18025     int test_ret = 0;
18026
18027
18028     /* missing type support */
18029     return(test_ret);
18030 }
18031
18032 #ifdef LIBXML_SCHEMATRON_ENABLED
18033
18034 #define gen_nb_xmlSchematronParserCtxtPtr 1
18035 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18036     return(NULL);
18037 }
18038 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18039 }
18040 #endif
18041
18042
18043 static int
18044 test_xmlSchematronParse(void) {
18045     int test_ret = 0;
18046
18047
18048     /* missing type support */
18049     return(test_ret);
18050 }
18051
18052 #ifdef LIBXML_SCHEMATRON_ENABLED
18053
18054 #define gen_nb_xmlSchematronValidCtxtPtr 1
18055 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18056     return(NULL);
18057 }
18058 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18059 }
18060 #endif
18061
18062
18063 static int
18064 test_xmlSchematronSetValidStructuredErrors(void) {
18065     int test_ret = 0;
18066
18067
18068     /* missing type support */
18069     return(test_ret);
18070 }
18071
18072
18073 static int
18074 test_xmlSchematronValidateDoc(void) {
18075     int test_ret = 0;
18076
18077 #if defined(LIBXML_SCHEMATRON_ENABLED)
18078     int mem_base;
18079     int ret_val;
18080     xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18081     int n_ctxt;
18082     xmlDocPtr instance; /* the document instace tree */
18083     int n_instance;
18084
18085     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18086     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18087         mem_base = xmlMemBlocks();
18088         ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18089         instance = gen_xmlDocPtr(n_instance, 1);
18090
18091         ret_val = xmlSchematronValidateDoc(ctxt, instance);
18092         desret_int(ret_val);
18093         call_tests++;
18094         des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18095         des_xmlDocPtr(n_instance, instance, 1);
18096         xmlResetLastError();
18097         if (mem_base != xmlMemBlocks()) {
18098             printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18099                    xmlMemBlocks() - mem_base);
18100             test_ret++;
18101             printf(" %d", n_ctxt);
18102             printf(" %d", n_instance);
18103             printf("\n");
18104         }
18105     }
18106     }
18107     function_tests++;
18108 #endif
18109
18110     return(test_ret);
18111 }
18112
18113 static int
18114 test_schematron(void) {
18115     int test_ret = 0;
18116
18117     if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18118     test_ret += test_xmlSchematronNewDocParserCtxt();
18119     test_ret += test_xmlSchematronNewMemParserCtxt();
18120     test_ret += test_xmlSchematronNewParserCtxt();
18121     test_ret += test_xmlSchematronNewValidCtxt();
18122     test_ret += test_xmlSchematronParse();
18123     test_ret += test_xmlSchematronSetValidStructuredErrors();
18124     test_ret += test_xmlSchematronValidateDoc();
18125
18126     if (test_ret != 0)
18127         printf("Module schematron: %d errors\n", test_ret);
18128     return(test_ret);
18129 }
18130
18131 static int
18132 test_xmlAddChild(void) {
18133     int test_ret = 0;
18134
18135     int mem_base;
18136     xmlNodePtr ret_val;
18137     xmlNodePtr parent; /* the parent node */
18138     int n_parent;
18139     xmlNodePtr cur; /* the child node */
18140     int n_cur;
18141
18142     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18143     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18144         mem_base = xmlMemBlocks();
18145         parent = gen_xmlNodePtr(n_parent, 0);
18146         cur = gen_xmlNodePtr_in(n_cur, 1);
18147
18148         ret_val = xmlAddChild(parent, cur);
18149         if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18150         desret_xmlNodePtr(ret_val);
18151         call_tests++;
18152         des_xmlNodePtr(n_parent, parent, 0);
18153         des_xmlNodePtr_in(n_cur, cur, 1);
18154         xmlResetLastError();
18155         if (mem_base != xmlMemBlocks()) {
18156             printf("Leak of %d blocks found in xmlAddChild",
18157                    xmlMemBlocks() - mem_base);
18158             test_ret++;
18159             printf(" %d", n_parent);
18160             printf(" %d", n_cur);
18161             printf("\n");
18162         }
18163     }
18164     }
18165     function_tests++;
18166
18167     return(test_ret);
18168 }
18169
18170
18171 static int
18172 test_xmlAddChildList(void) {
18173     int test_ret = 0;
18174
18175     int mem_base;
18176     xmlNodePtr ret_val;
18177     xmlNodePtr parent; /* the parent node */
18178     int n_parent;
18179     xmlNodePtr cur; /* the first node in the list */
18180     int n_cur;
18181
18182     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18183     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18184         mem_base = xmlMemBlocks();
18185         parent = gen_xmlNodePtr(n_parent, 0);
18186         cur = gen_xmlNodePtr_in(n_cur, 1);
18187
18188         ret_val = xmlAddChildList(parent, cur);
18189         if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18190         desret_xmlNodePtr(ret_val);
18191         call_tests++;
18192         des_xmlNodePtr(n_parent, parent, 0);
18193         des_xmlNodePtr_in(n_cur, cur, 1);
18194         xmlResetLastError();
18195         if (mem_base != xmlMemBlocks()) {
18196             printf("Leak of %d blocks found in xmlAddChildList",
18197                    xmlMemBlocks() - mem_base);
18198             test_ret++;
18199             printf(" %d", n_parent);
18200             printf(" %d", n_cur);
18201             printf("\n");
18202         }
18203     }
18204     }
18205     function_tests++;
18206
18207     return(test_ret);
18208 }
18209
18210
18211 static int
18212 test_xmlAddNextSibling(void) {
18213     int test_ret = 0;
18214
18215     int mem_base;
18216     xmlNodePtr ret_val;
18217     xmlNodePtr cur; /* the child node */
18218     int n_cur;
18219     xmlNodePtr elem; /* the new node */
18220     int n_elem;
18221
18222     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18223     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18224         mem_base = xmlMemBlocks();
18225         cur = gen_xmlNodePtr(n_cur, 0);
18226         elem = gen_xmlNodePtr_in(n_elem, 1);
18227
18228         ret_val = xmlAddNextSibling(cur, elem);
18229         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18230         desret_xmlNodePtr(ret_val);
18231         call_tests++;
18232         des_xmlNodePtr(n_cur, cur, 0);
18233         des_xmlNodePtr_in(n_elem, elem, 1);
18234         xmlResetLastError();
18235         if (mem_base != xmlMemBlocks()) {
18236             printf("Leak of %d blocks found in xmlAddNextSibling",
18237                    xmlMemBlocks() - mem_base);
18238             test_ret++;
18239             printf(" %d", n_cur);
18240             printf(" %d", n_elem);
18241             printf("\n");
18242         }
18243     }
18244     }
18245     function_tests++;
18246
18247     return(test_ret);
18248 }
18249
18250
18251 static int
18252 test_xmlAddPrevSibling(void) {
18253     int test_ret = 0;
18254
18255 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18256     int mem_base;
18257     xmlNodePtr ret_val;
18258     xmlNodePtr cur; /* the child node */
18259     int n_cur;
18260     xmlNodePtr elem; /* the new node */
18261     int n_elem;
18262
18263     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18264     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18265         mem_base = xmlMemBlocks();
18266         cur = gen_xmlNodePtr(n_cur, 0);
18267         elem = gen_xmlNodePtr_in(n_elem, 1);
18268
18269         ret_val = xmlAddPrevSibling(cur, elem);
18270         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18271         desret_xmlNodePtr(ret_val);
18272         call_tests++;
18273         des_xmlNodePtr(n_cur, cur, 0);
18274         des_xmlNodePtr_in(n_elem, elem, 1);
18275         xmlResetLastError();
18276         if (mem_base != xmlMemBlocks()) {
18277             printf("Leak of %d blocks found in xmlAddPrevSibling",
18278                    xmlMemBlocks() - mem_base);
18279             test_ret++;
18280             printf(" %d", n_cur);
18281             printf(" %d", n_elem);
18282             printf("\n");
18283         }
18284     }
18285     }
18286     function_tests++;
18287 #endif
18288
18289     return(test_ret);
18290 }
18291
18292
18293 static int
18294 test_xmlAddSibling(void) {
18295     int test_ret = 0;
18296
18297     int mem_base;
18298     xmlNodePtr ret_val;
18299     xmlNodePtr cur; /* the child node */
18300     int n_cur;
18301     xmlNodePtr elem; /* the new node */
18302     int n_elem;
18303
18304     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18305     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18306         mem_base = xmlMemBlocks();
18307         cur = gen_xmlNodePtr(n_cur, 0);
18308         elem = gen_xmlNodePtr_in(n_elem, 1);
18309
18310         ret_val = xmlAddSibling(cur, elem);
18311         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18312         desret_xmlNodePtr(ret_val);
18313         call_tests++;
18314         des_xmlNodePtr(n_cur, cur, 0);
18315         des_xmlNodePtr_in(n_elem, elem, 1);
18316         xmlResetLastError();
18317         if (mem_base != xmlMemBlocks()) {
18318             printf("Leak of %d blocks found in xmlAddSibling",
18319                    xmlMemBlocks() - mem_base);
18320             test_ret++;
18321             printf(" %d", n_cur);
18322             printf(" %d", n_elem);
18323             printf("\n");
18324         }
18325     }
18326     }
18327     function_tests++;
18328
18329     return(test_ret);
18330 }
18331
18332
18333 static int
18334 test_xmlAttrSerializeTxtContent(void) {
18335     int test_ret = 0;
18336
18337 #if defined(LIBXML_OUTPUT_ENABLED)
18338 #ifdef LIBXML_OUTPUT_ENABLED
18339     int mem_base;
18340     xmlBufferPtr buf; /* the XML buffer output */
18341     int n_buf;
18342     xmlDocPtr doc; /* the document */
18343     int n_doc;
18344     xmlAttrPtr attr; /* the attribute node */
18345     int n_attr;
18346     xmlChar * string; /* the text content */
18347     int n_string;
18348
18349     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18350     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18351     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18352     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18353         mem_base = xmlMemBlocks();
18354         buf = gen_xmlBufferPtr(n_buf, 0);
18355         doc = gen_xmlDocPtr(n_doc, 1);
18356         attr = gen_xmlAttrPtr(n_attr, 2);
18357         string = gen_const_xmlChar_ptr(n_string, 3);
18358
18359         xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18360         call_tests++;
18361         des_xmlBufferPtr(n_buf, buf, 0);
18362         des_xmlDocPtr(n_doc, doc, 1);
18363         des_xmlAttrPtr(n_attr, attr, 2);
18364         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18365         xmlResetLastError();
18366         if (mem_base != xmlMemBlocks()) {
18367             printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18368                    xmlMemBlocks() - mem_base);
18369             test_ret++;
18370             printf(" %d", n_buf);
18371             printf(" %d", n_doc);
18372             printf(" %d", n_attr);
18373             printf(" %d", n_string);
18374             printf("\n");
18375         }
18376     }
18377     }
18378     }
18379     }
18380     function_tests++;
18381 #endif
18382 #endif
18383
18384     return(test_ret);
18385 }
18386
18387
18388 static int
18389 test_xmlBufferAdd(void) {
18390     int test_ret = 0;
18391
18392     int mem_base;
18393     int ret_val;
18394     xmlBufferPtr buf; /* the buffer to dump */
18395     int n_buf;
18396     xmlChar * str; /* the #xmlChar string */
18397     int n_str;
18398     int len; /* the number of #xmlChar to add */
18399     int n_len;
18400
18401     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18402     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18403     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18404         mem_base = xmlMemBlocks();
18405         buf = gen_xmlBufferPtr(n_buf, 0);
18406         str = gen_const_xmlChar_ptr(n_str, 1);
18407         len = gen_int(n_len, 2);
18408
18409         ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18410         desret_int(ret_val);
18411         call_tests++;
18412         des_xmlBufferPtr(n_buf, buf, 0);
18413         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18414         des_int(n_len, len, 2);
18415         xmlResetLastError();
18416         if (mem_base != xmlMemBlocks()) {
18417             printf("Leak of %d blocks found in xmlBufferAdd",
18418                    xmlMemBlocks() - mem_base);
18419             test_ret++;
18420             printf(" %d", n_buf);
18421             printf(" %d", n_str);
18422             printf(" %d", n_len);
18423             printf("\n");
18424         }
18425     }
18426     }
18427     }
18428     function_tests++;
18429
18430     return(test_ret);
18431 }
18432
18433
18434 static int
18435 test_xmlBufferAddHead(void) {
18436     int test_ret = 0;
18437
18438     int mem_base;
18439     int ret_val;
18440     xmlBufferPtr buf; /* the buffer */
18441     int n_buf;
18442     xmlChar * str; /* the #xmlChar string */
18443     int n_str;
18444     int len; /* the number of #xmlChar to add */
18445     int n_len;
18446
18447     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18448     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18449     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18450         mem_base = xmlMemBlocks();
18451         buf = gen_xmlBufferPtr(n_buf, 0);
18452         str = gen_const_xmlChar_ptr(n_str, 1);
18453         len = gen_int(n_len, 2);
18454
18455         ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18456         desret_int(ret_val);
18457         call_tests++;
18458         des_xmlBufferPtr(n_buf, buf, 0);
18459         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18460         des_int(n_len, len, 2);
18461         xmlResetLastError();
18462         if (mem_base != xmlMemBlocks()) {
18463             printf("Leak of %d blocks found in xmlBufferAddHead",
18464                    xmlMemBlocks() - mem_base);
18465             test_ret++;
18466             printf(" %d", n_buf);
18467             printf(" %d", n_str);
18468             printf(" %d", n_len);
18469             printf("\n");
18470         }
18471     }
18472     }
18473     }
18474     function_tests++;
18475
18476     return(test_ret);
18477 }
18478
18479
18480 static int
18481 test_xmlBufferCCat(void) {
18482     int test_ret = 0;
18483
18484     int mem_base;
18485     int ret_val;
18486     xmlBufferPtr buf; /* the buffer to dump */
18487     int n_buf;
18488     char * str; /* the C char string */
18489     int n_str;
18490
18491     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18492     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18493         mem_base = xmlMemBlocks();
18494         buf = gen_xmlBufferPtr(n_buf, 0);
18495         str = gen_const_char_ptr(n_str, 1);
18496
18497         ret_val = xmlBufferCCat(buf, (const char *)str);
18498         desret_int(ret_val);
18499         call_tests++;
18500         des_xmlBufferPtr(n_buf, buf, 0);
18501         des_const_char_ptr(n_str, (const char *)str, 1);
18502         xmlResetLastError();
18503         if (mem_base != xmlMemBlocks()) {
18504             printf("Leak of %d blocks found in xmlBufferCCat",
18505                    xmlMemBlocks() - mem_base);
18506             test_ret++;
18507             printf(" %d", n_buf);
18508             printf(" %d", n_str);
18509             printf("\n");
18510         }
18511     }
18512     }
18513     function_tests++;
18514
18515     return(test_ret);
18516 }
18517
18518
18519 static int
18520 test_xmlBufferCat(void) {
18521     int test_ret = 0;
18522
18523     int mem_base;
18524     int ret_val;
18525     xmlBufferPtr buf; /* the buffer to add to */
18526     int n_buf;
18527     xmlChar * str; /* the #xmlChar string */
18528     int n_str;
18529
18530     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18531     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18532         mem_base = xmlMemBlocks();
18533         buf = gen_xmlBufferPtr(n_buf, 0);
18534         str = gen_const_xmlChar_ptr(n_str, 1);
18535
18536         ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18537         desret_int(ret_val);
18538         call_tests++;
18539         des_xmlBufferPtr(n_buf, buf, 0);
18540         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18541         xmlResetLastError();
18542         if (mem_base != xmlMemBlocks()) {
18543             printf("Leak of %d blocks found in xmlBufferCat",
18544                    xmlMemBlocks() - mem_base);
18545             test_ret++;
18546             printf(" %d", n_buf);
18547             printf(" %d", n_str);
18548             printf("\n");
18549         }
18550     }
18551     }
18552     function_tests++;
18553
18554     return(test_ret);
18555 }
18556
18557
18558 #define gen_nb_const_xmlBufferPtr 1
18559 static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18560     return(NULL);
18561 }
18562 static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18563 }
18564
18565 static int
18566 test_xmlBufferContent(void) {
18567     int test_ret = 0;
18568
18569     int mem_base;
18570     const xmlChar * ret_val;
18571     xmlBufferPtr buf; /* the buffer */
18572     int n_buf;
18573
18574     for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18575         mem_base = xmlMemBlocks();
18576         buf = gen_const_xmlBufferPtr(n_buf, 0);
18577
18578         ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18579         desret_const_xmlChar_ptr(ret_val);
18580         call_tests++;
18581         des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18582         xmlResetLastError();
18583         if (mem_base != xmlMemBlocks()) {
18584             printf("Leak of %d blocks found in xmlBufferContent",
18585                    xmlMemBlocks() - mem_base);
18586             test_ret++;
18587             printf(" %d", n_buf);
18588             printf("\n");
18589         }
18590     }
18591     function_tests++;
18592
18593     return(test_ret);
18594 }
18595
18596
18597 static int
18598 test_xmlBufferCreate(void) {
18599     int test_ret = 0;
18600
18601     int mem_base;
18602     xmlBufferPtr ret_val;
18603
18604         mem_base = xmlMemBlocks();
18605
18606         ret_val = xmlBufferCreate();
18607         desret_xmlBufferPtr(ret_val);
18608         call_tests++;
18609         xmlResetLastError();
18610         if (mem_base != xmlMemBlocks()) {
18611             printf("Leak of %d blocks found in xmlBufferCreate",
18612                    xmlMemBlocks() - mem_base);
18613             test_ret++;
18614             printf("\n");
18615         }
18616     function_tests++;
18617
18618     return(test_ret);
18619 }
18620
18621
18622 static int
18623 test_xmlBufferCreateSize(void) {
18624     int test_ret = 0;
18625
18626
18627     /* missing type support */
18628     return(test_ret);
18629 }
18630
18631
18632 static int
18633 test_xmlBufferCreateStatic(void) {
18634     int test_ret = 0;
18635
18636
18637     /* missing type support */
18638     return(test_ret);
18639 }
18640
18641
18642 static int
18643 test_xmlBufferDetach(void) {
18644     int test_ret = 0;
18645
18646     int mem_base;
18647     xmlChar * ret_val;
18648     xmlBufferPtr buf; /* the buffer */
18649     int n_buf;
18650
18651     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18652         mem_base = xmlMemBlocks();
18653         buf = gen_xmlBufferPtr(n_buf, 0);
18654
18655         ret_val = xmlBufferDetach(buf);
18656         desret_xmlChar_ptr(ret_val);
18657         call_tests++;
18658         des_xmlBufferPtr(n_buf, buf, 0);
18659         xmlResetLastError();
18660         if (mem_base != xmlMemBlocks()) {
18661             printf("Leak of %d blocks found in xmlBufferDetach",
18662                    xmlMemBlocks() - mem_base);
18663             test_ret++;
18664             printf(" %d", n_buf);
18665             printf("\n");
18666         }
18667     }
18668     function_tests++;
18669
18670     return(test_ret);
18671 }
18672
18673
18674 static int
18675 test_xmlBufferEmpty(void) {
18676     int test_ret = 0;
18677
18678     int mem_base;
18679     xmlBufferPtr buf; /* the buffer */
18680     int n_buf;
18681
18682     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18683         mem_base = xmlMemBlocks();
18684         buf = gen_xmlBufferPtr(n_buf, 0);
18685
18686         xmlBufferEmpty(buf);
18687         call_tests++;
18688         des_xmlBufferPtr(n_buf, buf, 0);
18689         xmlResetLastError();
18690         if (mem_base != xmlMemBlocks()) {
18691             printf("Leak of %d blocks found in xmlBufferEmpty",
18692                    xmlMemBlocks() - mem_base);
18693             test_ret++;
18694             printf(" %d", n_buf);
18695             printf("\n");
18696         }
18697     }
18698     function_tests++;
18699
18700     return(test_ret);
18701 }
18702
18703
18704 static int
18705 test_xmlBufferGrow(void) {
18706     int test_ret = 0;
18707
18708     int mem_base;
18709     int ret_val;
18710     xmlBufferPtr buf; /* the buffer */
18711     int n_buf;
18712     unsigned int len; /* the minimum free size to allocate */
18713     int n_len;
18714
18715     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18716     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18717         mem_base = xmlMemBlocks();
18718         buf = gen_xmlBufferPtr(n_buf, 0);
18719         len = gen_unsigned_int(n_len, 1);
18720
18721         ret_val = xmlBufferGrow(buf, len);
18722         desret_int(ret_val);
18723         call_tests++;
18724         des_xmlBufferPtr(n_buf, buf, 0);
18725         des_unsigned_int(n_len, len, 1);
18726         xmlResetLastError();
18727         if (mem_base != xmlMemBlocks()) {
18728             printf("Leak of %d blocks found in xmlBufferGrow",
18729                    xmlMemBlocks() - mem_base);
18730             test_ret++;
18731             printf(" %d", n_buf);
18732             printf(" %d", n_len);
18733             printf("\n");
18734         }
18735     }
18736     }
18737     function_tests++;
18738
18739     return(test_ret);
18740 }
18741
18742
18743 static int
18744 test_xmlBufferLength(void) {
18745     int test_ret = 0;
18746
18747     int mem_base;
18748     int ret_val;
18749     xmlBufferPtr buf; /* the buffer */
18750     int n_buf;
18751
18752     for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18753         mem_base = xmlMemBlocks();
18754         buf = gen_const_xmlBufferPtr(n_buf, 0);
18755
18756         ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18757         desret_int(ret_val);
18758         call_tests++;
18759         des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18760         xmlResetLastError();
18761         if (mem_base != xmlMemBlocks()) {
18762             printf("Leak of %d blocks found in xmlBufferLength",
18763                    xmlMemBlocks() - mem_base);
18764             test_ret++;
18765             printf(" %d", n_buf);
18766             printf("\n");
18767         }
18768     }
18769     function_tests++;
18770
18771     return(test_ret);
18772 }
18773
18774
18775 static int
18776 test_xmlBufferResize(void) {
18777     int test_ret = 0;
18778
18779     int mem_base;
18780     int ret_val;
18781     xmlBufferPtr buf; /* the buffer to resize */
18782     int n_buf;
18783     unsigned int size; /* the desired size */
18784     int n_size;
18785
18786     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18787     for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18788         mem_base = xmlMemBlocks();
18789         buf = gen_xmlBufferPtr(n_buf, 0);
18790         size = gen_unsigned_int(n_size, 1);
18791
18792         ret_val = xmlBufferResize(buf, size);
18793         desret_int(ret_val);
18794         call_tests++;
18795         des_xmlBufferPtr(n_buf, buf, 0);
18796         des_unsigned_int(n_size, size, 1);
18797         xmlResetLastError();
18798         if (mem_base != xmlMemBlocks()) {
18799             printf("Leak of %d blocks found in xmlBufferResize",
18800                    xmlMemBlocks() - mem_base);
18801             test_ret++;
18802             printf(" %d", n_buf);
18803             printf(" %d", n_size);
18804             printf("\n");
18805         }
18806     }
18807     }
18808     function_tests++;
18809
18810     return(test_ret);
18811 }
18812
18813
18814 static int
18815 test_xmlBufferSetAllocationScheme(void) {
18816     int test_ret = 0;
18817
18818     int mem_base;
18819     xmlBufferPtr buf; /* the buffer to tune */
18820     int n_buf;
18821     xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18822     int n_scheme;
18823
18824     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18825     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18826         mem_base = xmlMemBlocks();
18827         buf = gen_xmlBufferPtr(n_buf, 0);
18828         scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18829
18830         xmlBufferSetAllocationScheme(buf, scheme);
18831         if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
18832         call_tests++;
18833         des_xmlBufferPtr(n_buf, buf, 0);
18834         des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18835         xmlResetLastError();
18836         if (mem_base != xmlMemBlocks()) {
18837             printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18838                    xmlMemBlocks() - mem_base);
18839             test_ret++;
18840             printf(" %d", n_buf);
18841             printf(" %d", n_scheme);
18842             printf("\n");
18843         }
18844     }
18845     }
18846     function_tests++;
18847
18848     return(test_ret);
18849 }
18850
18851
18852 static int
18853 test_xmlBufferShrink(void) {
18854     int test_ret = 0;
18855
18856     int mem_base;
18857     int ret_val;
18858     xmlBufferPtr buf; /* the buffer to dump */
18859     int n_buf;
18860     unsigned int len; /* the number of xmlChar to remove */
18861     int n_len;
18862
18863     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18864     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18865         mem_base = xmlMemBlocks();
18866         buf = gen_xmlBufferPtr(n_buf, 0);
18867         len = gen_unsigned_int(n_len, 1);
18868
18869         ret_val = xmlBufferShrink(buf, len);
18870         desret_int(ret_val);
18871         call_tests++;
18872         des_xmlBufferPtr(n_buf, buf, 0);
18873         des_unsigned_int(n_len, len, 1);
18874         xmlResetLastError();
18875         if (mem_base != xmlMemBlocks()) {
18876             printf("Leak of %d blocks found in xmlBufferShrink",
18877                    xmlMemBlocks() - mem_base);
18878             test_ret++;
18879             printf(" %d", n_buf);
18880             printf(" %d", n_len);
18881             printf("\n");
18882         }
18883     }
18884     }
18885     function_tests++;
18886
18887     return(test_ret);
18888 }
18889
18890
18891 static int
18892 test_xmlBufferWriteCHAR(void) {
18893     int test_ret = 0;
18894
18895     int mem_base;
18896     xmlBufferPtr buf; /* the XML buffer */
18897     int n_buf;
18898     xmlChar * string; /* the string to add */
18899     int n_string;
18900
18901     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18902     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18903         mem_base = xmlMemBlocks();
18904         buf = gen_xmlBufferPtr(n_buf, 0);
18905         string = gen_const_xmlChar_ptr(n_string, 1);
18906
18907         xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18908         call_tests++;
18909         des_xmlBufferPtr(n_buf, buf, 0);
18910         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18911         xmlResetLastError();
18912         if (mem_base != xmlMemBlocks()) {
18913             printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18914                    xmlMemBlocks() - mem_base);
18915             test_ret++;
18916             printf(" %d", n_buf);
18917             printf(" %d", n_string);
18918             printf("\n");
18919         }
18920     }
18921     }
18922     function_tests++;
18923
18924     return(test_ret);
18925 }
18926
18927
18928 static int
18929 test_xmlBufferWriteChar(void) {
18930     int test_ret = 0;
18931
18932     int mem_base;
18933     xmlBufferPtr buf; /* the XML buffer output */
18934     int n_buf;
18935     char * string; /* the string to add */
18936     int n_string;
18937
18938     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18939     for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18940         mem_base = xmlMemBlocks();
18941         buf = gen_xmlBufferPtr(n_buf, 0);
18942         string = gen_const_char_ptr(n_string, 1);
18943
18944         xmlBufferWriteChar(buf, (const char *)string);
18945         call_tests++;
18946         des_xmlBufferPtr(n_buf, buf, 0);
18947         des_const_char_ptr(n_string, (const char *)string, 1);
18948         xmlResetLastError();
18949         if (mem_base != xmlMemBlocks()) {
18950             printf("Leak of %d blocks found in xmlBufferWriteChar",
18951                    xmlMemBlocks() - mem_base);
18952             test_ret++;
18953             printf(" %d", n_buf);
18954             printf(" %d", n_string);
18955             printf("\n");
18956         }
18957     }
18958     }
18959     function_tests++;
18960
18961     return(test_ret);
18962 }
18963
18964
18965 static int
18966 test_xmlBufferWriteQuotedString(void) {
18967     int test_ret = 0;
18968
18969     int mem_base;
18970     xmlBufferPtr buf; /* the XML buffer output */
18971     int n_buf;
18972     xmlChar * string; /* the string to add */
18973     int n_string;
18974
18975     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18976     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18977         mem_base = xmlMemBlocks();
18978         buf = gen_xmlBufferPtr(n_buf, 0);
18979         string = gen_const_xmlChar_ptr(n_string, 1);
18980
18981         xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18982         call_tests++;
18983         des_xmlBufferPtr(n_buf, buf, 0);
18984         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18985         xmlResetLastError();
18986         if (mem_base != xmlMemBlocks()) {
18987             printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18988                    xmlMemBlocks() - mem_base);
18989             test_ret++;
18990             printf(" %d", n_buf);
18991             printf(" %d", n_string);
18992             printf("\n");
18993         }
18994     }
18995     }
18996     function_tests++;
18997
18998     return(test_ret);
18999 }
19000
19001
19002 static int
19003 test_xmlBuildQName(void) {
19004     int test_ret = 0;
19005
19006     int mem_base;
19007     xmlChar * ret_val;
19008     xmlChar * ncname; /* the Name */
19009     int n_ncname;
19010     xmlChar * prefix; /* the prefix */
19011     int n_prefix;
19012     xmlChar * memory; /* preallocated memory */
19013     int n_memory;
19014     int len; /* preallocated memory length */
19015     int n_len;
19016
19017     for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19018     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19019     for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19020     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19021         mem_base = xmlMemBlocks();
19022         ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19023         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19024         memory = gen_xmlChar_ptr(n_memory, 2);
19025         len = gen_int(n_len, 3);
19026
19027         ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19028         if ((ret_val != NULL) && (ret_val != ncname) &&
19029               (ret_val != prefix) && (ret_val != memory))
19030               xmlFree(ret_val);
19031           ret_val = NULL;
19032         desret_xmlChar_ptr(ret_val);
19033         call_tests++;
19034         des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19035         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19036         des_xmlChar_ptr(n_memory, memory, 2);
19037         des_int(n_len, len, 3);
19038         xmlResetLastError();
19039         if (mem_base != xmlMemBlocks()) {
19040             printf("Leak of %d blocks found in xmlBuildQName",
19041                    xmlMemBlocks() - mem_base);
19042             test_ret++;
19043             printf(" %d", n_ncname);
19044             printf(" %d", n_prefix);
19045             printf(" %d", n_memory);
19046             printf(" %d", n_len);
19047             printf("\n");
19048         }
19049     }
19050     }
19051     }
19052     }
19053     function_tests++;
19054
19055     return(test_ret);
19056 }
19057
19058
19059 static int
19060 test_xmlChildElementCount(void) {
19061     int test_ret = 0;
19062
19063 #if defined(LIBXML_TREE_ENABLED)
19064     int mem_base;
19065     unsigned long ret_val;
19066     xmlNodePtr parent; /* the parent node */
19067     int n_parent;
19068
19069     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19070         mem_base = xmlMemBlocks();
19071         parent = gen_xmlNodePtr(n_parent, 0);
19072
19073         ret_val = xmlChildElementCount(parent);
19074         desret_unsigned_long(ret_val);
19075         call_tests++;
19076         des_xmlNodePtr(n_parent, parent, 0);
19077         xmlResetLastError();
19078         if (mem_base != xmlMemBlocks()) {
19079             printf("Leak of %d blocks found in xmlChildElementCount",
19080                    xmlMemBlocks() - mem_base);
19081             test_ret++;
19082             printf(" %d", n_parent);
19083             printf("\n");
19084         }
19085     }
19086     function_tests++;
19087 #endif
19088
19089     return(test_ret);
19090 }
19091
19092
19093 static int
19094 test_xmlCopyDoc(void) {
19095     int test_ret = 0;
19096
19097 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19098     int mem_base;
19099     xmlDocPtr ret_val;
19100     xmlDocPtr doc; /* the document */
19101     int n_doc;
19102     int recursive; /* if not zero do a recursive copy. */
19103     int n_recursive;
19104
19105     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19106     for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19107         mem_base = xmlMemBlocks();
19108         doc = gen_xmlDocPtr(n_doc, 0);
19109         recursive = gen_int(n_recursive, 1);
19110
19111         ret_val = xmlCopyDoc(doc, recursive);
19112         desret_xmlDocPtr(ret_val);
19113         call_tests++;
19114         des_xmlDocPtr(n_doc, doc, 0);
19115         des_int(n_recursive, recursive, 1);
19116         xmlResetLastError();
19117         if (mem_base != xmlMemBlocks()) {
19118             printf("Leak of %d blocks found in xmlCopyDoc",
19119                    xmlMemBlocks() - mem_base);
19120             test_ret++;
19121             printf(" %d", n_doc);
19122             printf(" %d", n_recursive);
19123             printf("\n");
19124         }
19125     }
19126     }
19127     function_tests++;
19128 #endif
19129
19130     return(test_ret);
19131 }
19132
19133
19134 static int
19135 test_xmlCopyDtd(void) {
19136     int test_ret = 0;
19137
19138 #if defined(LIBXML_TREE_ENABLED)
19139     int mem_base;
19140     xmlDtdPtr ret_val;
19141     xmlDtdPtr dtd; /* the dtd */
19142     int n_dtd;
19143
19144     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19145         mem_base = xmlMemBlocks();
19146         dtd = gen_xmlDtdPtr(n_dtd, 0);
19147
19148         ret_val = xmlCopyDtd(dtd);
19149         desret_xmlDtdPtr(ret_val);
19150         call_tests++;
19151         des_xmlDtdPtr(n_dtd, dtd, 0);
19152         xmlResetLastError();
19153         if (mem_base != xmlMemBlocks()) {
19154             printf("Leak of %d blocks found in xmlCopyDtd",
19155                    xmlMemBlocks() - mem_base);
19156             test_ret++;
19157             printf(" %d", n_dtd);
19158             printf("\n");
19159         }
19160     }
19161     function_tests++;
19162 #endif
19163
19164     return(test_ret);
19165 }
19166
19167
19168 static int
19169 test_xmlCopyNamespace(void) {
19170     int test_ret = 0;
19171
19172     int mem_base;
19173     xmlNsPtr ret_val;
19174     xmlNsPtr cur; /* the namespace */
19175     int n_cur;
19176
19177     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19178         mem_base = xmlMemBlocks();
19179         cur = gen_xmlNsPtr(n_cur, 0);
19180
19181         ret_val = xmlCopyNamespace(cur);
19182         if (ret_val != NULL) xmlFreeNs(ret_val);
19183         desret_xmlNsPtr(ret_val);
19184         call_tests++;
19185         des_xmlNsPtr(n_cur, cur, 0);
19186         xmlResetLastError();
19187         if (mem_base != xmlMemBlocks()) {
19188             printf("Leak of %d blocks found in xmlCopyNamespace",
19189                    xmlMemBlocks() - mem_base);
19190             test_ret++;
19191             printf(" %d", n_cur);
19192             printf("\n");
19193         }
19194     }
19195     function_tests++;
19196
19197     return(test_ret);
19198 }
19199
19200
19201 static int
19202 test_xmlCopyNamespaceList(void) {
19203     int test_ret = 0;
19204
19205     int mem_base;
19206     xmlNsPtr ret_val;
19207     xmlNsPtr cur; /* the first namespace */
19208     int n_cur;
19209
19210     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19211         mem_base = xmlMemBlocks();
19212         cur = gen_xmlNsPtr(n_cur, 0);
19213
19214         ret_val = xmlCopyNamespaceList(cur);
19215         if (ret_val != NULL) xmlFreeNsList(ret_val);
19216         desret_xmlNsPtr(ret_val);
19217         call_tests++;
19218         des_xmlNsPtr(n_cur, cur, 0);
19219         xmlResetLastError();
19220         if (mem_base != xmlMemBlocks()) {
19221             printf("Leak of %d blocks found in xmlCopyNamespaceList",
19222                    xmlMemBlocks() - mem_base);
19223             test_ret++;
19224             printf(" %d", n_cur);
19225             printf("\n");
19226         }
19227     }
19228     function_tests++;
19229
19230     return(test_ret);
19231 }
19232
19233
19234 static int
19235 test_xmlCopyNode(void) {
19236     int test_ret = 0;
19237
19238     int mem_base;
19239     xmlNodePtr ret_val;
19240     xmlNodePtr node; /* the node */
19241     int n_node;
19242     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19243     int n_extended;
19244
19245     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19246     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19247         mem_base = xmlMemBlocks();
19248         node = gen_const_xmlNodePtr(n_node, 0);
19249         extended = gen_int(n_extended, 1);
19250
19251         ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19252         desret_xmlNodePtr(ret_val);
19253         call_tests++;
19254         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19255         des_int(n_extended, extended, 1);
19256         xmlResetLastError();
19257         if (mem_base != xmlMemBlocks()) {
19258             printf("Leak of %d blocks found in xmlCopyNode",
19259                    xmlMemBlocks() - mem_base);
19260             test_ret++;
19261             printf(" %d", n_node);
19262             printf(" %d", n_extended);
19263             printf("\n");
19264         }
19265     }
19266     }
19267     function_tests++;
19268
19269     return(test_ret);
19270 }
19271
19272
19273 static int
19274 test_xmlCopyNodeList(void) {
19275     int test_ret = 0;
19276
19277     int mem_base;
19278     xmlNodePtr ret_val;
19279     xmlNodePtr node; /* the first node in the list. */
19280     int n_node;
19281
19282     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19283         mem_base = xmlMemBlocks();
19284         node = gen_const_xmlNodePtr(n_node, 0);
19285
19286         ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19287         desret_xmlNodePtr(ret_val);
19288         call_tests++;
19289         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19290         xmlResetLastError();
19291         if (mem_base != xmlMemBlocks()) {
19292             printf("Leak of %d blocks found in xmlCopyNodeList",
19293                    xmlMemBlocks() - mem_base);
19294             test_ret++;
19295             printf(" %d", n_node);
19296             printf("\n");
19297         }
19298     }
19299     function_tests++;
19300
19301     return(test_ret);
19302 }
19303
19304
19305 static int
19306 test_xmlCopyProp(void) {
19307     int test_ret = 0;
19308
19309     int mem_base;
19310     xmlAttrPtr ret_val;
19311     xmlNodePtr target; /* the element where the attribute will be grafted */
19312     int n_target;
19313     xmlAttrPtr cur; /* the attribute */
19314     int n_cur;
19315
19316     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19317     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19318         mem_base = xmlMemBlocks();
19319         target = gen_xmlNodePtr(n_target, 0);
19320         cur = gen_xmlAttrPtr(n_cur, 1);
19321
19322         ret_val = xmlCopyProp(target, cur);
19323         desret_xmlAttrPtr(ret_val);
19324         call_tests++;
19325         des_xmlNodePtr(n_target, target, 0);
19326         des_xmlAttrPtr(n_cur, cur, 1);
19327         xmlResetLastError();
19328         if (mem_base != xmlMemBlocks()) {
19329             printf("Leak of %d blocks found in xmlCopyProp",
19330                    xmlMemBlocks() - mem_base);
19331             test_ret++;
19332             printf(" %d", n_target);
19333             printf(" %d", n_cur);
19334             printf("\n");
19335         }
19336     }
19337     }
19338     function_tests++;
19339
19340     return(test_ret);
19341 }
19342
19343
19344 static int
19345 test_xmlCopyPropList(void) {
19346     int test_ret = 0;
19347
19348     int mem_base;
19349     xmlAttrPtr ret_val;
19350     xmlNodePtr target; /* the element where the attributes will be grafted */
19351     int n_target;
19352     xmlAttrPtr cur; /* the first attribute */
19353     int n_cur;
19354
19355     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19356     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19357         mem_base = xmlMemBlocks();
19358         target = gen_xmlNodePtr(n_target, 0);
19359         cur = gen_xmlAttrPtr(n_cur, 1);
19360
19361         ret_val = xmlCopyPropList(target, cur);
19362         desret_xmlAttrPtr(ret_val);
19363         call_tests++;
19364         des_xmlNodePtr(n_target, target, 0);
19365         des_xmlAttrPtr(n_cur, cur, 1);
19366         xmlResetLastError();
19367         if (mem_base != xmlMemBlocks()) {
19368             printf("Leak of %d blocks found in xmlCopyPropList",
19369                    xmlMemBlocks() - mem_base);
19370             test_ret++;
19371             printf(" %d", n_target);
19372             printf(" %d", n_cur);
19373             printf("\n");
19374         }
19375     }
19376     }
19377     function_tests++;
19378
19379     return(test_ret);
19380 }
19381
19382
19383 static int
19384 test_xmlCreateIntSubset(void) {
19385     int test_ret = 0;
19386
19387     int mem_base;
19388     xmlDtdPtr ret_val;
19389     xmlDocPtr doc; /* the document pointer */
19390     int n_doc;
19391     xmlChar * name; /* the DTD name */
19392     int n_name;
19393     xmlChar * ExternalID; /* the external (PUBLIC) ID */
19394     int n_ExternalID;
19395     xmlChar * SystemID; /* the system ID */
19396     int n_SystemID;
19397
19398     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19399     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19400     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19401     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19402         mem_base = xmlMemBlocks();
19403         doc = gen_xmlDocPtr(n_doc, 0);
19404         name = gen_const_xmlChar_ptr(n_name, 1);
19405         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19406         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19407
19408         ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19409         desret_xmlDtdPtr(ret_val);
19410         call_tests++;
19411         des_xmlDocPtr(n_doc, doc, 0);
19412         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19413         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19414         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19415         xmlResetLastError();
19416         if (mem_base != xmlMemBlocks()) {
19417             printf("Leak of %d blocks found in xmlCreateIntSubset",
19418                    xmlMemBlocks() - mem_base);
19419             test_ret++;
19420             printf(" %d", n_doc);
19421             printf(" %d", n_name);
19422             printf(" %d", n_ExternalID);
19423             printf(" %d", n_SystemID);
19424             printf("\n");
19425         }
19426     }
19427     }
19428     }
19429     }
19430     function_tests++;
19431
19432     return(test_ret);
19433 }
19434
19435
19436 #define gen_nb_xmlDOMWrapCtxtPtr 1
19437 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19438     return(NULL);
19439 }
19440 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19441 }
19442
19443 static int
19444 test_xmlDOMWrapAdoptNode(void) {
19445     int test_ret = 0;
19446
19447     int mem_base;
19448     int ret_val;
19449     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19450     int n_ctxt;
19451     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19452     int n_sourceDoc;
19453     xmlNodePtr node; /* the node to start with */
19454     int n_node;
19455     xmlDocPtr destDoc; /* the destination doc */
19456     int n_destDoc;
19457     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19458     int n_destParent;
19459     int options; /* option flags */
19460     int n_options;
19461
19462     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19463     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19464     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19465     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19466     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19467     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19468         mem_base = xmlMemBlocks();
19469         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19470         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19471         node = gen_xmlNodePtr(n_node, 2);
19472         destDoc = gen_xmlDocPtr(n_destDoc, 3);
19473         destParent = gen_xmlNodePtr(n_destParent, 4);
19474         options = gen_int(n_options, 5);
19475
19476         ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19477         if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19478         desret_int(ret_val);
19479         call_tests++;
19480         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19481         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19482         des_xmlNodePtr(n_node, node, 2);
19483         des_xmlDocPtr(n_destDoc, destDoc, 3);
19484         des_xmlNodePtr(n_destParent, destParent, 4);
19485         des_int(n_options, options, 5);
19486         xmlResetLastError();
19487         if (mem_base != xmlMemBlocks()) {
19488             printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19489                    xmlMemBlocks() - mem_base);
19490             test_ret++;
19491             printf(" %d", n_ctxt);
19492             printf(" %d", n_sourceDoc);
19493             printf(" %d", n_node);
19494             printf(" %d", n_destDoc);
19495             printf(" %d", n_destParent);
19496             printf(" %d", n_options);
19497             printf("\n");
19498         }
19499     }
19500     }
19501     }
19502     }
19503     }
19504     }
19505     function_tests++;
19506
19507     return(test_ret);
19508 }
19509
19510
19511 static int
19512 test_xmlDOMWrapCloneNode(void) {
19513     int test_ret = 0;
19514
19515     int mem_base;
19516     int ret_val;
19517     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19518     int n_ctxt;
19519     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19520     int n_sourceDoc;
19521     xmlNodePtr node; /* the node to start with */
19522     int n_node;
19523     xmlNodePtr * resNode; /* the clone of the given @node */
19524     int n_resNode;
19525     xmlDocPtr destDoc; /* the destination doc */
19526     int n_destDoc;
19527     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19528     int n_destParent;
19529     int deep; /* descend into child if set */
19530     int n_deep;
19531     int options; /* option flags */
19532     int n_options;
19533
19534     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19535     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19536     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19537     for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19538     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19539     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19540     for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19541     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19542         mem_base = xmlMemBlocks();
19543         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19544         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19545         node = gen_xmlNodePtr(n_node, 2);
19546         resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19547         destDoc = gen_xmlDocPtr(n_destDoc, 4);
19548         destParent = gen_xmlNodePtr(n_destParent, 5);
19549         deep = gen_int(n_deep, 6);
19550         options = gen_int(n_options, 7);
19551
19552         ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19553         desret_int(ret_val);
19554         call_tests++;
19555         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19556         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19557         des_xmlNodePtr(n_node, node, 2);
19558         des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19559         des_xmlDocPtr(n_destDoc, destDoc, 4);
19560         des_xmlNodePtr(n_destParent, destParent, 5);
19561         des_int(n_deep, deep, 6);
19562         des_int(n_options, options, 7);
19563         xmlResetLastError();
19564         if (mem_base != xmlMemBlocks()) {
19565             printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19566                    xmlMemBlocks() - mem_base);
19567             test_ret++;
19568             printf(" %d", n_ctxt);
19569             printf(" %d", n_sourceDoc);
19570             printf(" %d", n_node);
19571             printf(" %d", n_resNode);
19572             printf(" %d", n_destDoc);
19573             printf(" %d", n_destParent);
19574             printf(" %d", n_deep);
19575             printf(" %d", n_options);
19576             printf("\n");
19577         }
19578     }
19579     }
19580     }
19581     }
19582     }
19583     }
19584     }
19585     }
19586     function_tests++;
19587
19588     return(test_ret);
19589 }
19590
19591
19592 static int
19593 test_xmlDOMWrapNewCtxt(void) {
19594     int test_ret = 0;
19595
19596
19597     /* missing type support */
19598     return(test_ret);
19599 }
19600
19601
19602 static int
19603 test_xmlDOMWrapReconcileNamespaces(void) {
19604     int test_ret = 0;
19605
19606     int mem_base;
19607     int ret_val;
19608     xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19609     int n_ctxt;
19610     xmlNodePtr elem; /* the element-node */
19611     int n_elem;
19612     int options; /* option flags */
19613     int n_options;
19614
19615     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19616     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19617     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19618         mem_base = xmlMemBlocks();
19619         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19620         elem = gen_xmlNodePtr(n_elem, 1);
19621         options = gen_int(n_options, 2);
19622
19623         ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19624         desret_int(ret_val);
19625         call_tests++;
19626         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19627         des_xmlNodePtr(n_elem, elem, 1);
19628         des_int(n_options, options, 2);
19629         xmlResetLastError();
19630         if (mem_base != xmlMemBlocks()) {
19631             printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19632                    xmlMemBlocks() - mem_base);
19633             test_ret++;
19634             printf(" %d", n_ctxt);
19635             printf(" %d", n_elem);
19636             printf(" %d", n_options);
19637             printf("\n");
19638         }
19639     }
19640     }
19641     }
19642     function_tests++;
19643
19644     return(test_ret);
19645 }
19646
19647
19648 static int
19649 test_xmlDOMWrapRemoveNode(void) {
19650     int test_ret = 0;
19651
19652     int mem_base;
19653     int ret_val;
19654     xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19655     int n_ctxt;
19656     xmlDocPtr doc; /* the doc */
19657     int n_doc;
19658     xmlNodePtr node; /* the node to be removed. */
19659     int n_node;
19660     int options; /* set of options, unused at the moment */
19661     int n_options;
19662
19663     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19664     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19665     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19666     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19667         mem_base = xmlMemBlocks();
19668         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19669         doc = gen_xmlDocPtr(n_doc, 1);
19670         node = gen_xmlNodePtr(n_node, 2);
19671         options = gen_int(n_options, 3);
19672
19673         ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19674         desret_int(ret_val);
19675         call_tests++;
19676         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19677         des_xmlDocPtr(n_doc, doc, 1);
19678         des_xmlNodePtr(n_node, node, 2);
19679         des_int(n_options, options, 3);
19680         xmlResetLastError();
19681         if (mem_base != xmlMemBlocks()) {
19682             printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19683                    xmlMemBlocks() - mem_base);
19684             test_ret++;
19685             printf(" %d", n_ctxt);
19686             printf(" %d", n_doc);
19687             printf(" %d", n_node);
19688             printf(" %d", n_options);
19689             printf("\n");
19690         }
19691     }
19692     }
19693     }
19694     }
19695     function_tests++;
19696
19697     return(test_ret);
19698 }
19699
19700
19701 static int
19702 test_xmlDocCopyNode(void) {
19703     int test_ret = 0;
19704
19705     int mem_base;
19706     xmlNodePtr ret_val;
19707     xmlNodePtr node; /* the node */
19708     int n_node;
19709     xmlDocPtr doc; /* the document */
19710     int n_doc;
19711     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19712     int n_extended;
19713
19714     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19715     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19716     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19717         mem_base = xmlMemBlocks();
19718         node = gen_const_xmlNodePtr(n_node, 0);
19719         doc = gen_xmlDocPtr(n_doc, 1);
19720         extended = gen_int(n_extended, 2);
19721
19722         ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19723         desret_xmlNodePtr(ret_val);
19724         call_tests++;
19725         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19726         des_xmlDocPtr(n_doc, doc, 1);
19727         des_int(n_extended, extended, 2);
19728         xmlResetLastError();
19729         if (mem_base != xmlMemBlocks()) {
19730             printf("Leak of %d blocks found in xmlDocCopyNode",
19731                    xmlMemBlocks() - mem_base);
19732             test_ret++;
19733             printf(" %d", n_node);
19734             printf(" %d", n_doc);
19735             printf(" %d", n_extended);
19736             printf("\n");
19737         }
19738     }
19739     }
19740     }
19741     function_tests++;
19742
19743     return(test_ret);
19744 }
19745
19746
19747 static int
19748 test_xmlDocCopyNodeList(void) {
19749     int test_ret = 0;
19750
19751     int mem_base;
19752     xmlNodePtr ret_val;
19753     xmlDocPtr doc; /* the target document */
19754     int n_doc;
19755     xmlNodePtr node; /* the first node in the list. */
19756     int n_node;
19757
19758     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19759     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19760         mem_base = xmlMemBlocks();
19761         doc = gen_xmlDocPtr(n_doc, 0);
19762         node = gen_const_xmlNodePtr(n_node, 1);
19763
19764         ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19765         desret_xmlNodePtr(ret_val);
19766         call_tests++;
19767         des_xmlDocPtr(n_doc, doc, 0);
19768         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19769         xmlResetLastError();
19770         if (mem_base != xmlMemBlocks()) {
19771             printf("Leak of %d blocks found in xmlDocCopyNodeList",
19772                    xmlMemBlocks() - mem_base);
19773             test_ret++;
19774             printf(" %d", n_doc);
19775             printf(" %d", n_node);
19776             printf("\n");
19777         }
19778     }
19779     }
19780     function_tests++;
19781
19782     return(test_ret);
19783 }
19784
19785
19786 static int
19787 test_xmlDocDump(void) {
19788     int test_ret = 0;
19789
19790 #if defined(LIBXML_OUTPUT_ENABLED)
19791     int mem_base;
19792     int ret_val;
19793     FILE * f; /* the FILE* */
19794     int n_f;
19795     xmlDocPtr cur; /* the document */
19796     int n_cur;
19797
19798     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19799     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19800         mem_base = xmlMemBlocks();
19801         f = gen_FILE_ptr(n_f, 0);
19802         cur = gen_xmlDocPtr(n_cur, 1);
19803
19804         ret_val = xmlDocDump(f, cur);
19805         desret_int(ret_val);
19806         call_tests++;
19807         des_FILE_ptr(n_f, f, 0);
19808         des_xmlDocPtr(n_cur, cur, 1);
19809         xmlResetLastError();
19810         if (mem_base != xmlMemBlocks()) {
19811             printf("Leak of %d blocks found in xmlDocDump",
19812                    xmlMemBlocks() - mem_base);
19813             test_ret++;
19814             printf(" %d", n_f);
19815             printf(" %d", n_cur);
19816             printf("\n");
19817         }
19818     }
19819     }
19820     function_tests++;
19821 #endif
19822
19823     return(test_ret);
19824 }
19825
19826
19827 static int
19828 test_xmlDocDumpFormatMemory(void) {
19829     int test_ret = 0;
19830
19831 #if defined(LIBXML_OUTPUT_ENABLED)
19832     int mem_base;
19833     xmlDocPtr cur; /* the document */
19834     int n_cur;
19835     xmlChar ** mem; /* OUT: the memory pointer */
19836     int n_mem;
19837     int * size; /* OUT: the memory length */
19838     int n_size;
19839     int format; /* should formatting spaces been added */
19840     int n_format;
19841
19842     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19843     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19844     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19845     for (n_format = 0;n_format < gen_nb_int;n_format++) {
19846         mem_base = xmlMemBlocks();
19847         cur = gen_xmlDocPtr(n_cur, 0);
19848         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19849         size = gen_int_ptr(n_size, 2);
19850         format = gen_int(n_format, 3);
19851
19852         xmlDocDumpFormatMemory(cur, mem, size, format);
19853         call_tests++;
19854         des_xmlDocPtr(n_cur, cur, 0);
19855         des_xmlChar_ptr_ptr(n_mem, mem, 1);
19856         des_int_ptr(n_size, size, 2);
19857         des_int(n_format, format, 3);
19858         xmlResetLastError();
19859         if (mem_base != xmlMemBlocks()) {
19860             printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19861                    xmlMemBlocks() - mem_base);
19862             test_ret++;
19863             printf(" %d", n_cur);
19864             printf(" %d", n_mem);
19865             printf(" %d", n_size);
19866             printf(" %d", n_format);
19867             printf("\n");
19868         }
19869     }
19870     }
19871     }
19872     }
19873     function_tests++;
19874 #endif
19875
19876     return(test_ret);
19877 }
19878
19879
19880 static int
19881 test_xmlDocDumpFormatMemoryEnc(void) {
19882     int test_ret = 0;
19883
19884 #if defined(LIBXML_OUTPUT_ENABLED)
19885     int mem_base;
19886     xmlDocPtr out_doc; /* Document to generate XML text from */
19887     int n_out_doc;
19888     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19889     int n_doc_txt_ptr;
19890     int * doc_txt_len; /* Length of the generated XML text */
19891     int n_doc_txt_len;
19892     char * txt_encoding; /* Character encoding to use when generating XML text */
19893     int n_txt_encoding;
19894     int format; /* should formatting spaces been added */
19895     int n_format;
19896
19897     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19898     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19899     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19900     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19901     for (n_format = 0;n_format < gen_nb_int;n_format++) {
19902         mem_base = xmlMemBlocks();
19903         out_doc = gen_xmlDocPtr(n_out_doc, 0);
19904         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19905         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19906         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19907         format = gen_int(n_format, 4);
19908
19909         xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19910         call_tests++;
19911         des_xmlDocPtr(n_out_doc, out_doc, 0);
19912         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19913         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19914         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19915         des_int(n_format, format, 4);
19916         xmlResetLastError();
19917         if (mem_base != xmlMemBlocks()) {
19918             printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19919                    xmlMemBlocks() - mem_base);
19920             test_ret++;
19921             printf(" %d", n_out_doc);
19922             printf(" %d", n_doc_txt_ptr);
19923             printf(" %d", n_doc_txt_len);
19924             printf(" %d", n_txt_encoding);
19925             printf(" %d", n_format);
19926             printf("\n");
19927         }
19928     }
19929     }
19930     }
19931     }
19932     }
19933     function_tests++;
19934 #endif
19935
19936     return(test_ret);
19937 }
19938
19939
19940 static int
19941 test_xmlDocDumpMemory(void) {
19942     int test_ret = 0;
19943
19944 #if defined(LIBXML_OUTPUT_ENABLED)
19945     int mem_base;
19946     xmlDocPtr cur; /* the document */
19947     int n_cur;
19948     xmlChar ** mem; /* OUT: the memory pointer */
19949     int n_mem;
19950     int * size; /* OUT: the memory length */
19951     int n_size;
19952
19953     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19954     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19955     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19956         mem_base = xmlMemBlocks();
19957         cur = gen_xmlDocPtr(n_cur, 0);
19958         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19959         size = gen_int_ptr(n_size, 2);
19960
19961         xmlDocDumpMemory(cur, mem, size);
19962         call_tests++;
19963         des_xmlDocPtr(n_cur, cur, 0);
19964         des_xmlChar_ptr_ptr(n_mem, mem, 1);
19965         des_int_ptr(n_size, size, 2);
19966         xmlResetLastError();
19967         if (mem_base != xmlMemBlocks()) {
19968             printf("Leak of %d blocks found in xmlDocDumpMemory",
19969                    xmlMemBlocks() - mem_base);
19970             test_ret++;
19971             printf(" %d", n_cur);
19972             printf(" %d", n_mem);
19973             printf(" %d", n_size);
19974             printf("\n");
19975         }
19976     }
19977     }
19978     }
19979     function_tests++;
19980 #endif
19981
19982     return(test_ret);
19983 }
19984
19985
19986 static int
19987 test_xmlDocDumpMemoryEnc(void) {
19988     int test_ret = 0;
19989
19990 #if defined(LIBXML_OUTPUT_ENABLED)
19991     int mem_base;
19992     xmlDocPtr out_doc; /* Document to generate XML text from */
19993     int n_out_doc;
19994     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19995     int n_doc_txt_ptr;
19996     int * doc_txt_len; /* Length of the generated XML text */
19997     int n_doc_txt_len;
19998     char * txt_encoding; /* Character encoding to use when generating XML text */
19999     int n_txt_encoding;
20000
20001     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20002     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20003     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20004     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20005         mem_base = xmlMemBlocks();
20006         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20007         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20008         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20009         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20010
20011         xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20012         call_tests++;
20013         des_xmlDocPtr(n_out_doc, out_doc, 0);
20014         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20015         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20016         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20017         xmlResetLastError();
20018         if (mem_base != xmlMemBlocks()) {
20019             printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20020                    xmlMemBlocks() - mem_base);
20021             test_ret++;
20022             printf(" %d", n_out_doc);
20023             printf(" %d", n_doc_txt_ptr);
20024             printf(" %d", n_doc_txt_len);
20025             printf(" %d", n_txt_encoding);
20026             printf("\n");
20027         }
20028     }
20029     }
20030     }
20031     }
20032     function_tests++;
20033 #endif
20034
20035     return(test_ret);
20036 }
20037
20038
20039 static int
20040 test_xmlDocFormatDump(void) {
20041     int test_ret = 0;
20042
20043 #if defined(LIBXML_OUTPUT_ENABLED)
20044     int mem_base;
20045     int ret_val;
20046     FILE * f; /* the FILE* */
20047     int n_f;
20048     xmlDocPtr cur; /* the document */
20049     int n_cur;
20050     int format; /* should formatting spaces been added */
20051     int n_format;
20052
20053     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20054     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20055     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20056         mem_base = xmlMemBlocks();
20057         f = gen_FILE_ptr(n_f, 0);
20058         cur = gen_xmlDocPtr(n_cur, 1);
20059         format = gen_int(n_format, 2);
20060
20061         ret_val = xmlDocFormatDump(f, cur, format);
20062         desret_int(ret_val);
20063         call_tests++;
20064         des_FILE_ptr(n_f, f, 0);
20065         des_xmlDocPtr(n_cur, cur, 1);
20066         des_int(n_format, format, 2);
20067         xmlResetLastError();
20068         if (mem_base != xmlMemBlocks()) {
20069             printf("Leak of %d blocks found in xmlDocFormatDump",
20070                    xmlMemBlocks() - mem_base);
20071             test_ret++;
20072             printf(" %d", n_f);
20073             printf(" %d", n_cur);
20074             printf(" %d", n_format);
20075             printf("\n");
20076         }
20077     }
20078     }
20079     }
20080     function_tests++;
20081 #endif
20082
20083     return(test_ret);
20084 }
20085
20086
20087 static int
20088 test_xmlDocGetRootElement(void) {
20089     int test_ret = 0;
20090
20091     int mem_base;
20092     xmlNodePtr ret_val;
20093     xmlDocPtr doc; /* the document */
20094     int n_doc;
20095
20096     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20097         mem_base = xmlMemBlocks();
20098         doc = gen_xmlDocPtr(n_doc, 0);
20099
20100         ret_val = xmlDocGetRootElement(doc);
20101         desret_xmlNodePtr(ret_val);
20102         call_tests++;
20103         des_xmlDocPtr(n_doc, doc, 0);
20104         xmlResetLastError();
20105         if (mem_base != xmlMemBlocks()) {
20106             printf("Leak of %d blocks found in xmlDocGetRootElement",
20107                    xmlMemBlocks() - mem_base);
20108             test_ret++;
20109             printf(" %d", n_doc);
20110             printf("\n");
20111         }
20112     }
20113     function_tests++;
20114
20115     return(test_ret);
20116 }
20117
20118
20119 static int
20120 test_xmlDocSetRootElement(void) {
20121     int test_ret = 0;
20122
20123 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20124     int mem_base;
20125     xmlNodePtr ret_val;
20126     xmlDocPtr doc; /* the document */
20127     int n_doc;
20128     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. */
20129     int n_root;
20130
20131     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20132     for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20133         mem_base = xmlMemBlocks();
20134         doc = gen_xmlDocPtr(n_doc, 0);
20135         root = gen_xmlNodePtr_in(n_root, 1);
20136
20137         ret_val = xmlDocSetRootElement(doc, root);
20138         if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20139         desret_xmlNodePtr(ret_val);
20140         call_tests++;
20141         des_xmlDocPtr(n_doc, doc, 0);
20142         des_xmlNodePtr_in(n_root, root, 1);
20143         xmlResetLastError();
20144         if (mem_base != xmlMemBlocks()) {
20145             printf("Leak of %d blocks found in xmlDocSetRootElement",
20146                    xmlMemBlocks() - mem_base);
20147             test_ret++;
20148             printf(" %d", n_doc);
20149             printf(" %d", n_root);
20150             printf("\n");
20151         }
20152     }
20153     }
20154     function_tests++;
20155 #endif
20156
20157     return(test_ret);
20158 }
20159
20160
20161 static int
20162 test_xmlElemDump(void) {
20163     int test_ret = 0;
20164
20165 #if defined(LIBXML_OUTPUT_ENABLED)
20166     int mem_base;
20167     FILE * f; /* the FILE * for the output */
20168     int n_f;
20169     xmlDocPtr doc; /* the document */
20170     int n_doc;
20171     xmlNodePtr cur; /* the current node */
20172     int n_cur;
20173
20174     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20175     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20176     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20177         mem_base = xmlMemBlocks();
20178         f = gen_FILE_ptr(n_f, 0);
20179         doc = gen_xmlDocPtr(n_doc, 1);
20180         cur = gen_xmlNodePtr(n_cur, 2);
20181
20182         xmlElemDump(f, doc, cur);
20183         call_tests++;
20184         des_FILE_ptr(n_f, f, 0);
20185         des_xmlDocPtr(n_doc, doc, 1);
20186         des_xmlNodePtr(n_cur, cur, 2);
20187         xmlResetLastError();
20188         if (mem_base != xmlMemBlocks()) {
20189             printf("Leak of %d blocks found in xmlElemDump",
20190                    xmlMemBlocks() - mem_base);
20191             test_ret++;
20192             printf(" %d", n_f);
20193             printf(" %d", n_doc);
20194             printf(" %d", n_cur);
20195             printf("\n");
20196         }
20197     }
20198     }
20199     }
20200     function_tests++;
20201 #endif
20202
20203     return(test_ret);
20204 }
20205
20206
20207 static int
20208 test_xmlFirstElementChild(void) {
20209     int test_ret = 0;
20210
20211 #if defined(LIBXML_TREE_ENABLED)
20212     int mem_base;
20213     xmlNodePtr ret_val;
20214     xmlNodePtr parent; /* the parent node */
20215     int n_parent;
20216
20217     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20218         mem_base = xmlMemBlocks();
20219         parent = gen_xmlNodePtr(n_parent, 0);
20220
20221         ret_val = xmlFirstElementChild(parent);
20222         desret_xmlNodePtr(ret_val);
20223         call_tests++;
20224         des_xmlNodePtr(n_parent, parent, 0);
20225         xmlResetLastError();
20226         if (mem_base != xmlMemBlocks()) {
20227             printf("Leak of %d blocks found in xmlFirstElementChild",
20228                    xmlMemBlocks() - mem_base);
20229             test_ret++;
20230             printf(" %d", n_parent);
20231             printf("\n");
20232         }
20233     }
20234     function_tests++;
20235 #endif
20236
20237     return(test_ret);
20238 }
20239
20240
20241 static int
20242 test_xmlGetBufferAllocationScheme(void) {
20243     int test_ret = 0;
20244
20245     int mem_base;
20246     xmlBufferAllocationScheme ret_val;
20247
20248         mem_base = xmlMemBlocks();
20249
20250         ret_val = xmlGetBufferAllocationScheme();
20251         desret_xmlBufferAllocationScheme(ret_val);
20252         call_tests++;
20253         xmlResetLastError();
20254         if (mem_base != xmlMemBlocks()) {
20255             printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20256                    xmlMemBlocks() - mem_base);
20257             test_ret++;
20258             printf("\n");
20259         }
20260     function_tests++;
20261
20262     return(test_ret);
20263 }
20264
20265
20266 static int
20267 test_xmlGetCompressMode(void) {
20268     int test_ret = 0;
20269
20270     int mem_base;
20271     int ret_val;
20272
20273         mem_base = xmlMemBlocks();
20274
20275         ret_val = xmlGetCompressMode();
20276         desret_int(ret_val);
20277         call_tests++;
20278         xmlResetLastError();
20279         if (mem_base != xmlMemBlocks()) {
20280             printf("Leak of %d blocks found in xmlGetCompressMode",
20281                    xmlMemBlocks() - mem_base);
20282             test_ret++;
20283             printf("\n");
20284         }
20285     function_tests++;
20286
20287     return(test_ret);
20288 }
20289
20290
20291 static int
20292 test_xmlGetDocCompressMode(void) {
20293     int test_ret = 0;
20294
20295     int mem_base;
20296     int ret_val;
20297     xmlDocPtr doc; /* the document */
20298     int n_doc;
20299
20300     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20301         mem_base = xmlMemBlocks();
20302         doc = gen_xmlDocPtr(n_doc, 0);
20303
20304         ret_val = xmlGetDocCompressMode(doc);
20305         desret_int(ret_val);
20306         call_tests++;
20307         des_xmlDocPtr(n_doc, doc, 0);
20308         xmlResetLastError();
20309         if (mem_base != xmlMemBlocks()) {
20310             printf("Leak of %d blocks found in xmlGetDocCompressMode",
20311                    xmlMemBlocks() - mem_base);
20312             test_ret++;
20313             printf(" %d", n_doc);
20314             printf("\n");
20315         }
20316     }
20317     function_tests++;
20318
20319     return(test_ret);
20320 }
20321
20322
20323 static int
20324 test_xmlGetIntSubset(void) {
20325     int test_ret = 0;
20326
20327     int mem_base;
20328     xmlDtdPtr ret_val;
20329     xmlDocPtr doc; /* the document pointer */
20330     int n_doc;
20331
20332     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20333         mem_base = xmlMemBlocks();
20334         doc = gen_xmlDocPtr(n_doc, 0);
20335
20336         ret_val = xmlGetIntSubset(doc);
20337         desret_xmlDtdPtr(ret_val);
20338         call_tests++;
20339         des_xmlDocPtr(n_doc, doc, 0);
20340         xmlResetLastError();
20341         if (mem_base != xmlMemBlocks()) {
20342             printf("Leak of %d blocks found in xmlGetIntSubset",
20343                    xmlMemBlocks() - mem_base);
20344             test_ret++;
20345             printf(" %d", n_doc);
20346             printf("\n");
20347         }
20348     }
20349     function_tests++;
20350
20351     return(test_ret);
20352 }
20353
20354
20355 static int
20356 test_xmlGetLastChild(void) {
20357     int test_ret = 0;
20358
20359     int mem_base;
20360     xmlNodePtr ret_val;
20361     xmlNodePtr parent; /* the parent node */
20362     int n_parent;
20363
20364     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20365         mem_base = xmlMemBlocks();
20366         parent = gen_xmlNodePtr(n_parent, 0);
20367
20368         ret_val = xmlGetLastChild(parent);
20369         desret_xmlNodePtr(ret_val);
20370         call_tests++;
20371         des_xmlNodePtr(n_parent, parent, 0);
20372         xmlResetLastError();
20373         if (mem_base != xmlMemBlocks()) {
20374             printf("Leak of %d blocks found in xmlGetLastChild",
20375                    xmlMemBlocks() - mem_base);
20376             test_ret++;
20377             printf(" %d", n_parent);
20378             printf("\n");
20379         }
20380     }
20381     function_tests++;
20382
20383     return(test_ret);
20384 }
20385
20386
20387 static int
20388 test_xmlGetLineNo(void) {
20389     int test_ret = 0;
20390
20391     int mem_base;
20392     long ret_val;
20393     xmlNodePtr node; /* valid node */
20394     int n_node;
20395
20396     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20397         mem_base = xmlMemBlocks();
20398         node = gen_xmlNodePtr(n_node, 0);
20399
20400         ret_val = xmlGetLineNo(node);
20401         desret_long(ret_val);
20402         call_tests++;
20403         des_xmlNodePtr(n_node, node, 0);
20404         xmlResetLastError();
20405         if (mem_base != xmlMemBlocks()) {
20406             printf("Leak of %d blocks found in xmlGetLineNo",
20407                    xmlMemBlocks() - mem_base);
20408             test_ret++;
20409             printf(" %d", n_node);
20410             printf("\n");
20411         }
20412     }
20413     function_tests++;
20414
20415     return(test_ret);
20416 }
20417
20418
20419 static int
20420 test_xmlGetNoNsProp(void) {
20421     int test_ret = 0;
20422
20423     int mem_base;
20424     xmlChar * ret_val;
20425     xmlNodePtr node; /* the node */
20426     int n_node;
20427     xmlChar * name; /* the attribute name */
20428     int n_name;
20429
20430     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20431     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20432         mem_base = xmlMemBlocks();
20433         node = gen_xmlNodePtr(n_node, 0);
20434         name = gen_const_xmlChar_ptr(n_name, 1);
20435
20436         ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20437         desret_xmlChar_ptr(ret_val);
20438         call_tests++;
20439         des_xmlNodePtr(n_node, node, 0);
20440         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20441         xmlResetLastError();
20442         if (mem_base != xmlMemBlocks()) {
20443             printf("Leak of %d blocks found in xmlGetNoNsProp",
20444                    xmlMemBlocks() - mem_base);
20445             test_ret++;
20446             printf(" %d", n_node);
20447             printf(" %d", n_name);
20448             printf("\n");
20449         }
20450     }
20451     }
20452     function_tests++;
20453
20454     return(test_ret);
20455 }
20456
20457
20458 static int
20459 test_xmlGetNodePath(void) {
20460     int test_ret = 0;
20461
20462 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20463     int mem_base;
20464     xmlChar * ret_val;
20465     xmlNodePtr node; /* a node */
20466     int n_node;
20467
20468     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20469         mem_base = xmlMemBlocks();
20470         node = gen_xmlNodePtr(n_node, 0);
20471
20472         ret_val = xmlGetNodePath(node);
20473         desret_xmlChar_ptr(ret_val);
20474         call_tests++;
20475         des_xmlNodePtr(n_node, node, 0);
20476         xmlResetLastError();
20477         if (mem_base != xmlMemBlocks()) {
20478             printf("Leak of %d blocks found in xmlGetNodePath",
20479                    xmlMemBlocks() - mem_base);
20480             test_ret++;
20481             printf(" %d", n_node);
20482             printf("\n");
20483         }
20484     }
20485     function_tests++;
20486 #endif
20487
20488     return(test_ret);
20489 }
20490
20491
20492 static int
20493 test_xmlGetNsList(void) {
20494     int test_ret = 0;
20495
20496
20497     /* missing type support */
20498     return(test_ret);
20499 }
20500
20501
20502 static int
20503 test_xmlGetNsProp(void) {
20504     int test_ret = 0;
20505
20506     int mem_base;
20507     xmlChar * ret_val;
20508     xmlNodePtr node; /* the node */
20509     int n_node;
20510     xmlChar * name; /* the attribute name */
20511     int n_name;
20512     xmlChar * nameSpace; /* the URI of the namespace */
20513     int n_nameSpace;
20514
20515     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20516     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20517     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20518         mem_base = xmlMemBlocks();
20519         node = gen_xmlNodePtr(n_node, 0);
20520         name = gen_const_xmlChar_ptr(n_name, 1);
20521         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20522
20523         ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20524         desret_xmlChar_ptr(ret_val);
20525         call_tests++;
20526         des_xmlNodePtr(n_node, node, 0);
20527         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20528         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20529         xmlResetLastError();
20530         if (mem_base != xmlMemBlocks()) {
20531             printf("Leak of %d blocks found in xmlGetNsProp",
20532                    xmlMemBlocks() - mem_base);
20533             test_ret++;
20534             printf(" %d", n_node);
20535             printf(" %d", n_name);
20536             printf(" %d", n_nameSpace);
20537             printf("\n");
20538         }
20539     }
20540     }
20541     }
20542     function_tests++;
20543
20544     return(test_ret);
20545 }
20546
20547
20548 static int
20549 test_xmlGetProp(void) {
20550     int test_ret = 0;
20551
20552     int mem_base;
20553     xmlChar * ret_val;
20554     xmlNodePtr node; /* the node */
20555     int n_node;
20556     xmlChar * name; /* the attribute name */
20557     int n_name;
20558
20559     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20560     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20561         mem_base = xmlMemBlocks();
20562         node = gen_xmlNodePtr(n_node, 0);
20563         name = gen_const_xmlChar_ptr(n_name, 1);
20564
20565         ret_val = xmlGetProp(node, (const xmlChar *)name);
20566         desret_xmlChar_ptr(ret_val);
20567         call_tests++;
20568         des_xmlNodePtr(n_node, node, 0);
20569         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20570         xmlResetLastError();
20571         if (mem_base != xmlMemBlocks()) {
20572             printf("Leak of %d blocks found in xmlGetProp",
20573                    xmlMemBlocks() - mem_base);
20574             test_ret++;
20575             printf(" %d", n_node);
20576             printf(" %d", n_name);
20577             printf("\n");
20578         }
20579     }
20580     }
20581     function_tests++;
20582
20583     return(test_ret);
20584 }
20585
20586
20587 static int
20588 test_xmlHasNsProp(void) {
20589     int test_ret = 0;
20590
20591     int mem_base;
20592     xmlAttrPtr ret_val;
20593     xmlNodePtr node; /* the node */
20594     int n_node;
20595     xmlChar * name; /* the attribute name */
20596     int n_name;
20597     xmlChar * nameSpace; /* the URI of the namespace */
20598     int n_nameSpace;
20599
20600     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20601     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20602     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20603         mem_base = xmlMemBlocks();
20604         node = gen_xmlNodePtr(n_node, 0);
20605         name = gen_const_xmlChar_ptr(n_name, 1);
20606         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20607
20608         ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20609         desret_xmlAttrPtr(ret_val);
20610         call_tests++;
20611         des_xmlNodePtr(n_node, node, 0);
20612         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20613         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20614         xmlResetLastError();
20615         if (mem_base != xmlMemBlocks()) {
20616             printf("Leak of %d blocks found in xmlHasNsProp",
20617                    xmlMemBlocks() - mem_base);
20618             test_ret++;
20619             printf(" %d", n_node);
20620             printf(" %d", n_name);
20621             printf(" %d", n_nameSpace);
20622             printf("\n");
20623         }
20624     }
20625     }
20626     }
20627     function_tests++;
20628
20629     return(test_ret);
20630 }
20631
20632
20633 static int
20634 test_xmlHasProp(void) {
20635     int test_ret = 0;
20636
20637     int mem_base;
20638     xmlAttrPtr ret_val;
20639     xmlNodePtr node; /* the node */
20640     int n_node;
20641     xmlChar * name; /* the attribute name */
20642     int n_name;
20643
20644     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20645     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20646         mem_base = xmlMemBlocks();
20647         node = gen_xmlNodePtr(n_node, 0);
20648         name = gen_const_xmlChar_ptr(n_name, 1);
20649
20650         ret_val = xmlHasProp(node, (const xmlChar *)name);
20651         desret_xmlAttrPtr(ret_val);
20652         call_tests++;
20653         des_xmlNodePtr(n_node, node, 0);
20654         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20655         xmlResetLastError();
20656         if (mem_base != xmlMemBlocks()) {
20657             printf("Leak of %d blocks found in xmlHasProp",
20658                    xmlMemBlocks() - mem_base);
20659             test_ret++;
20660             printf(" %d", n_node);
20661             printf(" %d", n_name);
20662             printf("\n");
20663         }
20664     }
20665     }
20666     function_tests++;
20667
20668     return(test_ret);
20669 }
20670
20671
20672 static int
20673 test_xmlIsBlankNode(void) {
20674     int test_ret = 0;
20675
20676     int mem_base;
20677     int ret_val;
20678     xmlNodePtr node; /* the node */
20679     int n_node;
20680
20681     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20682         mem_base = xmlMemBlocks();
20683         node = gen_xmlNodePtr(n_node, 0);
20684
20685         ret_val = xmlIsBlankNode(node);
20686         desret_int(ret_val);
20687         call_tests++;
20688         des_xmlNodePtr(n_node, node, 0);
20689         xmlResetLastError();
20690         if (mem_base != xmlMemBlocks()) {
20691             printf("Leak of %d blocks found in xmlIsBlankNode",
20692                    xmlMemBlocks() - mem_base);
20693             test_ret++;
20694             printf(" %d", n_node);
20695             printf("\n");
20696         }
20697     }
20698     function_tests++;
20699
20700     return(test_ret);
20701 }
20702
20703
20704 static int
20705 test_xmlIsXHTML(void) {
20706     int test_ret = 0;
20707
20708     int mem_base;
20709     int ret_val;
20710     xmlChar * systemID; /* the system identifier */
20711     int n_systemID;
20712     xmlChar * publicID; /* the public identifier */
20713     int n_publicID;
20714
20715     for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20716     for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20717         mem_base = xmlMemBlocks();
20718         systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20719         publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20720
20721         ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20722         desret_int(ret_val);
20723         call_tests++;
20724         des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20725         des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20726         xmlResetLastError();
20727         if (mem_base != xmlMemBlocks()) {
20728             printf("Leak of %d blocks found in xmlIsXHTML",
20729                    xmlMemBlocks() - mem_base);
20730             test_ret++;
20731             printf(" %d", n_systemID);
20732             printf(" %d", n_publicID);
20733             printf("\n");
20734         }
20735     }
20736     }
20737     function_tests++;
20738
20739     return(test_ret);
20740 }
20741
20742
20743 static int
20744 test_xmlLastElementChild(void) {
20745     int test_ret = 0;
20746
20747 #if defined(LIBXML_TREE_ENABLED)
20748     int mem_base;
20749     xmlNodePtr ret_val;
20750     xmlNodePtr parent; /* the parent node */
20751     int n_parent;
20752
20753     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20754         mem_base = xmlMemBlocks();
20755         parent = gen_xmlNodePtr(n_parent, 0);
20756
20757         ret_val = xmlLastElementChild(parent);
20758         desret_xmlNodePtr(ret_val);
20759         call_tests++;
20760         des_xmlNodePtr(n_parent, parent, 0);
20761         xmlResetLastError();
20762         if (mem_base != xmlMemBlocks()) {
20763             printf("Leak of %d blocks found in xmlLastElementChild",
20764                    xmlMemBlocks() - mem_base);
20765             test_ret++;
20766             printf(" %d", n_parent);
20767             printf("\n");
20768         }
20769     }
20770     function_tests++;
20771 #endif
20772
20773     return(test_ret);
20774 }
20775
20776
20777 static int
20778 test_xmlNewCDataBlock(void) {
20779     int test_ret = 0;
20780
20781     int mem_base;
20782     xmlNodePtr ret_val;
20783     xmlDocPtr doc; /* the document */
20784     int n_doc;
20785     xmlChar * content; /* the CDATA block content content */
20786     int n_content;
20787     int len; /* the length of the block */
20788     int n_len;
20789
20790     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20791     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20792     for (n_len = 0;n_len < gen_nb_int;n_len++) {
20793         mem_base = xmlMemBlocks();
20794         doc = gen_xmlDocPtr(n_doc, 0);
20795         content = gen_const_xmlChar_ptr(n_content, 1);
20796         len = gen_int(n_len, 2);
20797
20798         ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20799         desret_xmlNodePtr(ret_val);
20800         call_tests++;
20801         des_xmlDocPtr(n_doc, doc, 0);
20802         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20803         des_int(n_len, len, 2);
20804         xmlResetLastError();
20805         if (mem_base != xmlMemBlocks()) {
20806             printf("Leak of %d blocks found in xmlNewCDataBlock",
20807                    xmlMemBlocks() - mem_base);
20808             test_ret++;
20809             printf(" %d", n_doc);
20810             printf(" %d", n_content);
20811             printf(" %d", n_len);
20812             printf("\n");
20813         }
20814     }
20815     }
20816     }
20817     function_tests++;
20818
20819     return(test_ret);
20820 }
20821
20822
20823 static int
20824 test_xmlNewCharRef(void) {
20825     int test_ret = 0;
20826
20827     int mem_base;
20828     xmlNodePtr ret_val;
20829     xmlDocPtr doc; /* the document */
20830     int n_doc;
20831     xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20832     int n_name;
20833
20834     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20835     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20836         mem_base = xmlMemBlocks();
20837         doc = gen_xmlDocPtr(n_doc, 0);
20838         name = gen_const_xmlChar_ptr(n_name, 1);
20839
20840         ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20841         desret_xmlNodePtr(ret_val);
20842         call_tests++;
20843         des_xmlDocPtr(n_doc, doc, 0);
20844         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20845         xmlResetLastError();
20846         if (mem_base != xmlMemBlocks()) {
20847             printf("Leak of %d blocks found in xmlNewCharRef",
20848                    xmlMemBlocks() - mem_base);
20849             test_ret++;
20850             printf(" %d", n_doc);
20851             printf(" %d", n_name);
20852             printf("\n");
20853         }
20854     }
20855     }
20856     function_tests++;
20857
20858     return(test_ret);
20859 }
20860
20861
20862 static int
20863 test_xmlNewChild(void) {
20864     int test_ret = 0;
20865
20866 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20867 #ifdef LIBXML_TREE_ENABLED
20868     int mem_base;
20869     xmlNodePtr ret_val;
20870     xmlNodePtr parent; /* the parent node */
20871     int n_parent;
20872     xmlNsPtr ns; /* a namespace if any */
20873     int n_ns;
20874     xmlChar * name; /* the name of the child */
20875     int n_name;
20876     xmlChar * content; /* the XML content of the child if any. */
20877     int n_content;
20878
20879     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20880     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20881     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20882     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20883         mem_base = xmlMemBlocks();
20884         parent = gen_xmlNodePtr(n_parent, 0);
20885         ns = gen_xmlNsPtr(n_ns, 1);
20886         name = gen_const_xmlChar_ptr(n_name, 2);
20887         content = gen_const_xmlChar_ptr(n_content, 3);
20888
20889         ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20890         desret_xmlNodePtr(ret_val);
20891         call_tests++;
20892         des_xmlNodePtr(n_parent, parent, 0);
20893         des_xmlNsPtr(n_ns, ns, 1);
20894         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20895         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20896         xmlResetLastError();
20897         if (mem_base != xmlMemBlocks()) {
20898             printf("Leak of %d blocks found in xmlNewChild",
20899                    xmlMemBlocks() - mem_base);
20900             test_ret++;
20901             printf(" %d", n_parent);
20902             printf(" %d", n_ns);
20903             printf(" %d", n_name);
20904             printf(" %d", n_content);
20905             printf("\n");
20906         }
20907     }
20908     }
20909     }
20910     }
20911     function_tests++;
20912 #endif
20913 #endif
20914
20915     return(test_ret);
20916 }
20917
20918
20919 static int
20920 test_xmlNewComment(void) {
20921     int test_ret = 0;
20922
20923     int mem_base;
20924     xmlNodePtr ret_val;
20925     xmlChar * content; /* the comment content */
20926     int n_content;
20927
20928     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20929         mem_base = xmlMemBlocks();
20930         content = gen_const_xmlChar_ptr(n_content, 0);
20931
20932         ret_val = xmlNewComment((const xmlChar *)content);
20933         desret_xmlNodePtr(ret_val);
20934         call_tests++;
20935         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20936         xmlResetLastError();
20937         if (mem_base != xmlMemBlocks()) {
20938             printf("Leak of %d blocks found in xmlNewComment",
20939                    xmlMemBlocks() - mem_base);
20940             test_ret++;
20941             printf(" %d", n_content);
20942             printf("\n");
20943         }
20944     }
20945     function_tests++;
20946
20947     return(test_ret);
20948 }
20949
20950
20951 static int
20952 test_xmlNewDoc(void) {
20953     int test_ret = 0;
20954
20955     int mem_base;
20956     xmlDocPtr ret_val;
20957     xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20958     int n_version;
20959
20960     for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20961         mem_base = xmlMemBlocks();
20962         version = gen_const_xmlChar_ptr(n_version, 0);
20963
20964         ret_val = xmlNewDoc((const xmlChar *)version);
20965         desret_xmlDocPtr(ret_val);
20966         call_tests++;
20967         des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20968         xmlResetLastError();
20969         if (mem_base != xmlMemBlocks()) {
20970             printf("Leak of %d blocks found in xmlNewDoc",
20971                    xmlMemBlocks() - mem_base);
20972             test_ret++;
20973             printf(" %d", n_version);
20974             printf("\n");
20975         }
20976     }
20977     function_tests++;
20978
20979     return(test_ret);
20980 }
20981
20982
20983 static int
20984 test_xmlNewDocComment(void) {
20985     int test_ret = 0;
20986
20987     int mem_base;
20988     xmlNodePtr ret_val;
20989     xmlDocPtr doc; /* the document */
20990     int n_doc;
20991     xmlChar * content; /* the comment content */
20992     int n_content;
20993
20994     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20995     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20996         mem_base = xmlMemBlocks();
20997         doc = gen_xmlDocPtr(n_doc, 0);
20998         content = gen_const_xmlChar_ptr(n_content, 1);
20999
21000         ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21001         desret_xmlNodePtr(ret_val);
21002         call_tests++;
21003         des_xmlDocPtr(n_doc, doc, 0);
21004         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21005         xmlResetLastError();
21006         if (mem_base != xmlMemBlocks()) {
21007             printf("Leak of %d blocks found in xmlNewDocComment",
21008                    xmlMemBlocks() - mem_base);
21009             test_ret++;
21010             printf(" %d", n_doc);
21011             printf(" %d", n_content);
21012             printf("\n");
21013         }
21014     }
21015     }
21016     function_tests++;
21017
21018     return(test_ret);
21019 }
21020
21021
21022 static int
21023 test_xmlNewDocFragment(void) {
21024     int test_ret = 0;
21025
21026 #if defined(LIBXML_TREE_ENABLED)
21027     int mem_base;
21028     xmlNodePtr ret_val;
21029     xmlDocPtr doc; /* the document owning the fragment */
21030     int n_doc;
21031
21032     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21033         mem_base = xmlMemBlocks();
21034         doc = gen_xmlDocPtr(n_doc, 0);
21035
21036         ret_val = xmlNewDocFragment(doc);
21037         desret_xmlNodePtr(ret_val);
21038         call_tests++;
21039         des_xmlDocPtr(n_doc, doc, 0);
21040         xmlResetLastError();
21041         if (mem_base != xmlMemBlocks()) {
21042             printf("Leak of %d blocks found in xmlNewDocFragment",
21043                    xmlMemBlocks() - mem_base);
21044             test_ret++;
21045             printf(" %d", n_doc);
21046             printf("\n");
21047         }
21048     }
21049     function_tests++;
21050 #endif
21051
21052     return(test_ret);
21053 }
21054
21055
21056 static int
21057 test_xmlNewDocNode(void) {
21058     int test_ret = 0;
21059
21060     int mem_base;
21061     xmlNodePtr ret_val;
21062     xmlDocPtr doc; /* the document */
21063     int n_doc;
21064     xmlNsPtr ns; /* namespace if any */
21065     int n_ns;
21066     xmlChar * name; /* the node name */
21067     int n_name;
21068     xmlChar * content; /* the XML text content if any */
21069     int n_content;
21070
21071     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21072     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21073     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21074     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21075         mem_base = xmlMemBlocks();
21076         doc = gen_xmlDocPtr(n_doc, 0);
21077         ns = gen_xmlNsPtr(n_ns, 1);
21078         name = gen_const_xmlChar_ptr(n_name, 2);
21079         content = gen_const_xmlChar_ptr(n_content, 3);
21080
21081         ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21082         desret_xmlNodePtr(ret_val);
21083         call_tests++;
21084         des_xmlDocPtr(n_doc, doc, 0);
21085         des_xmlNsPtr(n_ns, ns, 1);
21086         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21087         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21088         xmlResetLastError();
21089         if (mem_base != xmlMemBlocks()) {
21090             printf("Leak of %d blocks found in xmlNewDocNode",
21091                    xmlMemBlocks() - mem_base);
21092             test_ret++;
21093             printf(" %d", n_doc);
21094             printf(" %d", n_ns);
21095             printf(" %d", n_name);
21096             printf(" %d", n_content);
21097             printf("\n");
21098         }
21099     }
21100     }
21101     }
21102     }
21103     function_tests++;
21104
21105     return(test_ret);
21106 }
21107
21108
21109 static int
21110 test_xmlNewDocNodeEatName(void) {
21111     int test_ret = 0;
21112
21113     int mem_base;
21114     xmlNodePtr ret_val;
21115     xmlDocPtr doc; /* the document */
21116     int n_doc;
21117     xmlNsPtr ns; /* namespace if any */
21118     int n_ns;
21119     xmlChar * name; /* the node name */
21120     int n_name;
21121     xmlChar * content; /* the XML text content if any */
21122     int n_content;
21123
21124     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21125     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21126     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21127     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21128         mem_base = xmlMemBlocks();
21129         doc = gen_xmlDocPtr(n_doc, 0);
21130         ns = gen_xmlNsPtr(n_ns, 1);
21131         name = gen_eaten_name(n_name, 2);
21132         content = gen_const_xmlChar_ptr(n_content, 3);
21133
21134         ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21135         desret_xmlNodePtr(ret_val);
21136         call_tests++;
21137         des_xmlDocPtr(n_doc, doc, 0);
21138         des_xmlNsPtr(n_ns, ns, 1);
21139         des_eaten_name(n_name, name, 2);
21140         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21141         xmlResetLastError();
21142         if (mem_base != xmlMemBlocks()) {
21143             printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21144                    xmlMemBlocks() - mem_base);
21145             test_ret++;
21146             printf(" %d", n_doc);
21147             printf(" %d", n_ns);
21148             printf(" %d", n_name);
21149             printf(" %d", n_content);
21150             printf("\n");
21151         }
21152     }
21153     }
21154     }
21155     }
21156     function_tests++;
21157
21158     return(test_ret);
21159 }
21160
21161
21162 static int
21163 test_xmlNewDocPI(void) {
21164     int test_ret = 0;
21165
21166     int mem_base;
21167     xmlNodePtr ret_val;
21168     xmlDocPtr doc; /* the target document */
21169     int n_doc;
21170     xmlChar * name; /* the processing instruction name */
21171     int n_name;
21172     xmlChar * content; /* the PI content */
21173     int n_content;
21174
21175     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21176     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21177     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21178         mem_base = xmlMemBlocks();
21179         doc = gen_xmlDocPtr(n_doc, 0);
21180         name = gen_const_xmlChar_ptr(n_name, 1);
21181         content = gen_const_xmlChar_ptr(n_content, 2);
21182
21183         ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21184         desret_xmlNodePtr(ret_val);
21185         call_tests++;
21186         des_xmlDocPtr(n_doc, doc, 0);
21187         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21188         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21189         xmlResetLastError();
21190         if (mem_base != xmlMemBlocks()) {
21191             printf("Leak of %d blocks found in xmlNewDocPI",
21192                    xmlMemBlocks() - mem_base);
21193             test_ret++;
21194             printf(" %d", n_doc);
21195             printf(" %d", n_name);
21196             printf(" %d", n_content);
21197             printf("\n");
21198         }
21199     }
21200     }
21201     }
21202     function_tests++;
21203
21204     return(test_ret);
21205 }
21206
21207
21208 static int
21209 test_xmlNewDocProp(void) {
21210     int test_ret = 0;
21211
21212     int mem_base;
21213     xmlAttrPtr ret_val;
21214     xmlDocPtr doc; /* the document */
21215     int n_doc;
21216     xmlChar * name; /* the name of the attribute */
21217     int n_name;
21218     xmlChar * value; /* the value of the attribute */
21219     int n_value;
21220
21221     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21222     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21223     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21224         mem_base = xmlMemBlocks();
21225         doc = gen_xmlDocPtr(n_doc, 0);
21226         name = gen_const_xmlChar_ptr(n_name, 1);
21227         value = gen_const_xmlChar_ptr(n_value, 2);
21228
21229         ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21230         desret_xmlAttrPtr(ret_val);
21231         call_tests++;
21232         des_xmlDocPtr(n_doc, doc, 0);
21233         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21234         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21235         xmlResetLastError();
21236         if (mem_base != xmlMemBlocks()) {
21237             printf("Leak of %d blocks found in xmlNewDocProp",
21238                    xmlMemBlocks() - mem_base);
21239             test_ret++;
21240             printf(" %d", n_doc);
21241             printf(" %d", n_name);
21242             printf(" %d", n_value);
21243             printf("\n");
21244         }
21245     }
21246     }
21247     }
21248     function_tests++;
21249
21250     return(test_ret);
21251 }
21252
21253
21254 static int
21255 test_xmlNewDocRawNode(void) {
21256     int test_ret = 0;
21257
21258 #if defined(LIBXML_TREE_ENABLED)
21259 #ifdef LIBXML_TREE_ENABLED
21260     int mem_base;
21261     xmlNodePtr ret_val;
21262     xmlDocPtr doc; /* the document */
21263     int n_doc;
21264     xmlNsPtr ns; /* namespace if any */
21265     int n_ns;
21266     xmlChar * name; /* the node name */
21267     int n_name;
21268     xmlChar * content; /* the text content if any */
21269     int n_content;
21270
21271     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21272     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21273     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21274     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21275         mem_base = xmlMemBlocks();
21276         doc = gen_xmlDocPtr(n_doc, 0);
21277         ns = gen_xmlNsPtr(n_ns, 1);
21278         name = gen_const_xmlChar_ptr(n_name, 2);
21279         content = gen_const_xmlChar_ptr(n_content, 3);
21280
21281         ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21282         desret_xmlNodePtr(ret_val);
21283         call_tests++;
21284         des_xmlDocPtr(n_doc, doc, 0);
21285         des_xmlNsPtr(n_ns, ns, 1);
21286         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21287         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21288         xmlResetLastError();
21289         if (mem_base != xmlMemBlocks()) {
21290             printf("Leak of %d blocks found in xmlNewDocRawNode",
21291                    xmlMemBlocks() - mem_base);
21292             test_ret++;
21293             printf(" %d", n_doc);
21294             printf(" %d", n_ns);
21295             printf(" %d", n_name);
21296             printf(" %d", n_content);
21297             printf("\n");
21298         }
21299     }
21300     }
21301     }
21302     }
21303     function_tests++;
21304 #endif
21305 #endif
21306
21307     return(test_ret);
21308 }
21309
21310
21311 static int
21312 test_xmlNewDocText(void) {
21313     int test_ret = 0;
21314
21315     int mem_base;
21316     xmlNodePtr ret_val;
21317     xmlDocPtr doc; /* the document */
21318     int n_doc;
21319     xmlChar * content; /* the text content */
21320     int n_content;
21321
21322     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21323     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21324         mem_base = xmlMemBlocks();
21325         doc = gen_xmlDocPtr(n_doc, 0);
21326         content = gen_const_xmlChar_ptr(n_content, 1);
21327
21328         ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21329         desret_xmlNodePtr(ret_val);
21330         call_tests++;
21331         des_xmlDocPtr(n_doc, doc, 0);
21332         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21333         xmlResetLastError();
21334         if (mem_base != xmlMemBlocks()) {
21335             printf("Leak of %d blocks found in xmlNewDocText",
21336                    xmlMemBlocks() - mem_base);
21337             test_ret++;
21338             printf(" %d", n_doc);
21339             printf(" %d", n_content);
21340             printf("\n");
21341         }
21342     }
21343     }
21344     function_tests++;
21345
21346     return(test_ret);
21347 }
21348
21349
21350 static int
21351 test_xmlNewDocTextLen(void) {
21352     int test_ret = 0;
21353
21354     int mem_base;
21355     xmlNodePtr ret_val;
21356     xmlDocPtr doc; /* the document */
21357     int n_doc;
21358     xmlChar * content; /* the text content */
21359     int n_content;
21360     int len; /* the text len. */
21361     int n_len;
21362
21363     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21364     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21365     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21366         mem_base = xmlMemBlocks();
21367         doc = gen_xmlDocPtr(n_doc, 0);
21368         content = gen_const_xmlChar_ptr(n_content, 1);
21369         len = gen_int(n_len, 2);
21370
21371         ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21372         desret_xmlNodePtr(ret_val);
21373         call_tests++;
21374         des_xmlDocPtr(n_doc, doc, 0);
21375         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21376         des_int(n_len, len, 2);
21377         xmlResetLastError();
21378         if (mem_base != xmlMemBlocks()) {
21379             printf("Leak of %d blocks found in xmlNewDocTextLen",
21380                    xmlMemBlocks() - mem_base);
21381             test_ret++;
21382             printf(" %d", n_doc);
21383             printf(" %d", n_content);
21384             printf(" %d", n_len);
21385             printf("\n");
21386         }
21387     }
21388     }
21389     }
21390     function_tests++;
21391
21392     return(test_ret);
21393 }
21394
21395
21396 static int
21397 test_xmlNewDtd(void) {
21398     int test_ret = 0;
21399
21400     int mem_base;
21401     xmlDtdPtr ret_val;
21402     xmlDocPtr doc; /* the document pointer */
21403     int n_doc;
21404     xmlChar * name; /* the DTD name */
21405     int n_name;
21406     xmlChar * ExternalID; /* the external ID */
21407     int n_ExternalID;
21408     xmlChar * SystemID; /* the system ID */
21409     int n_SystemID;
21410
21411     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21412     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21413     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21414     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21415         mem_base = xmlMemBlocks();
21416         doc = gen_xmlDocPtr(n_doc, 0);
21417         name = gen_const_xmlChar_ptr(n_name, 1);
21418         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21419         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21420
21421         ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21422         desret_xmlDtdPtr(ret_val);
21423         call_tests++;
21424         des_xmlDocPtr(n_doc, doc, 0);
21425         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21426         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21427         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21428         xmlResetLastError();
21429         if (mem_base != xmlMemBlocks()) {
21430             printf("Leak of %d blocks found in xmlNewDtd",
21431                    xmlMemBlocks() - mem_base);
21432             test_ret++;
21433             printf(" %d", n_doc);
21434             printf(" %d", n_name);
21435             printf(" %d", n_ExternalID);
21436             printf(" %d", n_SystemID);
21437             printf("\n");
21438         }
21439     }
21440     }
21441     }
21442     }
21443     function_tests++;
21444
21445     return(test_ret);
21446 }
21447
21448
21449 static int
21450 test_xmlNewNode(void) {
21451     int test_ret = 0;
21452
21453     int mem_base;
21454     xmlNodePtr ret_val;
21455     xmlNsPtr ns; /* namespace if any */
21456     int n_ns;
21457     xmlChar * name; /* the node name */
21458     int n_name;
21459
21460     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21461     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21462         mem_base = xmlMemBlocks();
21463         ns = gen_xmlNsPtr(n_ns, 0);
21464         name = gen_const_xmlChar_ptr(n_name, 1);
21465
21466         ret_val = xmlNewNode(ns, (const xmlChar *)name);
21467         desret_xmlNodePtr(ret_val);
21468         call_tests++;
21469         des_xmlNsPtr(n_ns, ns, 0);
21470         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21471         xmlResetLastError();
21472         if (mem_base != xmlMemBlocks()) {
21473             printf("Leak of %d blocks found in xmlNewNode",
21474                    xmlMemBlocks() - mem_base);
21475             test_ret++;
21476             printf(" %d", n_ns);
21477             printf(" %d", n_name);
21478             printf("\n");
21479         }
21480     }
21481     }
21482     function_tests++;
21483
21484     return(test_ret);
21485 }
21486
21487
21488 static int
21489 test_xmlNewNodeEatName(void) {
21490     int test_ret = 0;
21491
21492     int mem_base;
21493     xmlNodePtr ret_val;
21494     xmlNsPtr ns; /* namespace if any */
21495     int n_ns;
21496     xmlChar * name; /* the node name */
21497     int n_name;
21498
21499     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21500     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21501         mem_base = xmlMemBlocks();
21502         ns = gen_xmlNsPtr(n_ns, 0);
21503         name = gen_eaten_name(n_name, 1);
21504
21505         ret_val = xmlNewNodeEatName(ns, name);
21506         desret_xmlNodePtr(ret_val);
21507         call_tests++;
21508         des_xmlNsPtr(n_ns, ns, 0);
21509         des_eaten_name(n_name, name, 1);
21510         xmlResetLastError();
21511         if (mem_base != xmlMemBlocks()) {
21512             printf("Leak of %d blocks found in xmlNewNodeEatName",
21513                    xmlMemBlocks() - mem_base);
21514             test_ret++;
21515             printf(" %d", n_ns);
21516             printf(" %d", n_name);
21517             printf("\n");
21518         }
21519     }
21520     }
21521     function_tests++;
21522
21523     return(test_ret);
21524 }
21525
21526
21527 static int
21528 test_xmlNewNs(void) {
21529     int test_ret = 0;
21530
21531     int mem_base;
21532     xmlNsPtr ret_val;
21533     xmlNodePtr node; /* the element carrying the namespace */
21534     int n_node;
21535     xmlChar * href; /* the URI associated */
21536     int n_href;
21537     xmlChar * prefix; /* the prefix for the namespace */
21538     int n_prefix;
21539
21540     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21541     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21542     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21543         mem_base = xmlMemBlocks();
21544         node = gen_xmlNodePtr(n_node, 0);
21545         href = gen_const_xmlChar_ptr(n_href, 1);
21546         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21547
21548         ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21549         if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21550         desret_xmlNsPtr(ret_val);
21551         call_tests++;
21552         des_xmlNodePtr(n_node, node, 0);
21553         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21554         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21555         xmlResetLastError();
21556         if (mem_base != xmlMemBlocks()) {
21557             printf("Leak of %d blocks found in xmlNewNs",
21558                    xmlMemBlocks() - mem_base);
21559             test_ret++;
21560             printf(" %d", n_node);
21561             printf(" %d", n_href);
21562             printf(" %d", n_prefix);
21563             printf("\n");
21564         }
21565     }
21566     }
21567     }
21568     function_tests++;
21569
21570     return(test_ret);
21571 }
21572
21573
21574 static int
21575 test_xmlNewNsProp(void) {
21576     int test_ret = 0;
21577
21578     int mem_base;
21579     xmlAttrPtr ret_val;
21580     xmlNodePtr node; /* the holding node */
21581     int n_node;
21582     xmlNsPtr ns; /* the namespace */
21583     int n_ns;
21584     xmlChar * name; /* the name of the attribute */
21585     int n_name;
21586     xmlChar * value; /* the value of the attribute */
21587     int n_value;
21588
21589     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21590     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21591     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21592     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21593         mem_base = xmlMemBlocks();
21594         node = gen_xmlNodePtr(n_node, 0);
21595         ns = gen_xmlNsPtr(n_ns, 1);
21596         name = gen_const_xmlChar_ptr(n_name, 2);
21597         value = gen_const_xmlChar_ptr(n_value, 3);
21598
21599         ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21600         desret_xmlAttrPtr(ret_val);
21601         call_tests++;
21602         des_xmlNodePtr(n_node, node, 0);
21603         des_xmlNsPtr(n_ns, ns, 1);
21604         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21605         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21606         xmlResetLastError();
21607         if (mem_base != xmlMemBlocks()) {
21608             printf("Leak of %d blocks found in xmlNewNsProp",
21609                    xmlMemBlocks() - mem_base);
21610             test_ret++;
21611             printf(" %d", n_node);
21612             printf(" %d", n_ns);
21613             printf(" %d", n_name);
21614             printf(" %d", n_value);
21615             printf("\n");
21616         }
21617     }
21618     }
21619     }
21620     }
21621     function_tests++;
21622
21623     return(test_ret);
21624 }
21625
21626
21627 static int
21628 test_xmlNewNsPropEatName(void) {
21629     int test_ret = 0;
21630
21631     int mem_base;
21632     xmlAttrPtr ret_val;
21633     xmlNodePtr node; /* the holding node */
21634     int n_node;
21635     xmlNsPtr ns; /* the namespace */
21636     int n_ns;
21637     xmlChar * name; /* the name of the attribute */
21638     int n_name;
21639     xmlChar * value; /* the value of the attribute */
21640     int n_value;
21641
21642     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21643     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21644     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21645     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21646         mem_base = xmlMemBlocks();
21647         node = gen_xmlNodePtr(n_node, 0);
21648         ns = gen_xmlNsPtr(n_ns, 1);
21649         name = gen_eaten_name(n_name, 2);
21650         value = gen_const_xmlChar_ptr(n_value, 3);
21651
21652         ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21653         desret_xmlAttrPtr(ret_val);
21654         call_tests++;
21655         des_xmlNodePtr(n_node, node, 0);
21656         des_xmlNsPtr(n_ns, ns, 1);
21657         des_eaten_name(n_name, name, 2);
21658         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21659         xmlResetLastError();
21660         if (mem_base != xmlMemBlocks()) {
21661             printf("Leak of %d blocks found in xmlNewNsPropEatName",
21662                    xmlMemBlocks() - mem_base);
21663             test_ret++;
21664             printf(" %d", n_node);
21665             printf(" %d", n_ns);
21666             printf(" %d", n_name);
21667             printf(" %d", n_value);
21668             printf("\n");
21669         }
21670     }
21671     }
21672     }
21673     }
21674     function_tests++;
21675
21676     return(test_ret);
21677 }
21678
21679
21680 static int
21681 test_xmlNewPI(void) {
21682     int test_ret = 0;
21683
21684     int mem_base;
21685     xmlNodePtr ret_val;
21686     xmlChar * name; /* the processing instruction name */
21687     int n_name;
21688     xmlChar * content; /* the PI content */
21689     int n_content;
21690
21691     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21692     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21693         mem_base = xmlMemBlocks();
21694         name = gen_const_xmlChar_ptr(n_name, 0);
21695         content = gen_const_xmlChar_ptr(n_content, 1);
21696
21697         ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21698         desret_xmlNodePtr(ret_val);
21699         call_tests++;
21700         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21701         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21702         xmlResetLastError();
21703         if (mem_base != xmlMemBlocks()) {
21704             printf("Leak of %d blocks found in xmlNewPI",
21705                    xmlMemBlocks() - mem_base);
21706             test_ret++;
21707             printf(" %d", n_name);
21708             printf(" %d", n_content);
21709             printf("\n");
21710         }
21711     }
21712     }
21713     function_tests++;
21714
21715     return(test_ret);
21716 }
21717
21718
21719 static int
21720 test_xmlNewProp(void) {
21721     int test_ret = 0;
21722
21723 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21724 #ifdef LIBXML_TREE_ENABLED
21725     int mem_base;
21726     xmlAttrPtr ret_val;
21727     xmlNodePtr node; /* the holding node */
21728     int n_node;
21729     xmlChar * name; /* the name of the attribute */
21730     int n_name;
21731     xmlChar * value; /* the value of the attribute */
21732     int n_value;
21733
21734     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21735     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21736     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21737         mem_base = xmlMemBlocks();
21738         node = gen_xmlNodePtr(n_node, 0);
21739         name = gen_const_xmlChar_ptr(n_name, 1);
21740         value = gen_const_xmlChar_ptr(n_value, 2);
21741
21742         ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21743         desret_xmlAttrPtr(ret_val);
21744         call_tests++;
21745         des_xmlNodePtr(n_node, node, 0);
21746         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21747         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21748         xmlResetLastError();
21749         if (mem_base != xmlMemBlocks()) {
21750             printf("Leak of %d blocks found in xmlNewProp",
21751                    xmlMemBlocks() - mem_base);
21752             test_ret++;
21753             printf(" %d", n_node);
21754             printf(" %d", n_name);
21755             printf(" %d", n_value);
21756             printf("\n");
21757         }
21758     }
21759     }
21760     }
21761     function_tests++;
21762 #endif
21763 #endif
21764
21765     return(test_ret);
21766 }
21767
21768
21769 static int
21770 test_xmlNewReference(void) {
21771     int test_ret = 0;
21772
21773     int mem_base;
21774     xmlNodePtr ret_val;
21775     xmlDocPtr doc; /* the document */
21776     int n_doc;
21777     xmlChar * name; /* the reference name, or the reference string with & and ; */
21778     int n_name;
21779
21780     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21781     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21782         mem_base = xmlMemBlocks();
21783         doc = gen_xmlDocPtr(n_doc, 0);
21784         name = gen_const_xmlChar_ptr(n_name, 1);
21785
21786         ret_val = xmlNewReference(doc, (const xmlChar *)name);
21787         desret_xmlNodePtr(ret_val);
21788         call_tests++;
21789         des_xmlDocPtr(n_doc, doc, 0);
21790         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21791         xmlResetLastError();
21792         if (mem_base != xmlMemBlocks()) {
21793             printf("Leak of %d blocks found in xmlNewReference",
21794                    xmlMemBlocks() - mem_base);
21795             test_ret++;
21796             printf(" %d", n_doc);
21797             printf(" %d", n_name);
21798             printf("\n");
21799         }
21800     }
21801     }
21802     function_tests++;
21803
21804     return(test_ret);
21805 }
21806
21807
21808 static int
21809 test_xmlNewText(void) {
21810     int test_ret = 0;
21811
21812     int mem_base;
21813     xmlNodePtr ret_val;
21814     xmlChar * content; /* the text content */
21815     int n_content;
21816
21817     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21818         mem_base = xmlMemBlocks();
21819         content = gen_const_xmlChar_ptr(n_content, 0);
21820
21821         ret_val = xmlNewText((const xmlChar *)content);
21822         desret_xmlNodePtr(ret_val);
21823         call_tests++;
21824         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21825         xmlResetLastError();
21826         if (mem_base != xmlMemBlocks()) {
21827             printf("Leak of %d blocks found in xmlNewText",
21828                    xmlMemBlocks() - mem_base);
21829             test_ret++;
21830             printf(" %d", n_content);
21831             printf("\n");
21832         }
21833     }
21834     function_tests++;
21835
21836     return(test_ret);
21837 }
21838
21839
21840 static int
21841 test_xmlNewTextChild(void) {
21842     int test_ret = 0;
21843
21844 #if defined(LIBXML_TREE_ENABLED)
21845 #ifdef LIBXML_TREE_ENABLED
21846     int mem_base;
21847     xmlNodePtr ret_val;
21848     xmlNodePtr parent; /* the parent node */
21849     int n_parent;
21850     xmlNsPtr ns; /* a namespace if any */
21851     int n_ns;
21852     xmlChar * name; /* the name of the child */
21853     int n_name;
21854     xmlChar * content; /* the text content of the child if any. */
21855     int n_content;
21856
21857     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21858     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21859     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21860     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21861         mem_base = xmlMemBlocks();
21862         parent = gen_xmlNodePtr(n_parent, 0);
21863         ns = gen_xmlNsPtr(n_ns, 1);
21864         name = gen_const_xmlChar_ptr(n_name, 2);
21865         content = gen_const_xmlChar_ptr(n_content, 3);
21866
21867         ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21868         desret_xmlNodePtr(ret_val);
21869         call_tests++;
21870         des_xmlNodePtr(n_parent, parent, 0);
21871         des_xmlNsPtr(n_ns, ns, 1);
21872         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21873         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21874         xmlResetLastError();
21875         if (mem_base != xmlMemBlocks()) {
21876             printf("Leak of %d blocks found in xmlNewTextChild",
21877                    xmlMemBlocks() - mem_base);
21878             test_ret++;
21879             printf(" %d", n_parent);
21880             printf(" %d", n_ns);
21881             printf(" %d", n_name);
21882             printf(" %d", n_content);
21883             printf("\n");
21884         }
21885     }
21886     }
21887     }
21888     }
21889     function_tests++;
21890 #endif
21891 #endif
21892
21893     return(test_ret);
21894 }
21895
21896
21897 static int
21898 test_xmlNewTextLen(void) {
21899     int test_ret = 0;
21900
21901     int mem_base;
21902     xmlNodePtr ret_val;
21903     xmlChar * content; /* the text content */
21904     int n_content;
21905     int len; /* the text len. */
21906     int n_len;
21907
21908     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21909     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21910         mem_base = xmlMemBlocks();
21911         content = gen_const_xmlChar_ptr(n_content, 0);
21912         len = gen_int(n_len, 1);
21913
21914         ret_val = xmlNewTextLen((const xmlChar *)content, len);
21915         desret_xmlNodePtr(ret_val);
21916         call_tests++;
21917         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21918         des_int(n_len, len, 1);
21919         xmlResetLastError();
21920         if (mem_base != xmlMemBlocks()) {
21921             printf("Leak of %d blocks found in xmlNewTextLen",
21922                    xmlMemBlocks() - mem_base);
21923             test_ret++;
21924             printf(" %d", n_content);
21925             printf(" %d", n_len);
21926             printf("\n");
21927         }
21928     }
21929     }
21930     function_tests++;
21931
21932     return(test_ret);
21933 }
21934
21935
21936 static int
21937 test_xmlNextElementSibling(void) {
21938     int test_ret = 0;
21939
21940 #if defined(LIBXML_TREE_ENABLED)
21941     int mem_base;
21942     xmlNodePtr ret_val;
21943     xmlNodePtr node; /* the current node */
21944     int n_node;
21945
21946     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21947         mem_base = xmlMemBlocks();
21948         node = gen_xmlNodePtr(n_node, 0);
21949
21950         ret_val = xmlNextElementSibling(node);
21951         desret_xmlNodePtr(ret_val);
21952         call_tests++;
21953         des_xmlNodePtr(n_node, node, 0);
21954         xmlResetLastError();
21955         if (mem_base != xmlMemBlocks()) {
21956             printf("Leak of %d blocks found in xmlNextElementSibling",
21957                    xmlMemBlocks() - mem_base);
21958             test_ret++;
21959             printf(" %d", n_node);
21960             printf("\n");
21961         }
21962     }
21963     function_tests++;
21964 #endif
21965
21966     return(test_ret);
21967 }
21968
21969
21970 static int
21971 test_xmlNodeAddContent(void) {
21972     int test_ret = 0;
21973
21974     int mem_base;
21975     xmlNodePtr cur; /* the node being modified */
21976     int n_cur;
21977     xmlChar * content; /* extra content */
21978     int n_content;
21979
21980     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21981     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21982         mem_base = xmlMemBlocks();
21983         cur = gen_xmlNodePtr(n_cur, 0);
21984         content = gen_const_xmlChar_ptr(n_content, 1);
21985
21986         xmlNodeAddContent(cur, (const xmlChar *)content);
21987         call_tests++;
21988         des_xmlNodePtr(n_cur, cur, 0);
21989         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21990         xmlResetLastError();
21991         if (mem_base != xmlMemBlocks()) {
21992             printf("Leak of %d blocks found in xmlNodeAddContent",
21993                    xmlMemBlocks() - mem_base);
21994             test_ret++;
21995             printf(" %d", n_cur);
21996             printf(" %d", n_content);
21997             printf("\n");
21998         }
21999     }
22000     }
22001     function_tests++;
22002
22003     return(test_ret);
22004 }
22005
22006
22007 static int
22008 test_xmlNodeAddContentLen(void) {
22009     int test_ret = 0;
22010
22011     int mem_base;
22012     xmlNodePtr cur; /* the node being modified */
22013     int n_cur;
22014     xmlChar * content; /* extra content */
22015     int n_content;
22016     int len; /* the size of @content */
22017     int n_len;
22018
22019     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22020     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22021     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22022         mem_base = xmlMemBlocks();
22023         cur = gen_xmlNodePtr(n_cur, 0);
22024         content = gen_const_xmlChar_ptr(n_content, 1);
22025         len = gen_int(n_len, 2);
22026
22027         xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22028         call_tests++;
22029         des_xmlNodePtr(n_cur, cur, 0);
22030         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22031         des_int(n_len, len, 2);
22032         xmlResetLastError();
22033         if (mem_base != xmlMemBlocks()) {
22034             printf("Leak of %d blocks found in xmlNodeAddContentLen",
22035                    xmlMemBlocks() - mem_base);
22036             test_ret++;
22037             printf(" %d", n_cur);
22038             printf(" %d", n_content);
22039             printf(" %d", n_len);
22040             printf("\n");
22041         }
22042     }
22043     }
22044     }
22045     function_tests++;
22046
22047     return(test_ret);
22048 }
22049
22050
22051 static int
22052 test_xmlNodeBufGetContent(void) {
22053     int test_ret = 0;
22054
22055     int mem_base;
22056     int ret_val;
22057     xmlBufferPtr buffer; /* a buffer */
22058     int n_buffer;
22059     xmlNodePtr cur; /* the node being read */
22060     int n_cur;
22061
22062     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22063     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22064         mem_base = xmlMemBlocks();
22065         buffer = gen_xmlBufferPtr(n_buffer, 0);
22066         cur = gen_xmlNodePtr(n_cur, 1);
22067
22068         ret_val = xmlNodeBufGetContent(buffer, cur);
22069         desret_int(ret_val);
22070         call_tests++;
22071         des_xmlBufferPtr(n_buffer, buffer, 0);
22072         des_xmlNodePtr(n_cur, cur, 1);
22073         xmlResetLastError();
22074         if (mem_base != xmlMemBlocks()) {
22075             printf("Leak of %d blocks found in xmlNodeBufGetContent",
22076                    xmlMemBlocks() - mem_base);
22077             test_ret++;
22078             printf(" %d", n_buffer);
22079             printf(" %d", n_cur);
22080             printf("\n");
22081         }
22082     }
22083     }
22084     function_tests++;
22085
22086     return(test_ret);
22087 }
22088
22089
22090 static int
22091 test_xmlNodeDump(void) {
22092     int test_ret = 0;
22093
22094 #if defined(LIBXML_OUTPUT_ENABLED)
22095     int mem_base;
22096     int ret_val;
22097     xmlBufferPtr buf; /* the XML buffer output */
22098     int n_buf;
22099     xmlDocPtr doc; /* the document */
22100     int n_doc;
22101     xmlNodePtr cur; /* the current node */
22102     int n_cur;
22103     int level; /* the imbrication level for indenting */
22104     int n_level;
22105     int format; /* is formatting allowed */
22106     int n_format;
22107
22108     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22109     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22110     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22111     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22112     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22113         mem_base = xmlMemBlocks();
22114         buf = gen_xmlBufferPtr(n_buf, 0);
22115         doc = gen_xmlDocPtr(n_doc, 1);
22116         cur = gen_xmlNodePtr(n_cur, 2);
22117         level = gen_int(n_level, 3);
22118         format = gen_int(n_format, 4);
22119
22120         ret_val = xmlNodeDump(buf, doc, cur, level, format);
22121         desret_int(ret_val);
22122         call_tests++;
22123         des_xmlBufferPtr(n_buf, buf, 0);
22124         des_xmlDocPtr(n_doc, doc, 1);
22125         des_xmlNodePtr(n_cur, cur, 2);
22126         des_int(n_level, level, 3);
22127         des_int(n_format, format, 4);
22128         xmlResetLastError();
22129         if (mem_base != xmlMemBlocks()) {
22130             printf("Leak of %d blocks found in xmlNodeDump",
22131                    xmlMemBlocks() - mem_base);
22132             test_ret++;
22133             printf(" %d", n_buf);
22134             printf(" %d", n_doc);
22135             printf(" %d", n_cur);
22136             printf(" %d", n_level);
22137             printf(" %d", n_format);
22138             printf("\n");
22139         }
22140     }
22141     }
22142     }
22143     }
22144     }
22145     function_tests++;
22146 #endif
22147
22148     return(test_ret);
22149 }
22150
22151
22152 static int
22153 test_xmlNodeDumpOutput(void) {
22154     int test_ret = 0;
22155
22156 #if defined(LIBXML_OUTPUT_ENABLED)
22157     int mem_base;
22158     xmlOutputBufferPtr buf; /* the XML buffer output */
22159     int n_buf;
22160     xmlDocPtr doc; /* the document */
22161     int n_doc;
22162     xmlNodePtr cur; /* the current node */
22163     int n_cur;
22164     int level; /* the imbrication level for indenting */
22165     int n_level;
22166     int format; /* is formatting allowed */
22167     int n_format;
22168     char * encoding; /* an optional encoding string */
22169     int n_encoding;
22170
22171     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22172     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22173     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22174     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22175     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22176     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22177         mem_base = xmlMemBlocks();
22178         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22179         doc = gen_xmlDocPtr(n_doc, 1);
22180         cur = gen_xmlNodePtr(n_cur, 2);
22181         level = gen_int(n_level, 3);
22182         format = gen_int(n_format, 4);
22183         encoding = gen_const_char_ptr(n_encoding, 5);
22184
22185         xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22186         call_tests++;
22187         des_xmlOutputBufferPtr(n_buf, buf, 0);
22188         des_xmlDocPtr(n_doc, doc, 1);
22189         des_xmlNodePtr(n_cur, cur, 2);
22190         des_int(n_level, level, 3);
22191         des_int(n_format, format, 4);
22192         des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22193         xmlResetLastError();
22194         if (mem_base != xmlMemBlocks()) {
22195             printf("Leak of %d blocks found in xmlNodeDumpOutput",
22196                    xmlMemBlocks() - mem_base);
22197             test_ret++;
22198             printf(" %d", n_buf);
22199             printf(" %d", n_doc);
22200             printf(" %d", n_cur);
22201             printf(" %d", n_level);
22202             printf(" %d", n_format);
22203             printf(" %d", n_encoding);
22204             printf("\n");
22205         }
22206     }
22207     }
22208     }
22209     }
22210     }
22211     }
22212     function_tests++;
22213 #endif
22214
22215     return(test_ret);
22216 }
22217
22218
22219 static int
22220 test_xmlNodeGetBase(void) {
22221     int test_ret = 0;
22222
22223     int mem_base;
22224     xmlChar * ret_val;
22225     xmlDocPtr doc; /* the document the node pertains to */
22226     int n_doc;
22227     xmlNodePtr cur; /* the node being checked */
22228     int n_cur;
22229
22230     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22231     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22232         mem_base = xmlMemBlocks();
22233         doc = gen_xmlDocPtr(n_doc, 0);
22234         cur = gen_xmlNodePtr(n_cur, 1);
22235
22236         ret_val = xmlNodeGetBase(doc, cur);
22237         desret_xmlChar_ptr(ret_val);
22238         call_tests++;
22239         des_xmlDocPtr(n_doc, doc, 0);
22240         des_xmlNodePtr(n_cur, cur, 1);
22241         xmlResetLastError();
22242         if (mem_base != xmlMemBlocks()) {
22243             printf("Leak of %d blocks found in xmlNodeGetBase",
22244                    xmlMemBlocks() - mem_base);
22245             test_ret++;
22246             printf(" %d", n_doc);
22247             printf(" %d", n_cur);
22248             printf("\n");
22249         }
22250     }
22251     }
22252     function_tests++;
22253
22254     return(test_ret);
22255 }
22256
22257
22258 static int
22259 test_xmlNodeGetContent(void) {
22260     int test_ret = 0;
22261
22262     int mem_base;
22263     xmlChar * ret_val;
22264     xmlNodePtr cur; /* the node being read */
22265     int n_cur;
22266
22267     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22268         mem_base = xmlMemBlocks();
22269         cur = gen_xmlNodePtr(n_cur, 0);
22270
22271         ret_val = xmlNodeGetContent(cur);
22272         desret_xmlChar_ptr(ret_val);
22273         call_tests++;
22274         des_xmlNodePtr(n_cur, cur, 0);
22275         xmlResetLastError();
22276         if (mem_base != xmlMemBlocks()) {
22277             printf("Leak of %d blocks found in xmlNodeGetContent",
22278                    xmlMemBlocks() - mem_base);
22279             test_ret++;
22280             printf(" %d", n_cur);
22281             printf("\n");
22282         }
22283     }
22284     function_tests++;
22285
22286     return(test_ret);
22287 }
22288
22289
22290 static int
22291 test_xmlNodeGetLang(void) {
22292     int test_ret = 0;
22293
22294     int mem_base;
22295     xmlChar * ret_val;
22296     xmlNodePtr cur; /* the node being checked */
22297     int n_cur;
22298
22299     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22300         mem_base = xmlMemBlocks();
22301         cur = gen_xmlNodePtr(n_cur, 0);
22302
22303         ret_val = xmlNodeGetLang(cur);
22304         desret_xmlChar_ptr(ret_val);
22305         call_tests++;
22306         des_xmlNodePtr(n_cur, cur, 0);
22307         xmlResetLastError();
22308         if (mem_base != xmlMemBlocks()) {
22309             printf("Leak of %d blocks found in xmlNodeGetLang",
22310                    xmlMemBlocks() - mem_base);
22311             test_ret++;
22312             printf(" %d", n_cur);
22313             printf("\n");
22314         }
22315     }
22316     function_tests++;
22317
22318     return(test_ret);
22319 }
22320
22321
22322 static int
22323 test_xmlNodeGetSpacePreserve(void) {
22324     int test_ret = 0;
22325
22326     int mem_base;
22327     int ret_val;
22328     xmlNodePtr cur; /* the node being checked */
22329     int n_cur;
22330
22331     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22332         mem_base = xmlMemBlocks();
22333         cur = gen_xmlNodePtr(n_cur, 0);
22334
22335         ret_val = xmlNodeGetSpacePreserve(cur);
22336         desret_int(ret_val);
22337         call_tests++;
22338         des_xmlNodePtr(n_cur, cur, 0);
22339         xmlResetLastError();
22340         if (mem_base != xmlMemBlocks()) {
22341             printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22342                    xmlMemBlocks() - mem_base);
22343             test_ret++;
22344             printf(" %d", n_cur);
22345             printf("\n");
22346         }
22347     }
22348     function_tests++;
22349
22350     return(test_ret);
22351 }
22352
22353
22354 static int
22355 test_xmlNodeIsText(void) {
22356     int test_ret = 0;
22357
22358     int mem_base;
22359     int ret_val;
22360     xmlNodePtr node; /* the node */
22361     int n_node;
22362
22363     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22364         mem_base = xmlMemBlocks();
22365         node = gen_xmlNodePtr(n_node, 0);
22366
22367         ret_val = xmlNodeIsText(node);
22368         desret_int(ret_val);
22369         call_tests++;
22370         des_xmlNodePtr(n_node, node, 0);
22371         xmlResetLastError();
22372         if (mem_base != xmlMemBlocks()) {
22373             printf("Leak of %d blocks found in xmlNodeIsText",
22374                    xmlMemBlocks() - mem_base);
22375             test_ret++;
22376             printf(" %d", n_node);
22377             printf("\n");
22378         }
22379     }
22380     function_tests++;
22381
22382     return(test_ret);
22383 }
22384
22385
22386 static int
22387 test_xmlNodeListGetRawString(void) {
22388     int test_ret = 0;
22389
22390 #if defined(LIBXML_TREE_ENABLED)
22391     int mem_base;
22392     xmlChar * ret_val;
22393     xmlDocPtr doc; /* the document */
22394     int n_doc;
22395     xmlNodePtr list; /* a Node list */
22396     int n_list;
22397     int inLine; /* should we replace entity contents or show their external form */
22398     int n_inLine;
22399
22400     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22401     for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22402     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22403         mem_base = xmlMemBlocks();
22404         doc = gen_xmlDocPtr(n_doc, 0);
22405         list = gen_xmlNodePtr(n_list, 1);
22406         inLine = gen_int(n_inLine, 2);
22407
22408         ret_val = xmlNodeListGetRawString(doc, list, inLine);
22409         desret_xmlChar_ptr(ret_val);
22410         call_tests++;
22411         des_xmlDocPtr(n_doc, doc, 0);
22412         des_xmlNodePtr(n_list, list, 1);
22413         des_int(n_inLine, inLine, 2);
22414         xmlResetLastError();
22415         if (mem_base != xmlMemBlocks()) {
22416             printf("Leak of %d blocks found in xmlNodeListGetRawString",
22417                    xmlMemBlocks() - mem_base);
22418             test_ret++;
22419             printf(" %d", n_doc);
22420             printf(" %d", n_list);
22421             printf(" %d", n_inLine);
22422             printf("\n");
22423         }
22424     }
22425     }
22426     }
22427     function_tests++;
22428 #endif
22429
22430     return(test_ret);
22431 }
22432
22433
22434 static int
22435 test_xmlNodeListGetString(void) {
22436     int test_ret = 0;
22437
22438     int mem_base;
22439     xmlChar * ret_val;
22440     xmlDocPtr doc; /* the document */
22441     int n_doc;
22442     xmlNodePtr list; /* a Node list */
22443     int n_list;
22444     int inLine; /* should we replace entity contents or show their external form */
22445     int n_inLine;
22446
22447     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22448     for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22449     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22450         mem_base = xmlMemBlocks();
22451         doc = gen_xmlDocPtr(n_doc, 0);
22452         list = gen_xmlNodePtr(n_list, 1);
22453         inLine = gen_int(n_inLine, 2);
22454
22455         ret_val = xmlNodeListGetString(doc, list, inLine);
22456         desret_xmlChar_ptr(ret_val);
22457         call_tests++;
22458         des_xmlDocPtr(n_doc, doc, 0);
22459         des_xmlNodePtr(n_list, list, 1);
22460         des_int(n_inLine, inLine, 2);
22461         xmlResetLastError();
22462         if (mem_base != xmlMemBlocks()) {
22463             printf("Leak of %d blocks found in xmlNodeListGetString",
22464                    xmlMemBlocks() - mem_base);
22465             test_ret++;
22466             printf(" %d", n_doc);
22467             printf(" %d", n_list);
22468             printf(" %d", n_inLine);
22469             printf("\n");
22470         }
22471     }
22472     }
22473     }
22474     function_tests++;
22475
22476     return(test_ret);
22477 }
22478
22479
22480 static int
22481 test_xmlNodeSetBase(void) {
22482     int test_ret = 0;
22483
22484 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22485     int mem_base;
22486     xmlNodePtr cur; /* the node being changed */
22487     int n_cur;
22488     xmlChar * uri; /* the new base URI */
22489     int n_uri;
22490
22491     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22492     for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22493         mem_base = xmlMemBlocks();
22494         cur = gen_xmlNodePtr(n_cur, 0);
22495         uri = gen_const_xmlChar_ptr(n_uri, 1);
22496
22497         xmlNodeSetBase(cur, (const xmlChar *)uri);
22498         call_tests++;
22499         des_xmlNodePtr(n_cur, cur, 0);
22500         des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22501         xmlResetLastError();
22502         if (mem_base != xmlMemBlocks()) {
22503             printf("Leak of %d blocks found in xmlNodeSetBase",
22504                    xmlMemBlocks() - mem_base);
22505             test_ret++;
22506             printf(" %d", n_cur);
22507             printf(" %d", n_uri);
22508             printf("\n");
22509         }
22510     }
22511     }
22512     function_tests++;
22513 #endif
22514
22515     return(test_ret);
22516 }
22517
22518
22519 static int
22520 test_xmlNodeSetContent(void) {
22521     int test_ret = 0;
22522
22523     int mem_base;
22524     xmlNodePtr cur; /* the node being modified */
22525     int n_cur;
22526     xmlChar * content; /* the new value of the content */
22527     int n_content;
22528
22529     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22530     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22531         mem_base = xmlMemBlocks();
22532         cur = gen_xmlNodePtr(n_cur, 0);
22533         content = gen_const_xmlChar_ptr(n_content, 1);
22534
22535         xmlNodeSetContent(cur, (const xmlChar *)content);
22536         call_tests++;
22537         des_xmlNodePtr(n_cur, cur, 0);
22538         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22539         xmlResetLastError();
22540         if (mem_base != xmlMemBlocks()) {
22541             printf("Leak of %d blocks found in xmlNodeSetContent",
22542                    xmlMemBlocks() - mem_base);
22543             test_ret++;
22544             printf(" %d", n_cur);
22545             printf(" %d", n_content);
22546             printf("\n");
22547         }
22548     }
22549     }
22550     function_tests++;
22551
22552     return(test_ret);
22553 }
22554
22555
22556 static int
22557 test_xmlNodeSetContentLen(void) {
22558     int test_ret = 0;
22559
22560 #if defined(LIBXML_TREE_ENABLED)
22561     int mem_base;
22562     xmlNodePtr cur; /* the node being modified */
22563     int n_cur;
22564     xmlChar * content; /* the new value of the content */
22565     int n_content;
22566     int len; /* the size of @content */
22567     int n_len;
22568
22569     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22570     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22571     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22572         mem_base = xmlMemBlocks();
22573         cur = gen_xmlNodePtr(n_cur, 0);
22574         content = gen_const_xmlChar_ptr(n_content, 1);
22575         len = gen_int(n_len, 2);
22576
22577         xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22578         call_tests++;
22579         des_xmlNodePtr(n_cur, cur, 0);
22580         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22581         des_int(n_len, len, 2);
22582         xmlResetLastError();
22583         if (mem_base != xmlMemBlocks()) {
22584             printf("Leak of %d blocks found in xmlNodeSetContentLen",
22585                    xmlMemBlocks() - mem_base);
22586             test_ret++;
22587             printf(" %d", n_cur);
22588             printf(" %d", n_content);
22589             printf(" %d", n_len);
22590             printf("\n");
22591         }
22592     }
22593     }
22594     }
22595     function_tests++;
22596 #endif
22597
22598     return(test_ret);
22599 }
22600
22601
22602 static int
22603 test_xmlNodeSetLang(void) {
22604     int test_ret = 0;
22605
22606 #if defined(LIBXML_TREE_ENABLED)
22607     int mem_base;
22608     xmlNodePtr cur; /* the node being changed */
22609     int n_cur;
22610     xmlChar * lang; /* the language description */
22611     int n_lang;
22612
22613     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22614     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22615         mem_base = xmlMemBlocks();
22616         cur = gen_xmlNodePtr(n_cur, 0);
22617         lang = gen_const_xmlChar_ptr(n_lang, 1);
22618
22619         xmlNodeSetLang(cur, (const xmlChar *)lang);
22620         call_tests++;
22621         des_xmlNodePtr(n_cur, cur, 0);
22622         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22623         xmlResetLastError();
22624         if (mem_base != xmlMemBlocks()) {
22625             printf("Leak of %d blocks found in xmlNodeSetLang",
22626                    xmlMemBlocks() - mem_base);
22627             test_ret++;
22628             printf(" %d", n_cur);
22629             printf(" %d", n_lang);
22630             printf("\n");
22631         }
22632     }
22633     }
22634     function_tests++;
22635 #endif
22636
22637     return(test_ret);
22638 }
22639
22640
22641 static int
22642 test_xmlNodeSetName(void) {
22643     int test_ret = 0;
22644
22645 #if defined(LIBXML_TREE_ENABLED)
22646     int mem_base;
22647     xmlNodePtr cur; /* the node being changed */
22648     int n_cur;
22649     xmlChar * name; /* the new tag name */
22650     int n_name;
22651
22652     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22653     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22654         mem_base = xmlMemBlocks();
22655         cur = gen_xmlNodePtr(n_cur, 0);
22656         name = gen_const_xmlChar_ptr(n_name, 1);
22657
22658         xmlNodeSetName(cur, (const xmlChar *)name);
22659         call_tests++;
22660         des_xmlNodePtr(n_cur, cur, 0);
22661         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22662         xmlResetLastError();
22663         if (mem_base != xmlMemBlocks()) {
22664             printf("Leak of %d blocks found in xmlNodeSetName",
22665                    xmlMemBlocks() - mem_base);
22666             test_ret++;
22667             printf(" %d", n_cur);
22668             printf(" %d", n_name);
22669             printf("\n");
22670         }
22671     }
22672     }
22673     function_tests++;
22674 #endif
22675
22676     return(test_ret);
22677 }
22678
22679
22680 static int
22681 test_xmlNodeSetSpacePreserve(void) {
22682     int test_ret = 0;
22683
22684 #if defined(LIBXML_TREE_ENABLED)
22685     int mem_base;
22686     xmlNodePtr cur; /* the node being changed */
22687     int n_cur;
22688     int val; /* the xml:space value ("0": default, 1: "preserve") */
22689     int n_val;
22690
22691     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22692     for (n_val = 0;n_val < gen_nb_int;n_val++) {
22693         mem_base = xmlMemBlocks();
22694         cur = gen_xmlNodePtr(n_cur, 0);
22695         val = gen_int(n_val, 1);
22696
22697         xmlNodeSetSpacePreserve(cur, val);
22698         call_tests++;
22699         des_xmlNodePtr(n_cur, cur, 0);
22700         des_int(n_val, val, 1);
22701         xmlResetLastError();
22702         if (mem_base != xmlMemBlocks()) {
22703             printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22704                    xmlMemBlocks() - mem_base);
22705             test_ret++;
22706             printf(" %d", n_cur);
22707             printf(" %d", n_val);
22708             printf("\n");
22709         }
22710     }
22711     }
22712     function_tests++;
22713 #endif
22714
22715     return(test_ret);
22716 }
22717
22718
22719 static int
22720 test_xmlPreviousElementSibling(void) {
22721     int test_ret = 0;
22722
22723 #if defined(LIBXML_TREE_ENABLED)
22724     int mem_base;
22725     xmlNodePtr ret_val;
22726     xmlNodePtr node; /* the current node */
22727     int n_node;
22728
22729     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22730         mem_base = xmlMemBlocks();
22731         node = gen_xmlNodePtr(n_node, 0);
22732
22733         ret_val = xmlPreviousElementSibling(node);
22734         desret_xmlNodePtr(ret_val);
22735         call_tests++;
22736         des_xmlNodePtr(n_node, node, 0);
22737         xmlResetLastError();
22738         if (mem_base != xmlMemBlocks()) {
22739             printf("Leak of %d blocks found in xmlPreviousElementSibling",
22740                    xmlMemBlocks() - mem_base);
22741             test_ret++;
22742             printf(" %d", n_node);
22743             printf("\n");
22744         }
22745     }
22746     function_tests++;
22747 #endif
22748
22749     return(test_ret);
22750 }
22751
22752
22753 static int
22754 test_xmlReconciliateNs(void) {
22755     int test_ret = 0;
22756
22757 #if defined(LIBXML_TREE_ENABLED)
22758 #ifdef LIBXML_TREE_ENABLED
22759     int mem_base;
22760     int ret_val;
22761     xmlDocPtr doc; /* the document */
22762     int n_doc;
22763     xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22764     int n_tree;
22765
22766     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22767     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22768         mem_base = xmlMemBlocks();
22769         doc = gen_xmlDocPtr(n_doc, 0);
22770         tree = gen_xmlNodePtr(n_tree, 1);
22771
22772         ret_val = xmlReconciliateNs(doc, tree);
22773         desret_int(ret_val);
22774         call_tests++;
22775         des_xmlDocPtr(n_doc, doc, 0);
22776         des_xmlNodePtr(n_tree, tree, 1);
22777         xmlResetLastError();
22778         if (mem_base != xmlMemBlocks()) {
22779             printf("Leak of %d blocks found in xmlReconciliateNs",
22780                    xmlMemBlocks() - mem_base);
22781             test_ret++;
22782             printf(" %d", n_doc);
22783             printf(" %d", n_tree);
22784             printf("\n");
22785         }
22786     }
22787     }
22788     function_tests++;
22789 #endif
22790 #endif
22791
22792     return(test_ret);
22793 }
22794
22795
22796 static int
22797 test_xmlRemoveProp(void) {
22798     int test_ret = 0;
22799
22800     int mem_base;
22801     int ret_val;
22802     xmlAttrPtr cur; /* an attribute */
22803     int n_cur;
22804
22805     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22806         mem_base = xmlMemBlocks();
22807         cur = gen_xmlAttrPtr(n_cur, 0);
22808
22809         ret_val = xmlRemoveProp(cur);
22810         cur = NULL;
22811         desret_int(ret_val);
22812         call_tests++;
22813         des_xmlAttrPtr(n_cur, cur, 0);
22814         xmlResetLastError();
22815         if (mem_base != xmlMemBlocks()) {
22816             printf("Leak of %d blocks found in xmlRemoveProp",
22817                    xmlMemBlocks() - mem_base);
22818             test_ret++;
22819             printf(" %d", n_cur);
22820             printf("\n");
22821         }
22822     }
22823     function_tests++;
22824
22825     return(test_ret);
22826 }
22827
22828
22829 static int
22830 test_xmlReplaceNode(void) {
22831     int test_ret = 0;
22832
22833 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22834     int mem_base;
22835     xmlNodePtr ret_val;
22836     xmlNodePtr old; /* the old node */
22837     int n_old;
22838     xmlNodePtr cur; /* the node */
22839     int n_cur;
22840
22841     for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22842     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22843         mem_base = xmlMemBlocks();
22844         old = gen_xmlNodePtr(n_old, 0);
22845         cur = gen_xmlNodePtr_in(n_cur, 1);
22846
22847         ret_val = xmlReplaceNode(old, cur);
22848         if (cur != NULL) {
22849               xmlUnlinkNode(cur);
22850               xmlFreeNode(cur) ; cur = NULL ; }
22851           if (old != NULL) {
22852               xmlUnlinkNode(old);
22853               xmlFreeNode(old) ; old = NULL ; }
22854           ret_val = NULL;
22855         desret_xmlNodePtr(ret_val);
22856         call_tests++;
22857         des_xmlNodePtr(n_old, old, 0);
22858         des_xmlNodePtr_in(n_cur, cur, 1);
22859         xmlResetLastError();
22860         if (mem_base != xmlMemBlocks()) {
22861             printf("Leak of %d blocks found in xmlReplaceNode",
22862                    xmlMemBlocks() - mem_base);
22863             test_ret++;
22864             printf(" %d", n_old);
22865             printf(" %d", n_cur);
22866             printf("\n");
22867         }
22868     }
22869     }
22870     function_tests++;
22871 #endif
22872
22873     return(test_ret);
22874 }
22875
22876
22877 static int
22878 test_xmlSaveFile(void) {
22879     int test_ret = 0;
22880
22881 #if defined(LIBXML_OUTPUT_ENABLED)
22882     int mem_base;
22883     int ret_val;
22884     const char * filename; /* the filename (or URL) */
22885     int n_filename;
22886     xmlDocPtr cur; /* the document */
22887     int n_cur;
22888
22889     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22890     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22891         mem_base = xmlMemBlocks();
22892         filename = gen_fileoutput(n_filename, 0);
22893         cur = gen_xmlDocPtr(n_cur, 1);
22894
22895         ret_val = xmlSaveFile(filename, cur);
22896         desret_int(ret_val);
22897         call_tests++;
22898         des_fileoutput(n_filename, filename, 0);
22899         des_xmlDocPtr(n_cur, cur, 1);
22900         xmlResetLastError();
22901         if (mem_base != xmlMemBlocks()) {
22902             printf("Leak of %d blocks found in xmlSaveFile",
22903                    xmlMemBlocks() - mem_base);
22904             test_ret++;
22905             printf(" %d", n_filename);
22906             printf(" %d", n_cur);
22907             printf("\n");
22908         }
22909     }
22910     }
22911     function_tests++;
22912 #endif
22913
22914     return(test_ret);
22915 }
22916
22917
22918 static int
22919 test_xmlSaveFileEnc(void) {
22920     int test_ret = 0;
22921
22922 #if defined(LIBXML_OUTPUT_ENABLED)
22923     int mem_base;
22924     int ret_val;
22925     const char * filename; /* the filename (or URL) */
22926     int n_filename;
22927     xmlDocPtr cur; /* the document */
22928     int n_cur;
22929     char * encoding; /* the name of an encoding (or NULL) */
22930     int n_encoding;
22931
22932     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22933     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22934     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22935         mem_base = xmlMemBlocks();
22936         filename = gen_fileoutput(n_filename, 0);
22937         cur = gen_xmlDocPtr(n_cur, 1);
22938         encoding = gen_const_char_ptr(n_encoding, 2);
22939
22940         ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22941         desret_int(ret_val);
22942         call_tests++;
22943         des_fileoutput(n_filename, filename, 0);
22944         des_xmlDocPtr(n_cur, cur, 1);
22945         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22946         xmlResetLastError();
22947         if (mem_base != xmlMemBlocks()) {
22948             printf("Leak of %d blocks found in xmlSaveFileEnc",
22949                    xmlMemBlocks() - mem_base);
22950             test_ret++;
22951             printf(" %d", n_filename);
22952             printf(" %d", n_cur);
22953             printf(" %d", n_encoding);
22954             printf("\n");
22955         }
22956     }
22957     }
22958     }
22959     function_tests++;
22960 #endif
22961
22962     return(test_ret);
22963 }
22964
22965
22966 static int
22967 test_xmlSaveFileTo(void) {
22968     int test_ret = 0;
22969
22970 #if defined(LIBXML_OUTPUT_ENABLED)
22971     int mem_base;
22972     int ret_val;
22973     xmlOutputBufferPtr buf; /* an output I/O buffer */
22974     int n_buf;
22975     xmlDocPtr cur; /* the document */
22976     int n_cur;
22977     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22978     int n_encoding;
22979
22980     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22981     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22982     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22983         mem_base = xmlMemBlocks();
22984         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22985         cur = gen_xmlDocPtr(n_cur, 1);
22986         encoding = gen_const_char_ptr(n_encoding, 2);
22987
22988         ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22989         buf = NULL;
22990         desret_int(ret_val);
22991         call_tests++;
22992         des_xmlOutputBufferPtr(n_buf, buf, 0);
22993         des_xmlDocPtr(n_cur, cur, 1);
22994         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22995         xmlResetLastError();
22996         if (mem_base != xmlMemBlocks()) {
22997             printf("Leak of %d blocks found in xmlSaveFileTo",
22998                    xmlMemBlocks() - mem_base);
22999             test_ret++;
23000             printf(" %d", n_buf);
23001             printf(" %d", n_cur);
23002             printf(" %d", n_encoding);
23003             printf("\n");
23004         }
23005     }
23006     }
23007     }
23008     function_tests++;
23009 #endif
23010
23011     return(test_ret);
23012 }
23013
23014
23015 static int
23016 test_xmlSaveFormatFile(void) {
23017     int test_ret = 0;
23018
23019 #if defined(LIBXML_OUTPUT_ENABLED)
23020     int mem_base;
23021     int ret_val;
23022     const char * filename; /* the filename (or URL) */
23023     int n_filename;
23024     xmlDocPtr cur; /* the document */
23025     int n_cur;
23026     int format; /* should formatting spaces been added */
23027     int n_format;
23028
23029     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23030     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23031     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23032         mem_base = xmlMemBlocks();
23033         filename = gen_fileoutput(n_filename, 0);
23034         cur = gen_xmlDocPtr(n_cur, 1);
23035         format = gen_int(n_format, 2);
23036
23037         ret_val = xmlSaveFormatFile(filename, cur, format);
23038         desret_int(ret_val);
23039         call_tests++;
23040         des_fileoutput(n_filename, filename, 0);
23041         des_xmlDocPtr(n_cur, cur, 1);
23042         des_int(n_format, format, 2);
23043         xmlResetLastError();
23044         if (mem_base != xmlMemBlocks()) {
23045             printf("Leak of %d blocks found in xmlSaveFormatFile",
23046                    xmlMemBlocks() - mem_base);
23047             test_ret++;
23048             printf(" %d", n_filename);
23049             printf(" %d", n_cur);
23050             printf(" %d", n_format);
23051             printf("\n");
23052         }
23053     }
23054     }
23055     }
23056     function_tests++;
23057 #endif
23058
23059     return(test_ret);
23060 }
23061
23062
23063 static int
23064 test_xmlSaveFormatFileEnc(void) {
23065     int test_ret = 0;
23066
23067 #if defined(LIBXML_OUTPUT_ENABLED)
23068     int mem_base;
23069     int ret_val;
23070     const char * filename; /* the filename or URL to output */
23071     int n_filename;
23072     xmlDocPtr cur; /* the document being saved */
23073     int n_cur;
23074     char * encoding; /* the name of the encoding to use or NULL. */
23075     int n_encoding;
23076     int format; /* should formatting spaces be added. */
23077     int n_format;
23078
23079     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23080     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23081     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23082     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23083         mem_base = xmlMemBlocks();
23084         filename = gen_fileoutput(n_filename, 0);
23085         cur = gen_xmlDocPtr(n_cur, 1);
23086         encoding = gen_const_char_ptr(n_encoding, 2);
23087         format = gen_int(n_format, 3);
23088
23089         ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23090         desret_int(ret_val);
23091         call_tests++;
23092         des_fileoutput(n_filename, filename, 0);
23093         des_xmlDocPtr(n_cur, cur, 1);
23094         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23095         des_int(n_format, format, 3);
23096         xmlResetLastError();
23097         if (mem_base != xmlMemBlocks()) {
23098             printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23099                    xmlMemBlocks() - mem_base);
23100             test_ret++;
23101             printf(" %d", n_filename);
23102             printf(" %d", n_cur);
23103             printf(" %d", n_encoding);
23104             printf(" %d", n_format);
23105             printf("\n");
23106         }
23107     }
23108     }
23109     }
23110     }
23111     function_tests++;
23112 #endif
23113
23114     return(test_ret);
23115 }
23116
23117
23118 static int
23119 test_xmlSaveFormatFileTo(void) {
23120     int test_ret = 0;
23121
23122 #if defined(LIBXML_OUTPUT_ENABLED)
23123     int mem_base;
23124     int ret_val;
23125     xmlOutputBufferPtr buf; /* an output I/O buffer */
23126     int n_buf;
23127     xmlDocPtr cur; /* the document */
23128     int n_cur;
23129     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23130     int n_encoding;
23131     int format; /* should formatting spaces been added */
23132     int n_format;
23133
23134     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23135     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23136     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23137     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23138         mem_base = xmlMemBlocks();
23139         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23140         cur = gen_xmlDocPtr(n_cur, 1);
23141         encoding = gen_const_char_ptr(n_encoding, 2);
23142         format = gen_int(n_format, 3);
23143
23144         ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23145         buf = NULL;
23146         desret_int(ret_val);
23147         call_tests++;
23148         des_xmlOutputBufferPtr(n_buf, buf, 0);
23149         des_xmlDocPtr(n_cur, cur, 1);
23150         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23151         des_int(n_format, format, 3);
23152         xmlResetLastError();
23153         if (mem_base != xmlMemBlocks()) {
23154             printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23155                    xmlMemBlocks() - mem_base);
23156             test_ret++;
23157             printf(" %d", n_buf);
23158             printf(" %d", n_cur);
23159             printf(" %d", n_encoding);
23160             printf(" %d", n_format);
23161             printf("\n");
23162         }
23163     }
23164     }
23165     }
23166     }
23167     function_tests++;
23168 #endif
23169
23170     return(test_ret);
23171 }
23172
23173
23174 static int
23175 test_xmlSearchNs(void) {
23176     int test_ret = 0;
23177
23178     int mem_base;
23179     xmlNsPtr ret_val;
23180     xmlDocPtr doc; /* the document */
23181     int n_doc;
23182     xmlNodePtr node; /* the current node */
23183     int n_node;
23184     xmlChar * nameSpace; /* the namespace prefix */
23185     int n_nameSpace;
23186
23187     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23188     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23189     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23190         mem_base = xmlMemBlocks();
23191         doc = gen_xmlDocPtr(n_doc, 0);
23192         node = gen_xmlNodePtr(n_node, 1);
23193         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23194
23195         ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23196         desret_xmlNsPtr(ret_val);
23197         call_tests++;
23198         des_xmlDocPtr(n_doc, doc, 0);
23199         des_xmlNodePtr(n_node, node, 1);
23200         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23201         xmlResetLastError();
23202         if (mem_base != xmlMemBlocks()) {
23203             printf("Leak of %d blocks found in xmlSearchNs",
23204                    xmlMemBlocks() - mem_base);
23205             test_ret++;
23206             printf(" %d", n_doc);
23207             printf(" %d", n_node);
23208             printf(" %d", n_nameSpace);
23209             printf("\n");
23210         }
23211     }
23212     }
23213     }
23214     function_tests++;
23215
23216     return(test_ret);
23217 }
23218
23219
23220 static int
23221 test_xmlSearchNsByHref(void) {
23222     int test_ret = 0;
23223
23224     int mem_base;
23225     xmlNsPtr ret_val;
23226     xmlDocPtr doc; /* the document */
23227     int n_doc;
23228     xmlNodePtr node; /* the current node */
23229     int n_node;
23230     xmlChar * href; /* the namespace value */
23231     int n_href;
23232
23233     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23234     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23235     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23236         mem_base = xmlMemBlocks();
23237         doc = gen_xmlDocPtr(n_doc, 0);
23238         node = gen_xmlNodePtr(n_node, 1);
23239         href = gen_const_xmlChar_ptr(n_href, 2);
23240
23241         ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23242         desret_xmlNsPtr(ret_val);
23243         call_tests++;
23244         des_xmlDocPtr(n_doc, doc, 0);
23245         des_xmlNodePtr(n_node, node, 1);
23246         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23247         xmlResetLastError();
23248         if (mem_base != xmlMemBlocks()) {
23249             printf("Leak of %d blocks found in xmlSearchNsByHref",
23250                    xmlMemBlocks() - mem_base);
23251             test_ret++;
23252             printf(" %d", n_doc);
23253             printf(" %d", n_node);
23254             printf(" %d", n_href);
23255             printf("\n");
23256         }
23257     }
23258     }
23259     }
23260     function_tests++;
23261
23262     return(test_ret);
23263 }
23264
23265
23266 static int
23267 test_xmlSetBufferAllocationScheme(void) {
23268     int test_ret = 0;
23269
23270     int mem_base;
23271     xmlBufferAllocationScheme scheme; /* allocation method to use */
23272     int n_scheme;
23273
23274     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23275         mem_base = xmlMemBlocks();
23276         scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23277
23278         xmlSetBufferAllocationScheme(scheme);
23279         call_tests++;
23280         des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23281         xmlResetLastError();
23282         if (mem_base != xmlMemBlocks()) {
23283             printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23284                    xmlMemBlocks() - mem_base);
23285             test_ret++;
23286             printf(" %d", n_scheme);
23287             printf("\n");
23288         }
23289     }
23290     function_tests++;
23291
23292     return(test_ret);
23293 }
23294
23295
23296 static int
23297 test_xmlSetCompressMode(void) {
23298     int test_ret = 0;
23299
23300     int mem_base;
23301     int mode; /* the compression ratio */
23302     int n_mode;
23303
23304     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23305         mem_base = xmlMemBlocks();
23306         mode = gen_int(n_mode, 0);
23307
23308         xmlSetCompressMode(mode);
23309         call_tests++;
23310         des_int(n_mode, mode, 0);
23311         xmlResetLastError();
23312         if (mem_base != xmlMemBlocks()) {
23313             printf("Leak of %d blocks found in xmlSetCompressMode",
23314                    xmlMemBlocks() - mem_base);
23315             test_ret++;
23316             printf(" %d", n_mode);
23317             printf("\n");
23318         }
23319     }
23320     function_tests++;
23321
23322     return(test_ret);
23323 }
23324
23325
23326 static int
23327 test_xmlSetDocCompressMode(void) {
23328     int test_ret = 0;
23329
23330     int mem_base;
23331     xmlDocPtr doc; /* the document */
23332     int n_doc;
23333     int mode; /* the compression ratio */
23334     int n_mode;
23335
23336     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23337     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23338         mem_base = xmlMemBlocks();
23339         doc = gen_xmlDocPtr(n_doc, 0);
23340         mode = gen_int(n_mode, 1);
23341
23342         xmlSetDocCompressMode(doc, mode);
23343         call_tests++;
23344         des_xmlDocPtr(n_doc, doc, 0);
23345         des_int(n_mode, mode, 1);
23346         xmlResetLastError();
23347         if (mem_base != xmlMemBlocks()) {
23348             printf("Leak of %d blocks found in xmlSetDocCompressMode",
23349                    xmlMemBlocks() - mem_base);
23350             test_ret++;
23351             printf(" %d", n_doc);
23352             printf(" %d", n_mode);
23353             printf("\n");
23354         }
23355     }
23356     }
23357     function_tests++;
23358
23359     return(test_ret);
23360 }
23361
23362
23363 static int
23364 test_xmlSetNs(void) {
23365     int test_ret = 0;
23366
23367     int mem_base;
23368     xmlNodePtr node; /* a node in the document */
23369     int n_node;
23370     xmlNsPtr ns; /* a namespace pointer */
23371     int n_ns;
23372
23373     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23374     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23375         mem_base = xmlMemBlocks();
23376         node = gen_xmlNodePtr(n_node, 0);
23377         ns = gen_xmlNsPtr(n_ns, 1);
23378
23379         xmlSetNs(node, ns);
23380         call_tests++;
23381         des_xmlNodePtr(n_node, node, 0);
23382         des_xmlNsPtr(n_ns, ns, 1);
23383         xmlResetLastError();
23384         if (mem_base != xmlMemBlocks()) {
23385             printf("Leak of %d blocks found in xmlSetNs",
23386                    xmlMemBlocks() - mem_base);
23387             test_ret++;
23388             printf(" %d", n_node);
23389             printf(" %d", n_ns);
23390             printf("\n");
23391         }
23392     }
23393     }
23394     function_tests++;
23395
23396     return(test_ret);
23397 }
23398
23399
23400 static int
23401 test_xmlSetNsProp(void) {
23402     int test_ret = 0;
23403
23404 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23405     int mem_base;
23406     xmlAttrPtr ret_val;
23407     xmlNodePtr node; /* the node */
23408     int n_node;
23409     xmlNsPtr ns; /* the namespace definition */
23410     int n_ns;
23411     xmlChar * name; /* the attribute name */
23412     int n_name;
23413     xmlChar * value; /* the attribute value */
23414     int n_value;
23415
23416     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23417     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23418     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23419     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23420         mem_base = xmlMemBlocks();
23421         node = gen_xmlNodePtr(n_node, 0);
23422         ns = gen_xmlNsPtr(n_ns, 1);
23423         name = gen_const_xmlChar_ptr(n_name, 2);
23424         value = gen_const_xmlChar_ptr(n_value, 3);
23425
23426         ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23427         desret_xmlAttrPtr(ret_val);
23428         call_tests++;
23429         des_xmlNodePtr(n_node, node, 0);
23430         des_xmlNsPtr(n_ns, ns, 1);
23431         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23432         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23433         xmlResetLastError();
23434         if (mem_base != xmlMemBlocks()) {
23435             printf("Leak of %d blocks found in xmlSetNsProp",
23436                    xmlMemBlocks() - mem_base);
23437             test_ret++;
23438             printf(" %d", n_node);
23439             printf(" %d", n_ns);
23440             printf(" %d", n_name);
23441             printf(" %d", n_value);
23442             printf("\n");
23443         }
23444     }
23445     }
23446     }
23447     }
23448     function_tests++;
23449 #endif
23450
23451     return(test_ret);
23452 }
23453
23454
23455 static int
23456 test_xmlSetProp(void) {
23457     int test_ret = 0;
23458
23459 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23460     int mem_base;
23461     xmlAttrPtr ret_val;
23462     xmlNodePtr node; /* the node */
23463     int n_node;
23464     xmlChar * name; /* the attribute name (a QName) */
23465     int n_name;
23466     xmlChar * value; /* the attribute value */
23467     int n_value;
23468
23469     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23470     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23471     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23472         mem_base = xmlMemBlocks();
23473         node = gen_xmlNodePtr(n_node, 0);
23474         name = gen_const_xmlChar_ptr(n_name, 1);
23475         value = gen_const_xmlChar_ptr(n_value, 2);
23476
23477         ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23478         desret_xmlAttrPtr(ret_val);
23479         call_tests++;
23480         des_xmlNodePtr(n_node, node, 0);
23481         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23482         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23483         xmlResetLastError();
23484         if (mem_base != xmlMemBlocks()) {
23485             printf("Leak of %d blocks found in xmlSetProp",
23486                    xmlMemBlocks() - mem_base);
23487             test_ret++;
23488             printf(" %d", n_node);
23489             printf(" %d", n_name);
23490             printf(" %d", n_value);
23491             printf("\n");
23492         }
23493     }
23494     }
23495     }
23496     function_tests++;
23497 #endif
23498
23499     return(test_ret);
23500 }
23501
23502
23503 static int
23504 test_xmlSplitQName2(void) {
23505     int test_ret = 0;
23506
23507     int mem_base;
23508     xmlChar * ret_val;
23509     xmlChar * name; /* the full QName */
23510     int n_name;
23511     xmlChar ** prefix; /* a xmlChar ** */
23512     int n_prefix;
23513
23514     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23515     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23516         mem_base = xmlMemBlocks();
23517         name = gen_const_xmlChar_ptr(n_name, 0);
23518         prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23519
23520         ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23521         desret_xmlChar_ptr(ret_val);
23522         call_tests++;
23523         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23524         des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23525         xmlResetLastError();
23526         if (mem_base != xmlMemBlocks()) {
23527             printf("Leak of %d blocks found in xmlSplitQName2",
23528                    xmlMemBlocks() - mem_base);
23529             test_ret++;
23530             printf(" %d", n_name);
23531             printf(" %d", n_prefix);
23532             printf("\n");
23533         }
23534     }
23535     }
23536     function_tests++;
23537
23538     return(test_ret);
23539 }
23540
23541
23542 static int
23543 test_xmlSplitQName3(void) {
23544     int test_ret = 0;
23545
23546     int mem_base;
23547     const xmlChar * ret_val;
23548     xmlChar * name; /* the full QName */
23549     int n_name;
23550     int * len; /* an int * */
23551     int n_len;
23552
23553     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23554     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23555         mem_base = xmlMemBlocks();
23556         name = gen_const_xmlChar_ptr(n_name, 0);
23557         len = gen_int_ptr(n_len, 1);
23558
23559         ret_val = xmlSplitQName3((const xmlChar *)name, len);
23560         desret_const_xmlChar_ptr(ret_val);
23561         call_tests++;
23562         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23563         des_int_ptr(n_len, len, 1);
23564         xmlResetLastError();
23565         if (mem_base != xmlMemBlocks()) {
23566             printf("Leak of %d blocks found in xmlSplitQName3",
23567                    xmlMemBlocks() - mem_base);
23568             test_ret++;
23569             printf(" %d", n_name);
23570             printf(" %d", n_len);
23571             printf("\n");
23572         }
23573     }
23574     }
23575     function_tests++;
23576
23577     return(test_ret);
23578 }
23579
23580
23581 static int
23582 test_xmlStringGetNodeList(void) {
23583     int test_ret = 0;
23584
23585     int mem_base;
23586     xmlNodePtr ret_val;
23587     xmlDocPtr doc; /* the document */
23588     int n_doc;
23589     xmlChar * value; /* the value of the attribute */
23590     int n_value;
23591
23592     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23593     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23594         mem_base = xmlMemBlocks();
23595         doc = gen_xmlDocPtr(n_doc, 0);
23596         value = gen_const_xmlChar_ptr(n_value, 1);
23597
23598         ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23599         desret_xmlNodePtr(ret_val);
23600         call_tests++;
23601         des_xmlDocPtr(n_doc, doc, 0);
23602         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23603         xmlResetLastError();
23604         if (mem_base != xmlMemBlocks()) {
23605             printf("Leak of %d blocks found in xmlStringGetNodeList",
23606                    xmlMemBlocks() - mem_base);
23607             test_ret++;
23608             printf(" %d", n_doc);
23609             printf(" %d", n_value);
23610             printf("\n");
23611         }
23612     }
23613     }
23614     function_tests++;
23615
23616     return(test_ret);
23617 }
23618
23619
23620 static int
23621 test_xmlStringLenGetNodeList(void) {
23622     int test_ret = 0;
23623
23624     int mem_base;
23625     xmlNodePtr ret_val;
23626     xmlDocPtr doc; /* the document */
23627     int n_doc;
23628     xmlChar * value; /* the value of the text */
23629     int n_value;
23630     int len; /* the length of the string value */
23631     int n_len;
23632
23633     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23634     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23635     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23636         mem_base = xmlMemBlocks();
23637         doc = gen_xmlDocPtr(n_doc, 0);
23638         value = gen_const_xmlChar_ptr(n_value, 1);
23639         len = gen_int(n_len, 2);
23640
23641         ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23642         desret_xmlNodePtr(ret_val);
23643         call_tests++;
23644         des_xmlDocPtr(n_doc, doc, 0);
23645         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23646         des_int(n_len, len, 2);
23647         xmlResetLastError();
23648         if (mem_base != xmlMemBlocks()) {
23649             printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23650                    xmlMemBlocks() - mem_base);
23651             test_ret++;
23652             printf(" %d", n_doc);
23653             printf(" %d", n_value);
23654             printf(" %d", n_len);
23655             printf("\n");
23656         }
23657     }
23658     }
23659     }
23660     function_tests++;
23661
23662     return(test_ret);
23663 }
23664
23665
23666 static int
23667 test_xmlTextConcat(void) {
23668     int test_ret = 0;
23669
23670     int mem_base;
23671     int ret_val;
23672     xmlNodePtr node; /* the node */
23673     int n_node;
23674     xmlChar * content; /* the content */
23675     int n_content;
23676     int len; /* @content length */
23677     int n_len;
23678
23679     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23680     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23681     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23682         mem_base = xmlMemBlocks();
23683         node = gen_xmlNodePtr(n_node, 0);
23684         content = gen_const_xmlChar_ptr(n_content, 1);
23685         len = gen_int(n_len, 2);
23686
23687         ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23688         desret_int(ret_val);
23689         call_tests++;
23690         des_xmlNodePtr(n_node, node, 0);
23691         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23692         des_int(n_len, len, 2);
23693         xmlResetLastError();
23694         if (mem_base != xmlMemBlocks()) {
23695             printf("Leak of %d blocks found in xmlTextConcat",
23696                    xmlMemBlocks() - mem_base);
23697             test_ret++;
23698             printf(" %d", n_node);
23699             printf(" %d", n_content);
23700             printf(" %d", n_len);
23701             printf("\n");
23702         }
23703     }
23704     }
23705     }
23706     function_tests++;
23707
23708     return(test_ret);
23709 }
23710
23711
23712 static int
23713 test_xmlTextMerge(void) {
23714     int test_ret = 0;
23715
23716     int mem_base;
23717     xmlNodePtr ret_val;
23718     xmlNodePtr first; /* the first text node */
23719     int n_first;
23720     xmlNodePtr second; /* the second text node being merged */
23721     int n_second;
23722
23723     for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23724     for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23725         mem_base = xmlMemBlocks();
23726         first = gen_xmlNodePtr_in(n_first, 0);
23727         second = gen_xmlNodePtr_in(n_second, 1);
23728
23729         ret_val = xmlTextMerge(first, second);
23730         if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23731               xmlUnlinkNode(second);
23732               xmlFreeNode(second) ; second = NULL ; }
23733         desret_xmlNodePtr(ret_val);
23734         call_tests++;
23735         des_xmlNodePtr_in(n_first, first, 0);
23736         des_xmlNodePtr_in(n_second, second, 1);
23737         xmlResetLastError();
23738         if (mem_base != xmlMemBlocks()) {
23739             printf("Leak of %d blocks found in xmlTextMerge",
23740                    xmlMemBlocks() - mem_base);
23741             test_ret++;
23742             printf(" %d", n_first);
23743             printf(" %d", n_second);
23744             printf("\n");
23745         }
23746     }
23747     }
23748     function_tests++;
23749
23750     return(test_ret);
23751 }
23752
23753
23754 static int
23755 test_xmlUnsetNsProp(void) {
23756     int test_ret = 0;
23757
23758 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23759     int mem_base;
23760     int ret_val;
23761     xmlNodePtr node; /* the node */
23762     int n_node;
23763     xmlNsPtr ns; /* the namespace definition */
23764     int n_ns;
23765     xmlChar * name; /* the attribute name */
23766     int n_name;
23767
23768     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23769     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23770     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23771         mem_base = xmlMemBlocks();
23772         node = gen_xmlNodePtr(n_node, 0);
23773         ns = gen_xmlNsPtr(n_ns, 1);
23774         name = gen_const_xmlChar_ptr(n_name, 2);
23775
23776         ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23777         desret_int(ret_val);
23778         call_tests++;
23779         des_xmlNodePtr(n_node, node, 0);
23780         des_xmlNsPtr(n_ns, ns, 1);
23781         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23782         xmlResetLastError();
23783         if (mem_base != xmlMemBlocks()) {
23784             printf("Leak of %d blocks found in xmlUnsetNsProp",
23785                    xmlMemBlocks() - mem_base);
23786             test_ret++;
23787             printf(" %d", n_node);
23788             printf(" %d", n_ns);
23789             printf(" %d", n_name);
23790             printf("\n");
23791         }
23792     }
23793     }
23794     }
23795     function_tests++;
23796 #endif
23797
23798     return(test_ret);
23799 }
23800
23801
23802 static int
23803 test_xmlUnsetProp(void) {
23804     int test_ret = 0;
23805
23806 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23807     int mem_base;
23808     int ret_val;
23809     xmlNodePtr node; /* the node */
23810     int n_node;
23811     xmlChar * name; /* the attribute name */
23812     int n_name;
23813
23814     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23815     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23816         mem_base = xmlMemBlocks();
23817         node = gen_xmlNodePtr(n_node, 0);
23818         name = gen_const_xmlChar_ptr(n_name, 1);
23819
23820         ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23821         desret_int(ret_val);
23822         call_tests++;
23823         des_xmlNodePtr(n_node, node, 0);
23824         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23825         xmlResetLastError();
23826         if (mem_base != xmlMemBlocks()) {
23827             printf("Leak of %d blocks found in xmlUnsetProp",
23828                    xmlMemBlocks() - mem_base);
23829             test_ret++;
23830             printf(" %d", n_node);
23831             printf(" %d", n_name);
23832             printf("\n");
23833         }
23834     }
23835     }
23836     function_tests++;
23837 #endif
23838
23839     return(test_ret);
23840 }
23841
23842
23843 static int
23844 test_xmlValidateNCName(void) {
23845     int test_ret = 0;
23846
23847 #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)
23848 #ifdef LIBXML_TREE_ENABLED
23849     int mem_base;
23850     int ret_val;
23851     xmlChar * value; /* the value to check */
23852     int n_value;
23853     int space; /* allow spaces in front and end of the string */
23854     int n_space;
23855
23856     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23857     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23858         mem_base = xmlMemBlocks();
23859         value = gen_const_xmlChar_ptr(n_value, 0);
23860         space = gen_int(n_space, 1);
23861
23862         ret_val = xmlValidateNCName((const xmlChar *)value, space);
23863         desret_int(ret_val);
23864         call_tests++;
23865         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23866         des_int(n_space, space, 1);
23867         xmlResetLastError();
23868         if (mem_base != xmlMemBlocks()) {
23869             printf("Leak of %d blocks found in xmlValidateNCName",
23870                    xmlMemBlocks() - mem_base);
23871             test_ret++;
23872             printf(" %d", n_value);
23873             printf(" %d", n_space);
23874             printf("\n");
23875         }
23876     }
23877     }
23878     function_tests++;
23879 #endif
23880 #endif
23881
23882     return(test_ret);
23883 }
23884
23885
23886 static int
23887 test_xmlValidateNMToken(void) {
23888     int test_ret = 0;
23889
23890 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23891 #ifdef LIBXML_TREE_ENABLED
23892     int mem_base;
23893     int ret_val;
23894     xmlChar * value; /* the value to check */
23895     int n_value;
23896     int space; /* allow spaces in front and end of the string */
23897     int n_space;
23898
23899     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23900     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23901         mem_base = xmlMemBlocks();
23902         value = gen_const_xmlChar_ptr(n_value, 0);
23903         space = gen_int(n_space, 1);
23904
23905         ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23906         desret_int(ret_val);
23907         call_tests++;
23908         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23909         des_int(n_space, space, 1);
23910         xmlResetLastError();
23911         if (mem_base != xmlMemBlocks()) {
23912             printf("Leak of %d blocks found in xmlValidateNMToken",
23913                    xmlMemBlocks() - mem_base);
23914             test_ret++;
23915             printf(" %d", n_value);
23916             printf(" %d", n_space);
23917             printf("\n");
23918         }
23919     }
23920     }
23921     function_tests++;
23922 #endif
23923 #endif
23924
23925     return(test_ret);
23926 }
23927
23928
23929 static int
23930 test_xmlValidateName(void) {
23931     int test_ret = 0;
23932
23933 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23934 #ifdef LIBXML_TREE_ENABLED
23935     int mem_base;
23936     int ret_val;
23937     xmlChar * value; /* the value to check */
23938     int n_value;
23939     int space; /* allow spaces in front and end of the string */
23940     int n_space;
23941
23942     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23943     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23944         mem_base = xmlMemBlocks();
23945         value = gen_const_xmlChar_ptr(n_value, 0);
23946         space = gen_int(n_space, 1);
23947
23948         ret_val = xmlValidateName((const xmlChar *)value, space);
23949         desret_int(ret_val);
23950         call_tests++;
23951         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23952         des_int(n_space, space, 1);
23953         xmlResetLastError();
23954         if (mem_base != xmlMemBlocks()) {
23955             printf("Leak of %d blocks found in xmlValidateName",
23956                    xmlMemBlocks() - mem_base);
23957             test_ret++;
23958             printf(" %d", n_value);
23959             printf(" %d", n_space);
23960             printf("\n");
23961         }
23962     }
23963     }
23964     function_tests++;
23965 #endif
23966 #endif
23967
23968     return(test_ret);
23969 }
23970
23971
23972 static int
23973 test_xmlValidateQName(void) {
23974     int test_ret = 0;
23975
23976 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23977 #ifdef LIBXML_TREE_ENABLED
23978     int mem_base;
23979     int ret_val;
23980     xmlChar * value; /* the value to check */
23981     int n_value;
23982     int space; /* allow spaces in front and end of the string */
23983     int n_space;
23984
23985     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23986     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23987         mem_base = xmlMemBlocks();
23988         value = gen_const_xmlChar_ptr(n_value, 0);
23989         space = gen_int(n_space, 1);
23990
23991         ret_val = xmlValidateQName((const xmlChar *)value, space);
23992         desret_int(ret_val);
23993         call_tests++;
23994         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23995         des_int(n_space, space, 1);
23996         xmlResetLastError();
23997         if (mem_base != xmlMemBlocks()) {
23998             printf("Leak of %d blocks found in xmlValidateQName",
23999                    xmlMemBlocks() - mem_base);
24000             test_ret++;
24001             printf(" %d", n_value);
24002             printf(" %d", n_space);
24003             printf("\n");
24004         }
24005     }
24006     }
24007     function_tests++;
24008 #endif
24009 #endif
24010
24011     return(test_ret);
24012 }
24013
24014 static int
24015 test_tree(void) {
24016     int test_ret = 0;
24017
24018     if (quiet == 0) printf("Testing tree : 139 of 158 functions ...\n");
24019     test_ret += test_xmlAddChild();
24020     test_ret += test_xmlAddChildList();
24021     test_ret += test_xmlAddNextSibling();
24022     test_ret += test_xmlAddPrevSibling();
24023     test_ret += test_xmlAddSibling();
24024     test_ret += test_xmlAttrSerializeTxtContent();
24025     test_ret += test_xmlBufferAdd();
24026     test_ret += test_xmlBufferAddHead();
24027     test_ret += test_xmlBufferCCat();
24028     test_ret += test_xmlBufferCat();
24029     test_ret += test_xmlBufferContent();
24030     test_ret += test_xmlBufferCreate();
24031     test_ret += test_xmlBufferCreateSize();
24032     test_ret += test_xmlBufferCreateStatic();
24033     test_ret += test_xmlBufferDetach();
24034     test_ret += test_xmlBufferEmpty();
24035     test_ret += test_xmlBufferGrow();
24036     test_ret += test_xmlBufferLength();
24037     test_ret += test_xmlBufferResize();
24038     test_ret += test_xmlBufferSetAllocationScheme();
24039     test_ret += test_xmlBufferShrink();
24040     test_ret += test_xmlBufferWriteCHAR();
24041     test_ret += test_xmlBufferWriteChar();
24042     test_ret += test_xmlBufferWriteQuotedString();
24043     test_ret += test_xmlBuildQName();
24044     test_ret += test_xmlChildElementCount();
24045     test_ret += test_xmlCopyDoc();
24046     test_ret += test_xmlCopyDtd();
24047     test_ret += test_xmlCopyNamespace();
24048     test_ret += test_xmlCopyNamespaceList();
24049     test_ret += test_xmlCopyNode();
24050     test_ret += test_xmlCopyNodeList();
24051     test_ret += test_xmlCopyProp();
24052     test_ret += test_xmlCopyPropList();
24053     test_ret += test_xmlCreateIntSubset();
24054     test_ret += test_xmlDOMWrapAdoptNode();
24055     test_ret += test_xmlDOMWrapCloneNode();
24056     test_ret += test_xmlDOMWrapNewCtxt();
24057     test_ret += test_xmlDOMWrapReconcileNamespaces();
24058     test_ret += test_xmlDOMWrapRemoveNode();
24059     test_ret += test_xmlDocCopyNode();
24060     test_ret += test_xmlDocCopyNodeList();
24061     test_ret += test_xmlDocDump();
24062     test_ret += test_xmlDocDumpFormatMemory();
24063     test_ret += test_xmlDocDumpFormatMemoryEnc();
24064     test_ret += test_xmlDocDumpMemory();
24065     test_ret += test_xmlDocDumpMemoryEnc();
24066     test_ret += test_xmlDocFormatDump();
24067     test_ret += test_xmlDocGetRootElement();
24068     test_ret += test_xmlDocSetRootElement();
24069     test_ret += test_xmlElemDump();
24070     test_ret += test_xmlFirstElementChild();
24071     test_ret += test_xmlGetBufferAllocationScheme();
24072     test_ret += test_xmlGetCompressMode();
24073     test_ret += test_xmlGetDocCompressMode();
24074     test_ret += test_xmlGetIntSubset();
24075     test_ret += test_xmlGetLastChild();
24076     test_ret += test_xmlGetLineNo();
24077     test_ret += test_xmlGetNoNsProp();
24078     test_ret += test_xmlGetNodePath();
24079     test_ret += test_xmlGetNsList();
24080     test_ret += test_xmlGetNsProp();
24081     test_ret += test_xmlGetProp();
24082     test_ret += test_xmlHasNsProp();
24083     test_ret += test_xmlHasProp();
24084     test_ret += test_xmlIsBlankNode();
24085     test_ret += test_xmlIsXHTML();
24086     test_ret += test_xmlLastElementChild();
24087     test_ret += test_xmlNewCDataBlock();
24088     test_ret += test_xmlNewCharRef();
24089     test_ret += test_xmlNewChild();
24090     test_ret += test_xmlNewComment();
24091     test_ret += test_xmlNewDoc();
24092     test_ret += test_xmlNewDocComment();
24093     test_ret += test_xmlNewDocFragment();
24094     test_ret += test_xmlNewDocNode();
24095     test_ret += test_xmlNewDocNodeEatName();
24096     test_ret += test_xmlNewDocPI();
24097     test_ret += test_xmlNewDocProp();
24098     test_ret += test_xmlNewDocRawNode();
24099     test_ret += test_xmlNewDocText();
24100     test_ret += test_xmlNewDocTextLen();
24101     test_ret += test_xmlNewDtd();
24102     test_ret += test_xmlNewNode();
24103     test_ret += test_xmlNewNodeEatName();
24104     test_ret += test_xmlNewNs();
24105     test_ret += test_xmlNewNsProp();
24106     test_ret += test_xmlNewNsPropEatName();
24107     test_ret += test_xmlNewPI();
24108     test_ret += test_xmlNewProp();
24109     test_ret += test_xmlNewReference();
24110     test_ret += test_xmlNewText();
24111     test_ret += test_xmlNewTextChild();
24112     test_ret += test_xmlNewTextLen();
24113     test_ret += test_xmlNextElementSibling();
24114     test_ret += test_xmlNodeAddContent();
24115     test_ret += test_xmlNodeAddContentLen();
24116     test_ret += test_xmlNodeBufGetContent();
24117     test_ret += test_xmlNodeDump();
24118     test_ret += test_xmlNodeDumpOutput();
24119     test_ret += test_xmlNodeGetBase();
24120     test_ret += test_xmlNodeGetContent();
24121     test_ret += test_xmlNodeGetLang();
24122     test_ret += test_xmlNodeGetSpacePreserve();
24123     test_ret += test_xmlNodeIsText();
24124     test_ret += test_xmlNodeListGetRawString();
24125     test_ret += test_xmlNodeListGetString();
24126     test_ret += test_xmlNodeSetBase();
24127     test_ret += test_xmlNodeSetContent();
24128     test_ret += test_xmlNodeSetContentLen();
24129     test_ret += test_xmlNodeSetLang();
24130     test_ret += test_xmlNodeSetName();
24131     test_ret += test_xmlNodeSetSpacePreserve();
24132     test_ret += test_xmlPreviousElementSibling();
24133     test_ret += test_xmlReconciliateNs();
24134     test_ret += test_xmlRemoveProp();
24135     test_ret += test_xmlReplaceNode();
24136     test_ret += test_xmlSaveFile();
24137     test_ret += test_xmlSaveFileEnc();
24138     test_ret += test_xmlSaveFileTo();
24139     test_ret += test_xmlSaveFormatFile();
24140     test_ret += test_xmlSaveFormatFileEnc();
24141     test_ret += test_xmlSaveFormatFileTo();
24142     test_ret += test_xmlSearchNs();
24143     test_ret += test_xmlSearchNsByHref();
24144     test_ret += test_xmlSetBufferAllocationScheme();
24145     test_ret += test_xmlSetCompressMode();
24146     test_ret += test_xmlSetDocCompressMode();
24147     test_ret += test_xmlSetNs();
24148     test_ret += test_xmlSetNsProp();
24149     test_ret += test_xmlSetProp();
24150     test_ret += test_xmlSplitQName2();
24151     test_ret += test_xmlSplitQName3();
24152     test_ret += test_xmlStringGetNodeList();
24153     test_ret += test_xmlStringLenGetNodeList();
24154     test_ret += test_xmlTextConcat();
24155     test_ret += test_xmlTextMerge();
24156     test_ret += test_xmlUnsetNsProp();
24157     test_ret += test_xmlUnsetProp();
24158     test_ret += test_xmlValidateNCName();
24159     test_ret += test_xmlValidateNMToken();
24160     test_ret += test_xmlValidateName();
24161     test_ret += test_xmlValidateQName();
24162
24163     if (test_ret != 0)
24164         printf("Module tree: %d errors\n", test_ret);
24165     return(test_ret);
24166 }
24167
24168 static int
24169 test_xmlBuildRelativeURI(void) {
24170     int test_ret = 0;
24171
24172     int mem_base;
24173     xmlChar * ret_val;
24174     xmlChar * URI; /* the URI reference under consideration */
24175     int n_URI;
24176     xmlChar * base; /* the base value */
24177     int n_base;
24178
24179     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24180     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24181         mem_base = xmlMemBlocks();
24182         URI = gen_const_xmlChar_ptr(n_URI, 0);
24183         base = gen_const_xmlChar_ptr(n_base, 1);
24184
24185         ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24186         desret_xmlChar_ptr(ret_val);
24187         call_tests++;
24188         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24189         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24190         xmlResetLastError();
24191         if (mem_base != xmlMemBlocks()) {
24192             printf("Leak of %d blocks found in xmlBuildRelativeURI",
24193                    xmlMemBlocks() - mem_base);
24194             test_ret++;
24195             printf(" %d", n_URI);
24196             printf(" %d", n_base);
24197             printf("\n");
24198         }
24199     }
24200     }
24201     function_tests++;
24202
24203     return(test_ret);
24204 }
24205
24206
24207 static int
24208 test_xmlBuildURI(void) {
24209     int test_ret = 0;
24210
24211     int mem_base;
24212     xmlChar * ret_val;
24213     xmlChar * URI; /* the URI instance found in the document */
24214     int n_URI;
24215     xmlChar * base; /* the base value */
24216     int n_base;
24217
24218     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24219     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24220         mem_base = xmlMemBlocks();
24221         URI = gen_const_xmlChar_ptr(n_URI, 0);
24222         base = gen_const_xmlChar_ptr(n_base, 1);
24223
24224         ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24225         desret_xmlChar_ptr(ret_val);
24226         call_tests++;
24227         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24228         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24229         xmlResetLastError();
24230         if (mem_base != xmlMemBlocks()) {
24231             printf("Leak of %d blocks found in xmlBuildURI",
24232                    xmlMemBlocks() - mem_base);
24233             test_ret++;
24234             printf(" %d", n_URI);
24235             printf(" %d", n_base);
24236             printf("\n");
24237         }
24238     }
24239     }
24240     function_tests++;
24241
24242     return(test_ret);
24243 }
24244
24245
24246 static int
24247 test_xmlCanonicPath(void) {
24248     int test_ret = 0;
24249
24250     int mem_base;
24251     xmlChar * ret_val;
24252     xmlChar * path; /* the resource locator in a filesystem notation */
24253     int n_path;
24254
24255     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24256         mem_base = xmlMemBlocks();
24257         path = gen_const_xmlChar_ptr(n_path, 0);
24258
24259         ret_val = xmlCanonicPath((const xmlChar *)path);
24260         desret_xmlChar_ptr(ret_val);
24261         call_tests++;
24262         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24263         xmlResetLastError();
24264         if (mem_base != xmlMemBlocks()) {
24265             printf("Leak of %d blocks found in xmlCanonicPath",
24266                    xmlMemBlocks() - mem_base);
24267             test_ret++;
24268             printf(" %d", n_path);
24269             printf("\n");
24270         }
24271     }
24272     function_tests++;
24273
24274     return(test_ret);
24275 }
24276
24277
24278 static int
24279 test_xmlCreateURI(void) {
24280     int test_ret = 0;
24281
24282
24283     /* missing type support */
24284     return(test_ret);
24285 }
24286
24287
24288 static int
24289 test_xmlNormalizeURIPath(void) {
24290     int test_ret = 0;
24291
24292     int mem_base;
24293     int ret_val;
24294     char * path; /* pointer to the path string */
24295     int n_path;
24296
24297     for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24298         mem_base = xmlMemBlocks();
24299         path = gen_char_ptr(n_path, 0);
24300
24301         ret_val = xmlNormalizeURIPath(path);
24302         desret_int(ret_val);
24303         call_tests++;
24304         des_char_ptr(n_path, path, 0);
24305         xmlResetLastError();
24306         if (mem_base != xmlMemBlocks()) {
24307             printf("Leak of %d blocks found in xmlNormalizeURIPath",
24308                    xmlMemBlocks() - mem_base);
24309             test_ret++;
24310             printf(" %d", n_path);
24311             printf("\n");
24312         }
24313     }
24314     function_tests++;
24315
24316     return(test_ret);
24317 }
24318
24319
24320 static int
24321 test_xmlParseURI(void) {
24322     int test_ret = 0;
24323
24324
24325     /* missing type support */
24326     return(test_ret);
24327 }
24328
24329
24330 static int
24331 test_xmlParseURIRaw(void) {
24332     int test_ret = 0;
24333
24334
24335     /* missing type support */
24336     return(test_ret);
24337 }
24338
24339
24340 #define gen_nb_xmlURIPtr 1
24341 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24342     return(NULL);
24343 }
24344 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24345 }
24346
24347 static int
24348 test_xmlParseURIReference(void) {
24349     int test_ret = 0;
24350
24351     int mem_base;
24352     int ret_val;
24353     xmlURIPtr uri; /* pointer to an URI structure */
24354     int n_uri;
24355     char * str; /* the string to analyze */
24356     int n_str;
24357
24358     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24359     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24360         mem_base = xmlMemBlocks();
24361         uri = gen_xmlURIPtr(n_uri, 0);
24362         str = gen_const_char_ptr(n_str, 1);
24363
24364         ret_val = xmlParseURIReference(uri, (const char *)str);
24365         desret_int(ret_val);
24366         call_tests++;
24367         des_xmlURIPtr(n_uri, uri, 0);
24368         des_const_char_ptr(n_str, (const char *)str, 1);
24369         xmlResetLastError();
24370         if (mem_base != xmlMemBlocks()) {
24371             printf("Leak of %d blocks found in xmlParseURIReference",
24372                    xmlMemBlocks() - mem_base);
24373             test_ret++;
24374             printf(" %d", n_uri);
24375             printf(" %d", n_str);
24376             printf("\n");
24377         }
24378     }
24379     }
24380     function_tests++;
24381
24382     return(test_ret);
24383 }
24384
24385
24386 static int
24387 test_xmlPathToURI(void) {
24388     int test_ret = 0;
24389
24390     int mem_base;
24391     xmlChar * ret_val;
24392     xmlChar * path; /* the resource locator in a filesystem notation */
24393     int n_path;
24394
24395     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24396         mem_base = xmlMemBlocks();
24397         path = gen_const_xmlChar_ptr(n_path, 0);
24398
24399         ret_val = xmlPathToURI((const xmlChar *)path);
24400         desret_xmlChar_ptr(ret_val);
24401         call_tests++;
24402         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24403         xmlResetLastError();
24404         if (mem_base != xmlMemBlocks()) {
24405             printf("Leak of %d blocks found in xmlPathToURI",
24406                    xmlMemBlocks() - mem_base);
24407             test_ret++;
24408             printf(" %d", n_path);
24409             printf("\n");
24410         }
24411     }
24412     function_tests++;
24413
24414     return(test_ret);
24415 }
24416
24417
24418 static int
24419 test_xmlPrintURI(void) {
24420     int test_ret = 0;
24421
24422     int mem_base;
24423     FILE * stream; /* a FILE* for the output */
24424     int n_stream;
24425     xmlURIPtr uri; /* pointer to an xmlURI */
24426     int n_uri;
24427
24428     for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24429     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24430         mem_base = xmlMemBlocks();
24431         stream = gen_FILE_ptr(n_stream, 0);
24432         uri = gen_xmlURIPtr(n_uri, 1);
24433
24434         xmlPrintURI(stream, uri);
24435         call_tests++;
24436         des_FILE_ptr(n_stream, stream, 0);
24437         des_xmlURIPtr(n_uri, uri, 1);
24438         xmlResetLastError();
24439         if (mem_base != xmlMemBlocks()) {
24440             printf("Leak of %d blocks found in xmlPrintURI",
24441                    xmlMemBlocks() - mem_base);
24442             test_ret++;
24443             printf(" %d", n_stream);
24444             printf(" %d", n_uri);
24445             printf("\n");
24446         }
24447     }
24448     }
24449     function_tests++;
24450
24451     return(test_ret);
24452 }
24453
24454
24455 static int
24456 test_xmlSaveUri(void) {
24457     int test_ret = 0;
24458
24459     int mem_base;
24460     xmlChar * ret_val;
24461     xmlURIPtr uri; /* pointer to an xmlURI */
24462     int n_uri;
24463
24464     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24465         mem_base = xmlMemBlocks();
24466         uri = gen_xmlURIPtr(n_uri, 0);
24467
24468         ret_val = xmlSaveUri(uri);
24469         desret_xmlChar_ptr(ret_val);
24470         call_tests++;
24471         des_xmlURIPtr(n_uri, uri, 0);
24472         xmlResetLastError();
24473         if (mem_base != xmlMemBlocks()) {
24474             printf("Leak of %d blocks found in xmlSaveUri",
24475                    xmlMemBlocks() - mem_base);
24476             test_ret++;
24477             printf(" %d", n_uri);
24478             printf("\n");
24479         }
24480     }
24481     function_tests++;
24482
24483     return(test_ret);
24484 }
24485
24486
24487 static int
24488 test_xmlURIEscape(void) {
24489     int test_ret = 0;
24490
24491     int mem_base;
24492     xmlChar * ret_val;
24493     xmlChar * str; /* the string of the URI to escape */
24494     int n_str;
24495
24496     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24497         mem_base = xmlMemBlocks();
24498         str = gen_const_xmlChar_ptr(n_str, 0);
24499
24500         ret_val = xmlURIEscape((const xmlChar *)str);
24501         desret_xmlChar_ptr(ret_val);
24502         call_tests++;
24503         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24504         xmlResetLastError();
24505         if (mem_base != xmlMemBlocks()) {
24506             printf("Leak of %d blocks found in xmlURIEscape",
24507                    xmlMemBlocks() - mem_base);
24508             test_ret++;
24509             printf(" %d", n_str);
24510             printf("\n");
24511         }
24512     }
24513     function_tests++;
24514
24515     return(test_ret);
24516 }
24517
24518
24519 static int
24520 test_xmlURIEscapeStr(void) {
24521     int test_ret = 0;
24522
24523     int mem_base;
24524     xmlChar * ret_val;
24525     xmlChar * str; /* string to escape */
24526     int n_str;
24527     xmlChar * list; /* exception list string of chars not to escape */
24528     int n_list;
24529
24530     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24531     for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24532         mem_base = xmlMemBlocks();
24533         str = gen_const_xmlChar_ptr(n_str, 0);
24534         list = gen_const_xmlChar_ptr(n_list, 1);
24535
24536         ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24537         desret_xmlChar_ptr(ret_val);
24538         call_tests++;
24539         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24540         des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24541         xmlResetLastError();
24542         if (mem_base != xmlMemBlocks()) {
24543             printf("Leak of %d blocks found in xmlURIEscapeStr",
24544                    xmlMemBlocks() - mem_base);
24545             test_ret++;
24546             printf(" %d", n_str);
24547             printf(" %d", n_list);
24548             printf("\n");
24549         }
24550     }
24551     }
24552     function_tests++;
24553
24554     return(test_ret);
24555 }
24556
24557
24558 static int
24559 test_xmlURIUnescapeString(void) {
24560     int test_ret = 0;
24561
24562
24563     /* missing type support */
24564     return(test_ret);
24565 }
24566
24567 static int
24568 test_uri(void) {
24569     int test_ret = 0;
24570
24571     if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24572     test_ret += test_xmlBuildRelativeURI();
24573     test_ret += test_xmlBuildURI();
24574     test_ret += test_xmlCanonicPath();
24575     test_ret += test_xmlCreateURI();
24576     test_ret += test_xmlNormalizeURIPath();
24577     test_ret += test_xmlParseURI();
24578     test_ret += test_xmlParseURIRaw();
24579     test_ret += test_xmlParseURIReference();
24580     test_ret += test_xmlPathToURI();
24581     test_ret += test_xmlPrintURI();
24582     test_ret += test_xmlSaveUri();
24583     test_ret += test_xmlURIEscape();
24584     test_ret += test_xmlURIEscapeStr();
24585     test_ret += test_xmlURIUnescapeString();
24586
24587     if (test_ret != 0)
24588         printf("Module uri: %d errors\n", test_ret);
24589     return(test_ret);
24590 }
24591
24592 static int
24593 test_xmlAddAttributeDecl(void) {
24594     int test_ret = 0;
24595
24596     int mem_base;
24597     xmlAttributePtr ret_val;
24598     xmlValidCtxtPtr ctxt; /* the validation context */
24599     int n_ctxt;
24600     xmlDtdPtr dtd; /* pointer to the DTD */
24601     int n_dtd;
24602     xmlChar * elem; /* the element name */
24603     int n_elem;
24604     xmlChar * name; /* the attribute name */
24605     int n_name;
24606     xmlChar * ns; /* the attribute namespace prefix */
24607     int n_ns;
24608     xmlAttributeType type; /* the attribute type */
24609     int n_type;
24610     xmlAttributeDefault def; /* the attribute default type */
24611     int n_def;
24612     xmlChar * defaultValue; /* the attribute default value */
24613     int n_defaultValue;
24614     xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24615     int n_tree;
24616
24617     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24618     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24619     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24620     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24621     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24622     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24623     for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24624     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24625     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24626         mem_base = xmlMemBlocks();
24627         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24628         dtd = gen_xmlDtdPtr(n_dtd, 1);
24629         elem = gen_const_xmlChar_ptr(n_elem, 2);
24630         name = gen_const_xmlChar_ptr(n_name, 3);
24631         ns = gen_const_xmlChar_ptr(n_ns, 4);
24632         type = gen_xmlAttributeType(n_type, 5);
24633         def = gen_xmlAttributeDefault(n_def, 6);
24634         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24635         tree = gen_xmlEnumerationPtr(n_tree, 8);
24636
24637         ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24638         desret_xmlAttributePtr(ret_val);
24639         call_tests++;
24640         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24641         des_xmlDtdPtr(n_dtd, dtd, 1);
24642         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24643         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24644         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24645         des_xmlAttributeType(n_type, type, 5);
24646         des_xmlAttributeDefault(n_def, def, 6);
24647         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24648         des_xmlEnumerationPtr(n_tree, tree, 8);
24649         xmlResetLastError();
24650         if (mem_base != xmlMemBlocks()) {
24651             printf("Leak of %d blocks found in xmlAddAttributeDecl",
24652                    xmlMemBlocks() - mem_base);
24653             test_ret++;
24654             printf(" %d", n_ctxt);
24655             printf(" %d", n_dtd);
24656             printf(" %d", n_elem);
24657             printf(" %d", n_name);
24658             printf(" %d", n_ns);
24659             printf(" %d", n_type);
24660             printf(" %d", n_def);
24661             printf(" %d", n_defaultValue);
24662             printf(" %d", n_tree);
24663             printf("\n");
24664         }
24665     }
24666     }
24667     }
24668     }
24669     }
24670     }
24671     }
24672     }
24673     }
24674     function_tests++;
24675
24676     return(test_ret);
24677 }
24678
24679
24680 static int
24681 test_xmlAddElementDecl(void) {
24682     int test_ret = 0;
24683
24684     int mem_base;
24685     xmlElementPtr ret_val;
24686     xmlValidCtxtPtr ctxt; /* the validation context */
24687     int n_ctxt;
24688     xmlDtdPtr dtd; /* pointer to the DTD */
24689     int n_dtd;
24690     xmlChar * name; /* the entity name */
24691     int n_name;
24692     xmlElementTypeVal type; /* the element type */
24693     int n_type;
24694     xmlElementContentPtr content; /* the element content tree or NULL */
24695     int n_content;
24696
24697     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24698     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24699     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24700     for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24701     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24702         mem_base = xmlMemBlocks();
24703         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24704         dtd = gen_xmlDtdPtr(n_dtd, 1);
24705         name = gen_const_xmlChar_ptr(n_name, 2);
24706         type = gen_xmlElementTypeVal(n_type, 3);
24707         content = gen_xmlElementContentPtr(n_content, 4);
24708
24709         ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24710         desret_xmlElementPtr(ret_val);
24711         call_tests++;
24712         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24713         des_xmlDtdPtr(n_dtd, dtd, 1);
24714         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24715         des_xmlElementTypeVal(n_type, type, 3);
24716         des_xmlElementContentPtr(n_content, content, 4);
24717         xmlResetLastError();
24718         if (mem_base != xmlMemBlocks()) {
24719             printf("Leak of %d blocks found in xmlAddElementDecl",
24720                    xmlMemBlocks() - mem_base);
24721             test_ret++;
24722             printf(" %d", n_ctxt);
24723             printf(" %d", n_dtd);
24724             printf(" %d", n_name);
24725             printf(" %d", n_type);
24726             printf(" %d", n_content);
24727             printf("\n");
24728         }
24729     }
24730     }
24731     }
24732     }
24733     }
24734     function_tests++;
24735
24736     return(test_ret);
24737 }
24738
24739
24740 static int
24741 test_xmlAddID(void) {
24742     int test_ret = 0;
24743
24744
24745     /* missing type support */
24746     return(test_ret);
24747 }
24748
24749
24750 static int
24751 test_xmlAddNotationDecl(void) {
24752     int test_ret = 0;
24753
24754
24755     /* missing type support */
24756     return(test_ret);
24757 }
24758
24759
24760 static int
24761 test_xmlAddRef(void) {
24762     int test_ret = 0;
24763
24764
24765     /* missing type support */
24766     return(test_ret);
24767 }
24768
24769
24770 #define gen_nb_xmlAttributeTablePtr 1
24771 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24772     return(NULL);
24773 }
24774 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24775 }
24776
24777 static int
24778 test_xmlCopyAttributeTable(void) {
24779     int test_ret = 0;
24780
24781
24782     /* missing type support */
24783     return(test_ret);
24784 }
24785
24786
24787 static int
24788 test_xmlCopyDocElementContent(void) {
24789     int test_ret = 0;
24790
24791     int mem_base;
24792     xmlElementContentPtr ret_val;
24793     xmlDocPtr doc; /* the document owning the element declaration */
24794     int n_doc;
24795     xmlElementContentPtr cur; /* An element content pointer. */
24796     int n_cur;
24797
24798     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24799     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24800         mem_base = xmlMemBlocks();
24801         doc = gen_xmlDocPtr(n_doc, 0);
24802         cur = gen_xmlElementContentPtr(n_cur, 1);
24803
24804         ret_val = xmlCopyDocElementContent(doc, cur);
24805         desret_xmlElementContentPtr(ret_val);
24806         call_tests++;
24807         des_xmlDocPtr(n_doc, doc, 0);
24808         des_xmlElementContentPtr(n_cur, cur, 1);
24809         xmlResetLastError();
24810         if (mem_base != xmlMemBlocks()) {
24811             printf("Leak of %d blocks found in xmlCopyDocElementContent",
24812                    xmlMemBlocks() - mem_base);
24813             test_ret++;
24814             printf(" %d", n_doc);
24815             printf(" %d", n_cur);
24816             printf("\n");
24817         }
24818     }
24819     }
24820     function_tests++;
24821
24822     return(test_ret);
24823 }
24824
24825
24826 static int
24827 test_xmlCopyElementContent(void) {
24828     int test_ret = 0;
24829
24830     int mem_base;
24831     xmlElementContentPtr ret_val;
24832     xmlElementContentPtr cur; /* An element content pointer. */
24833     int n_cur;
24834
24835     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24836         mem_base = xmlMemBlocks();
24837         cur = gen_xmlElementContentPtr(n_cur, 0);
24838
24839         ret_val = xmlCopyElementContent(cur);
24840         desret_xmlElementContentPtr(ret_val);
24841         call_tests++;
24842         des_xmlElementContentPtr(n_cur, cur, 0);
24843         xmlResetLastError();
24844         if (mem_base != xmlMemBlocks()) {
24845             printf("Leak of %d blocks found in xmlCopyElementContent",
24846                    xmlMemBlocks() - mem_base);
24847             test_ret++;
24848             printf(" %d", n_cur);
24849             printf("\n");
24850         }
24851     }
24852     function_tests++;
24853
24854     return(test_ret);
24855 }
24856
24857
24858 #define gen_nb_xmlElementTablePtr 1
24859 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24860     return(NULL);
24861 }
24862 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24863 }
24864
24865 static int
24866 test_xmlCopyElementTable(void) {
24867     int test_ret = 0;
24868
24869
24870     /* missing type support */
24871     return(test_ret);
24872 }
24873
24874
24875 static int
24876 test_xmlCopyEnumeration(void) {
24877     int test_ret = 0;
24878
24879
24880     /* missing type support */
24881     return(test_ret);
24882 }
24883
24884
24885 #define gen_nb_xmlNotationTablePtr 1
24886 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24887     return(NULL);
24888 }
24889 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24890 }
24891
24892 static int
24893 test_xmlCopyNotationTable(void) {
24894     int test_ret = 0;
24895
24896
24897     /* missing type support */
24898     return(test_ret);
24899 }
24900
24901
24902 static int
24903 test_xmlCreateEnumeration(void) {
24904     int test_ret = 0;
24905
24906
24907     /* missing type support */
24908     return(test_ret);
24909 }
24910
24911
24912 #define gen_nb_xmlAttributePtr 1
24913 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24914     return(NULL);
24915 }
24916 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24917 }
24918
24919 static int
24920 test_xmlDumpAttributeDecl(void) {
24921     int test_ret = 0;
24922
24923 #if defined(LIBXML_OUTPUT_ENABLED)
24924     int mem_base;
24925     xmlBufferPtr buf; /* the XML buffer output */
24926     int n_buf;
24927     xmlAttributePtr attr; /* An attribute declaration */
24928     int n_attr;
24929
24930     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24931     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24932         mem_base = xmlMemBlocks();
24933         buf = gen_xmlBufferPtr(n_buf, 0);
24934         attr = gen_xmlAttributePtr(n_attr, 1);
24935
24936         xmlDumpAttributeDecl(buf, attr);
24937         call_tests++;
24938         des_xmlBufferPtr(n_buf, buf, 0);
24939         des_xmlAttributePtr(n_attr, attr, 1);
24940         xmlResetLastError();
24941         if (mem_base != xmlMemBlocks()) {
24942             printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24943                    xmlMemBlocks() - mem_base);
24944             test_ret++;
24945             printf(" %d", n_buf);
24946             printf(" %d", n_attr);
24947             printf("\n");
24948         }
24949     }
24950     }
24951     function_tests++;
24952 #endif
24953
24954     return(test_ret);
24955 }
24956
24957
24958 static int
24959 test_xmlDumpAttributeTable(void) {
24960     int test_ret = 0;
24961
24962 #if defined(LIBXML_OUTPUT_ENABLED)
24963     int mem_base;
24964     xmlBufferPtr buf; /* the XML buffer output */
24965     int n_buf;
24966     xmlAttributeTablePtr table; /* An attribute table */
24967     int n_table;
24968
24969     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24970     for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24971         mem_base = xmlMemBlocks();
24972         buf = gen_xmlBufferPtr(n_buf, 0);
24973         table = gen_xmlAttributeTablePtr(n_table, 1);
24974
24975         xmlDumpAttributeTable(buf, table);
24976         call_tests++;
24977         des_xmlBufferPtr(n_buf, buf, 0);
24978         des_xmlAttributeTablePtr(n_table, table, 1);
24979         xmlResetLastError();
24980         if (mem_base != xmlMemBlocks()) {
24981             printf("Leak of %d blocks found in xmlDumpAttributeTable",
24982                    xmlMemBlocks() - mem_base);
24983             test_ret++;
24984             printf(" %d", n_buf);
24985             printf(" %d", n_table);
24986             printf("\n");
24987         }
24988     }
24989     }
24990     function_tests++;
24991 #endif
24992
24993     return(test_ret);
24994 }
24995
24996
24997 #define gen_nb_xmlElementPtr 1
24998 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24999     return(NULL);
25000 }
25001 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25002 }
25003
25004 static int
25005 test_xmlDumpElementDecl(void) {
25006     int test_ret = 0;
25007
25008 #if defined(LIBXML_OUTPUT_ENABLED)
25009     int mem_base;
25010     xmlBufferPtr buf; /* the XML buffer output */
25011     int n_buf;
25012     xmlElementPtr elem; /* An element table */
25013     int n_elem;
25014
25015     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25016     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25017         mem_base = xmlMemBlocks();
25018         buf = gen_xmlBufferPtr(n_buf, 0);
25019         elem = gen_xmlElementPtr(n_elem, 1);
25020
25021         xmlDumpElementDecl(buf, elem);
25022         call_tests++;
25023         des_xmlBufferPtr(n_buf, buf, 0);
25024         des_xmlElementPtr(n_elem, elem, 1);
25025         xmlResetLastError();
25026         if (mem_base != xmlMemBlocks()) {
25027             printf("Leak of %d blocks found in xmlDumpElementDecl",
25028                    xmlMemBlocks() - mem_base);
25029             test_ret++;
25030             printf(" %d", n_buf);
25031             printf(" %d", n_elem);
25032             printf("\n");
25033         }
25034     }
25035     }
25036     function_tests++;
25037 #endif
25038
25039     return(test_ret);
25040 }
25041
25042
25043 static int
25044 test_xmlDumpElementTable(void) {
25045     int test_ret = 0;
25046
25047 #if defined(LIBXML_OUTPUT_ENABLED)
25048     int mem_base;
25049     xmlBufferPtr buf; /* the XML buffer output */
25050     int n_buf;
25051     xmlElementTablePtr table; /* An element table */
25052     int n_table;
25053
25054     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25055     for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25056         mem_base = xmlMemBlocks();
25057         buf = gen_xmlBufferPtr(n_buf, 0);
25058         table = gen_xmlElementTablePtr(n_table, 1);
25059
25060         xmlDumpElementTable(buf, table);
25061         call_tests++;
25062         des_xmlBufferPtr(n_buf, buf, 0);
25063         des_xmlElementTablePtr(n_table, table, 1);
25064         xmlResetLastError();
25065         if (mem_base != xmlMemBlocks()) {
25066             printf("Leak of %d blocks found in xmlDumpElementTable",
25067                    xmlMemBlocks() - mem_base);
25068             test_ret++;
25069             printf(" %d", n_buf);
25070             printf(" %d", n_table);
25071             printf("\n");
25072         }
25073     }
25074     }
25075     function_tests++;
25076 #endif
25077
25078     return(test_ret);
25079 }
25080
25081
25082 #define gen_nb_xmlNotationPtr 1
25083 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25084     return(NULL);
25085 }
25086 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25087 }
25088
25089 static int
25090 test_xmlDumpNotationDecl(void) {
25091     int test_ret = 0;
25092
25093 #if defined(LIBXML_OUTPUT_ENABLED)
25094     int mem_base;
25095     xmlBufferPtr buf; /* the XML buffer output */
25096     int n_buf;
25097     xmlNotationPtr nota; /* A notation declaration */
25098     int n_nota;
25099
25100     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25101     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25102         mem_base = xmlMemBlocks();
25103         buf = gen_xmlBufferPtr(n_buf, 0);
25104         nota = gen_xmlNotationPtr(n_nota, 1);
25105
25106         xmlDumpNotationDecl(buf, nota);
25107         call_tests++;
25108         des_xmlBufferPtr(n_buf, buf, 0);
25109         des_xmlNotationPtr(n_nota, nota, 1);
25110         xmlResetLastError();
25111         if (mem_base != xmlMemBlocks()) {
25112             printf("Leak of %d blocks found in xmlDumpNotationDecl",
25113                    xmlMemBlocks() - mem_base);
25114             test_ret++;
25115             printf(" %d", n_buf);
25116             printf(" %d", n_nota);
25117             printf("\n");
25118         }
25119     }
25120     }
25121     function_tests++;
25122 #endif
25123
25124     return(test_ret);
25125 }
25126
25127
25128 static int
25129 test_xmlDumpNotationTable(void) {
25130     int test_ret = 0;
25131
25132 #if defined(LIBXML_OUTPUT_ENABLED)
25133     int mem_base;
25134     xmlBufferPtr buf; /* the XML buffer output */
25135     int n_buf;
25136     xmlNotationTablePtr table; /* A notation table */
25137     int n_table;
25138
25139     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25140     for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25141         mem_base = xmlMemBlocks();
25142         buf = gen_xmlBufferPtr(n_buf, 0);
25143         table = gen_xmlNotationTablePtr(n_table, 1);
25144
25145         xmlDumpNotationTable(buf, table);
25146         call_tests++;
25147         des_xmlBufferPtr(n_buf, buf, 0);
25148         des_xmlNotationTablePtr(n_table, table, 1);
25149         xmlResetLastError();
25150         if (mem_base != xmlMemBlocks()) {
25151             printf("Leak of %d blocks found in xmlDumpNotationTable",
25152                    xmlMemBlocks() - mem_base);
25153             test_ret++;
25154             printf(" %d", n_buf);
25155             printf(" %d", n_table);
25156             printf("\n");
25157         }
25158     }
25159     }
25160     function_tests++;
25161 #endif
25162
25163     return(test_ret);
25164 }
25165
25166
25167 static int
25168 test_xmlGetDtdAttrDesc(void) {
25169     int test_ret = 0;
25170
25171     int mem_base;
25172     xmlAttributePtr ret_val;
25173     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25174     int n_dtd;
25175     xmlChar * elem; /* the element name */
25176     int n_elem;
25177     xmlChar * name; /* the attribute name */
25178     int n_name;
25179
25180     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25181     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25182     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25183         mem_base = xmlMemBlocks();
25184         dtd = gen_xmlDtdPtr(n_dtd, 0);
25185         elem = gen_const_xmlChar_ptr(n_elem, 1);
25186         name = gen_const_xmlChar_ptr(n_name, 2);
25187
25188         ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25189         desret_xmlAttributePtr(ret_val);
25190         call_tests++;
25191         des_xmlDtdPtr(n_dtd, dtd, 0);
25192         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25193         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25194         xmlResetLastError();
25195         if (mem_base != xmlMemBlocks()) {
25196             printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25197                    xmlMemBlocks() - mem_base);
25198             test_ret++;
25199             printf(" %d", n_dtd);
25200             printf(" %d", n_elem);
25201             printf(" %d", n_name);
25202             printf("\n");
25203         }
25204     }
25205     }
25206     }
25207     function_tests++;
25208
25209     return(test_ret);
25210 }
25211
25212
25213 static int
25214 test_xmlGetDtdElementDesc(void) {
25215     int test_ret = 0;
25216
25217     int mem_base;
25218     xmlElementPtr ret_val;
25219     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25220     int n_dtd;
25221     xmlChar * name; /* the element name */
25222     int n_name;
25223
25224     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25225     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25226         mem_base = xmlMemBlocks();
25227         dtd = gen_xmlDtdPtr(n_dtd, 0);
25228         name = gen_const_xmlChar_ptr(n_name, 1);
25229
25230         ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25231         desret_xmlElementPtr(ret_val);
25232         call_tests++;
25233         des_xmlDtdPtr(n_dtd, dtd, 0);
25234         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25235         xmlResetLastError();
25236         if (mem_base != xmlMemBlocks()) {
25237             printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25238                    xmlMemBlocks() - mem_base);
25239             test_ret++;
25240             printf(" %d", n_dtd);
25241             printf(" %d", n_name);
25242             printf("\n");
25243         }
25244     }
25245     }
25246     function_tests++;
25247
25248     return(test_ret);
25249 }
25250
25251
25252 static int
25253 test_xmlGetDtdNotationDesc(void) {
25254     int test_ret = 0;
25255
25256
25257     /* missing type support */
25258     return(test_ret);
25259 }
25260
25261
25262 static int
25263 test_xmlGetDtdQAttrDesc(void) {
25264     int test_ret = 0;
25265
25266     int mem_base;
25267     xmlAttributePtr ret_val;
25268     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25269     int n_dtd;
25270     xmlChar * elem; /* the element name */
25271     int n_elem;
25272     xmlChar * name; /* the attribute name */
25273     int n_name;
25274     xmlChar * prefix; /* the attribute namespace prefix */
25275     int n_prefix;
25276
25277     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25278     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25279     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25280     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25281         mem_base = xmlMemBlocks();
25282         dtd = gen_xmlDtdPtr(n_dtd, 0);
25283         elem = gen_const_xmlChar_ptr(n_elem, 1);
25284         name = gen_const_xmlChar_ptr(n_name, 2);
25285         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25286
25287         ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25288         desret_xmlAttributePtr(ret_val);
25289         call_tests++;
25290         des_xmlDtdPtr(n_dtd, dtd, 0);
25291         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25292         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25293         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25294         xmlResetLastError();
25295         if (mem_base != xmlMemBlocks()) {
25296             printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25297                    xmlMemBlocks() - mem_base);
25298             test_ret++;
25299             printf(" %d", n_dtd);
25300             printf(" %d", n_elem);
25301             printf(" %d", n_name);
25302             printf(" %d", n_prefix);
25303             printf("\n");
25304         }
25305     }
25306     }
25307     }
25308     }
25309     function_tests++;
25310
25311     return(test_ret);
25312 }
25313
25314
25315 static int
25316 test_xmlGetDtdQElementDesc(void) {
25317     int test_ret = 0;
25318
25319     int mem_base;
25320     xmlElementPtr ret_val;
25321     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25322     int n_dtd;
25323     xmlChar * name; /* the element name */
25324     int n_name;
25325     xmlChar * prefix; /* the element namespace prefix */
25326     int n_prefix;
25327
25328     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25329     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25330     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25331         mem_base = xmlMemBlocks();
25332         dtd = gen_xmlDtdPtr(n_dtd, 0);
25333         name = gen_const_xmlChar_ptr(n_name, 1);
25334         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25335
25336         ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25337         desret_xmlElementPtr(ret_val);
25338         call_tests++;
25339         des_xmlDtdPtr(n_dtd, dtd, 0);
25340         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25341         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25342         xmlResetLastError();
25343         if (mem_base != xmlMemBlocks()) {
25344             printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25345                    xmlMemBlocks() - mem_base);
25346             test_ret++;
25347             printf(" %d", n_dtd);
25348             printf(" %d", n_name);
25349             printf(" %d", n_prefix);
25350             printf("\n");
25351         }
25352     }
25353     }
25354     }
25355     function_tests++;
25356
25357     return(test_ret);
25358 }
25359
25360
25361 static int
25362 test_xmlGetID(void) {
25363     int test_ret = 0;
25364
25365     int mem_base;
25366     xmlAttrPtr ret_val;
25367     xmlDocPtr doc; /* pointer to the document */
25368     int n_doc;
25369     xmlChar * ID; /* the ID value */
25370     int n_ID;
25371
25372     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25373     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25374         mem_base = xmlMemBlocks();
25375         doc = gen_xmlDocPtr(n_doc, 0);
25376         ID = gen_const_xmlChar_ptr(n_ID, 1);
25377
25378         ret_val = xmlGetID(doc, (const xmlChar *)ID);
25379         desret_xmlAttrPtr(ret_val);
25380         call_tests++;
25381         des_xmlDocPtr(n_doc, doc, 0);
25382         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25383         xmlResetLastError();
25384         if (mem_base != xmlMemBlocks()) {
25385             printf("Leak of %d blocks found in xmlGetID",
25386                    xmlMemBlocks() - mem_base);
25387             test_ret++;
25388             printf(" %d", n_doc);
25389             printf(" %d", n_ID);
25390             printf("\n");
25391         }
25392     }
25393     }
25394     function_tests++;
25395
25396     return(test_ret);
25397 }
25398
25399
25400 static int
25401 test_xmlGetRefs(void) {
25402     int test_ret = 0;
25403
25404
25405     /* missing type support */
25406     return(test_ret);
25407 }
25408
25409
25410 static int
25411 test_xmlIsID(void) {
25412     int test_ret = 0;
25413
25414     int mem_base;
25415     int ret_val;
25416     xmlDocPtr doc; /* the document */
25417     int n_doc;
25418     xmlNodePtr elem; /* the element carrying the attribute */
25419     int n_elem;
25420     xmlAttrPtr attr; /* the attribute */
25421     int n_attr;
25422
25423     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25424     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25425     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25426         mem_base = xmlMemBlocks();
25427         doc = gen_xmlDocPtr(n_doc, 0);
25428         elem = gen_xmlNodePtr(n_elem, 1);
25429         attr = gen_xmlAttrPtr(n_attr, 2);
25430
25431         ret_val = xmlIsID(doc, elem, attr);
25432         desret_int(ret_val);
25433         call_tests++;
25434         des_xmlDocPtr(n_doc, doc, 0);
25435         des_xmlNodePtr(n_elem, elem, 1);
25436         des_xmlAttrPtr(n_attr, attr, 2);
25437         xmlResetLastError();
25438         if (mem_base != xmlMemBlocks()) {
25439             printf("Leak of %d blocks found in xmlIsID",
25440                    xmlMemBlocks() - mem_base);
25441             test_ret++;
25442             printf(" %d", n_doc);
25443             printf(" %d", n_elem);
25444             printf(" %d", n_attr);
25445             printf("\n");
25446         }
25447     }
25448     }
25449     }
25450     function_tests++;
25451
25452     return(test_ret);
25453 }
25454
25455
25456 static int
25457 test_xmlIsMixedElement(void) {
25458     int test_ret = 0;
25459
25460     int mem_base;
25461     int ret_val;
25462     xmlDocPtr doc; /* the document */
25463     int n_doc;
25464     xmlChar * name; /* the element name */
25465     int n_name;
25466
25467     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25468     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25469         mem_base = xmlMemBlocks();
25470         doc = gen_xmlDocPtr(n_doc, 0);
25471         name = gen_const_xmlChar_ptr(n_name, 1);
25472
25473         ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25474         desret_int(ret_val);
25475         call_tests++;
25476         des_xmlDocPtr(n_doc, doc, 0);
25477         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25478         xmlResetLastError();
25479         if (mem_base != xmlMemBlocks()) {
25480             printf("Leak of %d blocks found in xmlIsMixedElement",
25481                    xmlMemBlocks() - mem_base);
25482             test_ret++;
25483             printf(" %d", n_doc);
25484             printf(" %d", n_name);
25485             printf("\n");
25486         }
25487     }
25488     }
25489     function_tests++;
25490
25491     return(test_ret);
25492 }
25493
25494
25495 static int
25496 test_xmlIsRef(void) {
25497     int test_ret = 0;
25498
25499     int mem_base;
25500     int ret_val;
25501     xmlDocPtr doc; /* the document */
25502     int n_doc;
25503     xmlNodePtr elem; /* the element carrying the attribute */
25504     int n_elem;
25505     xmlAttrPtr attr; /* the attribute */
25506     int n_attr;
25507
25508     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25509     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25510     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25511         mem_base = xmlMemBlocks();
25512         doc = gen_xmlDocPtr(n_doc, 0);
25513         elem = gen_xmlNodePtr(n_elem, 1);
25514         attr = gen_xmlAttrPtr(n_attr, 2);
25515
25516         ret_val = xmlIsRef(doc, elem, attr);
25517         desret_int(ret_val);
25518         call_tests++;
25519         des_xmlDocPtr(n_doc, doc, 0);
25520         des_xmlNodePtr(n_elem, elem, 1);
25521         des_xmlAttrPtr(n_attr, attr, 2);
25522         xmlResetLastError();
25523         if (mem_base != xmlMemBlocks()) {
25524             printf("Leak of %d blocks found in xmlIsRef",
25525                    xmlMemBlocks() - mem_base);
25526             test_ret++;
25527             printf(" %d", n_doc);
25528             printf(" %d", n_elem);
25529             printf(" %d", n_attr);
25530             printf("\n");
25531         }
25532     }
25533     }
25534     }
25535     function_tests++;
25536
25537     return(test_ret);
25538 }
25539
25540
25541 static int
25542 test_xmlNewDocElementContent(void) {
25543     int test_ret = 0;
25544
25545     int mem_base;
25546     xmlElementContentPtr ret_val;
25547     xmlDocPtr doc; /* the document */
25548     int n_doc;
25549     xmlChar * name; /* the subelement name or NULL */
25550     int n_name;
25551     xmlElementContentType type; /* the type of element content decl */
25552     int n_type;
25553
25554     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25555     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25556     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25557         mem_base = xmlMemBlocks();
25558         doc = gen_xmlDocPtr(n_doc, 0);
25559         name = gen_const_xmlChar_ptr(n_name, 1);
25560         type = gen_xmlElementContentType(n_type, 2);
25561
25562         ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25563         xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25564         desret_xmlElementContentPtr(ret_val);
25565         call_tests++;
25566         des_xmlDocPtr(n_doc, doc, 0);
25567         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25568         des_xmlElementContentType(n_type, type, 2);
25569         xmlResetLastError();
25570         if (mem_base != xmlMemBlocks()) {
25571             printf("Leak of %d blocks found in xmlNewDocElementContent",
25572                    xmlMemBlocks() - mem_base);
25573             test_ret++;
25574             printf(" %d", n_doc);
25575             printf(" %d", n_name);
25576             printf(" %d", n_type);
25577             printf("\n");
25578         }
25579     }
25580     }
25581     }
25582     function_tests++;
25583
25584     return(test_ret);
25585 }
25586
25587
25588 static int
25589 test_xmlNewElementContent(void) {
25590     int test_ret = 0;
25591
25592     int mem_base;
25593     xmlElementContentPtr ret_val;
25594     xmlChar * name; /* the subelement name or NULL */
25595     int n_name;
25596     xmlElementContentType type; /* the type of element content decl */
25597     int n_type;
25598
25599     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25600     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25601         mem_base = xmlMemBlocks();
25602         name = gen_const_xmlChar_ptr(n_name, 0);
25603         type = gen_xmlElementContentType(n_type, 1);
25604
25605         ret_val = xmlNewElementContent((const xmlChar *)name, type);
25606         desret_xmlElementContentPtr(ret_val);
25607         call_tests++;
25608         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25609         des_xmlElementContentType(n_type, type, 1);
25610         xmlResetLastError();
25611         if (mem_base != xmlMemBlocks()) {
25612             printf("Leak of %d blocks found in xmlNewElementContent",
25613                    xmlMemBlocks() - mem_base);
25614             test_ret++;
25615             printf(" %d", n_name);
25616             printf(" %d", n_type);
25617             printf("\n");
25618         }
25619     }
25620     }
25621     function_tests++;
25622
25623     return(test_ret);
25624 }
25625
25626
25627 static int
25628 test_xmlNewValidCtxt(void) {
25629     int test_ret = 0;
25630
25631
25632     /* missing type support */
25633     return(test_ret);
25634 }
25635
25636
25637 static int
25638 test_xmlRemoveID(void) {
25639     int test_ret = 0;
25640
25641     int mem_base;
25642     int ret_val;
25643     xmlDocPtr doc; /* the document */
25644     int n_doc;
25645     xmlAttrPtr attr; /* the attribute */
25646     int n_attr;
25647
25648     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25649     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25650         mem_base = xmlMemBlocks();
25651         doc = gen_xmlDocPtr(n_doc, 0);
25652         attr = gen_xmlAttrPtr(n_attr, 1);
25653
25654         ret_val = xmlRemoveID(doc, attr);
25655         desret_int(ret_val);
25656         call_tests++;
25657         des_xmlDocPtr(n_doc, doc, 0);
25658         des_xmlAttrPtr(n_attr, attr, 1);
25659         xmlResetLastError();
25660         if (mem_base != xmlMemBlocks()) {
25661             printf("Leak of %d blocks found in xmlRemoveID",
25662                    xmlMemBlocks() - mem_base);
25663             test_ret++;
25664             printf(" %d", n_doc);
25665             printf(" %d", n_attr);
25666             printf("\n");
25667         }
25668     }
25669     }
25670     function_tests++;
25671
25672     return(test_ret);
25673 }
25674
25675
25676 static int
25677 test_xmlRemoveRef(void) {
25678     int test_ret = 0;
25679
25680     int mem_base;
25681     int ret_val;
25682     xmlDocPtr doc; /* the document */
25683     int n_doc;
25684     xmlAttrPtr attr; /* the attribute */
25685     int n_attr;
25686
25687     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25688     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25689         mem_base = xmlMemBlocks();
25690         doc = gen_xmlDocPtr(n_doc, 0);
25691         attr = gen_xmlAttrPtr(n_attr, 1);
25692
25693         ret_val = xmlRemoveRef(doc, attr);
25694         desret_int(ret_val);
25695         call_tests++;
25696         des_xmlDocPtr(n_doc, doc, 0);
25697         des_xmlAttrPtr(n_attr, attr, 1);
25698         xmlResetLastError();
25699         if (mem_base != xmlMemBlocks()) {
25700             printf("Leak of %d blocks found in xmlRemoveRef",
25701                    xmlMemBlocks() - mem_base);
25702             test_ret++;
25703             printf(" %d", n_doc);
25704             printf(" %d", n_attr);
25705             printf("\n");
25706         }
25707     }
25708     }
25709     function_tests++;
25710
25711     return(test_ret);
25712 }
25713
25714
25715 static int
25716 test_xmlSnprintfElementContent(void) {
25717     int test_ret = 0;
25718
25719     int mem_base;
25720     char * buf; /* an output buffer */
25721     int n_buf;
25722     int size; /* the buffer size */
25723     int n_size;
25724     xmlElementContentPtr content; /* An element table */
25725     int n_content;
25726     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25727     int n_englob;
25728
25729     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25730     for (n_size = 0;n_size < gen_nb_int;n_size++) {
25731     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25732     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25733         mem_base = xmlMemBlocks();
25734         buf = gen_char_ptr(n_buf, 0);
25735         size = gen_int(n_size, 1);
25736         content = gen_xmlElementContentPtr(n_content, 2);
25737         englob = gen_int(n_englob, 3);
25738
25739         xmlSnprintfElementContent(buf, size, content, englob);
25740         call_tests++;
25741         des_char_ptr(n_buf, buf, 0);
25742         des_int(n_size, size, 1);
25743         des_xmlElementContentPtr(n_content, content, 2);
25744         des_int(n_englob, englob, 3);
25745         xmlResetLastError();
25746         if (mem_base != xmlMemBlocks()) {
25747             printf("Leak of %d blocks found in xmlSnprintfElementContent",
25748                    xmlMemBlocks() - mem_base);
25749             test_ret++;
25750             printf(" %d", n_buf);
25751             printf(" %d", n_size);
25752             printf(" %d", n_content);
25753             printf(" %d", n_englob);
25754             printf("\n");
25755         }
25756     }
25757     }
25758     }
25759     }
25760     function_tests++;
25761
25762     return(test_ret);
25763 }
25764
25765
25766 static int
25767 test_xmlSprintfElementContent(void) {
25768     int test_ret = 0;
25769
25770 #if defined(LIBXML_OUTPUT_ENABLED)
25771 #ifdef LIBXML_OUTPUT_ENABLED
25772     int mem_base;
25773     char * buf; /* an output buffer */
25774     int n_buf;
25775     xmlElementContentPtr content; /* An element table */
25776     int n_content;
25777     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25778     int n_englob;
25779
25780     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25781     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25782     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25783         mem_base = xmlMemBlocks();
25784         buf = gen_char_ptr(n_buf, 0);
25785         content = gen_xmlElementContentPtr(n_content, 1);
25786         englob = gen_int(n_englob, 2);
25787
25788         xmlSprintfElementContent(buf, content, englob);
25789         call_tests++;
25790         des_char_ptr(n_buf, buf, 0);
25791         des_xmlElementContentPtr(n_content, content, 1);
25792         des_int(n_englob, englob, 2);
25793         xmlResetLastError();
25794         if (mem_base != xmlMemBlocks()) {
25795             printf("Leak of %d blocks found in xmlSprintfElementContent",
25796                    xmlMemBlocks() - mem_base);
25797             test_ret++;
25798             printf(" %d", n_buf);
25799             printf(" %d", n_content);
25800             printf(" %d", n_englob);
25801             printf("\n");
25802         }
25803     }
25804     }
25805     }
25806     function_tests++;
25807 #endif
25808 #endif
25809
25810     return(test_ret);
25811 }
25812
25813
25814 static int
25815 test_xmlValidBuildContentModel(void) {
25816     int test_ret = 0;
25817
25818 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25819     int mem_base;
25820     int ret_val;
25821     xmlValidCtxtPtr ctxt; /* a validation context */
25822     int n_ctxt;
25823     xmlElementPtr elem; /* an element declaration node */
25824     int n_elem;
25825
25826     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25827     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25828         mem_base = xmlMemBlocks();
25829         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25830         elem = gen_xmlElementPtr(n_elem, 1);
25831
25832         ret_val = xmlValidBuildContentModel(ctxt, elem);
25833         desret_int(ret_val);
25834         call_tests++;
25835         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25836         des_xmlElementPtr(n_elem, elem, 1);
25837         xmlResetLastError();
25838         if (mem_base != xmlMemBlocks()) {
25839             printf("Leak of %d blocks found in xmlValidBuildContentModel",
25840                    xmlMemBlocks() - mem_base);
25841             test_ret++;
25842             printf(" %d", n_ctxt);
25843             printf(" %d", n_elem);
25844             printf("\n");
25845         }
25846     }
25847     }
25848     function_tests++;
25849 #endif
25850
25851     return(test_ret);
25852 }
25853
25854
25855 static int
25856 test_xmlValidCtxtNormalizeAttributeValue(void) {
25857     int test_ret = 0;
25858
25859 #if defined(LIBXML_VALID_ENABLED)
25860     int mem_base;
25861     xmlChar * ret_val;
25862     xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25863     int n_ctxt;
25864     xmlDocPtr doc; /* the document */
25865     int n_doc;
25866     xmlNodePtr elem; /* the parent */
25867     int n_elem;
25868     xmlChar * name; /* the attribute name */
25869     int n_name;
25870     xmlChar * value; /* the attribute value */
25871     int n_value;
25872
25873     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25874     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25875     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25876     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25877     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25878         mem_base = xmlMemBlocks();
25879         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25880         doc = gen_xmlDocPtr(n_doc, 1);
25881         elem = gen_xmlNodePtr(n_elem, 2);
25882         name = gen_const_xmlChar_ptr(n_name, 3);
25883         value = gen_const_xmlChar_ptr(n_value, 4);
25884
25885         ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25886         desret_xmlChar_ptr(ret_val);
25887         call_tests++;
25888         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25889         des_xmlDocPtr(n_doc, doc, 1);
25890         des_xmlNodePtr(n_elem, elem, 2);
25891         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25892         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25893         xmlResetLastError();
25894         if (mem_base != xmlMemBlocks()) {
25895             printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25896                    xmlMemBlocks() - mem_base);
25897             test_ret++;
25898             printf(" %d", n_ctxt);
25899             printf(" %d", n_doc);
25900             printf(" %d", n_elem);
25901             printf(" %d", n_name);
25902             printf(" %d", n_value);
25903             printf("\n");
25904         }
25905     }
25906     }
25907     }
25908     }
25909     }
25910     function_tests++;
25911 #endif
25912
25913     return(test_ret);
25914 }
25915
25916
25917 #define gen_nb_xmlElementContent_ptr 1
25918 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25919     return(NULL);
25920 }
25921 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25922 }
25923
25924 static int
25925 test_xmlValidGetPotentialChildren(void) {
25926     int test_ret = 0;
25927
25928 #if defined(LIBXML_VALID_ENABLED)
25929 #ifdef LIBXML_VALID_ENABLED
25930     int mem_base;
25931     int ret_val;
25932     xmlElementContent * ctree; /* an element content tree */
25933     int n_ctree;
25934     xmlChar ** names; /* an array to store the list of child names */
25935     int n_names;
25936     int * len; /* a pointer to the number of element in the list */
25937     int n_len;
25938     int max; /* the size of the array */
25939     int n_max;
25940
25941     for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25942     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25943     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25944     for (n_max = 0;n_max < gen_nb_int;n_max++) {
25945         mem_base = xmlMemBlocks();
25946         ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25947         names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25948         len = gen_int_ptr(n_len, 2);
25949         max = gen_int(n_max, 3);
25950
25951         ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25952         desret_int(ret_val);
25953         call_tests++;
25954         des_xmlElementContent_ptr(n_ctree, ctree, 0);
25955         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25956         des_int_ptr(n_len, len, 2);
25957         des_int(n_max, max, 3);
25958         xmlResetLastError();
25959         if (mem_base != xmlMemBlocks()) {
25960             printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25961                    xmlMemBlocks() - mem_base);
25962             test_ret++;
25963             printf(" %d", n_ctree);
25964             printf(" %d", n_names);
25965             printf(" %d", n_len);
25966             printf(" %d", n_max);
25967             printf("\n");
25968         }
25969     }
25970     }
25971     }
25972     }
25973     function_tests++;
25974 #endif
25975 #endif
25976
25977     return(test_ret);
25978 }
25979
25980
25981 static int
25982 test_xmlValidGetValidElements(void) {
25983     int test_ret = 0;
25984
25985 #if defined(LIBXML_VALID_ENABLED)
25986 #ifdef LIBXML_VALID_ENABLED
25987     int mem_base;
25988     int ret_val;
25989     xmlNode * prev; /* an element to insert after */
25990     int n_prev;
25991     xmlNode * next; /* an element to insert next */
25992     int n_next;
25993     xmlChar ** names; /* an array to store the list of child names */
25994     int n_names;
25995     int max; /* the size of the array */
25996     int n_max;
25997
25998     for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25999     for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26000     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26001     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26002         mem_base = xmlMemBlocks();
26003         prev = gen_xmlNodePtr(n_prev, 0);
26004         next = gen_xmlNodePtr(n_next, 1);
26005         names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26006         max = gen_int(n_max, 3);
26007
26008         ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26009         desret_int(ret_val);
26010         call_tests++;
26011         des_xmlNodePtr(n_prev, prev, 0);
26012         des_xmlNodePtr(n_next, next, 1);
26013         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26014         des_int(n_max, max, 3);
26015         xmlResetLastError();
26016         if (mem_base != xmlMemBlocks()) {
26017             printf("Leak of %d blocks found in xmlValidGetValidElements",
26018                    xmlMemBlocks() - mem_base);
26019             test_ret++;
26020             printf(" %d", n_prev);
26021             printf(" %d", n_next);
26022             printf(" %d", n_names);
26023             printf(" %d", n_max);
26024             printf("\n");
26025         }
26026     }
26027     }
26028     }
26029     }
26030     function_tests++;
26031 #endif
26032 #endif
26033
26034     return(test_ret);
26035 }
26036
26037
26038 static int
26039 test_xmlValidNormalizeAttributeValue(void) {
26040     int test_ret = 0;
26041
26042 #if defined(LIBXML_VALID_ENABLED)
26043     int mem_base;
26044     xmlChar * ret_val;
26045     xmlDocPtr doc; /* the document */
26046     int n_doc;
26047     xmlNodePtr elem; /* the parent */
26048     int n_elem;
26049     xmlChar * name; /* the attribute name */
26050     int n_name;
26051     xmlChar * value; /* the attribute value */
26052     int n_value;
26053
26054     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26055     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26056     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26057     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26058         mem_base = xmlMemBlocks();
26059         doc = gen_xmlDocPtr(n_doc, 0);
26060         elem = gen_xmlNodePtr(n_elem, 1);
26061         name = gen_const_xmlChar_ptr(n_name, 2);
26062         value = gen_const_xmlChar_ptr(n_value, 3);
26063
26064         ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26065         desret_xmlChar_ptr(ret_val);
26066         call_tests++;
26067         des_xmlDocPtr(n_doc, doc, 0);
26068         des_xmlNodePtr(n_elem, elem, 1);
26069         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26070         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26071         xmlResetLastError();
26072         if (mem_base != xmlMemBlocks()) {
26073             printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26074                    xmlMemBlocks() - mem_base);
26075             test_ret++;
26076             printf(" %d", n_doc);
26077             printf(" %d", n_elem);
26078             printf(" %d", n_name);
26079             printf(" %d", n_value);
26080             printf("\n");
26081         }
26082     }
26083     }
26084     }
26085     }
26086     function_tests++;
26087 #endif
26088
26089     return(test_ret);
26090 }
26091
26092
26093 static int
26094 test_xmlValidateAttributeDecl(void) {
26095     int test_ret = 0;
26096
26097 #if defined(LIBXML_VALID_ENABLED)
26098     int mem_base;
26099     int ret_val;
26100     xmlValidCtxtPtr ctxt; /* the validation context */
26101     int n_ctxt;
26102     xmlDocPtr doc; /* a document instance */
26103     int n_doc;
26104     xmlAttributePtr attr; /* an attribute definition */
26105     int n_attr;
26106
26107     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26108     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26109     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26110         mem_base = xmlMemBlocks();
26111         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26112         doc = gen_xmlDocPtr(n_doc, 1);
26113         attr = gen_xmlAttributePtr(n_attr, 2);
26114
26115         ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26116         desret_int(ret_val);
26117         call_tests++;
26118         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26119         des_xmlDocPtr(n_doc, doc, 1);
26120         des_xmlAttributePtr(n_attr, attr, 2);
26121         xmlResetLastError();
26122         if (mem_base != xmlMemBlocks()) {
26123             printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26124                    xmlMemBlocks() - mem_base);
26125             test_ret++;
26126             printf(" %d", n_ctxt);
26127             printf(" %d", n_doc);
26128             printf(" %d", n_attr);
26129             printf("\n");
26130         }
26131     }
26132     }
26133     }
26134     function_tests++;
26135 #endif
26136
26137     return(test_ret);
26138 }
26139
26140
26141 static int
26142 test_xmlValidateAttributeValue(void) {
26143     int test_ret = 0;
26144
26145 #if defined(LIBXML_VALID_ENABLED)
26146     int mem_base;
26147     int ret_val;
26148     xmlAttributeType type; /* an attribute type */
26149     int n_type;
26150     xmlChar * value; /* an attribute value */
26151     int n_value;
26152
26153     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26154     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26155         mem_base = xmlMemBlocks();
26156         type = gen_xmlAttributeType(n_type, 0);
26157         value = gen_const_xmlChar_ptr(n_value, 1);
26158
26159         ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26160         desret_int(ret_val);
26161         call_tests++;
26162         des_xmlAttributeType(n_type, type, 0);
26163         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26164         xmlResetLastError();
26165         if (mem_base != xmlMemBlocks()) {
26166             printf("Leak of %d blocks found in xmlValidateAttributeValue",
26167                    xmlMemBlocks() - mem_base);
26168             test_ret++;
26169             printf(" %d", n_type);
26170             printf(" %d", n_value);
26171             printf("\n");
26172         }
26173     }
26174     }
26175     function_tests++;
26176 #endif
26177
26178     return(test_ret);
26179 }
26180
26181
26182 static int
26183 test_xmlValidateDocument(void) {
26184     int test_ret = 0;
26185
26186 #if defined(LIBXML_VALID_ENABLED)
26187     int mem_base;
26188     int ret_val;
26189     xmlValidCtxtPtr ctxt; /* the validation context */
26190     int n_ctxt;
26191     xmlDocPtr doc; /* a document instance */
26192     int n_doc;
26193
26194     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26195     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26196         mem_base = xmlMemBlocks();
26197         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26198         doc = gen_xmlDocPtr(n_doc, 1);
26199
26200         ret_val = xmlValidateDocument(ctxt, doc);
26201         desret_int(ret_val);
26202         call_tests++;
26203         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26204         des_xmlDocPtr(n_doc, doc, 1);
26205         xmlResetLastError();
26206         if (mem_base != xmlMemBlocks()) {
26207             printf("Leak of %d blocks found in xmlValidateDocument",
26208                    xmlMemBlocks() - mem_base);
26209             test_ret++;
26210             printf(" %d", n_ctxt);
26211             printf(" %d", n_doc);
26212             printf("\n");
26213         }
26214     }
26215     }
26216     function_tests++;
26217 #endif
26218
26219     return(test_ret);
26220 }
26221
26222
26223 static int
26224 test_xmlValidateDocumentFinal(void) {
26225     int test_ret = 0;
26226
26227 #if defined(LIBXML_VALID_ENABLED)
26228     int mem_base;
26229     int ret_val;
26230     xmlValidCtxtPtr ctxt; /* the validation context */
26231     int n_ctxt;
26232     xmlDocPtr doc; /* a document instance */
26233     int n_doc;
26234
26235     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26236     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26237         mem_base = xmlMemBlocks();
26238         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26239         doc = gen_xmlDocPtr(n_doc, 1);
26240
26241         ret_val = xmlValidateDocumentFinal(ctxt, doc);
26242         desret_int(ret_val);
26243         call_tests++;
26244         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26245         des_xmlDocPtr(n_doc, doc, 1);
26246         xmlResetLastError();
26247         if (mem_base != xmlMemBlocks()) {
26248             printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26249                    xmlMemBlocks() - mem_base);
26250             test_ret++;
26251             printf(" %d", n_ctxt);
26252             printf(" %d", n_doc);
26253             printf("\n");
26254         }
26255     }
26256     }
26257     function_tests++;
26258 #endif
26259
26260     return(test_ret);
26261 }
26262
26263
26264 static int
26265 test_xmlValidateDtd(void) {
26266     int test_ret = 0;
26267
26268 #if defined(LIBXML_VALID_ENABLED)
26269     int mem_base;
26270     int ret_val;
26271     xmlValidCtxtPtr ctxt; /* the validation context */
26272     int n_ctxt;
26273     xmlDocPtr doc; /* a document instance */
26274     int n_doc;
26275     xmlDtdPtr dtd; /* a dtd instance */
26276     int n_dtd;
26277
26278     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26279     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26280     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26281         mem_base = xmlMemBlocks();
26282         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26283         doc = gen_xmlDocPtr(n_doc, 1);
26284         dtd = gen_xmlDtdPtr(n_dtd, 2);
26285
26286         ret_val = xmlValidateDtd(ctxt, doc, dtd);
26287         desret_int(ret_val);
26288         call_tests++;
26289         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26290         des_xmlDocPtr(n_doc, doc, 1);
26291         des_xmlDtdPtr(n_dtd, dtd, 2);
26292         xmlResetLastError();
26293         if (mem_base != xmlMemBlocks()) {
26294             printf("Leak of %d blocks found in xmlValidateDtd",
26295                    xmlMemBlocks() - mem_base);
26296             test_ret++;
26297             printf(" %d", n_ctxt);
26298             printf(" %d", n_doc);
26299             printf(" %d", n_dtd);
26300             printf("\n");
26301         }
26302     }
26303     }
26304     }
26305     function_tests++;
26306 #endif
26307
26308     return(test_ret);
26309 }
26310
26311
26312 static int
26313 test_xmlValidateDtdFinal(void) {
26314     int test_ret = 0;
26315
26316 #if defined(LIBXML_VALID_ENABLED)
26317     int mem_base;
26318     int ret_val;
26319     xmlValidCtxtPtr ctxt; /* the validation context */
26320     int n_ctxt;
26321     xmlDocPtr doc; /* a document instance */
26322     int n_doc;
26323
26324     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26325     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26326         mem_base = xmlMemBlocks();
26327         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26328         doc = gen_xmlDocPtr(n_doc, 1);
26329
26330         ret_val = xmlValidateDtdFinal(ctxt, doc);
26331         desret_int(ret_val);
26332         call_tests++;
26333         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26334         des_xmlDocPtr(n_doc, doc, 1);
26335         xmlResetLastError();
26336         if (mem_base != xmlMemBlocks()) {
26337             printf("Leak of %d blocks found in xmlValidateDtdFinal",
26338                    xmlMemBlocks() - mem_base);
26339             test_ret++;
26340             printf(" %d", n_ctxt);
26341             printf(" %d", n_doc);
26342             printf("\n");
26343         }
26344     }
26345     }
26346     function_tests++;
26347 #endif
26348
26349     return(test_ret);
26350 }
26351
26352
26353 static int
26354 test_xmlValidateElement(void) {
26355     int test_ret = 0;
26356
26357 #if defined(LIBXML_VALID_ENABLED)
26358     int mem_base;
26359     int ret_val;
26360     xmlValidCtxtPtr ctxt; /* the validation context */
26361     int n_ctxt;
26362     xmlDocPtr doc; /* a document instance */
26363     int n_doc;
26364     xmlNodePtr elem; /* an element instance */
26365     int n_elem;
26366
26367     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26368     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26369     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26370         mem_base = xmlMemBlocks();
26371         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26372         doc = gen_xmlDocPtr(n_doc, 1);
26373         elem = gen_xmlNodePtr(n_elem, 2);
26374
26375         ret_val = xmlValidateElement(ctxt, doc, elem);
26376         desret_int(ret_val);
26377         call_tests++;
26378         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26379         des_xmlDocPtr(n_doc, doc, 1);
26380         des_xmlNodePtr(n_elem, elem, 2);
26381         xmlResetLastError();
26382         if (mem_base != xmlMemBlocks()) {
26383             printf("Leak of %d blocks found in xmlValidateElement",
26384                    xmlMemBlocks() - mem_base);
26385             test_ret++;
26386             printf(" %d", n_ctxt);
26387             printf(" %d", n_doc);
26388             printf(" %d", n_elem);
26389             printf("\n");
26390         }
26391     }
26392     }
26393     }
26394     function_tests++;
26395 #endif
26396
26397     return(test_ret);
26398 }
26399
26400
26401 static int
26402 test_xmlValidateElementDecl(void) {
26403     int test_ret = 0;
26404
26405 #if defined(LIBXML_VALID_ENABLED)
26406     int mem_base;
26407     int ret_val;
26408     xmlValidCtxtPtr ctxt; /* the validation context */
26409     int n_ctxt;
26410     xmlDocPtr doc; /* a document instance */
26411     int n_doc;
26412     xmlElementPtr elem; /* an element definition */
26413     int n_elem;
26414
26415     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26416     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26417     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26418         mem_base = xmlMemBlocks();
26419         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26420         doc = gen_xmlDocPtr(n_doc, 1);
26421         elem = gen_xmlElementPtr(n_elem, 2);
26422
26423         ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26424         desret_int(ret_val);
26425         call_tests++;
26426         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26427         des_xmlDocPtr(n_doc, doc, 1);
26428         des_xmlElementPtr(n_elem, elem, 2);
26429         xmlResetLastError();
26430         if (mem_base != xmlMemBlocks()) {
26431             printf("Leak of %d blocks found in xmlValidateElementDecl",
26432                    xmlMemBlocks() - mem_base);
26433             test_ret++;
26434             printf(" %d", n_ctxt);
26435             printf(" %d", n_doc);
26436             printf(" %d", n_elem);
26437             printf("\n");
26438         }
26439     }
26440     }
26441     }
26442     function_tests++;
26443 #endif
26444
26445     return(test_ret);
26446 }
26447
26448
26449 static int
26450 test_xmlValidateNameValue(void) {
26451     int test_ret = 0;
26452
26453 #if defined(LIBXML_VALID_ENABLED)
26454     int mem_base;
26455     int ret_val;
26456     xmlChar * value; /* an Name value */
26457     int n_value;
26458
26459     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26460         mem_base = xmlMemBlocks();
26461         value = gen_const_xmlChar_ptr(n_value, 0);
26462
26463         ret_val = xmlValidateNameValue((const xmlChar *)value);
26464         desret_int(ret_val);
26465         call_tests++;
26466         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26467         xmlResetLastError();
26468         if (mem_base != xmlMemBlocks()) {
26469             printf("Leak of %d blocks found in xmlValidateNameValue",
26470                    xmlMemBlocks() - mem_base);
26471             test_ret++;
26472             printf(" %d", n_value);
26473             printf("\n");
26474         }
26475     }
26476     function_tests++;
26477 #endif
26478
26479     return(test_ret);
26480 }
26481
26482
26483 static int
26484 test_xmlValidateNamesValue(void) {
26485     int test_ret = 0;
26486
26487 #if defined(LIBXML_VALID_ENABLED)
26488     int mem_base;
26489     int ret_val;
26490     xmlChar * value; /* an Names value */
26491     int n_value;
26492
26493     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26494         mem_base = xmlMemBlocks();
26495         value = gen_const_xmlChar_ptr(n_value, 0);
26496
26497         ret_val = xmlValidateNamesValue((const xmlChar *)value);
26498         desret_int(ret_val);
26499         call_tests++;
26500         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26501         xmlResetLastError();
26502         if (mem_base != xmlMemBlocks()) {
26503             printf("Leak of %d blocks found in xmlValidateNamesValue",
26504                    xmlMemBlocks() - mem_base);
26505             test_ret++;
26506             printf(" %d", n_value);
26507             printf("\n");
26508         }
26509     }
26510     function_tests++;
26511 #endif
26512
26513     return(test_ret);
26514 }
26515
26516
26517 static int
26518 test_xmlValidateNmtokenValue(void) {
26519     int test_ret = 0;
26520
26521 #if defined(LIBXML_VALID_ENABLED)
26522     int mem_base;
26523     int ret_val;
26524     xmlChar * value; /* an Nmtoken value */
26525     int n_value;
26526
26527     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26528         mem_base = xmlMemBlocks();
26529         value = gen_const_xmlChar_ptr(n_value, 0);
26530
26531         ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26532         desret_int(ret_val);
26533         call_tests++;
26534         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26535         xmlResetLastError();
26536         if (mem_base != xmlMemBlocks()) {
26537             printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26538                    xmlMemBlocks() - mem_base);
26539             test_ret++;
26540             printf(" %d", n_value);
26541             printf("\n");
26542         }
26543     }
26544     function_tests++;
26545 #endif
26546
26547     return(test_ret);
26548 }
26549
26550
26551 static int
26552 test_xmlValidateNmtokensValue(void) {
26553     int test_ret = 0;
26554
26555 #if defined(LIBXML_VALID_ENABLED)
26556     int mem_base;
26557     int ret_val;
26558     xmlChar * value; /* an Nmtokens value */
26559     int n_value;
26560
26561     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26562         mem_base = xmlMemBlocks();
26563         value = gen_const_xmlChar_ptr(n_value, 0);
26564
26565         ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26566         desret_int(ret_val);
26567         call_tests++;
26568         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26569         xmlResetLastError();
26570         if (mem_base != xmlMemBlocks()) {
26571             printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26572                    xmlMemBlocks() - mem_base);
26573             test_ret++;
26574             printf(" %d", n_value);
26575             printf("\n");
26576         }
26577     }
26578     function_tests++;
26579 #endif
26580
26581     return(test_ret);
26582 }
26583
26584
26585 static int
26586 test_xmlValidateNotationDecl(void) {
26587     int test_ret = 0;
26588
26589 #if defined(LIBXML_VALID_ENABLED)
26590     int mem_base;
26591     int ret_val;
26592     xmlValidCtxtPtr ctxt; /* the validation context */
26593     int n_ctxt;
26594     xmlDocPtr doc; /* a document instance */
26595     int n_doc;
26596     xmlNotationPtr nota; /* a notation definition */
26597     int n_nota;
26598
26599     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26600     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26601     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26602         mem_base = xmlMemBlocks();
26603         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26604         doc = gen_xmlDocPtr(n_doc, 1);
26605         nota = gen_xmlNotationPtr(n_nota, 2);
26606
26607         ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26608         desret_int(ret_val);
26609         call_tests++;
26610         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26611         des_xmlDocPtr(n_doc, doc, 1);
26612         des_xmlNotationPtr(n_nota, nota, 2);
26613         xmlResetLastError();
26614         if (mem_base != xmlMemBlocks()) {
26615             printf("Leak of %d blocks found in xmlValidateNotationDecl",
26616                    xmlMemBlocks() - mem_base);
26617             test_ret++;
26618             printf(" %d", n_ctxt);
26619             printf(" %d", n_doc);
26620             printf(" %d", n_nota);
26621             printf("\n");
26622         }
26623     }
26624     }
26625     }
26626     function_tests++;
26627 #endif
26628
26629     return(test_ret);
26630 }
26631
26632
26633 static int
26634 test_xmlValidateNotationUse(void) {
26635     int test_ret = 0;
26636
26637 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26638     int mem_base;
26639     int ret_val;
26640     xmlValidCtxtPtr ctxt; /* the validation context */
26641     int n_ctxt;
26642     xmlDocPtr doc; /* the document */
26643     int n_doc;
26644     xmlChar * notationName; /* the notation name to check */
26645     int n_notationName;
26646
26647     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26648     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26649     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26650         mem_base = xmlMemBlocks();
26651         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26652         doc = gen_xmlDocPtr(n_doc, 1);
26653         notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26654
26655         ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26656         desret_int(ret_val);
26657         call_tests++;
26658         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26659         des_xmlDocPtr(n_doc, doc, 1);
26660         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26661         xmlResetLastError();
26662         if (mem_base != xmlMemBlocks()) {
26663             printf("Leak of %d blocks found in xmlValidateNotationUse",
26664                    xmlMemBlocks() - mem_base);
26665             test_ret++;
26666             printf(" %d", n_ctxt);
26667             printf(" %d", n_doc);
26668             printf(" %d", n_notationName);
26669             printf("\n");
26670         }
26671     }
26672     }
26673     }
26674     function_tests++;
26675 #endif
26676
26677     return(test_ret);
26678 }
26679
26680
26681 static int
26682 test_xmlValidateOneAttribute(void) {
26683     int test_ret = 0;
26684
26685 #if defined(LIBXML_VALID_ENABLED)
26686     int mem_base;
26687     int ret_val;
26688     xmlValidCtxtPtr ctxt; /* the validation context */
26689     int n_ctxt;
26690     xmlDocPtr doc; /* a document instance */
26691     int n_doc;
26692     xmlNodePtr elem; /* an element instance */
26693     int n_elem;
26694     xmlAttrPtr attr; /* an attribute instance */
26695     int n_attr;
26696     xmlChar * value; /* the attribute value (without entities processing) */
26697     int n_value;
26698
26699     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26700     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26701     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26702     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26703     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26704         mem_base = xmlMemBlocks();
26705         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26706         doc = gen_xmlDocPtr(n_doc, 1);
26707         elem = gen_xmlNodePtr(n_elem, 2);
26708         attr = gen_xmlAttrPtr(n_attr, 3);
26709         value = gen_const_xmlChar_ptr(n_value, 4);
26710
26711         ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26712         desret_int(ret_val);
26713         call_tests++;
26714         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26715         des_xmlDocPtr(n_doc, doc, 1);
26716         des_xmlNodePtr(n_elem, elem, 2);
26717         des_xmlAttrPtr(n_attr, attr, 3);
26718         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26719         xmlResetLastError();
26720         if (mem_base != xmlMemBlocks()) {
26721             printf("Leak of %d blocks found in xmlValidateOneAttribute",
26722                    xmlMemBlocks() - mem_base);
26723             test_ret++;
26724             printf(" %d", n_ctxt);
26725             printf(" %d", n_doc);
26726             printf(" %d", n_elem);
26727             printf(" %d", n_attr);
26728             printf(" %d", n_value);
26729             printf("\n");
26730         }
26731     }
26732     }
26733     }
26734     }
26735     }
26736     function_tests++;
26737 #endif
26738
26739     return(test_ret);
26740 }
26741
26742
26743 static int
26744 test_xmlValidateOneElement(void) {
26745     int test_ret = 0;
26746
26747 #if defined(LIBXML_VALID_ENABLED)
26748     int mem_base;
26749     int ret_val;
26750     xmlValidCtxtPtr ctxt; /* the validation context */
26751     int n_ctxt;
26752     xmlDocPtr doc; /* a document instance */
26753     int n_doc;
26754     xmlNodePtr elem; /* an element instance */
26755     int n_elem;
26756
26757     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26758     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26759     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26760         mem_base = xmlMemBlocks();
26761         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26762         doc = gen_xmlDocPtr(n_doc, 1);
26763         elem = gen_xmlNodePtr(n_elem, 2);
26764
26765         ret_val = xmlValidateOneElement(ctxt, doc, elem);
26766         desret_int(ret_val);
26767         call_tests++;
26768         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26769         des_xmlDocPtr(n_doc, doc, 1);
26770         des_xmlNodePtr(n_elem, elem, 2);
26771         xmlResetLastError();
26772         if (mem_base != xmlMemBlocks()) {
26773             printf("Leak of %d blocks found in xmlValidateOneElement",
26774                    xmlMemBlocks() - mem_base);
26775             test_ret++;
26776             printf(" %d", n_ctxt);
26777             printf(" %d", n_doc);
26778             printf(" %d", n_elem);
26779             printf("\n");
26780         }
26781     }
26782     }
26783     }
26784     function_tests++;
26785 #endif
26786
26787     return(test_ret);
26788 }
26789
26790
26791 static int
26792 test_xmlValidateOneNamespace(void) {
26793     int test_ret = 0;
26794
26795 #if defined(LIBXML_VALID_ENABLED)
26796     int mem_base;
26797     int ret_val;
26798     xmlValidCtxtPtr ctxt; /* the validation context */
26799     int n_ctxt;
26800     xmlDocPtr doc; /* a document instance */
26801     int n_doc;
26802     xmlNodePtr elem; /* an element instance */
26803     int n_elem;
26804     xmlChar * prefix; /* the namespace prefix */
26805     int n_prefix;
26806     xmlNsPtr ns; /* an namespace declaration instance */
26807     int n_ns;
26808     xmlChar * value; /* the attribute value (without entities processing) */
26809     int n_value;
26810
26811     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26812     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26813     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26814     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26815     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26816     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26817         mem_base = xmlMemBlocks();
26818         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26819         doc = gen_xmlDocPtr(n_doc, 1);
26820         elem = gen_xmlNodePtr(n_elem, 2);
26821         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26822         ns = gen_xmlNsPtr(n_ns, 4);
26823         value = gen_const_xmlChar_ptr(n_value, 5);
26824
26825         ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26826         desret_int(ret_val);
26827         call_tests++;
26828         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26829         des_xmlDocPtr(n_doc, doc, 1);
26830         des_xmlNodePtr(n_elem, elem, 2);
26831         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26832         des_xmlNsPtr(n_ns, ns, 4);
26833         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26834         xmlResetLastError();
26835         if (mem_base != xmlMemBlocks()) {
26836             printf("Leak of %d blocks found in xmlValidateOneNamespace",
26837                    xmlMemBlocks() - mem_base);
26838             test_ret++;
26839             printf(" %d", n_ctxt);
26840             printf(" %d", n_doc);
26841             printf(" %d", n_elem);
26842             printf(" %d", n_prefix);
26843             printf(" %d", n_ns);
26844             printf(" %d", n_value);
26845             printf("\n");
26846         }
26847     }
26848     }
26849     }
26850     }
26851     }
26852     }
26853     function_tests++;
26854 #endif
26855
26856     return(test_ret);
26857 }
26858
26859
26860 static int
26861 test_xmlValidatePopElement(void) {
26862     int test_ret = 0;
26863
26864 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26865     int mem_base;
26866     int ret_val;
26867     xmlValidCtxtPtr ctxt; /* the validation context */
26868     int n_ctxt;
26869     xmlDocPtr doc; /* a document instance */
26870     int n_doc;
26871     xmlNodePtr elem; /* an element instance */
26872     int n_elem;
26873     xmlChar * qname; /* the qualified name as appearing in the serialization */
26874     int n_qname;
26875
26876     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26877     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26878     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26879     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26880         mem_base = xmlMemBlocks();
26881         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26882         doc = gen_xmlDocPtr(n_doc, 1);
26883         elem = gen_xmlNodePtr(n_elem, 2);
26884         qname = gen_const_xmlChar_ptr(n_qname, 3);
26885
26886         ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26887         desret_int(ret_val);
26888         call_tests++;
26889         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26890         des_xmlDocPtr(n_doc, doc, 1);
26891         des_xmlNodePtr(n_elem, elem, 2);
26892         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26893         xmlResetLastError();
26894         if (mem_base != xmlMemBlocks()) {
26895             printf("Leak of %d blocks found in xmlValidatePopElement",
26896                    xmlMemBlocks() - mem_base);
26897             test_ret++;
26898             printf(" %d", n_ctxt);
26899             printf(" %d", n_doc);
26900             printf(" %d", n_elem);
26901             printf(" %d", n_qname);
26902             printf("\n");
26903         }
26904     }
26905     }
26906     }
26907     }
26908     function_tests++;
26909 #endif
26910
26911     return(test_ret);
26912 }
26913
26914
26915 static int
26916 test_xmlValidatePushCData(void) {
26917     int test_ret = 0;
26918
26919 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26920     int mem_base;
26921     int ret_val;
26922     xmlValidCtxtPtr ctxt; /* the validation context */
26923     int n_ctxt;
26924     xmlChar * data; /* some character data read */
26925     int n_data;
26926     int len; /* the lenght of the data */
26927     int n_len;
26928
26929     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26930     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26931     for (n_len = 0;n_len < gen_nb_int;n_len++) {
26932         mem_base = xmlMemBlocks();
26933         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26934         data = gen_const_xmlChar_ptr(n_data, 1);
26935         len = gen_int(n_len, 2);
26936
26937         ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26938         desret_int(ret_val);
26939         call_tests++;
26940         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26941         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26942         des_int(n_len, len, 2);
26943         xmlResetLastError();
26944         if (mem_base != xmlMemBlocks()) {
26945             printf("Leak of %d blocks found in xmlValidatePushCData",
26946                    xmlMemBlocks() - mem_base);
26947             test_ret++;
26948             printf(" %d", n_ctxt);
26949             printf(" %d", n_data);
26950             printf(" %d", n_len);
26951             printf("\n");
26952         }
26953     }
26954     }
26955     }
26956     function_tests++;
26957 #endif
26958
26959     return(test_ret);
26960 }
26961
26962
26963 static int
26964 test_xmlValidatePushElement(void) {
26965     int test_ret = 0;
26966
26967 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26968     int mem_base;
26969     int ret_val;
26970     xmlValidCtxtPtr ctxt; /* the validation context */
26971     int n_ctxt;
26972     xmlDocPtr doc; /* a document instance */
26973     int n_doc;
26974     xmlNodePtr elem; /* an element instance */
26975     int n_elem;
26976     xmlChar * qname; /* the qualified name as appearing in the serialization */
26977     int n_qname;
26978
26979     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26980     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26981     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26982     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26983         mem_base = xmlMemBlocks();
26984         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26985         doc = gen_xmlDocPtr(n_doc, 1);
26986         elem = gen_xmlNodePtr(n_elem, 2);
26987         qname = gen_const_xmlChar_ptr(n_qname, 3);
26988
26989         ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26990         desret_int(ret_val);
26991         call_tests++;
26992         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26993         des_xmlDocPtr(n_doc, doc, 1);
26994         des_xmlNodePtr(n_elem, elem, 2);
26995         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26996         xmlResetLastError();
26997         if (mem_base != xmlMemBlocks()) {
26998             printf("Leak of %d blocks found in xmlValidatePushElement",
26999                    xmlMemBlocks() - mem_base);
27000             test_ret++;
27001             printf(" %d", n_ctxt);
27002             printf(" %d", n_doc);
27003             printf(" %d", n_elem);
27004             printf(" %d", n_qname);
27005             printf("\n");
27006         }
27007     }
27008     }
27009     }
27010     }
27011     function_tests++;
27012 #endif
27013
27014     return(test_ret);
27015 }
27016
27017
27018 static int
27019 test_xmlValidateRoot(void) {
27020     int test_ret = 0;
27021
27022 #if defined(LIBXML_VALID_ENABLED)
27023     int mem_base;
27024     int ret_val;
27025     xmlValidCtxtPtr ctxt; /* the validation context */
27026     int n_ctxt;
27027     xmlDocPtr doc; /* a document instance */
27028     int n_doc;
27029
27030     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27031     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27032         mem_base = xmlMemBlocks();
27033         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27034         doc = gen_xmlDocPtr(n_doc, 1);
27035
27036         ret_val = xmlValidateRoot(ctxt, doc);
27037         desret_int(ret_val);
27038         call_tests++;
27039         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27040         des_xmlDocPtr(n_doc, doc, 1);
27041         xmlResetLastError();
27042         if (mem_base != xmlMemBlocks()) {
27043             printf("Leak of %d blocks found in xmlValidateRoot",
27044                    xmlMemBlocks() - mem_base);
27045             test_ret++;
27046             printf(" %d", n_ctxt);
27047             printf(" %d", n_doc);
27048             printf("\n");
27049         }
27050     }
27051     }
27052     function_tests++;
27053 #endif
27054
27055     return(test_ret);
27056 }
27057
27058 static int
27059 test_valid(void) {
27060     int test_ret = 0;
27061
27062     if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27063     test_ret += test_xmlAddAttributeDecl();
27064     test_ret += test_xmlAddElementDecl();
27065     test_ret += test_xmlAddID();
27066     test_ret += test_xmlAddNotationDecl();
27067     test_ret += test_xmlAddRef();
27068     test_ret += test_xmlCopyAttributeTable();
27069     test_ret += test_xmlCopyDocElementContent();
27070     test_ret += test_xmlCopyElementContent();
27071     test_ret += test_xmlCopyElementTable();
27072     test_ret += test_xmlCopyEnumeration();
27073     test_ret += test_xmlCopyNotationTable();
27074     test_ret += test_xmlCreateEnumeration();
27075     test_ret += test_xmlDumpAttributeDecl();
27076     test_ret += test_xmlDumpAttributeTable();
27077     test_ret += test_xmlDumpElementDecl();
27078     test_ret += test_xmlDumpElementTable();
27079     test_ret += test_xmlDumpNotationDecl();
27080     test_ret += test_xmlDumpNotationTable();
27081     test_ret += test_xmlGetDtdAttrDesc();
27082     test_ret += test_xmlGetDtdElementDesc();
27083     test_ret += test_xmlGetDtdNotationDesc();
27084     test_ret += test_xmlGetDtdQAttrDesc();
27085     test_ret += test_xmlGetDtdQElementDesc();
27086     test_ret += test_xmlGetID();
27087     test_ret += test_xmlGetRefs();
27088     test_ret += test_xmlIsID();
27089     test_ret += test_xmlIsMixedElement();
27090     test_ret += test_xmlIsRef();
27091     test_ret += test_xmlNewDocElementContent();
27092     test_ret += test_xmlNewElementContent();
27093     test_ret += test_xmlNewValidCtxt();
27094     test_ret += test_xmlRemoveID();
27095     test_ret += test_xmlRemoveRef();
27096     test_ret += test_xmlSnprintfElementContent();
27097     test_ret += test_xmlSprintfElementContent();
27098     test_ret += test_xmlValidBuildContentModel();
27099     test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27100     test_ret += test_xmlValidGetPotentialChildren();
27101     test_ret += test_xmlValidGetValidElements();
27102     test_ret += test_xmlValidNormalizeAttributeValue();
27103     test_ret += test_xmlValidateAttributeDecl();
27104     test_ret += test_xmlValidateAttributeValue();
27105     test_ret += test_xmlValidateDocument();
27106     test_ret += test_xmlValidateDocumentFinal();
27107     test_ret += test_xmlValidateDtd();
27108     test_ret += test_xmlValidateDtdFinal();
27109     test_ret += test_xmlValidateElement();
27110     test_ret += test_xmlValidateElementDecl();
27111     test_ret += test_xmlValidateNameValue();
27112     test_ret += test_xmlValidateNamesValue();
27113     test_ret += test_xmlValidateNmtokenValue();
27114     test_ret += test_xmlValidateNmtokensValue();
27115     test_ret += test_xmlValidateNotationDecl();
27116     test_ret += test_xmlValidateNotationUse();
27117     test_ret += test_xmlValidateOneAttribute();
27118     test_ret += test_xmlValidateOneElement();
27119     test_ret += test_xmlValidateOneNamespace();
27120     test_ret += test_xmlValidatePopElement();
27121     test_ret += test_xmlValidatePushCData();
27122     test_ret += test_xmlValidatePushElement();
27123     test_ret += test_xmlValidateRoot();
27124
27125     if (test_ret != 0)
27126         printf("Module valid: %d errors\n", test_ret);
27127     return(test_ret);
27128 }
27129
27130 static int
27131 test_xmlXIncludeNewContext(void) {
27132     int test_ret = 0;
27133
27134
27135     /* missing type support */
27136     return(test_ret);
27137 }
27138
27139
27140 static int
27141 test_xmlXIncludeProcess(void) {
27142     int test_ret = 0;
27143
27144 #if defined(LIBXML_XINCLUDE_ENABLED)
27145     int mem_base;
27146     int ret_val;
27147     xmlDocPtr doc; /* an XML document */
27148     int n_doc;
27149
27150     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27151         mem_base = xmlMemBlocks();
27152         doc = gen_xmlDocPtr(n_doc, 0);
27153
27154         ret_val = xmlXIncludeProcess(doc);
27155         desret_int(ret_val);
27156         call_tests++;
27157         des_xmlDocPtr(n_doc, doc, 0);
27158         xmlResetLastError();
27159         if (mem_base != xmlMemBlocks()) {
27160             printf("Leak of %d blocks found in xmlXIncludeProcess",
27161                    xmlMemBlocks() - mem_base);
27162             test_ret++;
27163             printf(" %d", n_doc);
27164             printf("\n");
27165         }
27166     }
27167     function_tests++;
27168 #endif
27169
27170     return(test_ret);
27171 }
27172
27173
27174 static int
27175 test_xmlXIncludeProcessFlags(void) {
27176     int test_ret = 0;
27177
27178 #if defined(LIBXML_XINCLUDE_ENABLED)
27179     int mem_base;
27180     int ret_val;
27181     xmlDocPtr doc; /* an XML document */
27182     int n_doc;
27183     int flags; /* a set of xmlParserOption used for parsing XML includes */
27184     int n_flags;
27185
27186     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27187     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27188         mem_base = xmlMemBlocks();
27189         doc = gen_xmlDocPtr(n_doc, 0);
27190         flags = gen_int(n_flags, 1);
27191
27192         ret_val = xmlXIncludeProcessFlags(doc, flags);
27193         desret_int(ret_val);
27194         call_tests++;
27195         des_xmlDocPtr(n_doc, doc, 0);
27196         des_int(n_flags, flags, 1);
27197         xmlResetLastError();
27198         if (mem_base != xmlMemBlocks()) {
27199             printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27200                    xmlMemBlocks() - mem_base);
27201             test_ret++;
27202             printf(" %d", n_doc);
27203             printf(" %d", n_flags);
27204             printf("\n");
27205         }
27206     }
27207     }
27208     function_tests++;
27209 #endif
27210
27211     return(test_ret);
27212 }
27213
27214
27215 static int
27216 test_xmlXIncludeProcessFlagsData(void) {
27217     int test_ret = 0;
27218
27219 #if defined(LIBXML_XINCLUDE_ENABLED)
27220     int mem_base;
27221     int ret_val;
27222     xmlDocPtr doc; /* an XML document */
27223     int n_doc;
27224     int flags; /* a set of xmlParserOption used for parsing XML includes */
27225     int n_flags;
27226     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27227     int n_data;
27228
27229     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27230     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27231     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27232         mem_base = xmlMemBlocks();
27233         doc = gen_xmlDocPtr(n_doc, 0);
27234         flags = gen_int(n_flags, 1);
27235         data = gen_userdata(n_data, 2);
27236
27237         ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27238         desret_int(ret_val);
27239         call_tests++;
27240         des_xmlDocPtr(n_doc, doc, 0);
27241         des_int(n_flags, flags, 1);
27242         des_userdata(n_data, data, 2);
27243         xmlResetLastError();
27244         if (mem_base != xmlMemBlocks()) {
27245             printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27246                    xmlMemBlocks() - mem_base);
27247             test_ret++;
27248             printf(" %d", n_doc);
27249             printf(" %d", n_flags);
27250             printf(" %d", n_data);
27251             printf("\n");
27252         }
27253     }
27254     }
27255     }
27256     function_tests++;
27257 #endif
27258
27259     return(test_ret);
27260 }
27261
27262 #ifdef LIBXML_XINCLUDE_ENABLED
27263
27264 #define gen_nb_xmlXIncludeCtxtPtr 1
27265 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27266     return(NULL);
27267 }
27268 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27269 }
27270 #endif
27271
27272
27273 static int
27274 test_xmlXIncludeProcessNode(void) {
27275     int test_ret = 0;
27276
27277 #if defined(LIBXML_XINCLUDE_ENABLED)
27278     int mem_base;
27279     int ret_val;
27280     xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27281     int n_ctxt;
27282     xmlNodePtr node; /* a node in an XML document */
27283     int n_node;
27284
27285     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27286     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27287         mem_base = xmlMemBlocks();
27288         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27289         node = gen_xmlNodePtr(n_node, 1);
27290
27291         ret_val = xmlXIncludeProcessNode(ctxt, node);
27292         desret_int(ret_val);
27293         call_tests++;
27294         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27295         des_xmlNodePtr(n_node, node, 1);
27296         xmlResetLastError();
27297         if (mem_base != xmlMemBlocks()) {
27298             printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27299                    xmlMemBlocks() - mem_base);
27300             test_ret++;
27301             printf(" %d", n_ctxt);
27302             printf(" %d", n_node);
27303             printf("\n");
27304         }
27305     }
27306     }
27307     function_tests++;
27308 #endif
27309
27310     return(test_ret);
27311 }
27312
27313
27314 static int
27315 test_xmlXIncludeProcessTree(void) {
27316     int test_ret = 0;
27317
27318 #if defined(LIBXML_XINCLUDE_ENABLED)
27319     int mem_base;
27320     int ret_val;
27321     xmlNodePtr tree; /* a node in an XML document */
27322     int n_tree;
27323
27324     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27325         mem_base = xmlMemBlocks();
27326         tree = gen_xmlNodePtr(n_tree, 0);
27327
27328         ret_val = xmlXIncludeProcessTree(tree);
27329         desret_int(ret_val);
27330         call_tests++;
27331         des_xmlNodePtr(n_tree, tree, 0);
27332         xmlResetLastError();
27333         if (mem_base != xmlMemBlocks()) {
27334             printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27335                    xmlMemBlocks() - mem_base);
27336             test_ret++;
27337             printf(" %d", n_tree);
27338             printf("\n");
27339         }
27340     }
27341     function_tests++;
27342 #endif
27343
27344     return(test_ret);
27345 }
27346
27347
27348 static int
27349 test_xmlXIncludeProcessTreeFlags(void) {
27350     int test_ret = 0;
27351
27352 #if defined(LIBXML_XINCLUDE_ENABLED)
27353     int mem_base;
27354     int ret_val;
27355     xmlNodePtr tree; /* a node in an XML document */
27356     int n_tree;
27357     int flags; /* a set of xmlParserOption used for parsing XML includes */
27358     int n_flags;
27359
27360     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27361     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27362         mem_base = xmlMemBlocks();
27363         tree = gen_xmlNodePtr(n_tree, 0);
27364         flags = gen_int(n_flags, 1);
27365
27366         ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27367         desret_int(ret_val);
27368         call_tests++;
27369         des_xmlNodePtr(n_tree, tree, 0);
27370         des_int(n_flags, flags, 1);
27371         xmlResetLastError();
27372         if (mem_base != xmlMemBlocks()) {
27373             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27374                    xmlMemBlocks() - mem_base);
27375             test_ret++;
27376             printf(" %d", n_tree);
27377             printf(" %d", n_flags);
27378             printf("\n");
27379         }
27380     }
27381     }
27382     function_tests++;
27383 #endif
27384
27385     return(test_ret);
27386 }
27387
27388
27389 static int
27390 test_xmlXIncludeProcessTreeFlagsData(void) {
27391     int test_ret = 0;
27392
27393 #if defined(LIBXML_XINCLUDE_ENABLED)
27394     int mem_base;
27395     int ret_val;
27396     xmlNodePtr tree; /* an XML node */
27397     int n_tree;
27398     int flags; /* a set of xmlParserOption used for parsing XML includes */
27399     int n_flags;
27400     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27401     int n_data;
27402
27403     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27404     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27405     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27406         mem_base = xmlMemBlocks();
27407         tree = gen_xmlNodePtr(n_tree, 0);
27408         flags = gen_int(n_flags, 1);
27409         data = gen_userdata(n_data, 2);
27410
27411         ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27412         desret_int(ret_val);
27413         call_tests++;
27414         des_xmlNodePtr(n_tree, tree, 0);
27415         des_int(n_flags, flags, 1);
27416         des_userdata(n_data, data, 2);
27417         xmlResetLastError();
27418         if (mem_base != xmlMemBlocks()) {
27419             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27420                    xmlMemBlocks() - mem_base);
27421             test_ret++;
27422             printf(" %d", n_tree);
27423             printf(" %d", n_flags);
27424             printf(" %d", n_data);
27425             printf("\n");
27426         }
27427     }
27428     }
27429     }
27430     function_tests++;
27431 #endif
27432
27433     return(test_ret);
27434 }
27435
27436
27437 static int
27438 test_xmlXIncludeSetFlags(void) {
27439     int test_ret = 0;
27440
27441 #if defined(LIBXML_XINCLUDE_ENABLED)
27442     int mem_base;
27443     int ret_val;
27444     xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27445     int n_ctxt;
27446     int flags; /* a set of xmlParserOption used for parsing XML includes */
27447     int n_flags;
27448
27449     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27450     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27451         mem_base = xmlMemBlocks();
27452         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27453         flags = gen_int(n_flags, 1);
27454
27455         ret_val = xmlXIncludeSetFlags(ctxt, flags);
27456         desret_int(ret_val);
27457         call_tests++;
27458         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27459         des_int(n_flags, flags, 1);
27460         xmlResetLastError();
27461         if (mem_base != xmlMemBlocks()) {
27462             printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27463                    xmlMemBlocks() - mem_base);
27464             test_ret++;
27465             printf(" %d", n_ctxt);
27466             printf(" %d", n_flags);
27467             printf("\n");
27468         }
27469     }
27470     }
27471     function_tests++;
27472 #endif
27473
27474     return(test_ret);
27475 }
27476
27477 static int
27478 test_xinclude(void) {
27479     int test_ret = 0;
27480
27481     if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27482     test_ret += test_xmlXIncludeNewContext();
27483     test_ret += test_xmlXIncludeProcess();
27484     test_ret += test_xmlXIncludeProcessFlags();
27485     test_ret += test_xmlXIncludeProcessFlagsData();
27486     test_ret += test_xmlXIncludeProcessNode();
27487     test_ret += test_xmlXIncludeProcessTree();
27488     test_ret += test_xmlXIncludeProcessTreeFlags();
27489     test_ret += test_xmlXIncludeProcessTreeFlagsData();
27490     test_ret += test_xmlXIncludeSetFlags();
27491
27492     if (test_ret != 0)
27493         printf("Module xinclude: %d errors\n", test_ret);
27494     return(test_ret);
27495 }
27496
27497 static int
27498 test_xmlAllocOutputBuffer(void) {
27499     int test_ret = 0;
27500
27501 #if defined(LIBXML_OUTPUT_ENABLED)
27502     int mem_base;
27503     xmlOutputBufferPtr ret_val;
27504     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27505     int n_encoder;
27506
27507     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27508         mem_base = xmlMemBlocks();
27509         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27510
27511         ret_val = xmlAllocOutputBuffer(encoder);
27512         desret_xmlOutputBufferPtr(ret_val);
27513         call_tests++;
27514         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27515         xmlResetLastError();
27516         if (mem_base != xmlMemBlocks()) {
27517             printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27518                    xmlMemBlocks() - mem_base);
27519             test_ret++;
27520             printf(" %d", n_encoder);
27521             printf("\n");
27522         }
27523     }
27524     function_tests++;
27525 #endif
27526
27527     return(test_ret);
27528 }
27529
27530
27531 static int
27532 test_xmlAllocParserInputBuffer(void) {
27533     int test_ret = 0;
27534
27535     int mem_base;
27536     xmlParserInputBufferPtr ret_val;
27537     xmlCharEncoding enc; /* the charset encoding if known */
27538     int n_enc;
27539
27540     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27541         mem_base = xmlMemBlocks();
27542         enc = gen_xmlCharEncoding(n_enc, 0);
27543
27544         ret_val = xmlAllocParserInputBuffer(enc);
27545         desret_xmlParserInputBufferPtr(ret_val);
27546         call_tests++;
27547         des_xmlCharEncoding(n_enc, enc, 0);
27548         xmlResetLastError();
27549         if (mem_base != xmlMemBlocks()) {
27550             printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27551                    xmlMemBlocks() - mem_base);
27552             test_ret++;
27553             printf(" %d", n_enc);
27554             printf("\n");
27555         }
27556     }
27557     function_tests++;
27558
27559     return(test_ret);
27560 }
27561
27562
27563 static int
27564 test_xmlCheckFilename(void) {
27565     int test_ret = 0;
27566
27567     int mem_base;
27568     int ret_val;
27569     char * path; /* the path to check */
27570     int n_path;
27571
27572     for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27573         mem_base = xmlMemBlocks();
27574         path = gen_const_char_ptr(n_path, 0);
27575
27576         ret_val = xmlCheckFilename((const char *)path);
27577         desret_int(ret_val);
27578         call_tests++;
27579         des_const_char_ptr(n_path, (const char *)path, 0);
27580         xmlResetLastError();
27581         if (mem_base != xmlMemBlocks()) {
27582             printf("Leak of %d blocks found in xmlCheckFilename",
27583                    xmlMemBlocks() - mem_base);
27584             test_ret++;
27585             printf(" %d", n_path);
27586             printf("\n");
27587         }
27588     }
27589     function_tests++;
27590
27591     return(test_ret);
27592 }
27593
27594
27595 static int
27596 test_xmlCheckHTTPInput(void) {
27597     int test_ret = 0;
27598
27599     int mem_base;
27600     xmlParserInputPtr ret_val;
27601     xmlParserCtxtPtr ctxt; /* an XML parser context */
27602     int n_ctxt;
27603     xmlParserInputPtr ret; /* an XML parser input */
27604     int n_ret;
27605
27606     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27607     for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27608         mem_base = xmlMemBlocks();
27609         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27610         ret = gen_xmlParserInputPtr(n_ret, 1);
27611
27612         ret_val = xmlCheckHTTPInput(ctxt, ret);
27613         desret_xmlParserInputPtr(ret_val);
27614         call_tests++;
27615         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27616         des_xmlParserInputPtr(n_ret, ret, 1);
27617         xmlResetLastError();
27618         if (mem_base != xmlMemBlocks()) {
27619             printf("Leak of %d blocks found in xmlCheckHTTPInput",
27620                    xmlMemBlocks() - mem_base);
27621             test_ret++;
27622             printf(" %d", n_ctxt);
27623             printf(" %d", n_ret);
27624             printf("\n");
27625         }
27626     }
27627     }
27628     function_tests++;
27629
27630     return(test_ret);
27631 }
27632
27633
27634 static int
27635 test_xmlCleanupInputCallbacks(void) {
27636     int test_ret = 0;
27637
27638     int mem_base;
27639
27640         mem_base = xmlMemBlocks();
27641
27642         xmlCleanupInputCallbacks();
27643         call_tests++;
27644         xmlResetLastError();
27645         if (mem_base != xmlMemBlocks()) {
27646             printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27647                    xmlMemBlocks() - mem_base);
27648             test_ret++;
27649             printf("\n");
27650         }
27651     function_tests++;
27652
27653     return(test_ret);
27654 }
27655
27656
27657 static int
27658 test_xmlCleanupOutputCallbacks(void) {
27659     int test_ret = 0;
27660
27661 #if defined(LIBXML_OUTPUT_ENABLED)
27662     int mem_base;
27663
27664         mem_base = xmlMemBlocks();
27665
27666         xmlCleanupOutputCallbacks();
27667         call_tests++;
27668         xmlResetLastError();
27669         if (mem_base != xmlMemBlocks()) {
27670             printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27671                    xmlMemBlocks() - mem_base);
27672             test_ret++;
27673             printf("\n");
27674         }
27675     function_tests++;
27676 #endif
27677
27678     return(test_ret);
27679 }
27680
27681
27682 static int
27683 test_xmlFileClose(void) {
27684     int test_ret = 0;
27685
27686     int mem_base;
27687     int ret_val;
27688     void * context; /* the I/O context */
27689     int n_context;
27690
27691     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27692         mem_base = xmlMemBlocks();
27693         context = gen_void_ptr(n_context, 0);
27694
27695         ret_val = xmlFileClose(context);
27696         desret_int(ret_val);
27697         call_tests++;
27698         des_void_ptr(n_context, context, 0);
27699         xmlResetLastError();
27700         if (mem_base != xmlMemBlocks()) {
27701             printf("Leak of %d blocks found in xmlFileClose",
27702                    xmlMemBlocks() - mem_base);
27703             test_ret++;
27704             printf(" %d", n_context);
27705             printf("\n");
27706         }
27707     }
27708     function_tests++;
27709
27710     return(test_ret);
27711 }
27712
27713
27714 static int
27715 test_xmlFileMatch(void) {
27716     int test_ret = 0;
27717
27718     int mem_base;
27719     int ret_val;
27720     const char * filename; /* the URI for matching */
27721     int n_filename;
27722
27723     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27724         mem_base = xmlMemBlocks();
27725         filename = gen_filepath(n_filename, 0);
27726
27727         ret_val = xmlFileMatch(filename);
27728         desret_int(ret_val);
27729         call_tests++;
27730         des_filepath(n_filename, filename, 0);
27731         xmlResetLastError();
27732         if (mem_base != xmlMemBlocks()) {
27733             printf("Leak of %d blocks found in xmlFileMatch",
27734                    xmlMemBlocks() - mem_base);
27735             test_ret++;
27736             printf(" %d", n_filename);
27737             printf("\n");
27738         }
27739     }
27740     function_tests++;
27741
27742     return(test_ret);
27743 }
27744
27745
27746 static int
27747 test_xmlFileOpen(void) {
27748     int test_ret = 0;
27749
27750     int mem_base;
27751     void * ret_val;
27752     const char * filename; /* the URI for matching */
27753     int n_filename;
27754
27755     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27756         mem_base = xmlMemBlocks();
27757         filename = gen_filepath(n_filename, 0);
27758
27759         ret_val = xmlFileOpen(filename);
27760         desret_void_ptr(ret_val);
27761         call_tests++;
27762         des_filepath(n_filename, filename, 0);
27763         xmlResetLastError();
27764         if (mem_base != xmlMemBlocks()) {
27765             printf("Leak of %d blocks found in xmlFileOpen",
27766                    xmlMemBlocks() - mem_base);
27767             test_ret++;
27768             printf(" %d", n_filename);
27769             printf("\n");
27770         }
27771     }
27772     function_tests++;
27773
27774     return(test_ret);
27775 }
27776
27777
27778 static int
27779 test_xmlFileRead(void) {
27780     int test_ret = 0;
27781
27782     int mem_base;
27783     int ret_val;
27784     void * context; /* the I/O context */
27785     int n_context;
27786     char * buffer; /* where to drop data */
27787     int n_buffer;
27788     int len; /* number of bytes to write */
27789     int n_len;
27790
27791     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27792     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27793     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27794         mem_base = xmlMemBlocks();
27795         context = gen_void_ptr(n_context, 0);
27796         buffer = gen_char_ptr(n_buffer, 1);
27797         len = gen_int(n_len, 2);
27798
27799         ret_val = xmlFileRead(context, buffer, len);
27800         desret_int(ret_val);
27801         call_tests++;
27802         des_void_ptr(n_context, context, 0);
27803         des_char_ptr(n_buffer, buffer, 1);
27804         des_int(n_len, len, 2);
27805         xmlResetLastError();
27806         if (mem_base != xmlMemBlocks()) {
27807             printf("Leak of %d blocks found in xmlFileRead",
27808                    xmlMemBlocks() - mem_base);
27809             test_ret++;
27810             printf(" %d", n_context);
27811             printf(" %d", n_buffer);
27812             printf(" %d", n_len);
27813             printf("\n");
27814         }
27815     }
27816     }
27817     }
27818     function_tests++;
27819
27820     return(test_ret);
27821 }
27822
27823
27824 static int
27825 test_xmlIOFTPClose(void) {
27826     int test_ret = 0;
27827
27828 #if defined(LIBXML_FTP_ENABLED)
27829     int mem_base;
27830     int ret_val;
27831     void * context; /* the I/O context */
27832     int n_context;
27833
27834     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27835         mem_base = xmlMemBlocks();
27836         context = gen_void_ptr(n_context, 0);
27837
27838         ret_val = xmlIOFTPClose(context);
27839         desret_int(ret_val);
27840         call_tests++;
27841         des_void_ptr(n_context, context, 0);
27842         xmlResetLastError();
27843         if (mem_base != xmlMemBlocks()) {
27844             printf("Leak of %d blocks found in xmlIOFTPClose",
27845                    xmlMemBlocks() - mem_base);
27846             test_ret++;
27847             printf(" %d", n_context);
27848             printf("\n");
27849         }
27850     }
27851     function_tests++;
27852 #endif
27853
27854     return(test_ret);
27855 }
27856
27857
27858 static int
27859 test_xmlIOFTPMatch(void) {
27860     int test_ret = 0;
27861
27862 #if defined(LIBXML_FTP_ENABLED)
27863     int mem_base;
27864     int ret_val;
27865     const char * filename; /* the URI for matching */
27866     int n_filename;
27867
27868     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27869         mem_base = xmlMemBlocks();
27870         filename = gen_filepath(n_filename, 0);
27871
27872         ret_val = xmlIOFTPMatch(filename);
27873         desret_int(ret_val);
27874         call_tests++;
27875         des_filepath(n_filename, filename, 0);
27876         xmlResetLastError();
27877         if (mem_base != xmlMemBlocks()) {
27878             printf("Leak of %d blocks found in xmlIOFTPMatch",
27879                    xmlMemBlocks() - mem_base);
27880             test_ret++;
27881             printf(" %d", n_filename);
27882             printf("\n");
27883         }
27884     }
27885     function_tests++;
27886 #endif
27887
27888     return(test_ret);
27889 }
27890
27891
27892 static int
27893 test_xmlIOFTPOpen(void) {
27894     int test_ret = 0;
27895
27896 #if defined(LIBXML_FTP_ENABLED)
27897     int mem_base;
27898     void * ret_val;
27899     const char * filename; /* the URI for matching */
27900     int n_filename;
27901
27902     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27903         mem_base = xmlMemBlocks();
27904         filename = gen_filepath(n_filename, 0);
27905
27906         ret_val = xmlIOFTPOpen(filename);
27907         desret_void_ptr(ret_val);
27908         call_tests++;
27909         des_filepath(n_filename, filename, 0);
27910         xmlResetLastError();
27911         if (mem_base != xmlMemBlocks()) {
27912             printf("Leak of %d blocks found in xmlIOFTPOpen",
27913                    xmlMemBlocks() - mem_base);
27914             test_ret++;
27915             printf(" %d", n_filename);
27916             printf("\n");
27917         }
27918     }
27919     function_tests++;
27920 #endif
27921
27922     return(test_ret);
27923 }
27924
27925
27926 static int
27927 test_xmlIOFTPRead(void) {
27928     int test_ret = 0;
27929
27930 #if defined(LIBXML_FTP_ENABLED)
27931     int mem_base;
27932     int ret_val;
27933     void * context; /* the I/O context */
27934     int n_context;
27935     char * buffer; /* where to drop data */
27936     int n_buffer;
27937     int len; /* number of bytes to write */
27938     int n_len;
27939
27940     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27941     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27942     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27943         mem_base = xmlMemBlocks();
27944         context = gen_void_ptr(n_context, 0);
27945         buffer = gen_char_ptr(n_buffer, 1);
27946         len = gen_int(n_len, 2);
27947
27948         ret_val = xmlIOFTPRead(context, buffer, len);
27949         desret_int(ret_val);
27950         call_tests++;
27951         des_void_ptr(n_context, context, 0);
27952         des_char_ptr(n_buffer, buffer, 1);
27953         des_int(n_len, len, 2);
27954         xmlResetLastError();
27955         if (mem_base != xmlMemBlocks()) {
27956             printf("Leak of %d blocks found in xmlIOFTPRead",
27957                    xmlMemBlocks() - mem_base);
27958             test_ret++;
27959             printf(" %d", n_context);
27960             printf(" %d", n_buffer);
27961             printf(" %d", n_len);
27962             printf("\n");
27963         }
27964     }
27965     }
27966     }
27967     function_tests++;
27968 #endif
27969
27970     return(test_ret);
27971 }
27972
27973
27974 static int
27975 test_xmlIOHTTPClose(void) {
27976     int test_ret = 0;
27977
27978 #if defined(LIBXML_HTTP_ENABLED)
27979     int mem_base;
27980     int ret_val;
27981     void * context; /* the I/O context */
27982     int n_context;
27983
27984     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27985         mem_base = xmlMemBlocks();
27986         context = gen_void_ptr(n_context, 0);
27987
27988         ret_val = xmlIOHTTPClose(context);
27989         desret_int(ret_val);
27990         call_tests++;
27991         des_void_ptr(n_context, context, 0);
27992         xmlResetLastError();
27993         if (mem_base != xmlMemBlocks()) {
27994             printf("Leak of %d blocks found in xmlIOHTTPClose",
27995                    xmlMemBlocks() - mem_base);
27996             test_ret++;
27997             printf(" %d", n_context);
27998             printf("\n");
27999         }
28000     }
28001     function_tests++;
28002 #endif
28003
28004     return(test_ret);
28005 }
28006
28007
28008 static int
28009 test_xmlIOHTTPMatch(void) {
28010     int test_ret = 0;
28011
28012 #if defined(LIBXML_HTTP_ENABLED)
28013     int mem_base;
28014     int ret_val;
28015     const char * filename; /* the URI for matching */
28016     int n_filename;
28017
28018     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28019         mem_base = xmlMemBlocks();
28020         filename = gen_filepath(n_filename, 0);
28021
28022         ret_val = xmlIOHTTPMatch(filename);
28023         desret_int(ret_val);
28024         call_tests++;
28025         des_filepath(n_filename, filename, 0);
28026         xmlResetLastError();
28027         if (mem_base != xmlMemBlocks()) {
28028             printf("Leak of %d blocks found in xmlIOHTTPMatch",
28029                    xmlMemBlocks() - mem_base);
28030             test_ret++;
28031             printf(" %d", n_filename);
28032             printf("\n");
28033         }
28034     }
28035     function_tests++;
28036 #endif
28037
28038     return(test_ret);
28039 }
28040
28041
28042 static int
28043 test_xmlIOHTTPOpen(void) {
28044     int test_ret = 0;
28045
28046 #if defined(LIBXML_HTTP_ENABLED)
28047     int mem_base;
28048     void * ret_val;
28049     const char * filename; /* the URI for matching */
28050     int n_filename;
28051
28052     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28053         mem_base = xmlMemBlocks();
28054         filename = gen_filepath(n_filename, 0);
28055
28056         ret_val = xmlIOHTTPOpen(filename);
28057         desret_xmlNanoHTTPCtxtPtr(ret_val);
28058         call_tests++;
28059         des_filepath(n_filename, filename, 0);
28060         xmlResetLastError();
28061         if (mem_base != xmlMemBlocks()) {
28062             printf("Leak of %d blocks found in xmlIOHTTPOpen",
28063                    xmlMemBlocks() - mem_base);
28064             test_ret++;
28065             printf(" %d", n_filename);
28066             printf("\n");
28067         }
28068     }
28069     function_tests++;
28070 #endif
28071
28072     return(test_ret);
28073 }
28074
28075
28076 static int
28077 test_xmlIOHTTPRead(void) {
28078     int test_ret = 0;
28079
28080 #if defined(LIBXML_HTTP_ENABLED)
28081     int mem_base;
28082     int ret_val;
28083     void * context; /* the I/O context */
28084     int n_context;
28085     char * buffer; /* where to drop data */
28086     int n_buffer;
28087     int len; /* number of bytes to write */
28088     int n_len;
28089
28090     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28091     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28092     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28093         mem_base = xmlMemBlocks();
28094         context = gen_void_ptr(n_context, 0);
28095         buffer = gen_char_ptr(n_buffer, 1);
28096         len = gen_int(n_len, 2);
28097
28098         ret_val = xmlIOHTTPRead(context, buffer, len);
28099         desret_int(ret_val);
28100         call_tests++;
28101         des_void_ptr(n_context, context, 0);
28102         des_char_ptr(n_buffer, buffer, 1);
28103         des_int(n_len, len, 2);
28104         xmlResetLastError();
28105         if (mem_base != xmlMemBlocks()) {
28106             printf("Leak of %d blocks found in xmlIOHTTPRead",
28107                    xmlMemBlocks() - mem_base);
28108             test_ret++;
28109             printf(" %d", n_context);
28110             printf(" %d", n_buffer);
28111             printf(" %d", n_len);
28112             printf("\n");
28113         }
28114     }
28115     }
28116     }
28117     function_tests++;
28118 #endif
28119
28120     return(test_ret);
28121 }
28122
28123
28124 static int
28125 test_xmlNoNetExternalEntityLoader(void) {
28126     int test_ret = 0;
28127
28128     int mem_base;
28129     xmlParserInputPtr ret_val;
28130     const char * URL; /* the URL for the entity to load */
28131     int n_URL;
28132     char * ID; /* the System ID for the entity to load */
28133     int n_ID;
28134     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28135     int n_ctxt;
28136
28137     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28138     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28139     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28140         mem_base = xmlMemBlocks();
28141         URL = gen_filepath(n_URL, 0);
28142         ID = gen_const_char_ptr(n_ID, 1);
28143         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28144
28145         ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28146         desret_xmlParserInputPtr(ret_val);
28147         call_tests++;
28148         des_filepath(n_URL, URL, 0);
28149         des_const_char_ptr(n_ID, (const char *)ID, 1);
28150         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28151         xmlResetLastError();
28152         if (mem_base != xmlMemBlocks()) {
28153             printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28154                    xmlMemBlocks() - mem_base);
28155             test_ret++;
28156             printf(" %d", n_URL);
28157             printf(" %d", n_ID);
28158             printf(" %d", n_ctxt);
28159             printf("\n");
28160         }
28161     }
28162     }
28163     }
28164     function_tests++;
28165
28166     return(test_ret);
28167 }
28168
28169
28170 static int
28171 test_xmlNormalizeWindowsPath(void) {
28172     int test_ret = 0;
28173
28174     int mem_base;
28175     xmlChar * ret_val;
28176     xmlChar * path; /* the input file path */
28177     int n_path;
28178
28179     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28180         mem_base = xmlMemBlocks();
28181         path = gen_const_xmlChar_ptr(n_path, 0);
28182
28183         ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28184         desret_xmlChar_ptr(ret_val);
28185         call_tests++;
28186         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28187         xmlResetLastError();
28188         if (mem_base != xmlMemBlocks()) {
28189             printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28190                    xmlMemBlocks() - mem_base);
28191             test_ret++;
28192             printf(" %d", n_path);
28193             printf("\n");
28194         }
28195     }
28196     function_tests++;
28197
28198     return(test_ret);
28199 }
28200
28201
28202 static int
28203 test_xmlOutputBufferCreateBuffer(void) {
28204     int test_ret = 0;
28205
28206 #if defined(LIBXML_OUTPUT_ENABLED)
28207     int mem_base;
28208     xmlOutputBufferPtr ret_val;
28209     xmlBufferPtr buffer; /* a xmlBufferPtr */
28210     int n_buffer;
28211     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28212     int n_encoder;
28213
28214     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28215     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28216         mem_base = xmlMemBlocks();
28217         buffer = gen_xmlBufferPtr(n_buffer, 0);
28218         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28219
28220         ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28221         desret_xmlOutputBufferPtr(ret_val);
28222         call_tests++;
28223         des_xmlBufferPtr(n_buffer, buffer, 0);
28224         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28225         xmlResetLastError();
28226         if (mem_base != xmlMemBlocks()) {
28227             printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28228                    xmlMemBlocks() - mem_base);
28229             test_ret++;
28230             printf(" %d", n_buffer);
28231             printf(" %d", n_encoder);
28232             printf("\n");
28233         }
28234     }
28235     }
28236     function_tests++;
28237 #endif
28238
28239     return(test_ret);
28240 }
28241
28242
28243 static int
28244 test_xmlOutputBufferCreateFd(void) {
28245     int test_ret = 0;
28246
28247 #if defined(LIBXML_OUTPUT_ENABLED)
28248     int mem_base;
28249     xmlOutputBufferPtr ret_val;
28250     int fd; /* a file descriptor number */
28251     int n_fd;
28252     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28253     int n_encoder;
28254
28255     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28256     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28257         mem_base = xmlMemBlocks();
28258         fd = gen_int(n_fd, 0);
28259         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28260
28261         ret_val = xmlOutputBufferCreateFd(fd, encoder);
28262         desret_xmlOutputBufferPtr(ret_val);
28263         call_tests++;
28264         des_int(n_fd, fd, 0);
28265         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28266         xmlResetLastError();
28267         if (mem_base != xmlMemBlocks()) {
28268             printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28269                    xmlMemBlocks() - mem_base);
28270             test_ret++;
28271             printf(" %d", n_fd);
28272             printf(" %d", n_encoder);
28273             printf("\n");
28274         }
28275     }
28276     }
28277     function_tests++;
28278 #endif
28279
28280     return(test_ret);
28281 }
28282
28283
28284 static int
28285 test_xmlOutputBufferCreateFile(void) {
28286     int test_ret = 0;
28287
28288 #if defined(LIBXML_OUTPUT_ENABLED)
28289     int mem_base;
28290     xmlOutputBufferPtr ret_val;
28291     FILE * file; /* a FILE* */
28292     int n_file;
28293     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28294     int n_encoder;
28295
28296     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28297     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28298         mem_base = xmlMemBlocks();
28299         file = gen_FILE_ptr(n_file, 0);
28300         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28301
28302         ret_val = xmlOutputBufferCreateFile(file, encoder);
28303         desret_xmlOutputBufferPtr(ret_val);
28304         call_tests++;
28305         des_FILE_ptr(n_file, file, 0);
28306         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28307         xmlResetLastError();
28308         if (mem_base != xmlMemBlocks()) {
28309             printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28310                    xmlMemBlocks() - mem_base);
28311             test_ret++;
28312             printf(" %d", n_file);
28313             printf(" %d", n_encoder);
28314             printf("\n");
28315         }
28316     }
28317     }
28318     function_tests++;
28319 #endif
28320
28321     return(test_ret);
28322 }
28323
28324
28325 static int
28326 test_xmlOutputBufferCreateFilename(void) {
28327     int test_ret = 0;
28328
28329 #if defined(LIBXML_OUTPUT_ENABLED)
28330     int mem_base;
28331     xmlOutputBufferPtr ret_val;
28332     const char * URI; /* a C string containing the URI or filename */
28333     int n_URI;
28334     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28335     int n_encoder;
28336     int compression; /* the compression ration (0 none, 9 max). */
28337     int n_compression;
28338
28339     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28340     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28341     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28342         mem_base = xmlMemBlocks();
28343         URI = gen_fileoutput(n_URI, 0);
28344         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28345         compression = gen_int(n_compression, 2);
28346
28347         ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28348         desret_xmlOutputBufferPtr(ret_val);
28349         call_tests++;
28350         des_fileoutput(n_URI, URI, 0);
28351         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28352         des_int(n_compression, compression, 2);
28353         xmlResetLastError();
28354         if (mem_base != xmlMemBlocks()) {
28355             printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28356                    xmlMemBlocks() - mem_base);
28357             test_ret++;
28358             printf(" %d", n_URI);
28359             printf(" %d", n_encoder);
28360             printf(" %d", n_compression);
28361             printf("\n");
28362         }
28363     }
28364     }
28365     }
28366     function_tests++;
28367 #endif
28368
28369     return(test_ret);
28370 }
28371
28372
28373 static int
28374 test_xmlOutputBufferFlush(void) {
28375     int test_ret = 0;
28376
28377 #if defined(LIBXML_OUTPUT_ENABLED)
28378     int mem_base;
28379     int ret_val;
28380     xmlOutputBufferPtr out; /* a buffered output */
28381     int n_out;
28382
28383     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28384         mem_base = xmlMemBlocks();
28385         out = gen_xmlOutputBufferPtr(n_out, 0);
28386
28387         ret_val = xmlOutputBufferFlush(out);
28388         desret_int(ret_val);
28389         call_tests++;
28390         des_xmlOutputBufferPtr(n_out, out, 0);
28391         xmlResetLastError();
28392         if (mem_base != xmlMemBlocks()) {
28393             printf("Leak of %d blocks found in xmlOutputBufferFlush",
28394                    xmlMemBlocks() - mem_base);
28395             test_ret++;
28396             printf(" %d", n_out);
28397             printf("\n");
28398         }
28399     }
28400     function_tests++;
28401 #endif
28402
28403     return(test_ret);
28404 }
28405
28406
28407 static int
28408 test_xmlOutputBufferWrite(void) {
28409     int test_ret = 0;
28410
28411 #if defined(LIBXML_OUTPUT_ENABLED)
28412     int mem_base;
28413     int ret_val;
28414     xmlOutputBufferPtr out; /* a buffered parser output */
28415     int n_out;
28416     int len; /* the size in bytes of the array. */
28417     int n_len;
28418     char * buf; /* an char array */
28419     int n_buf;
28420
28421     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28422     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28423     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28424         mem_base = xmlMemBlocks();
28425         out = gen_xmlOutputBufferPtr(n_out, 0);
28426         len = gen_int(n_len, 1);
28427         buf = gen_const_char_ptr(n_buf, 2);
28428
28429         ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28430         desret_int(ret_val);
28431         call_tests++;
28432         des_xmlOutputBufferPtr(n_out, out, 0);
28433         des_int(n_len, len, 1);
28434         des_const_char_ptr(n_buf, (const char *)buf, 2);
28435         xmlResetLastError();
28436         if (mem_base != xmlMemBlocks()) {
28437             printf("Leak of %d blocks found in xmlOutputBufferWrite",
28438                    xmlMemBlocks() - mem_base);
28439             test_ret++;
28440             printf(" %d", n_out);
28441             printf(" %d", n_len);
28442             printf(" %d", n_buf);
28443             printf("\n");
28444         }
28445     }
28446     }
28447     }
28448     function_tests++;
28449 #endif
28450
28451     return(test_ret);
28452 }
28453
28454
28455 static int
28456 test_xmlOutputBufferWriteEscape(void) {
28457     int test_ret = 0;
28458
28459
28460     /* missing type support */
28461     return(test_ret);
28462 }
28463
28464
28465 static int
28466 test_xmlOutputBufferWriteString(void) {
28467     int test_ret = 0;
28468
28469 #if defined(LIBXML_OUTPUT_ENABLED)
28470     int mem_base;
28471     int ret_val;
28472     xmlOutputBufferPtr out; /* a buffered parser output */
28473     int n_out;
28474     char * str; /* a zero terminated C string */
28475     int n_str;
28476
28477     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28478     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28479         mem_base = xmlMemBlocks();
28480         out = gen_xmlOutputBufferPtr(n_out, 0);
28481         str = gen_const_char_ptr(n_str, 1);
28482
28483         ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28484         desret_int(ret_val);
28485         call_tests++;
28486         des_xmlOutputBufferPtr(n_out, out, 0);
28487         des_const_char_ptr(n_str, (const char *)str, 1);
28488         xmlResetLastError();
28489         if (mem_base != xmlMemBlocks()) {
28490             printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28491                    xmlMemBlocks() - mem_base);
28492             test_ret++;
28493             printf(" %d", n_out);
28494             printf(" %d", n_str);
28495             printf("\n");
28496         }
28497     }
28498     }
28499     function_tests++;
28500 #endif
28501
28502     return(test_ret);
28503 }
28504
28505
28506 static int
28507 test_xmlParserGetDirectory(void) {
28508     int test_ret = 0;
28509
28510
28511     /* missing type support */
28512     return(test_ret);
28513 }
28514
28515
28516 static int
28517 test_xmlParserInputBufferCreateFd(void) {
28518     int test_ret = 0;
28519
28520     int mem_base;
28521     xmlParserInputBufferPtr ret_val;
28522     int fd; /* a file descriptor number */
28523     int n_fd;
28524     xmlCharEncoding enc; /* the charset encoding if known */
28525     int n_enc;
28526
28527     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28528     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28529         mem_base = xmlMemBlocks();
28530         fd = gen_int(n_fd, 0);
28531         enc = gen_xmlCharEncoding(n_enc, 1);
28532         if (fd >= 0) fd = -1;
28533
28534         ret_val = xmlParserInputBufferCreateFd(fd, enc);
28535         desret_xmlParserInputBufferPtr(ret_val);
28536         call_tests++;
28537         des_int(n_fd, fd, 0);
28538         des_xmlCharEncoding(n_enc, enc, 1);
28539         xmlResetLastError();
28540         if (mem_base != xmlMemBlocks()) {
28541             printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28542                    xmlMemBlocks() - mem_base);
28543             test_ret++;
28544             printf(" %d", n_fd);
28545             printf(" %d", n_enc);
28546             printf("\n");
28547         }
28548     }
28549     }
28550     function_tests++;
28551
28552     return(test_ret);
28553 }
28554
28555
28556 static int
28557 test_xmlParserInputBufferCreateFile(void) {
28558     int test_ret = 0;
28559
28560     int mem_base;
28561     xmlParserInputBufferPtr ret_val;
28562     FILE * file; /* a FILE* */
28563     int n_file;
28564     xmlCharEncoding enc; /* the charset encoding if known */
28565     int n_enc;
28566
28567     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28568     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28569         mem_base = xmlMemBlocks();
28570         file = gen_FILE_ptr(n_file, 0);
28571         enc = gen_xmlCharEncoding(n_enc, 1);
28572
28573         ret_val = xmlParserInputBufferCreateFile(file, enc);
28574         desret_xmlParserInputBufferPtr(ret_val);
28575         call_tests++;
28576         des_FILE_ptr(n_file, file, 0);
28577         des_xmlCharEncoding(n_enc, enc, 1);
28578         xmlResetLastError();
28579         if (mem_base != xmlMemBlocks()) {
28580             printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28581                    xmlMemBlocks() - mem_base);
28582             test_ret++;
28583             printf(" %d", n_file);
28584             printf(" %d", n_enc);
28585             printf("\n");
28586         }
28587     }
28588     }
28589     function_tests++;
28590
28591     return(test_ret);
28592 }
28593
28594
28595 static int
28596 test_xmlParserInputBufferCreateFilename(void) {
28597     int test_ret = 0;
28598
28599     int mem_base;
28600     xmlParserInputBufferPtr ret_val;
28601     const char * URI; /* a C string containing the URI or filename */
28602     int n_URI;
28603     xmlCharEncoding enc; /* the charset encoding if known */
28604     int n_enc;
28605
28606     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28607     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28608         mem_base = xmlMemBlocks();
28609         URI = gen_fileoutput(n_URI, 0);
28610         enc = gen_xmlCharEncoding(n_enc, 1);
28611
28612         ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28613         desret_xmlParserInputBufferPtr(ret_val);
28614         call_tests++;
28615         des_fileoutput(n_URI, URI, 0);
28616         des_xmlCharEncoding(n_enc, enc, 1);
28617         xmlResetLastError();
28618         if (mem_base != xmlMemBlocks()) {
28619             printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28620                    xmlMemBlocks() - mem_base);
28621             test_ret++;
28622             printf(" %d", n_URI);
28623             printf(" %d", n_enc);
28624             printf("\n");
28625         }
28626     }
28627     }
28628     function_tests++;
28629
28630     return(test_ret);
28631 }
28632
28633
28634 static int
28635 test_xmlParserInputBufferCreateMem(void) {
28636     int test_ret = 0;
28637
28638     int mem_base;
28639     xmlParserInputBufferPtr ret_val;
28640     char * mem; /* the memory input */
28641     int n_mem;
28642     int size; /* the length of the memory block */
28643     int n_size;
28644     xmlCharEncoding enc; /* the charset encoding if known */
28645     int n_enc;
28646
28647     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28648     for (n_size = 0;n_size < gen_nb_int;n_size++) {
28649     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28650         mem_base = xmlMemBlocks();
28651         mem = gen_const_char_ptr(n_mem, 0);
28652         size = gen_int(n_size, 1);
28653         enc = gen_xmlCharEncoding(n_enc, 2);
28654
28655         ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28656         desret_xmlParserInputBufferPtr(ret_val);
28657         call_tests++;
28658         des_const_char_ptr(n_mem, (const char *)mem, 0);
28659         des_int(n_size, size, 1);
28660         des_xmlCharEncoding(n_enc, enc, 2);
28661         xmlResetLastError();
28662         if (mem_base != xmlMemBlocks()) {
28663             printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28664                    xmlMemBlocks() - mem_base);
28665             test_ret++;
28666             printf(" %d", n_mem);
28667             printf(" %d", n_size);
28668             printf(" %d", n_enc);
28669             printf("\n");
28670         }
28671     }
28672     }
28673     }
28674     function_tests++;
28675
28676     return(test_ret);
28677 }
28678
28679
28680 static int
28681 test_xmlParserInputBufferCreateStatic(void) {
28682     int test_ret = 0;
28683
28684     int mem_base;
28685     xmlParserInputBufferPtr ret_val;
28686     char * mem; /* the memory input */
28687     int n_mem;
28688     int size; /* the length of the memory block */
28689     int n_size;
28690     xmlCharEncoding enc; /* the charset encoding if known */
28691     int n_enc;
28692
28693     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28694     for (n_size = 0;n_size < gen_nb_int;n_size++) {
28695     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28696         mem_base = xmlMemBlocks();
28697         mem = gen_const_char_ptr(n_mem, 0);
28698         size = gen_int(n_size, 1);
28699         enc = gen_xmlCharEncoding(n_enc, 2);
28700
28701         ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28702         desret_xmlParserInputBufferPtr(ret_val);
28703         call_tests++;
28704         des_const_char_ptr(n_mem, (const char *)mem, 0);
28705         des_int(n_size, size, 1);
28706         des_xmlCharEncoding(n_enc, enc, 2);
28707         xmlResetLastError();
28708         if (mem_base != xmlMemBlocks()) {
28709             printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28710                    xmlMemBlocks() - mem_base);
28711             test_ret++;
28712             printf(" %d", n_mem);
28713             printf(" %d", n_size);
28714             printf(" %d", n_enc);
28715             printf("\n");
28716         }
28717     }
28718     }
28719     }
28720     function_tests++;
28721
28722     return(test_ret);
28723 }
28724
28725
28726 static int
28727 test_xmlParserInputBufferGrow(void) {
28728     int test_ret = 0;
28729
28730     int mem_base;
28731     int ret_val;
28732     xmlParserInputBufferPtr in; /* a buffered parser input */
28733     int n_in;
28734     int len; /* indicative value of the amount of chars to read */
28735     int n_len;
28736
28737     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28738     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28739         mem_base = xmlMemBlocks();
28740         in = gen_xmlParserInputBufferPtr(n_in, 0);
28741         len = gen_int(n_len, 1);
28742
28743         ret_val = xmlParserInputBufferGrow(in, len);
28744         desret_int(ret_val);
28745         call_tests++;
28746         des_xmlParserInputBufferPtr(n_in, in, 0);
28747         des_int(n_len, len, 1);
28748         xmlResetLastError();
28749         if (mem_base != xmlMemBlocks()) {
28750             printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28751                    xmlMemBlocks() - mem_base);
28752             test_ret++;
28753             printf(" %d", n_in);
28754             printf(" %d", n_len);
28755             printf("\n");
28756         }
28757     }
28758     }
28759     function_tests++;
28760
28761     return(test_ret);
28762 }
28763
28764
28765 static int
28766 test_xmlParserInputBufferPush(void) {
28767     int test_ret = 0;
28768
28769     int mem_base;
28770     int ret_val;
28771     xmlParserInputBufferPtr in; /* a buffered parser input */
28772     int n_in;
28773     int len; /* the size in bytes of the array. */
28774     int n_len;
28775     char * buf; /* an char array */
28776     int n_buf;
28777
28778     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28779     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28780     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28781         mem_base = xmlMemBlocks();
28782         in = gen_xmlParserInputBufferPtr(n_in, 0);
28783         len = gen_int(n_len, 1);
28784         buf = gen_const_char_ptr(n_buf, 2);
28785
28786         ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28787         desret_int(ret_val);
28788         call_tests++;
28789         des_xmlParserInputBufferPtr(n_in, in, 0);
28790         des_int(n_len, len, 1);
28791         des_const_char_ptr(n_buf, (const char *)buf, 2);
28792         xmlResetLastError();
28793         if (mem_base != xmlMemBlocks()) {
28794             printf("Leak of %d blocks found in xmlParserInputBufferPush",
28795                    xmlMemBlocks() - mem_base);
28796             test_ret++;
28797             printf(" %d", n_in);
28798             printf(" %d", n_len);
28799             printf(" %d", n_buf);
28800             printf("\n");
28801         }
28802     }
28803     }
28804     }
28805     function_tests++;
28806
28807     return(test_ret);
28808 }
28809
28810
28811 static int
28812 test_xmlParserInputBufferRead(void) {
28813     int test_ret = 0;
28814
28815     int mem_base;
28816     int ret_val;
28817     xmlParserInputBufferPtr in; /* a buffered parser input */
28818     int n_in;
28819     int len; /* indicative value of the amount of chars to read */
28820     int n_len;
28821
28822     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28823     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28824         mem_base = xmlMemBlocks();
28825         in = gen_xmlParserInputBufferPtr(n_in, 0);
28826         len = gen_int(n_len, 1);
28827
28828         ret_val = xmlParserInputBufferRead(in, len);
28829         desret_int(ret_val);
28830         call_tests++;
28831         des_xmlParserInputBufferPtr(n_in, in, 0);
28832         des_int(n_len, len, 1);
28833         xmlResetLastError();
28834         if (mem_base != xmlMemBlocks()) {
28835             printf("Leak of %d blocks found in xmlParserInputBufferRead",
28836                    xmlMemBlocks() - mem_base);
28837             test_ret++;
28838             printf(" %d", n_in);
28839             printf(" %d", n_len);
28840             printf("\n");
28841         }
28842     }
28843     }
28844     function_tests++;
28845
28846     return(test_ret);
28847 }
28848
28849
28850 static int
28851 test_xmlPopInputCallbacks(void) {
28852     int test_ret = 0;
28853
28854     int mem_base;
28855     int ret_val;
28856
28857         mem_base = xmlMemBlocks();
28858
28859         ret_val = xmlPopInputCallbacks();
28860         desret_int(ret_val);
28861         call_tests++;
28862         xmlResetLastError();
28863         if (mem_base != xmlMemBlocks()) {
28864             printf("Leak of %d blocks found in xmlPopInputCallbacks",
28865                    xmlMemBlocks() - mem_base);
28866             test_ret++;
28867             printf("\n");
28868         }
28869     function_tests++;
28870
28871     return(test_ret);
28872 }
28873
28874
28875 static int
28876 test_xmlRegisterDefaultInputCallbacks(void) {
28877     int test_ret = 0;
28878
28879     int mem_base;
28880
28881         mem_base = xmlMemBlocks();
28882
28883         xmlRegisterDefaultInputCallbacks();
28884         call_tests++;
28885         xmlResetLastError();
28886         if (mem_base != xmlMemBlocks()) {
28887             printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28888                    xmlMemBlocks() - mem_base);
28889             test_ret++;
28890             printf("\n");
28891         }
28892     function_tests++;
28893
28894     return(test_ret);
28895 }
28896
28897
28898 static int
28899 test_xmlRegisterDefaultOutputCallbacks(void) {
28900     int test_ret = 0;
28901
28902 #if defined(LIBXML_OUTPUT_ENABLED)
28903     int mem_base;
28904
28905         mem_base = xmlMemBlocks();
28906
28907         xmlRegisterDefaultOutputCallbacks();
28908         call_tests++;
28909         xmlResetLastError();
28910         if (mem_base != xmlMemBlocks()) {
28911             printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28912                    xmlMemBlocks() - mem_base);
28913             test_ret++;
28914             printf("\n");
28915         }
28916     function_tests++;
28917 #endif
28918
28919     return(test_ret);
28920 }
28921
28922
28923 static int
28924 test_xmlRegisterHTTPPostCallbacks(void) {
28925     int test_ret = 0;
28926
28927 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28928     int mem_base;
28929
28930         mem_base = xmlMemBlocks();
28931
28932         xmlRegisterHTTPPostCallbacks();
28933         call_tests++;
28934         xmlResetLastError();
28935         if (mem_base != xmlMemBlocks()) {
28936             printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28937                    xmlMemBlocks() - mem_base);
28938             test_ret++;
28939             printf("\n");
28940         }
28941     function_tests++;
28942 #endif
28943
28944     return(test_ret);
28945 }
28946
28947 static int
28948 test_xmlIO(void) {
28949     int test_ret = 0;
28950
28951     if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28952     test_ret += test_xmlAllocOutputBuffer();
28953     test_ret += test_xmlAllocParserInputBuffer();
28954     test_ret += test_xmlCheckFilename();
28955     test_ret += test_xmlCheckHTTPInput();
28956     test_ret += test_xmlCleanupInputCallbacks();
28957     test_ret += test_xmlCleanupOutputCallbacks();
28958     test_ret += test_xmlFileClose();
28959     test_ret += test_xmlFileMatch();
28960     test_ret += test_xmlFileOpen();
28961     test_ret += test_xmlFileRead();
28962     test_ret += test_xmlIOFTPClose();
28963     test_ret += test_xmlIOFTPMatch();
28964     test_ret += test_xmlIOFTPOpen();
28965     test_ret += test_xmlIOFTPRead();
28966     test_ret += test_xmlIOHTTPClose();
28967     test_ret += test_xmlIOHTTPMatch();
28968     test_ret += test_xmlIOHTTPOpen();
28969     test_ret += test_xmlIOHTTPRead();
28970     test_ret += test_xmlNoNetExternalEntityLoader();
28971     test_ret += test_xmlNormalizeWindowsPath();
28972     test_ret += test_xmlOutputBufferCreateBuffer();
28973     test_ret += test_xmlOutputBufferCreateFd();
28974     test_ret += test_xmlOutputBufferCreateFile();
28975     test_ret += test_xmlOutputBufferCreateFilename();
28976     test_ret += test_xmlOutputBufferFlush();
28977     test_ret += test_xmlOutputBufferWrite();
28978     test_ret += test_xmlOutputBufferWriteEscape();
28979     test_ret += test_xmlOutputBufferWriteString();
28980     test_ret += test_xmlParserGetDirectory();
28981     test_ret += test_xmlParserInputBufferCreateFd();
28982     test_ret += test_xmlParserInputBufferCreateFile();
28983     test_ret += test_xmlParserInputBufferCreateFilename();
28984     test_ret += test_xmlParserInputBufferCreateMem();
28985     test_ret += test_xmlParserInputBufferCreateStatic();
28986     test_ret += test_xmlParserInputBufferGrow();
28987     test_ret += test_xmlParserInputBufferPush();
28988     test_ret += test_xmlParserInputBufferRead();
28989     test_ret += test_xmlPopInputCallbacks();
28990     test_ret += test_xmlRegisterDefaultInputCallbacks();
28991     test_ret += test_xmlRegisterDefaultOutputCallbacks();
28992     test_ret += test_xmlRegisterHTTPPostCallbacks();
28993
28994     if (test_ret != 0)
28995         printf("Module xmlIO: %d errors\n", test_ret);
28996     return(test_ret);
28997 }
28998 #ifdef LIBXML_AUTOMATA_ENABLED
28999
29000 #define gen_nb_xmlAutomataPtr 1
29001 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29002     return(NULL);
29003 }
29004 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29005 }
29006 #endif
29007
29008
29009 static int
29010 test_xmlAutomataCompile(void) {
29011     int test_ret = 0;
29012
29013
29014     /* missing type support */
29015     return(test_ret);
29016 }
29017
29018
29019 static int
29020 test_xmlAutomataGetInitState(void) {
29021     int test_ret = 0;
29022
29023
29024     /* missing type support */
29025     return(test_ret);
29026 }
29027
29028
29029 static int
29030 test_xmlAutomataIsDeterminist(void) {
29031     int test_ret = 0;
29032
29033 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29034     int mem_base;
29035     int ret_val;
29036     xmlAutomataPtr am; /* an automata */
29037     int n_am;
29038
29039     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29040         mem_base = xmlMemBlocks();
29041         am = gen_xmlAutomataPtr(n_am, 0);
29042
29043         ret_val = xmlAutomataIsDeterminist(am);
29044         desret_int(ret_val);
29045         call_tests++;
29046         des_xmlAutomataPtr(n_am, am, 0);
29047         xmlResetLastError();
29048         if (mem_base != xmlMemBlocks()) {
29049             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29050                    xmlMemBlocks() - mem_base);
29051             test_ret++;
29052             printf(" %d", n_am);
29053             printf("\n");
29054         }
29055     }
29056     function_tests++;
29057 #endif
29058
29059     return(test_ret);
29060 }
29061
29062 #ifdef LIBXML_AUTOMATA_ENABLED
29063
29064 #define gen_nb_xmlAutomataStatePtr 1
29065 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29066     return(NULL);
29067 }
29068 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29069 }
29070 #endif
29071
29072
29073 static int
29074 test_xmlAutomataNewAllTrans(void) {
29075     int test_ret = 0;
29076
29077
29078     /* missing type support */
29079     return(test_ret);
29080 }
29081
29082
29083 static int
29084 test_xmlAutomataNewCountTrans(void) {
29085     int test_ret = 0;
29086
29087
29088     /* missing type support */
29089     return(test_ret);
29090 }
29091
29092
29093 static int
29094 test_xmlAutomataNewCountTrans2(void) {
29095     int test_ret = 0;
29096
29097
29098     /* missing type support */
29099     return(test_ret);
29100 }
29101
29102
29103 static int
29104 test_xmlAutomataNewCountedTrans(void) {
29105     int test_ret = 0;
29106
29107
29108     /* missing type support */
29109     return(test_ret);
29110 }
29111
29112
29113 static int
29114 test_xmlAutomataNewCounter(void) {
29115     int test_ret = 0;
29116
29117 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29118     int mem_base;
29119     int ret_val;
29120     xmlAutomataPtr am; /* an automata */
29121     int n_am;
29122     int min; /* the minimal value on the counter */
29123     int n_min;
29124     int max; /* the maximal value on the counter */
29125     int n_max;
29126
29127     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29128     for (n_min = 0;n_min < gen_nb_int;n_min++) {
29129     for (n_max = 0;n_max < gen_nb_int;n_max++) {
29130         mem_base = xmlMemBlocks();
29131         am = gen_xmlAutomataPtr(n_am, 0);
29132         min = gen_int(n_min, 1);
29133         max = gen_int(n_max, 2);
29134
29135         ret_val = xmlAutomataNewCounter(am, min, max);
29136         desret_int(ret_val);
29137         call_tests++;
29138         des_xmlAutomataPtr(n_am, am, 0);
29139         des_int(n_min, min, 1);
29140         des_int(n_max, max, 2);
29141         xmlResetLastError();
29142         if (mem_base != xmlMemBlocks()) {
29143             printf("Leak of %d blocks found in xmlAutomataNewCounter",
29144                    xmlMemBlocks() - mem_base);
29145             test_ret++;
29146             printf(" %d", n_am);
29147             printf(" %d", n_min);
29148             printf(" %d", n_max);
29149             printf("\n");
29150         }
29151     }
29152     }
29153     }
29154     function_tests++;
29155 #endif
29156
29157     return(test_ret);
29158 }
29159
29160
29161 static int
29162 test_xmlAutomataNewCounterTrans(void) {
29163     int test_ret = 0;
29164
29165
29166     /* missing type support */
29167     return(test_ret);
29168 }
29169
29170
29171 static int
29172 test_xmlAutomataNewEpsilon(void) {
29173     int test_ret = 0;
29174
29175
29176     /* missing type support */
29177     return(test_ret);
29178 }
29179
29180
29181 static int
29182 test_xmlAutomataNewNegTrans(void) {
29183     int test_ret = 0;
29184
29185
29186     /* missing type support */
29187     return(test_ret);
29188 }
29189
29190
29191 static int
29192 test_xmlAutomataNewOnceTrans(void) {
29193     int test_ret = 0;
29194
29195
29196     /* missing type support */
29197     return(test_ret);
29198 }
29199
29200
29201 static int
29202 test_xmlAutomataNewOnceTrans2(void) {
29203     int test_ret = 0;
29204
29205
29206     /* missing type support */
29207     return(test_ret);
29208 }
29209
29210
29211 static int
29212 test_xmlAutomataNewState(void) {
29213     int test_ret = 0;
29214
29215
29216     /* missing type support */
29217     return(test_ret);
29218 }
29219
29220
29221 static int
29222 test_xmlAutomataNewTransition(void) {
29223     int test_ret = 0;
29224
29225
29226     /* missing type support */
29227     return(test_ret);
29228 }
29229
29230
29231 static int
29232 test_xmlAutomataNewTransition2(void) {
29233     int test_ret = 0;
29234
29235
29236     /* missing type support */
29237     return(test_ret);
29238 }
29239
29240
29241 static int
29242 test_xmlAutomataSetFinalState(void) {
29243     int test_ret = 0;
29244
29245 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29246     int mem_base;
29247     int ret_val;
29248     xmlAutomataPtr am; /* an automata */
29249     int n_am;
29250     xmlAutomataStatePtr state; /* a state in this automata */
29251     int n_state;
29252
29253     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29254     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29255         mem_base = xmlMemBlocks();
29256         am = gen_xmlAutomataPtr(n_am, 0);
29257         state = gen_xmlAutomataStatePtr(n_state, 1);
29258
29259         ret_val = xmlAutomataSetFinalState(am, state);
29260         desret_int(ret_val);
29261         call_tests++;
29262         des_xmlAutomataPtr(n_am, am, 0);
29263         des_xmlAutomataStatePtr(n_state, state, 1);
29264         xmlResetLastError();
29265         if (mem_base != xmlMemBlocks()) {
29266             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29267                    xmlMemBlocks() - mem_base);
29268             test_ret++;
29269             printf(" %d", n_am);
29270             printf(" %d", n_state);
29271             printf("\n");
29272         }
29273     }
29274     }
29275     function_tests++;
29276 #endif
29277
29278     return(test_ret);
29279 }
29280
29281
29282 static int
29283 test_xmlNewAutomata(void) {
29284     int test_ret = 0;
29285
29286
29287     /* missing type support */
29288     return(test_ret);
29289 }
29290
29291 static int
29292 test_xmlautomata(void) {
29293     int test_ret = 0;
29294
29295     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29296     test_ret += test_xmlAutomataCompile();
29297     test_ret += test_xmlAutomataGetInitState();
29298     test_ret += test_xmlAutomataIsDeterminist();
29299     test_ret += test_xmlAutomataNewAllTrans();
29300     test_ret += test_xmlAutomataNewCountTrans();
29301     test_ret += test_xmlAutomataNewCountTrans2();
29302     test_ret += test_xmlAutomataNewCountedTrans();
29303     test_ret += test_xmlAutomataNewCounter();
29304     test_ret += test_xmlAutomataNewCounterTrans();
29305     test_ret += test_xmlAutomataNewEpsilon();
29306     test_ret += test_xmlAutomataNewNegTrans();
29307     test_ret += test_xmlAutomataNewOnceTrans();
29308     test_ret += test_xmlAutomataNewOnceTrans2();
29309     test_ret += test_xmlAutomataNewState();
29310     test_ret += test_xmlAutomataNewTransition();
29311     test_ret += test_xmlAutomataNewTransition2();
29312     test_ret += test_xmlAutomataSetFinalState();
29313     test_ret += test_xmlNewAutomata();
29314
29315     if (test_ret != 0)
29316         printf("Module xmlautomata: %d errors\n", test_ret);
29317     return(test_ret);
29318 }
29319
29320 #define gen_nb_xmlGenericErrorFunc_ptr 1
29321 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29322     return(NULL);
29323 }
29324 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29325 }
29326
29327 static int
29328 test_initGenericErrorDefaultFunc(void) {
29329     int test_ret = 0;
29330
29331     int mem_base;
29332     xmlGenericErrorFunc * handler; /* the handler */
29333     int n_handler;
29334
29335     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29336         mem_base = xmlMemBlocks();
29337         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29338
29339         initGenericErrorDefaultFunc(handler);
29340         call_tests++;
29341         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29342         xmlResetLastError();
29343         if (mem_base != xmlMemBlocks()) {
29344             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29345                    xmlMemBlocks() - mem_base);
29346             test_ret++;
29347             printf(" %d", n_handler);
29348             printf("\n");
29349         }
29350     }
29351     function_tests++;
29352
29353     return(test_ret);
29354 }
29355
29356
29357 #define gen_nb_xmlErrorPtr 1
29358 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29359     return(NULL);
29360 }
29361 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29362 }
29363
29364 static int
29365 test_xmlCopyError(void) {
29366     int test_ret = 0;
29367
29368     int mem_base;
29369     int ret_val;
29370     xmlErrorPtr from; /* a source error */
29371     int n_from;
29372     xmlErrorPtr to; /* a target error */
29373     int n_to;
29374
29375     for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29376     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29377         mem_base = xmlMemBlocks();
29378         from = gen_xmlErrorPtr(n_from, 0);
29379         to = gen_xmlErrorPtr(n_to, 1);
29380
29381         ret_val = xmlCopyError(from, to);
29382         desret_int(ret_val);
29383         call_tests++;
29384         des_xmlErrorPtr(n_from, from, 0);
29385         des_xmlErrorPtr(n_to, to, 1);
29386         xmlResetLastError();
29387         if (mem_base != xmlMemBlocks()) {
29388             printf("Leak of %d blocks found in xmlCopyError",
29389                    xmlMemBlocks() - mem_base);
29390             test_ret++;
29391             printf(" %d", n_from);
29392             printf(" %d", n_to);
29393             printf("\n");
29394         }
29395     }
29396     }
29397     function_tests++;
29398
29399     return(test_ret);
29400 }
29401
29402
29403 static int
29404 test_xmlCtxtGetLastError(void) {
29405     int test_ret = 0;
29406
29407
29408     /* missing type support */
29409     return(test_ret);
29410 }
29411
29412
29413 static int
29414 test_xmlCtxtResetLastError(void) {
29415     int test_ret = 0;
29416
29417     int mem_base;
29418     void * ctx; /* an XML parser context */
29419     int n_ctx;
29420
29421     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29422         mem_base = xmlMemBlocks();
29423         ctx = gen_void_ptr(n_ctx, 0);
29424
29425         xmlCtxtResetLastError(ctx);
29426         call_tests++;
29427         des_void_ptr(n_ctx, ctx, 0);
29428         xmlResetLastError();
29429         if (mem_base != xmlMemBlocks()) {
29430             printf("Leak of %d blocks found in xmlCtxtResetLastError",
29431                    xmlMemBlocks() - mem_base);
29432             test_ret++;
29433             printf(" %d", n_ctx);
29434             printf("\n");
29435         }
29436     }
29437     function_tests++;
29438
29439     return(test_ret);
29440 }
29441
29442
29443 static int
29444 test_xmlGetLastError(void) {
29445     int test_ret = 0;
29446
29447
29448     /* missing type support */
29449     return(test_ret);
29450 }
29451
29452
29453 static int
29454 test_xmlParserError(void) {
29455     int test_ret = 0;
29456
29457
29458     /* missing type support */
29459     return(test_ret);
29460 }
29461
29462
29463 static int
29464 test_xmlParserPrintFileContext(void) {
29465     int test_ret = 0;
29466
29467     int mem_base;
29468     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29469     int n_input;
29470
29471     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29472         mem_base = xmlMemBlocks();
29473         input = gen_xmlParserInputPtr(n_input, 0);
29474
29475         xmlParserPrintFileContext(input);
29476         call_tests++;
29477         des_xmlParserInputPtr(n_input, input, 0);
29478         xmlResetLastError();
29479         if (mem_base != xmlMemBlocks()) {
29480             printf("Leak of %d blocks found in xmlParserPrintFileContext",
29481                    xmlMemBlocks() - mem_base);
29482             test_ret++;
29483             printf(" %d", n_input);
29484             printf("\n");
29485         }
29486     }
29487     function_tests++;
29488
29489     return(test_ret);
29490 }
29491
29492
29493 static int
29494 test_xmlParserPrintFileInfo(void) {
29495     int test_ret = 0;
29496
29497     int mem_base;
29498     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29499     int n_input;
29500
29501     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29502         mem_base = xmlMemBlocks();
29503         input = gen_xmlParserInputPtr(n_input, 0);
29504
29505         xmlParserPrintFileInfo(input);
29506         call_tests++;
29507         des_xmlParserInputPtr(n_input, input, 0);
29508         xmlResetLastError();
29509         if (mem_base != xmlMemBlocks()) {
29510             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29511                    xmlMemBlocks() - mem_base);
29512             test_ret++;
29513             printf(" %d", n_input);
29514             printf("\n");
29515         }
29516     }
29517     function_tests++;
29518
29519     return(test_ret);
29520 }
29521
29522
29523 static int
29524 test_xmlParserValidityError(void) {
29525     int test_ret = 0;
29526
29527
29528     /* missing type support */
29529     return(test_ret);
29530 }
29531
29532
29533 static int
29534 test_xmlParserValidityWarning(void) {
29535     int test_ret = 0;
29536
29537
29538     /* missing type support */
29539     return(test_ret);
29540 }
29541
29542
29543 static int
29544 test_xmlParserWarning(void) {
29545     int test_ret = 0;
29546
29547
29548     /* missing type support */
29549     return(test_ret);
29550 }
29551
29552
29553 static int
29554 test_xmlResetError(void) {
29555     int test_ret = 0;
29556
29557     int mem_base;
29558     xmlErrorPtr err; /* pointer to the error. */
29559     int n_err;
29560
29561     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29562         mem_base = xmlMemBlocks();
29563         err = gen_xmlErrorPtr(n_err, 0);
29564
29565         xmlResetError(err);
29566         call_tests++;
29567         des_xmlErrorPtr(n_err, err, 0);
29568         xmlResetLastError();
29569         if (mem_base != xmlMemBlocks()) {
29570             printf("Leak of %d blocks found in xmlResetError",
29571                    xmlMemBlocks() - mem_base);
29572             test_ret++;
29573             printf(" %d", n_err);
29574             printf("\n");
29575         }
29576     }
29577     function_tests++;
29578
29579     return(test_ret);
29580 }
29581
29582
29583 static int
29584 test_xmlResetLastError(void) {
29585     int test_ret = 0;
29586
29587
29588
29589         xmlResetLastError();
29590         call_tests++;
29591         xmlResetLastError();
29592     function_tests++;
29593
29594     return(test_ret);
29595 }
29596
29597
29598 static int
29599 test_xmlSetGenericErrorFunc(void) {
29600     int test_ret = 0;
29601
29602
29603     /* missing type support */
29604     return(test_ret);
29605 }
29606
29607
29608 static int
29609 test_xmlSetStructuredErrorFunc(void) {
29610     int test_ret = 0;
29611
29612
29613     /* missing type support */
29614     return(test_ret);
29615 }
29616
29617 static int
29618 test_xmlerror(void) {
29619     int test_ret = 0;
29620
29621     if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29622     test_ret += test_initGenericErrorDefaultFunc();
29623     test_ret += test_xmlCopyError();
29624     test_ret += test_xmlCtxtGetLastError();
29625     test_ret += test_xmlCtxtResetLastError();
29626     test_ret += test_xmlGetLastError();
29627     test_ret += test_xmlParserError();
29628     test_ret += test_xmlParserPrintFileContext();
29629     test_ret += test_xmlParserPrintFileInfo();
29630     test_ret += test_xmlParserValidityError();
29631     test_ret += test_xmlParserValidityWarning();
29632     test_ret += test_xmlParserWarning();
29633     test_ret += test_xmlResetError();
29634     test_ret += test_xmlResetLastError();
29635     test_ret += test_xmlSetGenericErrorFunc();
29636     test_ret += test_xmlSetStructuredErrorFunc();
29637
29638     if (test_ret != 0)
29639         printf("Module xmlerror: %d errors\n", test_ret);
29640     return(test_ret);
29641 }
29642 #ifdef LIBXML_MODULES_ENABLED
29643
29644 #define gen_nb_xmlModulePtr 1
29645 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29646     return(NULL);
29647 }
29648 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29649 }
29650 #endif
29651
29652
29653 static int
29654 test_xmlModuleClose(void) {
29655     int test_ret = 0;
29656
29657 #if defined(LIBXML_MODULES_ENABLED)
29658     int mem_base;
29659     int ret_val;
29660     xmlModulePtr module; /* the module handle */
29661     int n_module;
29662
29663     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29664         mem_base = xmlMemBlocks();
29665         module = gen_xmlModulePtr(n_module, 0);
29666
29667         ret_val = xmlModuleClose(module);
29668         desret_int(ret_val);
29669         call_tests++;
29670         des_xmlModulePtr(n_module, module, 0);
29671         xmlResetLastError();
29672         if (mem_base != xmlMemBlocks()) {
29673             printf("Leak of %d blocks found in xmlModuleClose",
29674                    xmlMemBlocks() - mem_base);
29675             test_ret++;
29676             printf(" %d", n_module);
29677             printf("\n");
29678         }
29679     }
29680     function_tests++;
29681 #endif
29682
29683     return(test_ret);
29684 }
29685
29686
29687 static int
29688 test_xmlModuleOpen(void) {
29689     int test_ret = 0;
29690
29691
29692     /* missing type support */
29693     return(test_ret);
29694 }
29695
29696
29697 static int
29698 test_xmlModuleSymbol(void) {
29699     int test_ret = 0;
29700
29701 #if defined(LIBXML_MODULES_ENABLED)
29702     int mem_base;
29703     int ret_val;
29704     xmlModulePtr module; /* the module */
29705     int n_module;
29706     char * name; /* the name of the symbol */
29707     int n_name;
29708     void ** symbol; /* the resulting symbol address */
29709     int n_symbol;
29710
29711     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29712     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29713     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29714         mem_base = xmlMemBlocks();
29715         module = gen_xmlModulePtr(n_module, 0);
29716         name = gen_const_char_ptr(n_name, 1);
29717         symbol = gen_void_ptr_ptr(n_symbol, 2);
29718
29719         ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29720         desret_int(ret_val);
29721         call_tests++;
29722         des_xmlModulePtr(n_module, module, 0);
29723         des_const_char_ptr(n_name, (const char *)name, 1);
29724         des_void_ptr_ptr(n_symbol, symbol, 2);
29725         xmlResetLastError();
29726         if (mem_base != xmlMemBlocks()) {
29727             printf("Leak of %d blocks found in xmlModuleSymbol",
29728                    xmlMemBlocks() - mem_base);
29729             test_ret++;
29730             printf(" %d", n_module);
29731             printf(" %d", n_name);
29732             printf(" %d", n_symbol);
29733             printf("\n");
29734         }
29735     }
29736     }
29737     }
29738     function_tests++;
29739 #endif
29740
29741     return(test_ret);
29742 }
29743
29744 static int
29745 test_xmlmodule(void) {
29746     int test_ret = 0;
29747
29748     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29749     test_ret += test_xmlModuleClose();
29750     test_ret += test_xmlModuleOpen();
29751     test_ret += test_xmlModuleSymbol();
29752
29753     if (test_ret != 0)
29754         printf("Module xmlmodule: %d errors\n", test_ret);
29755     return(test_ret);
29756 }
29757
29758 static int
29759 test_xmlNewTextReader(void) {
29760     int test_ret = 0;
29761
29762 #if defined(LIBXML_READER_ENABLED)
29763     int mem_base;
29764     xmlTextReaderPtr ret_val;
29765     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29766     int n_input;
29767     const char * URI; /* the URI information for the source if available */
29768     int n_URI;
29769
29770     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29771     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29772         mem_base = xmlMemBlocks();
29773         input = gen_xmlParserInputBufferPtr(n_input, 0);
29774         URI = gen_filepath(n_URI, 1);
29775
29776         ret_val = xmlNewTextReader(input, URI);
29777         desret_xmlTextReaderPtr(ret_val);
29778         call_tests++;
29779         des_xmlParserInputBufferPtr(n_input, input, 0);
29780         des_filepath(n_URI, URI, 1);
29781         xmlResetLastError();
29782         if (mem_base != xmlMemBlocks()) {
29783             printf("Leak of %d blocks found in xmlNewTextReader",
29784                    xmlMemBlocks() - mem_base);
29785             test_ret++;
29786             printf(" %d", n_input);
29787             printf(" %d", n_URI);
29788             printf("\n");
29789         }
29790     }
29791     }
29792     function_tests++;
29793 #endif
29794
29795     return(test_ret);
29796 }
29797
29798
29799 static int
29800 test_xmlNewTextReaderFilename(void) {
29801     int test_ret = 0;
29802
29803 #if defined(LIBXML_READER_ENABLED)
29804     int mem_base;
29805     xmlTextReaderPtr ret_val;
29806     const char * URI; /* the URI of the resource to process */
29807     int n_URI;
29808
29809     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29810         mem_base = xmlMemBlocks();
29811         URI = gen_filepath(n_URI, 0);
29812
29813         ret_val = xmlNewTextReaderFilename(URI);
29814         desret_xmlTextReaderPtr(ret_val);
29815         call_tests++;
29816         des_filepath(n_URI, URI, 0);
29817         xmlResetLastError();
29818         if (mem_base != xmlMemBlocks()) {
29819             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29820                    xmlMemBlocks() - mem_base);
29821             test_ret++;
29822             printf(" %d", n_URI);
29823             printf("\n");
29824         }
29825     }
29826     function_tests++;
29827 #endif
29828
29829     return(test_ret);
29830 }
29831
29832
29833 static int
29834 test_xmlReaderForDoc(void) {
29835     int test_ret = 0;
29836
29837 #if defined(LIBXML_READER_ENABLED)
29838     int mem_base;
29839     xmlTextReaderPtr ret_val;
29840     xmlChar * cur; /* a pointer to a zero terminated string */
29841     int n_cur;
29842     const char * URL; /* the base URL to use for the document */
29843     int n_URL;
29844     char * encoding; /* the document encoding, or NULL */
29845     int n_encoding;
29846     int options; /* a combination of xmlParserOption */
29847     int n_options;
29848
29849     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29850     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29851     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29852     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29853         mem_base = xmlMemBlocks();
29854         cur = gen_const_xmlChar_ptr(n_cur, 0);
29855         URL = gen_filepath(n_URL, 1);
29856         encoding = gen_const_char_ptr(n_encoding, 2);
29857         options = gen_parseroptions(n_options, 3);
29858
29859         ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29860         desret_xmlTextReaderPtr(ret_val);
29861         call_tests++;
29862         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29863         des_filepath(n_URL, URL, 1);
29864         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29865         des_parseroptions(n_options, options, 3);
29866         xmlResetLastError();
29867         if (mem_base != xmlMemBlocks()) {
29868             printf("Leak of %d blocks found in xmlReaderForDoc",
29869                    xmlMemBlocks() - mem_base);
29870             test_ret++;
29871             printf(" %d", n_cur);
29872             printf(" %d", n_URL);
29873             printf(" %d", n_encoding);
29874             printf(" %d", n_options);
29875             printf("\n");
29876         }
29877     }
29878     }
29879     }
29880     }
29881     function_tests++;
29882 #endif
29883
29884     return(test_ret);
29885 }
29886
29887
29888 static int
29889 test_xmlReaderForFile(void) {
29890     int test_ret = 0;
29891
29892 #if defined(LIBXML_READER_ENABLED)
29893     int mem_base;
29894     xmlTextReaderPtr ret_val;
29895     const char * filename; /* a file or URL */
29896     int n_filename;
29897     char * encoding; /* the document encoding, or NULL */
29898     int n_encoding;
29899     int options; /* a combination of xmlParserOption */
29900     int n_options;
29901
29902     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29903     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29904     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29905         mem_base = xmlMemBlocks();
29906         filename = gen_filepath(n_filename, 0);
29907         encoding = gen_const_char_ptr(n_encoding, 1);
29908         options = gen_parseroptions(n_options, 2);
29909
29910         ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29911         desret_xmlTextReaderPtr(ret_val);
29912         call_tests++;
29913         des_filepath(n_filename, filename, 0);
29914         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29915         des_parseroptions(n_options, options, 2);
29916         xmlResetLastError();
29917         if (mem_base != xmlMemBlocks()) {
29918             printf("Leak of %d blocks found in xmlReaderForFile",
29919                    xmlMemBlocks() - mem_base);
29920             test_ret++;
29921             printf(" %d", n_filename);
29922             printf(" %d", n_encoding);
29923             printf(" %d", n_options);
29924             printf("\n");
29925         }
29926     }
29927     }
29928     }
29929     function_tests++;
29930 #endif
29931
29932     return(test_ret);
29933 }
29934
29935
29936 static int
29937 test_xmlReaderForMemory(void) {
29938     int test_ret = 0;
29939
29940 #if defined(LIBXML_READER_ENABLED)
29941     int mem_base;
29942     xmlTextReaderPtr ret_val;
29943     char * buffer; /* a pointer to a char array */
29944     int n_buffer;
29945     int size; /* the size of the array */
29946     int n_size;
29947     const char * URL; /* the base URL to use for the document */
29948     int n_URL;
29949     char * encoding; /* the document encoding, or NULL */
29950     int n_encoding;
29951     int options; /* a combination of xmlParserOption */
29952     int n_options;
29953
29954     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29955     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29956     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29957     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29958     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29959         mem_base = xmlMemBlocks();
29960         buffer = gen_const_char_ptr(n_buffer, 0);
29961         size = gen_int(n_size, 1);
29962         URL = gen_filepath(n_URL, 2);
29963         encoding = gen_const_char_ptr(n_encoding, 3);
29964         options = gen_parseroptions(n_options, 4);
29965
29966         ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29967         desret_xmlTextReaderPtr(ret_val);
29968         call_tests++;
29969         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29970         des_int(n_size, size, 1);
29971         des_filepath(n_URL, URL, 2);
29972         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29973         des_parseroptions(n_options, options, 4);
29974         xmlResetLastError();
29975         if (mem_base != xmlMemBlocks()) {
29976             printf("Leak of %d blocks found in xmlReaderForMemory",
29977                    xmlMemBlocks() - mem_base);
29978             test_ret++;
29979             printf(" %d", n_buffer);
29980             printf(" %d", n_size);
29981             printf(" %d", n_URL);
29982             printf(" %d", n_encoding);
29983             printf(" %d", n_options);
29984             printf("\n");
29985         }
29986     }
29987     }
29988     }
29989     }
29990     }
29991     function_tests++;
29992 #endif
29993
29994     return(test_ret);
29995 }
29996
29997
29998 static int
29999 test_xmlReaderNewDoc(void) {
30000     int test_ret = 0;
30001
30002 #if defined(LIBXML_READER_ENABLED)
30003     int mem_base;
30004     int ret_val;
30005     xmlTextReaderPtr reader; /* an XML reader */
30006     int n_reader;
30007     xmlChar * cur; /* a pointer to a zero terminated string */
30008     int n_cur;
30009     const char * URL; /* the base URL to use for the document */
30010     int n_URL;
30011     char * encoding; /* the document encoding, or NULL */
30012     int n_encoding;
30013     int options; /* a combination of xmlParserOption */
30014     int n_options;
30015
30016     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30017     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30018     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30019     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30020     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30021         mem_base = xmlMemBlocks();
30022         reader = gen_xmlTextReaderPtr(n_reader, 0);
30023         cur = gen_const_xmlChar_ptr(n_cur, 1);
30024         URL = gen_filepath(n_URL, 2);
30025         encoding = gen_const_char_ptr(n_encoding, 3);
30026         options = gen_parseroptions(n_options, 4);
30027
30028         ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30029         desret_int(ret_val);
30030         call_tests++;
30031         des_xmlTextReaderPtr(n_reader, reader, 0);
30032         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30033         des_filepath(n_URL, URL, 2);
30034         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30035         des_parseroptions(n_options, options, 4);
30036         xmlResetLastError();
30037         if (mem_base != xmlMemBlocks()) {
30038             printf("Leak of %d blocks found in xmlReaderNewDoc",
30039                    xmlMemBlocks() - mem_base);
30040             test_ret++;
30041             printf(" %d", n_reader);
30042             printf(" %d", n_cur);
30043             printf(" %d", n_URL);
30044             printf(" %d", n_encoding);
30045             printf(" %d", n_options);
30046             printf("\n");
30047         }
30048     }
30049     }
30050     }
30051     }
30052     }
30053     function_tests++;
30054 #endif
30055
30056     return(test_ret);
30057 }
30058
30059
30060 static int
30061 test_xmlReaderNewFile(void) {
30062     int test_ret = 0;
30063
30064 #if defined(LIBXML_READER_ENABLED)
30065     int mem_base;
30066     int ret_val;
30067     xmlTextReaderPtr reader; /* an XML reader */
30068     int n_reader;
30069     const char * filename; /* a file or URL */
30070     int n_filename;
30071     char * encoding; /* the document encoding, or NULL */
30072     int n_encoding;
30073     int options; /* a combination of xmlParserOption */
30074     int n_options;
30075
30076     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30077     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30078     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30079     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30080         mem_base = xmlMemBlocks();
30081         reader = gen_xmlTextReaderPtr(n_reader, 0);
30082         filename = gen_filepath(n_filename, 1);
30083         encoding = gen_const_char_ptr(n_encoding, 2);
30084         options = gen_parseroptions(n_options, 3);
30085
30086         ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30087         desret_int(ret_val);
30088         call_tests++;
30089         des_xmlTextReaderPtr(n_reader, reader, 0);
30090         des_filepath(n_filename, filename, 1);
30091         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30092         des_parseroptions(n_options, options, 3);
30093         xmlResetLastError();
30094         if (mem_base != xmlMemBlocks()) {
30095             printf("Leak of %d blocks found in xmlReaderNewFile",
30096                    xmlMemBlocks() - mem_base);
30097             test_ret++;
30098             printf(" %d", n_reader);
30099             printf(" %d", n_filename);
30100             printf(" %d", n_encoding);
30101             printf(" %d", n_options);
30102             printf("\n");
30103         }
30104     }
30105     }
30106     }
30107     }
30108     function_tests++;
30109 #endif
30110
30111     return(test_ret);
30112 }
30113
30114
30115 static int
30116 test_xmlReaderNewMemory(void) {
30117     int test_ret = 0;
30118
30119 #if defined(LIBXML_READER_ENABLED)
30120     int mem_base;
30121     int ret_val;
30122     xmlTextReaderPtr reader; /* an XML reader */
30123     int n_reader;
30124     char * buffer; /* a pointer to a char array */
30125     int n_buffer;
30126     int size; /* the size of the array */
30127     int n_size;
30128     const char * URL; /* the base URL to use for the document */
30129     int n_URL;
30130     char * encoding; /* the document encoding, or NULL */
30131     int n_encoding;
30132     int options; /* a combination of xmlParserOption */
30133     int n_options;
30134
30135     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30136     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30137     for (n_size = 0;n_size < gen_nb_int;n_size++) {
30138     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30139     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30140     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30141         mem_base = xmlMemBlocks();
30142         reader = gen_xmlTextReaderPtr(n_reader, 0);
30143         buffer = gen_const_char_ptr(n_buffer, 1);
30144         size = gen_int(n_size, 2);
30145         URL = gen_filepath(n_URL, 3);
30146         encoding = gen_const_char_ptr(n_encoding, 4);
30147         options = gen_parseroptions(n_options, 5);
30148
30149         ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30150         desret_int(ret_val);
30151         call_tests++;
30152         des_xmlTextReaderPtr(n_reader, reader, 0);
30153         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30154         des_int(n_size, size, 2);
30155         des_filepath(n_URL, URL, 3);
30156         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30157         des_parseroptions(n_options, options, 5);
30158         xmlResetLastError();
30159         if (mem_base != xmlMemBlocks()) {
30160             printf("Leak of %d blocks found in xmlReaderNewMemory",
30161                    xmlMemBlocks() - mem_base);
30162             test_ret++;
30163             printf(" %d", n_reader);
30164             printf(" %d", n_buffer);
30165             printf(" %d", n_size);
30166             printf(" %d", n_URL);
30167             printf(" %d", n_encoding);
30168             printf(" %d", n_options);
30169             printf("\n");
30170         }
30171     }
30172     }
30173     }
30174     }
30175     }
30176     }
30177     function_tests++;
30178 #endif
30179
30180     return(test_ret);
30181 }
30182
30183
30184 static int
30185 test_xmlReaderNewWalker(void) {
30186     int test_ret = 0;
30187
30188 #if defined(LIBXML_READER_ENABLED)
30189     int mem_base;
30190     int ret_val;
30191     xmlTextReaderPtr reader; /* an XML reader */
30192     int n_reader;
30193     xmlDocPtr doc; /* a preparsed document */
30194     int n_doc;
30195
30196     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30197     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30198         mem_base = xmlMemBlocks();
30199         reader = gen_xmlTextReaderPtr(n_reader, 0);
30200         doc = gen_xmlDocPtr(n_doc, 1);
30201
30202         ret_val = xmlReaderNewWalker(reader, doc);
30203         desret_int(ret_val);
30204         call_tests++;
30205         des_xmlTextReaderPtr(n_reader, reader, 0);
30206         des_xmlDocPtr(n_doc, doc, 1);
30207         xmlResetLastError();
30208         if (mem_base != xmlMemBlocks()) {
30209             printf("Leak of %d blocks found in xmlReaderNewWalker",
30210                    xmlMemBlocks() - mem_base);
30211             test_ret++;
30212             printf(" %d", n_reader);
30213             printf(" %d", n_doc);
30214             printf("\n");
30215         }
30216     }
30217     }
30218     function_tests++;
30219 #endif
30220
30221     return(test_ret);
30222 }
30223
30224
30225 static int
30226 test_xmlReaderWalker(void) {
30227     int test_ret = 0;
30228
30229 #if defined(LIBXML_READER_ENABLED)
30230     int mem_base;
30231     xmlTextReaderPtr ret_val;
30232     xmlDocPtr doc; /* a preparsed document */
30233     int n_doc;
30234
30235     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30236         mem_base = xmlMemBlocks();
30237         doc = gen_xmlDocPtr(n_doc, 0);
30238
30239         ret_val = xmlReaderWalker(doc);
30240         desret_xmlTextReaderPtr(ret_val);
30241         call_tests++;
30242         des_xmlDocPtr(n_doc, doc, 0);
30243         xmlResetLastError();
30244         if (mem_base != xmlMemBlocks()) {
30245             printf("Leak of %d blocks found in xmlReaderWalker",
30246                    xmlMemBlocks() - mem_base);
30247             test_ret++;
30248             printf(" %d", n_doc);
30249             printf("\n");
30250         }
30251     }
30252     function_tests++;
30253 #endif
30254
30255     return(test_ret);
30256 }
30257
30258
30259 static int
30260 test_xmlTextReaderAttributeCount(void) {
30261     int test_ret = 0;
30262
30263 #if defined(LIBXML_READER_ENABLED)
30264     int mem_base;
30265     int ret_val;
30266     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30267     int n_reader;
30268
30269     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30270         mem_base = xmlMemBlocks();
30271         reader = gen_xmlTextReaderPtr(n_reader, 0);
30272
30273         ret_val = xmlTextReaderAttributeCount(reader);
30274         desret_int(ret_val);
30275         call_tests++;
30276         des_xmlTextReaderPtr(n_reader, reader, 0);
30277         xmlResetLastError();
30278         if (mem_base != xmlMemBlocks()) {
30279             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30280                    xmlMemBlocks() - mem_base);
30281             test_ret++;
30282             printf(" %d", n_reader);
30283             printf("\n");
30284         }
30285     }
30286     function_tests++;
30287 #endif
30288
30289     return(test_ret);
30290 }
30291
30292
30293 static int
30294 test_xmlTextReaderBaseUri(void) {
30295     int test_ret = 0;
30296
30297 #if defined(LIBXML_READER_ENABLED)
30298     int mem_base;
30299     xmlChar * ret_val;
30300     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30301     int n_reader;
30302
30303     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30304         mem_base = xmlMemBlocks();
30305         reader = gen_xmlTextReaderPtr(n_reader, 0);
30306
30307         ret_val = xmlTextReaderBaseUri(reader);
30308         desret_xmlChar_ptr(ret_val);
30309         call_tests++;
30310         des_xmlTextReaderPtr(n_reader, reader, 0);
30311         xmlResetLastError();
30312         if (mem_base != xmlMemBlocks()) {
30313             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30314                    xmlMemBlocks() - mem_base);
30315             test_ret++;
30316             printf(" %d", n_reader);
30317             printf("\n");
30318         }
30319     }
30320     function_tests++;
30321 #endif
30322
30323     return(test_ret);
30324 }
30325
30326
30327 static int
30328 test_xmlTextReaderByteConsumed(void) {
30329     int test_ret = 0;
30330
30331 #if defined(LIBXML_READER_ENABLED)
30332     int mem_base;
30333     long ret_val;
30334     xmlTextReaderPtr reader; /* an XML reader */
30335     int n_reader;
30336
30337     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30338         mem_base = xmlMemBlocks();
30339         reader = gen_xmlTextReaderPtr(n_reader, 0);
30340
30341         ret_val = xmlTextReaderByteConsumed(reader);
30342         desret_long(ret_val);
30343         call_tests++;
30344         des_xmlTextReaderPtr(n_reader, reader, 0);
30345         xmlResetLastError();
30346         if (mem_base != xmlMemBlocks()) {
30347             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30348                    xmlMemBlocks() - mem_base);
30349             test_ret++;
30350             printf(" %d", n_reader);
30351             printf("\n");
30352         }
30353     }
30354     function_tests++;
30355 #endif
30356
30357     return(test_ret);
30358 }
30359
30360
30361 static int
30362 test_xmlTextReaderClose(void) {
30363     int test_ret = 0;
30364
30365 #if defined(LIBXML_READER_ENABLED)
30366     int mem_base;
30367     int ret_val;
30368     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30369     int n_reader;
30370
30371     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30372         mem_base = xmlMemBlocks();
30373         reader = gen_xmlTextReaderPtr(n_reader, 0);
30374
30375         ret_val = xmlTextReaderClose(reader);
30376         desret_int(ret_val);
30377         call_tests++;
30378         des_xmlTextReaderPtr(n_reader, reader, 0);
30379         xmlResetLastError();
30380         if (mem_base != xmlMemBlocks()) {
30381             printf("Leak of %d blocks found in xmlTextReaderClose",
30382                    xmlMemBlocks() - mem_base);
30383             test_ret++;
30384             printf(" %d", n_reader);
30385             printf("\n");
30386         }
30387     }
30388     function_tests++;
30389 #endif
30390
30391     return(test_ret);
30392 }
30393
30394
30395 static int
30396 test_xmlTextReaderConstBaseUri(void) {
30397     int test_ret = 0;
30398
30399 #if defined(LIBXML_READER_ENABLED)
30400     int mem_base;
30401     const xmlChar * ret_val;
30402     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30403     int n_reader;
30404
30405     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30406         mem_base = xmlMemBlocks();
30407         reader = gen_xmlTextReaderPtr(n_reader, 0);
30408
30409         ret_val = xmlTextReaderConstBaseUri(reader);
30410         desret_const_xmlChar_ptr(ret_val);
30411         call_tests++;
30412         des_xmlTextReaderPtr(n_reader, reader, 0);
30413         xmlResetLastError();
30414         if (mem_base != xmlMemBlocks()) {
30415             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30416                    xmlMemBlocks() - mem_base);
30417             test_ret++;
30418             printf(" %d", n_reader);
30419             printf("\n");
30420         }
30421     }
30422     function_tests++;
30423 #endif
30424
30425     return(test_ret);
30426 }
30427
30428
30429 static int
30430 test_xmlTextReaderConstEncoding(void) {
30431     int test_ret = 0;
30432
30433 #if defined(LIBXML_READER_ENABLED)
30434     int mem_base;
30435     const xmlChar * ret_val;
30436     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30437     int n_reader;
30438
30439     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30440         mem_base = xmlMemBlocks();
30441         reader = gen_xmlTextReaderPtr(n_reader, 0);
30442
30443         ret_val = xmlTextReaderConstEncoding(reader);
30444         desret_const_xmlChar_ptr(ret_val);
30445         call_tests++;
30446         des_xmlTextReaderPtr(n_reader, reader, 0);
30447         xmlResetLastError();
30448         if (mem_base != xmlMemBlocks()) {
30449             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30450                    xmlMemBlocks() - mem_base);
30451             test_ret++;
30452             printf(" %d", n_reader);
30453             printf("\n");
30454         }
30455     }
30456     function_tests++;
30457 #endif
30458
30459     return(test_ret);
30460 }
30461
30462
30463 static int
30464 test_xmlTextReaderConstLocalName(void) {
30465     int test_ret = 0;
30466
30467 #if defined(LIBXML_READER_ENABLED)
30468     int mem_base;
30469     const xmlChar * ret_val;
30470     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30471     int n_reader;
30472
30473     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30474         mem_base = xmlMemBlocks();
30475         reader = gen_xmlTextReaderPtr(n_reader, 0);
30476
30477         ret_val = xmlTextReaderConstLocalName(reader);
30478         desret_const_xmlChar_ptr(ret_val);
30479         call_tests++;
30480         des_xmlTextReaderPtr(n_reader, reader, 0);
30481         xmlResetLastError();
30482         if (mem_base != xmlMemBlocks()) {
30483             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30484                    xmlMemBlocks() - mem_base);
30485             test_ret++;
30486             printf(" %d", n_reader);
30487             printf("\n");
30488         }
30489     }
30490     function_tests++;
30491 #endif
30492
30493     return(test_ret);
30494 }
30495
30496
30497 static int
30498 test_xmlTextReaderConstName(void) {
30499     int test_ret = 0;
30500
30501 #if defined(LIBXML_READER_ENABLED)
30502     int mem_base;
30503     const xmlChar * ret_val;
30504     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30505     int n_reader;
30506
30507     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30508         mem_base = xmlMemBlocks();
30509         reader = gen_xmlTextReaderPtr(n_reader, 0);
30510
30511         ret_val = xmlTextReaderConstName(reader);
30512         desret_const_xmlChar_ptr(ret_val);
30513         call_tests++;
30514         des_xmlTextReaderPtr(n_reader, reader, 0);
30515         xmlResetLastError();
30516         if (mem_base != xmlMemBlocks()) {
30517             printf("Leak of %d blocks found in xmlTextReaderConstName",
30518                    xmlMemBlocks() - mem_base);
30519             test_ret++;
30520             printf(" %d", n_reader);
30521             printf("\n");
30522         }
30523     }
30524     function_tests++;
30525 #endif
30526
30527     return(test_ret);
30528 }
30529
30530
30531 static int
30532 test_xmlTextReaderConstNamespaceUri(void) {
30533     int test_ret = 0;
30534
30535 #if defined(LIBXML_READER_ENABLED)
30536     int mem_base;
30537     const xmlChar * ret_val;
30538     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30539     int n_reader;
30540
30541     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30542         mem_base = xmlMemBlocks();
30543         reader = gen_xmlTextReaderPtr(n_reader, 0);
30544
30545         ret_val = xmlTextReaderConstNamespaceUri(reader);
30546         desret_const_xmlChar_ptr(ret_val);
30547         call_tests++;
30548         des_xmlTextReaderPtr(n_reader, reader, 0);
30549         xmlResetLastError();
30550         if (mem_base != xmlMemBlocks()) {
30551             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30552                    xmlMemBlocks() - mem_base);
30553             test_ret++;
30554             printf(" %d", n_reader);
30555             printf("\n");
30556         }
30557     }
30558     function_tests++;
30559 #endif
30560
30561     return(test_ret);
30562 }
30563
30564
30565 static int
30566 test_xmlTextReaderConstPrefix(void) {
30567     int test_ret = 0;
30568
30569 #if defined(LIBXML_READER_ENABLED)
30570     int mem_base;
30571     const xmlChar * ret_val;
30572     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30573     int n_reader;
30574
30575     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30576         mem_base = xmlMemBlocks();
30577         reader = gen_xmlTextReaderPtr(n_reader, 0);
30578
30579         ret_val = xmlTextReaderConstPrefix(reader);
30580         desret_const_xmlChar_ptr(ret_val);
30581         call_tests++;
30582         des_xmlTextReaderPtr(n_reader, reader, 0);
30583         xmlResetLastError();
30584         if (mem_base != xmlMemBlocks()) {
30585             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30586                    xmlMemBlocks() - mem_base);
30587             test_ret++;
30588             printf(" %d", n_reader);
30589             printf("\n");
30590         }
30591     }
30592     function_tests++;
30593 #endif
30594
30595     return(test_ret);
30596 }
30597
30598
30599 static int
30600 test_xmlTextReaderConstString(void) {
30601     int test_ret = 0;
30602
30603 #if defined(LIBXML_READER_ENABLED)
30604     int mem_base;
30605     const xmlChar * ret_val;
30606     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30607     int n_reader;
30608     xmlChar * str; /* the string to intern. */
30609     int n_str;
30610
30611     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30612     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30613         mem_base = xmlMemBlocks();
30614         reader = gen_xmlTextReaderPtr(n_reader, 0);
30615         str = gen_const_xmlChar_ptr(n_str, 1);
30616
30617         ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30618         desret_const_xmlChar_ptr(ret_val);
30619         call_tests++;
30620         des_xmlTextReaderPtr(n_reader, reader, 0);
30621         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30622         xmlResetLastError();
30623         if (mem_base != xmlMemBlocks()) {
30624             printf("Leak of %d blocks found in xmlTextReaderConstString",
30625                    xmlMemBlocks() - mem_base);
30626             test_ret++;
30627             printf(" %d", n_reader);
30628             printf(" %d", n_str);
30629             printf("\n");
30630         }
30631     }
30632     }
30633     function_tests++;
30634 #endif
30635
30636     return(test_ret);
30637 }
30638
30639
30640 static int
30641 test_xmlTextReaderConstValue(void) {
30642     int test_ret = 0;
30643
30644 #if defined(LIBXML_READER_ENABLED)
30645     int mem_base;
30646     const xmlChar * ret_val;
30647     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30648     int n_reader;
30649
30650     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30651         mem_base = xmlMemBlocks();
30652         reader = gen_xmlTextReaderPtr(n_reader, 0);
30653
30654         ret_val = xmlTextReaderConstValue(reader);
30655         desret_const_xmlChar_ptr(ret_val);
30656         call_tests++;
30657         des_xmlTextReaderPtr(n_reader, reader, 0);
30658         xmlResetLastError();
30659         if (mem_base != xmlMemBlocks()) {
30660             printf("Leak of %d blocks found in xmlTextReaderConstValue",
30661                    xmlMemBlocks() - mem_base);
30662             test_ret++;
30663             printf(" %d", n_reader);
30664             printf("\n");
30665         }
30666     }
30667     function_tests++;
30668 #endif
30669
30670     return(test_ret);
30671 }
30672
30673
30674 static int
30675 test_xmlTextReaderConstXmlLang(void) {
30676     int test_ret = 0;
30677
30678 #if defined(LIBXML_READER_ENABLED)
30679     int mem_base;
30680     const xmlChar * ret_val;
30681     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30682     int n_reader;
30683
30684     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30685         mem_base = xmlMemBlocks();
30686         reader = gen_xmlTextReaderPtr(n_reader, 0);
30687
30688         ret_val = xmlTextReaderConstXmlLang(reader);
30689         desret_const_xmlChar_ptr(ret_val);
30690         call_tests++;
30691         des_xmlTextReaderPtr(n_reader, reader, 0);
30692         xmlResetLastError();
30693         if (mem_base != xmlMemBlocks()) {
30694             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30695                    xmlMemBlocks() - mem_base);
30696             test_ret++;
30697             printf(" %d", n_reader);
30698             printf("\n");
30699         }
30700     }
30701     function_tests++;
30702 #endif
30703
30704     return(test_ret);
30705 }
30706
30707
30708 static int
30709 test_xmlTextReaderConstXmlVersion(void) {
30710     int test_ret = 0;
30711
30712 #if defined(LIBXML_READER_ENABLED)
30713     int mem_base;
30714     const xmlChar * ret_val;
30715     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30716     int n_reader;
30717
30718     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30719         mem_base = xmlMemBlocks();
30720         reader = gen_xmlTextReaderPtr(n_reader, 0);
30721
30722         ret_val = xmlTextReaderConstXmlVersion(reader);
30723         desret_const_xmlChar_ptr(ret_val);
30724         call_tests++;
30725         des_xmlTextReaderPtr(n_reader, reader, 0);
30726         xmlResetLastError();
30727         if (mem_base != xmlMemBlocks()) {
30728             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30729                    xmlMemBlocks() - mem_base);
30730             test_ret++;
30731             printf(" %d", n_reader);
30732             printf("\n");
30733         }
30734     }
30735     function_tests++;
30736 #endif
30737
30738     return(test_ret);
30739 }
30740
30741
30742 static int
30743 test_xmlTextReaderCurrentDoc(void) {
30744     int test_ret = 0;
30745
30746 #if defined(LIBXML_READER_ENABLED)
30747     int mem_base;
30748     xmlDocPtr ret_val;
30749     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30750     int n_reader;
30751
30752     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30753         mem_base = xmlMemBlocks();
30754         reader = gen_xmlTextReaderPtr(n_reader, 0);
30755
30756         ret_val = xmlTextReaderCurrentDoc(reader);
30757         desret_xmlDocPtr(ret_val);
30758         call_tests++;
30759         des_xmlTextReaderPtr(n_reader, reader, 0);
30760         xmlResetLastError();
30761         if (mem_base != xmlMemBlocks()) {
30762             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30763                    xmlMemBlocks() - mem_base);
30764             test_ret++;
30765             printf(" %d", n_reader);
30766             printf("\n");
30767         }
30768     }
30769     function_tests++;
30770 #endif
30771
30772     return(test_ret);
30773 }
30774
30775
30776 static int
30777 test_xmlTextReaderCurrentNode(void) {
30778     int test_ret = 0;
30779
30780 #if defined(LIBXML_READER_ENABLED)
30781     int mem_base;
30782     xmlNodePtr ret_val;
30783     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30784     int n_reader;
30785
30786     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30787         mem_base = xmlMemBlocks();
30788         reader = gen_xmlTextReaderPtr(n_reader, 0);
30789
30790         ret_val = xmlTextReaderCurrentNode(reader);
30791         desret_xmlNodePtr(ret_val);
30792         call_tests++;
30793         des_xmlTextReaderPtr(n_reader, reader, 0);
30794         xmlResetLastError();
30795         if (mem_base != xmlMemBlocks()) {
30796             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30797                    xmlMemBlocks() - mem_base);
30798             test_ret++;
30799             printf(" %d", n_reader);
30800             printf("\n");
30801         }
30802     }
30803     function_tests++;
30804 #endif
30805
30806     return(test_ret);
30807 }
30808
30809
30810 static int
30811 test_xmlTextReaderDepth(void) {
30812     int test_ret = 0;
30813
30814 #if defined(LIBXML_READER_ENABLED)
30815     int mem_base;
30816     int ret_val;
30817     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30818     int n_reader;
30819
30820     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30821         mem_base = xmlMemBlocks();
30822         reader = gen_xmlTextReaderPtr(n_reader, 0);
30823
30824         ret_val = xmlTextReaderDepth(reader);
30825         desret_int(ret_val);
30826         call_tests++;
30827         des_xmlTextReaderPtr(n_reader, reader, 0);
30828         xmlResetLastError();
30829         if (mem_base != xmlMemBlocks()) {
30830             printf("Leak of %d blocks found in xmlTextReaderDepth",
30831                    xmlMemBlocks() - mem_base);
30832             test_ret++;
30833             printf(" %d", n_reader);
30834             printf("\n");
30835         }
30836     }
30837     function_tests++;
30838 #endif
30839
30840     return(test_ret);
30841 }
30842
30843
30844 static int
30845 test_xmlTextReaderExpand(void) {
30846     int test_ret = 0;
30847
30848 #if defined(LIBXML_READER_ENABLED)
30849     int mem_base;
30850     xmlNodePtr ret_val;
30851     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30852     int n_reader;
30853
30854     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30855         mem_base = xmlMemBlocks();
30856         reader = gen_xmlTextReaderPtr(n_reader, 0);
30857
30858         ret_val = xmlTextReaderExpand(reader);
30859         desret_xmlNodePtr(ret_val);
30860         call_tests++;
30861         des_xmlTextReaderPtr(n_reader, reader, 0);
30862         xmlResetLastError();
30863         if (mem_base != xmlMemBlocks()) {
30864             printf("Leak of %d blocks found in xmlTextReaderExpand",
30865                    xmlMemBlocks() - mem_base);
30866             test_ret++;
30867             printf(" %d", n_reader);
30868             printf("\n");
30869         }
30870     }
30871     function_tests++;
30872 #endif
30873
30874     return(test_ret);
30875 }
30876
30877
30878 static int
30879 test_xmlTextReaderGetAttribute(void) {
30880     int test_ret = 0;
30881
30882 #if defined(LIBXML_READER_ENABLED)
30883     int mem_base;
30884     xmlChar * ret_val;
30885     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30886     int n_reader;
30887     xmlChar * name; /* the qualified name of the attribute. */
30888     int n_name;
30889
30890     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30891     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30892         mem_base = xmlMemBlocks();
30893         reader = gen_xmlTextReaderPtr(n_reader, 0);
30894         name = gen_const_xmlChar_ptr(n_name, 1);
30895
30896         ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30897         desret_xmlChar_ptr(ret_val);
30898         call_tests++;
30899         des_xmlTextReaderPtr(n_reader, reader, 0);
30900         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30901         xmlResetLastError();
30902         if (mem_base != xmlMemBlocks()) {
30903             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30904                    xmlMemBlocks() - mem_base);
30905             test_ret++;
30906             printf(" %d", n_reader);
30907             printf(" %d", n_name);
30908             printf("\n");
30909         }
30910     }
30911     }
30912     function_tests++;
30913 #endif
30914
30915     return(test_ret);
30916 }
30917
30918
30919 static int
30920 test_xmlTextReaderGetAttributeNo(void) {
30921     int test_ret = 0;
30922
30923 #if defined(LIBXML_READER_ENABLED)
30924     int mem_base;
30925     xmlChar * ret_val;
30926     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30927     int n_reader;
30928     int no; /* the zero-based index of the attribute relative to the containing element */
30929     int n_no;
30930
30931     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30932     for (n_no = 0;n_no < gen_nb_int;n_no++) {
30933         mem_base = xmlMemBlocks();
30934         reader = gen_xmlTextReaderPtr(n_reader, 0);
30935         no = gen_int(n_no, 1);
30936
30937         ret_val = xmlTextReaderGetAttributeNo(reader, no);
30938         desret_xmlChar_ptr(ret_val);
30939         call_tests++;
30940         des_xmlTextReaderPtr(n_reader, reader, 0);
30941         des_int(n_no, no, 1);
30942         xmlResetLastError();
30943         if (mem_base != xmlMemBlocks()) {
30944             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30945                    xmlMemBlocks() - mem_base);
30946             test_ret++;
30947             printf(" %d", n_reader);
30948             printf(" %d", n_no);
30949             printf("\n");
30950         }
30951     }
30952     }
30953     function_tests++;
30954 #endif
30955
30956     return(test_ret);
30957 }
30958
30959
30960 static int
30961 test_xmlTextReaderGetAttributeNs(void) {
30962     int test_ret = 0;
30963
30964 #if defined(LIBXML_READER_ENABLED)
30965     int mem_base;
30966     xmlChar * ret_val;
30967     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30968     int n_reader;
30969     xmlChar * localName; /* the local name of the attribute. */
30970     int n_localName;
30971     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30972     int n_namespaceURI;
30973
30974     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30975     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30976     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30977         mem_base = xmlMemBlocks();
30978         reader = gen_xmlTextReaderPtr(n_reader, 0);
30979         localName = gen_const_xmlChar_ptr(n_localName, 1);
30980         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30981
30982         ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30983         desret_xmlChar_ptr(ret_val);
30984         call_tests++;
30985         des_xmlTextReaderPtr(n_reader, reader, 0);
30986         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30987         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30988         xmlResetLastError();
30989         if (mem_base != xmlMemBlocks()) {
30990             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30991                    xmlMemBlocks() - mem_base);
30992             test_ret++;
30993             printf(" %d", n_reader);
30994             printf(" %d", n_localName);
30995             printf(" %d", n_namespaceURI);
30996             printf("\n");
30997         }
30998     }
30999     }
31000     }
31001     function_tests++;
31002 #endif
31003
31004     return(test_ret);
31005 }
31006
31007 #ifdef LIBXML_READER_ENABLED
31008
31009 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
31010 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31011     return(NULL);
31012 }
31013 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31014 }
31015 #endif
31016
31017
31018 static int
31019 test_xmlTextReaderGetErrorHandler(void) {
31020     int test_ret = 0;
31021
31022 #if defined(LIBXML_READER_ENABLED)
31023     int mem_base;
31024     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31025     int n_reader;
31026     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31027     int n_f;
31028     void ** arg; /* a user argument */
31029     int n_arg;
31030
31031     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31032     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31033     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31034         mem_base = xmlMemBlocks();
31035         reader = gen_xmlTextReaderPtr(n_reader, 0);
31036         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31037         arg = gen_void_ptr_ptr(n_arg, 2);
31038
31039         xmlTextReaderGetErrorHandler(reader, f, arg);
31040         call_tests++;
31041         des_xmlTextReaderPtr(n_reader, reader, 0);
31042         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31043         des_void_ptr_ptr(n_arg, arg, 2);
31044         xmlResetLastError();
31045         if (mem_base != xmlMemBlocks()) {
31046             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31047                    xmlMemBlocks() - mem_base);
31048             test_ret++;
31049             printf(" %d", n_reader);
31050             printf(" %d", n_f);
31051             printf(" %d", n_arg);
31052             printf("\n");
31053         }
31054     }
31055     }
31056     }
31057     function_tests++;
31058 #endif
31059
31060     return(test_ret);
31061 }
31062
31063
31064 static int
31065 test_xmlTextReaderGetParserColumnNumber(void) {
31066     int test_ret = 0;
31067
31068 #if defined(LIBXML_READER_ENABLED)
31069     int mem_base;
31070     int ret_val;
31071     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31072     int n_reader;
31073
31074     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31075         mem_base = xmlMemBlocks();
31076         reader = gen_xmlTextReaderPtr(n_reader, 0);
31077
31078         ret_val = xmlTextReaderGetParserColumnNumber(reader);
31079         desret_int(ret_val);
31080         call_tests++;
31081         des_xmlTextReaderPtr(n_reader, reader, 0);
31082         xmlResetLastError();
31083         if (mem_base != xmlMemBlocks()) {
31084             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31085                    xmlMemBlocks() - mem_base);
31086             test_ret++;
31087             printf(" %d", n_reader);
31088             printf("\n");
31089         }
31090     }
31091     function_tests++;
31092 #endif
31093
31094     return(test_ret);
31095 }
31096
31097
31098 static int
31099 test_xmlTextReaderGetParserLineNumber(void) {
31100     int test_ret = 0;
31101
31102 #if defined(LIBXML_READER_ENABLED)
31103     int mem_base;
31104     int ret_val;
31105     xmlTextReaderPtr reader; /* the user data (XML reader context) */
31106     int n_reader;
31107
31108     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31109         mem_base = xmlMemBlocks();
31110         reader = gen_xmlTextReaderPtr(n_reader, 0);
31111
31112         ret_val = xmlTextReaderGetParserLineNumber(reader);
31113         desret_int(ret_val);
31114         call_tests++;
31115         des_xmlTextReaderPtr(n_reader, reader, 0);
31116         xmlResetLastError();
31117         if (mem_base != xmlMemBlocks()) {
31118             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31119                    xmlMemBlocks() - mem_base);
31120             test_ret++;
31121             printf(" %d", n_reader);
31122             printf("\n");
31123         }
31124     }
31125     function_tests++;
31126 #endif
31127
31128     return(test_ret);
31129 }
31130
31131
31132 static int
31133 test_xmlTextReaderGetParserProp(void) {
31134     int test_ret = 0;
31135
31136 #if defined(LIBXML_READER_ENABLED)
31137     int mem_base;
31138     int ret_val;
31139     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31140     int n_reader;
31141     int prop; /* the xmlParserProperties to get */
31142     int n_prop;
31143
31144     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31145     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31146         mem_base = xmlMemBlocks();
31147         reader = gen_xmlTextReaderPtr(n_reader, 0);
31148         prop = gen_int(n_prop, 1);
31149
31150         ret_val = xmlTextReaderGetParserProp(reader, prop);
31151         desret_int(ret_val);
31152         call_tests++;
31153         des_xmlTextReaderPtr(n_reader, reader, 0);
31154         des_int(n_prop, prop, 1);
31155         xmlResetLastError();
31156         if (mem_base != xmlMemBlocks()) {
31157             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31158                    xmlMemBlocks() - mem_base);
31159             test_ret++;
31160             printf(" %d", n_reader);
31161             printf(" %d", n_prop);
31162             printf("\n");
31163         }
31164     }
31165     }
31166     function_tests++;
31167 #endif
31168
31169     return(test_ret);
31170 }
31171
31172
31173 static int
31174 test_xmlTextReaderGetRemainder(void) {
31175     int test_ret = 0;
31176
31177 #if defined(LIBXML_READER_ENABLED)
31178     int mem_base;
31179     xmlParserInputBufferPtr ret_val;
31180     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31181     int n_reader;
31182
31183     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31184         mem_base = xmlMemBlocks();
31185         reader = gen_xmlTextReaderPtr(n_reader, 0);
31186
31187         ret_val = xmlTextReaderGetRemainder(reader);
31188         desret_xmlParserInputBufferPtr(ret_val);
31189         call_tests++;
31190         des_xmlTextReaderPtr(n_reader, reader, 0);
31191         xmlResetLastError();
31192         if (mem_base != xmlMemBlocks()) {
31193             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31194                    xmlMemBlocks() - mem_base);
31195             test_ret++;
31196             printf(" %d", n_reader);
31197             printf("\n");
31198         }
31199     }
31200     function_tests++;
31201 #endif
31202
31203     return(test_ret);
31204 }
31205
31206
31207 static int
31208 test_xmlTextReaderHasAttributes(void) {
31209     int test_ret = 0;
31210
31211 #if defined(LIBXML_READER_ENABLED)
31212     int mem_base;
31213     int ret_val;
31214     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31215     int n_reader;
31216
31217     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31218         mem_base = xmlMemBlocks();
31219         reader = gen_xmlTextReaderPtr(n_reader, 0);
31220
31221         ret_val = xmlTextReaderHasAttributes(reader);
31222         desret_int(ret_val);
31223         call_tests++;
31224         des_xmlTextReaderPtr(n_reader, reader, 0);
31225         xmlResetLastError();
31226         if (mem_base != xmlMemBlocks()) {
31227             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31228                    xmlMemBlocks() - mem_base);
31229             test_ret++;
31230             printf(" %d", n_reader);
31231             printf("\n");
31232         }
31233     }
31234     function_tests++;
31235 #endif
31236
31237     return(test_ret);
31238 }
31239
31240
31241 static int
31242 test_xmlTextReaderHasValue(void) {
31243     int test_ret = 0;
31244
31245 #if defined(LIBXML_READER_ENABLED)
31246     int mem_base;
31247     int ret_val;
31248     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31249     int n_reader;
31250
31251     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31252         mem_base = xmlMemBlocks();
31253         reader = gen_xmlTextReaderPtr(n_reader, 0);
31254
31255         ret_val = xmlTextReaderHasValue(reader);
31256         desret_int(ret_val);
31257         call_tests++;
31258         des_xmlTextReaderPtr(n_reader, reader, 0);
31259         xmlResetLastError();
31260         if (mem_base != xmlMemBlocks()) {
31261             printf("Leak of %d blocks found in xmlTextReaderHasValue",
31262                    xmlMemBlocks() - mem_base);
31263             test_ret++;
31264             printf(" %d", n_reader);
31265             printf("\n");
31266         }
31267     }
31268     function_tests++;
31269 #endif
31270
31271     return(test_ret);
31272 }
31273
31274
31275 static int
31276 test_xmlTextReaderIsDefault(void) {
31277     int test_ret = 0;
31278
31279 #if defined(LIBXML_READER_ENABLED)
31280     int mem_base;
31281     int ret_val;
31282     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31283     int n_reader;
31284
31285     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31286         mem_base = xmlMemBlocks();
31287         reader = gen_xmlTextReaderPtr(n_reader, 0);
31288
31289         ret_val = xmlTextReaderIsDefault(reader);
31290         desret_int(ret_val);
31291         call_tests++;
31292         des_xmlTextReaderPtr(n_reader, reader, 0);
31293         xmlResetLastError();
31294         if (mem_base != xmlMemBlocks()) {
31295             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31296                    xmlMemBlocks() - mem_base);
31297             test_ret++;
31298             printf(" %d", n_reader);
31299             printf("\n");
31300         }
31301     }
31302     function_tests++;
31303 #endif
31304
31305     return(test_ret);
31306 }
31307
31308
31309 static int
31310 test_xmlTextReaderIsEmptyElement(void) {
31311     int test_ret = 0;
31312
31313 #if defined(LIBXML_READER_ENABLED)
31314     int mem_base;
31315     int ret_val;
31316     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31317     int n_reader;
31318
31319     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31320         mem_base = xmlMemBlocks();
31321         reader = gen_xmlTextReaderPtr(n_reader, 0);
31322
31323         ret_val = xmlTextReaderIsEmptyElement(reader);
31324         desret_int(ret_val);
31325         call_tests++;
31326         des_xmlTextReaderPtr(n_reader, reader, 0);
31327         xmlResetLastError();
31328         if (mem_base != xmlMemBlocks()) {
31329             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31330                    xmlMemBlocks() - mem_base);
31331             test_ret++;
31332             printf(" %d", n_reader);
31333             printf("\n");
31334         }
31335     }
31336     function_tests++;
31337 #endif
31338
31339     return(test_ret);
31340 }
31341
31342
31343 static int
31344 test_xmlTextReaderIsNamespaceDecl(void) {
31345     int test_ret = 0;
31346
31347 #if defined(LIBXML_READER_ENABLED)
31348     int mem_base;
31349     int ret_val;
31350     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31351     int n_reader;
31352
31353     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31354         mem_base = xmlMemBlocks();
31355         reader = gen_xmlTextReaderPtr(n_reader, 0);
31356
31357         ret_val = xmlTextReaderIsNamespaceDecl(reader);
31358         desret_int(ret_val);
31359         call_tests++;
31360         des_xmlTextReaderPtr(n_reader, reader, 0);
31361         xmlResetLastError();
31362         if (mem_base != xmlMemBlocks()) {
31363             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31364                    xmlMemBlocks() - mem_base);
31365             test_ret++;
31366             printf(" %d", n_reader);
31367             printf("\n");
31368         }
31369     }
31370     function_tests++;
31371 #endif
31372
31373     return(test_ret);
31374 }
31375
31376
31377 static int
31378 test_xmlTextReaderIsValid(void) {
31379     int test_ret = 0;
31380
31381 #if defined(LIBXML_READER_ENABLED)
31382     int mem_base;
31383     int ret_val;
31384     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31385     int n_reader;
31386
31387     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31388         mem_base = xmlMemBlocks();
31389         reader = gen_xmlTextReaderPtr(n_reader, 0);
31390
31391         ret_val = xmlTextReaderIsValid(reader);
31392         desret_int(ret_val);
31393         call_tests++;
31394         des_xmlTextReaderPtr(n_reader, reader, 0);
31395         xmlResetLastError();
31396         if (mem_base != xmlMemBlocks()) {
31397             printf("Leak of %d blocks found in xmlTextReaderIsValid",
31398                    xmlMemBlocks() - mem_base);
31399             test_ret++;
31400             printf(" %d", n_reader);
31401             printf("\n");
31402         }
31403     }
31404     function_tests++;
31405 #endif
31406
31407     return(test_ret);
31408 }
31409
31410
31411 static int
31412 test_xmlTextReaderLocalName(void) {
31413     int test_ret = 0;
31414
31415 #if defined(LIBXML_READER_ENABLED)
31416     int mem_base;
31417     xmlChar * ret_val;
31418     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31419     int n_reader;
31420
31421     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31422         mem_base = xmlMemBlocks();
31423         reader = gen_xmlTextReaderPtr(n_reader, 0);
31424
31425         ret_val = xmlTextReaderLocalName(reader);
31426         desret_xmlChar_ptr(ret_val);
31427         call_tests++;
31428         des_xmlTextReaderPtr(n_reader, reader, 0);
31429         xmlResetLastError();
31430         if (mem_base != xmlMemBlocks()) {
31431             printf("Leak of %d blocks found in xmlTextReaderLocalName",
31432                    xmlMemBlocks() - mem_base);
31433             test_ret++;
31434             printf(" %d", n_reader);
31435             printf("\n");
31436         }
31437     }
31438     function_tests++;
31439 #endif
31440
31441     return(test_ret);
31442 }
31443
31444 #ifdef LIBXML_READER_ENABLED
31445
31446 #define gen_nb_xmlTextReaderLocatorPtr 1
31447 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31448     return(NULL);
31449 }
31450 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31451 }
31452 #endif
31453
31454
31455 static int
31456 test_xmlTextReaderLocatorBaseURI(void) {
31457     int test_ret = 0;
31458
31459 #if defined(LIBXML_READER_ENABLED)
31460     int mem_base;
31461     xmlChar * ret_val;
31462     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31463     int n_locator;
31464
31465     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31466         mem_base = xmlMemBlocks();
31467         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31468
31469         ret_val = xmlTextReaderLocatorBaseURI(locator);
31470         desret_xmlChar_ptr(ret_val);
31471         call_tests++;
31472         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31473         xmlResetLastError();
31474         if (mem_base != xmlMemBlocks()) {
31475             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31476                    xmlMemBlocks() - mem_base);
31477             test_ret++;
31478             printf(" %d", n_locator);
31479             printf("\n");
31480         }
31481     }
31482     function_tests++;
31483 #endif
31484
31485     return(test_ret);
31486 }
31487
31488
31489 static int
31490 test_xmlTextReaderLocatorLineNumber(void) {
31491     int test_ret = 0;
31492
31493 #if defined(LIBXML_READER_ENABLED)
31494     int mem_base;
31495     int ret_val;
31496     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31497     int n_locator;
31498
31499     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31500         mem_base = xmlMemBlocks();
31501         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31502
31503         ret_val = xmlTextReaderLocatorLineNumber(locator);
31504         desret_int(ret_val);
31505         call_tests++;
31506         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31507         xmlResetLastError();
31508         if (mem_base != xmlMemBlocks()) {
31509             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31510                    xmlMemBlocks() - mem_base);
31511             test_ret++;
31512             printf(" %d", n_locator);
31513             printf("\n");
31514         }
31515     }
31516     function_tests++;
31517 #endif
31518
31519     return(test_ret);
31520 }
31521
31522
31523 static int
31524 test_xmlTextReaderLookupNamespace(void) {
31525     int test_ret = 0;
31526
31527 #if defined(LIBXML_READER_ENABLED)
31528     int mem_base;
31529     xmlChar * ret_val;
31530     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31531     int n_reader;
31532     xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31533     int n_prefix;
31534
31535     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31536     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31537         mem_base = xmlMemBlocks();
31538         reader = gen_xmlTextReaderPtr(n_reader, 0);
31539         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31540
31541         ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31542         desret_xmlChar_ptr(ret_val);
31543         call_tests++;
31544         des_xmlTextReaderPtr(n_reader, reader, 0);
31545         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31546         xmlResetLastError();
31547         if (mem_base != xmlMemBlocks()) {
31548             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31549                    xmlMemBlocks() - mem_base);
31550             test_ret++;
31551             printf(" %d", n_reader);
31552             printf(" %d", n_prefix);
31553             printf("\n");
31554         }
31555     }
31556     }
31557     function_tests++;
31558 #endif
31559
31560     return(test_ret);
31561 }
31562
31563
31564 static int
31565 test_xmlTextReaderMoveToAttribute(void) {
31566     int test_ret = 0;
31567
31568 #if defined(LIBXML_READER_ENABLED)
31569     int mem_base;
31570     int ret_val;
31571     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31572     int n_reader;
31573     xmlChar * name; /* the qualified name of the attribute. */
31574     int n_name;
31575
31576     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31577     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31578         mem_base = xmlMemBlocks();
31579         reader = gen_xmlTextReaderPtr(n_reader, 0);
31580         name = gen_const_xmlChar_ptr(n_name, 1);
31581
31582         ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31583         desret_int(ret_val);
31584         call_tests++;
31585         des_xmlTextReaderPtr(n_reader, reader, 0);
31586         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31587         xmlResetLastError();
31588         if (mem_base != xmlMemBlocks()) {
31589             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31590                    xmlMemBlocks() - mem_base);
31591             test_ret++;
31592             printf(" %d", n_reader);
31593             printf(" %d", n_name);
31594             printf("\n");
31595         }
31596     }
31597     }
31598     function_tests++;
31599 #endif
31600
31601     return(test_ret);
31602 }
31603
31604
31605 static int
31606 test_xmlTextReaderMoveToAttributeNo(void) {
31607     int test_ret = 0;
31608
31609 #if defined(LIBXML_READER_ENABLED)
31610     int mem_base;
31611     int ret_val;
31612     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31613     int n_reader;
31614     int no; /* the zero-based index of the attribute relative to the containing element. */
31615     int n_no;
31616
31617     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31618     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31619         mem_base = xmlMemBlocks();
31620         reader = gen_xmlTextReaderPtr(n_reader, 0);
31621         no = gen_int(n_no, 1);
31622
31623         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31624         desret_int(ret_val);
31625         call_tests++;
31626         des_xmlTextReaderPtr(n_reader, reader, 0);
31627         des_int(n_no, no, 1);
31628         xmlResetLastError();
31629         if (mem_base != xmlMemBlocks()) {
31630             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31631                    xmlMemBlocks() - mem_base);
31632             test_ret++;
31633             printf(" %d", n_reader);
31634             printf(" %d", n_no);
31635             printf("\n");
31636         }
31637     }
31638     }
31639     function_tests++;
31640 #endif
31641
31642     return(test_ret);
31643 }
31644
31645
31646 static int
31647 test_xmlTextReaderMoveToAttributeNs(void) {
31648     int test_ret = 0;
31649
31650 #if defined(LIBXML_READER_ENABLED)
31651     int mem_base;
31652     int ret_val;
31653     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31654     int n_reader;
31655     xmlChar * localName; /* the local name of the attribute. */
31656     int n_localName;
31657     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31658     int n_namespaceURI;
31659
31660     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31661     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31662     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31663         mem_base = xmlMemBlocks();
31664         reader = gen_xmlTextReaderPtr(n_reader, 0);
31665         localName = gen_const_xmlChar_ptr(n_localName, 1);
31666         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31667
31668         ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31669         desret_int(ret_val);
31670         call_tests++;
31671         des_xmlTextReaderPtr(n_reader, reader, 0);
31672         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31673         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31674         xmlResetLastError();
31675         if (mem_base != xmlMemBlocks()) {
31676             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31677                    xmlMemBlocks() - mem_base);
31678             test_ret++;
31679             printf(" %d", n_reader);
31680             printf(" %d", n_localName);
31681             printf(" %d", n_namespaceURI);
31682             printf("\n");
31683         }
31684     }
31685     }
31686     }
31687     function_tests++;
31688 #endif
31689
31690     return(test_ret);
31691 }
31692
31693
31694 static int
31695 test_xmlTextReaderMoveToElement(void) {
31696     int test_ret = 0;
31697
31698 #if defined(LIBXML_READER_ENABLED)
31699     int mem_base;
31700     int ret_val;
31701     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31702     int n_reader;
31703
31704     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31705         mem_base = xmlMemBlocks();
31706         reader = gen_xmlTextReaderPtr(n_reader, 0);
31707
31708         ret_val = xmlTextReaderMoveToElement(reader);
31709         desret_int(ret_val);
31710         call_tests++;
31711         des_xmlTextReaderPtr(n_reader, reader, 0);
31712         xmlResetLastError();
31713         if (mem_base != xmlMemBlocks()) {
31714             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31715                    xmlMemBlocks() - mem_base);
31716             test_ret++;
31717             printf(" %d", n_reader);
31718             printf("\n");
31719         }
31720     }
31721     function_tests++;
31722 #endif
31723
31724     return(test_ret);
31725 }
31726
31727
31728 static int
31729 test_xmlTextReaderMoveToFirstAttribute(void) {
31730     int test_ret = 0;
31731
31732 #if defined(LIBXML_READER_ENABLED)
31733     int mem_base;
31734     int ret_val;
31735     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31736     int n_reader;
31737
31738     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31739         mem_base = xmlMemBlocks();
31740         reader = gen_xmlTextReaderPtr(n_reader, 0);
31741
31742         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31743         desret_int(ret_val);
31744         call_tests++;
31745         des_xmlTextReaderPtr(n_reader, reader, 0);
31746         xmlResetLastError();
31747         if (mem_base != xmlMemBlocks()) {
31748             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31749                    xmlMemBlocks() - mem_base);
31750             test_ret++;
31751             printf(" %d", n_reader);
31752             printf("\n");
31753         }
31754     }
31755     function_tests++;
31756 #endif
31757
31758     return(test_ret);
31759 }
31760
31761
31762 static int
31763 test_xmlTextReaderMoveToNextAttribute(void) {
31764     int test_ret = 0;
31765
31766 #if defined(LIBXML_READER_ENABLED)
31767     int mem_base;
31768     int ret_val;
31769     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31770     int n_reader;
31771
31772     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31773         mem_base = xmlMemBlocks();
31774         reader = gen_xmlTextReaderPtr(n_reader, 0);
31775
31776         ret_val = xmlTextReaderMoveToNextAttribute(reader);
31777         desret_int(ret_val);
31778         call_tests++;
31779         des_xmlTextReaderPtr(n_reader, reader, 0);
31780         xmlResetLastError();
31781         if (mem_base != xmlMemBlocks()) {
31782             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31783                    xmlMemBlocks() - mem_base);
31784             test_ret++;
31785             printf(" %d", n_reader);
31786             printf("\n");
31787         }
31788     }
31789     function_tests++;
31790 #endif
31791
31792     return(test_ret);
31793 }
31794
31795
31796 static int
31797 test_xmlTextReaderName(void) {
31798     int test_ret = 0;
31799
31800 #if defined(LIBXML_READER_ENABLED)
31801     int mem_base;
31802     xmlChar * ret_val;
31803     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31804     int n_reader;
31805
31806     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31807         mem_base = xmlMemBlocks();
31808         reader = gen_xmlTextReaderPtr(n_reader, 0);
31809
31810         ret_val = xmlTextReaderName(reader);
31811         desret_xmlChar_ptr(ret_val);
31812         call_tests++;
31813         des_xmlTextReaderPtr(n_reader, reader, 0);
31814         xmlResetLastError();
31815         if (mem_base != xmlMemBlocks()) {
31816             printf("Leak of %d blocks found in xmlTextReaderName",
31817                    xmlMemBlocks() - mem_base);
31818             test_ret++;
31819             printf(" %d", n_reader);
31820             printf("\n");
31821         }
31822     }
31823     function_tests++;
31824 #endif
31825
31826     return(test_ret);
31827 }
31828
31829
31830 static int
31831 test_xmlTextReaderNamespaceUri(void) {
31832     int test_ret = 0;
31833
31834 #if defined(LIBXML_READER_ENABLED)
31835     int mem_base;
31836     xmlChar * ret_val;
31837     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31838     int n_reader;
31839
31840     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31841         mem_base = xmlMemBlocks();
31842         reader = gen_xmlTextReaderPtr(n_reader, 0);
31843
31844         ret_val = xmlTextReaderNamespaceUri(reader);
31845         desret_xmlChar_ptr(ret_val);
31846         call_tests++;
31847         des_xmlTextReaderPtr(n_reader, reader, 0);
31848         xmlResetLastError();
31849         if (mem_base != xmlMemBlocks()) {
31850             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31851                    xmlMemBlocks() - mem_base);
31852             test_ret++;
31853             printf(" %d", n_reader);
31854             printf("\n");
31855         }
31856     }
31857     function_tests++;
31858 #endif
31859
31860     return(test_ret);
31861 }
31862
31863
31864 static int
31865 test_xmlTextReaderNext(void) {
31866     int test_ret = 0;
31867
31868 #if defined(LIBXML_READER_ENABLED)
31869     int mem_base;
31870     int ret_val;
31871     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31872     int n_reader;
31873
31874     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31875         mem_base = xmlMemBlocks();
31876         reader = gen_xmlTextReaderPtr(n_reader, 0);
31877
31878         ret_val = xmlTextReaderNext(reader);
31879         desret_int(ret_val);
31880         call_tests++;
31881         des_xmlTextReaderPtr(n_reader, reader, 0);
31882         xmlResetLastError();
31883         if (mem_base != xmlMemBlocks()) {
31884             printf("Leak of %d blocks found in xmlTextReaderNext",
31885                    xmlMemBlocks() - mem_base);
31886             test_ret++;
31887             printf(" %d", n_reader);
31888             printf("\n");
31889         }
31890     }
31891     function_tests++;
31892 #endif
31893
31894     return(test_ret);
31895 }
31896
31897
31898 static int
31899 test_xmlTextReaderNextSibling(void) {
31900     int test_ret = 0;
31901
31902 #if defined(LIBXML_READER_ENABLED)
31903     int mem_base;
31904     int ret_val;
31905     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31906     int n_reader;
31907
31908     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31909         mem_base = xmlMemBlocks();
31910         reader = gen_xmlTextReaderPtr(n_reader, 0);
31911
31912         ret_val = xmlTextReaderNextSibling(reader);
31913         desret_int(ret_val);
31914         call_tests++;
31915         des_xmlTextReaderPtr(n_reader, reader, 0);
31916         xmlResetLastError();
31917         if (mem_base != xmlMemBlocks()) {
31918             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31919                    xmlMemBlocks() - mem_base);
31920             test_ret++;
31921             printf(" %d", n_reader);
31922             printf("\n");
31923         }
31924     }
31925     function_tests++;
31926 #endif
31927
31928     return(test_ret);
31929 }
31930
31931
31932 static int
31933 test_xmlTextReaderNodeType(void) {
31934     int test_ret = 0;
31935
31936 #if defined(LIBXML_READER_ENABLED)
31937     int mem_base;
31938     int ret_val;
31939     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31940     int n_reader;
31941
31942     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31943         mem_base = xmlMemBlocks();
31944         reader = gen_xmlTextReaderPtr(n_reader, 0);
31945
31946         ret_val = xmlTextReaderNodeType(reader);
31947         desret_int(ret_val);
31948         call_tests++;
31949         des_xmlTextReaderPtr(n_reader, reader, 0);
31950         xmlResetLastError();
31951         if (mem_base != xmlMemBlocks()) {
31952             printf("Leak of %d blocks found in xmlTextReaderNodeType",
31953                    xmlMemBlocks() - mem_base);
31954             test_ret++;
31955             printf(" %d", n_reader);
31956             printf("\n");
31957         }
31958     }
31959     function_tests++;
31960 #endif
31961
31962     return(test_ret);
31963 }
31964
31965
31966 static int
31967 test_xmlTextReaderNormalization(void) {
31968     int test_ret = 0;
31969
31970 #if defined(LIBXML_READER_ENABLED)
31971     int mem_base;
31972     int ret_val;
31973     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31974     int n_reader;
31975
31976     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31977         mem_base = xmlMemBlocks();
31978         reader = gen_xmlTextReaderPtr(n_reader, 0);
31979
31980         ret_val = xmlTextReaderNormalization(reader);
31981         desret_int(ret_val);
31982         call_tests++;
31983         des_xmlTextReaderPtr(n_reader, reader, 0);
31984         xmlResetLastError();
31985         if (mem_base != xmlMemBlocks()) {
31986             printf("Leak of %d blocks found in xmlTextReaderNormalization",
31987                    xmlMemBlocks() - mem_base);
31988             test_ret++;
31989             printf(" %d", n_reader);
31990             printf("\n");
31991         }
31992     }
31993     function_tests++;
31994 #endif
31995
31996     return(test_ret);
31997 }
31998
31999
32000 static int
32001 test_xmlTextReaderPrefix(void) {
32002     int test_ret = 0;
32003
32004 #if defined(LIBXML_READER_ENABLED)
32005     int mem_base;
32006     xmlChar * ret_val;
32007     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32008     int n_reader;
32009
32010     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32011         mem_base = xmlMemBlocks();
32012         reader = gen_xmlTextReaderPtr(n_reader, 0);
32013
32014         ret_val = xmlTextReaderPrefix(reader);
32015         desret_xmlChar_ptr(ret_val);
32016         call_tests++;
32017         des_xmlTextReaderPtr(n_reader, reader, 0);
32018         xmlResetLastError();
32019         if (mem_base != xmlMemBlocks()) {
32020             printf("Leak of %d blocks found in xmlTextReaderPrefix",
32021                    xmlMemBlocks() - mem_base);
32022             test_ret++;
32023             printf(" %d", n_reader);
32024             printf("\n");
32025         }
32026     }
32027     function_tests++;
32028 #endif
32029
32030     return(test_ret);
32031 }
32032
32033
32034 static int
32035 test_xmlTextReaderPreserve(void) {
32036     int test_ret = 0;
32037
32038 #if defined(LIBXML_READER_ENABLED)
32039     int mem_base;
32040     xmlNodePtr ret_val;
32041     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32042     int n_reader;
32043
32044     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32045         mem_base = xmlMemBlocks();
32046         reader = gen_xmlTextReaderPtr(n_reader, 0);
32047
32048         ret_val = xmlTextReaderPreserve(reader);
32049         desret_xmlNodePtr(ret_val);
32050         call_tests++;
32051         des_xmlTextReaderPtr(n_reader, reader, 0);
32052         xmlResetLastError();
32053         if (mem_base != xmlMemBlocks()) {
32054             printf("Leak of %d blocks found in xmlTextReaderPreserve",
32055                    xmlMemBlocks() - mem_base);
32056             test_ret++;
32057             printf(" %d", n_reader);
32058             printf("\n");
32059         }
32060     }
32061     function_tests++;
32062 #endif
32063
32064     return(test_ret);
32065 }
32066
32067
32068 static int
32069 test_xmlTextReaderPreservePattern(void) {
32070     int test_ret = 0;
32071
32072 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32073 #ifdef LIBXML_PATTERN_ENABLED
32074     int mem_base;
32075     int ret_val;
32076     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32077     int n_reader;
32078     xmlChar * pattern; /* an XPath subset pattern */
32079     int n_pattern;
32080     xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32081     int n_namespaces;
32082
32083     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32084     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32085     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32086         mem_base = xmlMemBlocks();
32087         reader = gen_xmlTextReaderPtr(n_reader, 0);
32088         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32089         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32090
32091         ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32092         desret_int(ret_val);
32093         call_tests++;
32094         des_xmlTextReaderPtr(n_reader, reader, 0);
32095         des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32096         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32097         xmlResetLastError();
32098         if (mem_base != xmlMemBlocks()) {
32099             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32100                    xmlMemBlocks() - mem_base);
32101             test_ret++;
32102             printf(" %d", n_reader);
32103             printf(" %d", n_pattern);
32104             printf(" %d", n_namespaces);
32105             printf("\n");
32106         }
32107     }
32108     }
32109     }
32110     function_tests++;
32111 #endif
32112 #endif
32113
32114     return(test_ret);
32115 }
32116
32117
32118 static int
32119 test_xmlTextReaderQuoteChar(void) {
32120     int test_ret = 0;
32121
32122 #if defined(LIBXML_READER_ENABLED)
32123     int mem_base;
32124     int ret_val;
32125     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32126     int n_reader;
32127
32128     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32129         mem_base = xmlMemBlocks();
32130         reader = gen_xmlTextReaderPtr(n_reader, 0);
32131
32132         ret_val = xmlTextReaderQuoteChar(reader);
32133         desret_int(ret_val);
32134         call_tests++;
32135         des_xmlTextReaderPtr(n_reader, reader, 0);
32136         xmlResetLastError();
32137         if (mem_base != xmlMemBlocks()) {
32138             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32139                    xmlMemBlocks() - mem_base);
32140             test_ret++;
32141             printf(" %d", n_reader);
32142             printf("\n");
32143         }
32144     }
32145     function_tests++;
32146 #endif
32147
32148     return(test_ret);
32149 }
32150
32151
32152 static int
32153 test_xmlTextReaderRead(void) {
32154     int test_ret = 0;
32155
32156 #if defined(LIBXML_READER_ENABLED)
32157     int mem_base;
32158     int ret_val;
32159     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32160     int n_reader;
32161
32162     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32163         mem_base = xmlMemBlocks();
32164         reader = gen_xmlTextReaderPtr(n_reader, 0);
32165
32166         ret_val = xmlTextReaderRead(reader);
32167         desret_int(ret_val);
32168         call_tests++;
32169         des_xmlTextReaderPtr(n_reader, reader, 0);
32170         xmlResetLastError();
32171         if (mem_base != xmlMemBlocks()) {
32172             printf("Leak of %d blocks found in xmlTextReaderRead",
32173                    xmlMemBlocks() - mem_base);
32174             test_ret++;
32175             printf(" %d", n_reader);
32176             printf("\n");
32177         }
32178     }
32179     function_tests++;
32180 #endif
32181
32182     return(test_ret);
32183 }
32184
32185
32186 static int
32187 test_xmlTextReaderReadAttributeValue(void) {
32188     int test_ret = 0;
32189
32190 #if defined(LIBXML_READER_ENABLED)
32191     int mem_base;
32192     int ret_val;
32193     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32194     int n_reader;
32195
32196     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32197         mem_base = xmlMemBlocks();
32198         reader = gen_xmlTextReaderPtr(n_reader, 0);
32199
32200         ret_val = xmlTextReaderReadAttributeValue(reader);
32201         desret_int(ret_val);
32202         call_tests++;
32203         des_xmlTextReaderPtr(n_reader, reader, 0);
32204         xmlResetLastError();
32205         if (mem_base != xmlMemBlocks()) {
32206             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32207                    xmlMemBlocks() - mem_base);
32208             test_ret++;
32209             printf(" %d", n_reader);
32210             printf("\n");
32211         }
32212     }
32213     function_tests++;
32214 #endif
32215
32216     return(test_ret);
32217 }
32218
32219
32220 static int
32221 test_xmlTextReaderReadState(void) {
32222     int test_ret = 0;
32223
32224 #if defined(LIBXML_READER_ENABLED)
32225     int mem_base;
32226     int ret_val;
32227     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32228     int n_reader;
32229
32230     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32231         mem_base = xmlMemBlocks();
32232         reader = gen_xmlTextReaderPtr(n_reader, 0);
32233
32234         ret_val = xmlTextReaderReadState(reader);
32235         desret_int(ret_val);
32236         call_tests++;
32237         des_xmlTextReaderPtr(n_reader, reader, 0);
32238         xmlResetLastError();
32239         if (mem_base != xmlMemBlocks()) {
32240             printf("Leak of %d blocks found in xmlTextReaderReadState",
32241                    xmlMemBlocks() - mem_base);
32242             test_ret++;
32243             printf(" %d", n_reader);
32244             printf("\n");
32245         }
32246     }
32247     function_tests++;
32248 #endif
32249
32250     return(test_ret);
32251 }
32252
32253
32254 static int
32255 test_xmlTextReaderRelaxNGSetSchema(void) {
32256     int test_ret = 0;
32257
32258 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32259     int mem_base;
32260     int ret_val;
32261     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32262     int n_reader;
32263     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32264     int n_schema;
32265
32266     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32267     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32268         mem_base = xmlMemBlocks();
32269         reader = gen_xmlTextReaderPtr(n_reader, 0);
32270         schema = gen_xmlRelaxNGPtr(n_schema, 1);
32271
32272         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32273         desret_int(ret_val);
32274         call_tests++;
32275         des_xmlTextReaderPtr(n_reader, reader, 0);
32276         des_xmlRelaxNGPtr(n_schema, schema, 1);
32277         xmlResetLastError();
32278         if (mem_base != xmlMemBlocks()) {
32279             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32280                    xmlMemBlocks() - mem_base);
32281             test_ret++;
32282             printf(" %d", n_reader);
32283             printf(" %d", n_schema);
32284             printf("\n");
32285         }
32286     }
32287     }
32288     function_tests++;
32289 #endif
32290
32291     return(test_ret);
32292 }
32293
32294
32295 static int
32296 test_xmlTextReaderRelaxNGValidate(void) {
32297     int test_ret = 0;
32298
32299 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32300     int mem_base;
32301     int ret_val;
32302     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32303     int n_reader;
32304     char * rng; /* the path to a RelaxNG schema or NULL */
32305     int n_rng;
32306
32307     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32308     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32309         mem_base = xmlMemBlocks();
32310         reader = gen_xmlTextReaderPtr(n_reader, 0);
32311         rng = gen_const_char_ptr(n_rng, 1);
32312
32313         ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32314         desret_int(ret_val);
32315         call_tests++;
32316         des_xmlTextReaderPtr(n_reader, reader, 0);
32317         des_const_char_ptr(n_rng, (const char *)rng, 1);
32318         xmlResetLastError();
32319         if (mem_base != xmlMemBlocks()) {
32320             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32321                    xmlMemBlocks() - mem_base);
32322             test_ret++;
32323             printf(" %d", n_reader);
32324             printf(" %d", n_rng);
32325             printf("\n");
32326         }
32327     }
32328     }
32329     function_tests++;
32330 #endif
32331
32332     return(test_ret);
32333 }
32334
32335
32336 static int
32337 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32338     int test_ret = 0;
32339
32340 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32341     int mem_base;
32342     int ret_val;
32343     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32344     int n_reader;
32345     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32346     int n_ctxt;
32347     int options; /* options (not used yet) */
32348     int n_options;
32349
32350     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32351     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32352     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32353         mem_base = xmlMemBlocks();
32354         reader = gen_xmlTextReaderPtr(n_reader, 0);
32355         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32356         options = gen_parseroptions(n_options, 2);
32357
32358         ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32359         desret_int(ret_val);
32360         call_tests++;
32361         des_xmlTextReaderPtr(n_reader, reader, 0);
32362         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32363         des_parseroptions(n_options, options, 2);
32364         xmlResetLastError();
32365         if (mem_base != xmlMemBlocks()) {
32366             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32367                    xmlMemBlocks() - mem_base);
32368             test_ret++;
32369             printf(" %d", n_reader);
32370             printf(" %d", n_ctxt);
32371             printf(" %d", n_options);
32372             printf("\n");
32373         }
32374     }
32375     }
32376     }
32377     function_tests++;
32378 #endif
32379
32380     return(test_ret);
32381 }
32382
32383
32384 static int
32385 test_xmlTextReaderSchemaValidate(void) {
32386     int test_ret = 0;
32387
32388 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32389     int ret_val;
32390     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32391     int n_reader;
32392     char * xsd; /* the path to a W3C XSD schema or NULL */
32393     int n_xsd;
32394
32395     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32396     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32397         reader = gen_xmlTextReaderPtr(n_reader, 0);
32398         xsd = gen_const_char_ptr(n_xsd, 1);
32399
32400         ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32401         desret_int(ret_val);
32402         call_tests++;
32403         des_xmlTextReaderPtr(n_reader, reader, 0);
32404         des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32405         xmlResetLastError();
32406     }
32407     }
32408     function_tests++;
32409 #endif
32410
32411     return(test_ret);
32412 }
32413
32414
32415 static int
32416 test_xmlTextReaderSchemaValidateCtxt(void) {
32417     int test_ret = 0;
32418
32419 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32420     int mem_base;
32421     int ret_val;
32422     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32423     int n_reader;
32424     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32425     int n_ctxt;
32426     int options; /* options (not used yet) */
32427     int n_options;
32428
32429     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32430     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32431     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32432         mem_base = xmlMemBlocks();
32433         reader = gen_xmlTextReaderPtr(n_reader, 0);
32434         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32435         options = gen_parseroptions(n_options, 2);
32436
32437         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32438         desret_int(ret_val);
32439         call_tests++;
32440         des_xmlTextReaderPtr(n_reader, reader, 0);
32441         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32442         des_parseroptions(n_options, options, 2);
32443         xmlResetLastError();
32444         if (mem_base != xmlMemBlocks()) {
32445             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32446                    xmlMemBlocks() - mem_base);
32447             test_ret++;
32448             printf(" %d", n_reader);
32449             printf(" %d", n_ctxt);
32450             printf(" %d", n_options);
32451             printf("\n");
32452         }
32453     }
32454     }
32455     }
32456     function_tests++;
32457 #endif
32458
32459     return(test_ret);
32460 }
32461
32462
32463 static int
32464 test_xmlTextReaderSetErrorHandler(void) {
32465     int test_ret = 0;
32466
32467
32468     /* missing type support */
32469     return(test_ret);
32470 }
32471
32472
32473 static int
32474 test_xmlTextReaderSetParserProp(void) {
32475     int test_ret = 0;
32476
32477 #if defined(LIBXML_READER_ENABLED)
32478     int mem_base;
32479     int ret_val;
32480     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32481     int n_reader;
32482     int prop; /* the xmlParserProperties to set */
32483     int n_prop;
32484     int value; /* usually 0 or 1 to (de)activate it */
32485     int n_value;
32486
32487     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32488     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32489     for (n_value = 0;n_value < gen_nb_int;n_value++) {
32490         mem_base = xmlMemBlocks();
32491         reader = gen_xmlTextReaderPtr(n_reader, 0);
32492         prop = gen_int(n_prop, 1);
32493         value = gen_int(n_value, 2);
32494
32495         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32496         desret_int(ret_val);
32497         call_tests++;
32498         des_xmlTextReaderPtr(n_reader, reader, 0);
32499         des_int(n_prop, prop, 1);
32500         des_int(n_value, value, 2);
32501         xmlResetLastError();
32502         if (mem_base != xmlMemBlocks()) {
32503             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32504                    xmlMemBlocks() - mem_base);
32505             test_ret++;
32506             printf(" %d", n_reader);
32507             printf(" %d", n_prop);
32508             printf(" %d", n_value);
32509             printf("\n");
32510         }
32511     }
32512     }
32513     }
32514     function_tests++;
32515 #endif
32516
32517     return(test_ret);
32518 }
32519
32520
32521 static int
32522 test_xmlTextReaderSetSchema(void) {
32523     int test_ret = 0;
32524
32525 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32526     int mem_base;
32527     int ret_val;
32528     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32529     int n_reader;
32530     xmlSchemaPtr schema; /* a precompiled Schema schema */
32531     int n_schema;
32532
32533     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32534     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32535         mem_base = xmlMemBlocks();
32536         reader = gen_xmlTextReaderPtr(n_reader, 0);
32537         schema = gen_xmlSchemaPtr(n_schema, 1);
32538
32539         ret_val = xmlTextReaderSetSchema(reader, schema);
32540         desret_int(ret_val);
32541         call_tests++;
32542         des_xmlTextReaderPtr(n_reader, reader, 0);
32543         des_xmlSchemaPtr(n_schema, schema, 1);
32544         xmlResetLastError();
32545         if (mem_base != xmlMemBlocks()) {
32546             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32547                    xmlMemBlocks() - mem_base);
32548             test_ret++;
32549             printf(" %d", n_reader);
32550             printf(" %d", n_schema);
32551             printf("\n");
32552         }
32553     }
32554     }
32555     function_tests++;
32556 #endif
32557
32558     return(test_ret);
32559 }
32560
32561
32562 static int
32563 test_xmlTextReaderSetStructuredErrorHandler(void) {
32564     int test_ret = 0;
32565
32566
32567     /* missing type support */
32568     return(test_ret);
32569 }
32570
32571
32572 static int
32573 test_xmlTextReaderSetup(void) {
32574     int test_ret = 0;
32575
32576 #if defined(LIBXML_READER_ENABLED)
32577     int mem_base;
32578     int ret_val;
32579     xmlTextReaderPtr reader; /* an XML reader */
32580     int n_reader;
32581     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32582     int n_input;
32583     const char * URL; /* the base URL to use for the document */
32584     int n_URL;
32585     char * encoding; /* the document encoding, or NULL */
32586     int n_encoding;
32587     int options; /* a combination of xmlParserOption */
32588     int n_options;
32589
32590     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32591     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32592     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32593     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32594     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32595         mem_base = xmlMemBlocks();
32596         reader = gen_xmlTextReaderPtr(n_reader, 0);
32597         input = gen_xmlParserInputBufferPtr(n_input, 1);
32598         URL = gen_filepath(n_URL, 2);
32599         encoding = gen_const_char_ptr(n_encoding, 3);
32600         options = gen_parseroptions(n_options, 4);
32601
32602         ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32603         desret_int(ret_val);
32604         call_tests++;
32605         des_xmlTextReaderPtr(n_reader, reader, 0);
32606         des_filepath(n_URL, URL, 2);
32607         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32608         des_parseroptions(n_options, options, 4);
32609         xmlResetLastError();
32610         if (mem_base != xmlMemBlocks()) {
32611             printf("Leak of %d blocks found in xmlTextReaderSetup",
32612                    xmlMemBlocks() - mem_base);
32613             test_ret++;
32614             printf(" %d", n_reader);
32615             printf(" %d", n_input);
32616             printf(" %d", n_URL);
32617             printf(" %d", n_encoding);
32618             printf(" %d", n_options);
32619             printf("\n");
32620         }
32621     }
32622     }
32623     }
32624     }
32625     }
32626     function_tests++;
32627 #endif
32628
32629     return(test_ret);
32630 }
32631
32632
32633 static int
32634 test_xmlTextReaderStandalone(void) {
32635     int test_ret = 0;
32636
32637 #if defined(LIBXML_READER_ENABLED)
32638     int mem_base;
32639     int ret_val;
32640     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32641     int n_reader;
32642
32643     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32644         mem_base = xmlMemBlocks();
32645         reader = gen_xmlTextReaderPtr(n_reader, 0);
32646
32647         ret_val = xmlTextReaderStandalone(reader);
32648         desret_int(ret_val);
32649         call_tests++;
32650         des_xmlTextReaderPtr(n_reader, reader, 0);
32651         xmlResetLastError();
32652         if (mem_base != xmlMemBlocks()) {
32653             printf("Leak of %d blocks found in xmlTextReaderStandalone",
32654                    xmlMemBlocks() - mem_base);
32655             test_ret++;
32656             printf(" %d", n_reader);
32657             printf("\n");
32658         }
32659     }
32660     function_tests++;
32661 #endif
32662
32663     return(test_ret);
32664 }
32665
32666
32667 static int
32668 test_xmlTextReaderValue(void) {
32669     int test_ret = 0;
32670
32671 #if defined(LIBXML_READER_ENABLED)
32672     int mem_base;
32673     xmlChar * ret_val;
32674     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32675     int n_reader;
32676
32677     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32678         mem_base = xmlMemBlocks();
32679         reader = gen_xmlTextReaderPtr(n_reader, 0);
32680
32681         ret_val = xmlTextReaderValue(reader);
32682         desret_xmlChar_ptr(ret_val);
32683         call_tests++;
32684         des_xmlTextReaderPtr(n_reader, reader, 0);
32685         xmlResetLastError();
32686         if (mem_base != xmlMemBlocks()) {
32687             printf("Leak of %d blocks found in xmlTextReaderValue",
32688                    xmlMemBlocks() - mem_base);
32689             test_ret++;
32690             printf(" %d", n_reader);
32691             printf("\n");
32692         }
32693     }
32694     function_tests++;
32695 #endif
32696
32697     return(test_ret);
32698 }
32699
32700
32701 static int
32702 test_xmlTextReaderXmlLang(void) {
32703     int test_ret = 0;
32704
32705 #if defined(LIBXML_READER_ENABLED)
32706     int mem_base;
32707     xmlChar * ret_val;
32708     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32709     int n_reader;
32710
32711     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32712         mem_base = xmlMemBlocks();
32713         reader = gen_xmlTextReaderPtr(n_reader, 0);
32714
32715         ret_val = xmlTextReaderXmlLang(reader);
32716         desret_xmlChar_ptr(ret_val);
32717         call_tests++;
32718         des_xmlTextReaderPtr(n_reader, reader, 0);
32719         xmlResetLastError();
32720         if (mem_base != xmlMemBlocks()) {
32721             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32722                    xmlMemBlocks() - mem_base);
32723             test_ret++;
32724             printf(" %d", n_reader);
32725             printf("\n");
32726         }
32727     }
32728     function_tests++;
32729 #endif
32730
32731     return(test_ret);
32732 }
32733
32734 static int
32735 test_xmlreader(void) {
32736     int test_ret = 0;
32737
32738     if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
32739     test_ret += test_xmlNewTextReader();
32740     test_ret += test_xmlNewTextReaderFilename();
32741     test_ret += test_xmlReaderForDoc();
32742     test_ret += test_xmlReaderForFile();
32743     test_ret += test_xmlReaderForMemory();
32744     test_ret += test_xmlReaderNewDoc();
32745     test_ret += test_xmlReaderNewFile();
32746     test_ret += test_xmlReaderNewMemory();
32747     test_ret += test_xmlReaderNewWalker();
32748     test_ret += test_xmlReaderWalker();
32749     test_ret += test_xmlTextReaderAttributeCount();
32750     test_ret += test_xmlTextReaderBaseUri();
32751     test_ret += test_xmlTextReaderByteConsumed();
32752     test_ret += test_xmlTextReaderClose();
32753     test_ret += test_xmlTextReaderConstBaseUri();
32754     test_ret += test_xmlTextReaderConstEncoding();
32755     test_ret += test_xmlTextReaderConstLocalName();
32756     test_ret += test_xmlTextReaderConstName();
32757     test_ret += test_xmlTextReaderConstNamespaceUri();
32758     test_ret += test_xmlTextReaderConstPrefix();
32759     test_ret += test_xmlTextReaderConstString();
32760     test_ret += test_xmlTextReaderConstValue();
32761     test_ret += test_xmlTextReaderConstXmlLang();
32762     test_ret += test_xmlTextReaderConstXmlVersion();
32763     test_ret += test_xmlTextReaderCurrentDoc();
32764     test_ret += test_xmlTextReaderCurrentNode();
32765     test_ret += test_xmlTextReaderDepth();
32766     test_ret += test_xmlTextReaderExpand();
32767     test_ret += test_xmlTextReaderGetAttribute();
32768     test_ret += test_xmlTextReaderGetAttributeNo();
32769     test_ret += test_xmlTextReaderGetAttributeNs();
32770     test_ret += test_xmlTextReaderGetErrorHandler();
32771     test_ret += test_xmlTextReaderGetParserColumnNumber();
32772     test_ret += test_xmlTextReaderGetParserLineNumber();
32773     test_ret += test_xmlTextReaderGetParserProp();
32774     test_ret += test_xmlTextReaderGetRemainder();
32775     test_ret += test_xmlTextReaderHasAttributes();
32776     test_ret += test_xmlTextReaderHasValue();
32777     test_ret += test_xmlTextReaderIsDefault();
32778     test_ret += test_xmlTextReaderIsEmptyElement();
32779     test_ret += test_xmlTextReaderIsNamespaceDecl();
32780     test_ret += test_xmlTextReaderIsValid();
32781     test_ret += test_xmlTextReaderLocalName();
32782     test_ret += test_xmlTextReaderLocatorBaseURI();
32783     test_ret += test_xmlTextReaderLocatorLineNumber();
32784     test_ret += test_xmlTextReaderLookupNamespace();
32785     test_ret += test_xmlTextReaderMoveToAttribute();
32786     test_ret += test_xmlTextReaderMoveToAttributeNo();
32787     test_ret += test_xmlTextReaderMoveToAttributeNs();
32788     test_ret += test_xmlTextReaderMoveToElement();
32789     test_ret += test_xmlTextReaderMoveToFirstAttribute();
32790     test_ret += test_xmlTextReaderMoveToNextAttribute();
32791     test_ret += test_xmlTextReaderName();
32792     test_ret += test_xmlTextReaderNamespaceUri();
32793     test_ret += test_xmlTextReaderNext();
32794     test_ret += test_xmlTextReaderNextSibling();
32795     test_ret += test_xmlTextReaderNodeType();
32796     test_ret += test_xmlTextReaderNormalization();
32797     test_ret += test_xmlTextReaderPrefix();
32798     test_ret += test_xmlTextReaderPreserve();
32799     test_ret += test_xmlTextReaderPreservePattern();
32800     test_ret += test_xmlTextReaderQuoteChar();
32801     test_ret += test_xmlTextReaderRead();
32802     test_ret += test_xmlTextReaderReadAttributeValue();
32803     test_ret += test_xmlTextReaderReadState();
32804     test_ret += test_xmlTextReaderRelaxNGSetSchema();
32805     test_ret += test_xmlTextReaderRelaxNGValidate();
32806     test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
32807     test_ret += test_xmlTextReaderSchemaValidate();
32808     test_ret += test_xmlTextReaderSchemaValidateCtxt();
32809     test_ret += test_xmlTextReaderSetErrorHandler();
32810     test_ret += test_xmlTextReaderSetParserProp();
32811     test_ret += test_xmlTextReaderSetSchema();
32812     test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32813     test_ret += test_xmlTextReaderSetup();
32814     test_ret += test_xmlTextReaderStandalone();
32815     test_ret += test_xmlTextReaderValue();
32816     test_ret += test_xmlTextReaderXmlLang();
32817
32818     if (test_ret != 0)
32819         printf("Module xmlreader: %d errors\n", test_ret);
32820     return(test_ret);
32821 }
32822
32823 static int
32824 test_xmlExpCtxtNbCons(void) {
32825     int test_ret = 0;
32826
32827 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32828     int mem_base;
32829     int ret_val;
32830     xmlExpCtxtPtr ctxt; /* an expression context */
32831     int n_ctxt;
32832
32833     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32834         mem_base = xmlMemBlocks();
32835         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32836
32837         ret_val = xmlExpCtxtNbCons(ctxt);
32838         desret_int(ret_val);
32839         call_tests++;
32840         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32841         xmlResetLastError();
32842         if (mem_base != xmlMemBlocks()) {
32843             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32844                    xmlMemBlocks() - mem_base);
32845             test_ret++;
32846             printf(" %d", n_ctxt);
32847             printf("\n");
32848         }
32849     }
32850     function_tests++;
32851 #endif
32852
32853     return(test_ret);
32854 }
32855
32856
32857 static int
32858 test_xmlExpCtxtNbNodes(void) {
32859     int test_ret = 0;
32860
32861 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32862     int mem_base;
32863     int ret_val;
32864     xmlExpCtxtPtr ctxt; /* an expression context */
32865     int n_ctxt;
32866
32867     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32868         mem_base = xmlMemBlocks();
32869         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32870
32871         ret_val = xmlExpCtxtNbNodes(ctxt);
32872         desret_int(ret_val);
32873         call_tests++;
32874         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32875         xmlResetLastError();
32876         if (mem_base != xmlMemBlocks()) {
32877             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32878                    xmlMemBlocks() - mem_base);
32879             test_ret++;
32880             printf(" %d", n_ctxt);
32881             printf("\n");
32882         }
32883     }
32884     function_tests++;
32885 #endif
32886
32887     return(test_ret);
32888 }
32889
32890
32891 static int
32892 test_xmlExpDump(void) {
32893     int test_ret = 0;
32894
32895 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32896     int mem_base;
32897     xmlBufferPtr buf; /* a buffer to receive the output */
32898     int n_buf;
32899     xmlExpNodePtr expr; /* the compiled expression */
32900     int n_expr;
32901
32902     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32903     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32904         mem_base = xmlMemBlocks();
32905         buf = gen_xmlBufferPtr(n_buf, 0);
32906         expr = gen_xmlExpNodePtr(n_expr, 1);
32907
32908         xmlExpDump(buf, expr);
32909         call_tests++;
32910         des_xmlBufferPtr(n_buf, buf, 0);
32911         des_xmlExpNodePtr(n_expr, expr, 1);
32912         xmlResetLastError();
32913         if (mem_base != xmlMemBlocks()) {
32914             printf("Leak of %d blocks found in xmlExpDump",
32915                    xmlMemBlocks() - mem_base);
32916             test_ret++;
32917             printf(" %d", n_buf);
32918             printf(" %d", n_expr);
32919             printf("\n");
32920         }
32921     }
32922     }
32923     function_tests++;
32924 #endif
32925
32926     return(test_ret);
32927 }
32928
32929
32930 static int
32931 test_xmlExpExpDerive(void) {
32932     int test_ret = 0;
32933
32934
32935     /* missing type support */
32936     return(test_ret);
32937 }
32938
32939
32940 static int
32941 test_xmlExpGetLanguage(void) {
32942     int test_ret = 0;
32943
32944 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32945     int mem_base;
32946     int ret_val;
32947     xmlExpCtxtPtr ctxt; /* the expression context */
32948     int n_ctxt;
32949     xmlExpNodePtr exp; /* the expression */
32950     int n_exp;
32951     xmlChar ** langList; /* where to store the tokens */
32952     int n_langList;
32953     int len; /* the allocated lenght of @list */
32954     int n_len;
32955
32956     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32957     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32958     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32959     for (n_len = 0;n_len < gen_nb_int;n_len++) {
32960         mem_base = xmlMemBlocks();
32961         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32962         exp = gen_xmlExpNodePtr(n_exp, 1);
32963         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32964         len = gen_int(n_len, 3);
32965
32966         ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32967         desret_int(ret_val);
32968         call_tests++;
32969         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32970         des_xmlExpNodePtr(n_exp, exp, 1);
32971         des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32972         des_int(n_len, len, 3);
32973         xmlResetLastError();
32974         if (mem_base != xmlMemBlocks()) {
32975             printf("Leak of %d blocks found in xmlExpGetLanguage",
32976                    xmlMemBlocks() - mem_base);
32977             test_ret++;
32978             printf(" %d", n_ctxt);
32979             printf(" %d", n_exp);
32980             printf(" %d", n_langList);
32981             printf(" %d", n_len);
32982             printf("\n");
32983         }
32984     }
32985     }
32986     }
32987     }
32988     function_tests++;
32989 #endif
32990
32991     return(test_ret);
32992 }
32993
32994
32995 static int
32996 test_xmlExpGetStart(void) {
32997     int test_ret = 0;
32998
32999 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33000     int mem_base;
33001     int ret_val;
33002     xmlExpCtxtPtr ctxt; /* the expression context */
33003     int n_ctxt;
33004     xmlExpNodePtr exp; /* the expression */
33005     int n_exp;
33006     xmlChar ** tokList; /* where to store the tokens */
33007     int n_tokList;
33008     int len; /* the allocated lenght of @list */
33009     int n_len;
33010
33011     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33012     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33013     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
33014     for (n_len = 0;n_len < gen_nb_int;n_len++) {
33015         mem_base = xmlMemBlocks();
33016         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33017         exp = gen_xmlExpNodePtr(n_exp, 1);
33018         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
33019         len = gen_int(n_len, 3);
33020
33021         ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
33022         desret_int(ret_val);
33023         call_tests++;
33024         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33025         des_xmlExpNodePtr(n_exp, exp, 1);
33026         des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
33027         des_int(n_len, len, 3);
33028         xmlResetLastError();
33029         if (mem_base != xmlMemBlocks()) {
33030             printf("Leak of %d blocks found in xmlExpGetStart",
33031                    xmlMemBlocks() - mem_base);
33032             test_ret++;
33033             printf(" %d", n_ctxt);
33034             printf(" %d", n_exp);
33035             printf(" %d", n_tokList);
33036             printf(" %d", n_len);
33037             printf("\n");
33038         }
33039     }
33040     }
33041     }
33042     }
33043     function_tests++;
33044 #endif
33045
33046     return(test_ret);
33047 }
33048
33049
33050 static int
33051 test_xmlExpIsNillable(void) {
33052     int test_ret = 0;
33053
33054 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33055     int mem_base;
33056     int ret_val;
33057     xmlExpNodePtr exp; /* the expression */
33058     int n_exp;
33059
33060     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33061         mem_base = xmlMemBlocks();
33062         exp = gen_xmlExpNodePtr(n_exp, 0);
33063
33064         ret_val = xmlExpIsNillable(exp);
33065         desret_int(ret_val);
33066         call_tests++;
33067         des_xmlExpNodePtr(n_exp, exp, 0);
33068         xmlResetLastError();
33069         if (mem_base != xmlMemBlocks()) {
33070             printf("Leak of %d blocks found in xmlExpIsNillable",
33071                    xmlMemBlocks() - mem_base);
33072             test_ret++;
33073             printf(" %d", n_exp);
33074             printf("\n");
33075         }
33076     }
33077     function_tests++;
33078 #endif
33079
33080     return(test_ret);
33081 }
33082
33083
33084 static int
33085 test_xmlExpMaxToken(void) {
33086     int test_ret = 0;
33087
33088 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33089     int mem_base;
33090     int ret_val;
33091     xmlExpNodePtr expr; /* a compiled expression */
33092     int n_expr;
33093
33094     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33095         mem_base = xmlMemBlocks();
33096         expr = gen_xmlExpNodePtr(n_expr, 0);
33097
33098         ret_val = xmlExpMaxToken(expr);
33099         desret_int(ret_val);
33100         call_tests++;
33101         des_xmlExpNodePtr(n_expr, expr, 0);
33102         xmlResetLastError();
33103         if (mem_base != xmlMemBlocks()) {
33104             printf("Leak of %d blocks found in xmlExpMaxToken",
33105                    xmlMemBlocks() - mem_base);
33106             test_ret++;
33107             printf(" %d", n_expr);
33108             printf("\n");
33109         }
33110     }
33111     function_tests++;
33112 #endif
33113
33114     return(test_ret);
33115 }
33116
33117
33118 static int
33119 test_xmlExpNewAtom(void) {
33120     int test_ret = 0;
33121
33122
33123     /* missing type support */
33124     return(test_ret);
33125 }
33126
33127
33128 static int
33129 test_xmlExpNewCtxt(void) {
33130     int test_ret = 0;
33131
33132
33133     /* missing type support */
33134     return(test_ret);
33135 }
33136
33137
33138 static int
33139 test_xmlExpNewOr(void) {
33140     int test_ret = 0;
33141
33142
33143     /* missing type support */
33144     return(test_ret);
33145 }
33146
33147
33148 static int
33149 test_xmlExpNewRange(void) {
33150     int test_ret = 0;
33151
33152
33153     /* missing type support */
33154     return(test_ret);
33155 }
33156
33157
33158 static int
33159 test_xmlExpNewSeq(void) {
33160     int test_ret = 0;
33161
33162
33163     /* missing type support */
33164     return(test_ret);
33165 }
33166
33167
33168 static int
33169 test_xmlExpParse(void) {
33170     int test_ret = 0;
33171
33172
33173     /* missing type support */
33174     return(test_ret);
33175 }
33176
33177
33178 static int
33179 test_xmlExpRef(void) {
33180     int test_ret = 0;
33181
33182 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33183     int mem_base;
33184     xmlExpNodePtr exp; /* the expression */
33185     int n_exp;
33186
33187     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33188         mem_base = xmlMemBlocks();
33189         exp = gen_xmlExpNodePtr(n_exp, 0);
33190
33191         xmlExpRef(exp);
33192         call_tests++;
33193         des_xmlExpNodePtr(n_exp, exp, 0);
33194         xmlResetLastError();
33195         if (mem_base != xmlMemBlocks()) {
33196             printf("Leak of %d blocks found in xmlExpRef",
33197                    xmlMemBlocks() - mem_base);
33198             test_ret++;
33199             printf(" %d", n_exp);
33200             printf("\n");
33201         }
33202     }
33203     function_tests++;
33204 #endif
33205
33206     return(test_ret);
33207 }
33208
33209
33210 static int
33211 test_xmlExpStringDerive(void) {
33212     int test_ret = 0;
33213
33214
33215     /* missing type support */
33216     return(test_ret);
33217 }
33218
33219
33220 static int
33221 test_xmlExpSubsume(void) {
33222     int test_ret = 0;
33223
33224 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33225     int mem_base;
33226     int ret_val;
33227     xmlExpCtxtPtr ctxt; /* the expressions context */
33228     int n_ctxt;
33229     xmlExpNodePtr exp; /* the englobing expression */
33230     int n_exp;
33231     xmlExpNodePtr sub; /* the subexpression */
33232     int n_sub;
33233
33234     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33235     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33236     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33237         mem_base = xmlMemBlocks();
33238         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33239         exp = gen_xmlExpNodePtr(n_exp, 1);
33240         sub = gen_xmlExpNodePtr(n_sub, 2);
33241
33242         ret_val = xmlExpSubsume(ctxt, exp, sub);
33243         desret_int(ret_val);
33244         call_tests++;
33245         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33246         des_xmlExpNodePtr(n_exp, exp, 1);
33247         des_xmlExpNodePtr(n_sub, sub, 2);
33248         xmlResetLastError();
33249         if (mem_base != xmlMemBlocks()) {
33250             printf("Leak of %d blocks found in xmlExpSubsume",
33251                    xmlMemBlocks() - mem_base);
33252             test_ret++;
33253             printf(" %d", n_ctxt);
33254             printf(" %d", n_exp);
33255             printf(" %d", n_sub);
33256             printf("\n");
33257         }
33258     }
33259     }
33260     }
33261     function_tests++;
33262 #endif
33263
33264     return(test_ret);
33265 }
33266
33267 #ifdef LIBXML_REGEXP_ENABLED
33268
33269 #define gen_nb_xmlRegExecCtxtPtr 1
33270 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33271     return(NULL);
33272 }
33273 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33274 }
33275 #endif
33276
33277
33278 static int
33279 test_xmlRegExecErrInfo(void) {
33280     int test_ret = 0;
33281
33282 #if defined(LIBXML_REGEXP_ENABLED)
33283     int mem_base;
33284     int ret_val;
33285     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33286     int n_exec;
33287     xmlChar ** string; /* return value for the error string */
33288     int n_string;
33289     int * nbval; /* pointer to the number of accepted values IN/OUT */
33290     int n_nbval;
33291     int * nbneg; /* return number of negative transitions */
33292     int n_nbneg;
33293     xmlChar ** values; /* pointer to the array of acceptable values */
33294     int n_values;
33295     int * terminal; /* return value if this was a terminal state */
33296     int n_terminal;
33297
33298     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33299     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33300     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33301     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33302     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33303     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33304         mem_base = xmlMemBlocks();
33305         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33306         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33307         nbval = gen_int_ptr(n_nbval, 2);
33308         nbneg = gen_int_ptr(n_nbneg, 3);
33309         values = gen_xmlChar_ptr_ptr(n_values, 4);
33310         terminal = gen_int_ptr(n_terminal, 5);
33311
33312         ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33313         desret_int(ret_val);
33314         call_tests++;
33315         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33316         des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33317         des_int_ptr(n_nbval, nbval, 2);
33318         des_int_ptr(n_nbneg, nbneg, 3);
33319         des_xmlChar_ptr_ptr(n_values, values, 4);
33320         des_int_ptr(n_terminal, terminal, 5);
33321         xmlResetLastError();
33322         if (mem_base != xmlMemBlocks()) {
33323             printf("Leak of %d blocks found in xmlRegExecErrInfo",
33324                    xmlMemBlocks() - mem_base);
33325             test_ret++;
33326             printf(" %d", n_exec);
33327             printf(" %d", n_string);
33328             printf(" %d", n_nbval);
33329             printf(" %d", n_nbneg);
33330             printf(" %d", n_values);
33331             printf(" %d", n_terminal);
33332             printf("\n");
33333         }
33334     }
33335     }
33336     }
33337     }
33338     }
33339     }
33340     function_tests++;
33341 #endif
33342
33343     return(test_ret);
33344 }
33345
33346
33347 static int
33348 test_xmlRegExecNextValues(void) {
33349     int test_ret = 0;
33350
33351 #if defined(LIBXML_REGEXP_ENABLED)
33352     int mem_base;
33353     int ret_val;
33354     xmlRegExecCtxtPtr exec; /* a regexp execution context */
33355     int n_exec;
33356     int * nbval; /* pointer to the number of accepted values IN/OUT */
33357     int n_nbval;
33358     int * nbneg; /* return number of negative transitions */
33359     int n_nbneg;
33360     xmlChar ** values; /* pointer to the array of acceptable values */
33361     int n_values;
33362     int * terminal; /* return value if this was a terminal state */
33363     int n_terminal;
33364
33365     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33366     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33367     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33368     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33369     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33370         mem_base = xmlMemBlocks();
33371         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33372         nbval = gen_int_ptr(n_nbval, 1);
33373         nbneg = gen_int_ptr(n_nbneg, 2);
33374         values = gen_xmlChar_ptr_ptr(n_values, 3);
33375         terminal = gen_int_ptr(n_terminal, 4);
33376
33377         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33378         desret_int(ret_val);
33379         call_tests++;
33380         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33381         des_int_ptr(n_nbval, nbval, 1);
33382         des_int_ptr(n_nbneg, nbneg, 2);
33383         des_xmlChar_ptr_ptr(n_values, values, 3);
33384         des_int_ptr(n_terminal, terminal, 4);
33385         xmlResetLastError();
33386         if (mem_base != xmlMemBlocks()) {
33387             printf("Leak of %d blocks found in xmlRegExecNextValues",
33388                    xmlMemBlocks() - mem_base);
33389             test_ret++;
33390             printf(" %d", n_exec);
33391             printf(" %d", n_nbval);
33392             printf(" %d", n_nbneg);
33393             printf(" %d", n_values);
33394             printf(" %d", n_terminal);
33395             printf("\n");
33396         }
33397     }
33398     }
33399     }
33400     }
33401     }
33402     function_tests++;
33403 #endif
33404
33405     return(test_ret);
33406 }
33407
33408
33409 static int
33410 test_xmlRegExecPushString(void) {
33411     int test_ret = 0;
33412
33413 #if defined(LIBXML_REGEXP_ENABLED)
33414     int mem_base;
33415     int ret_val;
33416     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33417     int n_exec;
33418     xmlChar * value; /* a string token input */
33419     int n_value;
33420     void * data; /* data associated to the token to reuse in callbacks */
33421     int n_data;
33422
33423     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33424     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33425     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33426         mem_base = xmlMemBlocks();
33427         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33428         value = gen_const_xmlChar_ptr(n_value, 1);
33429         data = gen_userdata(n_data, 2);
33430
33431         ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33432         desret_int(ret_val);
33433         call_tests++;
33434         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33435         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33436         des_userdata(n_data, data, 2);
33437         xmlResetLastError();
33438         if (mem_base != xmlMemBlocks()) {
33439             printf("Leak of %d blocks found in xmlRegExecPushString",
33440                    xmlMemBlocks() - mem_base);
33441             test_ret++;
33442             printf(" %d", n_exec);
33443             printf(" %d", n_value);
33444             printf(" %d", n_data);
33445             printf("\n");
33446         }
33447     }
33448     }
33449     }
33450     function_tests++;
33451 #endif
33452
33453     return(test_ret);
33454 }
33455
33456
33457 static int
33458 test_xmlRegExecPushString2(void) {
33459     int test_ret = 0;
33460
33461 #if defined(LIBXML_REGEXP_ENABLED)
33462     int mem_base;
33463     int ret_val;
33464     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33465     int n_exec;
33466     xmlChar * value; /* the first string token input */
33467     int n_value;
33468     xmlChar * value2; /* the second string token input */
33469     int n_value2;
33470     void * data; /* data associated to the token to reuse in callbacks */
33471     int n_data;
33472
33473     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33474     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33475     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33476     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33477         mem_base = xmlMemBlocks();
33478         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33479         value = gen_const_xmlChar_ptr(n_value, 1);
33480         value2 = gen_const_xmlChar_ptr(n_value2, 2);
33481         data = gen_userdata(n_data, 3);
33482
33483         ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33484         desret_int(ret_val);
33485         call_tests++;
33486         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33487         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33488         des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33489         des_userdata(n_data, data, 3);
33490         xmlResetLastError();
33491         if (mem_base != xmlMemBlocks()) {
33492             printf("Leak of %d blocks found in xmlRegExecPushString2",
33493                    xmlMemBlocks() - mem_base);
33494             test_ret++;
33495             printf(" %d", n_exec);
33496             printf(" %d", n_value);
33497             printf(" %d", n_value2);
33498             printf(" %d", n_data);
33499             printf("\n");
33500         }
33501     }
33502     }
33503     }
33504     }
33505     function_tests++;
33506 #endif
33507
33508     return(test_ret);
33509 }
33510
33511 #ifdef LIBXML_REGEXP_ENABLED
33512
33513 #define gen_nb_xmlRegexpPtr 1
33514 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33515     return(NULL);
33516 }
33517 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33518 }
33519 #endif
33520
33521
33522 static int
33523 test_xmlRegNewExecCtxt(void) {
33524     int test_ret = 0;
33525
33526
33527     /* missing type support */
33528     return(test_ret);
33529 }
33530
33531
33532 static int
33533 test_xmlRegexpCompile(void) {
33534     int test_ret = 0;
33535
33536
33537     /* missing type support */
33538     return(test_ret);
33539 }
33540
33541
33542 static int
33543 test_xmlRegexpExec(void) {
33544     int test_ret = 0;
33545
33546 #if defined(LIBXML_REGEXP_ENABLED)
33547     int mem_base;
33548     int ret_val;
33549     xmlRegexpPtr comp; /* the compiled regular expression */
33550     int n_comp;
33551     xmlChar * content; /* the value to check against the regular expression */
33552     int n_content;
33553
33554     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33555     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33556         mem_base = xmlMemBlocks();
33557         comp = gen_xmlRegexpPtr(n_comp, 0);
33558         content = gen_const_xmlChar_ptr(n_content, 1);
33559
33560         ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33561         desret_int(ret_val);
33562         call_tests++;
33563         des_xmlRegexpPtr(n_comp, comp, 0);
33564         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33565         xmlResetLastError();
33566         if (mem_base != xmlMemBlocks()) {
33567             printf("Leak of %d blocks found in xmlRegexpExec",
33568                    xmlMemBlocks() - mem_base);
33569             test_ret++;
33570             printf(" %d", n_comp);
33571             printf(" %d", n_content);
33572             printf("\n");
33573         }
33574     }
33575     }
33576     function_tests++;
33577 #endif
33578
33579     return(test_ret);
33580 }
33581
33582
33583 static int
33584 test_xmlRegexpIsDeterminist(void) {
33585     int test_ret = 0;
33586
33587 #if defined(LIBXML_REGEXP_ENABLED)
33588     int mem_base;
33589     int ret_val;
33590     xmlRegexpPtr comp; /* the compiled regular expression */
33591     int n_comp;
33592
33593     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33594         mem_base = xmlMemBlocks();
33595         comp = gen_xmlRegexpPtr(n_comp, 0);
33596
33597         ret_val = xmlRegexpIsDeterminist(comp);
33598         desret_int(ret_val);
33599         call_tests++;
33600         des_xmlRegexpPtr(n_comp, comp, 0);
33601         xmlResetLastError();
33602         if (mem_base != xmlMemBlocks()) {
33603             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33604                    xmlMemBlocks() - mem_base);
33605             test_ret++;
33606             printf(" %d", n_comp);
33607             printf("\n");
33608         }
33609     }
33610     function_tests++;
33611 #endif
33612
33613     return(test_ret);
33614 }
33615
33616
33617 static int
33618 test_xmlRegexpPrint(void) {
33619     int test_ret = 0;
33620
33621 #if defined(LIBXML_REGEXP_ENABLED)
33622     int mem_base;
33623     FILE * output; /* the file for the output debug */
33624     int n_output;
33625     xmlRegexpPtr regexp; /* the compiled regexp */
33626     int n_regexp;
33627
33628     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33629     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33630         mem_base = xmlMemBlocks();
33631         output = gen_FILE_ptr(n_output, 0);
33632         regexp = gen_xmlRegexpPtr(n_regexp, 1);
33633
33634         xmlRegexpPrint(output, regexp);
33635         call_tests++;
33636         des_FILE_ptr(n_output, output, 0);
33637         des_xmlRegexpPtr(n_regexp, regexp, 1);
33638         xmlResetLastError();
33639         if (mem_base != xmlMemBlocks()) {
33640             printf("Leak of %d blocks found in xmlRegexpPrint",
33641                    xmlMemBlocks() - mem_base);
33642             test_ret++;
33643             printf(" %d", n_output);
33644             printf(" %d", n_regexp);
33645             printf("\n");
33646         }
33647     }
33648     }
33649     function_tests++;
33650 #endif
33651
33652     return(test_ret);
33653 }
33654
33655 static int
33656 test_xmlregexp(void) {
33657     int test_ret = 0;
33658
33659     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33660     test_ret += test_xmlExpCtxtNbCons();
33661     test_ret += test_xmlExpCtxtNbNodes();
33662     test_ret += test_xmlExpDump();
33663     test_ret += test_xmlExpExpDerive();
33664     test_ret += test_xmlExpGetLanguage();
33665     test_ret += test_xmlExpGetStart();
33666     test_ret += test_xmlExpIsNillable();
33667     test_ret += test_xmlExpMaxToken();
33668     test_ret += test_xmlExpNewAtom();
33669     test_ret += test_xmlExpNewCtxt();
33670     test_ret += test_xmlExpNewOr();
33671     test_ret += test_xmlExpNewRange();
33672     test_ret += test_xmlExpNewSeq();
33673     test_ret += test_xmlExpParse();
33674     test_ret += test_xmlExpRef();
33675     test_ret += test_xmlExpStringDerive();
33676     test_ret += test_xmlExpSubsume();
33677     test_ret += test_xmlRegExecErrInfo();
33678     test_ret += test_xmlRegExecNextValues();
33679     test_ret += test_xmlRegExecPushString();
33680     test_ret += test_xmlRegExecPushString2();
33681     test_ret += test_xmlRegNewExecCtxt();
33682     test_ret += test_xmlRegexpCompile();
33683     test_ret += test_xmlRegexpExec();
33684     test_ret += test_xmlRegexpIsDeterminist();
33685     test_ret += test_xmlRegexpPrint();
33686
33687     if (test_ret != 0)
33688         printf("Module xmlregexp: %d errors\n", test_ret);
33689     return(test_ret);
33690 }
33691 #ifdef LIBXML_OUTPUT_ENABLED
33692
33693 #define gen_nb_xmlSaveCtxtPtr 1
33694 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33695     return(NULL);
33696 }
33697 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33698 }
33699 #endif
33700
33701
33702 static int
33703 test_xmlSaveClose(void) {
33704     int test_ret = 0;
33705
33706 #if defined(LIBXML_OUTPUT_ENABLED)
33707     int mem_base;
33708     int ret_val;
33709     xmlSaveCtxtPtr ctxt; /* a document saving context */
33710     int n_ctxt;
33711
33712     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33713         mem_base = xmlMemBlocks();
33714         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33715
33716         ret_val = xmlSaveClose(ctxt);
33717         desret_int(ret_val);
33718         call_tests++;
33719         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33720         xmlResetLastError();
33721         if (mem_base != xmlMemBlocks()) {
33722             printf("Leak of %d blocks found in xmlSaveClose",
33723                    xmlMemBlocks() - mem_base);
33724             test_ret++;
33725             printf(" %d", n_ctxt);
33726             printf("\n");
33727         }
33728     }
33729     function_tests++;
33730 #endif
33731
33732     return(test_ret);
33733 }
33734
33735
33736 static int
33737 test_xmlSaveDoc(void) {
33738     int test_ret = 0;
33739
33740 #if defined(LIBXML_OUTPUT_ENABLED)
33741     int mem_base;
33742     long ret_val;
33743     xmlSaveCtxtPtr ctxt; /* a document saving context */
33744     int n_ctxt;
33745     xmlDocPtr doc; /* a document */
33746     int n_doc;
33747
33748     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33749     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33750         mem_base = xmlMemBlocks();
33751         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33752         doc = gen_xmlDocPtr(n_doc, 1);
33753
33754         ret_val = xmlSaveDoc(ctxt, doc);
33755         desret_long(ret_val);
33756         call_tests++;
33757         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33758         des_xmlDocPtr(n_doc, doc, 1);
33759         xmlResetLastError();
33760         if (mem_base != xmlMemBlocks()) {
33761             printf("Leak of %d blocks found in xmlSaveDoc",
33762                    xmlMemBlocks() - mem_base);
33763             test_ret++;
33764             printf(" %d", n_ctxt);
33765             printf(" %d", n_doc);
33766             printf("\n");
33767         }
33768     }
33769     }
33770     function_tests++;
33771 #endif
33772
33773     return(test_ret);
33774 }
33775
33776
33777 static int
33778 test_xmlSaveFlush(void) {
33779     int test_ret = 0;
33780
33781 #if defined(LIBXML_OUTPUT_ENABLED)
33782     int mem_base;
33783     int ret_val;
33784     xmlSaveCtxtPtr ctxt; /* a document saving context */
33785     int n_ctxt;
33786
33787     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33788         mem_base = xmlMemBlocks();
33789         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33790
33791         ret_val = xmlSaveFlush(ctxt);
33792         desret_int(ret_val);
33793         call_tests++;
33794         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33795         xmlResetLastError();
33796         if (mem_base != xmlMemBlocks()) {
33797             printf("Leak of %d blocks found in xmlSaveFlush",
33798                    xmlMemBlocks() - mem_base);
33799             test_ret++;
33800             printf(" %d", n_ctxt);
33801             printf("\n");
33802         }
33803     }
33804     function_tests++;
33805 #endif
33806
33807     return(test_ret);
33808 }
33809
33810
33811 static int
33812 test_xmlSaveSetAttrEscape(void) {
33813     int test_ret = 0;
33814
33815
33816     /* missing type support */
33817     return(test_ret);
33818 }
33819
33820
33821 static int
33822 test_xmlSaveSetEscape(void) {
33823     int test_ret = 0;
33824
33825
33826     /* missing type support */
33827     return(test_ret);
33828 }
33829
33830
33831 static int
33832 test_xmlSaveToBuffer(void) {
33833     int test_ret = 0;
33834
33835
33836     /* missing type support */
33837     return(test_ret);
33838 }
33839
33840
33841 static int
33842 test_xmlSaveToFd(void) {
33843     int test_ret = 0;
33844
33845
33846     /* missing type support */
33847     return(test_ret);
33848 }
33849
33850
33851 static int
33852 test_xmlSaveToFilename(void) {
33853     int test_ret = 0;
33854
33855
33856     /* missing type support */
33857     return(test_ret);
33858 }
33859
33860
33861 static int
33862 test_xmlSaveTree(void) {
33863     int test_ret = 0;
33864
33865 #if defined(LIBXML_OUTPUT_ENABLED)
33866     int mem_base;
33867     long ret_val;
33868     xmlSaveCtxtPtr ctxt; /* a document saving context */
33869     int n_ctxt;
33870     xmlNodePtr node; /* the top node of the subtree to save */
33871     int n_node;
33872
33873     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33874     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33875         mem_base = xmlMemBlocks();
33876         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33877         node = gen_xmlNodePtr(n_node, 1);
33878
33879         ret_val = xmlSaveTree(ctxt, node);
33880         desret_long(ret_val);
33881         call_tests++;
33882         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33883         des_xmlNodePtr(n_node, node, 1);
33884         xmlResetLastError();
33885         if (mem_base != xmlMemBlocks()) {
33886             printf("Leak of %d blocks found in xmlSaveTree",
33887                    xmlMemBlocks() - mem_base);
33888             test_ret++;
33889             printf(" %d", n_ctxt);
33890             printf(" %d", n_node);
33891             printf("\n");
33892         }
33893     }
33894     }
33895     function_tests++;
33896 #endif
33897
33898     return(test_ret);
33899 }
33900
33901 static int
33902 test_xmlsave(void) {
33903     int test_ret = 0;
33904
33905     if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33906     test_ret += test_xmlSaveClose();
33907     test_ret += test_xmlSaveDoc();
33908     test_ret += test_xmlSaveFlush();
33909     test_ret += test_xmlSaveSetAttrEscape();
33910     test_ret += test_xmlSaveSetEscape();
33911     test_ret += test_xmlSaveToBuffer();
33912     test_ret += test_xmlSaveToFd();
33913     test_ret += test_xmlSaveToFilename();
33914     test_ret += test_xmlSaveTree();
33915
33916     if (test_ret != 0)
33917         printf("Module xmlsave: %d errors\n", test_ret);
33918     return(test_ret);
33919 }
33920
33921 static int
33922 test_xmlSchemaDump(void) {
33923     int test_ret = 0;
33924
33925 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33926     int mem_base;
33927     FILE * output; /* the file output */
33928     int n_output;
33929     xmlSchemaPtr schema; /* a schema structure */
33930     int n_schema;
33931
33932     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33933     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33934         mem_base = xmlMemBlocks();
33935         output = gen_FILE_ptr(n_output, 0);
33936         schema = gen_xmlSchemaPtr(n_schema, 1);
33937
33938         xmlSchemaDump(output, schema);
33939         call_tests++;
33940         des_FILE_ptr(n_output, output, 0);
33941         des_xmlSchemaPtr(n_schema, schema, 1);
33942         xmlResetLastError();
33943         if (mem_base != xmlMemBlocks()) {
33944             printf("Leak of %d blocks found in xmlSchemaDump",
33945                    xmlMemBlocks() - mem_base);
33946             test_ret++;
33947             printf(" %d", n_output);
33948             printf(" %d", n_schema);
33949             printf("\n");
33950         }
33951     }
33952     }
33953     function_tests++;
33954 #endif
33955
33956     return(test_ret);
33957 }
33958
33959 #ifdef LIBXML_SCHEMAS_ENABLED
33960
33961 #define gen_nb_xmlSchemaParserCtxtPtr 1
33962 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33963     return(NULL);
33964 }
33965 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33966 }
33967 #endif
33968
33969 #ifdef LIBXML_SCHEMAS_ENABLED
33970
33971 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33972 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33973     return(NULL);
33974 }
33975 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33976 }
33977 #endif
33978
33979 #ifdef LIBXML_SCHEMAS_ENABLED
33980
33981 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33982 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33983     return(NULL);
33984 }
33985 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33986 }
33987 #endif
33988
33989
33990 static int
33991 test_xmlSchemaGetParserErrors(void) {
33992     int test_ret = 0;
33993
33994 #if defined(LIBXML_SCHEMAS_ENABLED)
33995     int mem_base;
33996     int ret_val;
33997     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33998     int n_ctxt;
33999     xmlSchemaValidityErrorFunc * err; /* the error callback result */
34000     int n_err;
34001     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
34002     int n_warn;
34003     void ** ctx; /* contextual data for the callbacks result */
34004     int n_ctx;
34005
34006     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34007     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34008     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34009     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34010         mem_base = xmlMemBlocks();
34011         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34012         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34013         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34014         ctx = gen_void_ptr_ptr(n_ctx, 3);
34015
34016         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34017         desret_int(ret_val);
34018         call_tests++;
34019         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34020         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34021         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34022         des_void_ptr_ptr(n_ctx, ctx, 3);
34023         xmlResetLastError();
34024         if (mem_base != xmlMemBlocks()) {
34025             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34026                    xmlMemBlocks() - mem_base);
34027             test_ret++;
34028             printf(" %d", n_ctxt);
34029             printf(" %d", n_err);
34030             printf(" %d", n_warn);
34031             printf(" %d", n_ctx);
34032             printf("\n");
34033         }
34034     }
34035     }
34036     }
34037     }
34038     function_tests++;
34039 #endif
34040
34041     return(test_ret);
34042 }
34043
34044
34045 static int
34046 test_xmlSchemaGetValidErrors(void) {
34047     int test_ret = 0;
34048
34049 #if defined(LIBXML_SCHEMAS_ENABLED)
34050     int mem_base;
34051     int ret_val;
34052     xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34053     int n_ctxt;
34054     xmlSchemaValidityErrorFunc * err; /* the error function result */
34055     int n_err;
34056     xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34057     int n_warn;
34058     void ** ctx; /* the functions context result */
34059     int n_ctx;
34060
34061     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34062     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34063     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34064     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34065         mem_base = xmlMemBlocks();
34066         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34067         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34068         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34069         ctx = gen_void_ptr_ptr(n_ctx, 3);
34070
34071         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34072         desret_int(ret_val);
34073         call_tests++;
34074         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34075         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34076         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34077         des_void_ptr_ptr(n_ctx, ctx, 3);
34078         xmlResetLastError();
34079         if (mem_base != xmlMemBlocks()) {
34080             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34081                    xmlMemBlocks() - mem_base);
34082             test_ret++;
34083             printf(" %d", n_ctxt);
34084             printf(" %d", n_err);
34085             printf(" %d", n_warn);
34086             printf(" %d", n_ctx);
34087             printf("\n");
34088         }
34089     }
34090     }
34091     }
34092     }
34093     function_tests++;
34094 #endif
34095
34096     return(test_ret);
34097 }
34098
34099
34100 static int
34101 test_xmlSchemaIsValid(void) {
34102     int test_ret = 0;
34103
34104 #if defined(LIBXML_SCHEMAS_ENABLED)
34105     int mem_base;
34106     int ret_val;
34107     xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34108     int n_ctxt;
34109
34110     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34111         mem_base = xmlMemBlocks();
34112         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34113
34114         ret_val = xmlSchemaIsValid(ctxt);
34115         desret_int(ret_val);
34116         call_tests++;
34117         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34118         xmlResetLastError();
34119         if (mem_base != xmlMemBlocks()) {
34120             printf("Leak of %d blocks found in xmlSchemaIsValid",
34121                    xmlMemBlocks() - mem_base);
34122             test_ret++;
34123             printf(" %d", n_ctxt);
34124             printf("\n");
34125         }
34126     }
34127     function_tests++;
34128 #endif
34129
34130     return(test_ret);
34131 }
34132
34133
34134 static int
34135 test_xmlSchemaNewDocParserCtxt(void) {
34136     int test_ret = 0;
34137
34138 #if defined(LIBXML_SCHEMAS_ENABLED)
34139     int mem_base;
34140     xmlSchemaParserCtxtPtr ret_val;
34141     xmlDocPtr doc; /* a preparsed document tree */
34142     int n_doc;
34143
34144     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34145         mem_base = xmlMemBlocks();
34146         doc = gen_xmlDocPtr(n_doc, 0);
34147
34148         ret_val = xmlSchemaNewDocParserCtxt(doc);
34149         desret_xmlSchemaParserCtxtPtr(ret_val);
34150         call_tests++;
34151         des_xmlDocPtr(n_doc, doc, 0);
34152         xmlResetLastError();
34153         if (mem_base != xmlMemBlocks()) {
34154             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34155                    xmlMemBlocks() - mem_base);
34156             test_ret++;
34157             printf(" %d", n_doc);
34158             printf("\n");
34159         }
34160     }
34161     function_tests++;
34162 #endif
34163
34164     return(test_ret);
34165 }
34166
34167
34168 static int
34169 test_xmlSchemaNewMemParserCtxt(void) {
34170     int test_ret = 0;
34171
34172 #if defined(LIBXML_SCHEMAS_ENABLED)
34173     int mem_base;
34174     xmlSchemaParserCtxtPtr ret_val;
34175     char * buffer; /* a pointer to a char array containing the schemas */
34176     int n_buffer;
34177     int size; /* the size of the array */
34178     int n_size;
34179
34180     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34181     for (n_size = 0;n_size < gen_nb_int;n_size++) {
34182         mem_base = xmlMemBlocks();
34183         buffer = gen_const_char_ptr(n_buffer, 0);
34184         size = gen_int(n_size, 1);
34185
34186         ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34187         desret_xmlSchemaParserCtxtPtr(ret_val);
34188         call_tests++;
34189         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34190         des_int(n_size, size, 1);
34191         xmlResetLastError();
34192         if (mem_base != xmlMemBlocks()) {
34193             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34194                    xmlMemBlocks() - mem_base);
34195             test_ret++;
34196             printf(" %d", n_buffer);
34197             printf(" %d", n_size);
34198             printf("\n");
34199         }
34200     }
34201     }
34202     function_tests++;
34203 #endif
34204
34205     return(test_ret);
34206 }
34207
34208
34209 static int
34210 test_xmlSchemaNewParserCtxt(void) {
34211     int test_ret = 0;
34212
34213 #if defined(LIBXML_SCHEMAS_ENABLED)
34214     int mem_base;
34215     xmlSchemaParserCtxtPtr ret_val;
34216     char * URL; /* the location of the schema */
34217     int n_URL;
34218
34219     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34220         mem_base = xmlMemBlocks();
34221         URL = gen_const_char_ptr(n_URL, 0);
34222
34223         ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34224         desret_xmlSchemaParserCtxtPtr(ret_val);
34225         call_tests++;
34226         des_const_char_ptr(n_URL, (const char *)URL, 0);
34227         xmlResetLastError();
34228         if (mem_base != xmlMemBlocks()) {
34229             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34230                    xmlMemBlocks() - mem_base);
34231             test_ret++;
34232             printf(" %d", n_URL);
34233             printf("\n");
34234         }
34235     }
34236     function_tests++;
34237 #endif
34238
34239     return(test_ret);
34240 }
34241
34242
34243 static int
34244 test_xmlSchemaNewValidCtxt(void) {
34245     int test_ret = 0;
34246
34247
34248     /* missing type support */
34249     return(test_ret);
34250 }
34251
34252
34253 static int
34254 test_xmlSchemaParse(void) {
34255     int test_ret = 0;
34256
34257
34258     /* missing type support */
34259     return(test_ret);
34260 }
34261
34262 #ifdef LIBXML_SCHEMAS_ENABLED
34263
34264 #define gen_nb_xmlSAXHandlerPtr_ptr 1
34265 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34266     return(NULL);
34267 }
34268 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34269 }
34270 #endif
34271
34272
34273 static int
34274 test_xmlSchemaSAXPlug(void) {
34275     int test_ret = 0;
34276
34277
34278     /* missing type support */
34279     return(test_ret);
34280 }
34281
34282 #ifdef LIBXML_SCHEMAS_ENABLED
34283
34284 #define gen_nb_xmlSchemaSAXPlugPtr 1
34285 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34286     return(NULL);
34287 }
34288 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34289 }
34290 #endif
34291
34292
34293 static int
34294 test_xmlSchemaSAXUnplug(void) {
34295     int test_ret = 0;
34296
34297 #if defined(LIBXML_SCHEMAS_ENABLED)
34298     int mem_base;
34299     int ret_val;
34300     xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34301     int n_plug;
34302
34303     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34304         mem_base = xmlMemBlocks();
34305         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34306
34307         ret_val = xmlSchemaSAXUnplug(plug);
34308         desret_int(ret_val);
34309         call_tests++;
34310         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34311         xmlResetLastError();
34312         if (mem_base != xmlMemBlocks()) {
34313             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34314                    xmlMemBlocks() - mem_base);
34315             test_ret++;
34316             printf(" %d", n_plug);
34317             printf("\n");
34318         }
34319     }
34320     function_tests++;
34321 #endif
34322
34323     return(test_ret);
34324 }
34325
34326
34327 static int
34328 test_xmlSchemaSetParserErrors(void) {
34329     int test_ret = 0;
34330
34331
34332     /* missing type support */
34333     return(test_ret);
34334 }
34335
34336
34337 static int
34338 test_xmlSchemaSetParserStructuredErrors(void) {
34339     int test_ret = 0;
34340
34341
34342     /* missing type support */
34343     return(test_ret);
34344 }
34345
34346
34347 static int
34348 test_xmlSchemaSetValidErrors(void) {
34349     int test_ret = 0;
34350
34351
34352     /* missing type support */
34353     return(test_ret);
34354 }
34355
34356
34357 static int
34358 test_xmlSchemaSetValidOptions(void) {
34359     int test_ret = 0;
34360
34361 #if defined(LIBXML_SCHEMAS_ENABLED)
34362     int mem_base;
34363     int ret_val;
34364     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34365     int n_ctxt;
34366     int options; /* a combination of xmlSchemaValidOption */
34367     int n_options;
34368
34369     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34370     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34371         mem_base = xmlMemBlocks();
34372         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34373         options = gen_int(n_options, 1);
34374
34375         ret_val = xmlSchemaSetValidOptions(ctxt, options);
34376         desret_int(ret_val);
34377         call_tests++;
34378         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34379         des_int(n_options, options, 1);
34380         xmlResetLastError();
34381         if (mem_base != xmlMemBlocks()) {
34382             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34383                    xmlMemBlocks() - mem_base);
34384             test_ret++;
34385             printf(" %d", n_ctxt);
34386             printf(" %d", n_options);
34387             printf("\n");
34388         }
34389     }
34390     }
34391     function_tests++;
34392 #endif
34393
34394     return(test_ret);
34395 }
34396
34397
34398 static int
34399 test_xmlSchemaSetValidStructuredErrors(void) {
34400     int test_ret = 0;
34401
34402
34403     /* missing type support */
34404     return(test_ret);
34405 }
34406
34407
34408 static int
34409 test_xmlSchemaValidCtxtGetOptions(void) {
34410     int test_ret = 0;
34411
34412 #if defined(LIBXML_SCHEMAS_ENABLED)
34413     int mem_base;
34414     int ret_val;
34415     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34416     int n_ctxt;
34417
34418     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34419         mem_base = xmlMemBlocks();
34420         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34421
34422         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34423         desret_int(ret_val);
34424         call_tests++;
34425         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34426         xmlResetLastError();
34427         if (mem_base != xmlMemBlocks()) {
34428             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34429                    xmlMemBlocks() - mem_base);
34430             test_ret++;
34431             printf(" %d", n_ctxt);
34432             printf("\n");
34433         }
34434     }
34435     function_tests++;
34436 #endif
34437
34438     return(test_ret);
34439 }
34440
34441
34442 static int
34443 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34444     int test_ret = 0;
34445
34446 #if defined(LIBXML_SCHEMAS_ENABLED)
34447     int mem_base;
34448     xmlParserCtxtPtr ret_val;
34449     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34450     int n_ctxt;
34451
34452     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34453         mem_base = xmlMemBlocks();
34454         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34455
34456         ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34457         desret_xmlParserCtxtPtr(ret_val);
34458         call_tests++;
34459         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34460         xmlResetLastError();
34461         if (mem_base != xmlMemBlocks()) {
34462             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34463                    xmlMemBlocks() - mem_base);
34464             test_ret++;
34465             printf(" %d", n_ctxt);
34466             printf("\n");
34467         }
34468     }
34469     function_tests++;
34470 #endif
34471
34472     return(test_ret);
34473 }
34474
34475
34476 static int
34477 test_xmlSchemaValidateDoc(void) {
34478     int test_ret = 0;
34479
34480 #if defined(LIBXML_SCHEMAS_ENABLED)
34481     int mem_base;
34482     int ret_val;
34483     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34484     int n_ctxt;
34485     xmlDocPtr doc; /* a parsed document tree */
34486     int n_doc;
34487
34488     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34489     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34490         mem_base = xmlMemBlocks();
34491         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34492         doc = gen_xmlDocPtr(n_doc, 1);
34493
34494         ret_val = xmlSchemaValidateDoc(ctxt, doc);
34495         desret_int(ret_val);
34496         call_tests++;
34497         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34498         des_xmlDocPtr(n_doc, doc, 1);
34499         xmlResetLastError();
34500         if (mem_base != xmlMemBlocks()) {
34501             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34502                    xmlMemBlocks() - mem_base);
34503             test_ret++;
34504             printf(" %d", n_ctxt);
34505             printf(" %d", n_doc);
34506             printf("\n");
34507         }
34508     }
34509     }
34510     function_tests++;
34511 #endif
34512
34513     return(test_ret);
34514 }
34515
34516
34517 static int
34518 test_xmlSchemaValidateFile(void) {
34519     int test_ret = 0;
34520
34521 #if defined(LIBXML_SCHEMAS_ENABLED)
34522     int mem_base;
34523     int ret_val;
34524     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34525     int n_ctxt;
34526     const char * filename; /* the URI of the instance */
34527     int n_filename;
34528     int options; /* a future set of options, currently unused */
34529     int n_options;
34530
34531     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34532     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34533     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34534         mem_base = xmlMemBlocks();
34535         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34536         filename = gen_filepath(n_filename, 1);
34537         options = gen_int(n_options, 2);
34538
34539         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34540         desret_int(ret_val);
34541         call_tests++;
34542         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34543         des_filepath(n_filename, filename, 1);
34544         des_int(n_options, options, 2);
34545         xmlResetLastError();
34546         if (mem_base != xmlMemBlocks()) {
34547             printf("Leak of %d blocks found in xmlSchemaValidateFile",
34548                    xmlMemBlocks() - mem_base);
34549             test_ret++;
34550             printf(" %d", n_ctxt);
34551             printf(" %d", n_filename);
34552             printf(" %d", n_options);
34553             printf("\n");
34554         }
34555     }
34556     }
34557     }
34558     function_tests++;
34559 #endif
34560
34561     return(test_ret);
34562 }
34563
34564
34565 static int
34566 test_xmlSchemaValidateOneElement(void) {
34567     int test_ret = 0;
34568
34569 #if defined(LIBXML_SCHEMAS_ENABLED)
34570     int mem_base;
34571     int ret_val;
34572     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34573     int n_ctxt;
34574     xmlNodePtr elem; /* an element node */
34575     int n_elem;
34576
34577     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34578     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34579         mem_base = xmlMemBlocks();
34580         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34581         elem = gen_xmlNodePtr(n_elem, 1);
34582
34583         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34584         desret_int(ret_val);
34585         call_tests++;
34586         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34587         des_xmlNodePtr(n_elem, elem, 1);
34588         xmlResetLastError();
34589         if (mem_base != xmlMemBlocks()) {
34590             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34591                    xmlMemBlocks() - mem_base);
34592             test_ret++;
34593             printf(" %d", n_ctxt);
34594             printf(" %d", n_elem);
34595             printf("\n");
34596         }
34597     }
34598     }
34599     function_tests++;
34600 #endif
34601
34602     return(test_ret);
34603 }
34604
34605
34606 static int
34607 test_xmlSchemaValidateStream(void) {
34608     int test_ret = 0;
34609
34610 #if defined(LIBXML_SCHEMAS_ENABLED)
34611     int mem_base;
34612     int ret_val;
34613     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34614     int n_ctxt;
34615     xmlParserInputBufferPtr input; /* the input to use for reading the data */
34616     int n_input;
34617     xmlCharEncoding enc; /* an optional encoding information */
34618     int n_enc;
34619     xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34620     int n_sax;
34621     void * user_data; /* the context to provide to the SAX handler. */
34622     int n_user_data;
34623
34624     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34625     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34626     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34627     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34628     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34629         mem_base = xmlMemBlocks();
34630         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34631         input = gen_xmlParserInputBufferPtr(n_input, 1);
34632         enc = gen_xmlCharEncoding(n_enc, 2);
34633         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34634         user_data = gen_userdata(n_user_data, 4);
34635
34636         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34637         desret_int(ret_val);
34638         call_tests++;
34639         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34640         des_xmlParserInputBufferPtr(n_input, input, 1);
34641         des_xmlCharEncoding(n_enc, enc, 2);
34642         des_xmlSAXHandlerPtr(n_sax, sax, 3);
34643         des_userdata(n_user_data, user_data, 4);
34644         xmlResetLastError();
34645         if (mem_base != xmlMemBlocks()) {
34646             printf("Leak of %d blocks found in xmlSchemaValidateStream",
34647                    xmlMemBlocks() - mem_base);
34648             test_ret++;
34649             printf(" %d", n_ctxt);
34650             printf(" %d", n_input);
34651             printf(" %d", n_enc);
34652             printf(" %d", n_sax);
34653             printf(" %d", n_user_data);
34654             printf("\n");
34655         }
34656     }
34657     }
34658     }
34659     }
34660     }
34661     function_tests++;
34662 #endif
34663
34664     return(test_ret);
34665 }
34666
34667 static int
34668 test_xmlschemas(void) {
34669     int test_ret = 0;
34670
34671     if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34672     test_ret += test_xmlSchemaDump();
34673     test_ret += test_xmlSchemaGetParserErrors();
34674     test_ret += test_xmlSchemaGetValidErrors();
34675     test_ret += test_xmlSchemaIsValid();
34676     test_ret += test_xmlSchemaNewDocParserCtxt();
34677     test_ret += test_xmlSchemaNewMemParserCtxt();
34678     test_ret += test_xmlSchemaNewParserCtxt();
34679     test_ret += test_xmlSchemaNewValidCtxt();
34680     test_ret += test_xmlSchemaParse();
34681     test_ret += test_xmlSchemaSAXPlug();
34682     test_ret += test_xmlSchemaSAXUnplug();
34683     test_ret += test_xmlSchemaSetParserErrors();
34684     test_ret += test_xmlSchemaSetParserStructuredErrors();
34685     test_ret += test_xmlSchemaSetValidErrors();
34686     test_ret += test_xmlSchemaSetValidOptions();
34687     test_ret += test_xmlSchemaSetValidStructuredErrors();
34688     test_ret += test_xmlSchemaValidCtxtGetOptions();
34689     test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34690     test_ret += test_xmlSchemaValidateDoc();
34691     test_ret += test_xmlSchemaValidateFile();
34692     test_ret += test_xmlSchemaValidateOneElement();
34693     test_ret += test_xmlSchemaValidateStream();
34694
34695     if (test_ret != 0)
34696         printf("Module xmlschemas: %d errors\n", test_ret);
34697     return(test_ret);
34698 }
34699 #ifdef LIBXML_SCHEMAS_ENABLED
34700
34701 #define gen_nb_xmlSchemaFacetPtr 1
34702 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34703     return(NULL);
34704 }
34705 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34706 }
34707 #endif
34708
34709 #ifdef LIBXML_SCHEMAS_ENABLED
34710
34711 #define gen_nb_xmlSchemaTypePtr 1
34712 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34713     return(NULL);
34714 }
34715 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34716 }
34717 #endif
34718
34719
34720 static int
34721 test_xmlSchemaCheckFacet(void) {
34722     int test_ret = 0;
34723
34724 #if defined(LIBXML_SCHEMAS_ENABLED)
34725     int mem_base;
34726     int ret_val;
34727     xmlSchemaFacetPtr facet; /* the facet */
34728     int n_facet;
34729     xmlSchemaTypePtr typeDecl; /* the schema type definition */
34730     int n_typeDecl;
34731     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34732     int n_pctxt;
34733     xmlChar * name; /* the optional name of the type */
34734     int n_name;
34735
34736     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34737     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34738     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34739     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34740         mem_base = xmlMemBlocks();
34741         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34742         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34743         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34744         name = gen_const_xmlChar_ptr(n_name, 3);
34745
34746         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34747         desret_int(ret_val);
34748         call_tests++;
34749         des_xmlSchemaFacetPtr(n_facet, facet, 0);
34750         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34751         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34752         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34753         xmlResetLastError();
34754         if (mem_base != xmlMemBlocks()) {
34755             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34756                    xmlMemBlocks() - mem_base);
34757             test_ret++;
34758             printf(" %d", n_facet);
34759             printf(" %d", n_typeDecl);
34760             printf(" %d", n_pctxt);
34761             printf(" %d", n_name);
34762             printf("\n");
34763         }
34764     }
34765     }
34766     }
34767     }
34768     function_tests++;
34769 #endif
34770
34771     return(test_ret);
34772 }
34773
34774
34775 static int
34776 test_xmlSchemaCleanupTypes(void) {
34777     int test_ret = 0;
34778
34779 #if defined(LIBXML_SCHEMAS_ENABLED)
34780
34781
34782         xmlSchemaCleanupTypes();
34783         call_tests++;
34784         xmlResetLastError();
34785     function_tests++;
34786 #endif
34787
34788     return(test_ret);
34789 }
34790
34791
34792 static int
34793 test_xmlSchemaCollapseString(void) {
34794     int test_ret = 0;
34795
34796 #if defined(LIBXML_SCHEMAS_ENABLED)
34797     int mem_base;
34798     xmlChar * ret_val;
34799     xmlChar * value; /* a value */
34800     int n_value;
34801
34802     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34803         mem_base = xmlMemBlocks();
34804         value = gen_const_xmlChar_ptr(n_value, 0);
34805
34806         ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34807         desret_xmlChar_ptr(ret_val);
34808         call_tests++;
34809         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34810         xmlResetLastError();
34811         if (mem_base != xmlMemBlocks()) {
34812             printf("Leak of %d blocks found in xmlSchemaCollapseString",
34813                    xmlMemBlocks() - mem_base);
34814             test_ret++;
34815             printf(" %d", n_value);
34816             printf("\n");
34817         }
34818     }
34819     function_tests++;
34820 #endif
34821
34822     return(test_ret);
34823 }
34824
34825 #ifdef LIBXML_SCHEMAS_ENABLED
34826
34827 #define gen_nb_xmlSchemaValPtr 1
34828 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34829     return(NULL);
34830 }
34831 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34832 }
34833 #endif
34834
34835
34836 static int
34837 test_xmlSchemaCompareValues(void) {
34838     int test_ret = 0;
34839
34840 #if defined(LIBXML_SCHEMAS_ENABLED)
34841     int mem_base;
34842     int ret_val;
34843     xmlSchemaValPtr x; /* a first value */
34844     int n_x;
34845     xmlSchemaValPtr y; /* a second value */
34846     int n_y;
34847
34848     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34849     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34850         mem_base = xmlMemBlocks();
34851         x = gen_xmlSchemaValPtr(n_x, 0);
34852         y = gen_xmlSchemaValPtr(n_y, 1);
34853
34854         ret_val = xmlSchemaCompareValues(x, y);
34855         desret_int(ret_val);
34856         call_tests++;
34857         des_xmlSchemaValPtr(n_x, x, 0);
34858         des_xmlSchemaValPtr(n_y, y, 1);
34859         xmlResetLastError();
34860         if (mem_base != xmlMemBlocks()) {
34861             printf("Leak of %d blocks found in xmlSchemaCompareValues",
34862                    xmlMemBlocks() - mem_base);
34863             test_ret++;
34864             printf(" %d", n_x);
34865             printf(" %d", n_y);
34866             printf("\n");
34867         }
34868     }
34869     }
34870     function_tests++;
34871 #endif
34872
34873     return(test_ret);
34874 }
34875
34876
34877 static int
34878 test_xmlSchemaCompareValuesWhtsp(void) {
34879     int test_ret = 0;
34880
34881 #if defined(LIBXML_SCHEMAS_ENABLED)
34882     int mem_base;
34883     int ret_val;
34884     xmlSchemaValPtr x; /* a first value */
34885     int n_x;
34886     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34887     int n_xws;
34888     xmlSchemaValPtr y; /* a second value */
34889     int n_y;
34890     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34891     int n_yws;
34892
34893     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34894     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34895     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34896     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34897         mem_base = xmlMemBlocks();
34898         x = gen_xmlSchemaValPtr(n_x, 0);
34899         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34900         y = gen_xmlSchemaValPtr(n_y, 2);
34901         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34902
34903         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34904         desret_int(ret_val);
34905         call_tests++;
34906         des_xmlSchemaValPtr(n_x, x, 0);
34907         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34908         des_xmlSchemaValPtr(n_y, y, 2);
34909         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34910         xmlResetLastError();
34911         if (mem_base != xmlMemBlocks()) {
34912             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34913                    xmlMemBlocks() - mem_base);
34914             test_ret++;
34915             printf(" %d", n_x);
34916             printf(" %d", n_xws);
34917             printf(" %d", n_y);
34918             printf(" %d", n_yws);
34919             printf("\n");
34920         }
34921     }
34922     }
34923     }
34924     }
34925     function_tests++;
34926 #endif
34927
34928     return(test_ret);
34929 }
34930
34931
34932 static int
34933 test_xmlSchemaCopyValue(void) {
34934     int test_ret = 0;
34935
34936
34937     /* missing type support */
34938     return(test_ret);
34939 }
34940
34941
34942 static int
34943 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34944     int test_ret = 0;
34945
34946 #if defined(LIBXML_SCHEMAS_ENABLED)
34947     int mem_base;
34948     xmlSchemaTypePtr ret_val;
34949     xmlSchemaTypePtr type; /* the built-in simple type. */
34950     int n_type;
34951
34952     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34953         mem_base = xmlMemBlocks();
34954         type = gen_xmlSchemaTypePtr(n_type, 0);
34955
34956         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34957         desret_xmlSchemaTypePtr(ret_val);
34958         call_tests++;
34959         des_xmlSchemaTypePtr(n_type, type, 0);
34960         xmlResetLastError();
34961         if (mem_base != xmlMemBlocks()) {
34962             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34963                    xmlMemBlocks() - mem_base);
34964             test_ret++;
34965             printf(" %d", n_type);
34966             printf("\n");
34967         }
34968     }
34969     function_tests++;
34970 #endif
34971
34972     return(test_ret);
34973 }
34974
34975
34976 static int
34977 test_xmlSchemaGetBuiltInType(void) {
34978     int test_ret = 0;
34979
34980 #if defined(LIBXML_SCHEMAS_ENABLED)
34981     xmlSchemaTypePtr ret_val;
34982     xmlSchemaValType type; /* the type of the built in type */
34983     int n_type;
34984
34985     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34986         type = gen_xmlSchemaValType(n_type, 0);
34987
34988         ret_val = xmlSchemaGetBuiltInType(type);
34989         desret_xmlSchemaTypePtr(ret_val);
34990         call_tests++;
34991         des_xmlSchemaValType(n_type, type, 0);
34992         xmlResetLastError();
34993     }
34994     function_tests++;
34995 #endif
34996
34997     return(test_ret);
34998 }
34999
35000
35001 static int
35002 test_xmlSchemaGetCanonValue(void) {
35003     int test_ret = 0;
35004
35005 #if defined(LIBXML_SCHEMAS_ENABLED)
35006     int mem_base;
35007     int ret_val;
35008     xmlSchemaValPtr val; /* the precomputed value */
35009     int n_val;
35010     xmlChar ** retValue; /* the returned value */
35011     int n_retValue;
35012
35013     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35014     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35015         mem_base = xmlMemBlocks();
35016         val = gen_xmlSchemaValPtr(n_val, 0);
35017         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35018
35019         ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
35020         desret_int(ret_val);
35021         call_tests++;
35022         des_xmlSchemaValPtr(n_val, val, 0);
35023         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35024         xmlResetLastError();
35025         if (mem_base != xmlMemBlocks()) {
35026             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35027                    xmlMemBlocks() - mem_base);
35028             test_ret++;
35029             printf(" %d", n_val);
35030             printf(" %d", n_retValue);
35031             printf("\n");
35032         }
35033     }
35034     }
35035     function_tests++;
35036 #endif
35037
35038     return(test_ret);
35039 }
35040
35041
35042 static int
35043 test_xmlSchemaGetCanonValueWhtsp(void) {
35044     int test_ret = 0;
35045
35046 #if defined(LIBXML_SCHEMAS_ENABLED)
35047     int mem_base;
35048     int ret_val;
35049     xmlSchemaValPtr val; /* the precomputed value */
35050     int n_val;
35051     xmlChar ** retValue; /* the returned value */
35052     int n_retValue;
35053     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35054     int n_ws;
35055
35056     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35057     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35058     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35059         mem_base = xmlMemBlocks();
35060         val = gen_xmlSchemaValPtr(n_val, 0);
35061         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35062         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35063
35064         ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35065         desret_int(ret_val);
35066         call_tests++;
35067         des_xmlSchemaValPtr(n_val, val, 0);
35068         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35069         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35070         xmlResetLastError();
35071         if (mem_base != xmlMemBlocks()) {
35072             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35073                    xmlMemBlocks() - mem_base);
35074             test_ret++;
35075             printf(" %d", n_val);
35076             printf(" %d", n_retValue);
35077             printf(" %d", n_ws);
35078             printf("\n");
35079         }
35080     }
35081     }
35082     }
35083     function_tests++;
35084 #endif
35085
35086     return(test_ret);
35087 }
35088
35089
35090 static int
35091 test_xmlSchemaGetFacetValueAsULong(void) {
35092     int test_ret = 0;
35093
35094 #if defined(LIBXML_SCHEMAS_ENABLED)
35095     int mem_base;
35096     unsigned long ret_val;
35097     xmlSchemaFacetPtr facet; /* an schemas type facet */
35098     int n_facet;
35099
35100     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35101         mem_base = xmlMemBlocks();
35102         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35103
35104         ret_val = xmlSchemaGetFacetValueAsULong(facet);
35105         desret_unsigned_long(ret_val);
35106         call_tests++;
35107         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35108         xmlResetLastError();
35109         if (mem_base != xmlMemBlocks()) {
35110             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35111                    xmlMemBlocks() - mem_base);
35112             test_ret++;
35113             printf(" %d", n_facet);
35114             printf("\n");
35115         }
35116     }
35117     function_tests++;
35118 #endif
35119
35120     return(test_ret);
35121 }
35122
35123
35124 static int
35125 test_xmlSchemaGetPredefinedType(void) {
35126     int test_ret = 0;
35127
35128 #if defined(LIBXML_SCHEMAS_ENABLED)
35129     int mem_base;
35130     xmlSchemaTypePtr ret_val;
35131     xmlChar * name; /* the type name */
35132     int n_name;
35133     xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35134     int n_ns;
35135
35136     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35137     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35138         mem_base = xmlMemBlocks();
35139         name = gen_const_xmlChar_ptr(n_name, 0);
35140         ns = gen_const_xmlChar_ptr(n_ns, 1);
35141
35142         ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35143         desret_xmlSchemaTypePtr(ret_val);
35144         call_tests++;
35145         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35146         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35147         xmlResetLastError();
35148         if (mem_base != xmlMemBlocks()) {
35149             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35150                    xmlMemBlocks() - mem_base);
35151             test_ret++;
35152             printf(" %d", n_name);
35153             printf(" %d", n_ns);
35154             printf("\n");
35155         }
35156     }
35157     }
35158     function_tests++;
35159 #endif
35160
35161     return(test_ret);
35162 }
35163
35164
35165 static int
35166 test_xmlSchemaGetValType(void) {
35167     int test_ret = 0;
35168
35169 #if defined(LIBXML_SCHEMAS_ENABLED)
35170     int mem_base;
35171     xmlSchemaValType ret_val;
35172     xmlSchemaValPtr val; /* a schemas value */
35173     int n_val;
35174
35175     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35176         mem_base = xmlMemBlocks();
35177         val = gen_xmlSchemaValPtr(n_val, 0);
35178
35179         ret_val = xmlSchemaGetValType(val);
35180         desret_xmlSchemaValType(ret_val);
35181         call_tests++;
35182         des_xmlSchemaValPtr(n_val, val, 0);
35183         xmlResetLastError();
35184         if (mem_base != xmlMemBlocks()) {
35185             printf("Leak of %d blocks found in xmlSchemaGetValType",
35186                    xmlMemBlocks() - mem_base);
35187             test_ret++;
35188             printf(" %d", n_val);
35189             printf("\n");
35190         }
35191     }
35192     function_tests++;
35193 #endif
35194
35195     return(test_ret);
35196 }
35197
35198
35199 static int
35200 test_xmlSchemaInitTypes(void) {
35201     int test_ret = 0;
35202
35203 #if defined(LIBXML_SCHEMAS_ENABLED)
35204
35205
35206         xmlSchemaInitTypes();
35207         call_tests++;
35208         xmlResetLastError();
35209     function_tests++;
35210 #endif
35211
35212     return(test_ret);
35213 }
35214
35215
35216 static int
35217 test_xmlSchemaIsBuiltInTypeFacet(void) {
35218     int test_ret = 0;
35219
35220 #if defined(LIBXML_SCHEMAS_ENABLED)
35221     int mem_base;
35222     int ret_val;
35223     xmlSchemaTypePtr type; /* the built-in type */
35224     int n_type;
35225     int facetType; /* the facet type */
35226     int n_facetType;
35227
35228     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35229     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35230         mem_base = xmlMemBlocks();
35231         type = gen_xmlSchemaTypePtr(n_type, 0);
35232         facetType = gen_int(n_facetType, 1);
35233
35234         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35235         desret_int(ret_val);
35236         call_tests++;
35237         des_xmlSchemaTypePtr(n_type, type, 0);
35238         des_int(n_facetType, facetType, 1);
35239         xmlResetLastError();
35240         if (mem_base != xmlMemBlocks()) {
35241             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35242                    xmlMemBlocks() - mem_base);
35243             test_ret++;
35244             printf(" %d", n_type);
35245             printf(" %d", n_facetType);
35246             printf("\n");
35247         }
35248     }
35249     }
35250     function_tests++;
35251 #endif
35252
35253     return(test_ret);
35254 }
35255
35256
35257 static int
35258 test_xmlSchemaNewFacet(void) {
35259     int test_ret = 0;
35260
35261
35262     /* missing type support */
35263     return(test_ret);
35264 }
35265
35266
35267 static int
35268 test_xmlSchemaNewNOTATIONValue(void) {
35269     int test_ret = 0;
35270
35271
35272     /* missing type support */
35273     return(test_ret);
35274 }
35275
35276
35277 static int
35278 test_xmlSchemaNewQNameValue(void) {
35279     int test_ret = 0;
35280
35281
35282     /* missing type support */
35283     return(test_ret);
35284 }
35285
35286
35287 static int
35288 test_xmlSchemaNewStringValue(void) {
35289     int test_ret = 0;
35290
35291
35292     /* missing type support */
35293     return(test_ret);
35294 }
35295
35296 #ifdef LIBXML_SCHEMAS_ENABLED
35297
35298 #define gen_nb_xmlSchemaValPtr_ptr 1
35299 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35300     return(NULL);
35301 }
35302 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35303 }
35304 #endif
35305
35306
35307 static int
35308 test_xmlSchemaValPredefTypeNode(void) {
35309     int test_ret = 0;
35310
35311 #if defined(LIBXML_SCHEMAS_ENABLED)
35312     int mem_base;
35313     int ret_val;
35314     xmlSchemaTypePtr type; /* the predefined type */
35315     int n_type;
35316     xmlChar * value; /* the value to check */
35317     int n_value;
35318     xmlSchemaValPtr * val; /* the return computed value */
35319     int n_val;
35320     xmlNodePtr node; /* the node containing the value */
35321     int n_node;
35322
35323     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35324     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35325     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35326     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35327         mem_base = xmlMemBlocks();
35328         type = gen_xmlSchemaTypePtr(n_type, 0);
35329         value = gen_const_xmlChar_ptr(n_value, 1);
35330         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35331         node = gen_xmlNodePtr(n_node, 3);
35332
35333         ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35334         desret_int(ret_val);
35335         call_tests++;
35336         des_xmlSchemaTypePtr(n_type, type, 0);
35337         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35338         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35339         des_xmlNodePtr(n_node, node, 3);
35340         xmlResetLastError();
35341         if (mem_base != xmlMemBlocks()) {
35342             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35343                    xmlMemBlocks() - mem_base);
35344             test_ret++;
35345             printf(" %d", n_type);
35346             printf(" %d", n_value);
35347             printf(" %d", n_val);
35348             printf(" %d", n_node);
35349             printf("\n");
35350         }
35351     }
35352     }
35353     }
35354     }
35355     function_tests++;
35356 #endif
35357
35358     return(test_ret);
35359 }
35360
35361
35362 static int
35363 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35364     int test_ret = 0;
35365
35366 #if defined(LIBXML_SCHEMAS_ENABLED)
35367     int mem_base;
35368     int ret_val;
35369     xmlSchemaTypePtr type; /* the predefined type */
35370     int n_type;
35371     xmlChar * value; /* the value to check */
35372     int n_value;
35373     xmlSchemaValPtr * val; /* the return computed value */
35374     int n_val;
35375     xmlNodePtr node; /* the node containing the value */
35376     int n_node;
35377
35378     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35379     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35380     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35381     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35382         mem_base = xmlMemBlocks();
35383         type = gen_xmlSchemaTypePtr(n_type, 0);
35384         value = gen_const_xmlChar_ptr(n_value, 1);
35385         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35386         node = gen_xmlNodePtr(n_node, 3);
35387
35388         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35389         desret_int(ret_val);
35390         call_tests++;
35391         des_xmlSchemaTypePtr(n_type, type, 0);
35392         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35393         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35394         des_xmlNodePtr(n_node, node, 3);
35395         xmlResetLastError();
35396         if (mem_base != xmlMemBlocks()) {
35397             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35398                    xmlMemBlocks() - mem_base);
35399             test_ret++;
35400             printf(" %d", n_type);
35401             printf(" %d", n_value);
35402             printf(" %d", n_val);
35403             printf(" %d", n_node);
35404             printf("\n");
35405         }
35406     }
35407     }
35408     }
35409     }
35410     function_tests++;
35411 #endif
35412
35413     return(test_ret);
35414 }
35415
35416
35417 static int
35418 test_xmlSchemaValidateFacet(void) {
35419     int test_ret = 0;
35420
35421 #if defined(LIBXML_SCHEMAS_ENABLED)
35422     int mem_base;
35423     int ret_val;
35424     xmlSchemaTypePtr base; /* the base type */
35425     int n_base;
35426     xmlSchemaFacetPtr facet; /* the facet to check */
35427     int n_facet;
35428     xmlChar * value; /* the lexical repr of the value to validate */
35429     int n_value;
35430     xmlSchemaValPtr val; /* the precomputed value */
35431     int n_val;
35432
35433     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35434     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35435     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35436     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35437         mem_base = xmlMemBlocks();
35438         base = gen_xmlSchemaTypePtr(n_base, 0);
35439         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35440         value = gen_const_xmlChar_ptr(n_value, 2);
35441         val = gen_xmlSchemaValPtr(n_val, 3);
35442
35443         ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35444         desret_int(ret_val);
35445         call_tests++;
35446         des_xmlSchemaTypePtr(n_base, base, 0);
35447         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35448         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35449         des_xmlSchemaValPtr(n_val, val, 3);
35450         xmlResetLastError();
35451         if (mem_base != xmlMemBlocks()) {
35452             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35453                    xmlMemBlocks() - mem_base);
35454             test_ret++;
35455             printf(" %d", n_base);
35456             printf(" %d", n_facet);
35457             printf(" %d", n_value);
35458             printf(" %d", n_val);
35459             printf("\n");
35460         }
35461     }
35462     }
35463     }
35464     }
35465     function_tests++;
35466 #endif
35467
35468     return(test_ret);
35469 }
35470
35471
35472 static int
35473 test_xmlSchemaValidateFacetWhtsp(void) {
35474     int test_ret = 0;
35475
35476 #if defined(LIBXML_SCHEMAS_ENABLED)
35477     int mem_base;
35478     int ret_val;
35479     xmlSchemaFacetPtr facet; /* the facet to check */
35480     int n_facet;
35481     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35482     int n_fws;
35483     xmlSchemaValType valType; /* the built-in type of the value */
35484     int n_valType;
35485     xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35486     int n_value;
35487     xmlSchemaValPtr val; /* the precomputed value */
35488     int n_val;
35489     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35490     int n_ws;
35491
35492     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35493     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35494     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35495     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35496     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35497     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35498         mem_base = xmlMemBlocks();
35499         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35500         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35501         valType = gen_xmlSchemaValType(n_valType, 2);
35502         value = gen_const_xmlChar_ptr(n_value, 3);
35503         val = gen_xmlSchemaValPtr(n_val, 4);
35504         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35505
35506         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35507         desret_int(ret_val);
35508         call_tests++;
35509         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35510         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35511         des_xmlSchemaValType(n_valType, valType, 2);
35512         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35513         des_xmlSchemaValPtr(n_val, val, 4);
35514         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35515         xmlResetLastError();
35516         if (mem_base != xmlMemBlocks()) {
35517             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35518                    xmlMemBlocks() - mem_base);
35519             test_ret++;
35520             printf(" %d", n_facet);
35521             printf(" %d", n_fws);
35522             printf(" %d", n_valType);
35523             printf(" %d", n_value);
35524             printf(" %d", n_val);
35525             printf(" %d", n_ws);
35526             printf("\n");
35527         }
35528     }
35529     }
35530     }
35531     }
35532     }
35533     }
35534     function_tests++;
35535 #endif
35536
35537     return(test_ret);
35538 }
35539
35540
35541 static int
35542 test_xmlSchemaValidateLengthFacet(void) {
35543     int test_ret = 0;
35544
35545 #if defined(LIBXML_SCHEMAS_ENABLED)
35546     int mem_base;
35547     int ret_val;
35548     xmlSchemaTypePtr type; /* the built-in type */
35549     int n_type;
35550     xmlSchemaFacetPtr facet; /* the facet to check */
35551     int n_facet;
35552     xmlChar * value; /* the lexical repr. of the value to be validated */
35553     int n_value;
35554     xmlSchemaValPtr val; /* the precomputed value */
35555     int n_val;
35556     unsigned long * length; /* the actual length of the value */
35557     int n_length;
35558
35559     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35560     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35561     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35562     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35563     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35564         mem_base = xmlMemBlocks();
35565         type = gen_xmlSchemaTypePtr(n_type, 0);
35566         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35567         value = gen_const_xmlChar_ptr(n_value, 2);
35568         val = gen_xmlSchemaValPtr(n_val, 3);
35569         length = gen_unsigned_long_ptr(n_length, 4);
35570
35571         ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35572         desret_int(ret_val);
35573         call_tests++;
35574         des_xmlSchemaTypePtr(n_type, type, 0);
35575         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35576         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35577         des_xmlSchemaValPtr(n_val, val, 3);
35578         des_unsigned_long_ptr(n_length, length, 4);
35579         xmlResetLastError();
35580         if (mem_base != xmlMemBlocks()) {
35581             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35582                    xmlMemBlocks() - mem_base);
35583             test_ret++;
35584             printf(" %d", n_type);
35585             printf(" %d", n_facet);
35586             printf(" %d", n_value);
35587             printf(" %d", n_val);
35588             printf(" %d", n_length);
35589             printf("\n");
35590         }
35591     }
35592     }
35593     }
35594     }
35595     }
35596     function_tests++;
35597 #endif
35598
35599     return(test_ret);
35600 }
35601
35602
35603 static int
35604 test_xmlSchemaValidateLengthFacetWhtsp(void) {
35605     int test_ret = 0;
35606
35607 #if defined(LIBXML_SCHEMAS_ENABLED)
35608     int mem_base;
35609     int ret_val;
35610     xmlSchemaFacetPtr facet; /* the facet to check */
35611     int n_facet;
35612     xmlSchemaValType valType; /* the built-in type */
35613     int n_valType;
35614     xmlChar * value; /* the lexical repr. of the value to be validated */
35615     int n_value;
35616     xmlSchemaValPtr val; /* the precomputed value */
35617     int n_val;
35618     unsigned long * length; /* the actual length of the value */
35619     int n_length;
35620     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35621     int n_ws;
35622
35623     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35624     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35625     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35626     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35627     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35628     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35629         mem_base = xmlMemBlocks();
35630         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35631         valType = gen_xmlSchemaValType(n_valType, 1);
35632         value = gen_const_xmlChar_ptr(n_value, 2);
35633         val = gen_xmlSchemaValPtr(n_val, 3);
35634         length = gen_unsigned_long_ptr(n_length, 4);
35635         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35636
35637         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35638         desret_int(ret_val);
35639         call_tests++;
35640         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35641         des_xmlSchemaValType(n_valType, valType, 1);
35642         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35643         des_xmlSchemaValPtr(n_val, val, 3);
35644         des_unsigned_long_ptr(n_length, length, 4);
35645         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35646         xmlResetLastError();
35647         if (mem_base != xmlMemBlocks()) {
35648             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35649                    xmlMemBlocks() - mem_base);
35650             test_ret++;
35651             printf(" %d", n_facet);
35652             printf(" %d", n_valType);
35653             printf(" %d", n_value);
35654             printf(" %d", n_val);
35655             printf(" %d", n_length);
35656             printf(" %d", n_ws);
35657             printf("\n");
35658         }
35659     }
35660     }
35661     }
35662     }
35663     }
35664     }
35665     function_tests++;
35666 #endif
35667
35668     return(test_ret);
35669 }
35670
35671
35672 static int
35673 test_xmlSchemaValidateListSimpleTypeFacet(void) {
35674     int test_ret = 0;
35675
35676 #if defined(LIBXML_SCHEMAS_ENABLED)
35677     int mem_base;
35678     int ret_val;
35679     xmlSchemaFacetPtr facet; /* the facet to check */
35680     int n_facet;
35681     xmlChar * value; /* the lexical repr of the value to validate */
35682     int n_value;
35683     unsigned long actualLen; /* the number of list items */
35684     int n_actualLen;
35685     unsigned long * expectedLen; /* the resulting expected number of list items */
35686     int n_expectedLen;
35687
35688     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35689     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35690     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35691     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35692         mem_base = xmlMemBlocks();
35693         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35694         value = gen_const_xmlChar_ptr(n_value, 1);
35695         actualLen = gen_unsigned_long(n_actualLen, 2);
35696         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35697
35698         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35699         desret_int(ret_val);
35700         call_tests++;
35701         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35702         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35703         des_unsigned_long(n_actualLen, actualLen, 2);
35704         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35705         xmlResetLastError();
35706         if (mem_base != xmlMemBlocks()) {
35707             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35708                    xmlMemBlocks() - mem_base);
35709             test_ret++;
35710             printf(" %d", n_facet);
35711             printf(" %d", n_value);
35712             printf(" %d", n_actualLen);
35713             printf(" %d", n_expectedLen);
35714             printf("\n");
35715         }
35716     }
35717     }
35718     }
35719     }
35720     function_tests++;
35721 #endif
35722
35723     return(test_ret);
35724 }
35725
35726
35727 static int
35728 test_xmlSchemaValidatePredefinedType(void) {
35729     int test_ret = 0;
35730
35731 #if defined(LIBXML_SCHEMAS_ENABLED)
35732     int mem_base;
35733     int ret_val;
35734     xmlSchemaTypePtr type; /* the predefined type */
35735     int n_type;
35736     xmlChar * value; /* the value to check */
35737     int n_value;
35738     xmlSchemaValPtr * val; /* the return computed value */
35739     int n_val;
35740
35741     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35742     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35743     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35744         mem_base = xmlMemBlocks();
35745         type = gen_xmlSchemaTypePtr(n_type, 0);
35746         value = gen_const_xmlChar_ptr(n_value, 1);
35747         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35748
35749         ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35750         desret_int(ret_val);
35751         call_tests++;
35752         des_xmlSchemaTypePtr(n_type, type, 0);
35753         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35754         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35755         xmlResetLastError();
35756         if (mem_base != xmlMemBlocks()) {
35757             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35758                    xmlMemBlocks() - mem_base);
35759             test_ret++;
35760             printf(" %d", n_type);
35761             printf(" %d", n_value);
35762             printf(" %d", n_val);
35763             printf("\n");
35764         }
35765     }
35766     }
35767     }
35768     function_tests++;
35769 #endif
35770
35771     return(test_ret);
35772 }
35773
35774
35775 static int
35776 test_xmlSchemaValueAppend(void) {
35777     int test_ret = 0;
35778
35779 #if defined(LIBXML_SCHEMAS_ENABLED)
35780     int mem_base;
35781     int ret_val;
35782     xmlSchemaValPtr prev; /* the value */
35783     int n_prev;
35784     xmlSchemaValPtr cur; /* the value to be appended */
35785     int n_cur;
35786
35787     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35788     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35789         mem_base = xmlMemBlocks();
35790         prev = gen_xmlSchemaValPtr(n_prev, 0);
35791         cur = gen_xmlSchemaValPtr(n_cur, 1);
35792
35793         ret_val = xmlSchemaValueAppend(prev, cur);
35794         desret_int(ret_val);
35795         call_tests++;
35796         des_xmlSchemaValPtr(n_prev, prev, 0);
35797         des_xmlSchemaValPtr(n_cur, cur, 1);
35798         xmlResetLastError();
35799         if (mem_base != xmlMemBlocks()) {
35800             printf("Leak of %d blocks found in xmlSchemaValueAppend",
35801                    xmlMemBlocks() - mem_base);
35802             test_ret++;
35803             printf(" %d", n_prev);
35804             printf(" %d", n_cur);
35805             printf("\n");
35806         }
35807     }
35808     }
35809     function_tests++;
35810 #endif
35811
35812     return(test_ret);
35813 }
35814
35815
35816 static int
35817 test_xmlSchemaValueGetAsBoolean(void) {
35818     int test_ret = 0;
35819
35820 #if defined(LIBXML_SCHEMAS_ENABLED)
35821     int mem_base;
35822     int ret_val;
35823     xmlSchemaValPtr val; /* the value */
35824     int n_val;
35825
35826     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35827         mem_base = xmlMemBlocks();
35828         val = gen_xmlSchemaValPtr(n_val, 0);
35829
35830         ret_val = xmlSchemaValueGetAsBoolean(val);
35831         desret_int(ret_val);
35832         call_tests++;
35833         des_xmlSchemaValPtr(n_val, val, 0);
35834         xmlResetLastError();
35835         if (mem_base != xmlMemBlocks()) {
35836             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35837                    xmlMemBlocks() - mem_base);
35838             test_ret++;
35839             printf(" %d", n_val);
35840             printf("\n");
35841         }
35842     }
35843     function_tests++;
35844 #endif
35845
35846     return(test_ret);
35847 }
35848
35849
35850 static int
35851 test_xmlSchemaValueGetAsString(void) {
35852     int test_ret = 0;
35853
35854 #if defined(LIBXML_SCHEMAS_ENABLED)
35855     int mem_base;
35856     const xmlChar * ret_val;
35857     xmlSchemaValPtr val; /* the value */
35858     int n_val;
35859
35860     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35861         mem_base = xmlMemBlocks();
35862         val = gen_xmlSchemaValPtr(n_val, 0);
35863
35864         ret_val = xmlSchemaValueGetAsString(val);
35865         desret_const_xmlChar_ptr(ret_val);
35866         call_tests++;
35867         des_xmlSchemaValPtr(n_val, val, 0);
35868         xmlResetLastError();
35869         if (mem_base != xmlMemBlocks()) {
35870             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35871                    xmlMemBlocks() - mem_base);
35872             test_ret++;
35873             printf(" %d", n_val);
35874             printf("\n");
35875         }
35876     }
35877     function_tests++;
35878 #endif
35879
35880     return(test_ret);
35881 }
35882
35883
35884 static int
35885 test_xmlSchemaValueGetNext(void) {
35886     int test_ret = 0;
35887
35888
35889     /* missing type support */
35890     return(test_ret);
35891 }
35892
35893
35894 static int
35895 test_xmlSchemaWhiteSpaceReplace(void) {
35896     int test_ret = 0;
35897
35898 #if defined(LIBXML_SCHEMAS_ENABLED)
35899     int mem_base;
35900     xmlChar * ret_val;
35901     xmlChar * value; /* a value */
35902     int n_value;
35903
35904     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35905         mem_base = xmlMemBlocks();
35906         value = gen_const_xmlChar_ptr(n_value, 0);
35907
35908         ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35909         desret_xmlChar_ptr(ret_val);
35910         call_tests++;
35911         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35912         xmlResetLastError();
35913         if (mem_base != xmlMemBlocks()) {
35914             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35915                    xmlMemBlocks() - mem_base);
35916             test_ret++;
35917             printf(" %d", n_value);
35918             printf("\n");
35919         }
35920     }
35921     function_tests++;
35922 #endif
35923
35924     return(test_ret);
35925 }
35926
35927 static int
35928 test_xmlschemastypes(void) {
35929     int test_ret = 0;
35930
35931     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35932     test_ret += test_xmlSchemaCheckFacet();
35933     test_ret += test_xmlSchemaCleanupTypes();
35934     test_ret += test_xmlSchemaCollapseString();
35935     test_ret += test_xmlSchemaCompareValues();
35936     test_ret += test_xmlSchemaCompareValuesWhtsp();
35937     test_ret += test_xmlSchemaCopyValue();
35938     test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35939     test_ret += test_xmlSchemaGetBuiltInType();
35940     test_ret += test_xmlSchemaGetCanonValue();
35941     test_ret += test_xmlSchemaGetCanonValueWhtsp();
35942     test_ret += test_xmlSchemaGetFacetValueAsULong();
35943     test_ret += test_xmlSchemaGetPredefinedType();
35944     test_ret += test_xmlSchemaGetValType();
35945     test_ret += test_xmlSchemaInitTypes();
35946     test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35947     test_ret += test_xmlSchemaNewFacet();
35948     test_ret += test_xmlSchemaNewNOTATIONValue();
35949     test_ret += test_xmlSchemaNewQNameValue();
35950     test_ret += test_xmlSchemaNewStringValue();
35951     test_ret += test_xmlSchemaValPredefTypeNode();
35952     test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35953     test_ret += test_xmlSchemaValidateFacet();
35954     test_ret += test_xmlSchemaValidateFacetWhtsp();
35955     test_ret += test_xmlSchemaValidateLengthFacet();
35956     test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35957     test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35958     test_ret += test_xmlSchemaValidatePredefinedType();
35959     test_ret += test_xmlSchemaValueAppend();
35960     test_ret += test_xmlSchemaValueGetAsBoolean();
35961     test_ret += test_xmlSchemaValueGetAsString();
35962     test_ret += test_xmlSchemaValueGetNext();
35963     test_ret += test_xmlSchemaWhiteSpaceReplace();
35964
35965     if (test_ret != 0)
35966         printf("Module xmlschemastypes: %d errors\n", test_ret);
35967     return(test_ret);
35968 }
35969
35970 static int
35971 test_xmlCharStrdup(void) {
35972     int test_ret = 0;
35973
35974     int mem_base;
35975     xmlChar * ret_val;
35976     char * cur; /* the input char * */
35977     int n_cur;
35978
35979     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35980         mem_base = xmlMemBlocks();
35981         cur = gen_const_char_ptr(n_cur, 0);
35982
35983         ret_val = xmlCharStrdup((const char *)cur);
35984         desret_xmlChar_ptr(ret_val);
35985         call_tests++;
35986         des_const_char_ptr(n_cur, (const char *)cur, 0);
35987         xmlResetLastError();
35988         if (mem_base != xmlMemBlocks()) {
35989             printf("Leak of %d blocks found in xmlCharStrdup",
35990                    xmlMemBlocks() - mem_base);
35991             test_ret++;
35992             printf(" %d", n_cur);
35993             printf("\n");
35994         }
35995     }
35996     function_tests++;
35997
35998     return(test_ret);
35999 }
36000
36001
36002 static int
36003 test_xmlCharStrndup(void) {
36004     int test_ret = 0;
36005
36006     int mem_base;
36007     xmlChar * ret_val;
36008     char * cur; /* the input char * */
36009     int n_cur;
36010     int len; /* the len of @cur */
36011     int n_len;
36012
36013     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36014     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36015         mem_base = xmlMemBlocks();
36016         cur = gen_const_char_ptr(n_cur, 0);
36017         len = gen_int(n_len, 1);
36018
36019         ret_val = xmlCharStrndup((const char *)cur, len);
36020         desret_xmlChar_ptr(ret_val);
36021         call_tests++;
36022         des_const_char_ptr(n_cur, (const char *)cur, 0);
36023         des_int(n_len, len, 1);
36024         xmlResetLastError();
36025         if (mem_base != xmlMemBlocks()) {
36026             printf("Leak of %d blocks found in xmlCharStrndup",
36027                    xmlMemBlocks() - mem_base);
36028             test_ret++;
36029             printf(" %d", n_cur);
36030             printf(" %d", n_len);
36031             printf("\n");
36032         }
36033     }
36034     }
36035     function_tests++;
36036
36037     return(test_ret);
36038 }
36039
36040
36041 static int
36042 test_xmlCheckUTF8(void) {
36043     int test_ret = 0;
36044
36045     int mem_base;
36046     int ret_val;
36047     unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36048     int n_utf;
36049
36050     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36051         mem_base = xmlMemBlocks();
36052         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36053
36054         ret_val = xmlCheckUTF8((const unsigned char *)utf);
36055         desret_int(ret_val);
36056         call_tests++;
36057         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36058         xmlResetLastError();
36059         if (mem_base != xmlMemBlocks()) {
36060             printf("Leak of %d blocks found in xmlCheckUTF8",
36061                    xmlMemBlocks() - mem_base);
36062             test_ret++;
36063             printf(" %d", n_utf);
36064             printf("\n");
36065         }
36066     }
36067     function_tests++;
36068
36069     return(test_ret);
36070 }
36071
36072
36073 static int
36074 test_xmlGetUTF8Char(void) {
36075     int test_ret = 0;
36076
36077     int mem_base;
36078     int ret_val;
36079     unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36080     int n_utf;
36081     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. */
36082     int n_len;
36083
36084     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36085     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36086         mem_base = xmlMemBlocks();
36087         utf = gen_const_unsigned_char_ptr(n_utf, 0);
36088         len = gen_int_ptr(n_len, 1);
36089
36090         ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36091         desret_int(ret_val);
36092         call_tests++;
36093         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36094         des_int_ptr(n_len, len, 1);
36095         xmlResetLastError();
36096         if (mem_base != xmlMemBlocks()) {
36097             printf("Leak of %d blocks found in xmlGetUTF8Char",
36098                    xmlMemBlocks() - mem_base);
36099             test_ret++;
36100             printf(" %d", n_utf);
36101             printf(" %d", n_len);
36102             printf("\n");
36103         }
36104     }
36105     }
36106     function_tests++;
36107
36108     return(test_ret);
36109 }
36110
36111
36112 static int
36113 test_xmlStrEqual(void) {
36114     int test_ret = 0;
36115
36116     int mem_base;
36117     int ret_val;
36118     xmlChar * str1; /* the first xmlChar * */
36119     int n_str1;
36120     xmlChar * str2; /* the second xmlChar * */
36121     int n_str2;
36122
36123     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36124     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36125         mem_base = xmlMemBlocks();
36126         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36127         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36128
36129         ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36130         desret_int(ret_val);
36131         call_tests++;
36132         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36133         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36134         xmlResetLastError();
36135         if (mem_base != xmlMemBlocks()) {
36136             printf("Leak of %d blocks found in xmlStrEqual",
36137                    xmlMemBlocks() - mem_base);
36138             test_ret++;
36139             printf(" %d", n_str1);
36140             printf(" %d", n_str2);
36141             printf("\n");
36142         }
36143     }
36144     }
36145     function_tests++;
36146
36147     return(test_ret);
36148 }
36149
36150
36151 static int
36152 test_xmlStrPrintf(void) {
36153     int test_ret = 0;
36154
36155
36156     /* missing type support */
36157     return(test_ret);
36158 }
36159
36160
36161 static int
36162 test_xmlStrQEqual(void) {
36163     int test_ret = 0;
36164
36165     int mem_base;
36166     int ret_val;
36167     xmlChar * pref; /* the prefix of the QName */
36168     int n_pref;
36169     xmlChar * name; /* the localname of the QName */
36170     int n_name;
36171     xmlChar * str; /* the second xmlChar * */
36172     int n_str;
36173
36174     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36175     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36176     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36177         mem_base = xmlMemBlocks();
36178         pref = gen_const_xmlChar_ptr(n_pref, 0);
36179         name = gen_const_xmlChar_ptr(n_name, 1);
36180         str = gen_const_xmlChar_ptr(n_str, 2);
36181
36182         ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36183         desret_int(ret_val);
36184         call_tests++;
36185         des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36186         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36187         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36188         xmlResetLastError();
36189         if (mem_base != xmlMemBlocks()) {
36190             printf("Leak of %d blocks found in xmlStrQEqual",
36191                    xmlMemBlocks() - mem_base);
36192             test_ret++;
36193             printf(" %d", n_pref);
36194             printf(" %d", n_name);
36195             printf(" %d", n_str);
36196             printf("\n");
36197         }
36198     }
36199     }
36200     }
36201     function_tests++;
36202
36203     return(test_ret);
36204 }
36205
36206
36207 static int
36208 test_xmlStrVPrintf(void) {
36209     int test_ret = 0;
36210
36211
36212     /* missing type support */
36213     return(test_ret);
36214 }
36215
36216
36217 static int
36218 test_xmlStrcasecmp(void) {
36219     int test_ret = 0;
36220
36221     int mem_base;
36222     int ret_val;
36223     xmlChar * str1; /* the first xmlChar * */
36224     int n_str1;
36225     xmlChar * str2; /* the second xmlChar * */
36226     int n_str2;
36227
36228     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36229     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36230         mem_base = xmlMemBlocks();
36231         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36232         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36233
36234         ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36235         desret_int(ret_val);
36236         call_tests++;
36237         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36238         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36239         xmlResetLastError();
36240         if (mem_base != xmlMemBlocks()) {
36241             printf("Leak of %d blocks found in xmlStrcasecmp",
36242                    xmlMemBlocks() - mem_base);
36243             test_ret++;
36244             printf(" %d", n_str1);
36245             printf(" %d", n_str2);
36246             printf("\n");
36247         }
36248     }
36249     }
36250     function_tests++;
36251
36252     return(test_ret);
36253 }
36254
36255
36256 static int
36257 test_xmlStrcasestr(void) {
36258     int test_ret = 0;
36259
36260     int mem_base;
36261     const xmlChar * ret_val;
36262     xmlChar * str; /* the xmlChar * array (haystack) */
36263     int n_str;
36264     xmlChar * val; /* the xmlChar to search (needle) */
36265     int n_val;
36266
36267     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36268     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36269         mem_base = xmlMemBlocks();
36270         str = gen_const_xmlChar_ptr(n_str, 0);
36271         val = gen_const_xmlChar_ptr(n_val, 1);
36272
36273         ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36274         desret_const_xmlChar_ptr(ret_val);
36275         call_tests++;
36276         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36277         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36278         xmlResetLastError();
36279         if (mem_base != xmlMemBlocks()) {
36280             printf("Leak of %d blocks found in xmlStrcasestr",
36281                    xmlMemBlocks() - mem_base);
36282             test_ret++;
36283             printf(" %d", n_str);
36284             printf(" %d", n_val);
36285             printf("\n");
36286         }
36287     }
36288     }
36289     function_tests++;
36290
36291     return(test_ret);
36292 }
36293
36294
36295 static int
36296 test_xmlStrchr(void) {
36297     int test_ret = 0;
36298
36299     int mem_base;
36300     const xmlChar * ret_val;
36301     xmlChar * str; /* the xmlChar * array */
36302     int n_str;
36303     xmlChar val; /* the xmlChar to search */
36304     int n_val;
36305
36306     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36307     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36308         mem_base = xmlMemBlocks();
36309         str = gen_const_xmlChar_ptr(n_str, 0);
36310         val = gen_xmlChar(n_val, 1);
36311
36312         ret_val = xmlStrchr((const xmlChar *)str, val);
36313         desret_const_xmlChar_ptr(ret_val);
36314         call_tests++;
36315         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36316         des_xmlChar(n_val, val, 1);
36317         xmlResetLastError();
36318         if (mem_base != xmlMemBlocks()) {
36319             printf("Leak of %d blocks found in xmlStrchr",
36320                    xmlMemBlocks() - mem_base);
36321             test_ret++;
36322             printf(" %d", n_str);
36323             printf(" %d", n_val);
36324             printf("\n");
36325         }
36326     }
36327     }
36328     function_tests++;
36329
36330     return(test_ret);
36331 }
36332
36333
36334 static int
36335 test_xmlStrcmp(void) {
36336     int test_ret = 0;
36337
36338     int mem_base;
36339     int ret_val;
36340     xmlChar * str1; /* the first xmlChar * */
36341     int n_str1;
36342     xmlChar * str2; /* the second xmlChar * */
36343     int n_str2;
36344
36345     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36346     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36347         mem_base = xmlMemBlocks();
36348         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36349         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36350
36351         ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36352         desret_int(ret_val);
36353         call_tests++;
36354         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36355         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36356         xmlResetLastError();
36357         if (mem_base != xmlMemBlocks()) {
36358             printf("Leak of %d blocks found in xmlStrcmp",
36359                    xmlMemBlocks() - mem_base);
36360             test_ret++;
36361             printf(" %d", n_str1);
36362             printf(" %d", n_str2);
36363             printf("\n");
36364         }
36365     }
36366     }
36367     function_tests++;
36368
36369     return(test_ret);
36370 }
36371
36372
36373 static int
36374 test_xmlStrdup(void) {
36375     int test_ret = 0;
36376
36377     int mem_base;
36378     xmlChar * ret_val;
36379     xmlChar * cur; /* the input xmlChar * */
36380     int n_cur;
36381
36382     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36383         mem_base = xmlMemBlocks();
36384         cur = gen_const_xmlChar_ptr(n_cur, 0);
36385
36386         ret_val = xmlStrdup((const xmlChar *)cur);
36387         desret_xmlChar_ptr(ret_val);
36388         call_tests++;
36389         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36390         xmlResetLastError();
36391         if (mem_base != xmlMemBlocks()) {
36392             printf("Leak of %d blocks found in xmlStrdup",
36393                    xmlMemBlocks() - mem_base);
36394             test_ret++;
36395             printf(" %d", n_cur);
36396             printf("\n");
36397         }
36398     }
36399     function_tests++;
36400
36401     return(test_ret);
36402 }
36403
36404
36405 static int
36406 test_xmlStrlen(void) {
36407     int test_ret = 0;
36408
36409     int mem_base;
36410     int ret_val;
36411     xmlChar * str; /* the xmlChar * array */
36412     int n_str;
36413
36414     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36415         mem_base = xmlMemBlocks();
36416         str = gen_const_xmlChar_ptr(n_str, 0);
36417
36418         ret_val = xmlStrlen((const xmlChar *)str);
36419         desret_int(ret_val);
36420         call_tests++;
36421         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36422         xmlResetLastError();
36423         if (mem_base != xmlMemBlocks()) {
36424             printf("Leak of %d blocks found in xmlStrlen",
36425                    xmlMemBlocks() - mem_base);
36426             test_ret++;
36427             printf(" %d", n_str);
36428             printf("\n");
36429         }
36430     }
36431     function_tests++;
36432
36433     return(test_ret);
36434 }
36435
36436
36437 static int
36438 test_xmlStrncasecmp(void) {
36439     int test_ret = 0;
36440
36441     int mem_base;
36442     int ret_val;
36443     xmlChar * str1; /* the first xmlChar * */
36444     int n_str1;
36445     xmlChar * str2; /* the second xmlChar * */
36446     int n_str2;
36447     int len; /* the max comparison length */
36448     int n_len;
36449
36450     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36451     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36452     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36453         mem_base = xmlMemBlocks();
36454         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36455         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36456         len = gen_int(n_len, 2);
36457
36458         ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36459         desret_int(ret_val);
36460         call_tests++;
36461         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36462         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36463         des_int(n_len, len, 2);
36464         xmlResetLastError();
36465         if (mem_base != xmlMemBlocks()) {
36466             printf("Leak of %d blocks found in xmlStrncasecmp",
36467                    xmlMemBlocks() - mem_base);
36468             test_ret++;
36469             printf(" %d", n_str1);
36470             printf(" %d", n_str2);
36471             printf(" %d", n_len);
36472             printf("\n");
36473         }
36474     }
36475     }
36476     }
36477     function_tests++;
36478
36479     return(test_ret);
36480 }
36481
36482
36483 static int
36484 test_xmlStrncatNew(void) {
36485     int test_ret = 0;
36486
36487     int mem_base;
36488     xmlChar * ret_val;
36489     xmlChar * str1; /* first xmlChar string */
36490     int n_str1;
36491     xmlChar * str2; /* second xmlChar string */
36492     int n_str2;
36493     int len; /* the len of @str2 or < 0 */
36494     int n_len;
36495
36496     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36497     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36498     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36499         mem_base = xmlMemBlocks();
36500         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36501         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36502         len = gen_int(n_len, 2);
36503
36504         ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36505         desret_xmlChar_ptr(ret_val);
36506         call_tests++;
36507         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36508         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36509         des_int(n_len, len, 2);
36510         xmlResetLastError();
36511         if (mem_base != xmlMemBlocks()) {
36512             printf("Leak of %d blocks found in xmlStrncatNew",
36513                    xmlMemBlocks() - mem_base);
36514             test_ret++;
36515             printf(" %d", n_str1);
36516             printf(" %d", n_str2);
36517             printf(" %d", n_len);
36518             printf("\n");
36519         }
36520     }
36521     }
36522     }
36523     function_tests++;
36524
36525     return(test_ret);
36526 }
36527
36528
36529 static int
36530 test_xmlStrncmp(void) {
36531     int test_ret = 0;
36532
36533     int mem_base;
36534     int ret_val;
36535     xmlChar * str1; /* the first xmlChar * */
36536     int n_str1;
36537     xmlChar * str2; /* the second xmlChar * */
36538     int n_str2;
36539     int len; /* the max comparison length */
36540     int n_len;
36541
36542     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36543     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36544     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36545         mem_base = xmlMemBlocks();
36546         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36547         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36548         len = gen_int(n_len, 2);
36549
36550         ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36551         desret_int(ret_val);
36552         call_tests++;
36553         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36554         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36555         des_int(n_len, len, 2);
36556         xmlResetLastError();
36557         if (mem_base != xmlMemBlocks()) {
36558             printf("Leak of %d blocks found in xmlStrncmp",
36559                    xmlMemBlocks() - mem_base);
36560             test_ret++;
36561             printf(" %d", n_str1);
36562             printf(" %d", n_str2);
36563             printf(" %d", n_len);
36564             printf("\n");
36565         }
36566     }
36567     }
36568     }
36569     function_tests++;
36570
36571     return(test_ret);
36572 }
36573
36574
36575 static int
36576 test_xmlStrndup(void) {
36577     int test_ret = 0;
36578
36579     int mem_base;
36580     xmlChar * ret_val;
36581     xmlChar * cur; /* the input xmlChar * */
36582     int n_cur;
36583     int len; /* the len of @cur */
36584     int n_len;
36585
36586     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36587     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36588         mem_base = xmlMemBlocks();
36589         cur = gen_const_xmlChar_ptr(n_cur, 0);
36590         len = gen_int(n_len, 1);
36591
36592         ret_val = xmlStrndup((const xmlChar *)cur, len);
36593         desret_xmlChar_ptr(ret_val);
36594         call_tests++;
36595         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36596         des_int(n_len, len, 1);
36597         xmlResetLastError();
36598         if (mem_base != xmlMemBlocks()) {
36599             printf("Leak of %d blocks found in xmlStrndup",
36600                    xmlMemBlocks() - mem_base);
36601             test_ret++;
36602             printf(" %d", n_cur);
36603             printf(" %d", n_len);
36604             printf("\n");
36605         }
36606     }
36607     }
36608     function_tests++;
36609
36610     return(test_ret);
36611 }
36612
36613
36614 static int
36615 test_xmlStrstr(void) {
36616     int test_ret = 0;
36617
36618     int mem_base;
36619     const xmlChar * ret_val;
36620     xmlChar * str; /* the xmlChar * array (haystack) */
36621     int n_str;
36622     xmlChar * val; /* the xmlChar to search (needle) */
36623     int n_val;
36624
36625     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36626     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36627         mem_base = xmlMemBlocks();
36628         str = gen_const_xmlChar_ptr(n_str, 0);
36629         val = gen_const_xmlChar_ptr(n_val, 1);
36630
36631         ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36632         desret_const_xmlChar_ptr(ret_val);
36633         call_tests++;
36634         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36635         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36636         xmlResetLastError();
36637         if (mem_base != xmlMemBlocks()) {
36638             printf("Leak of %d blocks found in xmlStrstr",
36639                    xmlMemBlocks() - mem_base);
36640             test_ret++;
36641             printf(" %d", n_str);
36642             printf(" %d", n_val);
36643             printf("\n");
36644         }
36645     }
36646     }
36647     function_tests++;
36648
36649     return(test_ret);
36650 }
36651
36652
36653 static int
36654 test_xmlStrsub(void) {
36655     int test_ret = 0;
36656
36657     int mem_base;
36658     xmlChar * ret_val;
36659     xmlChar * str; /* the xmlChar * array (haystack) */
36660     int n_str;
36661     int start; /* the index of the first char (zero based) */
36662     int n_start;
36663     int len; /* the length of the substring */
36664     int n_len;
36665
36666     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36667     for (n_start = 0;n_start < gen_nb_int;n_start++) {
36668     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36669         mem_base = xmlMemBlocks();
36670         str = gen_const_xmlChar_ptr(n_str, 0);
36671         start = gen_int(n_start, 1);
36672         len = gen_int(n_len, 2);
36673
36674         ret_val = xmlStrsub((const xmlChar *)str, start, len);
36675         desret_xmlChar_ptr(ret_val);
36676         call_tests++;
36677         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36678         des_int(n_start, start, 1);
36679         des_int(n_len, len, 2);
36680         xmlResetLastError();
36681         if (mem_base != xmlMemBlocks()) {
36682             printf("Leak of %d blocks found in xmlStrsub",
36683                    xmlMemBlocks() - mem_base);
36684             test_ret++;
36685             printf(" %d", n_str);
36686             printf(" %d", n_start);
36687             printf(" %d", n_len);
36688             printf("\n");
36689         }
36690     }
36691     }
36692     }
36693     function_tests++;
36694
36695     return(test_ret);
36696 }
36697
36698
36699 static int
36700 test_xmlUTF8Charcmp(void) {
36701     int test_ret = 0;
36702
36703     int mem_base;
36704     int ret_val;
36705     xmlChar * utf1; /* pointer to first UTF8 char */
36706     int n_utf1;
36707     xmlChar * utf2; /* pointer to second UTF8 char */
36708     int n_utf2;
36709
36710     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36711     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36712         mem_base = xmlMemBlocks();
36713         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36714         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36715
36716         ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36717         desret_int(ret_val);
36718         call_tests++;
36719         des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36720         des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36721         xmlResetLastError();
36722         if (mem_base != xmlMemBlocks()) {
36723             printf("Leak of %d blocks found in xmlUTF8Charcmp",
36724                    xmlMemBlocks() - mem_base);
36725             test_ret++;
36726             printf(" %d", n_utf1);
36727             printf(" %d", n_utf2);
36728             printf("\n");
36729         }
36730     }
36731     }
36732     function_tests++;
36733
36734     return(test_ret);
36735 }
36736
36737
36738 static int
36739 test_xmlUTF8Size(void) {
36740     int test_ret = 0;
36741
36742     int mem_base;
36743     int ret_val;
36744     xmlChar * utf; /* pointer to the UTF8 character */
36745     int n_utf;
36746
36747     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36748         mem_base = xmlMemBlocks();
36749         utf = gen_const_xmlChar_ptr(n_utf, 0);
36750
36751         ret_val = xmlUTF8Size((const xmlChar *)utf);
36752         desret_int(ret_val);
36753         call_tests++;
36754         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36755         xmlResetLastError();
36756         if (mem_base != xmlMemBlocks()) {
36757             printf("Leak of %d blocks found in xmlUTF8Size",
36758                    xmlMemBlocks() - mem_base);
36759             test_ret++;
36760             printf(" %d", n_utf);
36761             printf("\n");
36762         }
36763     }
36764     function_tests++;
36765
36766     return(test_ret);
36767 }
36768
36769
36770 static int
36771 test_xmlUTF8Strlen(void) {
36772     int test_ret = 0;
36773
36774     int mem_base;
36775     int ret_val;
36776     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36777     int n_utf;
36778
36779     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36780         mem_base = xmlMemBlocks();
36781         utf = gen_const_xmlChar_ptr(n_utf, 0);
36782
36783         ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36784         desret_int(ret_val);
36785         call_tests++;
36786         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36787         xmlResetLastError();
36788         if (mem_base != xmlMemBlocks()) {
36789             printf("Leak of %d blocks found in xmlUTF8Strlen",
36790                    xmlMemBlocks() - mem_base);
36791             test_ret++;
36792             printf(" %d", n_utf);
36793             printf("\n");
36794         }
36795     }
36796     function_tests++;
36797
36798     return(test_ret);
36799 }
36800
36801
36802 static int
36803 test_xmlUTF8Strloc(void) {
36804     int test_ret = 0;
36805
36806     int mem_base;
36807     int ret_val;
36808     xmlChar * utf; /* the input UTF8 * */
36809     int n_utf;
36810     xmlChar * utfchar; /* the UTF8 character to be found */
36811     int n_utfchar;
36812
36813     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36814     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36815         mem_base = xmlMemBlocks();
36816         utf = gen_const_xmlChar_ptr(n_utf, 0);
36817         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36818
36819         ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36820         desret_int(ret_val);
36821         call_tests++;
36822         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36823         des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36824         xmlResetLastError();
36825         if (mem_base != xmlMemBlocks()) {
36826             printf("Leak of %d blocks found in xmlUTF8Strloc",
36827                    xmlMemBlocks() - mem_base);
36828             test_ret++;
36829             printf(" %d", n_utf);
36830             printf(" %d", n_utfchar);
36831             printf("\n");
36832         }
36833     }
36834     }
36835     function_tests++;
36836
36837     return(test_ret);
36838 }
36839
36840
36841 static int
36842 test_xmlUTF8Strndup(void) {
36843     int test_ret = 0;
36844
36845     int mem_base;
36846     xmlChar * ret_val;
36847     xmlChar * utf; /* the input UTF8 * */
36848     int n_utf;
36849     int len; /* the len of @utf (in chars) */
36850     int n_len;
36851
36852     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36853     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36854         mem_base = xmlMemBlocks();
36855         utf = gen_const_xmlChar_ptr(n_utf, 0);
36856         len = gen_int(n_len, 1);
36857
36858         ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36859         desret_xmlChar_ptr(ret_val);
36860         call_tests++;
36861         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36862         des_int(n_len, len, 1);
36863         xmlResetLastError();
36864         if (mem_base != xmlMemBlocks()) {
36865             printf("Leak of %d blocks found in xmlUTF8Strndup",
36866                    xmlMemBlocks() - mem_base);
36867             test_ret++;
36868             printf(" %d", n_utf);
36869             printf(" %d", n_len);
36870             printf("\n");
36871         }
36872     }
36873     }
36874     function_tests++;
36875
36876     return(test_ret);
36877 }
36878
36879
36880 static int
36881 test_xmlUTF8Strpos(void) {
36882     int test_ret = 0;
36883
36884     int mem_base;
36885     const xmlChar * ret_val;
36886     xmlChar * utf; /* the input UTF8 * */
36887     int n_utf;
36888     int pos; /* the position of the desired UTF8 char (in chars) */
36889     int n_pos;
36890
36891     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36892     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36893         mem_base = xmlMemBlocks();
36894         utf = gen_const_xmlChar_ptr(n_utf, 0);
36895         pos = gen_int(n_pos, 1);
36896
36897         ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36898         desret_const_xmlChar_ptr(ret_val);
36899         call_tests++;
36900         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36901         des_int(n_pos, pos, 1);
36902         xmlResetLastError();
36903         if (mem_base != xmlMemBlocks()) {
36904             printf("Leak of %d blocks found in xmlUTF8Strpos",
36905                    xmlMemBlocks() - mem_base);
36906             test_ret++;
36907             printf(" %d", n_utf);
36908             printf(" %d", n_pos);
36909             printf("\n");
36910         }
36911     }
36912     }
36913     function_tests++;
36914
36915     return(test_ret);
36916 }
36917
36918
36919 static int
36920 test_xmlUTF8Strsize(void) {
36921     int test_ret = 0;
36922
36923     int mem_base;
36924     int ret_val;
36925     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36926     int n_utf;
36927     int len; /* the number of characters in the array */
36928     int n_len;
36929
36930     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36931     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36932         mem_base = xmlMemBlocks();
36933         utf = gen_const_xmlChar_ptr(n_utf, 0);
36934         len = gen_int(n_len, 1);
36935
36936         ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36937         desret_int(ret_val);
36938         call_tests++;
36939         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36940         des_int(n_len, len, 1);
36941         xmlResetLastError();
36942         if (mem_base != xmlMemBlocks()) {
36943             printf("Leak of %d blocks found in xmlUTF8Strsize",
36944                    xmlMemBlocks() - mem_base);
36945             test_ret++;
36946             printf(" %d", n_utf);
36947             printf(" %d", n_len);
36948             printf("\n");
36949         }
36950     }
36951     }
36952     function_tests++;
36953
36954     return(test_ret);
36955 }
36956
36957
36958 static int
36959 test_xmlUTF8Strsub(void) {
36960     int test_ret = 0;
36961
36962     int mem_base;
36963     xmlChar * ret_val;
36964     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36965     int n_utf;
36966     int start; /* relative pos of first char */
36967     int n_start;
36968     int len; /* total number to copy */
36969     int n_len;
36970
36971     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36972     for (n_start = 0;n_start < gen_nb_int;n_start++) {
36973     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36974         mem_base = xmlMemBlocks();
36975         utf = gen_const_xmlChar_ptr(n_utf, 0);
36976         start = gen_int(n_start, 1);
36977         len = gen_int(n_len, 2);
36978
36979         ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36980         desret_xmlChar_ptr(ret_val);
36981         call_tests++;
36982         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36983         des_int(n_start, start, 1);
36984         des_int(n_len, len, 2);
36985         xmlResetLastError();
36986         if (mem_base != xmlMemBlocks()) {
36987             printf("Leak of %d blocks found in xmlUTF8Strsub",
36988                    xmlMemBlocks() - mem_base);
36989             test_ret++;
36990             printf(" %d", n_utf);
36991             printf(" %d", n_start);
36992             printf(" %d", n_len);
36993             printf("\n");
36994         }
36995     }
36996     }
36997     }
36998     function_tests++;
36999
37000     return(test_ret);
37001 }
37002
37003 static int
37004 test_xmlstring(void) {
37005     int test_ret = 0;
37006
37007     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37008     test_ret += test_xmlCharStrdup();
37009     test_ret += test_xmlCharStrndup();
37010     test_ret += test_xmlCheckUTF8();
37011     test_ret += test_xmlGetUTF8Char();
37012     test_ret += test_xmlStrEqual();
37013     test_ret += test_xmlStrPrintf();
37014     test_ret += test_xmlStrQEqual();
37015     test_ret += test_xmlStrVPrintf();
37016     test_ret += test_xmlStrcasecmp();
37017     test_ret += test_xmlStrcasestr();
37018     test_ret += test_xmlStrchr();
37019     test_ret += test_xmlStrcmp();
37020     test_ret += test_xmlStrdup();
37021     test_ret += test_xmlStrlen();
37022     test_ret += test_xmlStrncasecmp();
37023     test_ret += test_xmlStrncatNew();
37024     test_ret += test_xmlStrncmp();
37025     test_ret += test_xmlStrndup();
37026     test_ret += test_xmlStrstr();
37027     test_ret += test_xmlStrsub();
37028     test_ret += test_xmlUTF8Charcmp();
37029     test_ret += test_xmlUTF8Size();
37030     test_ret += test_xmlUTF8Strlen();
37031     test_ret += test_xmlUTF8Strloc();
37032     test_ret += test_xmlUTF8Strndup();
37033     test_ret += test_xmlUTF8Strpos();
37034     test_ret += test_xmlUTF8Strsize();
37035     test_ret += test_xmlUTF8Strsub();
37036
37037     if (test_ret != 0)
37038         printf("Module xmlstring: %d errors\n", test_ret);
37039     return(test_ret);
37040 }
37041
37042 static int
37043 test_xmlUCSIsAegeanNumbers(void) {
37044     int test_ret = 0;
37045
37046 #if defined(LIBXML_UNICODE_ENABLED)
37047     int mem_base;
37048     int ret_val;
37049     int code; /* UCS code point */
37050     int n_code;
37051
37052     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37053         mem_base = xmlMemBlocks();
37054         code = gen_int(n_code, 0);
37055
37056         ret_val = xmlUCSIsAegeanNumbers(code);
37057         desret_int(ret_val);
37058         call_tests++;
37059         des_int(n_code, code, 0);
37060         xmlResetLastError();
37061         if (mem_base != xmlMemBlocks()) {
37062             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37063                    xmlMemBlocks() - mem_base);
37064             test_ret++;
37065             printf(" %d", n_code);
37066             printf("\n");
37067         }
37068     }
37069     function_tests++;
37070 #endif
37071
37072     return(test_ret);
37073 }
37074
37075
37076 static int
37077 test_xmlUCSIsAlphabeticPresentationForms(void) {
37078     int test_ret = 0;
37079
37080 #if defined(LIBXML_UNICODE_ENABLED)
37081     int mem_base;
37082     int ret_val;
37083     int code; /* UCS code point */
37084     int n_code;
37085
37086     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37087         mem_base = xmlMemBlocks();
37088         code = gen_int(n_code, 0);
37089
37090         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37091         desret_int(ret_val);
37092         call_tests++;
37093         des_int(n_code, code, 0);
37094         xmlResetLastError();
37095         if (mem_base != xmlMemBlocks()) {
37096             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37097                    xmlMemBlocks() - mem_base);
37098             test_ret++;
37099             printf(" %d", n_code);
37100             printf("\n");
37101         }
37102     }
37103     function_tests++;
37104 #endif
37105
37106     return(test_ret);
37107 }
37108
37109
37110 static int
37111 test_xmlUCSIsArabic(void) {
37112     int test_ret = 0;
37113
37114 #if defined(LIBXML_UNICODE_ENABLED)
37115     int mem_base;
37116     int ret_val;
37117     int code; /* UCS code point */
37118     int n_code;
37119
37120     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37121         mem_base = xmlMemBlocks();
37122         code = gen_int(n_code, 0);
37123
37124         ret_val = xmlUCSIsArabic(code);
37125         desret_int(ret_val);
37126         call_tests++;
37127         des_int(n_code, code, 0);
37128         xmlResetLastError();
37129         if (mem_base != xmlMemBlocks()) {
37130             printf("Leak of %d blocks found in xmlUCSIsArabic",
37131                    xmlMemBlocks() - mem_base);
37132             test_ret++;
37133             printf(" %d", n_code);
37134             printf("\n");
37135         }
37136     }
37137     function_tests++;
37138 #endif
37139
37140     return(test_ret);
37141 }
37142
37143
37144 static int
37145 test_xmlUCSIsArabicPresentationFormsA(void) {
37146     int test_ret = 0;
37147
37148 #if defined(LIBXML_UNICODE_ENABLED)
37149     int mem_base;
37150     int ret_val;
37151     int code; /* UCS code point */
37152     int n_code;
37153
37154     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37155         mem_base = xmlMemBlocks();
37156         code = gen_int(n_code, 0);
37157
37158         ret_val = xmlUCSIsArabicPresentationFormsA(code);
37159         desret_int(ret_val);
37160         call_tests++;
37161         des_int(n_code, code, 0);
37162         xmlResetLastError();
37163         if (mem_base != xmlMemBlocks()) {
37164             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37165                    xmlMemBlocks() - mem_base);
37166             test_ret++;
37167             printf(" %d", n_code);
37168             printf("\n");
37169         }
37170     }
37171     function_tests++;
37172 #endif
37173
37174     return(test_ret);
37175 }
37176
37177
37178 static int
37179 test_xmlUCSIsArabicPresentationFormsB(void) {
37180     int test_ret = 0;
37181
37182 #if defined(LIBXML_UNICODE_ENABLED)
37183     int mem_base;
37184     int ret_val;
37185     int code; /* UCS code point */
37186     int n_code;
37187
37188     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37189         mem_base = xmlMemBlocks();
37190         code = gen_int(n_code, 0);
37191
37192         ret_val = xmlUCSIsArabicPresentationFormsB(code);
37193         desret_int(ret_val);
37194         call_tests++;
37195         des_int(n_code, code, 0);
37196         xmlResetLastError();
37197         if (mem_base != xmlMemBlocks()) {
37198             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37199                    xmlMemBlocks() - mem_base);
37200             test_ret++;
37201             printf(" %d", n_code);
37202             printf("\n");
37203         }
37204     }
37205     function_tests++;
37206 #endif
37207
37208     return(test_ret);
37209 }
37210
37211
37212 static int
37213 test_xmlUCSIsArmenian(void) {
37214     int test_ret = 0;
37215
37216 #if defined(LIBXML_UNICODE_ENABLED)
37217     int mem_base;
37218     int ret_val;
37219     int code; /* UCS code point */
37220     int n_code;
37221
37222     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37223         mem_base = xmlMemBlocks();
37224         code = gen_int(n_code, 0);
37225
37226         ret_val = xmlUCSIsArmenian(code);
37227         desret_int(ret_val);
37228         call_tests++;
37229         des_int(n_code, code, 0);
37230         xmlResetLastError();
37231         if (mem_base != xmlMemBlocks()) {
37232             printf("Leak of %d blocks found in xmlUCSIsArmenian",
37233                    xmlMemBlocks() - mem_base);
37234             test_ret++;
37235             printf(" %d", n_code);
37236             printf("\n");
37237         }
37238     }
37239     function_tests++;
37240 #endif
37241
37242     return(test_ret);
37243 }
37244
37245
37246 static int
37247 test_xmlUCSIsArrows(void) {
37248     int test_ret = 0;
37249
37250 #if defined(LIBXML_UNICODE_ENABLED)
37251     int mem_base;
37252     int ret_val;
37253     int code; /* UCS code point */
37254     int n_code;
37255
37256     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37257         mem_base = xmlMemBlocks();
37258         code = gen_int(n_code, 0);
37259
37260         ret_val = xmlUCSIsArrows(code);
37261         desret_int(ret_val);
37262         call_tests++;
37263         des_int(n_code, code, 0);
37264         xmlResetLastError();
37265         if (mem_base != xmlMemBlocks()) {
37266             printf("Leak of %d blocks found in xmlUCSIsArrows",
37267                    xmlMemBlocks() - mem_base);
37268             test_ret++;
37269             printf(" %d", n_code);
37270             printf("\n");
37271         }
37272     }
37273     function_tests++;
37274 #endif
37275
37276     return(test_ret);
37277 }
37278
37279
37280 static int
37281 test_xmlUCSIsBasicLatin(void) {
37282     int test_ret = 0;
37283
37284 #if defined(LIBXML_UNICODE_ENABLED)
37285     int mem_base;
37286     int ret_val;
37287     int code; /* UCS code point */
37288     int n_code;
37289
37290     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37291         mem_base = xmlMemBlocks();
37292         code = gen_int(n_code, 0);
37293
37294         ret_val = xmlUCSIsBasicLatin(code);
37295         desret_int(ret_val);
37296         call_tests++;
37297         des_int(n_code, code, 0);
37298         xmlResetLastError();
37299         if (mem_base != xmlMemBlocks()) {
37300             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37301                    xmlMemBlocks() - mem_base);
37302             test_ret++;
37303             printf(" %d", n_code);
37304             printf("\n");
37305         }
37306     }
37307     function_tests++;
37308 #endif
37309
37310     return(test_ret);
37311 }
37312
37313
37314 static int
37315 test_xmlUCSIsBengali(void) {
37316     int test_ret = 0;
37317
37318 #if defined(LIBXML_UNICODE_ENABLED)
37319     int mem_base;
37320     int ret_val;
37321     int code; /* UCS code point */
37322     int n_code;
37323
37324     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37325         mem_base = xmlMemBlocks();
37326         code = gen_int(n_code, 0);
37327
37328         ret_val = xmlUCSIsBengali(code);
37329         desret_int(ret_val);
37330         call_tests++;
37331         des_int(n_code, code, 0);
37332         xmlResetLastError();
37333         if (mem_base != xmlMemBlocks()) {
37334             printf("Leak of %d blocks found in xmlUCSIsBengali",
37335                    xmlMemBlocks() - mem_base);
37336             test_ret++;
37337             printf(" %d", n_code);
37338             printf("\n");
37339         }
37340     }
37341     function_tests++;
37342 #endif
37343
37344     return(test_ret);
37345 }
37346
37347
37348 static int
37349 test_xmlUCSIsBlock(void) {
37350     int test_ret = 0;
37351
37352 #if defined(LIBXML_UNICODE_ENABLED)
37353     int mem_base;
37354     int ret_val;
37355     int code; /* UCS code point */
37356     int n_code;
37357     char * block; /* UCS block name */
37358     int n_block;
37359
37360     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37361     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37362         mem_base = xmlMemBlocks();
37363         code = gen_int(n_code, 0);
37364         block = gen_const_char_ptr(n_block, 1);
37365
37366         ret_val = xmlUCSIsBlock(code, (const char *)block);
37367         desret_int(ret_val);
37368         call_tests++;
37369         des_int(n_code, code, 0);
37370         des_const_char_ptr(n_block, (const char *)block, 1);
37371         xmlResetLastError();
37372         if (mem_base != xmlMemBlocks()) {
37373             printf("Leak of %d blocks found in xmlUCSIsBlock",
37374                    xmlMemBlocks() - mem_base);
37375             test_ret++;
37376             printf(" %d", n_code);
37377             printf(" %d", n_block);
37378             printf("\n");
37379         }
37380     }
37381     }
37382     function_tests++;
37383 #endif
37384
37385     return(test_ret);
37386 }
37387
37388
37389 static int
37390 test_xmlUCSIsBlockElements(void) {
37391     int test_ret = 0;
37392
37393 #if defined(LIBXML_UNICODE_ENABLED)
37394     int mem_base;
37395     int ret_val;
37396     int code; /* UCS code point */
37397     int n_code;
37398
37399     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37400         mem_base = xmlMemBlocks();
37401         code = gen_int(n_code, 0);
37402
37403         ret_val = xmlUCSIsBlockElements(code);
37404         desret_int(ret_val);
37405         call_tests++;
37406         des_int(n_code, code, 0);
37407         xmlResetLastError();
37408         if (mem_base != xmlMemBlocks()) {
37409             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37410                    xmlMemBlocks() - mem_base);
37411             test_ret++;
37412             printf(" %d", n_code);
37413             printf("\n");
37414         }
37415     }
37416     function_tests++;
37417 #endif
37418
37419     return(test_ret);
37420 }
37421
37422
37423 static int
37424 test_xmlUCSIsBopomofo(void) {
37425     int test_ret = 0;
37426
37427 #if defined(LIBXML_UNICODE_ENABLED)
37428     int mem_base;
37429     int ret_val;
37430     int code; /* UCS code point */
37431     int n_code;
37432
37433     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37434         mem_base = xmlMemBlocks();
37435         code = gen_int(n_code, 0);
37436
37437         ret_val = xmlUCSIsBopomofo(code);
37438         desret_int(ret_val);
37439         call_tests++;
37440         des_int(n_code, code, 0);
37441         xmlResetLastError();
37442         if (mem_base != xmlMemBlocks()) {
37443             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37444                    xmlMemBlocks() - mem_base);
37445             test_ret++;
37446             printf(" %d", n_code);
37447             printf("\n");
37448         }
37449     }
37450     function_tests++;
37451 #endif
37452
37453     return(test_ret);
37454 }
37455
37456
37457 static int
37458 test_xmlUCSIsBopomofoExtended(void) {
37459     int test_ret = 0;
37460
37461 #if defined(LIBXML_UNICODE_ENABLED)
37462     int mem_base;
37463     int ret_val;
37464     int code; /* UCS code point */
37465     int n_code;
37466
37467     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37468         mem_base = xmlMemBlocks();
37469         code = gen_int(n_code, 0);
37470
37471         ret_val = xmlUCSIsBopomofoExtended(code);
37472         desret_int(ret_val);
37473         call_tests++;
37474         des_int(n_code, code, 0);
37475         xmlResetLastError();
37476         if (mem_base != xmlMemBlocks()) {
37477             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37478                    xmlMemBlocks() - mem_base);
37479             test_ret++;
37480             printf(" %d", n_code);
37481             printf("\n");
37482         }
37483     }
37484     function_tests++;
37485 #endif
37486
37487     return(test_ret);
37488 }
37489
37490
37491 static int
37492 test_xmlUCSIsBoxDrawing(void) {
37493     int test_ret = 0;
37494
37495 #if defined(LIBXML_UNICODE_ENABLED)
37496     int mem_base;
37497     int ret_val;
37498     int code; /* UCS code point */
37499     int n_code;
37500
37501     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37502         mem_base = xmlMemBlocks();
37503         code = gen_int(n_code, 0);
37504
37505         ret_val = xmlUCSIsBoxDrawing(code);
37506         desret_int(ret_val);
37507         call_tests++;
37508         des_int(n_code, code, 0);
37509         xmlResetLastError();
37510         if (mem_base != xmlMemBlocks()) {
37511             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37512                    xmlMemBlocks() - mem_base);
37513             test_ret++;
37514             printf(" %d", n_code);
37515             printf("\n");
37516         }
37517     }
37518     function_tests++;
37519 #endif
37520
37521     return(test_ret);
37522 }
37523
37524
37525 static int
37526 test_xmlUCSIsBraillePatterns(void) {
37527     int test_ret = 0;
37528
37529 #if defined(LIBXML_UNICODE_ENABLED)
37530     int mem_base;
37531     int ret_val;
37532     int code; /* UCS code point */
37533     int n_code;
37534
37535     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37536         mem_base = xmlMemBlocks();
37537         code = gen_int(n_code, 0);
37538
37539         ret_val = xmlUCSIsBraillePatterns(code);
37540         desret_int(ret_val);
37541         call_tests++;
37542         des_int(n_code, code, 0);
37543         xmlResetLastError();
37544         if (mem_base != xmlMemBlocks()) {
37545             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37546                    xmlMemBlocks() - mem_base);
37547             test_ret++;
37548             printf(" %d", n_code);
37549             printf("\n");
37550         }
37551     }
37552     function_tests++;
37553 #endif
37554
37555     return(test_ret);
37556 }
37557
37558
37559 static int
37560 test_xmlUCSIsBuhid(void) {
37561     int test_ret = 0;
37562
37563 #if defined(LIBXML_UNICODE_ENABLED)
37564     int mem_base;
37565     int ret_val;
37566     int code; /* UCS code point */
37567     int n_code;
37568
37569     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37570         mem_base = xmlMemBlocks();
37571         code = gen_int(n_code, 0);
37572
37573         ret_val = xmlUCSIsBuhid(code);
37574         desret_int(ret_val);
37575         call_tests++;
37576         des_int(n_code, code, 0);
37577         xmlResetLastError();
37578         if (mem_base != xmlMemBlocks()) {
37579             printf("Leak of %d blocks found in xmlUCSIsBuhid",
37580                    xmlMemBlocks() - mem_base);
37581             test_ret++;
37582             printf(" %d", n_code);
37583             printf("\n");
37584         }
37585     }
37586     function_tests++;
37587 #endif
37588
37589     return(test_ret);
37590 }
37591
37592
37593 static int
37594 test_xmlUCSIsByzantineMusicalSymbols(void) {
37595     int test_ret = 0;
37596
37597 #if defined(LIBXML_UNICODE_ENABLED)
37598     int mem_base;
37599     int ret_val;
37600     int code; /* UCS code point */
37601     int n_code;
37602
37603     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37604         mem_base = xmlMemBlocks();
37605         code = gen_int(n_code, 0);
37606
37607         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37608         desret_int(ret_val);
37609         call_tests++;
37610         des_int(n_code, code, 0);
37611         xmlResetLastError();
37612         if (mem_base != xmlMemBlocks()) {
37613             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37614                    xmlMemBlocks() - mem_base);
37615             test_ret++;
37616             printf(" %d", n_code);
37617             printf("\n");
37618         }
37619     }
37620     function_tests++;
37621 #endif
37622
37623     return(test_ret);
37624 }
37625
37626
37627 static int
37628 test_xmlUCSIsCJKCompatibility(void) {
37629     int test_ret = 0;
37630
37631 #if defined(LIBXML_UNICODE_ENABLED)
37632     int mem_base;
37633     int ret_val;
37634     int code; /* UCS code point */
37635     int n_code;
37636
37637     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37638         mem_base = xmlMemBlocks();
37639         code = gen_int(n_code, 0);
37640
37641         ret_val = xmlUCSIsCJKCompatibility(code);
37642         desret_int(ret_val);
37643         call_tests++;
37644         des_int(n_code, code, 0);
37645         xmlResetLastError();
37646         if (mem_base != xmlMemBlocks()) {
37647             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37648                    xmlMemBlocks() - mem_base);
37649             test_ret++;
37650             printf(" %d", n_code);
37651             printf("\n");
37652         }
37653     }
37654     function_tests++;
37655 #endif
37656
37657     return(test_ret);
37658 }
37659
37660
37661 static int
37662 test_xmlUCSIsCJKCompatibilityForms(void) {
37663     int test_ret = 0;
37664
37665 #if defined(LIBXML_UNICODE_ENABLED)
37666     int mem_base;
37667     int ret_val;
37668     int code; /* UCS code point */
37669     int n_code;
37670
37671     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37672         mem_base = xmlMemBlocks();
37673         code = gen_int(n_code, 0);
37674
37675         ret_val = xmlUCSIsCJKCompatibilityForms(code);
37676         desret_int(ret_val);
37677         call_tests++;
37678         des_int(n_code, code, 0);
37679         xmlResetLastError();
37680         if (mem_base != xmlMemBlocks()) {
37681             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37682                    xmlMemBlocks() - mem_base);
37683             test_ret++;
37684             printf(" %d", n_code);
37685             printf("\n");
37686         }
37687     }
37688     function_tests++;
37689 #endif
37690
37691     return(test_ret);
37692 }
37693
37694
37695 static int
37696 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37697     int test_ret = 0;
37698
37699 #if defined(LIBXML_UNICODE_ENABLED)
37700     int mem_base;
37701     int ret_val;
37702     int code; /* UCS code point */
37703     int n_code;
37704
37705     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37706         mem_base = xmlMemBlocks();
37707         code = gen_int(n_code, 0);
37708
37709         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37710         desret_int(ret_val);
37711         call_tests++;
37712         des_int(n_code, code, 0);
37713         xmlResetLastError();
37714         if (mem_base != xmlMemBlocks()) {
37715             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37716                    xmlMemBlocks() - mem_base);
37717             test_ret++;
37718             printf(" %d", n_code);
37719             printf("\n");
37720         }
37721     }
37722     function_tests++;
37723 #endif
37724
37725     return(test_ret);
37726 }
37727
37728
37729 static int
37730 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37731     int test_ret = 0;
37732
37733 #if defined(LIBXML_UNICODE_ENABLED)
37734     int mem_base;
37735     int ret_val;
37736     int code; /* UCS code point */
37737     int n_code;
37738
37739     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37740         mem_base = xmlMemBlocks();
37741         code = gen_int(n_code, 0);
37742
37743         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37744         desret_int(ret_val);
37745         call_tests++;
37746         des_int(n_code, code, 0);
37747         xmlResetLastError();
37748         if (mem_base != xmlMemBlocks()) {
37749             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37750                    xmlMemBlocks() - mem_base);
37751             test_ret++;
37752             printf(" %d", n_code);
37753             printf("\n");
37754         }
37755     }
37756     function_tests++;
37757 #endif
37758
37759     return(test_ret);
37760 }
37761
37762
37763 static int
37764 test_xmlUCSIsCJKRadicalsSupplement(void) {
37765     int test_ret = 0;
37766
37767 #if defined(LIBXML_UNICODE_ENABLED)
37768     int mem_base;
37769     int ret_val;
37770     int code; /* UCS code point */
37771     int n_code;
37772
37773     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37774         mem_base = xmlMemBlocks();
37775         code = gen_int(n_code, 0);
37776
37777         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37778         desret_int(ret_val);
37779         call_tests++;
37780         des_int(n_code, code, 0);
37781         xmlResetLastError();
37782         if (mem_base != xmlMemBlocks()) {
37783             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37784                    xmlMemBlocks() - mem_base);
37785             test_ret++;
37786             printf(" %d", n_code);
37787             printf("\n");
37788         }
37789     }
37790     function_tests++;
37791 #endif
37792
37793     return(test_ret);
37794 }
37795
37796
37797 static int
37798 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37799     int test_ret = 0;
37800
37801 #if defined(LIBXML_UNICODE_ENABLED)
37802     int mem_base;
37803     int ret_val;
37804     int code; /* UCS code point */
37805     int n_code;
37806
37807     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37808         mem_base = xmlMemBlocks();
37809         code = gen_int(n_code, 0);
37810
37811         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37812         desret_int(ret_val);
37813         call_tests++;
37814         des_int(n_code, code, 0);
37815         xmlResetLastError();
37816         if (mem_base != xmlMemBlocks()) {
37817             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37818                    xmlMemBlocks() - mem_base);
37819             test_ret++;
37820             printf(" %d", n_code);
37821             printf("\n");
37822         }
37823     }
37824     function_tests++;
37825 #endif
37826
37827     return(test_ret);
37828 }
37829
37830
37831 static int
37832 test_xmlUCSIsCJKUnifiedIdeographs(void) {
37833     int test_ret = 0;
37834
37835 #if defined(LIBXML_UNICODE_ENABLED)
37836     int mem_base;
37837     int ret_val;
37838     int code; /* UCS code point */
37839     int n_code;
37840
37841     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37842         mem_base = xmlMemBlocks();
37843         code = gen_int(n_code, 0);
37844
37845         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37846         desret_int(ret_val);
37847         call_tests++;
37848         des_int(n_code, code, 0);
37849         xmlResetLastError();
37850         if (mem_base != xmlMemBlocks()) {
37851             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37852                    xmlMemBlocks() - mem_base);
37853             test_ret++;
37854             printf(" %d", n_code);
37855             printf("\n");
37856         }
37857     }
37858     function_tests++;
37859 #endif
37860
37861     return(test_ret);
37862 }
37863
37864
37865 static int
37866 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37867     int test_ret = 0;
37868
37869 #if defined(LIBXML_UNICODE_ENABLED)
37870     int mem_base;
37871     int ret_val;
37872     int code; /* UCS code point */
37873     int n_code;
37874
37875     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37876         mem_base = xmlMemBlocks();
37877         code = gen_int(n_code, 0);
37878
37879         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37880         desret_int(ret_val);
37881         call_tests++;
37882         des_int(n_code, code, 0);
37883         xmlResetLastError();
37884         if (mem_base != xmlMemBlocks()) {
37885             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37886                    xmlMemBlocks() - mem_base);
37887             test_ret++;
37888             printf(" %d", n_code);
37889             printf("\n");
37890         }
37891     }
37892     function_tests++;
37893 #endif
37894
37895     return(test_ret);
37896 }
37897
37898
37899 static int
37900 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37901     int test_ret = 0;
37902
37903 #if defined(LIBXML_UNICODE_ENABLED)
37904     int mem_base;
37905     int ret_val;
37906     int code; /* UCS code point */
37907     int n_code;
37908
37909     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37910         mem_base = xmlMemBlocks();
37911         code = gen_int(n_code, 0);
37912
37913         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37914         desret_int(ret_val);
37915         call_tests++;
37916         des_int(n_code, code, 0);
37917         xmlResetLastError();
37918         if (mem_base != xmlMemBlocks()) {
37919             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37920                    xmlMemBlocks() - mem_base);
37921             test_ret++;
37922             printf(" %d", n_code);
37923             printf("\n");
37924         }
37925     }
37926     function_tests++;
37927 #endif
37928
37929     return(test_ret);
37930 }
37931
37932
37933 static int
37934 test_xmlUCSIsCat(void) {
37935     int test_ret = 0;
37936
37937 #if defined(LIBXML_UNICODE_ENABLED)
37938     int mem_base;
37939     int ret_val;
37940     int code; /* UCS code point */
37941     int n_code;
37942     char * cat; /* UCS Category name */
37943     int n_cat;
37944
37945     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37946     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37947         mem_base = xmlMemBlocks();
37948         code = gen_int(n_code, 0);
37949         cat = gen_const_char_ptr(n_cat, 1);
37950
37951         ret_val = xmlUCSIsCat(code, (const char *)cat);
37952         desret_int(ret_val);
37953         call_tests++;
37954         des_int(n_code, code, 0);
37955         des_const_char_ptr(n_cat, (const char *)cat, 1);
37956         xmlResetLastError();
37957         if (mem_base != xmlMemBlocks()) {
37958             printf("Leak of %d blocks found in xmlUCSIsCat",
37959                    xmlMemBlocks() - mem_base);
37960             test_ret++;
37961             printf(" %d", n_code);
37962             printf(" %d", n_cat);
37963             printf("\n");
37964         }
37965     }
37966     }
37967     function_tests++;
37968 #endif
37969
37970     return(test_ret);
37971 }
37972
37973
37974 static int
37975 test_xmlUCSIsCatC(void) {
37976     int test_ret = 0;
37977
37978 #if defined(LIBXML_UNICODE_ENABLED)
37979     int mem_base;
37980     int ret_val;
37981     int code; /* UCS code point */
37982     int n_code;
37983
37984     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37985         mem_base = xmlMemBlocks();
37986         code = gen_int(n_code, 0);
37987
37988         ret_val = xmlUCSIsCatC(code);
37989         desret_int(ret_val);
37990         call_tests++;
37991         des_int(n_code, code, 0);
37992         xmlResetLastError();
37993         if (mem_base != xmlMemBlocks()) {
37994             printf("Leak of %d blocks found in xmlUCSIsCatC",
37995                    xmlMemBlocks() - mem_base);
37996             test_ret++;
37997             printf(" %d", n_code);
37998             printf("\n");
37999         }
38000     }
38001     function_tests++;
38002 #endif
38003
38004     return(test_ret);
38005 }
38006
38007
38008 static int
38009 test_xmlUCSIsCatCc(void) {
38010     int test_ret = 0;
38011
38012 #if defined(LIBXML_UNICODE_ENABLED)
38013     int mem_base;
38014     int ret_val;
38015     int code; /* UCS code point */
38016     int n_code;
38017
38018     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38019         mem_base = xmlMemBlocks();
38020         code = gen_int(n_code, 0);
38021
38022         ret_val = xmlUCSIsCatCc(code);
38023         desret_int(ret_val);
38024         call_tests++;
38025         des_int(n_code, code, 0);
38026         xmlResetLastError();
38027         if (mem_base != xmlMemBlocks()) {
38028             printf("Leak of %d blocks found in xmlUCSIsCatCc",
38029                    xmlMemBlocks() - mem_base);
38030             test_ret++;
38031             printf(" %d", n_code);
38032             printf("\n");
38033         }
38034     }
38035     function_tests++;
38036 #endif
38037
38038     return(test_ret);
38039 }
38040
38041
38042 static int
38043 test_xmlUCSIsCatCf(void) {
38044     int test_ret = 0;
38045
38046 #if defined(LIBXML_UNICODE_ENABLED)
38047     int mem_base;
38048     int ret_val;
38049     int code; /* UCS code point */
38050     int n_code;
38051
38052     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38053         mem_base = xmlMemBlocks();
38054         code = gen_int(n_code, 0);
38055
38056         ret_val = xmlUCSIsCatCf(code);
38057         desret_int(ret_val);
38058         call_tests++;
38059         des_int(n_code, code, 0);
38060         xmlResetLastError();
38061         if (mem_base != xmlMemBlocks()) {
38062             printf("Leak of %d blocks found in xmlUCSIsCatCf",
38063                    xmlMemBlocks() - mem_base);
38064             test_ret++;
38065             printf(" %d", n_code);
38066             printf("\n");
38067         }
38068     }
38069     function_tests++;
38070 #endif
38071
38072     return(test_ret);
38073 }
38074
38075
38076 static int
38077 test_xmlUCSIsCatCo(void) {
38078     int test_ret = 0;
38079
38080 #if defined(LIBXML_UNICODE_ENABLED)
38081     int mem_base;
38082     int ret_val;
38083     int code; /* UCS code point */
38084     int n_code;
38085
38086     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38087         mem_base = xmlMemBlocks();
38088         code = gen_int(n_code, 0);
38089
38090         ret_val = xmlUCSIsCatCo(code);
38091         desret_int(ret_val);
38092         call_tests++;
38093         des_int(n_code, code, 0);
38094         xmlResetLastError();
38095         if (mem_base != xmlMemBlocks()) {
38096             printf("Leak of %d blocks found in xmlUCSIsCatCo",
38097                    xmlMemBlocks() - mem_base);
38098             test_ret++;
38099             printf(" %d", n_code);
38100             printf("\n");
38101         }
38102     }
38103     function_tests++;
38104 #endif
38105
38106     return(test_ret);
38107 }
38108
38109
38110 static int
38111 test_xmlUCSIsCatCs(void) {
38112     int test_ret = 0;
38113
38114 #if defined(LIBXML_UNICODE_ENABLED)
38115     int mem_base;
38116     int ret_val;
38117     int code; /* UCS code point */
38118     int n_code;
38119
38120     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38121         mem_base = xmlMemBlocks();
38122         code = gen_int(n_code, 0);
38123
38124         ret_val = xmlUCSIsCatCs(code);
38125         desret_int(ret_val);
38126         call_tests++;
38127         des_int(n_code, code, 0);
38128         xmlResetLastError();
38129         if (mem_base != xmlMemBlocks()) {
38130             printf("Leak of %d blocks found in xmlUCSIsCatCs",
38131                    xmlMemBlocks() - mem_base);
38132             test_ret++;
38133             printf(" %d", n_code);
38134             printf("\n");
38135         }
38136     }
38137     function_tests++;
38138 #endif
38139
38140     return(test_ret);
38141 }
38142
38143
38144 static int
38145 test_xmlUCSIsCatL(void) {
38146     int test_ret = 0;
38147
38148 #if defined(LIBXML_UNICODE_ENABLED)
38149     int mem_base;
38150     int ret_val;
38151     int code; /* UCS code point */
38152     int n_code;
38153
38154     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38155         mem_base = xmlMemBlocks();
38156         code = gen_int(n_code, 0);
38157
38158         ret_val = xmlUCSIsCatL(code);
38159         desret_int(ret_val);
38160         call_tests++;
38161         des_int(n_code, code, 0);
38162         xmlResetLastError();
38163         if (mem_base != xmlMemBlocks()) {
38164             printf("Leak of %d blocks found in xmlUCSIsCatL",
38165                    xmlMemBlocks() - mem_base);
38166             test_ret++;
38167             printf(" %d", n_code);
38168             printf("\n");
38169         }
38170     }
38171     function_tests++;
38172 #endif
38173
38174     return(test_ret);
38175 }
38176
38177
38178 static int
38179 test_xmlUCSIsCatLl(void) {
38180     int test_ret = 0;
38181
38182 #if defined(LIBXML_UNICODE_ENABLED)
38183     int mem_base;
38184     int ret_val;
38185     int code; /* UCS code point */
38186     int n_code;
38187
38188     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38189         mem_base = xmlMemBlocks();
38190         code = gen_int(n_code, 0);
38191
38192         ret_val = xmlUCSIsCatLl(code);
38193         desret_int(ret_val);
38194         call_tests++;
38195         des_int(n_code, code, 0);
38196         xmlResetLastError();
38197         if (mem_base != xmlMemBlocks()) {
38198             printf("Leak of %d blocks found in xmlUCSIsCatLl",
38199                    xmlMemBlocks() - mem_base);
38200             test_ret++;
38201             printf(" %d", n_code);
38202             printf("\n");
38203         }
38204     }
38205     function_tests++;
38206 #endif
38207
38208     return(test_ret);
38209 }
38210
38211
38212 static int
38213 test_xmlUCSIsCatLm(void) {
38214     int test_ret = 0;
38215
38216 #if defined(LIBXML_UNICODE_ENABLED)
38217     int mem_base;
38218     int ret_val;
38219     int code; /* UCS code point */
38220     int n_code;
38221
38222     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38223         mem_base = xmlMemBlocks();
38224         code = gen_int(n_code, 0);
38225
38226         ret_val = xmlUCSIsCatLm(code);
38227         desret_int(ret_val);
38228         call_tests++;
38229         des_int(n_code, code, 0);
38230         xmlResetLastError();
38231         if (mem_base != xmlMemBlocks()) {
38232             printf("Leak of %d blocks found in xmlUCSIsCatLm",
38233                    xmlMemBlocks() - mem_base);
38234             test_ret++;
38235             printf(" %d", n_code);
38236             printf("\n");
38237         }
38238     }
38239     function_tests++;
38240 #endif
38241
38242     return(test_ret);
38243 }
38244
38245
38246 static int
38247 test_xmlUCSIsCatLo(void) {
38248     int test_ret = 0;
38249
38250 #if defined(LIBXML_UNICODE_ENABLED)
38251     int mem_base;
38252     int ret_val;
38253     int code; /* UCS code point */
38254     int n_code;
38255
38256     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38257         mem_base = xmlMemBlocks();
38258         code = gen_int(n_code, 0);
38259
38260         ret_val = xmlUCSIsCatLo(code);
38261         desret_int(ret_val);
38262         call_tests++;
38263         des_int(n_code, code, 0);
38264         xmlResetLastError();
38265         if (mem_base != xmlMemBlocks()) {
38266             printf("Leak of %d blocks found in xmlUCSIsCatLo",
38267                    xmlMemBlocks() - mem_base);
38268             test_ret++;
38269             printf(" %d", n_code);
38270             printf("\n");
38271         }
38272     }
38273     function_tests++;
38274 #endif
38275
38276     return(test_ret);
38277 }
38278
38279
38280 static int
38281 test_xmlUCSIsCatLt(void) {
38282     int test_ret = 0;
38283
38284 #if defined(LIBXML_UNICODE_ENABLED)
38285     int mem_base;
38286     int ret_val;
38287     int code; /* UCS code point */
38288     int n_code;
38289
38290     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38291         mem_base = xmlMemBlocks();
38292         code = gen_int(n_code, 0);
38293
38294         ret_val = xmlUCSIsCatLt(code);
38295         desret_int(ret_val);
38296         call_tests++;
38297         des_int(n_code, code, 0);
38298         xmlResetLastError();
38299         if (mem_base != xmlMemBlocks()) {
38300             printf("Leak of %d blocks found in xmlUCSIsCatLt",
38301                    xmlMemBlocks() - mem_base);
38302             test_ret++;
38303             printf(" %d", n_code);
38304             printf("\n");
38305         }
38306     }
38307     function_tests++;
38308 #endif
38309
38310     return(test_ret);
38311 }
38312
38313
38314 static int
38315 test_xmlUCSIsCatLu(void) {
38316     int test_ret = 0;
38317
38318 #if defined(LIBXML_UNICODE_ENABLED)
38319     int mem_base;
38320     int ret_val;
38321     int code; /* UCS code point */
38322     int n_code;
38323
38324     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38325         mem_base = xmlMemBlocks();
38326         code = gen_int(n_code, 0);
38327
38328         ret_val = xmlUCSIsCatLu(code);
38329         desret_int(ret_val);
38330         call_tests++;
38331         des_int(n_code, code, 0);
38332         xmlResetLastError();
38333         if (mem_base != xmlMemBlocks()) {
38334             printf("Leak of %d blocks found in xmlUCSIsCatLu",
38335                    xmlMemBlocks() - mem_base);
38336             test_ret++;
38337             printf(" %d", n_code);
38338             printf("\n");
38339         }
38340     }
38341     function_tests++;
38342 #endif
38343
38344     return(test_ret);
38345 }
38346
38347
38348 static int
38349 test_xmlUCSIsCatM(void) {
38350     int test_ret = 0;
38351
38352 #if defined(LIBXML_UNICODE_ENABLED)
38353     int mem_base;
38354     int ret_val;
38355     int code; /* UCS code point */
38356     int n_code;
38357
38358     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38359         mem_base = xmlMemBlocks();
38360         code = gen_int(n_code, 0);
38361
38362         ret_val = xmlUCSIsCatM(code);
38363         desret_int(ret_val);
38364         call_tests++;
38365         des_int(n_code, code, 0);
38366         xmlResetLastError();
38367         if (mem_base != xmlMemBlocks()) {
38368             printf("Leak of %d blocks found in xmlUCSIsCatM",
38369                    xmlMemBlocks() - mem_base);
38370             test_ret++;
38371             printf(" %d", n_code);
38372             printf("\n");
38373         }
38374     }
38375     function_tests++;
38376 #endif
38377
38378     return(test_ret);
38379 }
38380
38381
38382 static int
38383 test_xmlUCSIsCatMc(void) {
38384     int test_ret = 0;
38385
38386 #if defined(LIBXML_UNICODE_ENABLED)
38387     int mem_base;
38388     int ret_val;
38389     int code; /* UCS code point */
38390     int n_code;
38391
38392     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38393         mem_base = xmlMemBlocks();
38394         code = gen_int(n_code, 0);
38395
38396         ret_val = xmlUCSIsCatMc(code);
38397         desret_int(ret_val);
38398         call_tests++;
38399         des_int(n_code, code, 0);
38400         xmlResetLastError();
38401         if (mem_base != xmlMemBlocks()) {
38402             printf("Leak of %d blocks found in xmlUCSIsCatMc",
38403                    xmlMemBlocks() - mem_base);
38404             test_ret++;
38405             printf(" %d", n_code);
38406             printf("\n");
38407         }
38408     }
38409     function_tests++;
38410 #endif
38411
38412     return(test_ret);
38413 }
38414
38415
38416 static int
38417 test_xmlUCSIsCatMe(void) {
38418     int test_ret = 0;
38419
38420 #if defined(LIBXML_UNICODE_ENABLED)
38421     int mem_base;
38422     int ret_val;
38423     int code; /* UCS code point */
38424     int n_code;
38425
38426     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38427         mem_base = xmlMemBlocks();
38428         code = gen_int(n_code, 0);
38429
38430         ret_val = xmlUCSIsCatMe(code);
38431         desret_int(ret_val);
38432         call_tests++;
38433         des_int(n_code, code, 0);
38434         xmlResetLastError();
38435         if (mem_base != xmlMemBlocks()) {
38436             printf("Leak of %d blocks found in xmlUCSIsCatMe",
38437                    xmlMemBlocks() - mem_base);
38438             test_ret++;
38439             printf(" %d", n_code);
38440             printf("\n");
38441         }
38442     }
38443     function_tests++;
38444 #endif
38445
38446     return(test_ret);
38447 }
38448
38449
38450 static int
38451 test_xmlUCSIsCatMn(void) {
38452     int test_ret = 0;
38453
38454 #if defined(LIBXML_UNICODE_ENABLED)
38455     int mem_base;
38456     int ret_val;
38457     int code; /* UCS code point */
38458     int n_code;
38459
38460     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38461         mem_base = xmlMemBlocks();
38462         code = gen_int(n_code, 0);
38463
38464         ret_val = xmlUCSIsCatMn(code);
38465         desret_int(ret_val);
38466         call_tests++;
38467         des_int(n_code, code, 0);
38468         xmlResetLastError();
38469         if (mem_base != xmlMemBlocks()) {
38470             printf("Leak of %d blocks found in xmlUCSIsCatMn",
38471                    xmlMemBlocks() - mem_base);
38472             test_ret++;
38473             printf(" %d", n_code);
38474             printf("\n");
38475         }
38476     }
38477     function_tests++;
38478 #endif
38479
38480     return(test_ret);
38481 }
38482
38483
38484 static int
38485 test_xmlUCSIsCatN(void) {
38486     int test_ret = 0;
38487
38488 #if defined(LIBXML_UNICODE_ENABLED)
38489     int mem_base;
38490     int ret_val;
38491     int code; /* UCS code point */
38492     int n_code;
38493
38494     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38495         mem_base = xmlMemBlocks();
38496         code = gen_int(n_code, 0);
38497
38498         ret_val = xmlUCSIsCatN(code);
38499         desret_int(ret_val);
38500         call_tests++;
38501         des_int(n_code, code, 0);
38502         xmlResetLastError();
38503         if (mem_base != xmlMemBlocks()) {
38504             printf("Leak of %d blocks found in xmlUCSIsCatN",
38505                    xmlMemBlocks() - mem_base);
38506             test_ret++;
38507             printf(" %d", n_code);
38508             printf("\n");
38509         }
38510     }
38511     function_tests++;
38512 #endif
38513
38514     return(test_ret);
38515 }
38516
38517
38518 static int
38519 test_xmlUCSIsCatNd(void) {
38520     int test_ret = 0;
38521
38522 #if defined(LIBXML_UNICODE_ENABLED)
38523     int mem_base;
38524     int ret_val;
38525     int code; /* UCS code point */
38526     int n_code;
38527
38528     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38529         mem_base = xmlMemBlocks();
38530         code = gen_int(n_code, 0);
38531
38532         ret_val = xmlUCSIsCatNd(code);
38533         desret_int(ret_val);
38534         call_tests++;
38535         des_int(n_code, code, 0);
38536         xmlResetLastError();
38537         if (mem_base != xmlMemBlocks()) {
38538             printf("Leak of %d blocks found in xmlUCSIsCatNd",
38539                    xmlMemBlocks() - mem_base);
38540             test_ret++;
38541             printf(" %d", n_code);
38542             printf("\n");
38543         }
38544     }
38545     function_tests++;
38546 #endif
38547
38548     return(test_ret);
38549 }
38550
38551
38552 static int
38553 test_xmlUCSIsCatNl(void) {
38554     int test_ret = 0;
38555
38556 #if defined(LIBXML_UNICODE_ENABLED)
38557     int mem_base;
38558     int ret_val;
38559     int code; /* UCS code point */
38560     int n_code;
38561
38562     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38563         mem_base = xmlMemBlocks();
38564         code = gen_int(n_code, 0);
38565
38566         ret_val = xmlUCSIsCatNl(code);
38567         desret_int(ret_val);
38568         call_tests++;
38569         des_int(n_code, code, 0);
38570         xmlResetLastError();
38571         if (mem_base != xmlMemBlocks()) {
38572             printf("Leak of %d blocks found in xmlUCSIsCatNl",
38573                    xmlMemBlocks() - mem_base);
38574             test_ret++;
38575             printf(" %d", n_code);
38576             printf("\n");
38577         }
38578     }
38579     function_tests++;
38580 #endif
38581
38582     return(test_ret);
38583 }
38584
38585
38586 static int
38587 test_xmlUCSIsCatNo(void) {
38588     int test_ret = 0;
38589
38590 #if defined(LIBXML_UNICODE_ENABLED)
38591     int mem_base;
38592     int ret_val;
38593     int code; /* UCS code point */
38594     int n_code;
38595
38596     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38597         mem_base = xmlMemBlocks();
38598         code = gen_int(n_code, 0);
38599
38600         ret_val = xmlUCSIsCatNo(code);
38601         desret_int(ret_val);
38602         call_tests++;
38603         des_int(n_code, code, 0);
38604         xmlResetLastError();
38605         if (mem_base != xmlMemBlocks()) {
38606             printf("Leak of %d blocks found in xmlUCSIsCatNo",
38607                    xmlMemBlocks() - mem_base);
38608             test_ret++;
38609             printf(" %d", n_code);
38610             printf("\n");
38611         }
38612     }
38613     function_tests++;
38614 #endif
38615
38616     return(test_ret);
38617 }
38618
38619
38620 static int
38621 test_xmlUCSIsCatP(void) {
38622     int test_ret = 0;
38623
38624 #if defined(LIBXML_UNICODE_ENABLED)
38625     int mem_base;
38626     int ret_val;
38627     int code; /* UCS code point */
38628     int n_code;
38629
38630     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38631         mem_base = xmlMemBlocks();
38632         code = gen_int(n_code, 0);
38633
38634         ret_val = xmlUCSIsCatP(code);
38635         desret_int(ret_val);
38636         call_tests++;
38637         des_int(n_code, code, 0);
38638         xmlResetLastError();
38639         if (mem_base != xmlMemBlocks()) {
38640             printf("Leak of %d blocks found in xmlUCSIsCatP",
38641                    xmlMemBlocks() - mem_base);
38642             test_ret++;
38643             printf(" %d", n_code);
38644             printf("\n");
38645         }
38646     }
38647     function_tests++;
38648 #endif
38649
38650     return(test_ret);
38651 }
38652
38653
38654 static int
38655 test_xmlUCSIsCatPc(void) {
38656     int test_ret = 0;
38657
38658 #if defined(LIBXML_UNICODE_ENABLED)
38659     int mem_base;
38660     int ret_val;
38661     int code; /* UCS code point */
38662     int n_code;
38663
38664     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38665         mem_base = xmlMemBlocks();
38666         code = gen_int(n_code, 0);
38667
38668         ret_val = xmlUCSIsCatPc(code);
38669         desret_int(ret_val);
38670         call_tests++;
38671         des_int(n_code, code, 0);
38672         xmlResetLastError();
38673         if (mem_base != xmlMemBlocks()) {
38674             printf("Leak of %d blocks found in xmlUCSIsCatPc",
38675                    xmlMemBlocks() - mem_base);
38676             test_ret++;
38677             printf(" %d", n_code);
38678             printf("\n");
38679         }
38680     }
38681     function_tests++;
38682 #endif
38683
38684     return(test_ret);
38685 }
38686
38687
38688 static int
38689 test_xmlUCSIsCatPd(void) {
38690     int test_ret = 0;
38691
38692 #if defined(LIBXML_UNICODE_ENABLED)
38693     int mem_base;
38694     int ret_val;
38695     int code; /* UCS code point */
38696     int n_code;
38697
38698     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38699         mem_base = xmlMemBlocks();
38700         code = gen_int(n_code, 0);
38701
38702         ret_val = xmlUCSIsCatPd(code);
38703         desret_int(ret_val);
38704         call_tests++;
38705         des_int(n_code, code, 0);
38706         xmlResetLastError();
38707         if (mem_base != xmlMemBlocks()) {
38708             printf("Leak of %d blocks found in xmlUCSIsCatPd",
38709                    xmlMemBlocks() - mem_base);
38710             test_ret++;
38711             printf(" %d", n_code);
38712             printf("\n");
38713         }
38714     }
38715     function_tests++;
38716 #endif
38717
38718     return(test_ret);
38719 }
38720
38721
38722 static int
38723 test_xmlUCSIsCatPe(void) {
38724     int test_ret = 0;
38725
38726 #if defined(LIBXML_UNICODE_ENABLED)
38727     int mem_base;
38728     int ret_val;
38729     int code; /* UCS code point */
38730     int n_code;
38731
38732     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38733         mem_base = xmlMemBlocks();
38734         code = gen_int(n_code, 0);
38735
38736         ret_val = xmlUCSIsCatPe(code);
38737         desret_int(ret_val);
38738         call_tests++;
38739         des_int(n_code, code, 0);
38740         xmlResetLastError();
38741         if (mem_base != xmlMemBlocks()) {
38742             printf("Leak of %d blocks found in xmlUCSIsCatPe",
38743                    xmlMemBlocks() - mem_base);
38744             test_ret++;
38745             printf(" %d", n_code);
38746             printf("\n");
38747         }
38748     }
38749     function_tests++;
38750 #endif
38751
38752     return(test_ret);
38753 }
38754
38755
38756 static int
38757 test_xmlUCSIsCatPf(void) {
38758     int test_ret = 0;
38759
38760 #if defined(LIBXML_UNICODE_ENABLED)
38761     int mem_base;
38762     int ret_val;
38763     int code; /* UCS code point */
38764     int n_code;
38765
38766     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38767         mem_base = xmlMemBlocks();
38768         code = gen_int(n_code, 0);
38769
38770         ret_val = xmlUCSIsCatPf(code);
38771         desret_int(ret_val);
38772         call_tests++;
38773         des_int(n_code, code, 0);
38774         xmlResetLastError();
38775         if (mem_base != xmlMemBlocks()) {
38776             printf("Leak of %d blocks found in xmlUCSIsCatPf",
38777                    xmlMemBlocks() - mem_base);
38778             test_ret++;
38779             printf(" %d", n_code);
38780             printf("\n");
38781         }
38782     }
38783     function_tests++;
38784 #endif
38785
38786     return(test_ret);
38787 }
38788
38789
38790 static int
38791 test_xmlUCSIsCatPi(void) {
38792     int test_ret = 0;
38793
38794 #if defined(LIBXML_UNICODE_ENABLED)
38795     int mem_base;
38796     int ret_val;
38797     int code; /* UCS code point */
38798     int n_code;
38799
38800     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38801         mem_base = xmlMemBlocks();
38802         code = gen_int(n_code, 0);
38803
38804         ret_val = xmlUCSIsCatPi(code);
38805         desret_int(ret_val);
38806         call_tests++;
38807         des_int(n_code, code, 0);
38808         xmlResetLastError();
38809         if (mem_base != xmlMemBlocks()) {
38810             printf("Leak of %d blocks found in xmlUCSIsCatPi",
38811                    xmlMemBlocks() - mem_base);
38812             test_ret++;
38813             printf(" %d", n_code);
38814             printf("\n");
38815         }
38816     }
38817     function_tests++;
38818 #endif
38819
38820     return(test_ret);
38821 }
38822
38823
38824 static int
38825 test_xmlUCSIsCatPo(void) {
38826     int test_ret = 0;
38827
38828 #if defined(LIBXML_UNICODE_ENABLED)
38829     int mem_base;
38830     int ret_val;
38831     int code; /* UCS code point */
38832     int n_code;
38833
38834     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38835         mem_base = xmlMemBlocks();
38836         code = gen_int(n_code, 0);
38837
38838         ret_val = xmlUCSIsCatPo(code);
38839         desret_int(ret_val);
38840         call_tests++;
38841         des_int(n_code, code, 0);
38842         xmlResetLastError();
38843         if (mem_base != xmlMemBlocks()) {
38844             printf("Leak of %d blocks found in xmlUCSIsCatPo",
38845                    xmlMemBlocks() - mem_base);
38846             test_ret++;
38847             printf(" %d", n_code);
38848             printf("\n");
38849         }
38850     }
38851     function_tests++;
38852 #endif
38853
38854     return(test_ret);
38855 }
38856
38857
38858 static int
38859 test_xmlUCSIsCatPs(void) {
38860     int test_ret = 0;
38861
38862 #if defined(LIBXML_UNICODE_ENABLED)
38863     int mem_base;
38864     int ret_val;
38865     int code; /* UCS code point */
38866     int n_code;
38867
38868     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38869         mem_base = xmlMemBlocks();
38870         code = gen_int(n_code, 0);
38871
38872         ret_val = xmlUCSIsCatPs(code);
38873         desret_int(ret_val);
38874         call_tests++;
38875         des_int(n_code, code, 0);
38876         xmlResetLastError();
38877         if (mem_base != xmlMemBlocks()) {
38878             printf("Leak of %d blocks found in xmlUCSIsCatPs",
38879                    xmlMemBlocks() - mem_base);
38880             test_ret++;
38881             printf(" %d", n_code);
38882             printf("\n");
38883         }
38884     }
38885     function_tests++;
38886 #endif
38887
38888     return(test_ret);
38889 }
38890
38891
38892 static int
38893 test_xmlUCSIsCatS(void) {
38894     int test_ret = 0;
38895
38896 #if defined(LIBXML_UNICODE_ENABLED)
38897     int mem_base;
38898     int ret_val;
38899     int code; /* UCS code point */
38900     int n_code;
38901
38902     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38903         mem_base = xmlMemBlocks();
38904         code = gen_int(n_code, 0);
38905
38906         ret_val = xmlUCSIsCatS(code);
38907         desret_int(ret_val);
38908         call_tests++;
38909         des_int(n_code, code, 0);
38910         xmlResetLastError();
38911         if (mem_base != xmlMemBlocks()) {
38912             printf("Leak of %d blocks found in xmlUCSIsCatS",
38913                    xmlMemBlocks() - mem_base);
38914             test_ret++;
38915             printf(" %d", n_code);
38916             printf("\n");
38917         }
38918     }
38919     function_tests++;
38920 #endif
38921
38922     return(test_ret);
38923 }
38924
38925
38926 static int
38927 test_xmlUCSIsCatSc(void) {
38928     int test_ret = 0;
38929
38930 #if defined(LIBXML_UNICODE_ENABLED)
38931     int mem_base;
38932     int ret_val;
38933     int code; /* UCS code point */
38934     int n_code;
38935
38936     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38937         mem_base = xmlMemBlocks();
38938         code = gen_int(n_code, 0);
38939
38940         ret_val = xmlUCSIsCatSc(code);
38941         desret_int(ret_val);
38942         call_tests++;
38943         des_int(n_code, code, 0);
38944         xmlResetLastError();
38945         if (mem_base != xmlMemBlocks()) {
38946             printf("Leak of %d blocks found in xmlUCSIsCatSc",
38947                    xmlMemBlocks() - mem_base);
38948             test_ret++;
38949             printf(" %d", n_code);
38950             printf("\n");
38951         }
38952     }
38953     function_tests++;
38954 #endif
38955
38956     return(test_ret);
38957 }
38958
38959
38960 static int
38961 test_xmlUCSIsCatSk(void) {
38962     int test_ret = 0;
38963
38964 #if defined(LIBXML_UNICODE_ENABLED)
38965     int mem_base;
38966     int ret_val;
38967     int code; /* UCS code point */
38968     int n_code;
38969
38970     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38971         mem_base = xmlMemBlocks();
38972         code = gen_int(n_code, 0);
38973
38974         ret_val = xmlUCSIsCatSk(code);
38975         desret_int(ret_val);
38976         call_tests++;
38977         des_int(n_code, code, 0);
38978         xmlResetLastError();
38979         if (mem_base != xmlMemBlocks()) {
38980             printf("Leak of %d blocks found in xmlUCSIsCatSk",
38981                    xmlMemBlocks() - mem_base);
38982             test_ret++;
38983             printf(" %d", n_code);
38984             printf("\n");
38985         }
38986     }
38987     function_tests++;
38988 #endif
38989
38990     return(test_ret);
38991 }
38992
38993
38994 static int
38995 test_xmlUCSIsCatSm(void) {
38996     int test_ret = 0;
38997
38998 #if defined(LIBXML_UNICODE_ENABLED)
38999     int mem_base;
39000     int ret_val;
39001     int code; /* UCS code point */
39002     int n_code;
39003
39004     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39005         mem_base = xmlMemBlocks();
39006         code = gen_int(n_code, 0);
39007
39008         ret_val = xmlUCSIsCatSm(code);
39009         desret_int(ret_val);
39010         call_tests++;
39011         des_int(n_code, code, 0);
39012         xmlResetLastError();
39013         if (mem_base != xmlMemBlocks()) {
39014             printf("Leak of %d blocks found in xmlUCSIsCatSm",
39015                    xmlMemBlocks() - mem_base);
39016             test_ret++;
39017             printf(" %d", n_code);
39018             printf("\n");
39019         }
39020     }
39021     function_tests++;
39022 #endif
39023
39024     return(test_ret);
39025 }
39026
39027
39028 static int
39029 test_xmlUCSIsCatSo(void) {
39030     int test_ret = 0;
39031
39032 #if defined(LIBXML_UNICODE_ENABLED)
39033     int mem_base;
39034     int ret_val;
39035     int code; /* UCS code point */
39036     int n_code;
39037
39038     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39039         mem_base = xmlMemBlocks();
39040         code = gen_int(n_code, 0);
39041
39042         ret_val = xmlUCSIsCatSo(code);
39043         desret_int(ret_val);
39044         call_tests++;
39045         des_int(n_code, code, 0);
39046         xmlResetLastError();
39047         if (mem_base != xmlMemBlocks()) {
39048             printf("Leak of %d blocks found in xmlUCSIsCatSo",
39049                    xmlMemBlocks() - mem_base);
39050             test_ret++;
39051             printf(" %d", n_code);
39052             printf("\n");
39053         }
39054     }
39055     function_tests++;
39056 #endif
39057
39058     return(test_ret);
39059 }
39060
39061
39062 static int
39063 test_xmlUCSIsCatZ(void) {
39064     int test_ret = 0;
39065
39066 #if defined(LIBXML_UNICODE_ENABLED)
39067     int mem_base;
39068     int ret_val;
39069     int code; /* UCS code point */
39070     int n_code;
39071
39072     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39073         mem_base = xmlMemBlocks();
39074         code = gen_int(n_code, 0);
39075
39076         ret_val = xmlUCSIsCatZ(code);
39077         desret_int(ret_val);
39078         call_tests++;
39079         des_int(n_code, code, 0);
39080         xmlResetLastError();
39081         if (mem_base != xmlMemBlocks()) {
39082             printf("Leak of %d blocks found in xmlUCSIsCatZ",
39083                    xmlMemBlocks() - mem_base);
39084             test_ret++;
39085             printf(" %d", n_code);
39086             printf("\n");
39087         }
39088     }
39089     function_tests++;
39090 #endif
39091
39092     return(test_ret);
39093 }
39094
39095
39096 static int
39097 test_xmlUCSIsCatZl(void) {
39098     int test_ret = 0;
39099
39100 #if defined(LIBXML_UNICODE_ENABLED)
39101     int mem_base;
39102     int ret_val;
39103     int code; /* UCS code point */
39104     int n_code;
39105
39106     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39107         mem_base = xmlMemBlocks();
39108         code = gen_int(n_code, 0);
39109
39110         ret_val = xmlUCSIsCatZl(code);
39111         desret_int(ret_val);
39112         call_tests++;
39113         des_int(n_code, code, 0);
39114         xmlResetLastError();
39115         if (mem_base != xmlMemBlocks()) {
39116             printf("Leak of %d blocks found in xmlUCSIsCatZl",
39117                    xmlMemBlocks() - mem_base);
39118             test_ret++;
39119             printf(" %d", n_code);
39120             printf("\n");
39121         }
39122     }
39123     function_tests++;
39124 #endif
39125
39126     return(test_ret);
39127 }
39128
39129
39130 static int
39131 test_xmlUCSIsCatZp(void) {
39132     int test_ret = 0;
39133
39134 #if defined(LIBXML_UNICODE_ENABLED)
39135     int mem_base;
39136     int ret_val;
39137     int code; /* UCS code point */
39138     int n_code;
39139
39140     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39141         mem_base = xmlMemBlocks();
39142         code = gen_int(n_code, 0);
39143
39144         ret_val = xmlUCSIsCatZp(code);
39145         desret_int(ret_val);
39146         call_tests++;
39147         des_int(n_code, code, 0);
39148         xmlResetLastError();
39149         if (mem_base != xmlMemBlocks()) {
39150             printf("Leak of %d blocks found in xmlUCSIsCatZp",
39151                    xmlMemBlocks() - mem_base);
39152             test_ret++;
39153             printf(" %d", n_code);
39154             printf("\n");
39155         }
39156     }
39157     function_tests++;
39158 #endif
39159
39160     return(test_ret);
39161 }
39162
39163
39164 static int
39165 test_xmlUCSIsCatZs(void) {
39166     int test_ret = 0;
39167
39168 #if defined(LIBXML_UNICODE_ENABLED)
39169     int mem_base;
39170     int ret_val;
39171     int code; /* UCS code point */
39172     int n_code;
39173
39174     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39175         mem_base = xmlMemBlocks();
39176         code = gen_int(n_code, 0);
39177
39178         ret_val = xmlUCSIsCatZs(code);
39179         desret_int(ret_val);
39180         call_tests++;
39181         des_int(n_code, code, 0);
39182         xmlResetLastError();
39183         if (mem_base != xmlMemBlocks()) {
39184             printf("Leak of %d blocks found in xmlUCSIsCatZs",
39185                    xmlMemBlocks() - mem_base);
39186             test_ret++;
39187             printf(" %d", n_code);
39188             printf("\n");
39189         }
39190     }
39191     function_tests++;
39192 #endif
39193
39194     return(test_ret);
39195 }
39196
39197
39198 static int
39199 test_xmlUCSIsCherokee(void) {
39200     int test_ret = 0;
39201
39202 #if defined(LIBXML_UNICODE_ENABLED)
39203     int mem_base;
39204     int ret_val;
39205     int code; /* UCS code point */
39206     int n_code;
39207
39208     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39209         mem_base = xmlMemBlocks();
39210         code = gen_int(n_code, 0);
39211
39212         ret_val = xmlUCSIsCherokee(code);
39213         desret_int(ret_val);
39214         call_tests++;
39215         des_int(n_code, code, 0);
39216         xmlResetLastError();
39217         if (mem_base != xmlMemBlocks()) {
39218             printf("Leak of %d blocks found in xmlUCSIsCherokee",
39219                    xmlMemBlocks() - mem_base);
39220             test_ret++;
39221             printf(" %d", n_code);
39222             printf("\n");
39223         }
39224     }
39225     function_tests++;
39226 #endif
39227
39228     return(test_ret);
39229 }
39230
39231
39232 static int
39233 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39234     int test_ret = 0;
39235
39236 #if defined(LIBXML_UNICODE_ENABLED)
39237     int mem_base;
39238     int ret_val;
39239     int code; /* UCS code point */
39240     int n_code;
39241
39242     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39243         mem_base = xmlMemBlocks();
39244         code = gen_int(n_code, 0);
39245
39246         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39247         desret_int(ret_val);
39248         call_tests++;
39249         des_int(n_code, code, 0);
39250         xmlResetLastError();
39251         if (mem_base != xmlMemBlocks()) {
39252             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39253                    xmlMemBlocks() - mem_base);
39254             test_ret++;
39255             printf(" %d", n_code);
39256             printf("\n");
39257         }
39258     }
39259     function_tests++;
39260 #endif
39261
39262     return(test_ret);
39263 }
39264
39265
39266 static int
39267 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39268     int test_ret = 0;
39269
39270 #if defined(LIBXML_UNICODE_ENABLED)
39271     int mem_base;
39272     int ret_val;
39273     int code; /* UCS code point */
39274     int n_code;
39275
39276     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39277         mem_base = xmlMemBlocks();
39278         code = gen_int(n_code, 0);
39279
39280         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39281         desret_int(ret_val);
39282         call_tests++;
39283         des_int(n_code, code, 0);
39284         xmlResetLastError();
39285         if (mem_base != xmlMemBlocks()) {
39286             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39287                    xmlMemBlocks() - mem_base);
39288             test_ret++;
39289             printf(" %d", n_code);
39290             printf("\n");
39291         }
39292     }
39293     function_tests++;
39294 #endif
39295
39296     return(test_ret);
39297 }
39298
39299
39300 static int
39301 test_xmlUCSIsCombiningHalfMarks(void) {
39302     int test_ret = 0;
39303
39304 #if defined(LIBXML_UNICODE_ENABLED)
39305     int mem_base;
39306     int ret_val;
39307     int code; /* UCS code point */
39308     int n_code;
39309
39310     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39311         mem_base = xmlMemBlocks();
39312         code = gen_int(n_code, 0);
39313
39314         ret_val = xmlUCSIsCombiningHalfMarks(code);
39315         desret_int(ret_val);
39316         call_tests++;
39317         des_int(n_code, code, 0);
39318         xmlResetLastError();
39319         if (mem_base != xmlMemBlocks()) {
39320             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39321                    xmlMemBlocks() - mem_base);
39322             test_ret++;
39323             printf(" %d", n_code);
39324             printf("\n");
39325         }
39326     }
39327     function_tests++;
39328 #endif
39329
39330     return(test_ret);
39331 }
39332
39333
39334 static int
39335 test_xmlUCSIsCombiningMarksforSymbols(void) {
39336     int test_ret = 0;
39337
39338 #if defined(LIBXML_UNICODE_ENABLED)
39339     int mem_base;
39340     int ret_val;
39341     int code; /* UCS code point */
39342     int n_code;
39343
39344     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39345         mem_base = xmlMemBlocks();
39346         code = gen_int(n_code, 0);
39347
39348         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39349         desret_int(ret_val);
39350         call_tests++;
39351         des_int(n_code, code, 0);
39352         xmlResetLastError();
39353         if (mem_base != xmlMemBlocks()) {
39354             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39355                    xmlMemBlocks() - mem_base);
39356             test_ret++;
39357             printf(" %d", n_code);
39358             printf("\n");
39359         }
39360     }
39361     function_tests++;
39362 #endif
39363
39364     return(test_ret);
39365 }
39366
39367
39368 static int
39369 test_xmlUCSIsControlPictures(void) {
39370     int test_ret = 0;
39371
39372 #if defined(LIBXML_UNICODE_ENABLED)
39373     int mem_base;
39374     int ret_val;
39375     int code; /* UCS code point */
39376     int n_code;
39377
39378     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39379         mem_base = xmlMemBlocks();
39380         code = gen_int(n_code, 0);
39381
39382         ret_val = xmlUCSIsControlPictures(code);
39383         desret_int(ret_val);
39384         call_tests++;
39385         des_int(n_code, code, 0);
39386         xmlResetLastError();
39387         if (mem_base != xmlMemBlocks()) {
39388             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39389                    xmlMemBlocks() - mem_base);
39390             test_ret++;
39391             printf(" %d", n_code);
39392             printf("\n");
39393         }
39394     }
39395     function_tests++;
39396 #endif
39397
39398     return(test_ret);
39399 }
39400
39401
39402 static int
39403 test_xmlUCSIsCurrencySymbols(void) {
39404     int test_ret = 0;
39405
39406 #if defined(LIBXML_UNICODE_ENABLED)
39407     int mem_base;
39408     int ret_val;
39409     int code; /* UCS code point */
39410     int n_code;
39411
39412     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39413         mem_base = xmlMemBlocks();
39414         code = gen_int(n_code, 0);
39415
39416         ret_val = xmlUCSIsCurrencySymbols(code);
39417         desret_int(ret_val);
39418         call_tests++;
39419         des_int(n_code, code, 0);
39420         xmlResetLastError();
39421         if (mem_base != xmlMemBlocks()) {
39422             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39423                    xmlMemBlocks() - mem_base);
39424             test_ret++;
39425             printf(" %d", n_code);
39426             printf("\n");
39427         }
39428     }
39429     function_tests++;
39430 #endif
39431
39432     return(test_ret);
39433 }
39434
39435
39436 static int
39437 test_xmlUCSIsCypriotSyllabary(void) {
39438     int test_ret = 0;
39439
39440 #if defined(LIBXML_UNICODE_ENABLED)
39441     int mem_base;
39442     int ret_val;
39443     int code; /* UCS code point */
39444     int n_code;
39445
39446     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39447         mem_base = xmlMemBlocks();
39448         code = gen_int(n_code, 0);
39449
39450         ret_val = xmlUCSIsCypriotSyllabary(code);
39451         desret_int(ret_val);
39452         call_tests++;
39453         des_int(n_code, code, 0);
39454         xmlResetLastError();
39455         if (mem_base != xmlMemBlocks()) {
39456             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39457                    xmlMemBlocks() - mem_base);
39458             test_ret++;
39459             printf(" %d", n_code);
39460             printf("\n");
39461         }
39462     }
39463     function_tests++;
39464 #endif
39465
39466     return(test_ret);
39467 }
39468
39469
39470 static int
39471 test_xmlUCSIsCyrillic(void) {
39472     int test_ret = 0;
39473
39474 #if defined(LIBXML_UNICODE_ENABLED)
39475     int mem_base;
39476     int ret_val;
39477     int code; /* UCS code point */
39478     int n_code;
39479
39480     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39481         mem_base = xmlMemBlocks();
39482         code = gen_int(n_code, 0);
39483
39484         ret_val = xmlUCSIsCyrillic(code);
39485         desret_int(ret_val);
39486         call_tests++;
39487         des_int(n_code, code, 0);
39488         xmlResetLastError();
39489         if (mem_base != xmlMemBlocks()) {
39490             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39491                    xmlMemBlocks() - mem_base);
39492             test_ret++;
39493             printf(" %d", n_code);
39494             printf("\n");
39495         }
39496     }
39497     function_tests++;
39498 #endif
39499
39500     return(test_ret);
39501 }
39502
39503
39504 static int
39505 test_xmlUCSIsCyrillicSupplement(void) {
39506     int test_ret = 0;
39507
39508 #if defined(LIBXML_UNICODE_ENABLED)
39509     int mem_base;
39510     int ret_val;
39511     int code; /* UCS code point */
39512     int n_code;
39513
39514     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39515         mem_base = xmlMemBlocks();
39516         code = gen_int(n_code, 0);
39517
39518         ret_val = xmlUCSIsCyrillicSupplement(code);
39519         desret_int(ret_val);
39520         call_tests++;
39521         des_int(n_code, code, 0);
39522         xmlResetLastError();
39523         if (mem_base != xmlMemBlocks()) {
39524             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39525                    xmlMemBlocks() - mem_base);
39526             test_ret++;
39527             printf(" %d", n_code);
39528             printf("\n");
39529         }
39530     }
39531     function_tests++;
39532 #endif
39533
39534     return(test_ret);
39535 }
39536
39537
39538 static int
39539 test_xmlUCSIsDeseret(void) {
39540     int test_ret = 0;
39541
39542 #if defined(LIBXML_UNICODE_ENABLED)
39543     int mem_base;
39544     int ret_val;
39545     int code; /* UCS code point */
39546     int n_code;
39547
39548     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39549         mem_base = xmlMemBlocks();
39550         code = gen_int(n_code, 0);
39551
39552         ret_val = xmlUCSIsDeseret(code);
39553         desret_int(ret_val);
39554         call_tests++;
39555         des_int(n_code, code, 0);
39556         xmlResetLastError();
39557         if (mem_base != xmlMemBlocks()) {
39558             printf("Leak of %d blocks found in xmlUCSIsDeseret",
39559                    xmlMemBlocks() - mem_base);
39560             test_ret++;
39561             printf(" %d", n_code);
39562             printf("\n");
39563         }
39564     }
39565     function_tests++;
39566 #endif
39567
39568     return(test_ret);
39569 }
39570
39571
39572 static int
39573 test_xmlUCSIsDevanagari(void) {
39574     int test_ret = 0;
39575
39576 #if defined(LIBXML_UNICODE_ENABLED)
39577     int mem_base;
39578     int ret_val;
39579     int code; /* UCS code point */
39580     int n_code;
39581
39582     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39583         mem_base = xmlMemBlocks();
39584         code = gen_int(n_code, 0);
39585
39586         ret_val = xmlUCSIsDevanagari(code);
39587         desret_int(ret_val);
39588         call_tests++;
39589         des_int(n_code, code, 0);
39590         xmlResetLastError();
39591         if (mem_base != xmlMemBlocks()) {
39592             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39593                    xmlMemBlocks() - mem_base);
39594             test_ret++;
39595             printf(" %d", n_code);
39596             printf("\n");
39597         }
39598     }
39599     function_tests++;
39600 #endif
39601
39602     return(test_ret);
39603 }
39604
39605
39606 static int
39607 test_xmlUCSIsDingbats(void) {
39608     int test_ret = 0;
39609
39610 #if defined(LIBXML_UNICODE_ENABLED)
39611     int mem_base;
39612     int ret_val;
39613     int code; /* UCS code point */
39614     int n_code;
39615
39616     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39617         mem_base = xmlMemBlocks();
39618         code = gen_int(n_code, 0);
39619
39620         ret_val = xmlUCSIsDingbats(code);
39621         desret_int(ret_val);
39622         call_tests++;
39623         des_int(n_code, code, 0);
39624         xmlResetLastError();
39625         if (mem_base != xmlMemBlocks()) {
39626             printf("Leak of %d blocks found in xmlUCSIsDingbats",
39627                    xmlMemBlocks() - mem_base);
39628             test_ret++;
39629             printf(" %d", n_code);
39630             printf("\n");
39631         }
39632     }
39633     function_tests++;
39634 #endif
39635
39636     return(test_ret);
39637 }
39638
39639
39640 static int
39641 test_xmlUCSIsEnclosedAlphanumerics(void) {
39642     int test_ret = 0;
39643
39644 #if defined(LIBXML_UNICODE_ENABLED)
39645     int mem_base;
39646     int ret_val;
39647     int code; /* UCS code point */
39648     int n_code;
39649
39650     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39651         mem_base = xmlMemBlocks();
39652         code = gen_int(n_code, 0);
39653
39654         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39655         desret_int(ret_val);
39656         call_tests++;
39657         des_int(n_code, code, 0);
39658         xmlResetLastError();
39659         if (mem_base != xmlMemBlocks()) {
39660             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39661                    xmlMemBlocks() - mem_base);
39662             test_ret++;
39663             printf(" %d", n_code);
39664             printf("\n");
39665         }
39666     }
39667     function_tests++;
39668 #endif
39669
39670     return(test_ret);
39671 }
39672
39673
39674 static int
39675 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39676     int test_ret = 0;
39677
39678 #if defined(LIBXML_UNICODE_ENABLED)
39679     int mem_base;
39680     int ret_val;
39681     int code; /* UCS code point */
39682     int n_code;
39683
39684     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39685         mem_base = xmlMemBlocks();
39686         code = gen_int(n_code, 0);
39687
39688         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39689         desret_int(ret_val);
39690         call_tests++;
39691         des_int(n_code, code, 0);
39692         xmlResetLastError();
39693         if (mem_base != xmlMemBlocks()) {
39694             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39695                    xmlMemBlocks() - mem_base);
39696             test_ret++;
39697             printf(" %d", n_code);
39698             printf("\n");
39699         }
39700     }
39701     function_tests++;
39702 #endif
39703
39704     return(test_ret);
39705 }
39706
39707
39708 static int
39709 test_xmlUCSIsEthiopic(void) {
39710     int test_ret = 0;
39711
39712 #if defined(LIBXML_UNICODE_ENABLED)
39713     int mem_base;
39714     int ret_val;
39715     int code; /* UCS code point */
39716     int n_code;
39717
39718     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39719         mem_base = xmlMemBlocks();
39720         code = gen_int(n_code, 0);
39721
39722         ret_val = xmlUCSIsEthiopic(code);
39723         desret_int(ret_val);
39724         call_tests++;
39725         des_int(n_code, code, 0);
39726         xmlResetLastError();
39727         if (mem_base != xmlMemBlocks()) {
39728             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39729                    xmlMemBlocks() - mem_base);
39730             test_ret++;
39731             printf(" %d", n_code);
39732             printf("\n");
39733         }
39734     }
39735     function_tests++;
39736 #endif
39737
39738     return(test_ret);
39739 }
39740
39741
39742 static int
39743 test_xmlUCSIsGeneralPunctuation(void) {
39744     int test_ret = 0;
39745
39746 #if defined(LIBXML_UNICODE_ENABLED)
39747     int mem_base;
39748     int ret_val;
39749     int code; /* UCS code point */
39750     int n_code;
39751
39752     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39753         mem_base = xmlMemBlocks();
39754         code = gen_int(n_code, 0);
39755
39756         ret_val = xmlUCSIsGeneralPunctuation(code);
39757         desret_int(ret_val);
39758         call_tests++;
39759         des_int(n_code, code, 0);
39760         xmlResetLastError();
39761         if (mem_base != xmlMemBlocks()) {
39762             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39763                    xmlMemBlocks() - mem_base);
39764             test_ret++;
39765             printf(" %d", n_code);
39766             printf("\n");
39767         }
39768     }
39769     function_tests++;
39770 #endif
39771
39772     return(test_ret);
39773 }
39774
39775
39776 static int
39777 test_xmlUCSIsGeometricShapes(void) {
39778     int test_ret = 0;
39779
39780 #if defined(LIBXML_UNICODE_ENABLED)
39781     int mem_base;
39782     int ret_val;
39783     int code; /* UCS code point */
39784     int n_code;
39785
39786     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39787         mem_base = xmlMemBlocks();
39788         code = gen_int(n_code, 0);
39789
39790         ret_val = xmlUCSIsGeometricShapes(code);
39791         desret_int(ret_val);
39792         call_tests++;
39793         des_int(n_code, code, 0);
39794         xmlResetLastError();
39795         if (mem_base != xmlMemBlocks()) {
39796             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39797                    xmlMemBlocks() - mem_base);
39798             test_ret++;
39799             printf(" %d", n_code);
39800             printf("\n");
39801         }
39802     }
39803     function_tests++;
39804 #endif
39805
39806     return(test_ret);
39807 }
39808
39809
39810 static int
39811 test_xmlUCSIsGeorgian(void) {
39812     int test_ret = 0;
39813
39814 #if defined(LIBXML_UNICODE_ENABLED)
39815     int mem_base;
39816     int ret_val;
39817     int code; /* UCS code point */
39818     int n_code;
39819
39820     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39821         mem_base = xmlMemBlocks();
39822         code = gen_int(n_code, 0);
39823
39824         ret_val = xmlUCSIsGeorgian(code);
39825         desret_int(ret_val);
39826         call_tests++;
39827         des_int(n_code, code, 0);
39828         xmlResetLastError();
39829         if (mem_base != xmlMemBlocks()) {
39830             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39831                    xmlMemBlocks() - mem_base);
39832             test_ret++;
39833             printf(" %d", n_code);
39834             printf("\n");
39835         }
39836     }
39837     function_tests++;
39838 #endif
39839
39840     return(test_ret);
39841 }
39842
39843
39844 static int
39845 test_xmlUCSIsGothic(void) {
39846     int test_ret = 0;
39847
39848 #if defined(LIBXML_UNICODE_ENABLED)
39849     int mem_base;
39850     int ret_val;
39851     int code; /* UCS code point */
39852     int n_code;
39853
39854     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39855         mem_base = xmlMemBlocks();
39856         code = gen_int(n_code, 0);
39857
39858         ret_val = xmlUCSIsGothic(code);
39859         desret_int(ret_val);
39860         call_tests++;
39861         des_int(n_code, code, 0);
39862         xmlResetLastError();
39863         if (mem_base != xmlMemBlocks()) {
39864             printf("Leak of %d blocks found in xmlUCSIsGothic",
39865                    xmlMemBlocks() - mem_base);
39866             test_ret++;
39867             printf(" %d", n_code);
39868             printf("\n");
39869         }
39870     }
39871     function_tests++;
39872 #endif
39873
39874     return(test_ret);
39875 }
39876
39877
39878 static int
39879 test_xmlUCSIsGreek(void) {
39880     int test_ret = 0;
39881
39882 #if defined(LIBXML_UNICODE_ENABLED)
39883     int mem_base;
39884     int ret_val;
39885     int code; /* UCS code point */
39886     int n_code;
39887
39888     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39889         mem_base = xmlMemBlocks();
39890         code = gen_int(n_code, 0);
39891
39892         ret_val = xmlUCSIsGreek(code);
39893         desret_int(ret_val);
39894         call_tests++;
39895         des_int(n_code, code, 0);
39896         xmlResetLastError();
39897         if (mem_base != xmlMemBlocks()) {
39898             printf("Leak of %d blocks found in xmlUCSIsGreek",
39899                    xmlMemBlocks() - mem_base);
39900             test_ret++;
39901             printf(" %d", n_code);
39902             printf("\n");
39903         }
39904     }
39905     function_tests++;
39906 #endif
39907
39908     return(test_ret);
39909 }
39910
39911
39912 static int
39913 test_xmlUCSIsGreekExtended(void) {
39914     int test_ret = 0;
39915
39916 #if defined(LIBXML_UNICODE_ENABLED)
39917     int mem_base;
39918     int ret_val;
39919     int code; /* UCS code point */
39920     int n_code;
39921
39922     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39923         mem_base = xmlMemBlocks();
39924         code = gen_int(n_code, 0);
39925
39926         ret_val = xmlUCSIsGreekExtended(code);
39927         desret_int(ret_val);
39928         call_tests++;
39929         des_int(n_code, code, 0);
39930         xmlResetLastError();
39931         if (mem_base != xmlMemBlocks()) {
39932             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39933                    xmlMemBlocks() - mem_base);
39934             test_ret++;
39935             printf(" %d", n_code);
39936             printf("\n");
39937         }
39938     }
39939     function_tests++;
39940 #endif
39941
39942     return(test_ret);
39943 }
39944
39945
39946 static int
39947 test_xmlUCSIsGreekandCoptic(void) {
39948     int test_ret = 0;
39949
39950 #if defined(LIBXML_UNICODE_ENABLED)
39951     int mem_base;
39952     int ret_val;
39953     int code; /* UCS code point */
39954     int n_code;
39955
39956     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39957         mem_base = xmlMemBlocks();
39958         code = gen_int(n_code, 0);
39959
39960         ret_val = xmlUCSIsGreekandCoptic(code);
39961         desret_int(ret_val);
39962         call_tests++;
39963         des_int(n_code, code, 0);
39964         xmlResetLastError();
39965         if (mem_base != xmlMemBlocks()) {
39966             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39967                    xmlMemBlocks() - mem_base);
39968             test_ret++;
39969             printf(" %d", n_code);
39970             printf("\n");
39971         }
39972     }
39973     function_tests++;
39974 #endif
39975
39976     return(test_ret);
39977 }
39978
39979
39980 static int
39981 test_xmlUCSIsGujarati(void) {
39982     int test_ret = 0;
39983
39984 #if defined(LIBXML_UNICODE_ENABLED)
39985     int mem_base;
39986     int ret_val;
39987     int code; /* UCS code point */
39988     int n_code;
39989
39990     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39991         mem_base = xmlMemBlocks();
39992         code = gen_int(n_code, 0);
39993
39994         ret_val = xmlUCSIsGujarati(code);
39995         desret_int(ret_val);
39996         call_tests++;
39997         des_int(n_code, code, 0);
39998         xmlResetLastError();
39999         if (mem_base != xmlMemBlocks()) {
40000             printf("Leak of %d blocks found in xmlUCSIsGujarati",
40001                    xmlMemBlocks() - mem_base);
40002             test_ret++;
40003             printf(" %d", n_code);
40004             printf("\n");
40005         }
40006     }
40007     function_tests++;
40008 #endif
40009
40010     return(test_ret);
40011 }
40012
40013
40014 static int
40015 test_xmlUCSIsGurmukhi(void) {
40016     int test_ret = 0;
40017
40018 #if defined(LIBXML_UNICODE_ENABLED)
40019     int mem_base;
40020     int ret_val;
40021     int code; /* UCS code point */
40022     int n_code;
40023
40024     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40025         mem_base = xmlMemBlocks();
40026         code = gen_int(n_code, 0);
40027
40028         ret_val = xmlUCSIsGurmukhi(code);
40029         desret_int(ret_val);
40030         call_tests++;
40031         des_int(n_code, code, 0);
40032         xmlResetLastError();
40033         if (mem_base != xmlMemBlocks()) {
40034             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40035                    xmlMemBlocks() - mem_base);
40036             test_ret++;
40037             printf(" %d", n_code);
40038             printf("\n");
40039         }
40040     }
40041     function_tests++;
40042 #endif
40043
40044     return(test_ret);
40045 }
40046
40047
40048 static int
40049 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40050     int test_ret = 0;
40051
40052 #if defined(LIBXML_UNICODE_ENABLED)
40053     int mem_base;
40054     int ret_val;
40055     int code; /* UCS code point */
40056     int n_code;
40057
40058     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40059         mem_base = xmlMemBlocks();
40060         code = gen_int(n_code, 0);
40061
40062         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40063         desret_int(ret_val);
40064         call_tests++;
40065         des_int(n_code, code, 0);
40066         xmlResetLastError();
40067         if (mem_base != xmlMemBlocks()) {
40068             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40069                    xmlMemBlocks() - mem_base);
40070             test_ret++;
40071             printf(" %d", n_code);
40072             printf("\n");
40073         }
40074     }
40075     function_tests++;
40076 #endif
40077
40078     return(test_ret);
40079 }
40080
40081
40082 static int
40083 test_xmlUCSIsHangulCompatibilityJamo(void) {
40084     int test_ret = 0;
40085
40086 #if defined(LIBXML_UNICODE_ENABLED)
40087     int mem_base;
40088     int ret_val;
40089     int code; /* UCS code point */
40090     int n_code;
40091
40092     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40093         mem_base = xmlMemBlocks();
40094         code = gen_int(n_code, 0);
40095
40096         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40097         desret_int(ret_val);
40098         call_tests++;
40099         des_int(n_code, code, 0);
40100         xmlResetLastError();
40101         if (mem_base != xmlMemBlocks()) {
40102             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40103                    xmlMemBlocks() - mem_base);
40104             test_ret++;
40105             printf(" %d", n_code);
40106             printf("\n");
40107         }
40108     }
40109     function_tests++;
40110 #endif
40111
40112     return(test_ret);
40113 }
40114
40115
40116 static int
40117 test_xmlUCSIsHangulJamo(void) {
40118     int test_ret = 0;
40119
40120 #if defined(LIBXML_UNICODE_ENABLED)
40121     int mem_base;
40122     int ret_val;
40123     int code; /* UCS code point */
40124     int n_code;
40125
40126     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40127         mem_base = xmlMemBlocks();
40128         code = gen_int(n_code, 0);
40129
40130         ret_val = xmlUCSIsHangulJamo(code);
40131         desret_int(ret_val);
40132         call_tests++;
40133         des_int(n_code, code, 0);
40134         xmlResetLastError();
40135         if (mem_base != xmlMemBlocks()) {
40136             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40137                    xmlMemBlocks() - mem_base);
40138             test_ret++;
40139             printf(" %d", n_code);
40140             printf("\n");
40141         }
40142     }
40143     function_tests++;
40144 #endif
40145
40146     return(test_ret);
40147 }
40148
40149
40150 static int
40151 test_xmlUCSIsHangulSyllables(void) {
40152     int test_ret = 0;
40153
40154 #if defined(LIBXML_UNICODE_ENABLED)
40155     int mem_base;
40156     int ret_val;
40157     int code; /* UCS code point */
40158     int n_code;
40159
40160     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40161         mem_base = xmlMemBlocks();
40162         code = gen_int(n_code, 0);
40163
40164         ret_val = xmlUCSIsHangulSyllables(code);
40165         desret_int(ret_val);
40166         call_tests++;
40167         des_int(n_code, code, 0);
40168         xmlResetLastError();
40169         if (mem_base != xmlMemBlocks()) {
40170             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40171                    xmlMemBlocks() - mem_base);
40172             test_ret++;
40173             printf(" %d", n_code);
40174             printf("\n");
40175         }
40176     }
40177     function_tests++;
40178 #endif
40179
40180     return(test_ret);
40181 }
40182
40183
40184 static int
40185 test_xmlUCSIsHanunoo(void) {
40186     int test_ret = 0;
40187
40188 #if defined(LIBXML_UNICODE_ENABLED)
40189     int mem_base;
40190     int ret_val;
40191     int code; /* UCS code point */
40192     int n_code;
40193
40194     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40195         mem_base = xmlMemBlocks();
40196         code = gen_int(n_code, 0);
40197
40198         ret_val = xmlUCSIsHanunoo(code);
40199         desret_int(ret_val);
40200         call_tests++;
40201         des_int(n_code, code, 0);
40202         xmlResetLastError();
40203         if (mem_base != xmlMemBlocks()) {
40204             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40205                    xmlMemBlocks() - mem_base);
40206             test_ret++;
40207             printf(" %d", n_code);
40208             printf("\n");
40209         }
40210     }
40211     function_tests++;
40212 #endif
40213
40214     return(test_ret);
40215 }
40216
40217
40218 static int
40219 test_xmlUCSIsHebrew(void) {
40220     int test_ret = 0;
40221
40222 #if defined(LIBXML_UNICODE_ENABLED)
40223     int mem_base;
40224     int ret_val;
40225     int code; /* UCS code point */
40226     int n_code;
40227
40228     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40229         mem_base = xmlMemBlocks();
40230         code = gen_int(n_code, 0);
40231
40232         ret_val = xmlUCSIsHebrew(code);
40233         desret_int(ret_val);
40234         call_tests++;
40235         des_int(n_code, code, 0);
40236         xmlResetLastError();
40237         if (mem_base != xmlMemBlocks()) {
40238             printf("Leak of %d blocks found in xmlUCSIsHebrew",
40239                    xmlMemBlocks() - mem_base);
40240             test_ret++;
40241             printf(" %d", n_code);
40242             printf("\n");
40243         }
40244     }
40245     function_tests++;
40246 #endif
40247
40248     return(test_ret);
40249 }
40250
40251
40252 static int
40253 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40254     int test_ret = 0;
40255
40256 #if defined(LIBXML_UNICODE_ENABLED)
40257     int mem_base;
40258     int ret_val;
40259     int code; /* UCS code point */
40260     int n_code;
40261
40262     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40263         mem_base = xmlMemBlocks();
40264         code = gen_int(n_code, 0);
40265
40266         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40267         desret_int(ret_val);
40268         call_tests++;
40269         des_int(n_code, code, 0);
40270         xmlResetLastError();
40271         if (mem_base != xmlMemBlocks()) {
40272             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40273                    xmlMemBlocks() - mem_base);
40274             test_ret++;
40275             printf(" %d", n_code);
40276             printf("\n");
40277         }
40278     }
40279     function_tests++;
40280 #endif
40281
40282     return(test_ret);
40283 }
40284
40285
40286 static int
40287 test_xmlUCSIsHighSurrogates(void) {
40288     int test_ret = 0;
40289
40290 #if defined(LIBXML_UNICODE_ENABLED)
40291     int mem_base;
40292     int ret_val;
40293     int code; /* UCS code point */
40294     int n_code;
40295
40296     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40297         mem_base = xmlMemBlocks();
40298         code = gen_int(n_code, 0);
40299
40300         ret_val = xmlUCSIsHighSurrogates(code);
40301         desret_int(ret_val);
40302         call_tests++;
40303         des_int(n_code, code, 0);
40304         xmlResetLastError();
40305         if (mem_base != xmlMemBlocks()) {
40306             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40307                    xmlMemBlocks() - mem_base);
40308             test_ret++;
40309             printf(" %d", n_code);
40310             printf("\n");
40311         }
40312     }
40313     function_tests++;
40314 #endif
40315
40316     return(test_ret);
40317 }
40318
40319
40320 static int
40321 test_xmlUCSIsHiragana(void) {
40322     int test_ret = 0;
40323
40324 #if defined(LIBXML_UNICODE_ENABLED)
40325     int mem_base;
40326     int ret_val;
40327     int code; /* UCS code point */
40328     int n_code;
40329
40330     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40331         mem_base = xmlMemBlocks();
40332         code = gen_int(n_code, 0);
40333
40334         ret_val = xmlUCSIsHiragana(code);
40335         desret_int(ret_val);
40336         call_tests++;
40337         des_int(n_code, code, 0);
40338         xmlResetLastError();
40339         if (mem_base != xmlMemBlocks()) {
40340             printf("Leak of %d blocks found in xmlUCSIsHiragana",
40341                    xmlMemBlocks() - mem_base);
40342             test_ret++;
40343             printf(" %d", n_code);
40344             printf("\n");
40345         }
40346     }
40347     function_tests++;
40348 #endif
40349
40350     return(test_ret);
40351 }
40352
40353
40354 static int
40355 test_xmlUCSIsIPAExtensions(void) {
40356     int test_ret = 0;
40357
40358 #if defined(LIBXML_UNICODE_ENABLED)
40359     int mem_base;
40360     int ret_val;
40361     int code; /* UCS code point */
40362     int n_code;
40363
40364     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40365         mem_base = xmlMemBlocks();
40366         code = gen_int(n_code, 0);
40367
40368         ret_val = xmlUCSIsIPAExtensions(code);
40369         desret_int(ret_val);
40370         call_tests++;
40371         des_int(n_code, code, 0);
40372         xmlResetLastError();
40373         if (mem_base != xmlMemBlocks()) {
40374             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40375                    xmlMemBlocks() - mem_base);
40376             test_ret++;
40377             printf(" %d", n_code);
40378             printf("\n");
40379         }
40380     }
40381     function_tests++;
40382 #endif
40383
40384     return(test_ret);
40385 }
40386
40387
40388 static int
40389 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40390     int test_ret = 0;
40391
40392 #if defined(LIBXML_UNICODE_ENABLED)
40393     int mem_base;
40394     int ret_val;
40395     int code; /* UCS code point */
40396     int n_code;
40397
40398     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40399         mem_base = xmlMemBlocks();
40400         code = gen_int(n_code, 0);
40401
40402         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40403         desret_int(ret_val);
40404         call_tests++;
40405         des_int(n_code, code, 0);
40406         xmlResetLastError();
40407         if (mem_base != xmlMemBlocks()) {
40408             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40409                    xmlMemBlocks() - mem_base);
40410             test_ret++;
40411             printf(" %d", n_code);
40412             printf("\n");
40413         }
40414     }
40415     function_tests++;
40416 #endif
40417
40418     return(test_ret);
40419 }
40420
40421
40422 static int
40423 test_xmlUCSIsKanbun(void) {
40424     int test_ret = 0;
40425
40426 #if defined(LIBXML_UNICODE_ENABLED)
40427     int mem_base;
40428     int ret_val;
40429     int code; /* UCS code point */
40430     int n_code;
40431
40432     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40433         mem_base = xmlMemBlocks();
40434         code = gen_int(n_code, 0);
40435
40436         ret_val = xmlUCSIsKanbun(code);
40437         desret_int(ret_val);
40438         call_tests++;
40439         des_int(n_code, code, 0);
40440         xmlResetLastError();
40441         if (mem_base != xmlMemBlocks()) {
40442             printf("Leak of %d blocks found in xmlUCSIsKanbun",
40443                    xmlMemBlocks() - mem_base);
40444             test_ret++;
40445             printf(" %d", n_code);
40446             printf("\n");
40447         }
40448     }
40449     function_tests++;
40450 #endif
40451
40452     return(test_ret);
40453 }
40454
40455
40456 static int
40457 test_xmlUCSIsKangxiRadicals(void) {
40458     int test_ret = 0;
40459
40460 #if defined(LIBXML_UNICODE_ENABLED)
40461     int mem_base;
40462     int ret_val;
40463     int code; /* UCS code point */
40464     int n_code;
40465
40466     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40467         mem_base = xmlMemBlocks();
40468         code = gen_int(n_code, 0);
40469
40470         ret_val = xmlUCSIsKangxiRadicals(code);
40471         desret_int(ret_val);
40472         call_tests++;
40473         des_int(n_code, code, 0);
40474         xmlResetLastError();
40475         if (mem_base != xmlMemBlocks()) {
40476             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40477                    xmlMemBlocks() - mem_base);
40478             test_ret++;
40479             printf(" %d", n_code);
40480             printf("\n");
40481         }
40482     }
40483     function_tests++;
40484 #endif
40485
40486     return(test_ret);
40487 }
40488
40489
40490 static int
40491 test_xmlUCSIsKannada(void) {
40492     int test_ret = 0;
40493
40494 #if defined(LIBXML_UNICODE_ENABLED)
40495     int mem_base;
40496     int ret_val;
40497     int code; /* UCS code point */
40498     int n_code;
40499
40500     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40501         mem_base = xmlMemBlocks();
40502         code = gen_int(n_code, 0);
40503
40504         ret_val = xmlUCSIsKannada(code);
40505         desret_int(ret_val);
40506         call_tests++;
40507         des_int(n_code, code, 0);
40508         xmlResetLastError();
40509         if (mem_base != xmlMemBlocks()) {
40510             printf("Leak of %d blocks found in xmlUCSIsKannada",
40511                    xmlMemBlocks() - mem_base);
40512             test_ret++;
40513             printf(" %d", n_code);
40514             printf("\n");
40515         }
40516     }
40517     function_tests++;
40518 #endif
40519
40520     return(test_ret);
40521 }
40522
40523
40524 static int
40525 test_xmlUCSIsKatakana(void) {
40526     int test_ret = 0;
40527
40528 #if defined(LIBXML_UNICODE_ENABLED)
40529     int mem_base;
40530     int ret_val;
40531     int code; /* UCS code point */
40532     int n_code;
40533
40534     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40535         mem_base = xmlMemBlocks();
40536         code = gen_int(n_code, 0);
40537
40538         ret_val = xmlUCSIsKatakana(code);
40539         desret_int(ret_val);
40540         call_tests++;
40541         des_int(n_code, code, 0);
40542         xmlResetLastError();
40543         if (mem_base != xmlMemBlocks()) {
40544             printf("Leak of %d blocks found in xmlUCSIsKatakana",
40545                    xmlMemBlocks() - mem_base);
40546             test_ret++;
40547             printf(" %d", n_code);
40548             printf("\n");
40549         }
40550     }
40551     function_tests++;
40552 #endif
40553
40554     return(test_ret);
40555 }
40556
40557
40558 static int
40559 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40560     int test_ret = 0;
40561
40562 #if defined(LIBXML_UNICODE_ENABLED)
40563     int mem_base;
40564     int ret_val;
40565     int code; /* UCS code point */
40566     int n_code;
40567
40568     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40569         mem_base = xmlMemBlocks();
40570         code = gen_int(n_code, 0);
40571
40572         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40573         desret_int(ret_val);
40574         call_tests++;
40575         des_int(n_code, code, 0);
40576         xmlResetLastError();
40577         if (mem_base != xmlMemBlocks()) {
40578             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40579                    xmlMemBlocks() - mem_base);
40580             test_ret++;
40581             printf(" %d", n_code);
40582             printf("\n");
40583         }
40584     }
40585     function_tests++;
40586 #endif
40587
40588     return(test_ret);
40589 }
40590
40591
40592 static int
40593 test_xmlUCSIsKhmer(void) {
40594     int test_ret = 0;
40595
40596 #if defined(LIBXML_UNICODE_ENABLED)
40597     int mem_base;
40598     int ret_val;
40599     int code; /* UCS code point */
40600     int n_code;
40601
40602     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40603         mem_base = xmlMemBlocks();
40604         code = gen_int(n_code, 0);
40605
40606         ret_val = xmlUCSIsKhmer(code);
40607         desret_int(ret_val);
40608         call_tests++;
40609         des_int(n_code, code, 0);
40610         xmlResetLastError();
40611         if (mem_base != xmlMemBlocks()) {
40612             printf("Leak of %d blocks found in xmlUCSIsKhmer",
40613                    xmlMemBlocks() - mem_base);
40614             test_ret++;
40615             printf(" %d", n_code);
40616             printf("\n");
40617         }
40618     }
40619     function_tests++;
40620 #endif
40621
40622     return(test_ret);
40623 }
40624
40625
40626 static int
40627 test_xmlUCSIsKhmerSymbols(void) {
40628     int test_ret = 0;
40629
40630 #if defined(LIBXML_UNICODE_ENABLED)
40631     int mem_base;
40632     int ret_val;
40633     int code; /* UCS code point */
40634     int n_code;
40635
40636     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40637         mem_base = xmlMemBlocks();
40638         code = gen_int(n_code, 0);
40639
40640         ret_val = xmlUCSIsKhmerSymbols(code);
40641         desret_int(ret_val);
40642         call_tests++;
40643         des_int(n_code, code, 0);
40644         xmlResetLastError();
40645         if (mem_base != xmlMemBlocks()) {
40646             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40647                    xmlMemBlocks() - mem_base);
40648             test_ret++;
40649             printf(" %d", n_code);
40650             printf("\n");
40651         }
40652     }
40653     function_tests++;
40654 #endif
40655
40656     return(test_ret);
40657 }
40658
40659
40660 static int
40661 test_xmlUCSIsLao(void) {
40662     int test_ret = 0;
40663
40664 #if defined(LIBXML_UNICODE_ENABLED)
40665     int mem_base;
40666     int ret_val;
40667     int code; /* UCS code point */
40668     int n_code;
40669
40670     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40671         mem_base = xmlMemBlocks();
40672         code = gen_int(n_code, 0);
40673
40674         ret_val = xmlUCSIsLao(code);
40675         desret_int(ret_val);
40676         call_tests++;
40677         des_int(n_code, code, 0);
40678         xmlResetLastError();
40679         if (mem_base != xmlMemBlocks()) {
40680             printf("Leak of %d blocks found in xmlUCSIsLao",
40681                    xmlMemBlocks() - mem_base);
40682             test_ret++;
40683             printf(" %d", n_code);
40684             printf("\n");
40685         }
40686     }
40687     function_tests++;
40688 #endif
40689
40690     return(test_ret);
40691 }
40692
40693
40694 static int
40695 test_xmlUCSIsLatin1Supplement(void) {
40696     int test_ret = 0;
40697
40698 #if defined(LIBXML_UNICODE_ENABLED)
40699     int mem_base;
40700     int ret_val;
40701     int code; /* UCS code point */
40702     int n_code;
40703
40704     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40705         mem_base = xmlMemBlocks();
40706         code = gen_int(n_code, 0);
40707
40708         ret_val = xmlUCSIsLatin1Supplement(code);
40709         desret_int(ret_val);
40710         call_tests++;
40711         des_int(n_code, code, 0);
40712         xmlResetLastError();
40713         if (mem_base != xmlMemBlocks()) {
40714             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40715                    xmlMemBlocks() - mem_base);
40716             test_ret++;
40717             printf(" %d", n_code);
40718             printf("\n");
40719         }
40720     }
40721     function_tests++;
40722 #endif
40723
40724     return(test_ret);
40725 }
40726
40727
40728 static int
40729 test_xmlUCSIsLatinExtendedA(void) {
40730     int test_ret = 0;
40731
40732 #if defined(LIBXML_UNICODE_ENABLED)
40733     int mem_base;
40734     int ret_val;
40735     int code; /* UCS code point */
40736     int n_code;
40737
40738     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40739         mem_base = xmlMemBlocks();
40740         code = gen_int(n_code, 0);
40741
40742         ret_val = xmlUCSIsLatinExtendedA(code);
40743         desret_int(ret_val);
40744         call_tests++;
40745         des_int(n_code, code, 0);
40746         xmlResetLastError();
40747         if (mem_base != xmlMemBlocks()) {
40748             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40749                    xmlMemBlocks() - mem_base);
40750             test_ret++;
40751             printf(" %d", n_code);
40752             printf("\n");
40753         }
40754     }
40755     function_tests++;
40756 #endif
40757
40758     return(test_ret);
40759 }
40760
40761
40762 static int
40763 test_xmlUCSIsLatinExtendedAdditional(void) {
40764     int test_ret = 0;
40765
40766 #if defined(LIBXML_UNICODE_ENABLED)
40767     int mem_base;
40768     int ret_val;
40769     int code; /* UCS code point */
40770     int n_code;
40771
40772     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40773         mem_base = xmlMemBlocks();
40774         code = gen_int(n_code, 0);
40775
40776         ret_val = xmlUCSIsLatinExtendedAdditional(code);
40777         desret_int(ret_val);
40778         call_tests++;
40779         des_int(n_code, code, 0);
40780         xmlResetLastError();
40781         if (mem_base != xmlMemBlocks()) {
40782             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40783                    xmlMemBlocks() - mem_base);
40784             test_ret++;
40785             printf(" %d", n_code);
40786             printf("\n");
40787         }
40788     }
40789     function_tests++;
40790 #endif
40791
40792     return(test_ret);
40793 }
40794
40795
40796 static int
40797 test_xmlUCSIsLatinExtendedB(void) {
40798     int test_ret = 0;
40799
40800 #if defined(LIBXML_UNICODE_ENABLED)
40801     int mem_base;
40802     int ret_val;
40803     int code; /* UCS code point */
40804     int n_code;
40805
40806     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40807         mem_base = xmlMemBlocks();
40808         code = gen_int(n_code, 0);
40809
40810         ret_val = xmlUCSIsLatinExtendedB(code);
40811         desret_int(ret_val);
40812         call_tests++;
40813         des_int(n_code, code, 0);
40814         xmlResetLastError();
40815         if (mem_base != xmlMemBlocks()) {
40816             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40817                    xmlMemBlocks() - mem_base);
40818             test_ret++;
40819             printf(" %d", n_code);
40820             printf("\n");
40821         }
40822     }
40823     function_tests++;
40824 #endif
40825
40826     return(test_ret);
40827 }
40828
40829
40830 static int
40831 test_xmlUCSIsLetterlikeSymbols(void) {
40832     int test_ret = 0;
40833
40834 #if defined(LIBXML_UNICODE_ENABLED)
40835     int mem_base;
40836     int ret_val;
40837     int code; /* UCS code point */
40838     int n_code;
40839
40840     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40841         mem_base = xmlMemBlocks();
40842         code = gen_int(n_code, 0);
40843
40844         ret_val = xmlUCSIsLetterlikeSymbols(code);
40845         desret_int(ret_val);
40846         call_tests++;
40847         des_int(n_code, code, 0);
40848         xmlResetLastError();
40849         if (mem_base != xmlMemBlocks()) {
40850             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40851                    xmlMemBlocks() - mem_base);
40852             test_ret++;
40853             printf(" %d", n_code);
40854             printf("\n");
40855         }
40856     }
40857     function_tests++;
40858 #endif
40859
40860     return(test_ret);
40861 }
40862
40863
40864 static int
40865 test_xmlUCSIsLimbu(void) {
40866     int test_ret = 0;
40867
40868 #if defined(LIBXML_UNICODE_ENABLED)
40869     int mem_base;
40870     int ret_val;
40871     int code; /* UCS code point */
40872     int n_code;
40873
40874     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40875         mem_base = xmlMemBlocks();
40876         code = gen_int(n_code, 0);
40877
40878         ret_val = xmlUCSIsLimbu(code);
40879         desret_int(ret_val);
40880         call_tests++;
40881         des_int(n_code, code, 0);
40882         xmlResetLastError();
40883         if (mem_base != xmlMemBlocks()) {
40884             printf("Leak of %d blocks found in xmlUCSIsLimbu",
40885                    xmlMemBlocks() - mem_base);
40886             test_ret++;
40887             printf(" %d", n_code);
40888             printf("\n");
40889         }
40890     }
40891     function_tests++;
40892 #endif
40893
40894     return(test_ret);
40895 }
40896
40897
40898 static int
40899 test_xmlUCSIsLinearBIdeograms(void) {
40900     int test_ret = 0;
40901
40902 #if defined(LIBXML_UNICODE_ENABLED)
40903     int mem_base;
40904     int ret_val;
40905     int code; /* UCS code point */
40906     int n_code;
40907
40908     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40909         mem_base = xmlMemBlocks();
40910         code = gen_int(n_code, 0);
40911
40912         ret_val = xmlUCSIsLinearBIdeograms(code);
40913         desret_int(ret_val);
40914         call_tests++;
40915         des_int(n_code, code, 0);
40916         xmlResetLastError();
40917         if (mem_base != xmlMemBlocks()) {
40918             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40919                    xmlMemBlocks() - mem_base);
40920             test_ret++;
40921             printf(" %d", n_code);
40922             printf("\n");
40923         }
40924     }
40925     function_tests++;
40926 #endif
40927
40928     return(test_ret);
40929 }
40930
40931
40932 static int
40933 test_xmlUCSIsLinearBSyllabary(void) {
40934     int test_ret = 0;
40935
40936 #if defined(LIBXML_UNICODE_ENABLED)
40937     int mem_base;
40938     int ret_val;
40939     int code; /* UCS code point */
40940     int n_code;
40941
40942     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40943         mem_base = xmlMemBlocks();
40944         code = gen_int(n_code, 0);
40945
40946         ret_val = xmlUCSIsLinearBSyllabary(code);
40947         desret_int(ret_val);
40948         call_tests++;
40949         des_int(n_code, code, 0);
40950         xmlResetLastError();
40951         if (mem_base != xmlMemBlocks()) {
40952             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40953                    xmlMemBlocks() - mem_base);
40954             test_ret++;
40955             printf(" %d", n_code);
40956             printf("\n");
40957         }
40958     }
40959     function_tests++;
40960 #endif
40961
40962     return(test_ret);
40963 }
40964
40965
40966 static int
40967 test_xmlUCSIsLowSurrogates(void) {
40968     int test_ret = 0;
40969
40970 #if defined(LIBXML_UNICODE_ENABLED)
40971     int mem_base;
40972     int ret_val;
40973     int code; /* UCS code point */
40974     int n_code;
40975
40976     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40977         mem_base = xmlMemBlocks();
40978         code = gen_int(n_code, 0);
40979
40980         ret_val = xmlUCSIsLowSurrogates(code);
40981         desret_int(ret_val);
40982         call_tests++;
40983         des_int(n_code, code, 0);
40984         xmlResetLastError();
40985         if (mem_base != xmlMemBlocks()) {
40986             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40987                    xmlMemBlocks() - mem_base);
40988             test_ret++;
40989             printf(" %d", n_code);
40990             printf("\n");
40991         }
40992     }
40993     function_tests++;
40994 #endif
40995
40996     return(test_ret);
40997 }
40998
40999
41000 static int
41001 test_xmlUCSIsMalayalam(void) {
41002     int test_ret = 0;
41003
41004 #if defined(LIBXML_UNICODE_ENABLED)
41005     int mem_base;
41006     int ret_val;
41007     int code; /* UCS code point */
41008     int n_code;
41009
41010     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41011         mem_base = xmlMemBlocks();
41012         code = gen_int(n_code, 0);
41013
41014         ret_val = xmlUCSIsMalayalam(code);
41015         desret_int(ret_val);
41016         call_tests++;
41017         des_int(n_code, code, 0);
41018         xmlResetLastError();
41019         if (mem_base != xmlMemBlocks()) {
41020             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41021                    xmlMemBlocks() - mem_base);
41022             test_ret++;
41023             printf(" %d", n_code);
41024             printf("\n");
41025         }
41026     }
41027     function_tests++;
41028 #endif
41029
41030     return(test_ret);
41031 }
41032
41033
41034 static int
41035 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41036     int test_ret = 0;
41037
41038 #if defined(LIBXML_UNICODE_ENABLED)
41039     int mem_base;
41040     int ret_val;
41041     int code; /* UCS code point */
41042     int n_code;
41043
41044     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41045         mem_base = xmlMemBlocks();
41046         code = gen_int(n_code, 0);
41047
41048         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41049         desret_int(ret_val);
41050         call_tests++;
41051         des_int(n_code, code, 0);
41052         xmlResetLastError();
41053         if (mem_base != xmlMemBlocks()) {
41054             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41055                    xmlMemBlocks() - mem_base);
41056             test_ret++;
41057             printf(" %d", n_code);
41058             printf("\n");
41059         }
41060     }
41061     function_tests++;
41062 #endif
41063
41064     return(test_ret);
41065 }
41066
41067
41068 static int
41069 test_xmlUCSIsMathematicalOperators(void) {
41070     int test_ret = 0;
41071
41072 #if defined(LIBXML_UNICODE_ENABLED)
41073     int mem_base;
41074     int ret_val;
41075     int code; /* UCS code point */
41076     int n_code;
41077
41078     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41079         mem_base = xmlMemBlocks();
41080         code = gen_int(n_code, 0);
41081
41082         ret_val = xmlUCSIsMathematicalOperators(code);
41083         desret_int(ret_val);
41084         call_tests++;
41085         des_int(n_code, code, 0);
41086         xmlResetLastError();
41087         if (mem_base != xmlMemBlocks()) {
41088             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41089                    xmlMemBlocks() - mem_base);
41090             test_ret++;
41091             printf(" %d", n_code);
41092             printf("\n");
41093         }
41094     }
41095     function_tests++;
41096 #endif
41097
41098     return(test_ret);
41099 }
41100
41101
41102 static int
41103 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41104     int test_ret = 0;
41105
41106 #if defined(LIBXML_UNICODE_ENABLED)
41107     int mem_base;
41108     int ret_val;
41109     int code; /* UCS code point */
41110     int n_code;
41111
41112     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41113         mem_base = xmlMemBlocks();
41114         code = gen_int(n_code, 0);
41115
41116         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41117         desret_int(ret_val);
41118         call_tests++;
41119         des_int(n_code, code, 0);
41120         xmlResetLastError();
41121         if (mem_base != xmlMemBlocks()) {
41122             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41123                    xmlMemBlocks() - mem_base);
41124             test_ret++;
41125             printf(" %d", n_code);
41126             printf("\n");
41127         }
41128     }
41129     function_tests++;
41130 #endif
41131
41132     return(test_ret);
41133 }
41134
41135
41136 static int
41137 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41138     int test_ret = 0;
41139
41140 #if defined(LIBXML_UNICODE_ENABLED)
41141     int mem_base;
41142     int ret_val;
41143     int code; /* UCS code point */
41144     int n_code;
41145
41146     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41147         mem_base = xmlMemBlocks();
41148         code = gen_int(n_code, 0);
41149
41150         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41151         desret_int(ret_val);
41152         call_tests++;
41153         des_int(n_code, code, 0);
41154         xmlResetLastError();
41155         if (mem_base != xmlMemBlocks()) {
41156             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41157                    xmlMemBlocks() - mem_base);
41158             test_ret++;
41159             printf(" %d", n_code);
41160             printf("\n");
41161         }
41162     }
41163     function_tests++;
41164 #endif
41165
41166     return(test_ret);
41167 }
41168
41169
41170 static int
41171 test_xmlUCSIsMiscellaneousSymbols(void) {
41172     int test_ret = 0;
41173
41174 #if defined(LIBXML_UNICODE_ENABLED)
41175     int mem_base;
41176     int ret_val;
41177     int code; /* UCS code point */
41178     int n_code;
41179
41180     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41181         mem_base = xmlMemBlocks();
41182         code = gen_int(n_code, 0);
41183
41184         ret_val = xmlUCSIsMiscellaneousSymbols(code);
41185         desret_int(ret_val);
41186         call_tests++;
41187         des_int(n_code, code, 0);
41188         xmlResetLastError();
41189         if (mem_base != xmlMemBlocks()) {
41190             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41191                    xmlMemBlocks() - mem_base);
41192             test_ret++;
41193             printf(" %d", n_code);
41194             printf("\n");
41195         }
41196     }
41197     function_tests++;
41198 #endif
41199
41200     return(test_ret);
41201 }
41202
41203
41204 static int
41205 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41206     int test_ret = 0;
41207
41208 #if defined(LIBXML_UNICODE_ENABLED)
41209     int mem_base;
41210     int ret_val;
41211     int code; /* UCS code point */
41212     int n_code;
41213
41214     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41215         mem_base = xmlMemBlocks();
41216         code = gen_int(n_code, 0);
41217
41218         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41219         desret_int(ret_val);
41220         call_tests++;
41221         des_int(n_code, code, 0);
41222         xmlResetLastError();
41223         if (mem_base != xmlMemBlocks()) {
41224             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41225                    xmlMemBlocks() - mem_base);
41226             test_ret++;
41227             printf(" %d", n_code);
41228             printf("\n");
41229         }
41230     }
41231     function_tests++;
41232 #endif
41233
41234     return(test_ret);
41235 }
41236
41237
41238 static int
41239 test_xmlUCSIsMiscellaneousTechnical(void) {
41240     int test_ret = 0;
41241
41242 #if defined(LIBXML_UNICODE_ENABLED)
41243     int mem_base;
41244     int ret_val;
41245     int code; /* UCS code point */
41246     int n_code;
41247
41248     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41249         mem_base = xmlMemBlocks();
41250         code = gen_int(n_code, 0);
41251
41252         ret_val = xmlUCSIsMiscellaneousTechnical(code);
41253         desret_int(ret_val);
41254         call_tests++;
41255         des_int(n_code, code, 0);
41256         xmlResetLastError();
41257         if (mem_base != xmlMemBlocks()) {
41258             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41259                    xmlMemBlocks() - mem_base);
41260             test_ret++;
41261             printf(" %d", n_code);
41262             printf("\n");
41263         }
41264     }
41265     function_tests++;
41266 #endif
41267
41268     return(test_ret);
41269 }
41270
41271
41272 static int
41273 test_xmlUCSIsMongolian(void) {
41274     int test_ret = 0;
41275
41276 #if defined(LIBXML_UNICODE_ENABLED)
41277     int mem_base;
41278     int ret_val;
41279     int code; /* UCS code point */
41280     int n_code;
41281
41282     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41283         mem_base = xmlMemBlocks();
41284         code = gen_int(n_code, 0);
41285
41286         ret_val = xmlUCSIsMongolian(code);
41287         desret_int(ret_val);
41288         call_tests++;
41289         des_int(n_code, code, 0);
41290         xmlResetLastError();
41291         if (mem_base != xmlMemBlocks()) {
41292             printf("Leak of %d blocks found in xmlUCSIsMongolian",
41293                    xmlMemBlocks() - mem_base);
41294             test_ret++;
41295             printf(" %d", n_code);
41296             printf("\n");
41297         }
41298     }
41299     function_tests++;
41300 #endif
41301
41302     return(test_ret);
41303 }
41304
41305
41306 static int
41307 test_xmlUCSIsMusicalSymbols(void) {
41308     int test_ret = 0;
41309
41310 #if defined(LIBXML_UNICODE_ENABLED)
41311     int mem_base;
41312     int ret_val;
41313     int code; /* UCS code point */
41314     int n_code;
41315
41316     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41317         mem_base = xmlMemBlocks();
41318         code = gen_int(n_code, 0);
41319
41320         ret_val = xmlUCSIsMusicalSymbols(code);
41321         desret_int(ret_val);
41322         call_tests++;
41323         des_int(n_code, code, 0);
41324         xmlResetLastError();
41325         if (mem_base != xmlMemBlocks()) {
41326             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41327                    xmlMemBlocks() - mem_base);
41328             test_ret++;
41329             printf(" %d", n_code);
41330             printf("\n");
41331         }
41332     }
41333     function_tests++;
41334 #endif
41335
41336     return(test_ret);
41337 }
41338
41339
41340 static int
41341 test_xmlUCSIsMyanmar(void) {
41342     int test_ret = 0;
41343
41344 #if defined(LIBXML_UNICODE_ENABLED)
41345     int mem_base;
41346     int ret_val;
41347     int code; /* UCS code point */
41348     int n_code;
41349
41350     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41351         mem_base = xmlMemBlocks();
41352         code = gen_int(n_code, 0);
41353
41354         ret_val = xmlUCSIsMyanmar(code);
41355         desret_int(ret_val);
41356         call_tests++;
41357         des_int(n_code, code, 0);
41358         xmlResetLastError();
41359         if (mem_base != xmlMemBlocks()) {
41360             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41361                    xmlMemBlocks() - mem_base);
41362             test_ret++;
41363             printf(" %d", n_code);
41364             printf("\n");
41365         }
41366     }
41367     function_tests++;
41368 #endif
41369
41370     return(test_ret);
41371 }
41372
41373
41374 static int
41375 test_xmlUCSIsNumberForms(void) {
41376     int test_ret = 0;
41377
41378 #if defined(LIBXML_UNICODE_ENABLED)
41379     int mem_base;
41380     int ret_val;
41381     int code; /* UCS code point */
41382     int n_code;
41383
41384     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41385         mem_base = xmlMemBlocks();
41386         code = gen_int(n_code, 0);
41387
41388         ret_val = xmlUCSIsNumberForms(code);
41389         desret_int(ret_val);
41390         call_tests++;
41391         des_int(n_code, code, 0);
41392         xmlResetLastError();
41393         if (mem_base != xmlMemBlocks()) {
41394             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41395                    xmlMemBlocks() - mem_base);
41396             test_ret++;
41397             printf(" %d", n_code);
41398             printf("\n");
41399         }
41400     }
41401     function_tests++;
41402 #endif
41403
41404     return(test_ret);
41405 }
41406
41407
41408 static int
41409 test_xmlUCSIsOgham(void) {
41410     int test_ret = 0;
41411
41412 #if defined(LIBXML_UNICODE_ENABLED)
41413     int mem_base;
41414     int ret_val;
41415     int code; /* UCS code point */
41416     int n_code;
41417
41418     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41419         mem_base = xmlMemBlocks();
41420         code = gen_int(n_code, 0);
41421
41422         ret_val = xmlUCSIsOgham(code);
41423         desret_int(ret_val);
41424         call_tests++;
41425         des_int(n_code, code, 0);
41426         xmlResetLastError();
41427         if (mem_base != xmlMemBlocks()) {
41428             printf("Leak of %d blocks found in xmlUCSIsOgham",
41429                    xmlMemBlocks() - mem_base);
41430             test_ret++;
41431             printf(" %d", n_code);
41432             printf("\n");
41433         }
41434     }
41435     function_tests++;
41436 #endif
41437
41438     return(test_ret);
41439 }
41440
41441
41442 static int
41443 test_xmlUCSIsOldItalic(void) {
41444     int test_ret = 0;
41445
41446 #if defined(LIBXML_UNICODE_ENABLED)
41447     int mem_base;
41448     int ret_val;
41449     int code; /* UCS code point */
41450     int n_code;
41451
41452     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41453         mem_base = xmlMemBlocks();
41454         code = gen_int(n_code, 0);
41455
41456         ret_val = xmlUCSIsOldItalic(code);
41457         desret_int(ret_val);
41458         call_tests++;
41459         des_int(n_code, code, 0);
41460         xmlResetLastError();
41461         if (mem_base != xmlMemBlocks()) {
41462             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41463                    xmlMemBlocks() - mem_base);
41464             test_ret++;
41465             printf(" %d", n_code);
41466             printf("\n");
41467         }
41468     }
41469     function_tests++;
41470 #endif
41471
41472     return(test_ret);
41473 }
41474
41475
41476 static int
41477 test_xmlUCSIsOpticalCharacterRecognition(void) {
41478     int test_ret = 0;
41479
41480 #if defined(LIBXML_UNICODE_ENABLED)
41481     int mem_base;
41482     int ret_val;
41483     int code; /* UCS code point */
41484     int n_code;
41485
41486     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41487         mem_base = xmlMemBlocks();
41488         code = gen_int(n_code, 0);
41489
41490         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41491         desret_int(ret_val);
41492         call_tests++;
41493         des_int(n_code, code, 0);
41494         xmlResetLastError();
41495         if (mem_base != xmlMemBlocks()) {
41496             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41497                    xmlMemBlocks() - mem_base);
41498             test_ret++;
41499             printf(" %d", n_code);
41500             printf("\n");
41501         }
41502     }
41503     function_tests++;
41504 #endif
41505
41506     return(test_ret);
41507 }
41508
41509
41510 static int
41511 test_xmlUCSIsOriya(void) {
41512     int test_ret = 0;
41513
41514 #if defined(LIBXML_UNICODE_ENABLED)
41515     int mem_base;
41516     int ret_val;
41517     int code; /* UCS code point */
41518     int n_code;
41519
41520     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41521         mem_base = xmlMemBlocks();
41522         code = gen_int(n_code, 0);
41523
41524         ret_val = xmlUCSIsOriya(code);
41525         desret_int(ret_val);
41526         call_tests++;
41527         des_int(n_code, code, 0);
41528         xmlResetLastError();
41529         if (mem_base != xmlMemBlocks()) {
41530             printf("Leak of %d blocks found in xmlUCSIsOriya",
41531                    xmlMemBlocks() - mem_base);
41532             test_ret++;
41533             printf(" %d", n_code);
41534             printf("\n");
41535         }
41536     }
41537     function_tests++;
41538 #endif
41539
41540     return(test_ret);
41541 }
41542
41543
41544 static int
41545 test_xmlUCSIsOsmanya(void) {
41546     int test_ret = 0;
41547
41548 #if defined(LIBXML_UNICODE_ENABLED)
41549     int mem_base;
41550     int ret_val;
41551     int code; /* UCS code point */
41552     int n_code;
41553
41554     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41555         mem_base = xmlMemBlocks();
41556         code = gen_int(n_code, 0);
41557
41558         ret_val = xmlUCSIsOsmanya(code);
41559         desret_int(ret_val);
41560         call_tests++;
41561         des_int(n_code, code, 0);
41562         xmlResetLastError();
41563         if (mem_base != xmlMemBlocks()) {
41564             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41565                    xmlMemBlocks() - mem_base);
41566             test_ret++;
41567             printf(" %d", n_code);
41568             printf("\n");
41569         }
41570     }
41571     function_tests++;
41572 #endif
41573
41574     return(test_ret);
41575 }
41576
41577
41578 static int
41579 test_xmlUCSIsPhoneticExtensions(void) {
41580     int test_ret = 0;
41581
41582 #if defined(LIBXML_UNICODE_ENABLED)
41583     int mem_base;
41584     int ret_val;
41585     int code; /* UCS code point */
41586     int n_code;
41587
41588     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41589         mem_base = xmlMemBlocks();
41590         code = gen_int(n_code, 0);
41591
41592         ret_val = xmlUCSIsPhoneticExtensions(code);
41593         desret_int(ret_val);
41594         call_tests++;
41595         des_int(n_code, code, 0);
41596         xmlResetLastError();
41597         if (mem_base != xmlMemBlocks()) {
41598             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41599                    xmlMemBlocks() - mem_base);
41600             test_ret++;
41601             printf(" %d", n_code);
41602             printf("\n");
41603         }
41604     }
41605     function_tests++;
41606 #endif
41607
41608     return(test_ret);
41609 }
41610
41611
41612 static int
41613 test_xmlUCSIsPrivateUse(void) {
41614     int test_ret = 0;
41615
41616 #if defined(LIBXML_UNICODE_ENABLED)
41617     int mem_base;
41618     int ret_val;
41619     int code; /* UCS code point */
41620     int n_code;
41621
41622     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41623         mem_base = xmlMemBlocks();
41624         code = gen_int(n_code, 0);
41625
41626         ret_val = xmlUCSIsPrivateUse(code);
41627         desret_int(ret_val);
41628         call_tests++;
41629         des_int(n_code, code, 0);
41630         xmlResetLastError();
41631         if (mem_base != xmlMemBlocks()) {
41632             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41633                    xmlMemBlocks() - mem_base);
41634             test_ret++;
41635             printf(" %d", n_code);
41636             printf("\n");
41637         }
41638     }
41639     function_tests++;
41640 #endif
41641
41642     return(test_ret);
41643 }
41644
41645
41646 static int
41647 test_xmlUCSIsPrivateUseArea(void) {
41648     int test_ret = 0;
41649
41650 #if defined(LIBXML_UNICODE_ENABLED)
41651     int mem_base;
41652     int ret_val;
41653     int code; /* UCS code point */
41654     int n_code;
41655
41656     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41657         mem_base = xmlMemBlocks();
41658         code = gen_int(n_code, 0);
41659
41660         ret_val = xmlUCSIsPrivateUseArea(code);
41661         desret_int(ret_val);
41662         call_tests++;
41663         des_int(n_code, code, 0);
41664         xmlResetLastError();
41665         if (mem_base != xmlMemBlocks()) {
41666             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41667                    xmlMemBlocks() - mem_base);
41668             test_ret++;
41669             printf(" %d", n_code);
41670             printf("\n");
41671         }
41672     }
41673     function_tests++;
41674 #endif
41675
41676     return(test_ret);
41677 }
41678
41679
41680 static int
41681 test_xmlUCSIsRunic(void) {
41682     int test_ret = 0;
41683
41684 #if defined(LIBXML_UNICODE_ENABLED)
41685     int mem_base;
41686     int ret_val;
41687     int code; /* UCS code point */
41688     int n_code;
41689
41690     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41691         mem_base = xmlMemBlocks();
41692         code = gen_int(n_code, 0);
41693
41694         ret_val = xmlUCSIsRunic(code);
41695         desret_int(ret_val);
41696         call_tests++;
41697         des_int(n_code, code, 0);
41698         xmlResetLastError();
41699         if (mem_base != xmlMemBlocks()) {
41700             printf("Leak of %d blocks found in xmlUCSIsRunic",
41701                    xmlMemBlocks() - mem_base);
41702             test_ret++;
41703             printf(" %d", n_code);
41704             printf("\n");
41705         }
41706     }
41707     function_tests++;
41708 #endif
41709
41710     return(test_ret);
41711 }
41712
41713
41714 static int
41715 test_xmlUCSIsShavian(void) {
41716     int test_ret = 0;
41717
41718 #if defined(LIBXML_UNICODE_ENABLED)
41719     int mem_base;
41720     int ret_val;
41721     int code; /* UCS code point */
41722     int n_code;
41723
41724     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41725         mem_base = xmlMemBlocks();
41726         code = gen_int(n_code, 0);
41727
41728         ret_val = xmlUCSIsShavian(code);
41729         desret_int(ret_val);
41730         call_tests++;
41731         des_int(n_code, code, 0);
41732         xmlResetLastError();
41733         if (mem_base != xmlMemBlocks()) {
41734             printf("Leak of %d blocks found in xmlUCSIsShavian",
41735                    xmlMemBlocks() - mem_base);
41736             test_ret++;
41737             printf(" %d", n_code);
41738             printf("\n");
41739         }
41740     }
41741     function_tests++;
41742 #endif
41743
41744     return(test_ret);
41745 }
41746
41747
41748 static int
41749 test_xmlUCSIsSinhala(void) {
41750     int test_ret = 0;
41751
41752 #if defined(LIBXML_UNICODE_ENABLED)
41753     int mem_base;
41754     int ret_val;
41755     int code; /* UCS code point */
41756     int n_code;
41757
41758     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41759         mem_base = xmlMemBlocks();
41760         code = gen_int(n_code, 0);
41761
41762         ret_val = xmlUCSIsSinhala(code);
41763         desret_int(ret_val);
41764         call_tests++;
41765         des_int(n_code, code, 0);
41766         xmlResetLastError();
41767         if (mem_base != xmlMemBlocks()) {
41768             printf("Leak of %d blocks found in xmlUCSIsSinhala",
41769                    xmlMemBlocks() - mem_base);
41770             test_ret++;
41771             printf(" %d", n_code);
41772             printf("\n");
41773         }
41774     }
41775     function_tests++;
41776 #endif
41777
41778     return(test_ret);
41779 }
41780
41781
41782 static int
41783 test_xmlUCSIsSmallFormVariants(void) {
41784     int test_ret = 0;
41785
41786 #if defined(LIBXML_UNICODE_ENABLED)
41787     int mem_base;
41788     int ret_val;
41789     int code; /* UCS code point */
41790     int n_code;
41791
41792     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41793         mem_base = xmlMemBlocks();
41794         code = gen_int(n_code, 0);
41795
41796         ret_val = xmlUCSIsSmallFormVariants(code);
41797         desret_int(ret_val);
41798         call_tests++;
41799         des_int(n_code, code, 0);
41800         xmlResetLastError();
41801         if (mem_base != xmlMemBlocks()) {
41802             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41803                    xmlMemBlocks() - mem_base);
41804             test_ret++;
41805             printf(" %d", n_code);
41806             printf("\n");
41807         }
41808     }
41809     function_tests++;
41810 #endif
41811
41812     return(test_ret);
41813 }
41814
41815
41816 static int
41817 test_xmlUCSIsSpacingModifierLetters(void) {
41818     int test_ret = 0;
41819
41820 #if defined(LIBXML_UNICODE_ENABLED)
41821     int mem_base;
41822     int ret_val;
41823     int code; /* UCS code point */
41824     int n_code;
41825
41826     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41827         mem_base = xmlMemBlocks();
41828         code = gen_int(n_code, 0);
41829
41830         ret_val = xmlUCSIsSpacingModifierLetters(code);
41831         desret_int(ret_val);
41832         call_tests++;
41833         des_int(n_code, code, 0);
41834         xmlResetLastError();
41835         if (mem_base != xmlMemBlocks()) {
41836             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41837                    xmlMemBlocks() - mem_base);
41838             test_ret++;
41839             printf(" %d", n_code);
41840             printf("\n");
41841         }
41842     }
41843     function_tests++;
41844 #endif
41845
41846     return(test_ret);
41847 }
41848
41849
41850 static int
41851 test_xmlUCSIsSpecials(void) {
41852     int test_ret = 0;
41853
41854 #if defined(LIBXML_UNICODE_ENABLED)
41855     int mem_base;
41856     int ret_val;
41857     int code; /* UCS code point */
41858     int n_code;
41859
41860     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41861         mem_base = xmlMemBlocks();
41862         code = gen_int(n_code, 0);
41863
41864         ret_val = xmlUCSIsSpecials(code);
41865         desret_int(ret_val);
41866         call_tests++;
41867         des_int(n_code, code, 0);
41868         xmlResetLastError();
41869         if (mem_base != xmlMemBlocks()) {
41870             printf("Leak of %d blocks found in xmlUCSIsSpecials",
41871                    xmlMemBlocks() - mem_base);
41872             test_ret++;
41873             printf(" %d", n_code);
41874             printf("\n");
41875         }
41876     }
41877     function_tests++;
41878 #endif
41879
41880     return(test_ret);
41881 }
41882
41883
41884 static int
41885 test_xmlUCSIsSuperscriptsandSubscripts(void) {
41886     int test_ret = 0;
41887
41888 #if defined(LIBXML_UNICODE_ENABLED)
41889     int mem_base;
41890     int ret_val;
41891     int code; /* UCS code point */
41892     int n_code;
41893
41894     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41895         mem_base = xmlMemBlocks();
41896         code = gen_int(n_code, 0);
41897
41898         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41899         desret_int(ret_val);
41900         call_tests++;
41901         des_int(n_code, code, 0);
41902         xmlResetLastError();
41903         if (mem_base != xmlMemBlocks()) {
41904             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41905                    xmlMemBlocks() - mem_base);
41906             test_ret++;
41907             printf(" %d", n_code);
41908             printf("\n");
41909         }
41910     }
41911     function_tests++;
41912 #endif
41913
41914     return(test_ret);
41915 }
41916
41917
41918 static int
41919 test_xmlUCSIsSupplementalArrowsA(void) {
41920     int test_ret = 0;
41921
41922 #if defined(LIBXML_UNICODE_ENABLED)
41923     int mem_base;
41924     int ret_val;
41925     int code; /* UCS code point */
41926     int n_code;
41927
41928     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41929         mem_base = xmlMemBlocks();
41930         code = gen_int(n_code, 0);
41931
41932         ret_val = xmlUCSIsSupplementalArrowsA(code);
41933         desret_int(ret_val);
41934         call_tests++;
41935         des_int(n_code, code, 0);
41936         xmlResetLastError();
41937         if (mem_base != xmlMemBlocks()) {
41938             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41939                    xmlMemBlocks() - mem_base);
41940             test_ret++;
41941             printf(" %d", n_code);
41942             printf("\n");
41943         }
41944     }
41945     function_tests++;
41946 #endif
41947
41948     return(test_ret);
41949 }
41950
41951
41952 static int
41953 test_xmlUCSIsSupplementalArrowsB(void) {
41954     int test_ret = 0;
41955
41956 #if defined(LIBXML_UNICODE_ENABLED)
41957     int mem_base;
41958     int ret_val;
41959     int code; /* UCS code point */
41960     int n_code;
41961
41962     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41963         mem_base = xmlMemBlocks();
41964         code = gen_int(n_code, 0);
41965
41966         ret_val = xmlUCSIsSupplementalArrowsB(code);
41967         desret_int(ret_val);
41968         call_tests++;
41969         des_int(n_code, code, 0);
41970         xmlResetLastError();
41971         if (mem_base != xmlMemBlocks()) {
41972             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41973                    xmlMemBlocks() - mem_base);
41974             test_ret++;
41975             printf(" %d", n_code);
41976             printf("\n");
41977         }
41978     }
41979     function_tests++;
41980 #endif
41981
41982     return(test_ret);
41983 }
41984
41985
41986 static int
41987 test_xmlUCSIsSupplementalMathematicalOperators(void) {
41988     int test_ret = 0;
41989
41990 #if defined(LIBXML_UNICODE_ENABLED)
41991     int mem_base;
41992     int ret_val;
41993     int code; /* UCS code point */
41994     int n_code;
41995
41996     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41997         mem_base = xmlMemBlocks();
41998         code = gen_int(n_code, 0);
41999
42000         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42001         desret_int(ret_val);
42002         call_tests++;
42003         des_int(n_code, code, 0);
42004         xmlResetLastError();
42005         if (mem_base != xmlMemBlocks()) {
42006             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42007                    xmlMemBlocks() - mem_base);
42008             test_ret++;
42009             printf(" %d", n_code);
42010             printf("\n");
42011         }
42012     }
42013     function_tests++;
42014 #endif
42015
42016     return(test_ret);
42017 }
42018
42019
42020 static int
42021 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42022     int test_ret = 0;
42023
42024 #if defined(LIBXML_UNICODE_ENABLED)
42025     int mem_base;
42026     int ret_val;
42027     int code; /* UCS code point */
42028     int n_code;
42029
42030     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42031         mem_base = xmlMemBlocks();
42032         code = gen_int(n_code, 0);
42033
42034         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42035         desret_int(ret_val);
42036         call_tests++;
42037         des_int(n_code, code, 0);
42038         xmlResetLastError();
42039         if (mem_base != xmlMemBlocks()) {
42040             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42041                    xmlMemBlocks() - mem_base);
42042             test_ret++;
42043             printf(" %d", n_code);
42044             printf("\n");
42045         }
42046     }
42047     function_tests++;
42048 #endif
42049
42050     return(test_ret);
42051 }
42052
42053
42054 static int
42055 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42056     int test_ret = 0;
42057
42058 #if defined(LIBXML_UNICODE_ENABLED)
42059     int mem_base;
42060     int ret_val;
42061     int code; /* UCS code point */
42062     int n_code;
42063
42064     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42065         mem_base = xmlMemBlocks();
42066         code = gen_int(n_code, 0);
42067
42068         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42069         desret_int(ret_val);
42070         call_tests++;
42071         des_int(n_code, code, 0);
42072         xmlResetLastError();
42073         if (mem_base != xmlMemBlocks()) {
42074             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42075                    xmlMemBlocks() - mem_base);
42076             test_ret++;
42077             printf(" %d", n_code);
42078             printf("\n");
42079         }
42080     }
42081     function_tests++;
42082 #endif
42083
42084     return(test_ret);
42085 }
42086
42087
42088 static int
42089 test_xmlUCSIsSyriac(void) {
42090     int test_ret = 0;
42091
42092 #if defined(LIBXML_UNICODE_ENABLED)
42093     int mem_base;
42094     int ret_val;
42095     int code; /* UCS code point */
42096     int n_code;
42097
42098     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42099         mem_base = xmlMemBlocks();
42100         code = gen_int(n_code, 0);
42101
42102         ret_val = xmlUCSIsSyriac(code);
42103         desret_int(ret_val);
42104         call_tests++;
42105         des_int(n_code, code, 0);
42106         xmlResetLastError();
42107         if (mem_base != xmlMemBlocks()) {
42108             printf("Leak of %d blocks found in xmlUCSIsSyriac",
42109                    xmlMemBlocks() - mem_base);
42110             test_ret++;
42111             printf(" %d", n_code);
42112             printf("\n");
42113         }
42114     }
42115     function_tests++;
42116 #endif
42117
42118     return(test_ret);
42119 }
42120
42121
42122 static int
42123 test_xmlUCSIsTagalog(void) {
42124     int test_ret = 0;
42125
42126 #if defined(LIBXML_UNICODE_ENABLED)
42127     int mem_base;
42128     int ret_val;
42129     int code; /* UCS code point */
42130     int n_code;
42131
42132     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42133         mem_base = xmlMemBlocks();
42134         code = gen_int(n_code, 0);
42135
42136         ret_val = xmlUCSIsTagalog(code);
42137         desret_int(ret_val);
42138         call_tests++;
42139         des_int(n_code, code, 0);
42140         xmlResetLastError();
42141         if (mem_base != xmlMemBlocks()) {
42142             printf("Leak of %d blocks found in xmlUCSIsTagalog",
42143                    xmlMemBlocks() - mem_base);
42144             test_ret++;
42145             printf(" %d", n_code);
42146             printf("\n");
42147         }
42148     }
42149     function_tests++;
42150 #endif
42151
42152     return(test_ret);
42153 }
42154
42155
42156 static int
42157 test_xmlUCSIsTagbanwa(void) {
42158     int test_ret = 0;
42159
42160 #if defined(LIBXML_UNICODE_ENABLED)
42161     int mem_base;
42162     int ret_val;
42163     int code; /* UCS code point */
42164     int n_code;
42165
42166     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42167         mem_base = xmlMemBlocks();
42168         code = gen_int(n_code, 0);
42169
42170         ret_val = xmlUCSIsTagbanwa(code);
42171         desret_int(ret_val);
42172         call_tests++;
42173         des_int(n_code, code, 0);
42174         xmlResetLastError();
42175         if (mem_base != xmlMemBlocks()) {
42176             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42177                    xmlMemBlocks() - mem_base);
42178             test_ret++;
42179             printf(" %d", n_code);
42180             printf("\n");
42181         }
42182     }
42183     function_tests++;
42184 #endif
42185
42186     return(test_ret);
42187 }
42188
42189
42190 static int
42191 test_xmlUCSIsTags(void) {
42192     int test_ret = 0;
42193
42194 #if defined(LIBXML_UNICODE_ENABLED)
42195     int mem_base;
42196     int ret_val;
42197     int code; /* UCS code point */
42198     int n_code;
42199
42200     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42201         mem_base = xmlMemBlocks();
42202         code = gen_int(n_code, 0);
42203
42204         ret_val = xmlUCSIsTags(code);
42205         desret_int(ret_val);
42206         call_tests++;
42207         des_int(n_code, code, 0);
42208         xmlResetLastError();
42209         if (mem_base != xmlMemBlocks()) {
42210             printf("Leak of %d blocks found in xmlUCSIsTags",
42211                    xmlMemBlocks() - mem_base);
42212             test_ret++;
42213             printf(" %d", n_code);
42214             printf("\n");
42215         }
42216     }
42217     function_tests++;
42218 #endif
42219
42220     return(test_ret);
42221 }
42222
42223
42224 static int
42225 test_xmlUCSIsTaiLe(void) {
42226     int test_ret = 0;
42227
42228 #if defined(LIBXML_UNICODE_ENABLED)
42229     int mem_base;
42230     int ret_val;
42231     int code; /* UCS code point */
42232     int n_code;
42233
42234     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42235         mem_base = xmlMemBlocks();
42236         code = gen_int(n_code, 0);
42237
42238         ret_val = xmlUCSIsTaiLe(code);
42239         desret_int(ret_val);
42240         call_tests++;
42241         des_int(n_code, code, 0);
42242         xmlResetLastError();
42243         if (mem_base != xmlMemBlocks()) {
42244             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42245                    xmlMemBlocks() - mem_base);
42246             test_ret++;
42247             printf(" %d", n_code);
42248             printf("\n");
42249         }
42250     }
42251     function_tests++;
42252 #endif
42253
42254     return(test_ret);
42255 }
42256
42257
42258 static int
42259 test_xmlUCSIsTaiXuanJingSymbols(void) {
42260     int test_ret = 0;
42261
42262 #if defined(LIBXML_UNICODE_ENABLED)
42263     int mem_base;
42264     int ret_val;
42265     int code; /* UCS code point */
42266     int n_code;
42267
42268     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42269         mem_base = xmlMemBlocks();
42270         code = gen_int(n_code, 0);
42271
42272         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42273         desret_int(ret_val);
42274         call_tests++;
42275         des_int(n_code, code, 0);
42276         xmlResetLastError();
42277         if (mem_base != xmlMemBlocks()) {
42278             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42279                    xmlMemBlocks() - mem_base);
42280             test_ret++;
42281             printf(" %d", n_code);
42282             printf("\n");
42283         }
42284     }
42285     function_tests++;
42286 #endif
42287
42288     return(test_ret);
42289 }
42290
42291
42292 static int
42293 test_xmlUCSIsTamil(void) {
42294     int test_ret = 0;
42295
42296 #if defined(LIBXML_UNICODE_ENABLED)
42297     int mem_base;
42298     int ret_val;
42299     int code; /* UCS code point */
42300     int n_code;
42301
42302     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42303         mem_base = xmlMemBlocks();
42304         code = gen_int(n_code, 0);
42305
42306         ret_val = xmlUCSIsTamil(code);
42307         desret_int(ret_val);
42308         call_tests++;
42309         des_int(n_code, code, 0);
42310         xmlResetLastError();
42311         if (mem_base != xmlMemBlocks()) {
42312             printf("Leak of %d blocks found in xmlUCSIsTamil",
42313                    xmlMemBlocks() - mem_base);
42314             test_ret++;
42315             printf(" %d", n_code);
42316             printf("\n");
42317         }
42318     }
42319     function_tests++;
42320 #endif
42321
42322     return(test_ret);
42323 }
42324
42325
42326 static int
42327 test_xmlUCSIsTelugu(void) {
42328     int test_ret = 0;
42329
42330 #if defined(LIBXML_UNICODE_ENABLED)
42331     int mem_base;
42332     int ret_val;
42333     int code; /* UCS code point */
42334     int n_code;
42335
42336     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42337         mem_base = xmlMemBlocks();
42338         code = gen_int(n_code, 0);
42339
42340         ret_val = xmlUCSIsTelugu(code);
42341         desret_int(ret_val);
42342         call_tests++;
42343         des_int(n_code, code, 0);
42344         xmlResetLastError();
42345         if (mem_base != xmlMemBlocks()) {
42346             printf("Leak of %d blocks found in xmlUCSIsTelugu",
42347                    xmlMemBlocks() - mem_base);
42348             test_ret++;
42349             printf(" %d", n_code);
42350             printf("\n");
42351         }
42352     }
42353     function_tests++;
42354 #endif
42355
42356     return(test_ret);
42357 }
42358
42359
42360 static int
42361 test_xmlUCSIsThaana(void) {
42362     int test_ret = 0;
42363
42364 #if defined(LIBXML_UNICODE_ENABLED)
42365     int mem_base;
42366     int ret_val;
42367     int code; /* UCS code point */
42368     int n_code;
42369
42370     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42371         mem_base = xmlMemBlocks();
42372         code = gen_int(n_code, 0);
42373
42374         ret_val = xmlUCSIsThaana(code);
42375         desret_int(ret_val);
42376         call_tests++;
42377         des_int(n_code, code, 0);
42378         xmlResetLastError();
42379         if (mem_base != xmlMemBlocks()) {
42380             printf("Leak of %d blocks found in xmlUCSIsThaana",
42381                    xmlMemBlocks() - mem_base);
42382             test_ret++;
42383             printf(" %d", n_code);
42384             printf("\n");
42385         }
42386     }
42387     function_tests++;
42388 #endif
42389
42390     return(test_ret);
42391 }
42392
42393
42394 static int
42395 test_xmlUCSIsThai(void) {
42396     int test_ret = 0;
42397
42398 #if defined(LIBXML_UNICODE_ENABLED)
42399     int mem_base;
42400     int ret_val;
42401     int code; /* UCS code point */
42402     int n_code;
42403
42404     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42405         mem_base = xmlMemBlocks();
42406         code = gen_int(n_code, 0);
42407
42408         ret_val = xmlUCSIsThai(code);
42409         desret_int(ret_val);
42410         call_tests++;
42411         des_int(n_code, code, 0);
42412         xmlResetLastError();
42413         if (mem_base != xmlMemBlocks()) {
42414             printf("Leak of %d blocks found in xmlUCSIsThai",
42415                    xmlMemBlocks() - mem_base);
42416             test_ret++;
42417             printf(" %d", n_code);
42418             printf("\n");
42419         }
42420     }
42421     function_tests++;
42422 #endif
42423
42424     return(test_ret);
42425 }
42426
42427
42428 static int
42429 test_xmlUCSIsTibetan(void) {
42430     int test_ret = 0;
42431
42432 #if defined(LIBXML_UNICODE_ENABLED)
42433     int mem_base;
42434     int ret_val;
42435     int code; /* UCS code point */
42436     int n_code;
42437
42438     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42439         mem_base = xmlMemBlocks();
42440         code = gen_int(n_code, 0);
42441
42442         ret_val = xmlUCSIsTibetan(code);
42443         desret_int(ret_val);
42444         call_tests++;
42445         des_int(n_code, code, 0);
42446         xmlResetLastError();
42447         if (mem_base != xmlMemBlocks()) {
42448             printf("Leak of %d blocks found in xmlUCSIsTibetan",
42449                    xmlMemBlocks() - mem_base);
42450             test_ret++;
42451             printf(" %d", n_code);
42452             printf("\n");
42453         }
42454     }
42455     function_tests++;
42456 #endif
42457
42458     return(test_ret);
42459 }
42460
42461
42462 static int
42463 test_xmlUCSIsUgaritic(void) {
42464     int test_ret = 0;
42465
42466 #if defined(LIBXML_UNICODE_ENABLED)
42467     int mem_base;
42468     int ret_val;
42469     int code; /* UCS code point */
42470     int n_code;
42471
42472     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42473         mem_base = xmlMemBlocks();
42474         code = gen_int(n_code, 0);
42475
42476         ret_val = xmlUCSIsUgaritic(code);
42477         desret_int(ret_val);
42478         call_tests++;
42479         des_int(n_code, code, 0);
42480         xmlResetLastError();
42481         if (mem_base != xmlMemBlocks()) {
42482             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42483                    xmlMemBlocks() - mem_base);
42484             test_ret++;
42485             printf(" %d", n_code);
42486             printf("\n");
42487         }
42488     }
42489     function_tests++;
42490 #endif
42491
42492     return(test_ret);
42493 }
42494
42495
42496 static int
42497 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42498     int test_ret = 0;
42499
42500 #if defined(LIBXML_UNICODE_ENABLED)
42501     int mem_base;
42502     int ret_val;
42503     int code; /* UCS code point */
42504     int n_code;
42505
42506     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42507         mem_base = xmlMemBlocks();
42508         code = gen_int(n_code, 0);
42509
42510         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42511         desret_int(ret_val);
42512         call_tests++;
42513         des_int(n_code, code, 0);
42514         xmlResetLastError();
42515         if (mem_base != xmlMemBlocks()) {
42516             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42517                    xmlMemBlocks() - mem_base);
42518             test_ret++;
42519             printf(" %d", n_code);
42520             printf("\n");
42521         }
42522     }
42523     function_tests++;
42524 #endif
42525
42526     return(test_ret);
42527 }
42528
42529
42530 static int
42531 test_xmlUCSIsVariationSelectors(void) {
42532     int test_ret = 0;
42533
42534 #if defined(LIBXML_UNICODE_ENABLED)
42535     int mem_base;
42536     int ret_val;
42537     int code; /* UCS code point */
42538     int n_code;
42539
42540     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42541         mem_base = xmlMemBlocks();
42542         code = gen_int(n_code, 0);
42543
42544         ret_val = xmlUCSIsVariationSelectors(code);
42545         desret_int(ret_val);
42546         call_tests++;
42547         des_int(n_code, code, 0);
42548         xmlResetLastError();
42549         if (mem_base != xmlMemBlocks()) {
42550             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42551                    xmlMemBlocks() - mem_base);
42552             test_ret++;
42553             printf(" %d", n_code);
42554             printf("\n");
42555         }
42556     }
42557     function_tests++;
42558 #endif
42559
42560     return(test_ret);
42561 }
42562
42563
42564 static int
42565 test_xmlUCSIsVariationSelectorsSupplement(void) {
42566     int test_ret = 0;
42567
42568 #if defined(LIBXML_UNICODE_ENABLED)
42569     int mem_base;
42570     int ret_val;
42571     int code; /* UCS code point */
42572     int n_code;
42573
42574     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42575         mem_base = xmlMemBlocks();
42576         code = gen_int(n_code, 0);
42577
42578         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42579         desret_int(ret_val);
42580         call_tests++;
42581         des_int(n_code, code, 0);
42582         xmlResetLastError();
42583         if (mem_base != xmlMemBlocks()) {
42584             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42585                    xmlMemBlocks() - mem_base);
42586             test_ret++;
42587             printf(" %d", n_code);
42588             printf("\n");
42589         }
42590     }
42591     function_tests++;
42592 #endif
42593
42594     return(test_ret);
42595 }
42596
42597
42598 static int
42599 test_xmlUCSIsYiRadicals(void) {
42600     int test_ret = 0;
42601
42602 #if defined(LIBXML_UNICODE_ENABLED)
42603     int mem_base;
42604     int ret_val;
42605     int code; /* UCS code point */
42606     int n_code;
42607
42608     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42609         mem_base = xmlMemBlocks();
42610         code = gen_int(n_code, 0);
42611
42612         ret_val = xmlUCSIsYiRadicals(code);
42613         desret_int(ret_val);
42614         call_tests++;
42615         des_int(n_code, code, 0);
42616         xmlResetLastError();
42617         if (mem_base != xmlMemBlocks()) {
42618             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42619                    xmlMemBlocks() - mem_base);
42620             test_ret++;
42621             printf(" %d", n_code);
42622             printf("\n");
42623         }
42624     }
42625     function_tests++;
42626 #endif
42627
42628     return(test_ret);
42629 }
42630
42631
42632 static int
42633 test_xmlUCSIsYiSyllables(void) {
42634     int test_ret = 0;
42635
42636 #if defined(LIBXML_UNICODE_ENABLED)
42637     int mem_base;
42638     int ret_val;
42639     int code; /* UCS code point */
42640     int n_code;
42641
42642     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42643         mem_base = xmlMemBlocks();
42644         code = gen_int(n_code, 0);
42645
42646         ret_val = xmlUCSIsYiSyllables(code);
42647         desret_int(ret_val);
42648         call_tests++;
42649         des_int(n_code, code, 0);
42650         xmlResetLastError();
42651         if (mem_base != xmlMemBlocks()) {
42652             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42653                    xmlMemBlocks() - mem_base);
42654             test_ret++;
42655             printf(" %d", n_code);
42656             printf("\n");
42657         }
42658     }
42659     function_tests++;
42660 #endif
42661
42662     return(test_ret);
42663 }
42664
42665
42666 static int
42667 test_xmlUCSIsYijingHexagramSymbols(void) {
42668     int test_ret = 0;
42669
42670 #if defined(LIBXML_UNICODE_ENABLED)
42671     int mem_base;
42672     int ret_val;
42673     int code; /* UCS code point */
42674     int n_code;
42675
42676     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42677         mem_base = xmlMemBlocks();
42678         code = gen_int(n_code, 0);
42679
42680         ret_val = xmlUCSIsYijingHexagramSymbols(code);
42681         desret_int(ret_val);
42682         call_tests++;
42683         des_int(n_code, code, 0);
42684         xmlResetLastError();
42685         if (mem_base != xmlMemBlocks()) {
42686             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42687                    xmlMemBlocks() - mem_base);
42688             test_ret++;
42689             printf(" %d", n_code);
42690             printf("\n");
42691         }
42692     }
42693     function_tests++;
42694 #endif
42695
42696     return(test_ret);
42697 }
42698
42699 static int
42700 test_xmlunicode(void) {
42701     int test_ret = 0;
42702
42703     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42704     test_ret += test_xmlUCSIsAegeanNumbers();
42705     test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42706     test_ret += test_xmlUCSIsArabic();
42707     test_ret += test_xmlUCSIsArabicPresentationFormsA();
42708     test_ret += test_xmlUCSIsArabicPresentationFormsB();
42709     test_ret += test_xmlUCSIsArmenian();
42710     test_ret += test_xmlUCSIsArrows();
42711     test_ret += test_xmlUCSIsBasicLatin();
42712     test_ret += test_xmlUCSIsBengali();
42713     test_ret += test_xmlUCSIsBlock();
42714     test_ret += test_xmlUCSIsBlockElements();
42715     test_ret += test_xmlUCSIsBopomofo();
42716     test_ret += test_xmlUCSIsBopomofoExtended();
42717     test_ret += test_xmlUCSIsBoxDrawing();
42718     test_ret += test_xmlUCSIsBraillePatterns();
42719     test_ret += test_xmlUCSIsBuhid();
42720     test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42721     test_ret += test_xmlUCSIsCJKCompatibility();
42722     test_ret += test_xmlUCSIsCJKCompatibilityForms();
42723     test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42724     test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42725     test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42726     test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42727     test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42728     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42729     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42730     test_ret += test_xmlUCSIsCat();
42731     test_ret += test_xmlUCSIsCatC();
42732     test_ret += test_xmlUCSIsCatCc();
42733     test_ret += test_xmlUCSIsCatCf();
42734     test_ret += test_xmlUCSIsCatCo();
42735     test_ret += test_xmlUCSIsCatCs();
42736     test_ret += test_xmlUCSIsCatL();
42737     test_ret += test_xmlUCSIsCatLl();
42738     test_ret += test_xmlUCSIsCatLm();
42739     test_ret += test_xmlUCSIsCatLo();
42740     test_ret += test_xmlUCSIsCatLt();
42741     test_ret += test_xmlUCSIsCatLu();
42742     test_ret += test_xmlUCSIsCatM();
42743     test_ret += test_xmlUCSIsCatMc();
42744     test_ret += test_xmlUCSIsCatMe();
42745     test_ret += test_xmlUCSIsCatMn();
42746     test_ret += test_xmlUCSIsCatN();
42747     test_ret += test_xmlUCSIsCatNd();
42748     test_ret += test_xmlUCSIsCatNl();
42749     test_ret += test_xmlUCSIsCatNo();
42750     test_ret += test_xmlUCSIsCatP();
42751     test_ret += test_xmlUCSIsCatPc();
42752     test_ret += test_xmlUCSIsCatPd();
42753     test_ret += test_xmlUCSIsCatPe();
42754     test_ret += test_xmlUCSIsCatPf();
42755     test_ret += test_xmlUCSIsCatPi();
42756     test_ret += test_xmlUCSIsCatPo();
42757     test_ret += test_xmlUCSIsCatPs();
42758     test_ret += test_xmlUCSIsCatS();
42759     test_ret += test_xmlUCSIsCatSc();
42760     test_ret += test_xmlUCSIsCatSk();
42761     test_ret += test_xmlUCSIsCatSm();
42762     test_ret += test_xmlUCSIsCatSo();
42763     test_ret += test_xmlUCSIsCatZ();
42764     test_ret += test_xmlUCSIsCatZl();
42765     test_ret += test_xmlUCSIsCatZp();
42766     test_ret += test_xmlUCSIsCatZs();
42767     test_ret += test_xmlUCSIsCherokee();
42768     test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42769     test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42770     test_ret += test_xmlUCSIsCombiningHalfMarks();
42771     test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42772     test_ret += test_xmlUCSIsControlPictures();
42773     test_ret += test_xmlUCSIsCurrencySymbols();
42774     test_ret += test_xmlUCSIsCypriotSyllabary();
42775     test_ret += test_xmlUCSIsCyrillic();
42776     test_ret += test_xmlUCSIsCyrillicSupplement();
42777     test_ret += test_xmlUCSIsDeseret();
42778     test_ret += test_xmlUCSIsDevanagari();
42779     test_ret += test_xmlUCSIsDingbats();
42780     test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42781     test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42782     test_ret += test_xmlUCSIsEthiopic();
42783     test_ret += test_xmlUCSIsGeneralPunctuation();
42784     test_ret += test_xmlUCSIsGeometricShapes();
42785     test_ret += test_xmlUCSIsGeorgian();
42786     test_ret += test_xmlUCSIsGothic();
42787     test_ret += test_xmlUCSIsGreek();
42788     test_ret += test_xmlUCSIsGreekExtended();
42789     test_ret += test_xmlUCSIsGreekandCoptic();
42790     test_ret += test_xmlUCSIsGujarati();
42791     test_ret += test_xmlUCSIsGurmukhi();
42792     test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42793     test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42794     test_ret += test_xmlUCSIsHangulJamo();
42795     test_ret += test_xmlUCSIsHangulSyllables();
42796     test_ret += test_xmlUCSIsHanunoo();
42797     test_ret += test_xmlUCSIsHebrew();
42798     test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42799     test_ret += test_xmlUCSIsHighSurrogates();
42800     test_ret += test_xmlUCSIsHiragana();
42801     test_ret += test_xmlUCSIsIPAExtensions();
42802     test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42803     test_ret += test_xmlUCSIsKanbun();
42804     test_ret += test_xmlUCSIsKangxiRadicals();
42805     test_ret += test_xmlUCSIsKannada();
42806     test_ret += test_xmlUCSIsKatakana();
42807     test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42808     test_ret += test_xmlUCSIsKhmer();
42809     test_ret += test_xmlUCSIsKhmerSymbols();
42810     test_ret += test_xmlUCSIsLao();
42811     test_ret += test_xmlUCSIsLatin1Supplement();
42812     test_ret += test_xmlUCSIsLatinExtendedA();
42813     test_ret += test_xmlUCSIsLatinExtendedAdditional();
42814     test_ret += test_xmlUCSIsLatinExtendedB();
42815     test_ret += test_xmlUCSIsLetterlikeSymbols();
42816     test_ret += test_xmlUCSIsLimbu();
42817     test_ret += test_xmlUCSIsLinearBIdeograms();
42818     test_ret += test_xmlUCSIsLinearBSyllabary();
42819     test_ret += test_xmlUCSIsLowSurrogates();
42820     test_ret += test_xmlUCSIsMalayalam();
42821     test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42822     test_ret += test_xmlUCSIsMathematicalOperators();
42823     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42824     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42825     test_ret += test_xmlUCSIsMiscellaneousSymbols();
42826     test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42827     test_ret += test_xmlUCSIsMiscellaneousTechnical();
42828     test_ret += test_xmlUCSIsMongolian();
42829     test_ret += test_xmlUCSIsMusicalSymbols();
42830     test_ret += test_xmlUCSIsMyanmar();
42831     test_ret += test_xmlUCSIsNumberForms();
42832     test_ret += test_xmlUCSIsOgham();
42833     test_ret += test_xmlUCSIsOldItalic();
42834     test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42835     test_ret += test_xmlUCSIsOriya();
42836     test_ret += test_xmlUCSIsOsmanya();
42837     test_ret += test_xmlUCSIsPhoneticExtensions();
42838     test_ret += test_xmlUCSIsPrivateUse();
42839     test_ret += test_xmlUCSIsPrivateUseArea();
42840     test_ret += test_xmlUCSIsRunic();
42841     test_ret += test_xmlUCSIsShavian();
42842     test_ret += test_xmlUCSIsSinhala();
42843     test_ret += test_xmlUCSIsSmallFormVariants();
42844     test_ret += test_xmlUCSIsSpacingModifierLetters();
42845     test_ret += test_xmlUCSIsSpecials();
42846     test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42847     test_ret += test_xmlUCSIsSupplementalArrowsA();
42848     test_ret += test_xmlUCSIsSupplementalArrowsB();
42849     test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42850     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42851     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42852     test_ret += test_xmlUCSIsSyriac();
42853     test_ret += test_xmlUCSIsTagalog();
42854     test_ret += test_xmlUCSIsTagbanwa();
42855     test_ret += test_xmlUCSIsTags();
42856     test_ret += test_xmlUCSIsTaiLe();
42857     test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42858     test_ret += test_xmlUCSIsTamil();
42859     test_ret += test_xmlUCSIsTelugu();
42860     test_ret += test_xmlUCSIsThaana();
42861     test_ret += test_xmlUCSIsThai();
42862     test_ret += test_xmlUCSIsTibetan();
42863     test_ret += test_xmlUCSIsUgaritic();
42864     test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42865     test_ret += test_xmlUCSIsVariationSelectors();
42866     test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42867     test_ret += test_xmlUCSIsYiRadicals();
42868     test_ret += test_xmlUCSIsYiSyllables();
42869     test_ret += test_xmlUCSIsYijingHexagramSymbols();
42870
42871     if (test_ret != 0)
42872         printf("Module xmlunicode: %d errors\n", test_ret);
42873     return(test_ret);
42874 }
42875
42876 static int
42877 test_xmlNewTextWriter(void) {
42878     int test_ret = 0;
42879
42880 #if defined(LIBXML_WRITER_ENABLED)
42881     int mem_base;
42882     xmlTextWriterPtr ret_val;
42883     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42884     int n_out;
42885
42886     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42887         mem_base = xmlMemBlocks();
42888         out = gen_xmlOutputBufferPtr(n_out, 0);
42889
42890         ret_val = xmlNewTextWriter(out);
42891         if (ret_val != NULL) out = NULL;
42892         desret_xmlTextWriterPtr(ret_val);
42893         call_tests++;
42894         des_xmlOutputBufferPtr(n_out, out, 0);
42895         xmlResetLastError();
42896         if (mem_base != xmlMemBlocks()) {
42897             printf("Leak of %d blocks found in xmlNewTextWriter",
42898                    xmlMemBlocks() - mem_base);
42899             test_ret++;
42900             printf(" %d", n_out);
42901             printf("\n");
42902         }
42903     }
42904     function_tests++;
42905 #endif
42906
42907     return(test_ret);
42908 }
42909
42910
42911 static int
42912 test_xmlNewTextWriterFilename(void) {
42913     int test_ret = 0;
42914
42915 #if defined(LIBXML_WRITER_ENABLED)
42916     int mem_base;
42917     xmlTextWriterPtr ret_val;
42918     const char * uri; /* the URI of the resource for the output */
42919     int n_uri;
42920     int compression; /* compress the output? */
42921     int n_compression;
42922
42923     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42924     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42925         mem_base = xmlMemBlocks();
42926         uri = gen_fileoutput(n_uri, 0);
42927         compression = gen_int(n_compression, 1);
42928
42929         ret_val = xmlNewTextWriterFilename(uri, compression);
42930         desret_xmlTextWriterPtr(ret_val);
42931         call_tests++;
42932         des_fileoutput(n_uri, uri, 0);
42933         des_int(n_compression, compression, 1);
42934         xmlResetLastError();
42935         if (mem_base != xmlMemBlocks()) {
42936             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42937                    xmlMemBlocks() - mem_base);
42938             test_ret++;
42939             printf(" %d", n_uri);
42940             printf(" %d", n_compression);
42941             printf("\n");
42942         }
42943     }
42944     }
42945     function_tests++;
42946 #endif
42947
42948     return(test_ret);
42949 }
42950
42951
42952 static int
42953 test_xmlNewTextWriterMemory(void) {
42954     int test_ret = 0;
42955
42956 #if defined(LIBXML_WRITER_ENABLED)
42957     int mem_base;
42958     xmlTextWriterPtr ret_val;
42959     xmlBufferPtr buf; /* xmlBufferPtr */
42960     int n_buf;
42961     int compression; /* compress the output? */
42962     int n_compression;
42963
42964     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42965     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42966         mem_base = xmlMemBlocks();
42967         buf = gen_xmlBufferPtr(n_buf, 0);
42968         compression = gen_int(n_compression, 1);
42969
42970         ret_val = xmlNewTextWriterMemory(buf, compression);
42971         desret_xmlTextWriterPtr(ret_val);
42972         call_tests++;
42973         des_xmlBufferPtr(n_buf, buf, 0);
42974         des_int(n_compression, compression, 1);
42975         xmlResetLastError();
42976         if (mem_base != xmlMemBlocks()) {
42977             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42978                    xmlMemBlocks() - mem_base);
42979             test_ret++;
42980             printf(" %d", n_buf);
42981             printf(" %d", n_compression);
42982             printf("\n");
42983         }
42984     }
42985     }
42986     function_tests++;
42987 #endif
42988
42989     return(test_ret);
42990 }
42991
42992
42993 static int
42994 test_xmlNewTextWriterPushParser(void) {
42995     int test_ret = 0;
42996
42997 #if defined(LIBXML_WRITER_ENABLED)
42998     int mem_base;
42999     xmlTextWriterPtr ret_val;
43000     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43001     int n_ctxt;
43002     int compression; /* compress the output? */
43003     int n_compression;
43004
43005     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43006     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43007         mem_base = xmlMemBlocks();
43008         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43009         compression = gen_int(n_compression, 1);
43010
43011         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43012         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43013         desret_xmlTextWriterPtr(ret_val);
43014         call_tests++;
43015         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43016         des_int(n_compression, compression, 1);
43017         xmlResetLastError();
43018         if (mem_base != xmlMemBlocks()) {
43019             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43020                    xmlMemBlocks() - mem_base);
43021             test_ret++;
43022             printf(" %d", n_ctxt);
43023             printf(" %d", n_compression);
43024             printf("\n");
43025         }
43026     }
43027     }
43028     function_tests++;
43029 #endif
43030
43031     return(test_ret);
43032 }
43033
43034
43035 static int
43036 test_xmlNewTextWriterTree(void) {
43037     int test_ret = 0;
43038
43039 #if defined(LIBXML_WRITER_ENABLED)
43040     int mem_base;
43041     xmlTextWriterPtr ret_val;
43042     xmlDocPtr doc; /* xmlDocPtr */
43043     int n_doc;
43044     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43045     int n_node;
43046     int compression; /* compress the output? */
43047     int n_compression;
43048
43049     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43050     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43051     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43052         mem_base = xmlMemBlocks();
43053         doc = gen_xmlDocPtr(n_doc, 0);
43054         node = gen_xmlNodePtr(n_node, 1);
43055         compression = gen_int(n_compression, 2);
43056
43057         ret_val = xmlNewTextWriterTree(doc, node, compression);
43058         desret_xmlTextWriterPtr(ret_val);
43059         call_tests++;
43060         des_xmlDocPtr(n_doc, doc, 0);
43061         des_xmlNodePtr(n_node, node, 1);
43062         des_int(n_compression, compression, 2);
43063         xmlResetLastError();
43064         if (mem_base != xmlMemBlocks()) {
43065             printf("Leak of %d blocks found in xmlNewTextWriterTree",
43066                    xmlMemBlocks() - mem_base);
43067             test_ret++;
43068             printf(" %d", n_doc);
43069             printf(" %d", n_node);
43070             printf(" %d", n_compression);
43071             printf("\n");
43072         }
43073     }
43074     }
43075     }
43076     function_tests++;
43077 #endif
43078
43079     return(test_ret);
43080 }
43081
43082
43083 static int
43084 test_xmlTextWriterEndAttribute(void) {
43085     int test_ret = 0;
43086
43087 #if defined(LIBXML_WRITER_ENABLED)
43088     int mem_base;
43089     int ret_val;
43090     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43091     int n_writer;
43092
43093     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43094         mem_base = xmlMemBlocks();
43095         writer = gen_xmlTextWriterPtr(n_writer, 0);
43096
43097         ret_val = xmlTextWriterEndAttribute(writer);
43098         desret_int(ret_val);
43099         call_tests++;
43100         des_xmlTextWriterPtr(n_writer, writer, 0);
43101         xmlResetLastError();
43102         if (mem_base != xmlMemBlocks()) {
43103             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43104                    xmlMemBlocks() - mem_base);
43105             test_ret++;
43106             printf(" %d", n_writer);
43107             printf("\n");
43108         }
43109     }
43110     function_tests++;
43111 #endif
43112
43113     return(test_ret);
43114 }
43115
43116
43117 static int
43118 test_xmlTextWriterEndCDATA(void) {
43119     int test_ret = 0;
43120
43121 #if defined(LIBXML_WRITER_ENABLED)
43122     int mem_base;
43123     int ret_val;
43124     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43125     int n_writer;
43126
43127     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43128         mem_base = xmlMemBlocks();
43129         writer = gen_xmlTextWriterPtr(n_writer, 0);
43130
43131         ret_val = xmlTextWriterEndCDATA(writer);
43132         desret_int(ret_val);
43133         call_tests++;
43134         des_xmlTextWriterPtr(n_writer, writer, 0);
43135         xmlResetLastError();
43136         if (mem_base != xmlMemBlocks()) {
43137             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43138                    xmlMemBlocks() - mem_base);
43139             test_ret++;
43140             printf(" %d", n_writer);
43141             printf("\n");
43142         }
43143     }
43144     function_tests++;
43145 #endif
43146
43147     return(test_ret);
43148 }
43149
43150
43151 static int
43152 test_xmlTextWriterEndComment(void) {
43153     int test_ret = 0;
43154
43155 #if defined(LIBXML_WRITER_ENABLED)
43156     int mem_base;
43157     int ret_val;
43158     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43159     int n_writer;
43160
43161     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43162         mem_base = xmlMemBlocks();
43163         writer = gen_xmlTextWriterPtr(n_writer, 0);
43164
43165         ret_val = xmlTextWriterEndComment(writer);
43166         desret_int(ret_val);
43167         call_tests++;
43168         des_xmlTextWriterPtr(n_writer, writer, 0);
43169         xmlResetLastError();
43170         if (mem_base != xmlMemBlocks()) {
43171             printf("Leak of %d blocks found in xmlTextWriterEndComment",
43172                    xmlMemBlocks() - mem_base);
43173             test_ret++;
43174             printf(" %d", n_writer);
43175             printf("\n");
43176         }
43177     }
43178     function_tests++;
43179 #endif
43180
43181     return(test_ret);
43182 }
43183
43184
43185 static int
43186 test_xmlTextWriterEndDTD(void) {
43187     int test_ret = 0;
43188
43189 #if defined(LIBXML_WRITER_ENABLED)
43190     int mem_base;
43191     int ret_val;
43192     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43193     int n_writer;
43194
43195     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43196         mem_base = xmlMemBlocks();
43197         writer = gen_xmlTextWriterPtr(n_writer, 0);
43198
43199         ret_val = xmlTextWriterEndDTD(writer);
43200         desret_int(ret_val);
43201         call_tests++;
43202         des_xmlTextWriterPtr(n_writer, writer, 0);
43203         xmlResetLastError();
43204         if (mem_base != xmlMemBlocks()) {
43205             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43206                    xmlMemBlocks() - mem_base);
43207             test_ret++;
43208             printf(" %d", n_writer);
43209             printf("\n");
43210         }
43211     }
43212     function_tests++;
43213 #endif
43214
43215     return(test_ret);
43216 }
43217
43218
43219 static int
43220 test_xmlTextWriterEndDTDAttlist(void) {
43221     int test_ret = 0;
43222
43223 #if defined(LIBXML_WRITER_ENABLED)
43224     int mem_base;
43225     int ret_val;
43226     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43227     int n_writer;
43228
43229     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43230         mem_base = xmlMemBlocks();
43231         writer = gen_xmlTextWriterPtr(n_writer, 0);
43232
43233         ret_val = xmlTextWriterEndDTDAttlist(writer);
43234         desret_int(ret_val);
43235         call_tests++;
43236         des_xmlTextWriterPtr(n_writer, writer, 0);
43237         xmlResetLastError();
43238         if (mem_base != xmlMemBlocks()) {
43239             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43240                    xmlMemBlocks() - mem_base);
43241             test_ret++;
43242             printf(" %d", n_writer);
43243             printf("\n");
43244         }
43245     }
43246     function_tests++;
43247 #endif
43248
43249     return(test_ret);
43250 }
43251
43252
43253 static int
43254 test_xmlTextWriterEndDTDElement(void) {
43255     int test_ret = 0;
43256
43257 #if defined(LIBXML_WRITER_ENABLED)
43258     int mem_base;
43259     int ret_val;
43260     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43261     int n_writer;
43262
43263     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43264         mem_base = xmlMemBlocks();
43265         writer = gen_xmlTextWriterPtr(n_writer, 0);
43266
43267         ret_val = xmlTextWriterEndDTDElement(writer);
43268         desret_int(ret_val);
43269         call_tests++;
43270         des_xmlTextWriterPtr(n_writer, writer, 0);
43271         xmlResetLastError();
43272         if (mem_base != xmlMemBlocks()) {
43273             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43274                    xmlMemBlocks() - mem_base);
43275             test_ret++;
43276             printf(" %d", n_writer);
43277             printf("\n");
43278         }
43279     }
43280     function_tests++;
43281 #endif
43282
43283     return(test_ret);
43284 }
43285
43286
43287 static int
43288 test_xmlTextWriterEndDTDEntity(void) {
43289     int test_ret = 0;
43290
43291 #if defined(LIBXML_WRITER_ENABLED)
43292     int mem_base;
43293     int ret_val;
43294     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43295     int n_writer;
43296
43297     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43298         mem_base = xmlMemBlocks();
43299         writer = gen_xmlTextWriterPtr(n_writer, 0);
43300
43301         ret_val = xmlTextWriterEndDTDEntity(writer);
43302         desret_int(ret_val);
43303         call_tests++;
43304         des_xmlTextWriterPtr(n_writer, writer, 0);
43305         xmlResetLastError();
43306         if (mem_base != xmlMemBlocks()) {
43307             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43308                    xmlMemBlocks() - mem_base);
43309             test_ret++;
43310             printf(" %d", n_writer);
43311             printf("\n");
43312         }
43313     }
43314     function_tests++;
43315 #endif
43316
43317     return(test_ret);
43318 }
43319
43320
43321 static int
43322 test_xmlTextWriterEndDocument(void) {
43323     int test_ret = 0;
43324
43325 #if defined(LIBXML_WRITER_ENABLED)
43326     int mem_base;
43327     int ret_val;
43328     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43329     int n_writer;
43330
43331     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43332         mem_base = xmlMemBlocks();
43333         writer = gen_xmlTextWriterPtr(n_writer, 0);
43334
43335         ret_val = xmlTextWriterEndDocument(writer);
43336         desret_int(ret_val);
43337         call_tests++;
43338         des_xmlTextWriterPtr(n_writer, writer, 0);
43339         xmlResetLastError();
43340         if (mem_base != xmlMemBlocks()) {
43341             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43342                    xmlMemBlocks() - mem_base);
43343             test_ret++;
43344             printf(" %d", n_writer);
43345             printf("\n");
43346         }
43347     }
43348     function_tests++;
43349 #endif
43350
43351     return(test_ret);
43352 }
43353
43354
43355 static int
43356 test_xmlTextWriterEndElement(void) {
43357     int test_ret = 0;
43358
43359 #if defined(LIBXML_WRITER_ENABLED)
43360     int mem_base;
43361     int ret_val;
43362     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43363     int n_writer;
43364
43365     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43366         mem_base = xmlMemBlocks();
43367         writer = gen_xmlTextWriterPtr(n_writer, 0);
43368
43369         ret_val = xmlTextWriterEndElement(writer);
43370         desret_int(ret_val);
43371         call_tests++;
43372         des_xmlTextWriterPtr(n_writer, writer, 0);
43373         xmlResetLastError();
43374         if (mem_base != xmlMemBlocks()) {
43375             printf("Leak of %d blocks found in xmlTextWriterEndElement",
43376                    xmlMemBlocks() - mem_base);
43377             test_ret++;
43378             printf(" %d", n_writer);
43379             printf("\n");
43380         }
43381     }
43382     function_tests++;
43383 #endif
43384
43385     return(test_ret);
43386 }
43387
43388
43389 static int
43390 test_xmlTextWriterEndPI(void) {
43391     int test_ret = 0;
43392
43393 #if defined(LIBXML_WRITER_ENABLED)
43394     int mem_base;
43395     int ret_val;
43396     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43397     int n_writer;
43398
43399     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43400         mem_base = xmlMemBlocks();
43401         writer = gen_xmlTextWriterPtr(n_writer, 0);
43402
43403         ret_val = xmlTextWriterEndPI(writer);
43404         desret_int(ret_val);
43405         call_tests++;
43406         des_xmlTextWriterPtr(n_writer, writer, 0);
43407         xmlResetLastError();
43408         if (mem_base != xmlMemBlocks()) {
43409             printf("Leak of %d blocks found in xmlTextWriterEndPI",
43410                    xmlMemBlocks() - mem_base);
43411             test_ret++;
43412             printf(" %d", n_writer);
43413             printf("\n");
43414         }
43415     }
43416     function_tests++;
43417 #endif
43418
43419     return(test_ret);
43420 }
43421
43422
43423 static int
43424 test_xmlTextWriterFlush(void) {
43425     int test_ret = 0;
43426
43427 #if defined(LIBXML_WRITER_ENABLED)
43428     int mem_base;
43429     int ret_val;
43430     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43431     int n_writer;
43432
43433     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43434         mem_base = xmlMemBlocks();
43435         writer = gen_xmlTextWriterPtr(n_writer, 0);
43436
43437         ret_val = xmlTextWriterFlush(writer);
43438         desret_int(ret_val);
43439         call_tests++;
43440         des_xmlTextWriterPtr(n_writer, writer, 0);
43441         xmlResetLastError();
43442         if (mem_base != xmlMemBlocks()) {
43443             printf("Leak of %d blocks found in xmlTextWriterFlush",
43444                    xmlMemBlocks() - mem_base);
43445             test_ret++;
43446             printf(" %d", n_writer);
43447             printf("\n");
43448         }
43449     }
43450     function_tests++;
43451 #endif
43452
43453     return(test_ret);
43454 }
43455
43456
43457 static int
43458 test_xmlTextWriterFullEndElement(void) {
43459     int test_ret = 0;
43460
43461 #if defined(LIBXML_WRITER_ENABLED)
43462     int mem_base;
43463     int ret_val;
43464     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43465     int n_writer;
43466
43467     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43468         mem_base = xmlMemBlocks();
43469         writer = gen_xmlTextWriterPtr(n_writer, 0);
43470
43471         ret_val = xmlTextWriterFullEndElement(writer);
43472         desret_int(ret_val);
43473         call_tests++;
43474         des_xmlTextWriterPtr(n_writer, writer, 0);
43475         xmlResetLastError();
43476         if (mem_base != xmlMemBlocks()) {
43477             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43478                    xmlMemBlocks() - mem_base);
43479             test_ret++;
43480             printf(" %d", n_writer);
43481             printf("\n");
43482         }
43483     }
43484     function_tests++;
43485 #endif
43486
43487     return(test_ret);
43488 }
43489
43490
43491 static int
43492 test_xmlTextWriterSetIndent(void) {
43493     int test_ret = 0;
43494
43495 #if defined(LIBXML_WRITER_ENABLED)
43496     int mem_base;
43497     int ret_val;
43498     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43499     int n_writer;
43500     int indent; /* do indentation? */
43501     int n_indent;
43502
43503     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43504     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43505         mem_base = xmlMemBlocks();
43506         writer = gen_xmlTextWriterPtr(n_writer, 0);
43507         indent = gen_int(n_indent, 1);
43508
43509         ret_val = xmlTextWriterSetIndent(writer, indent);
43510         desret_int(ret_val);
43511         call_tests++;
43512         des_xmlTextWriterPtr(n_writer, writer, 0);
43513         des_int(n_indent, indent, 1);
43514         xmlResetLastError();
43515         if (mem_base != xmlMemBlocks()) {
43516             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43517                    xmlMemBlocks() - mem_base);
43518             test_ret++;
43519             printf(" %d", n_writer);
43520             printf(" %d", n_indent);
43521             printf("\n");
43522         }
43523     }
43524     }
43525     function_tests++;
43526 #endif
43527
43528     return(test_ret);
43529 }
43530
43531
43532 static int
43533 test_xmlTextWriterSetIndentString(void) {
43534     int test_ret = 0;
43535
43536 #if defined(LIBXML_WRITER_ENABLED)
43537     int mem_base;
43538     int ret_val;
43539     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43540     int n_writer;
43541     xmlChar * str; /* the xmlChar string */
43542     int n_str;
43543
43544     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43545     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43546         mem_base = xmlMemBlocks();
43547         writer = gen_xmlTextWriterPtr(n_writer, 0);
43548         str = gen_const_xmlChar_ptr(n_str, 1);
43549
43550         ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43551         desret_int(ret_val);
43552         call_tests++;
43553         des_xmlTextWriterPtr(n_writer, writer, 0);
43554         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43555         xmlResetLastError();
43556         if (mem_base != xmlMemBlocks()) {
43557             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43558                    xmlMemBlocks() - mem_base);
43559             test_ret++;
43560             printf(" %d", n_writer);
43561             printf(" %d", n_str);
43562             printf("\n");
43563         }
43564     }
43565     }
43566     function_tests++;
43567 #endif
43568
43569     return(test_ret);
43570 }
43571
43572
43573 static int
43574 test_xmlTextWriterStartAttribute(void) {
43575     int test_ret = 0;
43576
43577 #if defined(LIBXML_WRITER_ENABLED)
43578     int mem_base;
43579     int ret_val;
43580     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43581     int n_writer;
43582     xmlChar * name; /* element name */
43583     int n_name;
43584
43585     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43586     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43587         mem_base = xmlMemBlocks();
43588         writer = gen_xmlTextWriterPtr(n_writer, 0);
43589         name = gen_const_xmlChar_ptr(n_name, 1);
43590
43591         ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43592         desret_int(ret_val);
43593         call_tests++;
43594         des_xmlTextWriterPtr(n_writer, writer, 0);
43595         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43596         xmlResetLastError();
43597         if (mem_base != xmlMemBlocks()) {
43598             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43599                    xmlMemBlocks() - mem_base);
43600             test_ret++;
43601             printf(" %d", n_writer);
43602             printf(" %d", n_name);
43603             printf("\n");
43604         }
43605     }
43606     }
43607     function_tests++;
43608 #endif
43609
43610     return(test_ret);
43611 }
43612
43613
43614 static int
43615 test_xmlTextWriterStartAttributeNS(void) {
43616     int test_ret = 0;
43617
43618 #if defined(LIBXML_WRITER_ENABLED)
43619     int mem_base;
43620     int ret_val;
43621     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43622     int n_writer;
43623     xmlChar * prefix; /* namespace prefix or NULL */
43624     int n_prefix;
43625     xmlChar * name; /* element local name */
43626     int n_name;
43627     xmlChar * namespaceURI; /* namespace URI or NULL */
43628     int n_namespaceURI;
43629
43630     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43631     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43632     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43633     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43634         mem_base = xmlMemBlocks();
43635         writer = gen_xmlTextWriterPtr(n_writer, 0);
43636         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43637         name = gen_const_xmlChar_ptr(n_name, 2);
43638         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43639
43640         ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43641         desret_int(ret_val);
43642         call_tests++;
43643         des_xmlTextWriterPtr(n_writer, writer, 0);
43644         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43645         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43646         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43647         xmlResetLastError();
43648         if (mem_base != xmlMemBlocks()) {
43649             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43650                    xmlMemBlocks() - mem_base);
43651             test_ret++;
43652             printf(" %d", n_writer);
43653             printf(" %d", n_prefix);
43654             printf(" %d", n_name);
43655             printf(" %d", n_namespaceURI);
43656             printf("\n");
43657         }
43658     }
43659     }
43660     }
43661     }
43662     function_tests++;
43663 #endif
43664
43665     return(test_ret);
43666 }
43667
43668
43669 static int
43670 test_xmlTextWriterStartCDATA(void) {
43671     int test_ret = 0;
43672
43673 #if defined(LIBXML_WRITER_ENABLED)
43674     int mem_base;
43675     int ret_val;
43676     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43677     int n_writer;
43678
43679     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43680         mem_base = xmlMemBlocks();
43681         writer = gen_xmlTextWriterPtr(n_writer, 0);
43682
43683         ret_val = xmlTextWriterStartCDATA(writer);
43684         desret_int(ret_val);
43685         call_tests++;
43686         des_xmlTextWriterPtr(n_writer, writer, 0);
43687         xmlResetLastError();
43688         if (mem_base != xmlMemBlocks()) {
43689             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43690                    xmlMemBlocks() - mem_base);
43691             test_ret++;
43692             printf(" %d", n_writer);
43693             printf("\n");
43694         }
43695     }
43696     function_tests++;
43697 #endif
43698
43699     return(test_ret);
43700 }
43701
43702
43703 static int
43704 test_xmlTextWriterStartComment(void) {
43705     int test_ret = 0;
43706
43707 #if defined(LIBXML_WRITER_ENABLED)
43708     int mem_base;
43709     int ret_val;
43710     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43711     int n_writer;
43712
43713     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43714         mem_base = xmlMemBlocks();
43715         writer = gen_xmlTextWriterPtr(n_writer, 0);
43716
43717         ret_val = xmlTextWriterStartComment(writer);
43718         desret_int(ret_val);
43719         call_tests++;
43720         des_xmlTextWriterPtr(n_writer, writer, 0);
43721         xmlResetLastError();
43722         if (mem_base != xmlMemBlocks()) {
43723             printf("Leak of %d blocks found in xmlTextWriterStartComment",
43724                    xmlMemBlocks() - mem_base);
43725             test_ret++;
43726             printf(" %d", n_writer);
43727             printf("\n");
43728         }
43729     }
43730     function_tests++;
43731 #endif
43732
43733     return(test_ret);
43734 }
43735
43736
43737 static int
43738 test_xmlTextWriterStartDTD(void) {
43739     int test_ret = 0;
43740
43741 #if defined(LIBXML_WRITER_ENABLED)
43742     int mem_base;
43743     int ret_val;
43744     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43745     int n_writer;
43746     xmlChar * name; /* the name of the DTD */
43747     int n_name;
43748     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43749     int n_pubid;
43750     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43751     int n_sysid;
43752
43753     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43754     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43755     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43756     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43757         mem_base = xmlMemBlocks();
43758         writer = gen_xmlTextWriterPtr(n_writer, 0);
43759         name = gen_const_xmlChar_ptr(n_name, 1);
43760         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43761         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43762
43763         ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43764         desret_int(ret_val);
43765         call_tests++;
43766         des_xmlTextWriterPtr(n_writer, writer, 0);
43767         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43768         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43769         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43770         xmlResetLastError();
43771         if (mem_base != xmlMemBlocks()) {
43772             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43773                    xmlMemBlocks() - mem_base);
43774             test_ret++;
43775             printf(" %d", n_writer);
43776             printf(" %d", n_name);
43777             printf(" %d", n_pubid);
43778             printf(" %d", n_sysid);
43779             printf("\n");
43780         }
43781     }
43782     }
43783     }
43784     }
43785     function_tests++;
43786 #endif
43787
43788     return(test_ret);
43789 }
43790
43791
43792 static int
43793 test_xmlTextWriterStartDTDAttlist(void) {
43794     int test_ret = 0;
43795
43796 #if defined(LIBXML_WRITER_ENABLED)
43797     int mem_base;
43798     int ret_val;
43799     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43800     int n_writer;
43801     xmlChar * name; /* the name of the DTD ATTLIST */
43802     int n_name;
43803
43804     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43805     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43806         mem_base = xmlMemBlocks();
43807         writer = gen_xmlTextWriterPtr(n_writer, 0);
43808         name = gen_const_xmlChar_ptr(n_name, 1);
43809
43810         ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43811         desret_int(ret_val);
43812         call_tests++;
43813         des_xmlTextWriterPtr(n_writer, writer, 0);
43814         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43815         xmlResetLastError();
43816         if (mem_base != xmlMemBlocks()) {
43817             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43818                    xmlMemBlocks() - mem_base);
43819             test_ret++;
43820             printf(" %d", n_writer);
43821             printf(" %d", n_name);
43822             printf("\n");
43823         }
43824     }
43825     }
43826     function_tests++;
43827 #endif
43828
43829     return(test_ret);
43830 }
43831
43832
43833 static int
43834 test_xmlTextWriterStartDTDElement(void) {
43835     int test_ret = 0;
43836
43837 #if defined(LIBXML_WRITER_ENABLED)
43838     int mem_base;
43839     int ret_val;
43840     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43841     int n_writer;
43842     xmlChar * name; /* the name of the DTD element */
43843     int n_name;
43844
43845     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43846     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43847         mem_base = xmlMemBlocks();
43848         writer = gen_xmlTextWriterPtr(n_writer, 0);
43849         name = gen_const_xmlChar_ptr(n_name, 1);
43850
43851         ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43852         desret_int(ret_val);
43853         call_tests++;
43854         des_xmlTextWriterPtr(n_writer, writer, 0);
43855         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43856         xmlResetLastError();
43857         if (mem_base != xmlMemBlocks()) {
43858             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43859                    xmlMemBlocks() - mem_base);
43860             test_ret++;
43861             printf(" %d", n_writer);
43862             printf(" %d", n_name);
43863             printf("\n");
43864         }
43865     }
43866     }
43867     function_tests++;
43868 #endif
43869
43870     return(test_ret);
43871 }
43872
43873
43874 static int
43875 test_xmlTextWriterStartDTDEntity(void) {
43876     int test_ret = 0;
43877
43878 #if defined(LIBXML_WRITER_ENABLED)
43879     int mem_base;
43880     int ret_val;
43881     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43882     int n_writer;
43883     int pe; /* TRUE if this is a parameter entity, FALSE if not */
43884     int n_pe;
43885     xmlChar * name; /* the name of the DTD ATTLIST */
43886     int n_name;
43887
43888     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43889     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43890     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43891         mem_base = xmlMemBlocks();
43892         writer = gen_xmlTextWriterPtr(n_writer, 0);
43893         pe = gen_int(n_pe, 1);
43894         name = gen_const_xmlChar_ptr(n_name, 2);
43895
43896         ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43897         desret_int(ret_val);
43898         call_tests++;
43899         des_xmlTextWriterPtr(n_writer, writer, 0);
43900         des_int(n_pe, pe, 1);
43901         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43902         xmlResetLastError();
43903         if (mem_base != xmlMemBlocks()) {
43904             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43905                    xmlMemBlocks() - mem_base);
43906             test_ret++;
43907             printf(" %d", n_writer);
43908             printf(" %d", n_pe);
43909             printf(" %d", n_name);
43910             printf("\n");
43911         }
43912     }
43913     }
43914     }
43915     function_tests++;
43916 #endif
43917
43918     return(test_ret);
43919 }
43920
43921
43922 static int
43923 test_xmlTextWriterStartDocument(void) {
43924     int test_ret = 0;
43925
43926 #if defined(LIBXML_WRITER_ENABLED)
43927     int mem_base;
43928     int ret_val;
43929     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43930     int n_writer;
43931     char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43932     int n_version;
43933     char * encoding; /* the encoding or NULL for default */
43934     int n_encoding;
43935     char * standalone; /* "yes" or "no" or NULL for default */
43936     int n_standalone;
43937
43938     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43939     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43940     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43941     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43942         mem_base = xmlMemBlocks();
43943         writer = gen_xmlTextWriterPtr(n_writer, 0);
43944         version = gen_const_char_ptr(n_version, 1);
43945         encoding = gen_const_char_ptr(n_encoding, 2);
43946         standalone = gen_const_char_ptr(n_standalone, 3);
43947
43948         ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43949         desret_int(ret_val);
43950         call_tests++;
43951         des_xmlTextWriterPtr(n_writer, writer, 0);
43952         des_const_char_ptr(n_version, (const char *)version, 1);
43953         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43954         des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43955         xmlResetLastError();
43956         if (mem_base != xmlMemBlocks()) {
43957             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43958                    xmlMemBlocks() - mem_base);
43959             test_ret++;
43960             printf(" %d", n_writer);
43961             printf(" %d", n_version);
43962             printf(" %d", n_encoding);
43963             printf(" %d", n_standalone);
43964             printf("\n");
43965         }
43966     }
43967     }
43968     }
43969     }
43970     function_tests++;
43971 #endif
43972
43973     return(test_ret);
43974 }
43975
43976
43977 static int
43978 test_xmlTextWriterStartElement(void) {
43979     int test_ret = 0;
43980
43981 #if defined(LIBXML_WRITER_ENABLED)
43982     int mem_base;
43983     int ret_val;
43984     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43985     int n_writer;
43986     xmlChar * name; /* element name */
43987     int n_name;
43988
43989     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43990     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43991         mem_base = xmlMemBlocks();
43992         writer = gen_xmlTextWriterPtr(n_writer, 0);
43993         name = gen_const_xmlChar_ptr(n_name, 1);
43994
43995         ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43996         desret_int(ret_val);
43997         call_tests++;
43998         des_xmlTextWriterPtr(n_writer, writer, 0);
43999         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44000         xmlResetLastError();
44001         if (mem_base != xmlMemBlocks()) {
44002             printf("Leak of %d blocks found in xmlTextWriterStartElement",
44003                    xmlMemBlocks() - mem_base);
44004             test_ret++;
44005             printf(" %d", n_writer);
44006             printf(" %d", n_name);
44007             printf("\n");
44008         }
44009     }
44010     }
44011     function_tests++;
44012 #endif
44013
44014     return(test_ret);
44015 }
44016
44017
44018 static int
44019 test_xmlTextWriterStartElementNS(void) {
44020     int test_ret = 0;
44021
44022 #if defined(LIBXML_WRITER_ENABLED)
44023     int mem_base;
44024     int ret_val;
44025     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44026     int n_writer;
44027     xmlChar * prefix; /* namespace prefix or NULL */
44028     int n_prefix;
44029     xmlChar * name; /* element local name */
44030     int n_name;
44031     xmlChar * namespaceURI; /* namespace URI or NULL */
44032     int n_namespaceURI;
44033
44034     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44035     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44036     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44037     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44038         mem_base = xmlMemBlocks();
44039         writer = gen_xmlTextWriterPtr(n_writer, 0);
44040         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44041         name = gen_const_xmlChar_ptr(n_name, 2);
44042         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44043
44044         ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44045         desret_int(ret_val);
44046         call_tests++;
44047         des_xmlTextWriterPtr(n_writer, writer, 0);
44048         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44049         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44050         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44051         xmlResetLastError();
44052         if (mem_base != xmlMemBlocks()) {
44053             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44054                    xmlMemBlocks() - mem_base);
44055             test_ret++;
44056             printf(" %d", n_writer);
44057             printf(" %d", n_prefix);
44058             printf(" %d", n_name);
44059             printf(" %d", n_namespaceURI);
44060             printf("\n");
44061         }
44062     }
44063     }
44064     }
44065     }
44066     function_tests++;
44067 #endif
44068
44069     return(test_ret);
44070 }
44071
44072
44073 static int
44074 test_xmlTextWriterStartPI(void) {
44075     int test_ret = 0;
44076
44077 #if defined(LIBXML_WRITER_ENABLED)
44078     int mem_base;
44079     int ret_val;
44080     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44081     int n_writer;
44082     xmlChar * target; /* PI target */
44083     int n_target;
44084
44085     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44086     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44087         mem_base = xmlMemBlocks();
44088         writer = gen_xmlTextWriterPtr(n_writer, 0);
44089         target = gen_const_xmlChar_ptr(n_target, 1);
44090
44091         ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44092         desret_int(ret_val);
44093         call_tests++;
44094         des_xmlTextWriterPtr(n_writer, writer, 0);
44095         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44096         xmlResetLastError();
44097         if (mem_base != xmlMemBlocks()) {
44098             printf("Leak of %d blocks found in xmlTextWriterStartPI",
44099                    xmlMemBlocks() - mem_base);
44100             test_ret++;
44101             printf(" %d", n_writer);
44102             printf(" %d", n_target);
44103             printf("\n");
44104         }
44105     }
44106     }
44107     function_tests++;
44108 #endif
44109
44110     return(test_ret);
44111 }
44112
44113
44114 static int
44115 test_xmlTextWriterWriteAttribute(void) {
44116     int test_ret = 0;
44117
44118 #if defined(LIBXML_WRITER_ENABLED)
44119     int mem_base;
44120     int ret_val;
44121     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44122     int n_writer;
44123     xmlChar * name; /* attribute name */
44124     int n_name;
44125     xmlChar * content; /* attribute content */
44126     int n_content;
44127
44128     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44129     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44130     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44131         mem_base = xmlMemBlocks();
44132         writer = gen_xmlTextWriterPtr(n_writer, 0);
44133         name = gen_const_xmlChar_ptr(n_name, 1);
44134         content = gen_const_xmlChar_ptr(n_content, 2);
44135
44136         ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44137         desret_int(ret_val);
44138         call_tests++;
44139         des_xmlTextWriterPtr(n_writer, writer, 0);
44140         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44141         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44142         xmlResetLastError();
44143         if (mem_base != xmlMemBlocks()) {
44144             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44145                    xmlMemBlocks() - mem_base);
44146             test_ret++;
44147             printf(" %d", n_writer);
44148             printf(" %d", n_name);
44149             printf(" %d", n_content);
44150             printf("\n");
44151         }
44152     }
44153     }
44154     }
44155     function_tests++;
44156 #endif
44157
44158     return(test_ret);
44159 }
44160
44161
44162 static int
44163 test_xmlTextWriterWriteAttributeNS(void) {
44164     int test_ret = 0;
44165
44166 #if defined(LIBXML_WRITER_ENABLED)
44167     int mem_base;
44168     int ret_val;
44169     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44170     int n_writer;
44171     xmlChar * prefix; /* namespace prefix */
44172     int n_prefix;
44173     xmlChar * name; /* attribute local name */
44174     int n_name;
44175     xmlChar * namespaceURI; /* namespace URI */
44176     int n_namespaceURI;
44177     xmlChar * content; /* attribute content */
44178     int n_content;
44179
44180     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44181     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44182     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44183     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44184     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44185         mem_base = xmlMemBlocks();
44186         writer = gen_xmlTextWriterPtr(n_writer, 0);
44187         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44188         name = gen_const_xmlChar_ptr(n_name, 2);
44189         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44190         content = gen_const_xmlChar_ptr(n_content, 4);
44191
44192         ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44193         desret_int(ret_val);
44194         call_tests++;
44195         des_xmlTextWriterPtr(n_writer, writer, 0);
44196         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44197         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44198         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44199         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44200         xmlResetLastError();
44201         if (mem_base != xmlMemBlocks()) {
44202             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44203                    xmlMemBlocks() - mem_base);
44204             test_ret++;
44205             printf(" %d", n_writer);
44206             printf(" %d", n_prefix);
44207             printf(" %d", n_name);
44208             printf(" %d", n_namespaceURI);
44209             printf(" %d", n_content);
44210             printf("\n");
44211         }
44212     }
44213     }
44214     }
44215     }
44216     }
44217     function_tests++;
44218 #endif
44219
44220     return(test_ret);
44221 }
44222
44223
44224 static int
44225 test_xmlTextWriterWriteBase64(void) {
44226     int test_ret = 0;
44227
44228 #if defined(LIBXML_WRITER_ENABLED)
44229     int mem_base;
44230     int ret_val;
44231     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44232     int n_writer;
44233     char * data; /* binary data */
44234     int n_data;
44235     int start; /* the position within the data of the first byte to encode */
44236     int n_start;
44237     int len; /* the number of bytes to encode */
44238     int n_len;
44239
44240     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44241     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44242     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44243     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44244         mem_base = xmlMemBlocks();
44245         writer = gen_xmlTextWriterPtr(n_writer, 0);
44246         data = gen_const_char_ptr(n_data, 1);
44247         start = gen_int(n_start, 2);
44248         len = gen_int(n_len, 3);
44249
44250         ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44251         desret_int(ret_val);
44252         call_tests++;
44253         des_xmlTextWriterPtr(n_writer, writer, 0);
44254         des_const_char_ptr(n_data, (const char *)data, 1);
44255         des_int(n_start, start, 2);
44256         des_int(n_len, len, 3);
44257         xmlResetLastError();
44258         if (mem_base != xmlMemBlocks()) {
44259             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44260                    xmlMemBlocks() - mem_base);
44261             test_ret++;
44262             printf(" %d", n_writer);
44263             printf(" %d", n_data);
44264             printf(" %d", n_start);
44265             printf(" %d", n_len);
44266             printf("\n");
44267         }
44268     }
44269     }
44270     }
44271     }
44272     function_tests++;
44273 #endif
44274
44275     return(test_ret);
44276 }
44277
44278
44279 static int
44280 test_xmlTextWriterWriteBinHex(void) {
44281     int test_ret = 0;
44282
44283 #if defined(LIBXML_WRITER_ENABLED)
44284     int mem_base;
44285     int ret_val;
44286     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44287     int n_writer;
44288     char * data; /* binary data */
44289     int n_data;
44290     int start; /* the position within the data of the first byte to encode */
44291     int n_start;
44292     int len; /* the number of bytes to encode */
44293     int n_len;
44294
44295     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44296     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44297     for (n_start = 0;n_start < gen_nb_int;n_start++) {
44298     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44299         mem_base = xmlMemBlocks();
44300         writer = gen_xmlTextWriterPtr(n_writer, 0);
44301         data = gen_const_char_ptr(n_data, 1);
44302         start = gen_int(n_start, 2);
44303         len = gen_int(n_len, 3);
44304
44305         ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44306         desret_int(ret_val);
44307         call_tests++;
44308         des_xmlTextWriterPtr(n_writer, writer, 0);
44309         des_const_char_ptr(n_data, (const char *)data, 1);
44310         des_int(n_start, start, 2);
44311         des_int(n_len, len, 3);
44312         xmlResetLastError();
44313         if (mem_base != xmlMemBlocks()) {
44314             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44315                    xmlMemBlocks() - mem_base);
44316             test_ret++;
44317             printf(" %d", n_writer);
44318             printf(" %d", n_data);
44319             printf(" %d", n_start);
44320             printf(" %d", n_len);
44321             printf("\n");
44322         }
44323     }
44324     }
44325     }
44326     }
44327     function_tests++;
44328 #endif
44329
44330     return(test_ret);
44331 }
44332
44333
44334 static int
44335 test_xmlTextWriterWriteCDATA(void) {
44336     int test_ret = 0;
44337
44338 #if defined(LIBXML_WRITER_ENABLED)
44339     int mem_base;
44340     int ret_val;
44341     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44342     int n_writer;
44343     xmlChar * content; /* CDATA content */
44344     int n_content;
44345
44346     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44347     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44348         mem_base = xmlMemBlocks();
44349         writer = gen_xmlTextWriterPtr(n_writer, 0);
44350         content = gen_const_xmlChar_ptr(n_content, 1);
44351
44352         ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44353         desret_int(ret_val);
44354         call_tests++;
44355         des_xmlTextWriterPtr(n_writer, writer, 0);
44356         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44357         xmlResetLastError();
44358         if (mem_base != xmlMemBlocks()) {
44359             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44360                    xmlMemBlocks() - mem_base);
44361             test_ret++;
44362             printf(" %d", n_writer);
44363             printf(" %d", n_content);
44364             printf("\n");
44365         }
44366     }
44367     }
44368     function_tests++;
44369 #endif
44370
44371     return(test_ret);
44372 }
44373
44374
44375 static int
44376 test_xmlTextWriterWriteComment(void) {
44377     int test_ret = 0;
44378
44379 #if defined(LIBXML_WRITER_ENABLED)
44380     int mem_base;
44381     int ret_val;
44382     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44383     int n_writer;
44384     xmlChar * content; /* comment string */
44385     int n_content;
44386
44387     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44388     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44389         mem_base = xmlMemBlocks();
44390         writer = gen_xmlTextWriterPtr(n_writer, 0);
44391         content = gen_const_xmlChar_ptr(n_content, 1);
44392
44393         ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44394         desret_int(ret_val);
44395         call_tests++;
44396         des_xmlTextWriterPtr(n_writer, writer, 0);
44397         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44398         xmlResetLastError();
44399         if (mem_base != xmlMemBlocks()) {
44400             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44401                    xmlMemBlocks() - mem_base);
44402             test_ret++;
44403             printf(" %d", n_writer);
44404             printf(" %d", n_content);
44405             printf("\n");
44406         }
44407     }
44408     }
44409     function_tests++;
44410 #endif
44411
44412     return(test_ret);
44413 }
44414
44415
44416 static int
44417 test_xmlTextWriterWriteDTD(void) {
44418     int test_ret = 0;
44419
44420 #if defined(LIBXML_WRITER_ENABLED)
44421     int mem_base;
44422     int ret_val;
44423     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44424     int n_writer;
44425     xmlChar * name; /* the name of the DTD */
44426     int n_name;
44427     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44428     int n_pubid;
44429     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44430     int n_sysid;
44431     xmlChar * subset; /* string content of the DTD */
44432     int n_subset;
44433
44434     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44435     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44436     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44437     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44438     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44439         mem_base = xmlMemBlocks();
44440         writer = gen_xmlTextWriterPtr(n_writer, 0);
44441         name = gen_const_xmlChar_ptr(n_name, 1);
44442         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44443         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44444         subset = gen_const_xmlChar_ptr(n_subset, 4);
44445
44446         ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44447         desret_int(ret_val);
44448         call_tests++;
44449         des_xmlTextWriterPtr(n_writer, writer, 0);
44450         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44451         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44452         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44453         des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44454         xmlResetLastError();
44455         if (mem_base != xmlMemBlocks()) {
44456             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44457                    xmlMemBlocks() - mem_base);
44458             test_ret++;
44459             printf(" %d", n_writer);
44460             printf(" %d", n_name);
44461             printf(" %d", n_pubid);
44462             printf(" %d", n_sysid);
44463             printf(" %d", n_subset);
44464             printf("\n");
44465         }
44466     }
44467     }
44468     }
44469     }
44470     }
44471     function_tests++;
44472 #endif
44473
44474     return(test_ret);
44475 }
44476
44477
44478 static int
44479 test_xmlTextWriterWriteDTDAttlist(void) {
44480     int test_ret = 0;
44481
44482 #if defined(LIBXML_WRITER_ENABLED)
44483     int mem_base;
44484     int ret_val;
44485     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44486     int n_writer;
44487     xmlChar * name; /* the name of the DTD ATTLIST */
44488     int n_name;
44489     xmlChar * content; /* content of the ATTLIST */
44490     int n_content;
44491
44492     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44493     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44494     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44495         mem_base = xmlMemBlocks();
44496         writer = gen_xmlTextWriterPtr(n_writer, 0);
44497         name = gen_const_xmlChar_ptr(n_name, 1);
44498         content = gen_const_xmlChar_ptr(n_content, 2);
44499
44500         ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44501         desret_int(ret_val);
44502         call_tests++;
44503         des_xmlTextWriterPtr(n_writer, writer, 0);
44504         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44505         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44506         xmlResetLastError();
44507         if (mem_base != xmlMemBlocks()) {
44508             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44509                    xmlMemBlocks() - mem_base);
44510             test_ret++;
44511             printf(" %d", n_writer);
44512             printf(" %d", n_name);
44513             printf(" %d", n_content);
44514             printf("\n");
44515         }
44516     }
44517     }
44518     }
44519     function_tests++;
44520 #endif
44521
44522     return(test_ret);
44523 }
44524
44525
44526 static int
44527 test_xmlTextWriterWriteDTDElement(void) {
44528     int test_ret = 0;
44529
44530 #if defined(LIBXML_WRITER_ENABLED)
44531     int mem_base;
44532     int ret_val;
44533     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44534     int n_writer;
44535     xmlChar * name; /* the name of the DTD element */
44536     int n_name;
44537     xmlChar * content; /* content of the element */
44538     int n_content;
44539
44540     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44541     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44542     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44543         mem_base = xmlMemBlocks();
44544         writer = gen_xmlTextWriterPtr(n_writer, 0);
44545         name = gen_const_xmlChar_ptr(n_name, 1);
44546         content = gen_const_xmlChar_ptr(n_content, 2);
44547
44548         ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44549         desret_int(ret_val);
44550         call_tests++;
44551         des_xmlTextWriterPtr(n_writer, writer, 0);
44552         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44553         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44554         xmlResetLastError();
44555         if (mem_base != xmlMemBlocks()) {
44556             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44557                    xmlMemBlocks() - mem_base);
44558             test_ret++;
44559             printf(" %d", n_writer);
44560             printf(" %d", n_name);
44561             printf(" %d", n_content);
44562             printf("\n");
44563         }
44564     }
44565     }
44566     }
44567     function_tests++;
44568 #endif
44569
44570     return(test_ret);
44571 }
44572
44573
44574 static int
44575 test_xmlTextWriterWriteDTDEntity(void) {
44576     int test_ret = 0;
44577
44578 #if defined(LIBXML_WRITER_ENABLED)
44579     int mem_base;
44580     int ret_val;
44581     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44582     int n_writer;
44583     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44584     int n_pe;
44585     xmlChar * name; /* the name of the DTD entity */
44586     int n_name;
44587     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44588     int n_pubid;
44589     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44590     int n_sysid;
44591     xmlChar * ndataid; /* the xml notation name. */
44592     int n_ndataid;
44593     xmlChar * content; /* content of the entity */
44594     int n_content;
44595
44596     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44597     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44598     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44599     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44600     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44601     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44602     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44603         mem_base = xmlMemBlocks();
44604         writer = gen_xmlTextWriterPtr(n_writer, 0);
44605         pe = gen_int(n_pe, 1);
44606         name = gen_const_xmlChar_ptr(n_name, 2);
44607         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44608         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44609         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44610         content = gen_const_xmlChar_ptr(n_content, 6);
44611
44612         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44613         desret_int(ret_val);
44614         call_tests++;
44615         des_xmlTextWriterPtr(n_writer, writer, 0);
44616         des_int(n_pe, pe, 1);
44617         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44618         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44619         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44620         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44621         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44622         xmlResetLastError();
44623         if (mem_base != xmlMemBlocks()) {
44624             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44625                    xmlMemBlocks() - mem_base);
44626             test_ret++;
44627             printf(" %d", n_writer);
44628             printf(" %d", n_pe);
44629             printf(" %d", n_name);
44630             printf(" %d", n_pubid);
44631             printf(" %d", n_sysid);
44632             printf(" %d", n_ndataid);
44633             printf(" %d", n_content);
44634             printf("\n");
44635         }
44636     }
44637     }
44638     }
44639     }
44640     }
44641     }
44642     }
44643     function_tests++;
44644 #endif
44645
44646     return(test_ret);
44647 }
44648
44649
44650 static int
44651 test_xmlTextWriterWriteDTDExternalEntity(void) {
44652     int test_ret = 0;
44653
44654 #if defined(LIBXML_WRITER_ENABLED)
44655     int mem_base;
44656     int ret_val;
44657     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44658     int n_writer;
44659     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44660     int n_pe;
44661     xmlChar * name; /* the name of the DTD entity */
44662     int n_name;
44663     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44664     int n_pubid;
44665     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44666     int n_sysid;
44667     xmlChar * ndataid; /* the xml notation name. */
44668     int n_ndataid;
44669
44670     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44671     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44672     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44673     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44674     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44675     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44676         mem_base = xmlMemBlocks();
44677         writer = gen_xmlTextWriterPtr(n_writer, 0);
44678         pe = gen_int(n_pe, 1);
44679         name = gen_const_xmlChar_ptr(n_name, 2);
44680         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44681         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44682         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44683
44684         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44685         desret_int(ret_val);
44686         call_tests++;
44687         des_xmlTextWriterPtr(n_writer, writer, 0);
44688         des_int(n_pe, pe, 1);
44689         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44690         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44691         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44692         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44693         xmlResetLastError();
44694         if (mem_base != xmlMemBlocks()) {
44695             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44696                    xmlMemBlocks() - mem_base);
44697             test_ret++;
44698             printf(" %d", n_writer);
44699             printf(" %d", n_pe);
44700             printf(" %d", n_name);
44701             printf(" %d", n_pubid);
44702             printf(" %d", n_sysid);
44703             printf(" %d", n_ndataid);
44704             printf("\n");
44705         }
44706     }
44707     }
44708     }
44709     }
44710     }
44711     }
44712     function_tests++;
44713 #endif
44714
44715     return(test_ret);
44716 }
44717
44718
44719 static int
44720 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44721     int test_ret = 0;
44722
44723 #if defined(LIBXML_WRITER_ENABLED)
44724     int mem_base;
44725     int ret_val;
44726     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44727     int n_writer;
44728     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44729     int n_pubid;
44730     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44731     int n_sysid;
44732     xmlChar * ndataid; /* the xml notation name. */
44733     int n_ndataid;
44734
44735     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44736     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44737     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44738     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44739         mem_base = xmlMemBlocks();
44740         writer = gen_xmlTextWriterPtr(n_writer, 0);
44741         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44742         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44743         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44744
44745         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44746         desret_int(ret_val);
44747         call_tests++;
44748         des_xmlTextWriterPtr(n_writer, writer, 0);
44749         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44750         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44751         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44752         xmlResetLastError();
44753         if (mem_base != xmlMemBlocks()) {
44754             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44755                    xmlMemBlocks() - mem_base);
44756             test_ret++;
44757             printf(" %d", n_writer);
44758             printf(" %d", n_pubid);
44759             printf(" %d", n_sysid);
44760             printf(" %d", n_ndataid);
44761             printf("\n");
44762         }
44763     }
44764     }
44765     }
44766     }
44767     function_tests++;
44768 #endif
44769
44770     return(test_ret);
44771 }
44772
44773
44774 static int
44775 test_xmlTextWriterWriteDTDInternalEntity(void) {
44776     int test_ret = 0;
44777
44778 #if defined(LIBXML_WRITER_ENABLED)
44779     int mem_base;
44780     int ret_val;
44781     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44782     int n_writer;
44783     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44784     int n_pe;
44785     xmlChar * name; /* the name of the DTD entity */
44786     int n_name;
44787     xmlChar * content; /* content of the entity */
44788     int n_content;
44789
44790     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44791     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44792     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44793     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44794         mem_base = xmlMemBlocks();
44795         writer = gen_xmlTextWriterPtr(n_writer, 0);
44796         pe = gen_int(n_pe, 1);
44797         name = gen_const_xmlChar_ptr(n_name, 2);
44798         content = gen_const_xmlChar_ptr(n_content, 3);
44799
44800         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44801         desret_int(ret_val);
44802         call_tests++;
44803         des_xmlTextWriterPtr(n_writer, writer, 0);
44804         des_int(n_pe, pe, 1);
44805         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44806         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44807         xmlResetLastError();
44808         if (mem_base != xmlMemBlocks()) {
44809             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44810                    xmlMemBlocks() - mem_base);
44811             test_ret++;
44812             printf(" %d", n_writer);
44813             printf(" %d", n_pe);
44814             printf(" %d", n_name);
44815             printf(" %d", n_content);
44816             printf("\n");
44817         }
44818     }
44819     }
44820     }
44821     }
44822     function_tests++;
44823 #endif
44824
44825     return(test_ret);
44826 }
44827
44828
44829 static int
44830 test_xmlTextWriterWriteDTDNotation(void) {
44831     int test_ret = 0;
44832
44833 #if defined(LIBXML_WRITER_ENABLED)
44834     int mem_base;
44835     int ret_val;
44836     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44837     int n_writer;
44838     xmlChar * name; /* the name of the xml notation */
44839     int n_name;
44840     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44841     int n_pubid;
44842     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44843     int n_sysid;
44844
44845     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44846     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44847     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44848     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44849         mem_base = xmlMemBlocks();
44850         writer = gen_xmlTextWriterPtr(n_writer, 0);
44851         name = gen_const_xmlChar_ptr(n_name, 1);
44852         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44853         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44854
44855         ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44856         desret_int(ret_val);
44857         call_tests++;
44858         des_xmlTextWriterPtr(n_writer, writer, 0);
44859         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44860         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44861         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44862         xmlResetLastError();
44863         if (mem_base != xmlMemBlocks()) {
44864             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44865                    xmlMemBlocks() - mem_base);
44866             test_ret++;
44867             printf(" %d", n_writer);
44868             printf(" %d", n_name);
44869             printf(" %d", n_pubid);
44870             printf(" %d", n_sysid);
44871             printf("\n");
44872         }
44873     }
44874     }
44875     }
44876     }
44877     function_tests++;
44878 #endif
44879
44880     return(test_ret);
44881 }
44882
44883
44884 static int
44885 test_xmlTextWriterWriteElement(void) {
44886     int test_ret = 0;
44887
44888 #if defined(LIBXML_WRITER_ENABLED)
44889     int mem_base;
44890     int ret_val;
44891     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44892     int n_writer;
44893     xmlChar * name; /* element name */
44894     int n_name;
44895     xmlChar * content; /* element content */
44896     int n_content;
44897
44898     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44899     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44900     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44901         mem_base = xmlMemBlocks();
44902         writer = gen_xmlTextWriterPtr(n_writer, 0);
44903         name = gen_const_xmlChar_ptr(n_name, 1);
44904         content = gen_const_xmlChar_ptr(n_content, 2);
44905
44906         ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44907         desret_int(ret_val);
44908         call_tests++;
44909         des_xmlTextWriterPtr(n_writer, writer, 0);
44910         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44911         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44912         xmlResetLastError();
44913         if (mem_base != xmlMemBlocks()) {
44914             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44915                    xmlMemBlocks() - mem_base);
44916             test_ret++;
44917             printf(" %d", n_writer);
44918             printf(" %d", n_name);
44919             printf(" %d", n_content);
44920             printf("\n");
44921         }
44922     }
44923     }
44924     }
44925     function_tests++;
44926 #endif
44927
44928     return(test_ret);
44929 }
44930
44931
44932 static int
44933 test_xmlTextWriterWriteElementNS(void) {
44934     int test_ret = 0;
44935
44936 #if defined(LIBXML_WRITER_ENABLED)
44937     int mem_base;
44938     int ret_val;
44939     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44940     int n_writer;
44941     xmlChar * prefix; /* namespace prefix */
44942     int n_prefix;
44943     xmlChar * name; /* element local name */
44944     int n_name;
44945     xmlChar * namespaceURI; /* namespace URI */
44946     int n_namespaceURI;
44947     xmlChar * content; /* element content */
44948     int n_content;
44949
44950     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44951     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44952     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44953     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44954     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44955         mem_base = xmlMemBlocks();
44956         writer = gen_xmlTextWriterPtr(n_writer, 0);
44957         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44958         name = gen_const_xmlChar_ptr(n_name, 2);
44959         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44960         content = gen_const_xmlChar_ptr(n_content, 4);
44961
44962         ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44963         desret_int(ret_val);
44964         call_tests++;
44965         des_xmlTextWriterPtr(n_writer, writer, 0);
44966         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44967         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44968         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44969         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44970         xmlResetLastError();
44971         if (mem_base != xmlMemBlocks()) {
44972             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44973                    xmlMemBlocks() - mem_base);
44974             test_ret++;
44975             printf(" %d", n_writer);
44976             printf(" %d", n_prefix);
44977             printf(" %d", n_name);
44978             printf(" %d", n_namespaceURI);
44979             printf(" %d", n_content);
44980             printf("\n");
44981         }
44982     }
44983     }
44984     }
44985     }
44986     }
44987     function_tests++;
44988 #endif
44989
44990     return(test_ret);
44991 }
44992
44993
44994 static int
44995 test_xmlTextWriterWriteFormatAttribute(void) {
44996     int test_ret = 0;
44997
44998
44999     /* missing type support */
45000     return(test_ret);
45001 }
45002
45003
45004 static int
45005 test_xmlTextWriterWriteFormatAttributeNS(void) {
45006     int test_ret = 0;
45007
45008
45009     /* missing type support */
45010     return(test_ret);
45011 }
45012
45013
45014 static int
45015 test_xmlTextWriterWriteFormatCDATA(void) {
45016     int test_ret = 0;
45017
45018
45019     /* missing type support */
45020     return(test_ret);
45021 }
45022
45023
45024 static int
45025 test_xmlTextWriterWriteFormatComment(void) {
45026     int test_ret = 0;
45027
45028
45029     /* missing type support */
45030     return(test_ret);
45031 }
45032
45033
45034 static int
45035 test_xmlTextWriterWriteFormatDTD(void) {
45036     int test_ret = 0;
45037
45038
45039     /* missing type support */
45040     return(test_ret);
45041 }
45042
45043
45044 static int
45045 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45046     int test_ret = 0;
45047
45048
45049     /* missing type support */
45050     return(test_ret);
45051 }
45052
45053
45054 static int
45055 test_xmlTextWriterWriteFormatDTDElement(void) {
45056     int test_ret = 0;
45057
45058
45059     /* missing type support */
45060     return(test_ret);
45061 }
45062
45063
45064 static int
45065 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45066     int test_ret = 0;
45067
45068
45069     /* missing type support */
45070     return(test_ret);
45071 }
45072
45073
45074 static int
45075 test_xmlTextWriterWriteFormatElement(void) {
45076     int test_ret = 0;
45077
45078
45079     /* missing type support */
45080     return(test_ret);
45081 }
45082
45083
45084 static int
45085 test_xmlTextWriterWriteFormatElementNS(void) {
45086     int test_ret = 0;
45087
45088
45089     /* missing type support */
45090     return(test_ret);
45091 }
45092
45093
45094 static int
45095 test_xmlTextWriterWriteFormatPI(void) {
45096     int test_ret = 0;
45097
45098
45099     /* missing type support */
45100     return(test_ret);
45101 }
45102
45103
45104 static int
45105 test_xmlTextWriterWriteFormatRaw(void) {
45106     int test_ret = 0;
45107
45108
45109     /* missing type support */
45110     return(test_ret);
45111 }
45112
45113
45114 static int
45115 test_xmlTextWriterWriteFormatString(void) {
45116     int test_ret = 0;
45117
45118
45119     /* missing type support */
45120     return(test_ret);
45121 }
45122
45123
45124 static int
45125 test_xmlTextWriterWritePI(void) {
45126     int test_ret = 0;
45127
45128 #if defined(LIBXML_WRITER_ENABLED)
45129     int mem_base;
45130     int ret_val;
45131     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45132     int n_writer;
45133     xmlChar * target; /* PI target */
45134     int n_target;
45135     xmlChar * content; /* PI content */
45136     int n_content;
45137
45138     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45139     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45140     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45141         mem_base = xmlMemBlocks();
45142         writer = gen_xmlTextWriterPtr(n_writer, 0);
45143         target = gen_const_xmlChar_ptr(n_target, 1);
45144         content = gen_const_xmlChar_ptr(n_content, 2);
45145
45146         ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45147         desret_int(ret_val);
45148         call_tests++;
45149         des_xmlTextWriterPtr(n_writer, writer, 0);
45150         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45151         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45152         xmlResetLastError();
45153         if (mem_base != xmlMemBlocks()) {
45154             printf("Leak of %d blocks found in xmlTextWriterWritePI",
45155                    xmlMemBlocks() - mem_base);
45156             test_ret++;
45157             printf(" %d", n_writer);
45158             printf(" %d", n_target);
45159             printf(" %d", n_content);
45160             printf("\n");
45161         }
45162     }
45163     }
45164     }
45165     function_tests++;
45166 #endif
45167
45168     return(test_ret);
45169 }
45170
45171
45172 static int
45173 test_xmlTextWriterWriteRaw(void) {
45174     int test_ret = 0;
45175
45176 #if defined(LIBXML_WRITER_ENABLED)
45177     int mem_base;
45178     int ret_val;
45179     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45180     int n_writer;
45181     xmlChar * content; /* text string */
45182     int n_content;
45183
45184     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45185     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45186         mem_base = xmlMemBlocks();
45187         writer = gen_xmlTextWriterPtr(n_writer, 0);
45188         content = gen_const_xmlChar_ptr(n_content, 1);
45189
45190         ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45191         desret_int(ret_val);
45192         call_tests++;
45193         des_xmlTextWriterPtr(n_writer, writer, 0);
45194         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45195         xmlResetLastError();
45196         if (mem_base != xmlMemBlocks()) {
45197             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45198                    xmlMemBlocks() - mem_base);
45199             test_ret++;
45200             printf(" %d", n_writer);
45201             printf(" %d", n_content);
45202             printf("\n");
45203         }
45204     }
45205     }
45206     function_tests++;
45207 #endif
45208
45209     return(test_ret);
45210 }
45211
45212
45213 static int
45214 test_xmlTextWriterWriteRawLen(void) {
45215     int test_ret = 0;
45216
45217 #if defined(LIBXML_WRITER_ENABLED)
45218     int mem_base;
45219     int ret_val;
45220     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45221     int n_writer;
45222     xmlChar * content; /* text string */
45223     int n_content;
45224     int len; /* length of the text string */
45225     int n_len;
45226
45227     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45228     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45229     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45230         mem_base = xmlMemBlocks();
45231         writer = gen_xmlTextWriterPtr(n_writer, 0);
45232         content = gen_const_xmlChar_ptr(n_content, 1);
45233         len = gen_int(n_len, 2);
45234
45235         ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45236         desret_int(ret_val);
45237         call_tests++;
45238         des_xmlTextWriterPtr(n_writer, writer, 0);
45239         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45240         des_int(n_len, len, 2);
45241         xmlResetLastError();
45242         if (mem_base != xmlMemBlocks()) {
45243             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45244                    xmlMemBlocks() - mem_base);
45245             test_ret++;
45246             printf(" %d", n_writer);
45247             printf(" %d", n_content);
45248             printf(" %d", n_len);
45249             printf("\n");
45250         }
45251     }
45252     }
45253     }
45254     function_tests++;
45255 #endif
45256
45257     return(test_ret);
45258 }
45259
45260
45261 static int
45262 test_xmlTextWriterWriteString(void) {
45263     int test_ret = 0;
45264
45265 #if defined(LIBXML_WRITER_ENABLED)
45266     int mem_base;
45267     int ret_val;
45268     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45269     int n_writer;
45270     xmlChar * content; /* text string */
45271     int n_content;
45272
45273     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45274     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45275         mem_base = xmlMemBlocks();
45276         writer = gen_xmlTextWriterPtr(n_writer, 0);
45277         content = gen_const_xmlChar_ptr(n_content, 1);
45278
45279         ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45280         desret_int(ret_val);
45281         call_tests++;
45282         des_xmlTextWriterPtr(n_writer, writer, 0);
45283         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45284         xmlResetLastError();
45285         if (mem_base != xmlMemBlocks()) {
45286             printf("Leak of %d blocks found in xmlTextWriterWriteString",
45287                    xmlMemBlocks() - mem_base);
45288             test_ret++;
45289             printf(" %d", n_writer);
45290             printf(" %d", n_content);
45291             printf("\n");
45292         }
45293     }
45294     }
45295     function_tests++;
45296 #endif
45297
45298     return(test_ret);
45299 }
45300
45301
45302 static int
45303 test_xmlTextWriterWriteVFormatAttribute(void) {
45304     int test_ret = 0;
45305
45306
45307     /* missing type support */
45308     return(test_ret);
45309 }
45310
45311
45312 static int
45313 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45314     int test_ret = 0;
45315
45316
45317     /* missing type support */
45318     return(test_ret);
45319 }
45320
45321
45322 static int
45323 test_xmlTextWriterWriteVFormatCDATA(void) {
45324     int test_ret = 0;
45325
45326
45327     /* missing type support */
45328     return(test_ret);
45329 }
45330
45331
45332 static int
45333 test_xmlTextWriterWriteVFormatComment(void) {
45334     int test_ret = 0;
45335
45336
45337     /* missing type support */
45338     return(test_ret);
45339 }
45340
45341
45342 static int
45343 test_xmlTextWriterWriteVFormatDTD(void) {
45344     int test_ret = 0;
45345
45346
45347     /* missing type support */
45348     return(test_ret);
45349 }
45350
45351
45352 static int
45353 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45354     int test_ret = 0;
45355
45356
45357     /* missing type support */
45358     return(test_ret);
45359 }
45360
45361
45362 static int
45363 test_xmlTextWriterWriteVFormatDTDElement(void) {
45364     int test_ret = 0;
45365
45366
45367     /* missing type support */
45368     return(test_ret);
45369 }
45370
45371
45372 static int
45373 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45374     int test_ret = 0;
45375
45376
45377     /* missing type support */
45378     return(test_ret);
45379 }
45380
45381
45382 static int
45383 test_xmlTextWriterWriteVFormatElement(void) {
45384     int test_ret = 0;
45385
45386
45387     /* missing type support */
45388     return(test_ret);
45389 }
45390
45391
45392 static int
45393 test_xmlTextWriterWriteVFormatElementNS(void) {
45394     int test_ret = 0;
45395
45396
45397     /* missing type support */
45398     return(test_ret);
45399 }
45400
45401
45402 static int
45403 test_xmlTextWriterWriteVFormatPI(void) {
45404     int test_ret = 0;
45405
45406
45407     /* missing type support */
45408     return(test_ret);
45409 }
45410
45411
45412 static int
45413 test_xmlTextWriterWriteVFormatRaw(void) {
45414     int test_ret = 0;
45415
45416
45417     /* missing type support */
45418     return(test_ret);
45419 }
45420
45421
45422 static int
45423 test_xmlTextWriterWriteVFormatString(void) {
45424     int test_ret = 0;
45425
45426
45427     /* missing type support */
45428     return(test_ret);
45429 }
45430
45431 static int
45432 test_xmlwriter(void) {
45433     int test_ret = 0;
45434
45435     if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45436     test_ret += test_xmlNewTextWriter();
45437     test_ret += test_xmlNewTextWriterFilename();
45438     test_ret += test_xmlNewTextWriterMemory();
45439     test_ret += test_xmlNewTextWriterPushParser();
45440     test_ret += test_xmlNewTextWriterTree();
45441     test_ret += test_xmlTextWriterEndAttribute();
45442     test_ret += test_xmlTextWriterEndCDATA();
45443     test_ret += test_xmlTextWriterEndComment();
45444     test_ret += test_xmlTextWriterEndDTD();
45445     test_ret += test_xmlTextWriterEndDTDAttlist();
45446     test_ret += test_xmlTextWriterEndDTDElement();
45447     test_ret += test_xmlTextWriterEndDTDEntity();
45448     test_ret += test_xmlTextWriterEndDocument();
45449     test_ret += test_xmlTextWriterEndElement();
45450     test_ret += test_xmlTextWriterEndPI();
45451     test_ret += test_xmlTextWriterFlush();
45452     test_ret += test_xmlTextWriterFullEndElement();
45453     test_ret += test_xmlTextWriterSetIndent();
45454     test_ret += test_xmlTextWriterSetIndentString();
45455     test_ret += test_xmlTextWriterStartAttribute();
45456     test_ret += test_xmlTextWriterStartAttributeNS();
45457     test_ret += test_xmlTextWriterStartCDATA();
45458     test_ret += test_xmlTextWriterStartComment();
45459     test_ret += test_xmlTextWriterStartDTD();
45460     test_ret += test_xmlTextWriterStartDTDAttlist();
45461     test_ret += test_xmlTextWriterStartDTDElement();
45462     test_ret += test_xmlTextWriterStartDTDEntity();
45463     test_ret += test_xmlTextWriterStartDocument();
45464     test_ret += test_xmlTextWriterStartElement();
45465     test_ret += test_xmlTextWriterStartElementNS();
45466     test_ret += test_xmlTextWriterStartPI();
45467     test_ret += test_xmlTextWriterWriteAttribute();
45468     test_ret += test_xmlTextWriterWriteAttributeNS();
45469     test_ret += test_xmlTextWriterWriteBase64();
45470     test_ret += test_xmlTextWriterWriteBinHex();
45471     test_ret += test_xmlTextWriterWriteCDATA();
45472     test_ret += test_xmlTextWriterWriteComment();
45473     test_ret += test_xmlTextWriterWriteDTD();
45474     test_ret += test_xmlTextWriterWriteDTDAttlist();
45475     test_ret += test_xmlTextWriterWriteDTDElement();
45476     test_ret += test_xmlTextWriterWriteDTDEntity();
45477     test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45478     test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45479     test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45480     test_ret += test_xmlTextWriterWriteDTDNotation();
45481     test_ret += test_xmlTextWriterWriteElement();
45482     test_ret += test_xmlTextWriterWriteElementNS();
45483     test_ret += test_xmlTextWriterWriteFormatAttribute();
45484     test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45485     test_ret += test_xmlTextWriterWriteFormatCDATA();
45486     test_ret += test_xmlTextWriterWriteFormatComment();
45487     test_ret += test_xmlTextWriterWriteFormatDTD();
45488     test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45489     test_ret += test_xmlTextWriterWriteFormatDTDElement();
45490     test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45491     test_ret += test_xmlTextWriterWriteFormatElement();
45492     test_ret += test_xmlTextWriterWriteFormatElementNS();
45493     test_ret += test_xmlTextWriterWriteFormatPI();
45494     test_ret += test_xmlTextWriterWriteFormatRaw();
45495     test_ret += test_xmlTextWriterWriteFormatString();
45496     test_ret += test_xmlTextWriterWritePI();
45497     test_ret += test_xmlTextWriterWriteRaw();
45498     test_ret += test_xmlTextWriterWriteRawLen();
45499     test_ret += test_xmlTextWriterWriteString();
45500     test_ret += test_xmlTextWriterWriteVFormatAttribute();
45501     test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45502     test_ret += test_xmlTextWriterWriteVFormatCDATA();
45503     test_ret += test_xmlTextWriterWriteVFormatComment();
45504     test_ret += test_xmlTextWriterWriteVFormatDTD();
45505     test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45506     test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45507     test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45508     test_ret += test_xmlTextWriterWriteVFormatElement();
45509     test_ret += test_xmlTextWriterWriteVFormatElementNS();
45510     test_ret += test_xmlTextWriterWriteVFormatPI();
45511     test_ret += test_xmlTextWriterWriteVFormatRaw();
45512     test_ret += test_xmlTextWriterWriteVFormatString();
45513
45514     if (test_ret != 0)
45515         printf("Module xmlwriter: %d errors\n", test_ret);
45516     return(test_ret);
45517 }
45518
45519 static int
45520 test_xmlXPathCastBooleanToNumber(void) {
45521     int test_ret = 0;
45522
45523 #if defined(LIBXML_XPATH_ENABLED)
45524     int mem_base;
45525     double ret_val;
45526     int val; /* a boolean */
45527     int n_val;
45528
45529     for (n_val = 0;n_val < gen_nb_int;n_val++) {
45530         mem_base = xmlMemBlocks();
45531         val = gen_int(n_val, 0);
45532
45533         ret_val = xmlXPathCastBooleanToNumber(val);
45534         desret_double(ret_val);
45535         call_tests++;
45536         des_int(n_val, val, 0);
45537         xmlResetLastError();
45538         if (mem_base != xmlMemBlocks()) {
45539             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45540                    xmlMemBlocks() - mem_base);
45541             test_ret++;
45542             printf(" %d", n_val);
45543             printf("\n");
45544         }
45545     }
45546     function_tests++;
45547 #endif
45548
45549     return(test_ret);
45550 }
45551
45552
45553 static int
45554 test_xmlXPathCastBooleanToString(void) {
45555     int test_ret = 0;
45556
45557 #if defined(LIBXML_XPATH_ENABLED)
45558     int mem_base;
45559     xmlChar * ret_val;
45560     int val; /* a boolean */
45561     int n_val;
45562
45563     for (n_val = 0;n_val < gen_nb_int;n_val++) {
45564         mem_base = xmlMemBlocks();
45565         val = gen_int(n_val, 0);
45566
45567         ret_val = xmlXPathCastBooleanToString(val);
45568         desret_xmlChar_ptr(ret_val);
45569         call_tests++;
45570         des_int(n_val, val, 0);
45571         xmlResetLastError();
45572         if (mem_base != xmlMemBlocks()) {
45573             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45574                    xmlMemBlocks() - mem_base);
45575             test_ret++;
45576             printf(" %d", n_val);
45577             printf("\n");
45578         }
45579     }
45580     function_tests++;
45581 #endif
45582
45583     return(test_ret);
45584 }
45585
45586
45587 static int
45588 test_xmlXPathCastNodeSetToBoolean(void) {
45589     int test_ret = 0;
45590
45591 #if defined(LIBXML_XPATH_ENABLED)
45592     int mem_base;
45593     int ret_val;
45594     xmlNodeSetPtr ns; /* a node-set */
45595     int n_ns;
45596
45597     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45598         mem_base = xmlMemBlocks();
45599         ns = gen_xmlNodeSetPtr(n_ns, 0);
45600
45601         ret_val = xmlXPathCastNodeSetToBoolean(ns);
45602         desret_int(ret_val);
45603         call_tests++;
45604         des_xmlNodeSetPtr(n_ns, ns, 0);
45605         xmlResetLastError();
45606         if (mem_base != xmlMemBlocks()) {
45607             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45608                    xmlMemBlocks() - mem_base);
45609             test_ret++;
45610             printf(" %d", n_ns);
45611             printf("\n");
45612         }
45613     }
45614     function_tests++;
45615 #endif
45616
45617     return(test_ret);
45618 }
45619
45620
45621 static int
45622 test_xmlXPathCastNodeSetToNumber(void) {
45623     int test_ret = 0;
45624
45625 #if defined(LIBXML_XPATH_ENABLED)
45626     int mem_base;
45627     double ret_val;
45628     xmlNodeSetPtr ns; /* a node-set */
45629     int n_ns;
45630
45631     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45632         mem_base = xmlMemBlocks();
45633         ns = gen_xmlNodeSetPtr(n_ns, 0);
45634
45635         ret_val = xmlXPathCastNodeSetToNumber(ns);
45636         desret_double(ret_val);
45637         call_tests++;
45638         des_xmlNodeSetPtr(n_ns, ns, 0);
45639         xmlResetLastError();
45640         if (mem_base != xmlMemBlocks()) {
45641             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45642                    xmlMemBlocks() - mem_base);
45643             test_ret++;
45644             printf(" %d", n_ns);
45645             printf("\n");
45646         }
45647     }
45648     function_tests++;
45649 #endif
45650
45651     return(test_ret);
45652 }
45653
45654
45655 static int
45656 test_xmlXPathCastNodeSetToString(void) {
45657     int test_ret = 0;
45658
45659 #if defined(LIBXML_XPATH_ENABLED)
45660     int mem_base;
45661     xmlChar * ret_val;
45662     xmlNodeSetPtr ns; /* a node-set */
45663     int n_ns;
45664
45665     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45666         mem_base = xmlMemBlocks();
45667         ns = gen_xmlNodeSetPtr(n_ns, 0);
45668
45669         ret_val = xmlXPathCastNodeSetToString(ns);
45670         desret_xmlChar_ptr(ret_val);
45671         call_tests++;
45672         des_xmlNodeSetPtr(n_ns, ns, 0);
45673         xmlResetLastError();
45674         if (mem_base != xmlMemBlocks()) {
45675             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45676                    xmlMemBlocks() - mem_base);
45677             test_ret++;
45678             printf(" %d", n_ns);
45679             printf("\n");
45680         }
45681     }
45682     function_tests++;
45683 #endif
45684
45685     return(test_ret);
45686 }
45687
45688
45689 static int
45690 test_xmlXPathCastNodeToNumber(void) {
45691     int test_ret = 0;
45692
45693 #if defined(LIBXML_XPATH_ENABLED)
45694     int mem_base;
45695     double ret_val;
45696     xmlNodePtr node; /* a node */
45697     int n_node;
45698
45699     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45700         mem_base = xmlMemBlocks();
45701         node = gen_xmlNodePtr(n_node, 0);
45702
45703         ret_val = xmlXPathCastNodeToNumber(node);
45704         desret_double(ret_val);
45705         call_tests++;
45706         des_xmlNodePtr(n_node, node, 0);
45707         xmlResetLastError();
45708         if (mem_base != xmlMemBlocks()) {
45709             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45710                    xmlMemBlocks() - mem_base);
45711             test_ret++;
45712             printf(" %d", n_node);
45713             printf("\n");
45714         }
45715     }
45716     function_tests++;
45717 #endif
45718
45719     return(test_ret);
45720 }
45721
45722
45723 static int
45724 test_xmlXPathCastNodeToString(void) {
45725     int test_ret = 0;
45726
45727 #if defined(LIBXML_XPATH_ENABLED)
45728     int mem_base;
45729     xmlChar * ret_val;
45730     xmlNodePtr node; /* a node */
45731     int n_node;
45732
45733     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45734         mem_base = xmlMemBlocks();
45735         node = gen_xmlNodePtr(n_node, 0);
45736
45737         ret_val = xmlXPathCastNodeToString(node);
45738         desret_xmlChar_ptr(ret_val);
45739         call_tests++;
45740         des_xmlNodePtr(n_node, node, 0);
45741         xmlResetLastError();
45742         if (mem_base != xmlMemBlocks()) {
45743             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45744                    xmlMemBlocks() - mem_base);
45745             test_ret++;
45746             printf(" %d", n_node);
45747             printf("\n");
45748         }
45749     }
45750     function_tests++;
45751 #endif
45752
45753     return(test_ret);
45754 }
45755
45756
45757 static int
45758 test_xmlXPathCastNumberToBoolean(void) {
45759     int test_ret = 0;
45760
45761 #if defined(LIBXML_XPATH_ENABLED)
45762     int mem_base;
45763     int ret_val;
45764     double val; /* a number */
45765     int n_val;
45766
45767     for (n_val = 0;n_val < gen_nb_double;n_val++) {
45768         mem_base = xmlMemBlocks();
45769         val = gen_double(n_val, 0);
45770
45771         ret_val = xmlXPathCastNumberToBoolean(val);
45772         desret_int(ret_val);
45773         call_tests++;
45774         des_double(n_val, val, 0);
45775         xmlResetLastError();
45776         if (mem_base != xmlMemBlocks()) {
45777             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45778                    xmlMemBlocks() - mem_base);
45779             test_ret++;
45780             printf(" %d", n_val);
45781             printf("\n");
45782         }
45783     }
45784     function_tests++;
45785 #endif
45786
45787     return(test_ret);
45788 }
45789
45790
45791 static int
45792 test_xmlXPathCastNumberToString(void) {
45793     int test_ret = 0;
45794
45795 #if defined(LIBXML_XPATH_ENABLED)
45796     int mem_base;
45797     xmlChar * ret_val;
45798     double val; /* a number */
45799     int n_val;
45800
45801     for (n_val = 0;n_val < gen_nb_double;n_val++) {
45802         mem_base = xmlMemBlocks();
45803         val = gen_double(n_val, 0);
45804
45805         ret_val = xmlXPathCastNumberToString(val);
45806         desret_xmlChar_ptr(ret_val);
45807         call_tests++;
45808         des_double(n_val, val, 0);
45809         xmlResetLastError();
45810         if (mem_base != xmlMemBlocks()) {
45811             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45812                    xmlMemBlocks() - mem_base);
45813             test_ret++;
45814             printf(" %d", n_val);
45815             printf("\n");
45816         }
45817     }
45818     function_tests++;
45819 #endif
45820
45821     return(test_ret);
45822 }
45823
45824
45825 static int
45826 test_xmlXPathCastStringToBoolean(void) {
45827     int test_ret = 0;
45828
45829 #if defined(LIBXML_XPATH_ENABLED)
45830     int mem_base;
45831     int ret_val;
45832     xmlChar * val; /* a string */
45833     int n_val;
45834
45835     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45836         mem_base = xmlMemBlocks();
45837         val = gen_const_xmlChar_ptr(n_val, 0);
45838
45839         ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45840         desret_int(ret_val);
45841         call_tests++;
45842         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45843         xmlResetLastError();
45844         if (mem_base != xmlMemBlocks()) {
45845             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45846                    xmlMemBlocks() - mem_base);
45847             test_ret++;
45848             printf(" %d", n_val);
45849             printf("\n");
45850         }
45851     }
45852     function_tests++;
45853 #endif
45854
45855     return(test_ret);
45856 }
45857
45858
45859 static int
45860 test_xmlXPathCastStringToNumber(void) {
45861     int test_ret = 0;
45862
45863 #if defined(LIBXML_XPATH_ENABLED)
45864     int mem_base;
45865     double ret_val;
45866     xmlChar * val; /* a string */
45867     int n_val;
45868
45869     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45870         mem_base = xmlMemBlocks();
45871         val = gen_const_xmlChar_ptr(n_val, 0);
45872
45873         ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45874         desret_double(ret_val);
45875         call_tests++;
45876         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45877         xmlResetLastError();
45878         if (mem_base != xmlMemBlocks()) {
45879             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45880                    xmlMemBlocks() - mem_base);
45881             test_ret++;
45882             printf(" %d", n_val);
45883             printf("\n");
45884         }
45885     }
45886     function_tests++;
45887 #endif
45888
45889     return(test_ret);
45890 }
45891
45892
45893 static int
45894 test_xmlXPathCastToBoolean(void) {
45895     int test_ret = 0;
45896
45897 #if defined(LIBXML_XPATH_ENABLED)
45898     int mem_base;
45899     int ret_val;
45900     xmlXPathObjectPtr val; /* an XPath object */
45901     int n_val;
45902
45903     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45904         mem_base = xmlMemBlocks();
45905         val = gen_xmlXPathObjectPtr(n_val, 0);
45906
45907         ret_val = xmlXPathCastToBoolean(val);
45908         desret_int(ret_val);
45909         call_tests++;
45910         des_xmlXPathObjectPtr(n_val, val, 0);
45911         xmlResetLastError();
45912         if (mem_base != xmlMemBlocks()) {
45913             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45914                    xmlMemBlocks() - mem_base);
45915             test_ret++;
45916             printf(" %d", n_val);
45917             printf("\n");
45918         }
45919     }
45920     function_tests++;
45921 #endif
45922
45923     return(test_ret);
45924 }
45925
45926
45927 static int
45928 test_xmlXPathCastToNumber(void) {
45929     int test_ret = 0;
45930
45931 #if defined(LIBXML_XPATH_ENABLED)
45932     int mem_base;
45933     double ret_val;
45934     xmlXPathObjectPtr val; /* an XPath object */
45935     int n_val;
45936
45937     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45938         mem_base = xmlMemBlocks();
45939         val = gen_xmlXPathObjectPtr(n_val, 0);
45940
45941         ret_val = xmlXPathCastToNumber(val);
45942         desret_double(ret_val);
45943         call_tests++;
45944         des_xmlXPathObjectPtr(n_val, val, 0);
45945         xmlResetLastError();
45946         if (mem_base != xmlMemBlocks()) {
45947             printf("Leak of %d blocks found in xmlXPathCastToNumber",
45948                    xmlMemBlocks() - mem_base);
45949             test_ret++;
45950             printf(" %d", n_val);
45951             printf("\n");
45952         }
45953     }
45954     function_tests++;
45955 #endif
45956
45957     return(test_ret);
45958 }
45959
45960
45961 static int
45962 test_xmlXPathCastToString(void) {
45963     int test_ret = 0;
45964
45965 #if defined(LIBXML_XPATH_ENABLED)
45966     int mem_base;
45967     xmlChar * ret_val;
45968     xmlXPathObjectPtr val; /* an XPath object */
45969     int n_val;
45970
45971     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45972         mem_base = xmlMemBlocks();
45973         val = gen_xmlXPathObjectPtr(n_val, 0);
45974
45975         ret_val = xmlXPathCastToString(val);
45976         desret_xmlChar_ptr(ret_val);
45977         call_tests++;
45978         des_xmlXPathObjectPtr(n_val, val, 0);
45979         xmlResetLastError();
45980         if (mem_base != xmlMemBlocks()) {
45981             printf("Leak of %d blocks found in xmlXPathCastToString",
45982                    xmlMemBlocks() - mem_base);
45983             test_ret++;
45984             printf(" %d", n_val);
45985             printf("\n");
45986         }
45987     }
45988     function_tests++;
45989 #endif
45990
45991     return(test_ret);
45992 }
45993
45994
45995 static int
45996 test_xmlXPathCmpNodes(void) {
45997     int test_ret = 0;
45998
45999 #if defined(LIBXML_XPATH_ENABLED)
46000     int mem_base;
46001     int ret_val;
46002     xmlNodePtr node1; /* the first node */
46003     int n_node1;
46004     xmlNodePtr node2; /* the second node */
46005     int n_node2;
46006
46007     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46008     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46009         mem_base = xmlMemBlocks();
46010         node1 = gen_xmlNodePtr(n_node1, 0);
46011         node2 = gen_xmlNodePtr(n_node2, 1);
46012
46013         ret_val = xmlXPathCmpNodes(node1, node2);
46014         desret_int(ret_val);
46015         call_tests++;
46016         des_xmlNodePtr(n_node1, node1, 0);
46017         des_xmlNodePtr(n_node2, node2, 1);
46018         xmlResetLastError();
46019         if (mem_base != xmlMemBlocks()) {
46020             printf("Leak of %d blocks found in xmlXPathCmpNodes",
46021                    xmlMemBlocks() - mem_base);
46022             test_ret++;
46023             printf(" %d", n_node1);
46024             printf(" %d", n_node2);
46025             printf("\n");
46026         }
46027     }
46028     }
46029     function_tests++;
46030 #endif
46031
46032     return(test_ret);
46033 }
46034
46035
46036 static int
46037 test_xmlXPathCompile(void) {
46038     int test_ret = 0;
46039
46040
46041     /* missing type support */
46042     return(test_ret);
46043 }
46044
46045 #ifdef LIBXML_XPATH_ENABLED
46046
46047 #define gen_nb_xmlXPathCompExprPtr 1
46048 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46049     return(NULL);
46050 }
46051 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46052 }
46053 #endif
46054
46055 #ifdef LIBXML_XPATH_ENABLED
46056
46057 #define gen_nb_xmlXPathContextPtr 1
46058 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46059     return(NULL);
46060 }
46061 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46062 }
46063 #endif
46064
46065
46066 static int
46067 test_xmlXPathCompiledEval(void) {
46068     int test_ret = 0;
46069
46070 #if defined(LIBXML_XPATH_ENABLED)
46071     int mem_base;
46072     xmlXPathObjectPtr ret_val;
46073     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46074     int n_comp;
46075     xmlXPathContextPtr ctx; /* the XPath context */
46076     int n_ctx;
46077
46078     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46079     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46080         mem_base = xmlMemBlocks();
46081         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46082         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46083
46084         ret_val = xmlXPathCompiledEval(comp, ctx);
46085         desret_xmlXPathObjectPtr(ret_val);
46086         call_tests++;
46087         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46088         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46089         xmlResetLastError();
46090         if (mem_base != xmlMemBlocks()) {
46091             printf("Leak of %d blocks found in xmlXPathCompiledEval",
46092                    xmlMemBlocks() - mem_base);
46093             test_ret++;
46094             printf(" %d", n_comp);
46095             printf(" %d", n_ctx);
46096             printf("\n");
46097         }
46098     }
46099     }
46100     function_tests++;
46101 #endif
46102
46103     return(test_ret);
46104 }
46105
46106
46107 static int
46108 test_xmlXPathCompiledEvalToBoolean(void) {
46109     int test_ret = 0;
46110
46111 #if defined(LIBXML_XPATH_ENABLED)
46112     int mem_base;
46113     int ret_val;
46114     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46115     int n_comp;
46116     xmlXPathContextPtr ctxt; /* the XPath context */
46117     int n_ctxt;
46118
46119     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46120     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46121         mem_base = xmlMemBlocks();
46122         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46123         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46124
46125         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46126         desret_int(ret_val);
46127         call_tests++;
46128         des_xmlXPathCompExprPtr(n_comp, comp, 0);
46129         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46130         xmlResetLastError();
46131         if (mem_base != xmlMemBlocks()) {
46132             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46133                    xmlMemBlocks() - mem_base);
46134             test_ret++;
46135             printf(" %d", n_comp);
46136             printf(" %d", n_ctxt);
46137             printf("\n");
46138         }
46139     }
46140     }
46141     function_tests++;
46142 #endif
46143
46144     return(test_ret);
46145 }
46146
46147
46148 static int
46149 test_xmlXPathContextSetCache(void) {
46150     int test_ret = 0;
46151
46152 #if defined(LIBXML_XPATH_ENABLED)
46153     int mem_base;
46154     int ret_val;
46155     xmlXPathContextPtr ctxt; /* the XPath context */
46156     int n_ctxt;
46157     int active; /* enables/disables (creates/frees) the cache */
46158     int n_active;
46159     int value; /* a value with semantics dependant on @options */
46160     int n_value;
46161     int options; /* options (currently only the value 0 is used) */
46162     int n_options;
46163
46164     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46165     for (n_active = 0;n_active < gen_nb_int;n_active++) {
46166     for (n_value = 0;n_value < gen_nb_int;n_value++) {
46167     for (n_options = 0;n_options < gen_nb_int;n_options++) {
46168         mem_base = xmlMemBlocks();
46169         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46170         active = gen_int(n_active, 1);
46171         value = gen_int(n_value, 2);
46172         options = gen_int(n_options, 3);
46173
46174         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46175         desret_int(ret_val);
46176         call_tests++;
46177         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46178         des_int(n_active, active, 1);
46179         des_int(n_value, value, 2);
46180         des_int(n_options, options, 3);
46181         xmlResetLastError();
46182         if (mem_base != xmlMemBlocks()) {
46183             printf("Leak of %d blocks found in xmlXPathContextSetCache",
46184                    xmlMemBlocks() - mem_base);
46185             test_ret++;
46186             printf(" %d", n_ctxt);
46187             printf(" %d", n_active);
46188             printf(" %d", n_value);
46189             printf(" %d", n_options);
46190             printf("\n");
46191         }
46192     }
46193     }
46194     }
46195     }
46196     function_tests++;
46197 #endif
46198
46199     return(test_ret);
46200 }
46201
46202
46203 static int
46204 test_xmlXPathConvertBoolean(void) {
46205     int test_ret = 0;
46206
46207 #if defined(LIBXML_XPATH_ENABLED)
46208     int mem_base;
46209     xmlXPathObjectPtr ret_val;
46210     xmlXPathObjectPtr val; /* an XPath object */
46211     int n_val;
46212
46213     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46214         mem_base = xmlMemBlocks();
46215         val = gen_xmlXPathObjectPtr(n_val, 0);
46216
46217         ret_val = xmlXPathConvertBoolean(val);
46218         val = NULL;
46219         desret_xmlXPathObjectPtr(ret_val);
46220         call_tests++;
46221         des_xmlXPathObjectPtr(n_val, val, 0);
46222         xmlResetLastError();
46223         if (mem_base != xmlMemBlocks()) {
46224             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46225                    xmlMemBlocks() - mem_base);
46226             test_ret++;
46227             printf(" %d", n_val);
46228             printf("\n");
46229         }
46230     }
46231     function_tests++;
46232 #endif
46233
46234     return(test_ret);
46235 }
46236
46237
46238 static int
46239 test_xmlXPathConvertNumber(void) {
46240     int test_ret = 0;
46241
46242 #if defined(LIBXML_XPATH_ENABLED)
46243     int mem_base;
46244     xmlXPathObjectPtr ret_val;
46245     xmlXPathObjectPtr val; /* an XPath object */
46246     int n_val;
46247
46248     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46249         mem_base = xmlMemBlocks();
46250         val = gen_xmlXPathObjectPtr(n_val, 0);
46251
46252         ret_val = xmlXPathConvertNumber(val);
46253         val = NULL;
46254         desret_xmlXPathObjectPtr(ret_val);
46255         call_tests++;
46256         des_xmlXPathObjectPtr(n_val, val, 0);
46257         xmlResetLastError();
46258         if (mem_base != xmlMemBlocks()) {
46259             printf("Leak of %d blocks found in xmlXPathConvertNumber",
46260                    xmlMemBlocks() - mem_base);
46261             test_ret++;
46262             printf(" %d", n_val);
46263             printf("\n");
46264         }
46265     }
46266     function_tests++;
46267 #endif
46268
46269     return(test_ret);
46270 }
46271
46272
46273 static int
46274 test_xmlXPathConvertString(void) {
46275     int test_ret = 0;
46276
46277 #if defined(LIBXML_XPATH_ENABLED)
46278     int mem_base;
46279     xmlXPathObjectPtr ret_val;
46280     xmlXPathObjectPtr val; /* an XPath object */
46281     int n_val;
46282
46283     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46284         mem_base = xmlMemBlocks();
46285         val = gen_xmlXPathObjectPtr(n_val, 0);
46286
46287         ret_val = xmlXPathConvertString(val);
46288         val = NULL;
46289         desret_xmlXPathObjectPtr(ret_val);
46290         call_tests++;
46291         des_xmlXPathObjectPtr(n_val, val, 0);
46292         xmlResetLastError();
46293         if (mem_base != xmlMemBlocks()) {
46294             printf("Leak of %d blocks found in xmlXPathConvertString",
46295                    xmlMemBlocks() - mem_base);
46296             test_ret++;
46297             printf(" %d", n_val);
46298             printf("\n");
46299         }
46300     }
46301     function_tests++;
46302 #endif
46303
46304     return(test_ret);
46305 }
46306
46307
46308 static int
46309 test_xmlXPathCtxtCompile(void) {
46310     int test_ret = 0;
46311
46312
46313     /* missing type support */
46314     return(test_ret);
46315 }
46316
46317
46318 static int
46319 test_xmlXPathEval(void) {
46320     int test_ret = 0;
46321
46322 #if defined(LIBXML_XPATH_ENABLED)
46323     int mem_base;
46324     xmlXPathObjectPtr ret_val;
46325     xmlChar * str; /* the XPath expression */
46326     int n_str;
46327     xmlXPathContextPtr ctx; /* the XPath context */
46328     int n_ctx;
46329
46330     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46331     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46332         mem_base = xmlMemBlocks();
46333         str = gen_const_xmlChar_ptr(n_str, 0);
46334         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46335
46336         ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46337         desret_xmlXPathObjectPtr(ret_val);
46338         call_tests++;
46339         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46340         des_xmlXPathContextPtr(n_ctx, ctx, 1);
46341         xmlResetLastError();
46342         if (mem_base != xmlMemBlocks()) {
46343             printf("Leak of %d blocks found in xmlXPathEval",
46344                    xmlMemBlocks() - mem_base);
46345             test_ret++;
46346             printf(" %d", n_str);
46347             printf(" %d", n_ctx);
46348             printf("\n");
46349         }
46350     }
46351     }
46352     function_tests++;
46353 #endif
46354
46355     return(test_ret);
46356 }
46357
46358
46359 static int
46360 test_xmlXPathEvalExpression(void) {
46361     int test_ret = 0;
46362
46363 #if defined(LIBXML_XPATH_ENABLED)
46364     int mem_base;
46365     xmlXPathObjectPtr ret_val;
46366     xmlChar * str; /* the XPath expression */
46367     int n_str;
46368     xmlXPathContextPtr ctxt; /* the XPath context */
46369     int n_ctxt;
46370
46371     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46372     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46373         mem_base = xmlMemBlocks();
46374         str = gen_const_xmlChar_ptr(n_str, 0);
46375         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46376
46377         ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46378         desret_xmlXPathObjectPtr(ret_val);
46379         call_tests++;
46380         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46381         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46382         xmlResetLastError();
46383         if (mem_base != xmlMemBlocks()) {
46384             printf("Leak of %d blocks found in xmlXPathEvalExpression",
46385                    xmlMemBlocks() - mem_base);
46386             test_ret++;
46387             printf(" %d", n_str);
46388             printf(" %d", n_ctxt);
46389             printf("\n");
46390         }
46391     }
46392     }
46393     function_tests++;
46394 #endif
46395
46396     return(test_ret);
46397 }
46398
46399
46400 static int
46401 test_xmlXPathEvalPredicate(void) {
46402     int test_ret = 0;
46403
46404 #if defined(LIBXML_XPATH_ENABLED)
46405     int mem_base;
46406     int ret_val;
46407     xmlXPathContextPtr ctxt; /* the XPath context */
46408     int n_ctxt;
46409     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46410     int n_res;
46411
46412     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46413     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46414         mem_base = xmlMemBlocks();
46415         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46416         res = gen_xmlXPathObjectPtr(n_res, 1);
46417
46418         ret_val = xmlXPathEvalPredicate(ctxt, res);
46419         desret_int(ret_val);
46420         call_tests++;
46421         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46422         des_xmlXPathObjectPtr(n_res, res, 1);
46423         xmlResetLastError();
46424         if (mem_base != xmlMemBlocks()) {
46425             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46426                    xmlMemBlocks() - mem_base);
46427             test_ret++;
46428             printf(" %d", n_ctxt);
46429             printf(" %d", n_res);
46430             printf("\n");
46431         }
46432     }
46433     }
46434     function_tests++;
46435 #endif
46436
46437     return(test_ret);
46438 }
46439
46440
46441 static int
46442 test_xmlXPathInit(void) {
46443     int test_ret = 0;
46444
46445 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46446     int mem_base;
46447
46448         mem_base = xmlMemBlocks();
46449
46450         xmlXPathInit();
46451         call_tests++;
46452         xmlResetLastError();
46453         if (mem_base != xmlMemBlocks()) {
46454             printf("Leak of %d blocks found in xmlXPathInit",
46455                    xmlMemBlocks() - mem_base);
46456             test_ret++;
46457             printf("\n");
46458         }
46459     function_tests++;
46460 #endif
46461
46462     return(test_ret);
46463 }
46464
46465
46466 static int
46467 test_xmlXPathIsInf(void) {
46468     int test_ret = 0;
46469
46470 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46471     int mem_base;
46472     int ret_val;
46473     double val; /* a double value */
46474     int n_val;
46475
46476     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46477         mem_base = xmlMemBlocks();
46478         val = gen_double(n_val, 0);
46479
46480         ret_val = xmlXPathIsInf(val);
46481         desret_int(ret_val);
46482         call_tests++;
46483         des_double(n_val, val, 0);
46484         xmlResetLastError();
46485         if (mem_base != xmlMemBlocks()) {
46486             printf("Leak of %d blocks found in xmlXPathIsInf",
46487                    xmlMemBlocks() - mem_base);
46488             test_ret++;
46489             printf(" %d", n_val);
46490             printf("\n");
46491         }
46492     }
46493     function_tests++;
46494 #endif
46495
46496     return(test_ret);
46497 }
46498
46499
46500 static int
46501 test_xmlXPathIsNaN(void) {
46502     int test_ret = 0;
46503
46504 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46505     int mem_base;
46506     int ret_val;
46507     double val; /* a double value */
46508     int n_val;
46509
46510     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46511         mem_base = xmlMemBlocks();
46512         val = gen_double(n_val, 0);
46513
46514         ret_val = xmlXPathIsNaN(val);
46515         desret_int(ret_val);
46516         call_tests++;
46517         des_double(n_val, val, 0);
46518         xmlResetLastError();
46519         if (mem_base != xmlMemBlocks()) {
46520             printf("Leak of %d blocks found in xmlXPathIsNaN",
46521                    xmlMemBlocks() - mem_base);
46522             test_ret++;
46523             printf(" %d", n_val);
46524             printf("\n");
46525         }
46526     }
46527     function_tests++;
46528 #endif
46529
46530     return(test_ret);
46531 }
46532
46533
46534 static int
46535 test_xmlXPathNewContext(void) {
46536     int test_ret = 0;
46537
46538
46539     /* missing type support */
46540     return(test_ret);
46541 }
46542
46543
46544 static int
46545 test_xmlXPathNodeSetCreate(void) {
46546     int test_ret = 0;
46547
46548 #if defined(LIBXML_XPATH_ENABLED)
46549     int mem_base;
46550     xmlNodeSetPtr ret_val;
46551     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46552     int n_val;
46553
46554     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46555         mem_base = xmlMemBlocks();
46556         val = gen_xmlNodePtr(n_val, 0);
46557
46558         ret_val = xmlXPathNodeSetCreate(val);
46559         desret_xmlNodeSetPtr(ret_val);
46560         call_tests++;
46561         des_xmlNodePtr(n_val, val, 0);
46562         xmlResetLastError();
46563         if (mem_base != xmlMemBlocks()) {
46564             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46565                    xmlMemBlocks() - mem_base);
46566             test_ret++;
46567             printf(" %d", n_val);
46568             printf("\n");
46569         }
46570     }
46571     function_tests++;
46572 #endif
46573
46574     return(test_ret);
46575 }
46576
46577
46578 static int
46579 test_xmlXPathObjectCopy(void) {
46580     int test_ret = 0;
46581
46582 #if defined(LIBXML_XPATH_ENABLED)
46583     int mem_base;
46584     xmlXPathObjectPtr ret_val;
46585     xmlXPathObjectPtr val; /* the original object */
46586     int n_val;
46587
46588     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46589         mem_base = xmlMemBlocks();
46590         val = gen_xmlXPathObjectPtr(n_val, 0);
46591
46592         ret_val = xmlXPathObjectCopy(val);
46593         desret_xmlXPathObjectPtr(ret_val);
46594         call_tests++;
46595         des_xmlXPathObjectPtr(n_val, val, 0);
46596         xmlResetLastError();
46597         if (mem_base != xmlMemBlocks()) {
46598             printf("Leak of %d blocks found in xmlXPathObjectCopy",
46599                    xmlMemBlocks() - mem_base);
46600             test_ret++;
46601             printf(" %d", n_val);
46602             printf("\n");
46603         }
46604     }
46605     function_tests++;
46606 #endif
46607
46608     return(test_ret);
46609 }
46610
46611
46612 static int
46613 test_xmlXPathOrderDocElems(void) {
46614     int test_ret = 0;
46615
46616 #if defined(LIBXML_XPATH_ENABLED)
46617     int mem_base;
46618     long ret_val;
46619     xmlDocPtr doc; /* an input document */
46620     int n_doc;
46621
46622     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46623         mem_base = xmlMemBlocks();
46624         doc = gen_xmlDocPtr(n_doc, 0);
46625
46626         ret_val = xmlXPathOrderDocElems(doc);
46627         desret_long(ret_val);
46628         call_tests++;
46629         des_xmlDocPtr(n_doc, doc, 0);
46630         xmlResetLastError();
46631         if (mem_base != xmlMemBlocks()) {
46632             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46633                    xmlMemBlocks() - mem_base);
46634             test_ret++;
46635             printf(" %d", n_doc);
46636             printf("\n");
46637         }
46638     }
46639     function_tests++;
46640 #endif
46641
46642     return(test_ret);
46643 }
46644
46645 static int
46646 test_xpath(void) {
46647     int test_ret = 0;
46648
46649     if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46650     test_ret += test_xmlXPathCastBooleanToNumber();
46651     test_ret += test_xmlXPathCastBooleanToString();
46652     test_ret += test_xmlXPathCastNodeSetToBoolean();
46653     test_ret += test_xmlXPathCastNodeSetToNumber();
46654     test_ret += test_xmlXPathCastNodeSetToString();
46655     test_ret += test_xmlXPathCastNodeToNumber();
46656     test_ret += test_xmlXPathCastNodeToString();
46657     test_ret += test_xmlXPathCastNumberToBoolean();
46658     test_ret += test_xmlXPathCastNumberToString();
46659     test_ret += test_xmlXPathCastStringToBoolean();
46660     test_ret += test_xmlXPathCastStringToNumber();
46661     test_ret += test_xmlXPathCastToBoolean();
46662     test_ret += test_xmlXPathCastToNumber();
46663     test_ret += test_xmlXPathCastToString();
46664     test_ret += test_xmlXPathCmpNodes();
46665     test_ret += test_xmlXPathCompile();
46666     test_ret += test_xmlXPathCompiledEval();
46667     test_ret += test_xmlXPathCompiledEvalToBoolean();
46668     test_ret += test_xmlXPathContextSetCache();
46669     test_ret += test_xmlXPathConvertBoolean();
46670     test_ret += test_xmlXPathConvertNumber();
46671     test_ret += test_xmlXPathConvertString();
46672     test_ret += test_xmlXPathCtxtCompile();
46673     test_ret += test_xmlXPathEval();
46674     test_ret += test_xmlXPathEvalExpression();
46675     test_ret += test_xmlXPathEvalPredicate();
46676     test_ret += test_xmlXPathInit();
46677     test_ret += test_xmlXPathIsInf();
46678     test_ret += test_xmlXPathIsNaN();
46679     test_ret += test_xmlXPathNewContext();
46680     test_ret += test_xmlXPathNodeSetCreate();
46681     test_ret += test_xmlXPathObjectCopy();
46682     test_ret += test_xmlXPathOrderDocElems();
46683
46684     if (test_ret != 0)
46685         printf("Module xpath: %d errors\n", test_ret);
46686     return(test_ret);
46687 }
46688 #ifdef LIBXML_XPATH_ENABLED
46689
46690 #define gen_nb_xmlXPathParserContextPtr 1
46691 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46692     return(NULL);
46693 }
46694 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46695 }
46696 #endif
46697
46698
46699 static int
46700 test_valuePop(void) {
46701     int test_ret = 0;
46702
46703 #if defined(LIBXML_XPATH_ENABLED)
46704     int mem_base;
46705     xmlXPathObjectPtr ret_val;
46706     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46707     int n_ctxt;
46708
46709     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46710         mem_base = xmlMemBlocks();
46711         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46712
46713         ret_val = valuePop(ctxt);
46714         desret_xmlXPathObjectPtr(ret_val);
46715         call_tests++;
46716         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46717         xmlResetLastError();
46718         if (mem_base != xmlMemBlocks()) {
46719             printf("Leak of %d blocks found in valuePop",
46720                    xmlMemBlocks() - mem_base);
46721             test_ret++;
46722             printf(" %d", n_ctxt);
46723             printf("\n");
46724         }
46725     }
46726     function_tests++;
46727 #endif
46728
46729     return(test_ret);
46730 }
46731
46732
46733 static int
46734 test_valuePush(void) {
46735     int test_ret = 0;
46736
46737 #if defined(LIBXML_XPATH_ENABLED)
46738     int mem_base;
46739     int ret_val;
46740     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46741     int n_ctxt;
46742     xmlXPathObjectPtr value; /* the XPath object */
46743     int n_value;
46744
46745     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46746     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46747         mem_base = xmlMemBlocks();
46748         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46749         value = gen_xmlXPathObjectPtr(n_value, 1);
46750
46751         ret_val = valuePush(ctxt, value);
46752         desret_int(ret_val);
46753         call_tests++;
46754         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46755         des_xmlXPathObjectPtr(n_value, value, 1);
46756         xmlResetLastError();
46757         if (mem_base != xmlMemBlocks()) {
46758             printf("Leak of %d blocks found in valuePush",
46759                    xmlMemBlocks() - mem_base);
46760             test_ret++;
46761             printf(" %d", n_ctxt);
46762             printf(" %d", n_value);
46763             printf("\n");
46764         }
46765     }
46766     }
46767     function_tests++;
46768 #endif
46769
46770     return(test_ret);
46771 }
46772
46773
46774 static int
46775 test_xmlXPathAddValues(void) {
46776     int test_ret = 0;
46777
46778 #if defined(LIBXML_XPATH_ENABLED)
46779     int mem_base;
46780     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46781     int n_ctxt;
46782
46783     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46784         mem_base = xmlMemBlocks();
46785         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46786
46787         xmlXPathAddValues(ctxt);
46788         call_tests++;
46789         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46790         xmlResetLastError();
46791         if (mem_base != xmlMemBlocks()) {
46792             printf("Leak of %d blocks found in xmlXPathAddValues",
46793                    xmlMemBlocks() - mem_base);
46794             test_ret++;
46795             printf(" %d", n_ctxt);
46796             printf("\n");
46797         }
46798     }
46799     function_tests++;
46800 #endif
46801
46802     return(test_ret);
46803 }
46804
46805
46806 static int
46807 test_xmlXPathBooleanFunction(void) {
46808     int test_ret = 0;
46809
46810 #if defined(LIBXML_XPATH_ENABLED)
46811     int mem_base;
46812     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46813     int n_ctxt;
46814     int nargs; /* the number of arguments */
46815     int n_nargs;
46816
46817     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46818     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46819         mem_base = xmlMemBlocks();
46820         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46821         nargs = gen_int(n_nargs, 1);
46822
46823         xmlXPathBooleanFunction(ctxt, nargs);
46824         call_tests++;
46825         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46826         des_int(n_nargs, nargs, 1);
46827         xmlResetLastError();
46828         if (mem_base != xmlMemBlocks()) {
46829             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46830                    xmlMemBlocks() - mem_base);
46831             test_ret++;
46832             printf(" %d", n_ctxt);
46833             printf(" %d", n_nargs);
46834             printf("\n");
46835         }
46836     }
46837     }
46838     function_tests++;
46839 #endif
46840
46841     return(test_ret);
46842 }
46843
46844
46845 static int
46846 test_xmlXPathCeilingFunction(void) {
46847     int test_ret = 0;
46848
46849 #if defined(LIBXML_XPATH_ENABLED)
46850     int mem_base;
46851     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46852     int n_ctxt;
46853     int nargs; /* the number of arguments */
46854     int n_nargs;
46855
46856     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46857     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46858         mem_base = xmlMemBlocks();
46859         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46860         nargs = gen_int(n_nargs, 1);
46861
46862         xmlXPathCeilingFunction(ctxt, nargs);
46863         call_tests++;
46864         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46865         des_int(n_nargs, nargs, 1);
46866         xmlResetLastError();
46867         if (mem_base != xmlMemBlocks()) {
46868             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46869                    xmlMemBlocks() - mem_base);
46870             test_ret++;
46871             printf(" %d", n_ctxt);
46872             printf(" %d", n_nargs);
46873             printf("\n");
46874         }
46875     }
46876     }
46877     function_tests++;
46878 #endif
46879
46880     return(test_ret);
46881 }
46882
46883
46884 static int
46885 test_xmlXPathCompareValues(void) {
46886     int test_ret = 0;
46887
46888 #if defined(LIBXML_XPATH_ENABLED)
46889     int mem_base;
46890     int ret_val;
46891     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46892     int n_ctxt;
46893     int inf; /* less than (1) or greater than (0) */
46894     int n_inf;
46895     int strict; /* is the comparison strict */
46896     int n_strict;
46897
46898     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46899     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46900     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46901         mem_base = xmlMemBlocks();
46902         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46903         inf = gen_int(n_inf, 1);
46904         strict = gen_int(n_strict, 2);
46905
46906         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46907         desret_int(ret_val);
46908         call_tests++;
46909         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46910         des_int(n_inf, inf, 1);
46911         des_int(n_strict, strict, 2);
46912         xmlResetLastError();
46913         if (mem_base != xmlMemBlocks()) {
46914             printf("Leak of %d blocks found in xmlXPathCompareValues",
46915                    xmlMemBlocks() - mem_base);
46916             test_ret++;
46917             printf(" %d", n_ctxt);
46918             printf(" %d", n_inf);
46919             printf(" %d", n_strict);
46920             printf("\n");
46921         }
46922     }
46923     }
46924     }
46925     function_tests++;
46926 #endif
46927
46928     return(test_ret);
46929 }
46930
46931
46932 static int
46933 test_xmlXPathConcatFunction(void) {
46934     int test_ret = 0;
46935
46936 #if defined(LIBXML_XPATH_ENABLED)
46937     int mem_base;
46938     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46939     int n_ctxt;
46940     int nargs; /* the number of arguments */
46941     int n_nargs;
46942
46943     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46944     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46945         mem_base = xmlMemBlocks();
46946         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46947         nargs = gen_int(n_nargs, 1);
46948
46949         xmlXPathConcatFunction(ctxt, nargs);
46950         call_tests++;
46951         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46952         des_int(n_nargs, nargs, 1);
46953         xmlResetLastError();
46954         if (mem_base != xmlMemBlocks()) {
46955             printf("Leak of %d blocks found in xmlXPathConcatFunction",
46956                    xmlMemBlocks() - mem_base);
46957             test_ret++;
46958             printf(" %d", n_ctxt);
46959             printf(" %d", n_nargs);
46960             printf("\n");
46961         }
46962     }
46963     }
46964     function_tests++;
46965 #endif
46966
46967     return(test_ret);
46968 }
46969
46970
46971 static int
46972 test_xmlXPathContainsFunction(void) {
46973     int test_ret = 0;
46974
46975 #if defined(LIBXML_XPATH_ENABLED)
46976     int mem_base;
46977     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46978     int n_ctxt;
46979     int nargs; /* the number of arguments */
46980     int n_nargs;
46981
46982     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46983     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46984         mem_base = xmlMemBlocks();
46985         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46986         nargs = gen_int(n_nargs, 1);
46987
46988         xmlXPathContainsFunction(ctxt, nargs);
46989         call_tests++;
46990         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46991         des_int(n_nargs, nargs, 1);
46992         xmlResetLastError();
46993         if (mem_base != xmlMemBlocks()) {
46994             printf("Leak of %d blocks found in xmlXPathContainsFunction",
46995                    xmlMemBlocks() - mem_base);
46996             test_ret++;
46997             printf(" %d", n_ctxt);
46998             printf(" %d", n_nargs);
46999             printf("\n");
47000         }
47001     }
47002     }
47003     function_tests++;
47004 #endif
47005
47006     return(test_ret);
47007 }
47008
47009
47010 static int
47011 test_xmlXPathCountFunction(void) {
47012     int test_ret = 0;
47013
47014 #if defined(LIBXML_XPATH_ENABLED)
47015     int mem_base;
47016     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47017     int n_ctxt;
47018     int nargs; /* the number of arguments */
47019     int n_nargs;
47020
47021     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47022     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47023         mem_base = xmlMemBlocks();
47024         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47025         nargs = gen_int(n_nargs, 1);
47026
47027         xmlXPathCountFunction(ctxt, nargs);
47028         call_tests++;
47029         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47030         des_int(n_nargs, nargs, 1);
47031         xmlResetLastError();
47032         if (mem_base != xmlMemBlocks()) {
47033             printf("Leak of %d blocks found in xmlXPathCountFunction",
47034                    xmlMemBlocks() - mem_base);
47035             test_ret++;
47036             printf(" %d", n_ctxt);
47037             printf(" %d", n_nargs);
47038             printf("\n");
47039         }
47040     }
47041     }
47042     function_tests++;
47043 #endif
47044
47045     return(test_ret);
47046 }
47047
47048
47049 static int
47050 test_xmlXPathDebugDumpCompExpr(void) {
47051     int test_ret = 0;
47052
47053 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47054     int mem_base;
47055     FILE * output; /* the FILE * for the output */
47056     int n_output;
47057     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47058     int n_comp;
47059     int depth; /* the indentation level. */
47060     int n_depth;
47061
47062     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47063     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47064     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47065         mem_base = xmlMemBlocks();
47066         output = gen_FILE_ptr(n_output, 0);
47067         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47068         depth = gen_int(n_depth, 2);
47069
47070         xmlXPathDebugDumpCompExpr(output, comp, depth);
47071         call_tests++;
47072         des_FILE_ptr(n_output, output, 0);
47073         des_xmlXPathCompExprPtr(n_comp, comp, 1);
47074         des_int(n_depth, depth, 2);
47075         xmlResetLastError();
47076         if (mem_base != xmlMemBlocks()) {
47077             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47078                    xmlMemBlocks() - mem_base);
47079             test_ret++;
47080             printf(" %d", n_output);
47081             printf(" %d", n_comp);
47082             printf(" %d", n_depth);
47083             printf("\n");
47084         }
47085     }
47086     }
47087     }
47088     function_tests++;
47089 #endif
47090
47091     return(test_ret);
47092 }
47093
47094
47095 static int
47096 test_xmlXPathDebugDumpObject(void) {
47097     int test_ret = 0;
47098
47099 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47100     int mem_base;
47101     FILE * output; /* the FILE * to dump the output */
47102     int n_output;
47103     xmlXPathObjectPtr cur; /* the object to inspect */
47104     int n_cur;
47105     int depth; /* indentation level */
47106     int n_depth;
47107
47108     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47109     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47110     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47111         mem_base = xmlMemBlocks();
47112         output = gen_FILE_ptr(n_output, 0);
47113         cur = gen_xmlXPathObjectPtr(n_cur, 1);
47114         depth = gen_int(n_depth, 2);
47115
47116         xmlXPathDebugDumpObject(output, cur, depth);
47117         call_tests++;
47118         des_FILE_ptr(n_output, output, 0);
47119         des_xmlXPathObjectPtr(n_cur, cur, 1);
47120         des_int(n_depth, depth, 2);
47121         xmlResetLastError();
47122         if (mem_base != xmlMemBlocks()) {
47123             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47124                    xmlMemBlocks() - mem_base);
47125             test_ret++;
47126             printf(" %d", n_output);
47127             printf(" %d", n_cur);
47128             printf(" %d", n_depth);
47129             printf("\n");
47130         }
47131     }
47132     }
47133     }
47134     function_tests++;
47135 #endif
47136
47137     return(test_ret);
47138 }
47139
47140
47141 static int
47142 test_xmlXPathDifference(void) {
47143     int test_ret = 0;
47144
47145 #if defined(LIBXML_XPATH_ENABLED)
47146     int mem_base;
47147     xmlNodeSetPtr ret_val;
47148     xmlNodeSetPtr nodes1; /* a node-set */
47149     int n_nodes1;
47150     xmlNodeSetPtr nodes2; /* a node-set */
47151     int n_nodes2;
47152
47153     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47154     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47155         mem_base = xmlMemBlocks();
47156         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47157         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47158
47159         ret_val = xmlXPathDifference(nodes1, nodes2);
47160         desret_xmlNodeSetPtr(ret_val);
47161         call_tests++;
47162         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47163         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47164         xmlResetLastError();
47165         if (mem_base != xmlMemBlocks()) {
47166             printf("Leak of %d blocks found in xmlXPathDifference",
47167                    xmlMemBlocks() - mem_base);
47168             test_ret++;
47169             printf(" %d", n_nodes1);
47170             printf(" %d", n_nodes2);
47171             printf("\n");
47172         }
47173     }
47174     }
47175     function_tests++;
47176 #endif
47177
47178     return(test_ret);
47179 }
47180
47181
47182 static int
47183 test_xmlXPathDistinct(void) {
47184     int test_ret = 0;
47185
47186 #if defined(LIBXML_XPATH_ENABLED)
47187     int mem_base;
47188     xmlNodeSetPtr ret_val;
47189     xmlNodeSetPtr nodes; /* a node-set */
47190     int n_nodes;
47191
47192     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47193         mem_base = xmlMemBlocks();
47194         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47195
47196         ret_val = xmlXPathDistinct(nodes);
47197         desret_xmlNodeSetPtr(ret_val);
47198         call_tests++;
47199         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47200         xmlResetLastError();
47201         if (mem_base != xmlMemBlocks()) {
47202             printf("Leak of %d blocks found in xmlXPathDistinct",
47203                    xmlMemBlocks() - mem_base);
47204             test_ret++;
47205             printf(" %d", n_nodes);
47206             printf("\n");
47207         }
47208     }
47209     function_tests++;
47210 #endif
47211
47212     return(test_ret);
47213 }
47214
47215
47216 static int
47217 test_xmlXPathDistinctSorted(void) {
47218     int test_ret = 0;
47219
47220 #if defined(LIBXML_XPATH_ENABLED)
47221     int mem_base;
47222     xmlNodeSetPtr ret_val;
47223     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47224     int n_nodes;
47225
47226     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47227         mem_base = xmlMemBlocks();
47228         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47229
47230         ret_val = xmlXPathDistinctSorted(nodes);
47231         desret_xmlNodeSetPtr(ret_val);
47232         call_tests++;
47233         des_xmlNodeSetPtr(n_nodes, nodes, 0);
47234         xmlResetLastError();
47235         if (mem_base != xmlMemBlocks()) {
47236             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47237                    xmlMemBlocks() - mem_base);
47238             test_ret++;
47239             printf(" %d", n_nodes);
47240             printf("\n");
47241         }
47242     }
47243     function_tests++;
47244 #endif
47245
47246     return(test_ret);
47247 }
47248
47249
47250 static int
47251 test_xmlXPathDivValues(void) {
47252     int test_ret = 0;
47253
47254 #if defined(LIBXML_XPATH_ENABLED)
47255     int mem_base;
47256     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47257     int n_ctxt;
47258
47259     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47260         mem_base = xmlMemBlocks();
47261         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47262
47263         xmlXPathDivValues(ctxt);
47264         call_tests++;
47265         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47266         xmlResetLastError();
47267         if (mem_base != xmlMemBlocks()) {
47268             printf("Leak of %d blocks found in xmlXPathDivValues",
47269                    xmlMemBlocks() - mem_base);
47270             test_ret++;
47271             printf(" %d", n_ctxt);
47272             printf("\n");
47273         }
47274     }
47275     function_tests++;
47276 #endif
47277
47278     return(test_ret);
47279 }
47280
47281
47282 static int
47283 test_xmlXPathEqualValues(void) {
47284     int test_ret = 0;
47285
47286 #if defined(LIBXML_XPATH_ENABLED)
47287     int mem_base;
47288     int ret_val;
47289     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47290     int n_ctxt;
47291
47292     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47293         mem_base = xmlMemBlocks();
47294         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47295
47296         ret_val = xmlXPathEqualValues(ctxt);
47297         desret_int(ret_val);
47298         call_tests++;
47299         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47300         xmlResetLastError();
47301         if (mem_base != xmlMemBlocks()) {
47302             printf("Leak of %d blocks found in xmlXPathEqualValues",
47303                    xmlMemBlocks() - mem_base);
47304             test_ret++;
47305             printf(" %d", n_ctxt);
47306             printf("\n");
47307         }
47308     }
47309     function_tests++;
47310 #endif
47311
47312     return(test_ret);
47313 }
47314
47315
47316 static int
47317 test_xmlXPathErr(void) {
47318     int test_ret = 0;
47319
47320 #if defined(LIBXML_XPATH_ENABLED)
47321     int mem_base;
47322     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47323     int n_ctxt;
47324     int error; /* the error code */
47325     int n_error;
47326
47327     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47328     for (n_error = 0;n_error < gen_nb_int;n_error++) {
47329         mem_base = xmlMemBlocks();
47330         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47331         error = gen_int(n_error, 1);
47332
47333         xmlXPathErr(ctxt, error);
47334         call_tests++;
47335         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47336         des_int(n_error, error, 1);
47337         xmlResetLastError();
47338         if (mem_base != xmlMemBlocks()) {
47339             printf("Leak of %d blocks found in xmlXPathErr",
47340                    xmlMemBlocks() - mem_base);
47341             test_ret++;
47342             printf(" %d", n_ctxt);
47343             printf(" %d", n_error);
47344             printf("\n");
47345         }
47346     }
47347     }
47348     function_tests++;
47349 #endif
47350
47351     return(test_ret);
47352 }
47353
47354
47355 static int
47356 test_xmlXPathEvalExpr(void) {
47357     int test_ret = 0;
47358
47359 #if defined(LIBXML_XPATH_ENABLED)
47360     int mem_base;
47361     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47362     int n_ctxt;
47363
47364     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47365         mem_base = xmlMemBlocks();
47366         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47367
47368         xmlXPathEvalExpr(ctxt);
47369         call_tests++;
47370         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47371         xmlResetLastError();
47372         if (mem_base != xmlMemBlocks()) {
47373             printf("Leak of %d blocks found in xmlXPathEvalExpr",
47374                    xmlMemBlocks() - mem_base);
47375             test_ret++;
47376             printf(" %d", n_ctxt);
47377             printf("\n");
47378         }
47379     }
47380     function_tests++;
47381 #endif
47382
47383     return(test_ret);
47384 }
47385
47386
47387 static int
47388 test_xmlXPathEvaluatePredicateResult(void) {
47389     int test_ret = 0;
47390
47391 #if defined(LIBXML_XPATH_ENABLED)
47392     int mem_base;
47393     int ret_val;
47394     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47395     int n_ctxt;
47396     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47397     int n_res;
47398
47399     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47400     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47401         mem_base = xmlMemBlocks();
47402         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47403         res = gen_xmlXPathObjectPtr(n_res, 1);
47404
47405         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47406         desret_int(ret_val);
47407         call_tests++;
47408         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47409         des_xmlXPathObjectPtr(n_res, res, 1);
47410         xmlResetLastError();
47411         if (mem_base != xmlMemBlocks()) {
47412             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47413                    xmlMemBlocks() - mem_base);
47414             test_ret++;
47415             printf(" %d", n_ctxt);
47416             printf(" %d", n_res);
47417             printf("\n");
47418         }
47419     }
47420     }
47421     function_tests++;
47422 #endif
47423
47424     return(test_ret);
47425 }
47426
47427
47428 static int
47429 test_xmlXPathFalseFunction(void) {
47430     int test_ret = 0;
47431
47432 #if defined(LIBXML_XPATH_ENABLED)
47433     int mem_base;
47434     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47435     int n_ctxt;
47436     int nargs; /* the number of arguments */
47437     int n_nargs;
47438
47439     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47440     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47441         mem_base = xmlMemBlocks();
47442         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47443         nargs = gen_int(n_nargs, 1);
47444
47445         xmlXPathFalseFunction(ctxt, nargs);
47446         call_tests++;
47447         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47448         des_int(n_nargs, nargs, 1);
47449         xmlResetLastError();
47450         if (mem_base != xmlMemBlocks()) {
47451             printf("Leak of %d blocks found in xmlXPathFalseFunction",
47452                    xmlMemBlocks() - mem_base);
47453             test_ret++;
47454             printf(" %d", n_ctxt);
47455             printf(" %d", n_nargs);
47456             printf("\n");
47457         }
47458     }
47459     }
47460     function_tests++;
47461 #endif
47462
47463     return(test_ret);
47464 }
47465
47466
47467 static int
47468 test_xmlXPathFloorFunction(void) {
47469     int test_ret = 0;
47470
47471 #if defined(LIBXML_XPATH_ENABLED)
47472     int mem_base;
47473     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47474     int n_ctxt;
47475     int nargs; /* the number of arguments */
47476     int n_nargs;
47477
47478     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47479     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47480         mem_base = xmlMemBlocks();
47481         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47482         nargs = gen_int(n_nargs, 1);
47483
47484         xmlXPathFloorFunction(ctxt, nargs);
47485         call_tests++;
47486         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47487         des_int(n_nargs, nargs, 1);
47488         xmlResetLastError();
47489         if (mem_base != xmlMemBlocks()) {
47490             printf("Leak of %d blocks found in xmlXPathFloorFunction",
47491                    xmlMemBlocks() - mem_base);
47492             test_ret++;
47493             printf(" %d", n_ctxt);
47494             printf(" %d", n_nargs);
47495             printf("\n");
47496         }
47497     }
47498     }
47499     function_tests++;
47500 #endif
47501
47502     return(test_ret);
47503 }
47504
47505
47506 static int
47507 test_xmlXPathFunctionLookup(void) {
47508     int test_ret = 0;
47509
47510
47511     /* missing type support */
47512     return(test_ret);
47513 }
47514
47515
47516 static int
47517 test_xmlXPathFunctionLookupNS(void) {
47518     int test_ret = 0;
47519
47520
47521     /* missing type support */
47522     return(test_ret);
47523 }
47524
47525
47526 static int
47527 test_xmlXPathHasSameNodes(void) {
47528     int test_ret = 0;
47529
47530 #if defined(LIBXML_XPATH_ENABLED)
47531     int mem_base;
47532     int ret_val;
47533     xmlNodeSetPtr nodes1; /* a node-set */
47534     int n_nodes1;
47535     xmlNodeSetPtr nodes2; /* a node-set */
47536     int n_nodes2;
47537
47538     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47539     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47540         mem_base = xmlMemBlocks();
47541         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47542         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47543
47544         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47545         desret_int(ret_val);
47546         call_tests++;
47547         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47548         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47549         xmlResetLastError();
47550         if (mem_base != xmlMemBlocks()) {
47551             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47552                    xmlMemBlocks() - mem_base);
47553             test_ret++;
47554             printf(" %d", n_nodes1);
47555             printf(" %d", n_nodes2);
47556             printf("\n");
47557         }
47558     }
47559     }
47560     function_tests++;
47561 #endif
47562
47563     return(test_ret);
47564 }
47565
47566
47567 static int
47568 test_xmlXPathIdFunction(void) {
47569     int test_ret = 0;
47570
47571 #if defined(LIBXML_XPATH_ENABLED)
47572     int mem_base;
47573     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47574     int n_ctxt;
47575     int nargs; /* the number of arguments */
47576     int n_nargs;
47577
47578     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47579     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47580         mem_base = xmlMemBlocks();
47581         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47582         nargs = gen_int(n_nargs, 1);
47583
47584         xmlXPathIdFunction(ctxt, nargs);
47585         call_tests++;
47586         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47587         des_int(n_nargs, nargs, 1);
47588         xmlResetLastError();
47589         if (mem_base != xmlMemBlocks()) {
47590             printf("Leak of %d blocks found in xmlXPathIdFunction",
47591                    xmlMemBlocks() - mem_base);
47592             test_ret++;
47593             printf(" %d", n_ctxt);
47594             printf(" %d", n_nargs);
47595             printf("\n");
47596         }
47597     }
47598     }
47599     function_tests++;
47600 #endif
47601
47602     return(test_ret);
47603 }
47604
47605
47606 static int
47607 test_xmlXPathIntersection(void) {
47608     int test_ret = 0;
47609
47610 #if defined(LIBXML_XPATH_ENABLED)
47611     int mem_base;
47612     xmlNodeSetPtr ret_val;
47613     xmlNodeSetPtr nodes1; /* a node-set */
47614     int n_nodes1;
47615     xmlNodeSetPtr nodes2; /* a node-set */
47616     int n_nodes2;
47617
47618     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47619     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47620         mem_base = xmlMemBlocks();
47621         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47622         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47623
47624         ret_val = xmlXPathIntersection(nodes1, nodes2);
47625         desret_xmlNodeSetPtr(ret_val);
47626         call_tests++;
47627         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47628         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47629         xmlResetLastError();
47630         if (mem_base != xmlMemBlocks()) {
47631             printf("Leak of %d blocks found in xmlXPathIntersection",
47632                    xmlMemBlocks() - mem_base);
47633             test_ret++;
47634             printf(" %d", n_nodes1);
47635             printf(" %d", n_nodes2);
47636             printf("\n");
47637         }
47638     }
47639     }
47640     function_tests++;
47641 #endif
47642
47643     return(test_ret);
47644 }
47645
47646
47647 static int
47648 test_xmlXPathIsNodeType(void) {
47649     int test_ret = 0;
47650
47651 #if defined(LIBXML_XPATH_ENABLED)
47652     int mem_base;
47653     int ret_val;
47654     xmlChar * name; /* a name string */
47655     int n_name;
47656
47657     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47658         mem_base = xmlMemBlocks();
47659         name = gen_const_xmlChar_ptr(n_name, 0);
47660
47661         ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47662         desret_int(ret_val);
47663         call_tests++;
47664         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47665         xmlResetLastError();
47666         if (mem_base != xmlMemBlocks()) {
47667             printf("Leak of %d blocks found in xmlXPathIsNodeType",
47668                    xmlMemBlocks() - mem_base);
47669             test_ret++;
47670             printf(" %d", n_name);
47671             printf("\n");
47672         }
47673     }
47674     function_tests++;
47675 #endif
47676
47677     return(test_ret);
47678 }
47679
47680
47681 static int
47682 test_xmlXPathLangFunction(void) {
47683     int test_ret = 0;
47684
47685 #if defined(LIBXML_XPATH_ENABLED)
47686     int mem_base;
47687     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47688     int n_ctxt;
47689     int nargs; /* the number of arguments */
47690     int n_nargs;
47691
47692     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47693     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47694         mem_base = xmlMemBlocks();
47695         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47696         nargs = gen_int(n_nargs, 1);
47697
47698         xmlXPathLangFunction(ctxt, nargs);
47699         call_tests++;
47700         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47701         des_int(n_nargs, nargs, 1);
47702         xmlResetLastError();
47703         if (mem_base != xmlMemBlocks()) {
47704             printf("Leak of %d blocks found in xmlXPathLangFunction",
47705                    xmlMemBlocks() - mem_base);
47706             test_ret++;
47707             printf(" %d", n_ctxt);
47708             printf(" %d", n_nargs);
47709             printf("\n");
47710         }
47711     }
47712     }
47713     function_tests++;
47714 #endif
47715
47716     return(test_ret);
47717 }
47718
47719
47720 static int
47721 test_xmlXPathLastFunction(void) {
47722     int test_ret = 0;
47723
47724 #if defined(LIBXML_XPATH_ENABLED)
47725     int mem_base;
47726     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47727     int n_ctxt;
47728     int nargs; /* the number of arguments */
47729     int n_nargs;
47730
47731     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47732     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47733         mem_base = xmlMemBlocks();
47734         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47735         nargs = gen_int(n_nargs, 1);
47736
47737         xmlXPathLastFunction(ctxt, nargs);
47738         call_tests++;
47739         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47740         des_int(n_nargs, nargs, 1);
47741         xmlResetLastError();
47742         if (mem_base != xmlMemBlocks()) {
47743             printf("Leak of %d blocks found in xmlXPathLastFunction",
47744                    xmlMemBlocks() - mem_base);
47745             test_ret++;
47746             printf(" %d", n_ctxt);
47747             printf(" %d", n_nargs);
47748             printf("\n");
47749         }
47750     }
47751     }
47752     function_tests++;
47753 #endif
47754
47755     return(test_ret);
47756 }
47757
47758
47759 static int
47760 test_xmlXPathLeading(void) {
47761     int test_ret = 0;
47762
47763 #if defined(LIBXML_XPATH_ENABLED)
47764     int mem_base;
47765     xmlNodeSetPtr ret_val;
47766     xmlNodeSetPtr nodes1; /* a node-set */
47767     int n_nodes1;
47768     xmlNodeSetPtr nodes2; /* a node-set */
47769     int n_nodes2;
47770
47771     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47772     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47773         mem_base = xmlMemBlocks();
47774         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47775         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47776
47777         ret_val = xmlXPathLeading(nodes1, nodes2);
47778         desret_xmlNodeSetPtr(ret_val);
47779         call_tests++;
47780         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47781         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47782         xmlResetLastError();
47783         if (mem_base != xmlMemBlocks()) {
47784             printf("Leak of %d blocks found in xmlXPathLeading",
47785                    xmlMemBlocks() - mem_base);
47786             test_ret++;
47787             printf(" %d", n_nodes1);
47788             printf(" %d", n_nodes2);
47789             printf("\n");
47790         }
47791     }
47792     }
47793     function_tests++;
47794 #endif
47795
47796     return(test_ret);
47797 }
47798
47799
47800 static int
47801 test_xmlXPathLeadingSorted(void) {
47802     int test_ret = 0;
47803
47804 #if defined(LIBXML_XPATH_ENABLED)
47805     int mem_base;
47806     xmlNodeSetPtr ret_val;
47807     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47808     int n_nodes1;
47809     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47810     int n_nodes2;
47811
47812     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47813     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47814         mem_base = xmlMemBlocks();
47815         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47816         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47817
47818         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47819         desret_xmlNodeSetPtr(ret_val);
47820         call_tests++;
47821         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47822         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47823         xmlResetLastError();
47824         if (mem_base != xmlMemBlocks()) {
47825             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47826                    xmlMemBlocks() - mem_base);
47827             test_ret++;
47828             printf(" %d", n_nodes1);
47829             printf(" %d", n_nodes2);
47830             printf("\n");
47831         }
47832     }
47833     }
47834     function_tests++;
47835 #endif
47836
47837     return(test_ret);
47838 }
47839
47840
47841 static int
47842 test_xmlXPathLocalNameFunction(void) {
47843     int test_ret = 0;
47844
47845 #if defined(LIBXML_XPATH_ENABLED)
47846     int mem_base;
47847     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47848     int n_ctxt;
47849     int nargs; /* the number of arguments */
47850     int n_nargs;
47851
47852     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47853     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47854         mem_base = xmlMemBlocks();
47855         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47856         nargs = gen_int(n_nargs, 1);
47857
47858         xmlXPathLocalNameFunction(ctxt, nargs);
47859         call_tests++;
47860         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47861         des_int(n_nargs, nargs, 1);
47862         xmlResetLastError();
47863         if (mem_base != xmlMemBlocks()) {
47864             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47865                    xmlMemBlocks() - mem_base);
47866             test_ret++;
47867             printf(" %d", n_ctxt);
47868             printf(" %d", n_nargs);
47869             printf("\n");
47870         }
47871     }
47872     }
47873     function_tests++;
47874 #endif
47875
47876     return(test_ret);
47877 }
47878
47879
47880 static int
47881 test_xmlXPathModValues(void) {
47882     int test_ret = 0;
47883
47884 #if defined(LIBXML_XPATH_ENABLED)
47885     int mem_base;
47886     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47887     int n_ctxt;
47888
47889     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47890         mem_base = xmlMemBlocks();
47891         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47892
47893         xmlXPathModValues(ctxt);
47894         call_tests++;
47895         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47896         xmlResetLastError();
47897         if (mem_base != xmlMemBlocks()) {
47898             printf("Leak of %d blocks found in xmlXPathModValues",
47899                    xmlMemBlocks() - mem_base);
47900             test_ret++;
47901             printf(" %d", n_ctxt);
47902             printf("\n");
47903         }
47904     }
47905     function_tests++;
47906 #endif
47907
47908     return(test_ret);
47909 }
47910
47911
47912 static int
47913 test_xmlXPathMultValues(void) {
47914     int test_ret = 0;
47915
47916 #if defined(LIBXML_XPATH_ENABLED)
47917     int mem_base;
47918     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47919     int n_ctxt;
47920
47921     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47922         mem_base = xmlMemBlocks();
47923         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47924
47925         xmlXPathMultValues(ctxt);
47926         call_tests++;
47927         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47928         xmlResetLastError();
47929         if (mem_base != xmlMemBlocks()) {
47930             printf("Leak of %d blocks found in xmlXPathMultValues",
47931                    xmlMemBlocks() - mem_base);
47932             test_ret++;
47933             printf(" %d", n_ctxt);
47934             printf("\n");
47935         }
47936     }
47937     function_tests++;
47938 #endif
47939
47940     return(test_ret);
47941 }
47942
47943
47944 static int
47945 test_xmlXPathNamespaceURIFunction(void) {
47946     int test_ret = 0;
47947
47948 #if defined(LIBXML_XPATH_ENABLED)
47949     int mem_base;
47950     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47951     int n_ctxt;
47952     int nargs; /* the number of arguments */
47953     int n_nargs;
47954
47955     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47956     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47957         mem_base = xmlMemBlocks();
47958         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47959         nargs = gen_int(n_nargs, 1);
47960
47961         xmlXPathNamespaceURIFunction(ctxt, nargs);
47962         call_tests++;
47963         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47964         des_int(n_nargs, nargs, 1);
47965         xmlResetLastError();
47966         if (mem_base != xmlMemBlocks()) {
47967             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47968                    xmlMemBlocks() - mem_base);
47969             test_ret++;
47970             printf(" %d", n_ctxt);
47971             printf(" %d", n_nargs);
47972             printf("\n");
47973         }
47974     }
47975     }
47976     function_tests++;
47977 #endif
47978
47979     return(test_ret);
47980 }
47981
47982
47983 static int
47984 test_xmlXPathNewBoolean(void) {
47985     int test_ret = 0;
47986
47987 #if defined(LIBXML_XPATH_ENABLED)
47988     int mem_base;
47989     xmlXPathObjectPtr ret_val;
47990     int val; /* the boolean value */
47991     int n_val;
47992
47993     for (n_val = 0;n_val < gen_nb_int;n_val++) {
47994         mem_base = xmlMemBlocks();
47995         val = gen_int(n_val, 0);
47996
47997         ret_val = xmlXPathNewBoolean(val);
47998         desret_xmlXPathObjectPtr(ret_val);
47999         call_tests++;
48000         des_int(n_val, val, 0);
48001         xmlResetLastError();
48002         if (mem_base != xmlMemBlocks()) {
48003             printf("Leak of %d blocks found in xmlXPathNewBoolean",
48004                    xmlMemBlocks() - mem_base);
48005             test_ret++;
48006             printf(" %d", n_val);
48007             printf("\n");
48008         }
48009     }
48010     function_tests++;
48011 #endif
48012
48013     return(test_ret);
48014 }
48015
48016
48017 static int
48018 test_xmlXPathNewCString(void) {
48019     int test_ret = 0;
48020
48021 #if defined(LIBXML_XPATH_ENABLED)
48022     int mem_base;
48023     xmlXPathObjectPtr ret_val;
48024     char * val; /* the char * value */
48025     int n_val;
48026
48027     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48028         mem_base = xmlMemBlocks();
48029         val = gen_const_char_ptr(n_val, 0);
48030
48031         ret_val = xmlXPathNewCString((const char *)val);
48032         desret_xmlXPathObjectPtr(ret_val);
48033         call_tests++;
48034         des_const_char_ptr(n_val, (const char *)val, 0);
48035         xmlResetLastError();
48036         if (mem_base != xmlMemBlocks()) {
48037             printf("Leak of %d blocks found in xmlXPathNewCString",
48038                    xmlMemBlocks() - mem_base);
48039             test_ret++;
48040             printf(" %d", n_val);
48041             printf("\n");
48042         }
48043     }
48044     function_tests++;
48045 #endif
48046
48047     return(test_ret);
48048 }
48049
48050
48051 static int
48052 test_xmlXPathNewFloat(void) {
48053     int test_ret = 0;
48054
48055 #if defined(LIBXML_XPATH_ENABLED)
48056     int mem_base;
48057     xmlXPathObjectPtr ret_val;
48058     double val; /* the double value */
48059     int n_val;
48060
48061     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48062         mem_base = xmlMemBlocks();
48063         val = gen_double(n_val, 0);
48064
48065         ret_val = xmlXPathNewFloat(val);
48066         desret_xmlXPathObjectPtr(ret_val);
48067         call_tests++;
48068         des_double(n_val, val, 0);
48069         xmlResetLastError();
48070         if (mem_base != xmlMemBlocks()) {
48071             printf("Leak of %d blocks found in xmlXPathNewFloat",
48072                    xmlMemBlocks() - mem_base);
48073             test_ret++;
48074             printf(" %d", n_val);
48075             printf("\n");
48076         }
48077     }
48078     function_tests++;
48079 #endif
48080
48081     return(test_ret);
48082 }
48083
48084
48085 static int
48086 test_xmlXPathNewNodeSet(void) {
48087     int test_ret = 0;
48088
48089 #if defined(LIBXML_XPATH_ENABLED)
48090     int mem_base;
48091     xmlXPathObjectPtr ret_val;
48092     xmlNodePtr val; /* the NodePtr value */
48093     int n_val;
48094
48095     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48096         mem_base = xmlMemBlocks();
48097         val = gen_xmlNodePtr(n_val, 0);
48098
48099         ret_val = xmlXPathNewNodeSet(val);
48100         desret_xmlXPathObjectPtr(ret_val);
48101         call_tests++;
48102         des_xmlNodePtr(n_val, val, 0);
48103         xmlResetLastError();
48104         if (mem_base != xmlMemBlocks()) {
48105             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48106                    xmlMemBlocks() - mem_base);
48107             test_ret++;
48108             printf(" %d", n_val);
48109             printf("\n");
48110         }
48111     }
48112     function_tests++;
48113 #endif
48114
48115     return(test_ret);
48116 }
48117
48118
48119 static int
48120 test_xmlXPathNewNodeSetList(void) {
48121     int test_ret = 0;
48122
48123 #if defined(LIBXML_XPATH_ENABLED)
48124     int mem_base;
48125     xmlXPathObjectPtr ret_val;
48126     xmlNodeSetPtr val; /* an existing NodeSet */
48127     int n_val;
48128
48129     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48130         mem_base = xmlMemBlocks();
48131         val = gen_xmlNodeSetPtr(n_val, 0);
48132
48133         ret_val = xmlXPathNewNodeSetList(val);
48134         desret_xmlXPathObjectPtr(ret_val);
48135         call_tests++;
48136         des_xmlNodeSetPtr(n_val, val, 0);
48137         xmlResetLastError();
48138         if (mem_base != xmlMemBlocks()) {
48139             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48140                    xmlMemBlocks() - mem_base);
48141             test_ret++;
48142             printf(" %d", n_val);
48143             printf("\n");
48144         }
48145     }
48146     function_tests++;
48147 #endif
48148
48149     return(test_ret);
48150 }
48151
48152
48153 static int
48154 test_xmlXPathNewParserContext(void) {
48155     int test_ret = 0;
48156
48157
48158     /* missing type support */
48159     return(test_ret);
48160 }
48161
48162
48163 static int
48164 test_xmlXPathNewString(void) {
48165     int test_ret = 0;
48166
48167 #if defined(LIBXML_XPATH_ENABLED)
48168     int mem_base;
48169     xmlXPathObjectPtr ret_val;
48170     xmlChar * val; /* the xmlChar * value */
48171     int n_val;
48172
48173     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48174         mem_base = xmlMemBlocks();
48175         val = gen_const_xmlChar_ptr(n_val, 0);
48176
48177         ret_val = xmlXPathNewString((const xmlChar *)val);
48178         desret_xmlXPathObjectPtr(ret_val);
48179         call_tests++;
48180         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48181         xmlResetLastError();
48182         if (mem_base != xmlMemBlocks()) {
48183             printf("Leak of %d blocks found in xmlXPathNewString",
48184                    xmlMemBlocks() - mem_base);
48185             test_ret++;
48186             printf(" %d", n_val);
48187             printf("\n");
48188         }
48189     }
48190     function_tests++;
48191 #endif
48192
48193     return(test_ret);
48194 }
48195
48196
48197 static int
48198 test_xmlXPathNextAncestor(void) {
48199     int test_ret = 0;
48200
48201 #if defined(LIBXML_XPATH_ENABLED)
48202     int mem_base;
48203     xmlNodePtr ret_val;
48204     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48205     int n_ctxt;
48206     xmlNodePtr cur; /* the current node in the traversal */
48207     int n_cur;
48208
48209     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48210     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48211         mem_base = xmlMemBlocks();
48212         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48213         cur = gen_xmlNodePtr(n_cur, 1);
48214
48215         ret_val = xmlXPathNextAncestor(ctxt, cur);
48216         desret_xmlNodePtr(ret_val);
48217         call_tests++;
48218         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48219         des_xmlNodePtr(n_cur, cur, 1);
48220         xmlResetLastError();
48221         if (mem_base != xmlMemBlocks()) {
48222             printf("Leak of %d blocks found in xmlXPathNextAncestor",
48223                    xmlMemBlocks() - mem_base);
48224             test_ret++;
48225             printf(" %d", n_ctxt);
48226             printf(" %d", n_cur);
48227             printf("\n");
48228         }
48229     }
48230     }
48231     function_tests++;
48232 #endif
48233
48234     return(test_ret);
48235 }
48236
48237
48238 static int
48239 test_xmlXPathNextAncestorOrSelf(void) {
48240     int test_ret = 0;
48241
48242 #if defined(LIBXML_XPATH_ENABLED)
48243     int mem_base;
48244     xmlNodePtr ret_val;
48245     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48246     int n_ctxt;
48247     xmlNodePtr cur; /* the current node in the traversal */
48248     int n_cur;
48249
48250     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48251     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48252         mem_base = xmlMemBlocks();
48253         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48254         cur = gen_xmlNodePtr(n_cur, 1);
48255
48256         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48257         desret_xmlNodePtr(ret_val);
48258         call_tests++;
48259         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48260         des_xmlNodePtr(n_cur, cur, 1);
48261         xmlResetLastError();
48262         if (mem_base != xmlMemBlocks()) {
48263             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48264                    xmlMemBlocks() - mem_base);
48265             test_ret++;
48266             printf(" %d", n_ctxt);
48267             printf(" %d", n_cur);
48268             printf("\n");
48269         }
48270     }
48271     }
48272     function_tests++;
48273 #endif
48274
48275     return(test_ret);
48276 }
48277
48278
48279 static int
48280 test_xmlXPathNextAttribute(void) {
48281     int test_ret = 0;
48282
48283 #if defined(LIBXML_XPATH_ENABLED)
48284     int mem_base;
48285     xmlNodePtr ret_val;
48286     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48287     int n_ctxt;
48288     xmlNodePtr cur; /* the current attribute in the traversal */
48289     int n_cur;
48290
48291     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48292     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48293         mem_base = xmlMemBlocks();
48294         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48295         cur = gen_xmlNodePtr(n_cur, 1);
48296
48297         ret_val = xmlXPathNextAttribute(ctxt, cur);
48298         desret_xmlNodePtr(ret_val);
48299         call_tests++;
48300         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48301         des_xmlNodePtr(n_cur, cur, 1);
48302         xmlResetLastError();
48303         if (mem_base != xmlMemBlocks()) {
48304             printf("Leak of %d blocks found in xmlXPathNextAttribute",
48305                    xmlMemBlocks() - mem_base);
48306             test_ret++;
48307             printf(" %d", n_ctxt);
48308             printf(" %d", n_cur);
48309             printf("\n");
48310         }
48311     }
48312     }
48313     function_tests++;
48314 #endif
48315
48316     return(test_ret);
48317 }
48318
48319
48320 static int
48321 test_xmlXPathNextChild(void) {
48322     int test_ret = 0;
48323
48324 #if defined(LIBXML_XPATH_ENABLED)
48325     int mem_base;
48326     xmlNodePtr ret_val;
48327     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48328     int n_ctxt;
48329     xmlNodePtr cur; /* the current node in the traversal */
48330     int n_cur;
48331
48332     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48333     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48334         mem_base = xmlMemBlocks();
48335         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48336         cur = gen_xmlNodePtr(n_cur, 1);
48337
48338         ret_val = xmlXPathNextChild(ctxt, cur);
48339         desret_xmlNodePtr(ret_val);
48340         call_tests++;
48341         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48342         des_xmlNodePtr(n_cur, cur, 1);
48343         xmlResetLastError();
48344         if (mem_base != xmlMemBlocks()) {
48345             printf("Leak of %d blocks found in xmlXPathNextChild",
48346                    xmlMemBlocks() - mem_base);
48347             test_ret++;
48348             printf(" %d", n_ctxt);
48349             printf(" %d", n_cur);
48350             printf("\n");
48351         }
48352     }
48353     }
48354     function_tests++;
48355 #endif
48356
48357     return(test_ret);
48358 }
48359
48360
48361 static int
48362 test_xmlXPathNextDescendant(void) {
48363     int test_ret = 0;
48364
48365 #if defined(LIBXML_XPATH_ENABLED)
48366     int mem_base;
48367     xmlNodePtr ret_val;
48368     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48369     int n_ctxt;
48370     xmlNodePtr cur; /* the current node in the traversal */
48371     int n_cur;
48372
48373     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48374     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48375         mem_base = xmlMemBlocks();
48376         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48377         cur = gen_xmlNodePtr(n_cur, 1);
48378
48379         ret_val = xmlXPathNextDescendant(ctxt, cur);
48380         desret_xmlNodePtr(ret_val);
48381         call_tests++;
48382         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48383         des_xmlNodePtr(n_cur, cur, 1);
48384         xmlResetLastError();
48385         if (mem_base != xmlMemBlocks()) {
48386             printf("Leak of %d blocks found in xmlXPathNextDescendant",
48387                    xmlMemBlocks() - mem_base);
48388             test_ret++;
48389             printf(" %d", n_ctxt);
48390             printf(" %d", n_cur);
48391             printf("\n");
48392         }
48393     }
48394     }
48395     function_tests++;
48396 #endif
48397
48398     return(test_ret);
48399 }
48400
48401
48402 static int
48403 test_xmlXPathNextDescendantOrSelf(void) {
48404     int test_ret = 0;
48405
48406 #if defined(LIBXML_XPATH_ENABLED)
48407     int mem_base;
48408     xmlNodePtr ret_val;
48409     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48410     int n_ctxt;
48411     xmlNodePtr cur; /* the current node in the traversal */
48412     int n_cur;
48413
48414     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48415     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48416         mem_base = xmlMemBlocks();
48417         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48418         cur = gen_xmlNodePtr(n_cur, 1);
48419
48420         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48421         desret_xmlNodePtr(ret_val);
48422         call_tests++;
48423         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48424         des_xmlNodePtr(n_cur, cur, 1);
48425         xmlResetLastError();
48426         if (mem_base != xmlMemBlocks()) {
48427             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48428                    xmlMemBlocks() - mem_base);
48429             test_ret++;
48430             printf(" %d", n_ctxt);
48431             printf(" %d", n_cur);
48432             printf("\n");
48433         }
48434     }
48435     }
48436     function_tests++;
48437 #endif
48438
48439     return(test_ret);
48440 }
48441
48442
48443 static int
48444 test_xmlXPathNextFollowing(void) {
48445     int test_ret = 0;
48446
48447 #if defined(LIBXML_XPATH_ENABLED)
48448     int mem_base;
48449     xmlNodePtr ret_val;
48450     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48451     int n_ctxt;
48452     xmlNodePtr cur; /* the current node in the traversal */
48453     int n_cur;
48454
48455     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48456     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48457         mem_base = xmlMemBlocks();
48458         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48459         cur = gen_xmlNodePtr(n_cur, 1);
48460
48461         ret_val = xmlXPathNextFollowing(ctxt, cur);
48462         desret_xmlNodePtr(ret_val);
48463         call_tests++;
48464         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48465         des_xmlNodePtr(n_cur, cur, 1);
48466         xmlResetLastError();
48467         if (mem_base != xmlMemBlocks()) {
48468             printf("Leak of %d blocks found in xmlXPathNextFollowing",
48469                    xmlMemBlocks() - mem_base);
48470             test_ret++;
48471             printf(" %d", n_ctxt);
48472             printf(" %d", n_cur);
48473             printf("\n");
48474         }
48475     }
48476     }
48477     function_tests++;
48478 #endif
48479
48480     return(test_ret);
48481 }
48482
48483
48484 static int
48485 test_xmlXPathNextFollowingSibling(void) {
48486     int test_ret = 0;
48487
48488 #if defined(LIBXML_XPATH_ENABLED)
48489     int mem_base;
48490     xmlNodePtr ret_val;
48491     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48492     int n_ctxt;
48493     xmlNodePtr cur; /* the current node in the traversal */
48494     int n_cur;
48495
48496     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48497     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48498         mem_base = xmlMemBlocks();
48499         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48500         cur = gen_xmlNodePtr(n_cur, 1);
48501
48502         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48503         desret_xmlNodePtr(ret_val);
48504         call_tests++;
48505         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48506         des_xmlNodePtr(n_cur, cur, 1);
48507         xmlResetLastError();
48508         if (mem_base != xmlMemBlocks()) {
48509             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48510                    xmlMemBlocks() - mem_base);
48511             test_ret++;
48512             printf(" %d", n_ctxt);
48513             printf(" %d", n_cur);
48514             printf("\n");
48515         }
48516     }
48517     }
48518     function_tests++;
48519 #endif
48520
48521     return(test_ret);
48522 }
48523
48524
48525 static int
48526 test_xmlXPathNextNamespace(void) {
48527     int test_ret = 0;
48528
48529 #if defined(LIBXML_XPATH_ENABLED)
48530     int mem_base;
48531     xmlNodePtr ret_val;
48532     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48533     int n_ctxt;
48534     xmlNodePtr cur; /* the current attribute in the traversal */
48535     int n_cur;
48536
48537     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48538     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48539         mem_base = xmlMemBlocks();
48540         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48541         cur = gen_xmlNodePtr(n_cur, 1);
48542
48543         ret_val = xmlXPathNextNamespace(ctxt, cur);
48544         desret_xmlNodePtr(ret_val);
48545         call_tests++;
48546         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48547         des_xmlNodePtr(n_cur, cur, 1);
48548         xmlResetLastError();
48549         if (mem_base != xmlMemBlocks()) {
48550             printf("Leak of %d blocks found in xmlXPathNextNamespace",
48551                    xmlMemBlocks() - mem_base);
48552             test_ret++;
48553             printf(" %d", n_ctxt);
48554             printf(" %d", n_cur);
48555             printf("\n");
48556         }
48557     }
48558     }
48559     function_tests++;
48560 #endif
48561
48562     return(test_ret);
48563 }
48564
48565
48566 static int
48567 test_xmlXPathNextParent(void) {
48568     int test_ret = 0;
48569
48570 #if defined(LIBXML_XPATH_ENABLED)
48571     int mem_base;
48572     xmlNodePtr ret_val;
48573     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48574     int n_ctxt;
48575     xmlNodePtr cur; /* the current node in the traversal */
48576     int n_cur;
48577
48578     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48579     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48580         mem_base = xmlMemBlocks();
48581         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48582         cur = gen_xmlNodePtr(n_cur, 1);
48583
48584         ret_val = xmlXPathNextParent(ctxt, cur);
48585         desret_xmlNodePtr(ret_val);
48586         call_tests++;
48587         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48588         des_xmlNodePtr(n_cur, cur, 1);
48589         xmlResetLastError();
48590         if (mem_base != xmlMemBlocks()) {
48591             printf("Leak of %d blocks found in xmlXPathNextParent",
48592                    xmlMemBlocks() - mem_base);
48593             test_ret++;
48594             printf(" %d", n_ctxt);
48595             printf(" %d", n_cur);
48596             printf("\n");
48597         }
48598     }
48599     }
48600     function_tests++;
48601 #endif
48602
48603     return(test_ret);
48604 }
48605
48606
48607 static int
48608 test_xmlXPathNextPreceding(void) {
48609     int test_ret = 0;
48610
48611 #if defined(LIBXML_XPATH_ENABLED)
48612     int mem_base;
48613     xmlNodePtr ret_val;
48614     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48615     int n_ctxt;
48616     xmlNodePtr cur; /* the current node in the traversal */
48617     int n_cur;
48618
48619     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48620     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48621         mem_base = xmlMemBlocks();
48622         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48623         cur = gen_xmlNodePtr(n_cur, 1);
48624
48625         ret_val = xmlXPathNextPreceding(ctxt, cur);
48626         desret_xmlNodePtr(ret_val);
48627         call_tests++;
48628         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48629         des_xmlNodePtr(n_cur, cur, 1);
48630         xmlResetLastError();
48631         if (mem_base != xmlMemBlocks()) {
48632             printf("Leak of %d blocks found in xmlXPathNextPreceding",
48633                    xmlMemBlocks() - mem_base);
48634             test_ret++;
48635             printf(" %d", n_ctxt);
48636             printf(" %d", n_cur);
48637             printf("\n");
48638         }
48639     }
48640     }
48641     function_tests++;
48642 #endif
48643
48644     return(test_ret);
48645 }
48646
48647
48648 static int
48649 test_xmlXPathNextPrecedingSibling(void) {
48650     int test_ret = 0;
48651
48652 #if defined(LIBXML_XPATH_ENABLED)
48653     int mem_base;
48654     xmlNodePtr ret_val;
48655     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48656     int n_ctxt;
48657     xmlNodePtr cur; /* the current node in the traversal */
48658     int n_cur;
48659
48660     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48661     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48662         mem_base = xmlMemBlocks();
48663         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48664         cur = gen_xmlNodePtr(n_cur, 1);
48665
48666         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48667         desret_xmlNodePtr(ret_val);
48668         call_tests++;
48669         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48670         des_xmlNodePtr(n_cur, cur, 1);
48671         xmlResetLastError();
48672         if (mem_base != xmlMemBlocks()) {
48673             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48674                    xmlMemBlocks() - mem_base);
48675             test_ret++;
48676             printf(" %d", n_ctxt);
48677             printf(" %d", n_cur);
48678             printf("\n");
48679         }
48680     }
48681     }
48682     function_tests++;
48683 #endif
48684
48685     return(test_ret);
48686 }
48687
48688
48689 static int
48690 test_xmlXPathNextSelf(void) {
48691     int test_ret = 0;
48692
48693 #if defined(LIBXML_XPATH_ENABLED)
48694     int mem_base;
48695     xmlNodePtr ret_val;
48696     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48697     int n_ctxt;
48698     xmlNodePtr cur; /* the current node in the traversal */
48699     int n_cur;
48700
48701     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48702     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48703         mem_base = xmlMemBlocks();
48704         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48705         cur = gen_xmlNodePtr(n_cur, 1);
48706
48707         ret_val = xmlXPathNextSelf(ctxt, cur);
48708         desret_xmlNodePtr(ret_val);
48709         call_tests++;
48710         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48711         des_xmlNodePtr(n_cur, cur, 1);
48712         xmlResetLastError();
48713         if (mem_base != xmlMemBlocks()) {
48714             printf("Leak of %d blocks found in xmlXPathNextSelf",
48715                    xmlMemBlocks() - mem_base);
48716             test_ret++;
48717             printf(" %d", n_ctxt);
48718             printf(" %d", n_cur);
48719             printf("\n");
48720         }
48721     }
48722     }
48723     function_tests++;
48724 #endif
48725
48726     return(test_ret);
48727 }
48728
48729
48730 static int
48731 test_xmlXPathNodeLeading(void) {
48732     int test_ret = 0;
48733
48734 #if defined(LIBXML_XPATH_ENABLED)
48735     int mem_base;
48736     xmlNodeSetPtr ret_val;
48737     xmlNodeSetPtr nodes; /* a node-set */
48738     int n_nodes;
48739     xmlNodePtr node; /* a node */
48740     int n_node;
48741
48742     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48743     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48744         mem_base = xmlMemBlocks();
48745         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48746         node = gen_xmlNodePtr(n_node, 1);
48747
48748         ret_val = xmlXPathNodeLeading(nodes, node);
48749         desret_xmlNodeSetPtr(ret_val);
48750         call_tests++;
48751         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48752         des_xmlNodePtr(n_node, node, 1);
48753         xmlResetLastError();
48754         if (mem_base != xmlMemBlocks()) {
48755             printf("Leak of %d blocks found in xmlXPathNodeLeading",
48756                    xmlMemBlocks() - mem_base);
48757             test_ret++;
48758             printf(" %d", n_nodes);
48759             printf(" %d", n_node);
48760             printf("\n");
48761         }
48762     }
48763     }
48764     function_tests++;
48765 #endif
48766
48767     return(test_ret);
48768 }
48769
48770
48771 static int
48772 test_xmlXPathNodeLeadingSorted(void) {
48773     int test_ret = 0;
48774
48775 #if defined(LIBXML_XPATH_ENABLED)
48776     int mem_base;
48777     xmlNodeSetPtr ret_val;
48778     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48779     int n_nodes;
48780     xmlNodePtr node; /* a node */
48781     int n_node;
48782
48783     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48784     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48785         mem_base = xmlMemBlocks();
48786         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48787         node = gen_xmlNodePtr(n_node, 1);
48788
48789         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48790         desret_xmlNodeSetPtr(ret_val);
48791         call_tests++;
48792         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48793         des_xmlNodePtr(n_node, node, 1);
48794         xmlResetLastError();
48795         if (mem_base != xmlMemBlocks()) {
48796             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48797                    xmlMemBlocks() - mem_base);
48798             test_ret++;
48799             printf(" %d", n_nodes);
48800             printf(" %d", n_node);
48801             printf("\n");
48802         }
48803     }
48804     }
48805     function_tests++;
48806 #endif
48807
48808     return(test_ret);
48809 }
48810
48811
48812 static int
48813 test_xmlXPathNodeSetAdd(void) {
48814     int test_ret = 0;
48815
48816 #if defined(LIBXML_XPATH_ENABLED)
48817     int mem_base;
48818     xmlNodeSetPtr cur; /* the initial node set */
48819     int n_cur;
48820     xmlNodePtr val; /* a new xmlNodePtr */
48821     int n_val;
48822
48823     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48824     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48825         mem_base = xmlMemBlocks();
48826         cur = gen_xmlNodeSetPtr(n_cur, 0);
48827         val = gen_xmlNodePtr(n_val, 1);
48828
48829         xmlXPathNodeSetAdd(cur, val);
48830         call_tests++;
48831         des_xmlNodeSetPtr(n_cur, cur, 0);
48832         des_xmlNodePtr(n_val, val, 1);
48833         xmlResetLastError();
48834         if (mem_base != xmlMemBlocks()) {
48835             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48836                    xmlMemBlocks() - mem_base);
48837             test_ret++;
48838             printf(" %d", n_cur);
48839             printf(" %d", n_val);
48840             printf("\n");
48841         }
48842     }
48843     }
48844     function_tests++;
48845 #endif
48846
48847     return(test_ret);
48848 }
48849
48850
48851 static int
48852 test_xmlXPathNodeSetAddNs(void) {
48853     int test_ret = 0;
48854
48855 #if defined(LIBXML_XPATH_ENABLED)
48856     int mem_base;
48857     xmlNodeSetPtr cur; /* the initial node set */
48858     int n_cur;
48859     xmlNodePtr node; /* the hosting node */
48860     int n_node;
48861     xmlNsPtr ns; /* a the namespace node */
48862     int n_ns;
48863
48864     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48865     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48866     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48867         mem_base = xmlMemBlocks();
48868         cur = gen_xmlNodeSetPtr(n_cur, 0);
48869         node = gen_xmlNodePtr(n_node, 1);
48870         ns = gen_xmlNsPtr(n_ns, 2);
48871
48872         xmlXPathNodeSetAddNs(cur, node, ns);
48873         call_tests++;
48874         des_xmlNodeSetPtr(n_cur, cur, 0);
48875         des_xmlNodePtr(n_node, node, 1);
48876         des_xmlNsPtr(n_ns, ns, 2);
48877         xmlResetLastError();
48878         if (mem_base != xmlMemBlocks()) {
48879             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48880                    xmlMemBlocks() - mem_base);
48881             test_ret++;
48882             printf(" %d", n_cur);
48883             printf(" %d", n_node);
48884             printf(" %d", n_ns);
48885             printf("\n");
48886         }
48887     }
48888     }
48889     }
48890     function_tests++;
48891 #endif
48892
48893     return(test_ret);
48894 }
48895
48896
48897 static int
48898 test_xmlXPathNodeSetAddUnique(void) {
48899     int test_ret = 0;
48900
48901 #if defined(LIBXML_XPATH_ENABLED)
48902     int mem_base;
48903     xmlNodeSetPtr cur; /* the initial node set */
48904     int n_cur;
48905     xmlNodePtr val; /* a new xmlNodePtr */
48906     int n_val;
48907
48908     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48909     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48910         mem_base = xmlMemBlocks();
48911         cur = gen_xmlNodeSetPtr(n_cur, 0);
48912         val = gen_xmlNodePtr(n_val, 1);
48913
48914         xmlXPathNodeSetAddUnique(cur, val);
48915         call_tests++;
48916         des_xmlNodeSetPtr(n_cur, cur, 0);
48917         des_xmlNodePtr(n_val, val, 1);
48918         xmlResetLastError();
48919         if (mem_base != xmlMemBlocks()) {
48920             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48921                    xmlMemBlocks() - mem_base);
48922             test_ret++;
48923             printf(" %d", n_cur);
48924             printf(" %d", n_val);
48925             printf("\n");
48926         }
48927     }
48928     }
48929     function_tests++;
48930 #endif
48931
48932     return(test_ret);
48933 }
48934
48935
48936 static int
48937 test_xmlXPathNodeSetContains(void) {
48938     int test_ret = 0;
48939
48940 #if defined(LIBXML_XPATH_ENABLED)
48941     int mem_base;
48942     int ret_val;
48943     xmlNodeSetPtr cur; /* the node-set */
48944     int n_cur;
48945     xmlNodePtr val; /* the node */
48946     int n_val;
48947
48948     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48949     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48950         mem_base = xmlMemBlocks();
48951         cur = gen_xmlNodeSetPtr(n_cur, 0);
48952         val = gen_xmlNodePtr(n_val, 1);
48953
48954         ret_val = xmlXPathNodeSetContains(cur, val);
48955         desret_int(ret_val);
48956         call_tests++;
48957         des_xmlNodeSetPtr(n_cur, cur, 0);
48958         des_xmlNodePtr(n_val, val, 1);
48959         xmlResetLastError();
48960         if (mem_base != xmlMemBlocks()) {
48961             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48962                    xmlMemBlocks() - mem_base);
48963             test_ret++;
48964             printf(" %d", n_cur);
48965             printf(" %d", n_val);
48966             printf("\n");
48967         }
48968     }
48969     }
48970     function_tests++;
48971 #endif
48972
48973     return(test_ret);
48974 }
48975
48976
48977 static int
48978 test_xmlXPathNodeSetDel(void) {
48979     int test_ret = 0;
48980
48981 #if defined(LIBXML_XPATH_ENABLED)
48982     int mem_base;
48983     xmlNodeSetPtr cur; /* the initial node set */
48984     int n_cur;
48985     xmlNodePtr val; /* an xmlNodePtr */
48986     int n_val;
48987
48988     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48989     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48990         mem_base = xmlMemBlocks();
48991         cur = gen_xmlNodeSetPtr(n_cur, 0);
48992         val = gen_xmlNodePtr(n_val, 1);
48993
48994         xmlXPathNodeSetDel(cur, val);
48995         call_tests++;
48996         des_xmlNodeSetPtr(n_cur, cur, 0);
48997         des_xmlNodePtr(n_val, val, 1);
48998         xmlResetLastError();
48999         if (mem_base != xmlMemBlocks()) {
49000             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49001                    xmlMemBlocks() - mem_base);
49002             test_ret++;
49003             printf(" %d", n_cur);
49004             printf(" %d", n_val);
49005             printf("\n");
49006         }
49007     }
49008     }
49009     function_tests++;
49010 #endif
49011
49012     return(test_ret);
49013 }
49014
49015
49016 static int
49017 test_xmlXPathNodeSetMerge(void) {
49018     int test_ret = 0;
49019
49020 #if defined(LIBXML_XPATH_ENABLED)
49021     int mem_base;
49022     xmlNodeSetPtr ret_val;
49023     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49024     int n_val1;
49025     xmlNodeSetPtr val2; /* the second NodeSet */
49026     int n_val2;
49027
49028     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49029     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49030         mem_base = xmlMemBlocks();
49031         val1 = gen_xmlNodeSetPtr(n_val1, 0);
49032         val2 = gen_xmlNodeSetPtr(n_val2, 1);
49033
49034         ret_val = xmlXPathNodeSetMerge(val1, val2);
49035         desret_xmlNodeSetPtr(ret_val);
49036         call_tests++;
49037         des_xmlNodeSetPtr(n_val1, val1, 0);
49038         des_xmlNodeSetPtr(n_val2, val2, 1);
49039         xmlResetLastError();
49040         if (mem_base != xmlMemBlocks()) {
49041             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49042                    xmlMemBlocks() - mem_base);
49043             test_ret++;
49044             printf(" %d", n_val1);
49045             printf(" %d", n_val2);
49046             printf("\n");
49047         }
49048     }
49049     }
49050     function_tests++;
49051 #endif
49052
49053     return(test_ret);
49054 }
49055
49056
49057 static int
49058 test_xmlXPathNodeSetRemove(void) {
49059     int test_ret = 0;
49060
49061 #if defined(LIBXML_XPATH_ENABLED)
49062     int mem_base;
49063     xmlNodeSetPtr cur; /* the initial node set */
49064     int n_cur;
49065     int val; /* the index to remove */
49066     int n_val;
49067
49068     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49069     for (n_val = 0;n_val < gen_nb_int;n_val++) {
49070         mem_base = xmlMemBlocks();
49071         cur = gen_xmlNodeSetPtr(n_cur, 0);
49072         val = gen_int(n_val, 1);
49073
49074         xmlXPathNodeSetRemove(cur, val);
49075         call_tests++;
49076         des_xmlNodeSetPtr(n_cur, cur, 0);
49077         des_int(n_val, val, 1);
49078         xmlResetLastError();
49079         if (mem_base != xmlMemBlocks()) {
49080             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49081                    xmlMemBlocks() - mem_base);
49082             test_ret++;
49083             printf(" %d", n_cur);
49084             printf(" %d", n_val);
49085             printf("\n");
49086         }
49087     }
49088     }
49089     function_tests++;
49090 #endif
49091
49092     return(test_ret);
49093 }
49094
49095
49096 static int
49097 test_xmlXPathNodeSetSort(void) {
49098     int test_ret = 0;
49099
49100 #if defined(LIBXML_XPATH_ENABLED)
49101     int mem_base;
49102     xmlNodeSetPtr set; /* the node set */
49103     int n_set;
49104
49105     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49106         mem_base = xmlMemBlocks();
49107         set = gen_xmlNodeSetPtr(n_set, 0);
49108
49109         xmlXPathNodeSetSort(set);
49110         call_tests++;
49111         des_xmlNodeSetPtr(n_set, set, 0);
49112         xmlResetLastError();
49113         if (mem_base != xmlMemBlocks()) {
49114             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49115                    xmlMemBlocks() - mem_base);
49116             test_ret++;
49117             printf(" %d", n_set);
49118             printf("\n");
49119         }
49120     }
49121     function_tests++;
49122 #endif
49123
49124     return(test_ret);
49125 }
49126
49127
49128 static int
49129 test_xmlXPathNodeTrailing(void) {
49130     int test_ret = 0;
49131
49132 #if defined(LIBXML_XPATH_ENABLED)
49133     int mem_base;
49134     xmlNodeSetPtr ret_val;
49135     xmlNodeSetPtr nodes; /* a node-set */
49136     int n_nodes;
49137     xmlNodePtr node; /* a node */
49138     int n_node;
49139
49140     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49141     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49142         mem_base = xmlMemBlocks();
49143         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49144         node = gen_xmlNodePtr(n_node, 1);
49145
49146         ret_val = xmlXPathNodeTrailing(nodes, node);
49147         desret_xmlNodeSetPtr(ret_val);
49148         call_tests++;
49149         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49150         des_xmlNodePtr(n_node, node, 1);
49151         xmlResetLastError();
49152         if (mem_base != xmlMemBlocks()) {
49153             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49154                    xmlMemBlocks() - mem_base);
49155             test_ret++;
49156             printf(" %d", n_nodes);
49157             printf(" %d", n_node);
49158             printf("\n");
49159         }
49160     }
49161     }
49162     function_tests++;
49163 #endif
49164
49165     return(test_ret);
49166 }
49167
49168
49169 static int
49170 test_xmlXPathNodeTrailingSorted(void) {
49171     int test_ret = 0;
49172
49173 #if defined(LIBXML_XPATH_ENABLED)
49174     int mem_base;
49175     xmlNodeSetPtr ret_val;
49176     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49177     int n_nodes;
49178     xmlNodePtr node; /* a node */
49179     int n_node;
49180
49181     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49182     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49183         mem_base = xmlMemBlocks();
49184         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49185         node = gen_xmlNodePtr(n_node, 1);
49186
49187         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49188         desret_xmlNodeSetPtr(ret_val);
49189         call_tests++;
49190         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49191         des_xmlNodePtr(n_node, node, 1);
49192         xmlResetLastError();
49193         if (mem_base != xmlMemBlocks()) {
49194             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49195                    xmlMemBlocks() - mem_base);
49196             test_ret++;
49197             printf(" %d", n_nodes);
49198             printf(" %d", n_node);
49199             printf("\n");
49200         }
49201     }
49202     }
49203     function_tests++;
49204 #endif
49205
49206     return(test_ret);
49207 }
49208
49209
49210 static int
49211 test_xmlXPathNormalizeFunction(void) {
49212     int test_ret = 0;
49213
49214 #if defined(LIBXML_XPATH_ENABLED)
49215     int mem_base;
49216     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49217     int n_ctxt;
49218     int nargs; /* the number of arguments */
49219     int n_nargs;
49220
49221     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49222     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49223         mem_base = xmlMemBlocks();
49224         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49225         nargs = gen_int(n_nargs, 1);
49226
49227         xmlXPathNormalizeFunction(ctxt, nargs);
49228         call_tests++;
49229         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49230         des_int(n_nargs, nargs, 1);
49231         xmlResetLastError();
49232         if (mem_base != xmlMemBlocks()) {
49233             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49234                    xmlMemBlocks() - mem_base);
49235             test_ret++;
49236             printf(" %d", n_ctxt);
49237             printf(" %d", n_nargs);
49238             printf("\n");
49239         }
49240     }
49241     }
49242     function_tests++;
49243 #endif
49244
49245     return(test_ret);
49246 }
49247
49248
49249 static int
49250 test_xmlXPathNotEqualValues(void) {
49251     int test_ret = 0;
49252
49253 #if defined(LIBXML_XPATH_ENABLED)
49254     int mem_base;
49255     int ret_val;
49256     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49257     int n_ctxt;
49258
49259     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49260         mem_base = xmlMemBlocks();
49261         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49262
49263         ret_val = xmlXPathNotEqualValues(ctxt);
49264         desret_int(ret_val);
49265         call_tests++;
49266         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49267         xmlResetLastError();
49268         if (mem_base != xmlMemBlocks()) {
49269             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49270                    xmlMemBlocks() - mem_base);
49271             test_ret++;
49272             printf(" %d", n_ctxt);
49273             printf("\n");
49274         }
49275     }
49276     function_tests++;
49277 #endif
49278
49279     return(test_ret);
49280 }
49281
49282
49283 static int
49284 test_xmlXPathNotFunction(void) {
49285     int test_ret = 0;
49286
49287 #if defined(LIBXML_XPATH_ENABLED)
49288     int mem_base;
49289     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49290     int n_ctxt;
49291     int nargs; /* the number of arguments */
49292     int n_nargs;
49293
49294     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49295     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49296         mem_base = xmlMemBlocks();
49297         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49298         nargs = gen_int(n_nargs, 1);
49299
49300         xmlXPathNotFunction(ctxt, nargs);
49301         call_tests++;
49302         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49303         des_int(n_nargs, nargs, 1);
49304         xmlResetLastError();
49305         if (mem_base != xmlMemBlocks()) {
49306             printf("Leak of %d blocks found in xmlXPathNotFunction",
49307                    xmlMemBlocks() - mem_base);
49308             test_ret++;
49309             printf(" %d", n_ctxt);
49310             printf(" %d", n_nargs);
49311             printf("\n");
49312         }
49313     }
49314     }
49315     function_tests++;
49316 #endif
49317
49318     return(test_ret);
49319 }
49320
49321
49322 static int
49323 test_xmlXPathNsLookup(void) {
49324     int test_ret = 0;
49325
49326 #if defined(LIBXML_XPATH_ENABLED)
49327     int mem_base;
49328     const xmlChar * ret_val;
49329     xmlXPathContextPtr ctxt; /* the XPath context */
49330     int n_ctxt;
49331     xmlChar * prefix; /* the namespace prefix value */
49332     int n_prefix;
49333
49334     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49335     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49336         mem_base = xmlMemBlocks();
49337         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49338         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49339
49340         ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49341         desret_const_xmlChar_ptr(ret_val);
49342         call_tests++;
49343         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49344         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49345         xmlResetLastError();
49346         if (mem_base != xmlMemBlocks()) {
49347             printf("Leak of %d blocks found in xmlXPathNsLookup",
49348                    xmlMemBlocks() - mem_base);
49349             test_ret++;
49350             printf(" %d", n_ctxt);
49351             printf(" %d", n_prefix);
49352             printf("\n");
49353         }
49354     }
49355     }
49356     function_tests++;
49357 #endif
49358
49359     return(test_ret);
49360 }
49361
49362
49363 static int
49364 test_xmlXPathNumberFunction(void) {
49365     int test_ret = 0;
49366
49367 #if defined(LIBXML_XPATH_ENABLED)
49368     int mem_base;
49369     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49370     int n_ctxt;
49371     int nargs; /* the number of arguments */
49372     int n_nargs;
49373
49374     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49375     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49376         mem_base = xmlMemBlocks();
49377         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49378         nargs = gen_int(n_nargs, 1);
49379
49380         xmlXPathNumberFunction(ctxt, nargs);
49381         call_tests++;
49382         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49383         des_int(n_nargs, nargs, 1);
49384         xmlResetLastError();
49385         if (mem_base != xmlMemBlocks()) {
49386             printf("Leak of %d blocks found in xmlXPathNumberFunction",
49387                    xmlMemBlocks() - mem_base);
49388             test_ret++;
49389             printf(" %d", n_ctxt);
49390             printf(" %d", n_nargs);
49391             printf("\n");
49392         }
49393     }
49394     }
49395     function_tests++;
49396 #endif
49397
49398     return(test_ret);
49399 }
49400
49401
49402 static int
49403 test_xmlXPathParseNCName(void) {
49404     int test_ret = 0;
49405
49406 #if defined(LIBXML_XPATH_ENABLED)
49407     int mem_base;
49408     xmlChar * ret_val;
49409     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49410     int n_ctxt;
49411
49412     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49413         mem_base = xmlMemBlocks();
49414         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49415
49416         ret_val = xmlXPathParseNCName(ctxt);
49417         desret_xmlChar_ptr(ret_val);
49418         call_tests++;
49419         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49420         xmlResetLastError();
49421         if (mem_base != xmlMemBlocks()) {
49422             printf("Leak of %d blocks found in xmlXPathParseNCName",
49423                    xmlMemBlocks() - mem_base);
49424             test_ret++;
49425             printf(" %d", n_ctxt);
49426             printf("\n");
49427         }
49428     }
49429     function_tests++;
49430 #endif
49431
49432     return(test_ret);
49433 }
49434
49435
49436 static int
49437 test_xmlXPathParseName(void) {
49438     int test_ret = 0;
49439
49440 #if defined(LIBXML_XPATH_ENABLED)
49441     int mem_base;
49442     xmlChar * ret_val;
49443     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49444     int n_ctxt;
49445
49446     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49447         mem_base = xmlMemBlocks();
49448         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49449
49450         ret_val = xmlXPathParseName(ctxt);
49451         desret_xmlChar_ptr(ret_val);
49452         call_tests++;
49453         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49454         xmlResetLastError();
49455         if (mem_base != xmlMemBlocks()) {
49456             printf("Leak of %d blocks found in xmlXPathParseName",
49457                    xmlMemBlocks() - mem_base);
49458             test_ret++;
49459             printf(" %d", n_ctxt);
49460             printf("\n");
49461         }
49462     }
49463     function_tests++;
49464 #endif
49465
49466     return(test_ret);
49467 }
49468
49469
49470 static int
49471 test_xmlXPathPopBoolean(void) {
49472     int test_ret = 0;
49473
49474 #if defined(LIBXML_XPATH_ENABLED)
49475     int mem_base;
49476     int ret_val;
49477     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49478     int n_ctxt;
49479
49480     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49481         mem_base = xmlMemBlocks();
49482         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49483
49484         ret_val = xmlXPathPopBoolean(ctxt);
49485         desret_int(ret_val);
49486         call_tests++;
49487         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49488         xmlResetLastError();
49489         if (mem_base != xmlMemBlocks()) {
49490             printf("Leak of %d blocks found in xmlXPathPopBoolean",
49491                    xmlMemBlocks() - mem_base);
49492             test_ret++;
49493             printf(" %d", n_ctxt);
49494             printf("\n");
49495         }
49496     }
49497     function_tests++;
49498 #endif
49499
49500     return(test_ret);
49501 }
49502
49503
49504 static int
49505 test_xmlXPathPopExternal(void) {
49506     int test_ret = 0;
49507
49508 #if defined(LIBXML_XPATH_ENABLED)
49509     int mem_base;
49510     void * ret_val;
49511     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49512     int n_ctxt;
49513
49514     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49515         mem_base = xmlMemBlocks();
49516         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49517
49518         ret_val = xmlXPathPopExternal(ctxt);
49519         desret_void_ptr(ret_val);
49520         call_tests++;
49521         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49522         xmlResetLastError();
49523         if (mem_base != xmlMemBlocks()) {
49524             printf("Leak of %d blocks found in xmlXPathPopExternal",
49525                    xmlMemBlocks() - mem_base);
49526             test_ret++;
49527             printf(" %d", n_ctxt);
49528             printf("\n");
49529         }
49530     }
49531     function_tests++;
49532 #endif
49533
49534     return(test_ret);
49535 }
49536
49537
49538 static int
49539 test_xmlXPathPopNodeSet(void) {
49540     int test_ret = 0;
49541
49542 #if defined(LIBXML_XPATH_ENABLED)
49543     int mem_base;
49544     xmlNodeSetPtr ret_val;
49545     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49546     int n_ctxt;
49547
49548     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49549         mem_base = xmlMemBlocks();
49550         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49551
49552         ret_val = xmlXPathPopNodeSet(ctxt);
49553         desret_xmlNodeSetPtr(ret_val);
49554         call_tests++;
49555         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49556         xmlResetLastError();
49557         if (mem_base != xmlMemBlocks()) {
49558             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49559                    xmlMemBlocks() - mem_base);
49560             test_ret++;
49561             printf(" %d", n_ctxt);
49562             printf("\n");
49563         }
49564     }
49565     function_tests++;
49566 #endif
49567
49568     return(test_ret);
49569 }
49570
49571
49572 static int
49573 test_xmlXPathPopNumber(void) {
49574     int test_ret = 0;
49575
49576 #if defined(LIBXML_XPATH_ENABLED)
49577     int mem_base;
49578     double ret_val;
49579     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49580     int n_ctxt;
49581
49582     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49583         mem_base = xmlMemBlocks();
49584         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49585
49586         ret_val = xmlXPathPopNumber(ctxt);
49587         desret_double(ret_val);
49588         call_tests++;
49589         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49590         xmlResetLastError();
49591         if (mem_base != xmlMemBlocks()) {
49592             printf("Leak of %d blocks found in xmlXPathPopNumber",
49593                    xmlMemBlocks() - mem_base);
49594             test_ret++;
49595             printf(" %d", n_ctxt);
49596             printf("\n");
49597         }
49598     }
49599     function_tests++;
49600 #endif
49601
49602     return(test_ret);
49603 }
49604
49605
49606 static int
49607 test_xmlXPathPopString(void) {
49608     int test_ret = 0;
49609
49610 #if defined(LIBXML_XPATH_ENABLED)
49611     int mem_base;
49612     xmlChar * ret_val;
49613     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49614     int n_ctxt;
49615
49616     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49617         mem_base = xmlMemBlocks();
49618         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49619
49620         ret_val = xmlXPathPopString(ctxt);
49621         desret_xmlChar_ptr(ret_val);
49622         call_tests++;
49623         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49624         xmlResetLastError();
49625         if (mem_base != xmlMemBlocks()) {
49626             printf("Leak of %d blocks found in xmlXPathPopString",
49627                    xmlMemBlocks() - mem_base);
49628             test_ret++;
49629             printf(" %d", n_ctxt);
49630             printf("\n");
49631         }
49632     }
49633     function_tests++;
49634 #endif
49635
49636     return(test_ret);
49637 }
49638
49639
49640 static int
49641 test_xmlXPathPositionFunction(void) {
49642     int test_ret = 0;
49643
49644 #if defined(LIBXML_XPATH_ENABLED)
49645     int mem_base;
49646     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49647     int n_ctxt;
49648     int nargs; /* the number of arguments */
49649     int n_nargs;
49650
49651     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49652     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49653         mem_base = xmlMemBlocks();
49654         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49655         nargs = gen_int(n_nargs, 1);
49656
49657         xmlXPathPositionFunction(ctxt, nargs);
49658         call_tests++;
49659         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49660         des_int(n_nargs, nargs, 1);
49661         xmlResetLastError();
49662         if (mem_base != xmlMemBlocks()) {
49663             printf("Leak of %d blocks found in xmlXPathPositionFunction",
49664                    xmlMemBlocks() - mem_base);
49665             test_ret++;
49666             printf(" %d", n_ctxt);
49667             printf(" %d", n_nargs);
49668             printf("\n");
49669         }
49670     }
49671     }
49672     function_tests++;
49673 #endif
49674
49675     return(test_ret);
49676 }
49677
49678
49679 static int
49680 test_xmlXPathRegisterAllFunctions(void) {
49681     int test_ret = 0;
49682
49683 #if defined(LIBXML_XPATH_ENABLED)
49684     int mem_base;
49685     xmlXPathContextPtr ctxt; /* the XPath context */
49686     int n_ctxt;
49687
49688     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49689         mem_base = xmlMemBlocks();
49690         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49691
49692         xmlXPathRegisterAllFunctions(ctxt);
49693         call_tests++;
49694         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49695         xmlResetLastError();
49696         if (mem_base != xmlMemBlocks()) {
49697             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49698                    xmlMemBlocks() - mem_base);
49699             test_ret++;
49700             printf(" %d", n_ctxt);
49701             printf("\n");
49702         }
49703     }
49704     function_tests++;
49705 #endif
49706
49707     return(test_ret);
49708 }
49709
49710
49711 static int
49712 test_xmlXPathRegisterFunc(void) {
49713     int test_ret = 0;
49714
49715
49716     /* missing type support */
49717     return(test_ret);
49718 }
49719
49720
49721 static int
49722 test_xmlXPathRegisterFuncLookup(void) {
49723     int test_ret = 0;
49724
49725
49726     /* missing type support */
49727     return(test_ret);
49728 }
49729
49730
49731 static int
49732 test_xmlXPathRegisterFuncNS(void) {
49733     int test_ret = 0;
49734
49735
49736     /* missing type support */
49737     return(test_ret);
49738 }
49739
49740
49741 static int
49742 test_xmlXPathRegisterNs(void) {
49743     int test_ret = 0;
49744
49745 #if defined(LIBXML_XPATH_ENABLED)
49746     int mem_base;
49747     int ret_val;
49748     xmlXPathContextPtr ctxt; /* the XPath context */
49749     int n_ctxt;
49750     xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
49751     int n_prefix;
49752     xmlChar * ns_uri; /* the namespace name */
49753     int n_ns_uri;
49754
49755     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49756     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49757     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49758         mem_base = xmlMemBlocks();
49759         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49760         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49761         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49762
49763         ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49764         desret_int(ret_val);
49765         call_tests++;
49766         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49767         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49768         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49769         xmlResetLastError();
49770         if (mem_base != xmlMemBlocks()) {
49771             printf("Leak of %d blocks found in xmlXPathRegisterNs",
49772                    xmlMemBlocks() - mem_base);
49773             test_ret++;
49774             printf(" %d", n_ctxt);
49775             printf(" %d", n_prefix);
49776             printf(" %d", n_ns_uri);
49777             printf("\n");
49778         }
49779     }
49780     }
49781     }
49782     function_tests++;
49783 #endif
49784
49785     return(test_ret);
49786 }
49787
49788
49789 static int
49790 test_xmlXPathRegisterVariable(void) {
49791     int test_ret = 0;
49792
49793 #if defined(LIBXML_XPATH_ENABLED)
49794     int mem_base;
49795     int ret_val;
49796     xmlXPathContextPtr ctxt; /* the XPath context */
49797     int n_ctxt;
49798     xmlChar * name; /* the variable name */
49799     int n_name;
49800     xmlXPathObjectPtr value; /* the variable value or NULL */
49801     int n_value;
49802
49803     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49804     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49805     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49806         mem_base = xmlMemBlocks();
49807         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49808         name = gen_const_xmlChar_ptr(n_name, 1);
49809         value = gen_xmlXPathObjectPtr(n_value, 2);
49810
49811         ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49812         desret_int(ret_val);
49813         call_tests++;
49814         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49815         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49816         des_xmlXPathObjectPtr(n_value, value, 2);
49817         xmlResetLastError();
49818         if (mem_base != xmlMemBlocks()) {
49819             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49820                    xmlMemBlocks() - mem_base);
49821             test_ret++;
49822             printf(" %d", n_ctxt);
49823             printf(" %d", n_name);
49824             printf(" %d", n_value);
49825             printf("\n");
49826         }
49827     }
49828     }
49829     }
49830     function_tests++;
49831 #endif
49832
49833     return(test_ret);
49834 }
49835
49836
49837 static int
49838 test_xmlXPathRegisterVariableLookup(void) {
49839     int test_ret = 0;
49840
49841
49842     /* missing type support */
49843     return(test_ret);
49844 }
49845
49846
49847 static int
49848 test_xmlXPathRegisterVariableNS(void) {
49849     int test_ret = 0;
49850
49851 #if defined(LIBXML_XPATH_ENABLED)
49852     int mem_base;
49853     int ret_val;
49854     xmlXPathContextPtr ctxt; /* the XPath context */
49855     int n_ctxt;
49856     xmlChar * name; /* the variable name */
49857     int n_name;
49858     xmlChar * ns_uri; /* the variable namespace URI */
49859     int n_ns_uri;
49860     xmlXPathObjectPtr value; /* the variable value or NULL */
49861     int n_value;
49862
49863     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49864     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49865     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49866     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49867         mem_base = xmlMemBlocks();
49868         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49869         name = gen_const_xmlChar_ptr(n_name, 1);
49870         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49871         value = gen_xmlXPathObjectPtr(n_value, 3);
49872
49873         ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49874         desret_int(ret_val);
49875         call_tests++;
49876         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49877         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49878         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49879         des_xmlXPathObjectPtr(n_value, value, 3);
49880         xmlResetLastError();
49881         if (mem_base != xmlMemBlocks()) {
49882             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49883                    xmlMemBlocks() - mem_base);
49884             test_ret++;
49885             printf(" %d", n_ctxt);
49886             printf(" %d", n_name);
49887             printf(" %d", n_ns_uri);
49888             printf(" %d", n_value);
49889             printf("\n");
49890         }
49891     }
49892     }
49893     }
49894     }
49895     function_tests++;
49896 #endif
49897
49898     return(test_ret);
49899 }
49900
49901
49902 static int
49903 test_xmlXPathRegisteredFuncsCleanup(void) {
49904     int test_ret = 0;
49905
49906 #if defined(LIBXML_XPATH_ENABLED)
49907     int mem_base;
49908     xmlXPathContextPtr ctxt; /* the XPath context */
49909     int n_ctxt;
49910
49911     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49912         mem_base = xmlMemBlocks();
49913         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49914
49915         xmlXPathRegisteredFuncsCleanup(ctxt);
49916         call_tests++;
49917         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49918         xmlResetLastError();
49919         if (mem_base != xmlMemBlocks()) {
49920             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49921                    xmlMemBlocks() - mem_base);
49922             test_ret++;
49923             printf(" %d", n_ctxt);
49924             printf("\n");
49925         }
49926     }
49927     function_tests++;
49928 #endif
49929
49930     return(test_ret);
49931 }
49932
49933
49934 static int
49935 test_xmlXPathRegisteredNsCleanup(void) {
49936     int test_ret = 0;
49937
49938 #if defined(LIBXML_XPATH_ENABLED)
49939     int mem_base;
49940     xmlXPathContextPtr ctxt; /* the XPath context */
49941     int n_ctxt;
49942
49943     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49944         mem_base = xmlMemBlocks();
49945         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49946
49947         xmlXPathRegisteredNsCleanup(ctxt);
49948         call_tests++;
49949         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49950         xmlResetLastError();
49951         if (mem_base != xmlMemBlocks()) {
49952             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49953                    xmlMemBlocks() - mem_base);
49954             test_ret++;
49955             printf(" %d", n_ctxt);
49956             printf("\n");
49957         }
49958     }
49959     function_tests++;
49960 #endif
49961
49962     return(test_ret);
49963 }
49964
49965
49966 static int
49967 test_xmlXPathRegisteredVariablesCleanup(void) {
49968     int test_ret = 0;
49969
49970 #if defined(LIBXML_XPATH_ENABLED)
49971     int mem_base;
49972     xmlXPathContextPtr ctxt; /* the XPath context */
49973     int n_ctxt;
49974
49975     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49976         mem_base = xmlMemBlocks();
49977         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49978
49979         xmlXPathRegisteredVariablesCleanup(ctxt);
49980         call_tests++;
49981         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49982         xmlResetLastError();
49983         if (mem_base != xmlMemBlocks()) {
49984             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49985                    xmlMemBlocks() - mem_base);
49986             test_ret++;
49987             printf(" %d", n_ctxt);
49988             printf("\n");
49989         }
49990     }
49991     function_tests++;
49992 #endif
49993
49994     return(test_ret);
49995 }
49996
49997
49998 static int
49999 test_xmlXPathRoot(void) {
50000     int test_ret = 0;
50001
50002 #if defined(LIBXML_XPATH_ENABLED)
50003     int mem_base;
50004     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50005     int n_ctxt;
50006
50007     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50008         mem_base = xmlMemBlocks();
50009         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50010
50011         xmlXPathRoot(ctxt);
50012         call_tests++;
50013         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50014         xmlResetLastError();
50015         if (mem_base != xmlMemBlocks()) {
50016             printf("Leak of %d blocks found in xmlXPathRoot",
50017                    xmlMemBlocks() - mem_base);
50018             test_ret++;
50019             printf(" %d", n_ctxt);
50020             printf("\n");
50021         }
50022     }
50023     function_tests++;
50024 #endif
50025
50026     return(test_ret);
50027 }
50028
50029
50030 static int
50031 test_xmlXPathRoundFunction(void) {
50032     int test_ret = 0;
50033
50034 #if defined(LIBXML_XPATH_ENABLED)
50035     int mem_base;
50036     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50037     int n_ctxt;
50038     int nargs; /* the number of arguments */
50039     int n_nargs;
50040
50041     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50042     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50043         mem_base = xmlMemBlocks();
50044         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50045         nargs = gen_int(n_nargs, 1);
50046
50047         xmlXPathRoundFunction(ctxt, nargs);
50048         call_tests++;
50049         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50050         des_int(n_nargs, nargs, 1);
50051         xmlResetLastError();
50052         if (mem_base != xmlMemBlocks()) {
50053             printf("Leak of %d blocks found in xmlXPathRoundFunction",
50054                    xmlMemBlocks() - mem_base);
50055             test_ret++;
50056             printf(" %d", n_ctxt);
50057             printf(" %d", n_nargs);
50058             printf("\n");
50059         }
50060     }
50061     }
50062     function_tests++;
50063 #endif
50064
50065     return(test_ret);
50066 }
50067
50068
50069 static int
50070 test_xmlXPathStartsWithFunction(void) {
50071     int test_ret = 0;
50072
50073 #if defined(LIBXML_XPATH_ENABLED)
50074     int mem_base;
50075     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50076     int n_ctxt;
50077     int nargs; /* the number of arguments */
50078     int n_nargs;
50079
50080     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50081     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50082         mem_base = xmlMemBlocks();
50083         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50084         nargs = gen_int(n_nargs, 1);
50085
50086         xmlXPathStartsWithFunction(ctxt, nargs);
50087         call_tests++;
50088         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50089         des_int(n_nargs, nargs, 1);
50090         xmlResetLastError();
50091         if (mem_base != xmlMemBlocks()) {
50092             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50093                    xmlMemBlocks() - mem_base);
50094             test_ret++;
50095             printf(" %d", n_ctxt);
50096             printf(" %d", n_nargs);
50097             printf("\n");
50098         }
50099     }
50100     }
50101     function_tests++;
50102 #endif
50103
50104     return(test_ret);
50105 }
50106
50107
50108 static int
50109 test_xmlXPathStringEvalNumber(void) {
50110     int test_ret = 0;
50111
50112 #if defined(LIBXML_XPATH_ENABLED)
50113     int mem_base;
50114     double ret_val;
50115     xmlChar * str; /* A string to scan */
50116     int n_str;
50117
50118     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50119         mem_base = xmlMemBlocks();
50120         str = gen_const_xmlChar_ptr(n_str, 0);
50121
50122         ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50123         desret_double(ret_val);
50124         call_tests++;
50125         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50126         xmlResetLastError();
50127         if (mem_base != xmlMemBlocks()) {
50128             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50129                    xmlMemBlocks() - mem_base);
50130             test_ret++;
50131             printf(" %d", n_str);
50132             printf("\n");
50133         }
50134     }
50135     function_tests++;
50136 #endif
50137
50138     return(test_ret);
50139 }
50140
50141
50142 static int
50143 test_xmlXPathStringFunction(void) {
50144     int test_ret = 0;
50145
50146 #if defined(LIBXML_XPATH_ENABLED)
50147     int mem_base;
50148     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50149     int n_ctxt;
50150     int nargs; /* the number of arguments */
50151     int n_nargs;
50152
50153     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50154     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50155         mem_base = xmlMemBlocks();
50156         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50157         nargs = gen_int(n_nargs, 1);
50158
50159         xmlXPathStringFunction(ctxt, nargs);
50160         call_tests++;
50161         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50162         des_int(n_nargs, nargs, 1);
50163         xmlResetLastError();
50164         if (mem_base != xmlMemBlocks()) {
50165             printf("Leak of %d blocks found in xmlXPathStringFunction",
50166                    xmlMemBlocks() - mem_base);
50167             test_ret++;
50168             printf(" %d", n_ctxt);
50169             printf(" %d", n_nargs);
50170             printf("\n");
50171         }
50172     }
50173     }
50174     function_tests++;
50175 #endif
50176
50177     return(test_ret);
50178 }
50179
50180
50181 static int
50182 test_xmlXPathStringLengthFunction(void) {
50183     int test_ret = 0;
50184
50185 #if defined(LIBXML_XPATH_ENABLED)
50186     int mem_base;
50187     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50188     int n_ctxt;
50189     int nargs; /* the number of arguments */
50190     int n_nargs;
50191
50192     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50193     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50194         mem_base = xmlMemBlocks();
50195         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50196         nargs = gen_int(n_nargs, 1);
50197
50198         xmlXPathStringLengthFunction(ctxt, nargs);
50199         call_tests++;
50200         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50201         des_int(n_nargs, nargs, 1);
50202         xmlResetLastError();
50203         if (mem_base != xmlMemBlocks()) {
50204             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50205                    xmlMemBlocks() - mem_base);
50206             test_ret++;
50207             printf(" %d", n_ctxt);
50208             printf(" %d", n_nargs);
50209             printf("\n");
50210         }
50211     }
50212     }
50213     function_tests++;
50214 #endif
50215
50216     return(test_ret);
50217 }
50218
50219
50220 static int
50221 test_xmlXPathSubValues(void) {
50222     int test_ret = 0;
50223
50224 #if defined(LIBXML_XPATH_ENABLED)
50225     int mem_base;
50226     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50227     int n_ctxt;
50228
50229     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50230         mem_base = xmlMemBlocks();
50231         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50232
50233         xmlXPathSubValues(ctxt);
50234         call_tests++;
50235         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50236         xmlResetLastError();
50237         if (mem_base != xmlMemBlocks()) {
50238             printf("Leak of %d blocks found in xmlXPathSubValues",
50239                    xmlMemBlocks() - mem_base);
50240             test_ret++;
50241             printf(" %d", n_ctxt);
50242             printf("\n");
50243         }
50244     }
50245     function_tests++;
50246 #endif
50247
50248     return(test_ret);
50249 }
50250
50251
50252 static int
50253 test_xmlXPathSubstringAfterFunction(void) {
50254     int test_ret = 0;
50255
50256 #if defined(LIBXML_XPATH_ENABLED)
50257     int mem_base;
50258     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50259     int n_ctxt;
50260     int nargs; /* the number of arguments */
50261     int n_nargs;
50262
50263     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50264     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50265         mem_base = xmlMemBlocks();
50266         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50267         nargs = gen_int(n_nargs, 1);
50268
50269         xmlXPathSubstringAfterFunction(ctxt, nargs);
50270         call_tests++;
50271         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50272         des_int(n_nargs, nargs, 1);
50273         xmlResetLastError();
50274         if (mem_base != xmlMemBlocks()) {
50275             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50276                    xmlMemBlocks() - mem_base);
50277             test_ret++;
50278             printf(" %d", n_ctxt);
50279             printf(" %d", n_nargs);
50280             printf("\n");
50281         }
50282     }
50283     }
50284     function_tests++;
50285 #endif
50286
50287     return(test_ret);
50288 }
50289
50290
50291 static int
50292 test_xmlXPathSubstringBeforeFunction(void) {
50293     int test_ret = 0;
50294
50295 #if defined(LIBXML_XPATH_ENABLED)
50296     int mem_base;
50297     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50298     int n_ctxt;
50299     int nargs; /* the number of arguments */
50300     int n_nargs;
50301
50302     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50303     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50304         mem_base = xmlMemBlocks();
50305         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50306         nargs = gen_int(n_nargs, 1);
50307
50308         xmlXPathSubstringBeforeFunction(ctxt, nargs);
50309         call_tests++;
50310         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50311         des_int(n_nargs, nargs, 1);
50312         xmlResetLastError();
50313         if (mem_base != xmlMemBlocks()) {
50314             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50315                    xmlMemBlocks() - mem_base);
50316             test_ret++;
50317             printf(" %d", n_ctxt);
50318             printf(" %d", n_nargs);
50319             printf("\n");
50320         }
50321     }
50322     }
50323     function_tests++;
50324 #endif
50325
50326     return(test_ret);
50327 }
50328
50329
50330 static int
50331 test_xmlXPathSubstringFunction(void) {
50332     int test_ret = 0;
50333
50334 #if defined(LIBXML_XPATH_ENABLED)
50335     int mem_base;
50336     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50337     int n_ctxt;
50338     int nargs; /* the number of arguments */
50339     int n_nargs;
50340
50341     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50342     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50343         mem_base = xmlMemBlocks();
50344         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50345         nargs = gen_int(n_nargs, 1);
50346
50347         xmlXPathSubstringFunction(ctxt, nargs);
50348         call_tests++;
50349         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50350         des_int(n_nargs, nargs, 1);
50351         xmlResetLastError();
50352         if (mem_base != xmlMemBlocks()) {
50353             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50354                    xmlMemBlocks() - mem_base);
50355             test_ret++;
50356             printf(" %d", n_ctxt);
50357             printf(" %d", n_nargs);
50358             printf("\n");
50359         }
50360     }
50361     }
50362     function_tests++;
50363 #endif
50364
50365     return(test_ret);
50366 }
50367
50368
50369 static int
50370 test_xmlXPathSumFunction(void) {
50371     int test_ret = 0;
50372
50373 #if defined(LIBXML_XPATH_ENABLED)
50374     int mem_base;
50375     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50376     int n_ctxt;
50377     int nargs; /* the number of arguments */
50378     int n_nargs;
50379
50380     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50381     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50382         mem_base = xmlMemBlocks();
50383         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50384         nargs = gen_int(n_nargs, 1);
50385
50386         xmlXPathSumFunction(ctxt, nargs);
50387         call_tests++;
50388         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50389         des_int(n_nargs, nargs, 1);
50390         xmlResetLastError();
50391         if (mem_base != xmlMemBlocks()) {
50392             printf("Leak of %d blocks found in xmlXPathSumFunction",
50393                    xmlMemBlocks() - mem_base);
50394             test_ret++;
50395             printf(" %d", n_ctxt);
50396             printf(" %d", n_nargs);
50397             printf("\n");
50398         }
50399     }
50400     }
50401     function_tests++;
50402 #endif
50403
50404     return(test_ret);
50405 }
50406
50407
50408 static int
50409 test_xmlXPathTrailing(void) {
50410     int test_ret = 0;
50411
50412 #if defined(LIBXML_XPATH_ENABLED)
50413     int mem_base;
50414     xmlNodeSetPtr ret_val;
50415     xmlNodeSetPtr nodes1; /* a node-set */
50416     int n_nodes1;
50417     xmlNodeSetPtr nodes2; /* a node-set */
50418     int n_nodes2;
50419
50420     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50421     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50422         mem_base = xmlMemBlocks();
50423         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50424         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50425
50426         ret_val = xmlXPathTrailing(nodes1, nodes2);
50427         desret_xmlNodeSetPtr(ret_val);
50428         call_tests++;
50429         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50430         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50431         xmlResetLastError();
50432         if (mem_base != xmlMemBlocks()) {
50433             printf("Leak of %d blocks found in xmlXPathTrailing",
50434                    xmlMemBlocks() - mem_base);
50435             test_ret++;
50436             printf(" %d", n_nodes1);
50437             printf(" %d", n_nodes2);
50438             printf("\n");
50439         }
50440     }
50441     }
50442     function_tests++;
50443 #endif
50444
50445     return(test_ret);
50446 }
50447
50448
50449 static int
50450 test_xmlXPathTrailingSorted(void) {
50451     int test_ret = 0;
50452
50453 #if defined(LIBXML_XPATH_ENABLED)
50454     int mem_base;
50455     xmlNodeSetPtr ret_val;
50456     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50457     int n_nodes1;
50458     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50459     int n_nodes2;
50460
50461     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50462     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50463         mem_base = xmlMemBlocks();
50464         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50465         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50466
50467         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50468         desret_xmlNodeSetPtr(ret_val);
50469         call_tests++;
50470         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50471         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50472         xmlResetLastError();
50473         if (mem_base != xmlMemBlocks()) {
50474             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50475                    xmlMemBlocks() - mem_base);
50476             test_ret++;
50477             printf(" %d", n_nodes1);
50478             printf(" %d", n_nodes2);
50479             printf("\n");
50480         }
50481     }
50482     }
50483     function_tests++;
50484 #endif
50485
50486     return(test_ret);
50487 }
50488
50489
50490 static int
50491 test_xmlXPathTranslateFunction(void) {
50492     int test_ret = 0;
50493
50494 #if defined(LIBXML_XPATH_ENABLED)
50495     int mem_base;
50496     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50497     int n_ctxt;
50498     int nargs; /* the number of arguments */
50499     int n_nargs;
50500
50501     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50502     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50503         mem_base = xmlMemBlocks();
50504         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50505         nargs = gen_int(n_nargs, 1);
50506
50507         xmlXPathTranslateFunction(ctxt, nargs);
50508         call_tests++;
50509         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50510         des_int(n_nargs, nargs, 1);
50511         xmlResetLastError();
50512         if (mem_base != xmlMemBlocks()) {
50513             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50514                    xmlMemBlocks() - mem_base);
50515             test_ret++;
50516             printf(" %d", n_ctxt);
50517             printf(" %d", n_nargs);
50518             printf("\n");
50519         }
50520     }
50521     }
50522     function_tests++;
50523 #endif
50524
50525     return(test_ret);
50526 }
50527
50528
50529 static int
50530 test_xmlXPathTrueFunction(void) {
50531     int test_ret = 0;
50532
50533 #if defined(LIBXML_XPATH_ENABLED)
50534     int mem_base;
50535     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50536     int n_ctxt;
50537     int nargs; /* the number of arguments */
50538     int n_nargs;
50539
50540     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50541     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50542         mem_base = xmlMemBlocks();
50543         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50544         nargs = gen_int(n_nargs, 1);
50545
50546         xmlXPathTrueFunction(ctxt, nargs);
50547         call_tests++;
50548         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50549         des_int(n_nargs, nargs, 1);
50550         xmlResetLastError();
50551         if (mem_base != xmlMemBlocks()) {
50552             printf("Leak of %d blocks found in xmlXPathTrueFunction",
50553                    xmlMemBlocks() - mem_base);
50554             test_ret++;
50555             printf(" %d", n_ctxt);
50556             printf(" %d", n_nargs);
50557             printf("\n");
50558         }
50559     }
50560     }
50561     function_tests++;
50562 #endif
50563
50564     return(test_ret);
50565 }
50566
50567
50568 static int
50569 test_xmlXPathValueFlipSign(void) {
50570     int test_ret = 0;
50571
50572 #if defined(LIBXML_XPATH_ENABLED)
50573     int mem_base;
50574     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50575     int n_ctxt;
50576
50577     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50578         mem_base = xmlMemBlocks();
50579         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50580
50581         xmlXPathValueFlipSign(ctxt);
50582         call_tests++;
50583         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50584         xmlResetLastError();
50585         if (mem_base != xmlMemBlocks()) {
50586             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50587                    xmlMemBlocks() - mem_base);
50588             test_ret++;
50589             printf(" %d", n_ctxt);
50590             printf("\n");
50591         }
50592     }
50593     function_tests++;
50594 #endif
50595
50596     return(test_ret);
50597 }
50598
50599
50600 static int
50601 test_xmlXPathVariableLookup(void) {
50602     int test_ret = 0;
50603
50604 #if defined(LIBXML_XPATH_ENABLED)
50605     int mem_base;
50606     xmlXPathObjectPtr ret_val;
50607     xmlXPathContextPtr ctxt; /* the XPath context */
50608     int n_ctxt;
50609     xmlChar * name; /* the variable name */
50610     int n_name;
50611
50612     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50613     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50614         mem_base = xmlMemBlocks();
50615         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50616         name = gen_const_xmlChar_ptr(n_name, 1);
50617
50618         ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50619         desret_xmlXPathObjectPtr(ret_val);
50620         call_tests++;
50621         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50622         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50623         xmlResetLastError();
50624         if (mem_base != xmlMemBlocks()) {
50625             printf("Leak of %d blocks found in xmlXPathVariableLookup",
50626                    xmlMemBlocks() - mem_base);
50627             test_ret++;
50628             printf(" %d", n_ctxt);
50629             printf(" %d", n_name);
50630             printf("\n");
50631         }
50632     }
50633     }
50634     function_tests++;
50635 #endif
50636
50637     return(test_ret);
50638 }
50639
50640
50641 static int
50642 test_xmlXPathVariableLookupNS(void) {
50643     int test_ret = 0;
50644
50645 #if defined(LIBXML_XPATH_ENABLED)
50646     int mem_base;
50647     xmlXPathObjectPtr ret_val;
50648     xmlXPathContextPtr ctxt; /* the XPath context */
50649     int n_ctxt;
50650     xmlChar * name; /* the variable name */
50651     int n_name;
50652     xmlChar * ns_uri; /* the variable namespace URI */
50653     int n_ns_uri;
50654
50655     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50656     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50657     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50658         mem_base = xmlMemBlocks();
50659         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50660         name = gen_const_xmlChar_ptr(n_name, 1);
50661         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50662
50663         ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50664         desret_xmlXPathObjectPtr(ret_val);
50665         call_tests++;
50666         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50667         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50668         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50669         xmlResetLastError();
50670         if (mem_base != xmlMemBlocks()) {
50671             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50672                    xmlMemBlocks() - mem_base);
50673             test_ret++;
50674             printf(" %d", n_ctxt);
50675             printf(" %d", n_name);
50676             printf(" %d", n_ns_uri);
50677             printf("\n");
50678         }
50679     }
50680     }
50681     }
50682     function_tests++;
50683 #endif
50684
50685     return(test_ret);
50686 }
50687
50688
50689 static int
50690 test_xmlXPathWrapCString(void) {
50691     int test_ret = 0;
50692
50693 #if defined(LIBXML_XPATH_ENABLED)
50694     int mem_base;
50695     xmlXPathObjectPtr ret_val;
50696     char * val; /* the char * value */
50697     int n_val;
50698
50699     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50700         mem_base = xmlMemBlocks();
50701         val = gen_char_ptr(n_val, 0);
50702
50703         ret_val = xmlXPathWrapCString(val);
50704         desret_xmlXPathObjectPtr(ret_val);
50705         call_tests++;
50706         des_char_ptr(n_val, val, 0);
50707         xmlResetLastError();
50708         if (mem_base != xmlMemBlocks()) {
50709             printf("Leak of %d blocks found in xmlXPathWrapCString",
50710                    xmlMemBlocks() - mem_base);
50711             test_ret++;
50712             printf(" %d", n_val);
50713             printf("\n");
50714         }
50715     }
50716     function_tests++;
50717 #endif
50718
50719     return(test_ret);
50720 }
50721
50722
50723 static int
50724 test_xmlXPathWrapExternal(void) {
50725     int test_ret = 0;
50726
50727 #if defined(LIBXML_XPATH_ENABLED)
50728     int mem_base;
50729     xmlXPathObjectPtr ret_val;
50730     void * val; /* the user data */
50731     int n_val;
50732
50733     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50734         mem_base = xmlMemBlocks();
50735         val = gen_void_ptr(n_val, 0);
50736
50737         ret_val = xmlXPathWrapExternal(val);
50738         desret_xmlXPathObjectPtr(ret_val);
50739         call_tests++;
50740         des_void_ptr(n_val, val, 0);
50741         xmlResetLastError();
50742         if (mem_base != xmlMemBlocks()) {
50743             printf("Leak of %d blocks found in xmlXPathWrapExternal",
50744                    xmlMemBlocks() - mem_base);
50745             test_ret++;
50746             printf(" %d", n_val);
50747             printf("\n");
50748         }
50749     }
50750     function_tests++;
50751 #endif
50752
50753     return(test_ret);
50754 }
50755
50756
50757 static int
50758 test_xmlXPathWrapNodeSet(void) {
50759     int test_ret = 0;
50760
50761 #if defined(LIBXML_XPATH_ENABLED)
50762     int mem_base;
50763     xmlXPathObjectPtr ret_val;
50764     xmlNodeSetPtr val; /* the NodePtr value */
50765     int n_val;
50766
50767     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50768         mem_base = xmlMemBlocks();
50769         val = gen_xmlNodeSetPtr(n_val, 0);
50770
50771         ret_val = xmlXPathWrapNodeSet(val);
50772         desret_xmlXPathObjectPtr(ret_val);
50773         call_tests++;
50774         des_xmlNodeSetPtr(n_val, val, 0);
50775         xmlResetLastError();
50776         if (mem_base != xmlMemBlocks()) {
50777             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50778                    xmlMemBlocks() - mem_base);
50779             test_ret++;
50780             printf(" %d", n_val);
50781             printf("\n");
50782         }
50783     }
50784     function_tests++;
50785 #endif
50786
50787     return(test_ret);
50788 }
50789
50790
50791 static int
50792 test_xmlXPatherror(void) {
50793     int test_ret = 0;
50794
50795 #if defined(LIBXML_XPATH_ENABLED)
50796     int mem_base;
50797     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50798     int n_ctxt;
50799     const char * file; /* the file name */
50800     int n_file;
50801     int line; /* the line number */
50802     int n_line;
50803     int no; /* the error number */
50804     int n_no;
50805
50806     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50807     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50808     for (n_line = 0;n_line < gen_nb_int;n_line++) {
50809     for (n_no = 0;n_no < gen_nb_int;n_no++) {
50810         mem_base = xmlMemBlocks();
50811         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50812         file = gen_filepath(n_file, 1);
50813         line = gen_int(n_line, 2);
50814         no = gen_int(n_no, 3);
50815
50816         xmlXPatherror(ctxt, file, line, no);
50817         call_tests++;
50818         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50819         des_filepath(n_file, file, 1);
50820         des_int(n_line, line, 2);
50821         des_int(n_no, no, 3);
50822         xmlResetLastError();
50823         if (mem_base != xmlMemBlocks()) {
50824             printf("Leak of %d blocks found in xmlXPatherror",
50825                    xmlMemBlocks() - mem_base);
50826             test_ret++;
50827             printf(" %d", n_ctxt);
50828             printf(" %d", n_file);
50829             printf(" %d", n_line);
50830             printf(" %d", n_no);
50831             printf("\n");
50832         }
50833     }
50834     }
50835     }
50836     }
50837     function_tests++;
50838 #endif
50839
50840     return(test_ret);
50841 }
50842
50843 static int
50844 test_xpathInternals(void) {
50845     int test_ret = 0;
50846
50847     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50848     test_ret += test_valuePop();
50849     test_ret += test_valuePush();
50850     test_ret += test_xmlXPathAddValues();
50851     test_ret += test_xmlXPathBooleanFunction();
50852     test_ret += test_xmlXPathCeilingFunction();
50853     test_ret += test_xmlXPathCompareValues();
50854     test_ret += test_xmlXPathConcatFunction();
50855     test_ret += test_xmlXPathContainsFunction();
50856     test_ret += test_xmlXPathCountFunction();
50857     test_ret += test_xmlXPathDebugDumpCompExpr();
50858     test_ret += test_xmlXPathDebugDumpObject();
50859     test_ret += test_xmlXPathDifference();
50860     test_ret += test_xmlXPathDistinct();
50861     test_ret += test_xmlXPathDistinctSorted();
50862     test_ret += test_xmlXPathDivValues();
50863     test_ret += test_xmlXPathEqualValues();
50864     test_ret += test_xmlXPathErr();
50865     test_ret += test_xmlXPathEvalExpr();
50866     test_ret += test_xmlXPathEvaluatePredicateResult();
50867     test_ret += test_xmlXPathFalseFunction();
50868     test_ret += test_xmlXPathFloorFunction();
50869     test_ret += test_xmlXPathFunctionLookup();
50870     test_ret += test_xmlXPathFunctionLookupNS();
50871     test_ret += test_xmlXPathHasSameNodes();
50872     test_ret += test_xmlXPathIdFunction();
50873     test_ret += test_xmlXPathIntersection();
50874     test_ret += test_xmlXPathIsNodeType();
50875     test_ret += test_xmlXPathLangFunction();
50876     test_ret += test_xmlXPathLastFunction();
50877     test_ret += test_xmlXPathLeading();
50878     test_ret += test_xmlXPathLeadingSorted();
50879     test_ret += test_xmlXPathLocalNameFunction();
50880     test_ret += test_xmlXPathModValues();
50881     test_ret += test_xmlXPathMultValues();
50882     test_ret += test_xmlXPathNamespaceURIFunction();
50883     test_ret += test_xmlXPathNewBoolean();
50884     test_ret += test_xmlXPathNewCString();
50885     test_ret += test_xmlXPathNewFloat();
50886     test_ret += test_xmlXPathNewNodeSet();
50887     test_ret += test_xmlXPathNewNodeSetList();
50888     test_ret += test_xmlXPathNewParserContext();
50889     test_ret += test_xmlXPathNewString();
50890     test_ret += test_xmlXPathNextAncestor();
50891     test_ret += test_xmlXPathNextAncestorOrSelf();
50892     test_ret += test_xmlXPathNextAttribute();
50893     test_ret += test_xmlXPathNextChild();
50894     test_ret += test_xmlXPathNextDescendant();
50895     test_ret += test_xmlXPathNextDescendantOrSelf();
50896     test_ret += test_xmlXPathNextFollowing();
50897     test_ret += test_xmlXPathNextFollowingSibling();
50898     test_ret += test_xmlXPathNextNamespace();
50899     test_ret += test_xmlXPathNextParent();
50900     test_ret += test_xmlXPathNextPreceding();
50901     test_ret += test_xmlXPathNextPrecedingSibling();
50902     test_ret += test_xmlXPathNextSelf();
50903     test_ret += test_xmlXPathNodeLeading();
50904     test_ret += test_xmlXPathNodeLeadingSorted();
50905     test_ret += test_xmlXPathNodeSetAdd();
50906     test_ret += test_xmlXPathNodeSetAddNs();
50907     test_ret += test_xmlXPathNodeSetAddUnique();
50908     test_ret += test_xmlXPathNodeSetContains();
50909     test_ret += test_xmlXPathNodeSetDel();
50910     test_ret += test_xmlXPathNodeSetMerge();
50911     test_ret += test_xmlXPathNodeSetRemove();
50912     test_ret += test_xmlXPathNodeSetSort();
50913     test_ret += test_xmlXPathNodeTrailing();
50914     test_ret += test_xmlXPathNodeTrailingSorted();
50915     test_ret += test_xmlXPathNormalizeFunction();
50916     test_ret += test_xmlXPathNotEqualValues();
50917     test_ret += test_xmlXPathNotFunction();
50918     test_ret += test_xmlXPathNsLookup();
50919     test_ret += test_xmlXPathNumberFunction();
50920     test_ret += test_xmlXPathParseNCName();
50921     test_ret += test_xmlXPathParseName();
50922     test_ret += test_xmlXPathPopBoolean();
50923     test_ret += test_xmlXPathPopExternal();
50924     test_ret += test_xmlXPathPopNodeSet();
50925     test_ret += test_xmlXPathPopNumber();
50926     test_ret += test_xmlXPathPopString();
50927     test_ret += test_xmlXPathPositionFunction();
50928     test_ret += test_xmlXPathRegisterAllFunctions();
50929     test_ret += test_xmlXPathRegisterFunc();
50930     test_ret += test_xmlXPathRegisterFuncLookup();
50931     test_ret += test_xmlXPathRegisterFuncNS();
50932     test_ret += test_xmlXPathRegisterNs();
50933     test_ret += test_xmlXPathRegisterVariable();
50934     test_ret += test_xmlXPathRegisterVariableLookup();
50935     test_ret += test_xmlXPathRegisterVariableNS();
50936     test_ret += test_xmlXPathRegisteredFuncsCleanup();
50937     test_ret += test_xmlXPathRegisteredNsCleanup();
50938     test_ret += test_xmlXPathRegisteredVariablesCleanup();
50939     test_ret += test_xmlXPathRoot();
50940     test_ret += test_xmlXPathRoundFunction();
50941     test_ret += test_xmlXPathStartsWithFunction();
50942     test_ret += test_xmlXPathStringEvalNumber();
50943     test_ret += test_xmlXPathStringFunction();
50944     test_ret += test_xmlXPathStringLengthFunction();
50945     test_ret += test_xmlXPathSubValues();
50946     test_ret += test_xmlXPathSubstringAfterFunction();
50947     test_ret += test_xmlXPathSubstringBeforeFunction();
50948     test_ret += test_xmlXPathSubstringFunction();
50949     test_ret += test_xmlXPathSumFunction();
50950     test_ret += test_xmlXPathTrailing();
50951     test_ret += test_xmlXPathTrailingSorted();
50952     test_ret += test_xmlXPathTranslateFunction();
50953     test_ret += test_xmlXPathTrueFunction();
50954     test_ret += test_xmlXPathValueFlipSign();
50955     test_ret += test_xmlXPathVariableLookup();
50956     test_ret += test_xmlXPathVariableLookupNS();
50957     test_ret += test_xmlXPathWrapCString();
50958     test_ret += test_xmlXPathWrapExternal();
50959     test_ret += test_xmlXPathWrapNodeSet();
50960     test_ret += test_xmlXPatherror();
50961
50962     if (test_ret != 0)
50963         printf("Module xpathInternals: %d errors\n", test_ret);
50964     return(test_ret);
50965 }
50966
50967 static int
50968 test_xmlXPtrBuildNodeList(void) {
50969     int test_ret = 0;
50970
50971 #if defined(LIBXML_XPTR_ENABLED)
50972     int mem_base;
50973     xmlNodePtr ret_val;
50974     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50975     int n_obj;
50976
50977     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50978         mem_base = xmlMemBlocks();
50979         obj = gen_xmlXPathObjectPtr(n_obj, 0);
50980
50981         ret_val = xmlXPtrBuildNodeList(obj);
50982         desret_xmlNodePtr(ret_val);
50983         call_tests++;
50984         des_xmlXPathObjectPtr(n_obj, obj, 0);
50985         xmlResetLastError();
50986         if (mem_base != xmlMemBlocks()) {
50987             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50988                    xmlMemBlocks() - mem_base);
50989             test_ret++;
50990             printf(" %d", n_obj);
50991             printf("\n");
50992         }
50993     }
50994     function_tests++;
50995 #endif
50996
50997     return(test_ret);
50998 }
50999
51000
51001 static int
51002 test_xmlXPtrEval(void) {
51003     int test_ret = 0;
51004
51005 #if defined(LIBXML_XPTR_ENABLED)
51006     int mem_base;
51007     xmlXPathObjectPtr ret_val;
51008     xmlChar * str; /* the XPointer expression */
51009     int n_str;
51010     xmlXPathContextPtr ctx; /* the XPointer context */
51011     int n_ctx;
51012
51013     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51014     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51015         mem_base = xmlMemBlocks();
51016         str = gen_const_xmlChar_ptr(n_str, 0);
51017         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51018
51019         ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
51020         desret_xmlXPathObjectPtr(ret_val);
51021         call_tests++;
51022         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51023         des_xmlXPathContextPtr(n_ctx, ctx, 1);
51024         xmlResetLastError();
51025         if (mem_base != xmlMemBlocks()) {
51026             printf("Leak of %d blocks found in xmlXPtrEval",
51027                    xmlMemBlocks() - mem_base);
51028             test_ret++;
51029             printf(" %d", n_str);
51030             printf(" %d", n_ctx);
51031             printf("\n");
51032         }
51033     }
51034     }
51035     function_tests++;
51036 #endif
51037
51038     return(test_ret);
51039 }
51040
51041
51042 static int
51043 test_xmlXPtrEvalRangePredicate(void) {
51044     int test_ret = 0;
51045
51046 #if defined(LIBXML_XPTR_ENABLED)
51047     int mem_base;
51048     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51049     int n_ctxt;
51050
51051     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51052         mem_base = xmlMemBlocks();
51053         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51054
51055         xmlXPtrEvalRangePredicate(ctxt);
51056         call_tests++;
51057         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51058         xmlResetLastError();
51059         if (mem_base != xmlMemBlocks()) {
51060             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51061                    xmlMemBlocks() - mem_base);
51062             test_ret++;
51063             printf(" %d", n_ctxt);
51064             printf("\n");
51065         }
51066     }
51067     function_tests++;
51068 #endif
51069
51070     return(test_ret);
51071 }
51072
51073 #ifdef LIBXML_XPTR_ENABLED
51074
51075 #define gen_nb_xmlLocationSetPtr 1
51076 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51077     return(NULL);
51078 }
51079 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51080 }
51081 #endif
51082
51083
51084 static int
51085 test_xmlXPtrLocationSetAdd(void) {
51086     int test_ret = 0;
51087
51088 #if defined(LIBXML_XPTR_ENABLED)
51089     int mem_base;
51090     xmlLocationSetPtr cur; /* the initial range set */
51091     int n_cur;
51092     xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51093     int n_val;
51094
51095     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51096     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51097         mem_base = xmlMemBlocks();
51098         cur = gen_xmlLocationSetPtr(n_cur, 0);
51099         val = gen_xmlXPathObjectPtr(n_val, 1);
51100
51101         xmlXPtrLocationSetAdd(cur, val);
51102         call_tests++;
51103         des_xmlLocationSetPtr(n_cur, cur, 0);
51104         des_xmlXPathObjectPtr(n_val, val, 1);
51105         xmlResetLastError();
51106         if (mem_base != xmlMemBlocks()) {
51107             printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51108                    xmlMemBlocks() - mem_base);
51109             test_ret++;
51110             printf(" %d", n_cur);
51111             printf(" %d", n_val);
51112             printf("\n");
51113         }
51114     }
51115     }
51116     function_tests++;
51117 #endif
51118
51119     return(test_ret);
51120 }
51121
51122
51123 static int
51124 test_xmlXPtrLocationSetCreate(void) {
51125     int test_ret = 0;
51126
51127
51128     /* missing type support */
51129     return(test_ret);
51130 }
51131
51132
51133 static int
51134 test_xmlXPtrLocationSetDel(void) {
51135     int test_ret = 0;
51136
51137 #if defined(LIBXML_XPTR_ENABLED)
51138     int mem_base;
51139     xmlLocationSetPtr cur; /* the initial range set */
51140     int n_cur;
51141     xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51142     int n_val;
51143
51144     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51145     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51146         mem_base = xmlMemBlocks();
51147         cur = gen_xmlLocationSetPtr(n_cur, 0);
51148         val = gen_xmlXPathObjectPtr(n_val, 1);
51149
51150         xmlXPtrLocationSetDel(cur, val);
51151         call_tests++;
51152         des_xmlLocationSetPtr(n_cur, cur, 0);
51153         des_xmlXPathObjectPtr(n_val, val, 1);
51154         xmlResetLastError();
51155         if (mem_base != xmlMemBlocks()) {
51156             printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51157                    xmlMemBlocks() - mem_base);
51158             test_ret++;
51159             printf(" %d", n_cur);
51160             printf(" %d", n_val);
51161             printf("\n");
51162         }
51163     }
51164     }
51165     function_tests++;
51166 #endif
51167
51168     return(test_ret);
51169 }
51170
51171
51172 static int
51173 test_xmlXPtrLocationSetMerge(void) {
51174     int test_ret = 0;
51175
51176
51177     /* missing type support */
51178     return(test_ret);
51179 }
51180
51181
51182 static int
51183 test_xmlXPtrLocationSetRemove(void) {
51184     int test_ret = 0;
51185
51186 #if defined(LIBXML_XPTR_ENABLED)
51187     int mem_base;
51188     xmlLocationSetPtr cur; /* the initial range set */
51189     int n_cur;
51190     int val; /* the index to remove */
51191     int n_val;
51192
51193     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51194     for (n_val = 0;n_val < gen_nb_int;n_val++) {
51195         mem_base = xmlMemBlocks();
51196         cur = gen_xmlLocationSetPtr(n_cur, 0);
51197         val = gen_int(n_val, 1);
51198
51199         xmlXPtrLocationSetRemove(cur, val);
51200         call_tests++;
51201         des_xmlLocationSetPtr(n_cur, cur, 0);
51202         des_int(n_val, val, 1);
51203         xmlResetLastError();
51204         if (mem_base != xmlMemBlocks()) {
51205             printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51206                    xmlMemBlocks() - mem_base);
51207             test_ret++;
51208             printf(" %d", n_cur);
51209             printf(" %d", n_val);
51210             printf("\n");
51211         }
51212     }
51213     }
51214     function_tests++;
51215 #endif
51216
51217     return(test_ret);
51218 }
51219
51220
51221 static int
51222 test_xmlXPtrNewCollapsedRange(void) {
51223     int test_ret = 0;
51224
51225 #if defined(LIBXML_XPTR_ENABLED)
51226     int mem_base;
51227     xmlXPathObjectPtr ret_val;
51228     xmlNodePtr start; /* the starting and ending node */
51229     int n_start;
51230
51231     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51232         mem_base = xmlMemBlocks();
51233         start = gen_xmlNodePtr(n_start, 0);
51234
51235         ret_val = xmlXPtrNewCollapsedRange(start);
51236         desret_xmlXPathObjectPtr(ret_val);
51237         call_tests++;
51238         des_xmlNodePtr(n_start, start, 0);
51239         xmlResetLastError();
51240         if (mem_base != xmlMemBlocks()) {
51241             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51242                    xmlMemBlocks() - mem_base);
51243             test_ret++;
51244             printf(" %d", n_start);
51245             printf("\n");
51246         }
51247     }
51248     function_tests++;
51249 #endif
51250
51251     return(test_ret);
51252 }
51253
51254
51255 static int
51256 test_xmlXPtrNewContext(void) {
51257     int test_ret = 0;
51258
51259
51260     /* missing type support */
51261     return(test_ret);
51262 }
51263
51264
51265 static int
51266 test_xmlXPtrNewLocationSetNodeSet(void) {
51267     int test_ret = 0;
51268
51269 #if defined(LIBXML_XPTR_ENABLED)
51270     int mem_base;
51271     xmlXPathObjectPtr ret_val;
51272     xmlNodeSetPtr set; /* a node set */
51273     int n_set;
51274
51275     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51276         mem_base = xmlMemBlocks();
51277         set = gen_xmlNodeSetPtr(n_set, 0);
51278
51279         ret_val = xmlXPtrNewLocationSetNodeSet(set);
51280         desret_xmlXPathObjectPtr(ret_val);
51281         call_tests++;
51282         des_xmlNodeSetPtr(n_set, set, 0);
51283         xmlResetLastError();
51284         if (mem_base != xmlMemBlocks()) {
51285             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51286                    xmlMemBlocks() - mem_base);
51287             test_ret++;
51288             printf(" %d", n_set);
51289             printf("\n");
51290         }
51291     }
51292     function_tests++;
51293 #endif
51294
51295     return(test_ret);
51296 }
51297
51298
51299 static int
51300 test_xmlXPtrNewLocationSetNodes(void) {
51301     int test_ret = 0;
51302
51303 #if defined(LIBXML_XPTR_ENABLED)
51304     int mem_base;
51305     xmlXPathObjectPtr ret_val;
51306     xmlNodePtr start; /* the start NodePtr value */
51307     int n_start;
51308     xmlNodePtr end; /* the end NodePtr value or NULL */
51309     int n_end;
51310
51311     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51312     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51313         mem_base = xmlMemBlocks();
51314         start = gen_xmlNodePtr(n_start, 0);
51315         end = gen_xmlNodePtr(n_end, 1);
51316
51317         ret_val = xmlXPtrNewLocationSetNodes(start, end);
51318         desret_xmlXPathObjectPtr(ret_val);
51319         call_tests++;
51320         des_xmlNodePtr(n_start, start, 0);
51321         des_xmlNodePtr(n_end, end, 1);
51322         xmlResetLastError();
51323         if (mem_base != xmlMemBlocks()) {
51324             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51325                    xmlMemBlocks() - mem_base);
51326             test_ret++;
51327             printf(" %d", n_start);
51328             printf(" %d", n_end);
51329             printf("\n");
51330         }
51331     }
51332     }
51333     function_tests++;
51334 #endif
51335
51336     return(test_ret);
51337 }
51338
51339
51340 static int
51341 test_xmlXPtrNewRange(void) {
51342     int test_ret = 0;
51343
51344 #if defined(LIBXML_XPTR_ENABLED)
51345     int mem_base;
51346     xmlXPathObjectPtr ret_val;
51347     xmlNodePtr start; /* the starting node */
51348     int n_start;
51349     int startindex; /* the start index */
51350     int n_startindex;
51351     xmlNodePtr end; /* the ending point */
51352     int n_end;
51353     int endindex; /* the ending index */
51354     int n_endindex;
51355
51356     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51357     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51358     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51359     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51360         mem_base = xmlMemBlocks();
51361         start = gen_xmlNodePtr(n_start, 0);
51362         startindex = gen_int(n_startindex, 1);
51363         end = gen_xmlNodePtr(n_end, 2);
51364         endindex = gen_int(n_endindex, 3);
51365
51366         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51367         desret_xmlXPathObjectPtr(ret_val);
51368         call_tests++;
51369         des_xmlNodePtr(n_start, start, 0);
51370         des_int(n_startindex, startindex, 1);
51371         des_xmlNodePtr(n_end, end, 2);
51372         des_int(n_endindex, endindex, 3);
51373         xmlResetLastError();
51374         if (mem_base != xmlMemBlocks()) {
51375             printf("Leak of %d blocks found in xmlXPtrNewRange",
51376                    xmlMemBlocks() - mem_base);
51377             test_ret++;
51378             printf(" %d", n_start);
51379             printf(" %d", n_startindex);
51380             printf(" %d", n_end);
51381             printf(" %d", n_endindex);
51382             printf("\n");
51383         }
51384     }
51385     }
51386     }
51387     }
51388     function_tests++;
51389 #endif
51390
51391     return(test_ret);
51392 }
51393
51394
51395 static int
51396 test_xmlXPtrNewRangeNodeObject(void) {
51397     int test_ret = 0;
51398
51399 #if defined(LIBXML_XPTR_ENABLED)
51400     int mem_base;
51401     xmlXPathObjectPtr ret_val;
51402     xmlNodePtr start; /* the starting node */
51403     int n_start;
51404     xmlXPathObjectPtr end; /* the ending object */
51405     int n_end;
51406
51407     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51408     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51409         mem_base = xmlMemBlocks();
51410         start = gen_xmlNodePtr(n_start, 0);
51411         end = gen_xmlXPathObjectPtr(n_end, 1);
51412
51413         ret_val = xmlXPtrNewRangeNodeObject(start, end);
51414         desret_xmlXPathObjectPtr(ret_val);
51415         call_tests++;
51416         des_xmlNodePtr(n_start, start, 0);
51417         des_xmlXPathObjectPtr(n_end, end, 1);
51418         xmlResetLastError();
51419         if (mem_base != xmlMemBlocks()) {
51420             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51421                    xmlMemBlocks() - mem_base);
51422             test_ret++;
51423             printf(" %d", n_start);
51424             printf(" %d", n_end);
51425             printf("\n");
51426         }
51427     }
51428     }
51429     function_tests++;
51430 #endif
51431
51432     return(test_ret);
51433 }
51434
51435
51436 static int
51437 test_xmlXPtrNewRangeNodePoint(void) {
51438     int test_ret = 0;
51439
51440 #if defined(LIBXML_XPTR_ENABLED)
51441     int mem_base;
51442     xmlXPathObjectPtr ret_val;
51443     xmlNodePtr start; /* the starting node */
51444     int n_start;
51445     xmlXPathObjectPtr end; /* the ending point */
51446     int n_end;
51447
51448     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51449     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51450         mem_base = xmlMemBlocks();
51451         start = gen_xmlNodePtr(n_start, 0);
51452         end = gen_xmlXPathObjectPtr(n_end, 1);
51453
51454         ret_val = xmlXPtrNewRangeNodePoint(start, end);
51455         desret_xmlXPathObjectPtr(ret_val);
51456         call_tests++;
51457         des_xmlNodePtr(n_start, start, 0);
51458         des_xmlXPathObjectPtr(n_end, end, 1);
51459         xmlResetLastError();
51460         if (mem_base != xmlMemBlocks()) {
51461             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51462                    xmlMemBlocks() - mem_base);
51463             test_ret++;
51464             printf(" %d", n_start);
51465             printf(" %d", n_end);
51466             printf("\n");
51467         }
51468     }
51469     }
51470     function_tests++;
51471 #endif
51472
51473     return(test_ret);
51474 }
51475
51476
51477 static int
51478 test_xmlXPtrNewRangeNodes(void) {
51479     int test_ret = 0;
51480
51481 #if defined(LIBXML_XPTR_ENABLED)
51482     int mem_base;
51483     xmlXPathObjectPtr ret_val;
51484     xmlNodePtr start; /* the starting node */
51485     int n_start;
51486     xmlNodePtr end; /* the ending node */
51487     int n_end;
51488
51489     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51490     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51491         mem_base = xmlMemBlocks();
51492         start = gen_xmlNodePtr(n_start, 0);
51493         end = gen_xmlNodePtr(n_end, 1);
51494
51495         ret_val = xmlXPtrNewRangeNodes(start, end);
51496         desret_xmlXPathObjectPtr(ret_val);
51497         call_tests++;
51498         des_xmlNodePtr(n_start, start, 0);
51499         des_xmlNodePtr(n_end, end, 1);
51500         xmlResetLastError();
51501         if (mem_base != xmlMemBlocks()) {
51502             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51503                    xmlMemBlocks() - mem_base);
51504             test_ret++;
51505             printf(" %d", n_start);
51506             printf(" %d", n_end);
51507             printf("\n");
51508         }
51509     }
51510     }
51511     function_tests++;
51512 #endif
51513
51514     return(test_ret);
51515 }
51516
51517
51518 static int
51519 test_xmlXPtrNewRangePointNode(void) {
51520     int test_ret = 0;
51521
51522 #if defined(LIBXML_XPTR_ENABLED)
51523     int mem_base;
51524     xmlXPathObjectPtr ret_val;
51525     xmlXPathObjectPtr start; /* the starting point */
51526     int n_start;
51527     xmlNodePtr end; /* the ending node */
51528     int n_end;
51529
51530     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51531     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51532         mem_base = xmlMemBlocks();
51533         start = gen_xmlXPathObjectPtr(n_start, 0);
51534         end = gen_xmlNodePtr(n_end, 1);
51535
51536         ret_val = xmlXPtrNewRangePointNode(start, end);
51537         desret_xmlXPathObjectPtr(ret_val);
51538         call_tests++;
51539         des_xmlXPathObjectPtr(n_start, start, 0);
51540         des_xmlNodePtr(n_end, end, 1);
51541         xmlResetLastError();
51542         if (mem_base != xmlMemBlocks()) {
51543             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51544                    xmlMemBlocks() - mem_base);
51545             test_ret++;
51546             printf(" %d", n_start);
51547             printf(" %d", n_end);
51548             printf("\n");
51549         }
51550     }
51551     }
51552     function_tests++;
51553 #endif
51554
51555     return(test_ret);
51556 }
51557
51558
51559 static int
51560 test_xmlXPtrNewRangePoints(void) {
51561     int test_ret = 0;
51562
51563 #if defined(LIBXML_XPTR_ENABLED)
51564     int mem_base;
51565     xmlXPathObjectPtr ret_val;
51566     xmlXPathObjectPtr start; /* the starting point */
51567     int n_start;
51568     xmlXPathObjectPtr end; /* the ending point */
51569     int n_end;
51570
51571     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51572     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51573         mem_base = xmlMemBlocks();
51574         start = gen_xmlXPathObjectPtr(n_start, 0);
51575         end = gen_xmlXPathObjectPtr(n_end, 1);
51576
51577         ret_val = xmlXPtrNewRangePoints(start, end);
51578         desret_xmlXPathObjectPtr(ret_val);
51579         call_tests++;
51580         des_xmlXPathObjectPtr(n_start, start, 0);
51581         des_xmlXPathObjectPtr(n_end, end, 1);
51582         xmlResetLastError();
51583         if (mem_base != xmlMemBlocks()) {
51584             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51585                    xmlMemBlocks() - mem_base);
51586             test_ret++;
51587             printf(" %d", n_start);
51588             printf(" %d", n_end);
51589             printf("\n");
51590         }
51591     }
51592     }
51593     function_tests++;
51594 #endif
51595
51596     return(test_ret);
51597 }
51598
51599
51600 static int
51601 test_xmlXPtrRangeToFunction(void) {
51602     int test_ret = 0;
51603
51604 #if defined(LIBXML_XPTR_ENABLED)
51605     int mem_base;
51606     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51607     int n_ctxt;
51608     int nargs; /* the number of args */
51609     int n_nargs;
51610
51611     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51612     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51613         mem_base = xmlMemBlocks();
51614         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51615         nargs = gen_int(n_nargs, 1);
51616
51617         xmlXPtrRangeToFunction(ctxt, nargs);
51618         call_tests++;
51619         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51620         des_int(n_nargs, nargs, 1);
51621         xmlResetLastError();
51622         if (mem_base != xmlMemBlocks()) {
51623             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51624                    xmlMemBlocks() - mem_base);
51625             test_ret++;
51626             printf(" %d", n_ctxt);
51627             printf(" %d", n_nargs);
51628             printf("\n");
51629         }
51630     }
51631     }
51632     function_tests++;
51633 #endif
51634
51635     return(test_ret);
51636 }
51637
51638
51639 static int
51640 test_xmlXPtrWrapLocationSet(void) {
51641     int test_ret = 0;
51642
51643 #if defined(LIBXML_XPTR_ENABLED)
51644     int mem_base;
51645     xmlXPathObjectPtr ret_val;
51646     xmlLocationSetPtr val; /* the LocationSet value */
51647     int n_val;
51648
51649     for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51650         mem_base = xmlMemBlocks();
51651         val = gen_xmlLocationSetPtr(n_val, 0);
51652
51653         ret_val = xmlXPtrWrapLocationSet(val);
51654         desret_xmlXPathObjectPtr(ret_val);
51655         call_tests++;
51656         des_xmlLocationSetPtr(n_val, val, 0);
51657         xmlResetLastError();
51658         if (mem_base != xmlMemBlocks()) {
51659             printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51660                    xmlMemBlocks() - mem_base);
51661             test_ret++;
51662             printf(" %d", n_val);
51663             printf("\n");
51664         }
51665     }
51666     function_tests++;
51667 #endif
51668
51669     return(test_ret);
51670 }
51671
51672 static int
51673 test_xpointer(void) {
51674     int test_ret = 0;
51675
51676     if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51677     test_ret += test_xmlXPtrBuildNodeList();
51678     test_ret += test_xmlXPtrEval();
51679     test_ret += test_xmlXPtrEvalRangePredicate();
51680     test_ret += test_xmlXPtrLocationSetAdd();
51681     test_ret += test_xmlXPtrLocationSetCreate();
51682     test_ret += test_xmlXPtrLocationSetDel();
51683     test_ret += test_xmlXPtrLocationSetMerge();
51684     test_ret += test_xmlXPtrLocationSetRemove();
51685     test_ret += test_xmlXPtrNewCollapsedRange();
51686     test_ret += test_xmlXPtrNewContext();
51687     test_ret += test_xmlXPtrNewLocationSetNodeSet();
51688     test_ret += test_xmlXPtrNewLocationSetNodes();
51689     test_ret += test_xmlXPtrNewRange();
51690     test_ret += test_xmlXPtrNewRangeNodeObject();
51691     test_ret += test_xmlXPtrNewRangeNodePoint();
51692     test_ret += test_xmlXPtrNewRangeNodes();
51693     test_ret += test_xmlXPtrNewRangePointNode();
51694     test_ret += test_xmlXPtrNewRangePoints();
51695     test_ret += test_xmlXPtrRangeToFunction();
51696     test_ret += test_xmlXPtrWrapLocationSet();
51697
51698     if (test_ret != 0)
51699         printf("Module xpointer: %d errors\n", test_ret);
51700     return(test_ret);
51701 }
51702 static int
51703 test_module(const char *module) {
51704     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51705     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51706     if (!strcmp(module, "SAX2")) return(test_SAX2());
51707     if (!strcmp(module, "c14n")) return(test_c14n());
51708     if (!strcmp(module, "catalog")) return(test_catalog());
51709     if (!strcmp(module, "chvalid")) return(test_chvalid());
51710     if (!strcmp(module, "debugXML")) return(test_debugXML());
51711     if (!strcmp(module, "dict")) return(test_dict());
51712     if (!strcmp(module, "encoding")) return(test_encoding());
51713     if (!strcmp(module, "entities")) return(test_entities());
51714     if (!strcmp(module, "hash")) return(test_hash());
51715     if (!strcmp(module, "list")) return(test_list());
51716     if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51717     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51718     if (!strcmp(module, "parser")) return(test_parser());
51719     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51720     if (!strcmp(module, "pattern")) return(test_pattern());
51721     if (!strcmp(module, "relaxng")) return(test_relaxng());
51722     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51723     if (!strcmp(module, "schematron")) return(test_schematron());
51724     if (!strcmp(module, "tree")) return(test_tree());
51725     if (!strcmp(module, "uri")) return(test_uri());
51726     if (!strcmp(module, "valid")) return(test_valid());
51727     if (!strcmp(module, "xinclude")) return(test_xinclude());
51728     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51729     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51730     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51731     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51732     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51733     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51734     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51735     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51736     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51737     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51738     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51739     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51740     if (!strcmp(module, "xpath")) return(test_xpath());
51741     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51742     if (!strcmp(module, "xpointer")) return(test_xpointer());
51743     return(0);
51744 }