Merge "Merge branch 'tizen_base' into tizen" into tizen
[platform/upstream/libxml2.git] / testapi.c
1 /*
2  * testapi.c: libxml2 API tester program.
3  *
4  * Automatically generated by gentest.py from libxml2-api.xml
5  *
6  * See Copyright for the status of this software.
7  *
8  * daniel@veillard.com
9  */
10
11 #include "libxml.h"
12 #include <stdio.h>
13
14 #include <stdlib.h> /* for putenv() */
15 #include <string.h>
16 #include <libxml/xmlerror.h>
17 #include <libxml/relaxng.h>
18
19
20 static int testlibxml2(void);
21 static int test_module(const char *module);
22
23 static int generic_errors = 0;
24 static int call_tests = 0;
25 static int function_tests = 0;
26
27 static xmlChar chartab[1024];
28 static int inttab[1024];
29 static unsigned long longtab[1024];
30
31 static xmlDocPtr api_doc = NULL;
32 static xmlDtdPtr api_dtd = NULL;
33 static xmlNodePtr api_root = NULL;
34 static xmlAttrPtr api_attr = NULL;
35 static xmlNsPtr api_ns = NULL;
36
37 static void
38 structured_errors(void *userData ATTRIBUTE_UNUSED,
39                   xmlErrorPtr error ATTRIBUTE_UNUSED) {
40     generic_errors++;
41 }
42
43 static void
44 free_api_doc(void) {
45     xmlFreeDoc(api_doc);
46     api_doc = NULL;
47     api_dtd = NULL;
48     api_root = NULL;
49     api_attr = NULL;
50     api_ns = NULL;
51 }
52
53 static xmlDocPtr
54 get_api_doc(void) {
55     if (api_doc == NULL) {
56         api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
57         api_root = NULL;
58         api_attr = NULL;
59     }
60     return(api_doc);
61 }
62
63 static xmlDtdPtr
64 get_api_dtd(void) {
65     if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
66         get_api_doc();
67         if ((api_doc != NULL) && (api_doc->children != NULL) &&
68             (api_doc->children->type == XML_DTD_NODE))
69             api_dtd = (xmlDtdPtr) api_doc->children;
70     }
71     return(api_dtd);
72 }
73
74 static xmlNodePtr
75 get_api_root(void) {
76     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
77         get_api_doc();
78         if ((api_doc != NULL) && (api_doc->children != NULL) &&
79             (api_doc->children->next != NULL) &&
80             (api_doc->children->next->type == XML_ELEMENT_NODE))
81             api_root = api_doc->children->next;
82     }
83     return(api_root);
84 }
85
86 static xmlNsPtr
87 get_api_ns(void) {
88     get_api_root();
89     if (api_root != NULL)
90         api_ns = api_root->nsDef;
91     return(api_ns);
92 }
93
94 static xmlAttrPtr
95 get_api_attr(void) {
96 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
97     static int nr = 0;
98     xmlChar name[20];
99 #endif
100
101     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
102         get_api_root();
103     }
104     if (api_root == NULL)
105         return(NULL);
106     if (api_root->properties != NULL) {
107         api_attr = api_root->properties;
108         return(api_root->properties);
109     }
110     api_attr = NULL;
111 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
112     snprintf((char *) name, 20, "foo%d", nr++);
113     api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
114 #endif
115     return(api_attr);
116 }
117
118 static int quiet = 0;
119
120 int main(int argc, char **argv) {
121     int ret;
122     int blocks, mem;
123
124 #ifdef HAVE_PUTENV
125     /* access to the proxy can slow up regression tests a lot */
126     putenv((char *) "http_proxy=");
127 #endif
128
129     memset(chartab, 0, sizeof(chartab));
130     strncpy((char *) chartab, "  chartab\n", 20);
131     memset(inttab, 0, sizeof(inttab));
132     memset(longtab, 0, sizeof(longtab));
133
134     xmlInitParser();
135 #ifdef LIBXML_SCHEMAS_ENABLED
136     xmlRelaxNGInitTypes();
137 #endif
138
139     LIBXML_TEST_VERSION
140
141     xmlSetStructuredErrorFunc(NULL, structured_errors);
142
143     if (argc >= 2) {
144         if (!strcmp(argv[1], "-q")) {
145             quiet = 1;
146             if (argc >= 3)
147                 ret = test_module(argv[2]);
148             else
149                 ret = testlibxml2();
150         } else {
151            ret = test_module(argv[1]);
152         }
153     } else
154         ret = testlibxml2();
155
156     xmlCleanupParser();
157     blocks = xmlMemBlocks();
158     mem = xmlMemUsed();
159     if ((blocks != 0) || (mem != 0)) {
160         printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
161     }
162     xmlMemoryDump();
163
164     return (ret != 0);
165 }
166
167 #include <libxml/HTMLparser.h>
168 #include <libxml/HTMLtree.h>
169 #include <libxml/catalog.h>
170 #include <libxml/chvalid.h>
171 #include <libxml/dict.h>
172 #include <libxml/encoding.h>
173 #include <libxml/entities.h>
174 #include <libxml/hash.h>
175 #include <libxml/list.h>
176 #include <libxml/nanoftp.h>
177 #include <libxml/nanohttp.h>
178 #include <libxml/parser.h>
179 #include <libxml/parserInternals.h>
180 #include <libxml/pattern.h>
181 #include <libxml/relaxng.h>
182 #include <libxml/schemasInternals.h>
183 #include <libxml/schematron.h>
184 #include <libxml/tree.h>
185 #include <libxml/uri.h>
186 #include <libxml/valid.h>
187 #include <libxml/xinclude.h>
188 #include <libxml/xmlIO.h>
189 #include <libxml/xmlerror.h>
190 #include <libxml/xmlreader.h>
191 #include <libxml/xmlsave.h>
192 #include <libxml/xmlschemas.h>
193 #include <libxml/xmlschemastypes.h>
194 #include <libxml/xmlstring.h>
195 #include <libxml/xmlwriter.h>
196 #include <libxml/xpath.h>
197 #include <libxml/xpointer.h>
198 #include <libxml/debugXML.h>
199
200 /*
201   We manually define xmlErrMemory because it's normal declaration
202   is "hidden" by #ifdef IN_LIBXML
203 */
204 void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
205
206 /*
207  We need some "remote" addresses, but want to avoid getting into
208  name resolution delays, so we use these
209 */
210 #define REMOTE1GOOD     "http://localhost/"
211 #define REMOTE1BAD      "http:http://http"
212 #define REMOTE2GOOD     "ftp://localhost/foo"
213
214 #define gen_nb_void_ptr 2
215
216 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
217     return(NULL);
218 }
219 static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
220 }
221
222 #if 0
223 #define gen_nb_const_void_ptr 2
224
225 static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
226     if (no == 0) return((const void *) "immutable string");
227     return(NULL);
228 }
229 static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
230 }
231 #endif
232
233 #define gen_nb_userdata 3
234
235 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
236     if (no == 0) return((void *) &call_tests);
237     if (no == 1) return((void *) -1);
238     return(NULL);
239 }
240 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
241 }
242
243
244 #define gen_nb_int 4
245
246 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
247     if (no == 0) return(0);
248     if (no == 1) return(1);
249     if (no == 2) return(-1);
250     if (no == 3) return(122);
251     return(-1);
252 }
253
254 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
255 }
256
257 #define gen_nb_parseroptions 5
258
259 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
260     if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
261     if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
262     if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
263     if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
264     return(XML_PARSE_SAX1);
265 }
266
267 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
268 }
269
270 #if 0
271 #define gen_nb_long 5
272
273 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
274     if (no == 0) return(0);
275     if (no == 1) return(1);
276     if (no == 2) return(-1);
277     if (no == 3) return(122);
278     return(-1);
279 }
280
281 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
282 }
283 #endif
284
285 #define gen_nb_xmlChar 4
286
287 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
288     if (no == 0) return('a');
289     if (no == 1) return(' ');
290     if (no == 2) return((xmlChar) '\xf8');
291     return(0);
292 }
293
294 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
295 }
296
297 #define gen_nb_unsigned_int 3
298
299 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
300     if (no == 0) return(0);
301     if (no == 1) return(1);
302     if (no == 2) return(122);
303     return((unsigned int) -1);
304 }
305
306 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
307 }
308
309 #define gen_nb_unsigned_long 4
310
311 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
312     if (no == 0) return(0);
313     if (no == 1) return(1);
314     if (no == 2) return(122);
315     return((unsigned long) -1);
316 }
317
318 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
319 }
320
321 #define gen_nb_double 4
322
323 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
324     if (no == 0) return(0);
325     if (no == 1) return(-1.1);
326 #if defined(LIBXML_XPATH_ENABLED)
327     if (no == 2) return(xmlXPathNAN);
328 #endif
329     return(-1);
330 }
331
332 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
333 }
334
335 #define gen_nb_unsigned_long_ptr 2
336
337 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
338     if (no == 0) return(&longtab[nr]);
339     return(NULL);
340 }
341
342 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
343 }
344
345 #define gen_nb_int_ptr 2
346
347 static int *gen_int_ptr(int no, int nr) {
348     if (no == 0) return(&inttab[nr]);
349     return(NULL);
350 }
351
352 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
353 }
354
355 #define gen_nb_const_char_ptr 4
356
357 static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
358     if (no == 0) return((char *) "foo");
359     if (no == 1) return((char *) "<foo/>");
360     if (no == 2) return((char *) "test/ent2");
361     return(NULL);
362 }
363 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
364 }
365
366 #define gen_nb_xmlChar_ptr 2
367
368 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
369     if (no == 0) return(&chartab[0]);
370     return(NULL);
371 }
372 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
373 }
374
375 #define gen_nb_FILE_ptr 2
376
377 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
378     if (no == 0) return(fopen("test.out", "a+"));
379     return(NULL);
380 }
381 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
382     if (val != NULL) fclose(val);
383 }
384
385 #define gen_nb_debug_FILE_ptr 2
386 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
387     return(fopen("test.out", "a+"));
388 }
389 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
390     if (val != NULL) fclose(val);
391 }
392
393 #define gen_nb_const_xmlChar_ptr 5
394
395 static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
396     if (no == 0) return((xmlChar *) "foo");
397     if (no == 1) return((xmlChar *) "<foo/>");
398     if (no == 2) return((xmlChar *) "n" "\xf8" "ne");
399     if (no == 3) return((xmlChar *) " 2ab ");
400     return(NULL);
401 }
402 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
403 }
404
405 #define gen_nb_filepath 8
406
407 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
408     if (no == 0) return("missing.xml");
409     if (no == 1) return("<foo/>");
410     if (no == 2) return("test/ent2");
411     if (no == 3) return("test/valid/REC-xml-19980210.xml");
412     if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
413     if (no == 5) return(REMOTE1GOOD);
414     if (no == 6) return(REMOTE1BAD);
415     return(NULL);
416 }
417 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
418 }
419
420 #define gen_nb_eaten_name 2
421
422 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
423     if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
424     return(NULL);
425 }
426 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
427 }
428
429 #define gen_nb_fileoutput 6
430
431 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
432     if (no == 0) return("/missing.xml");
433     if (no == 1) return("<foo/>");
434     if (no == 2) return(REMOTE2GOOD);
435     if (no == 3) return(REMOTE1GOOD);
436     if (no == 4) return(REMOTE1BAD);
437     return(NULL);
438 }
439 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
440 }
441
442 #define gen_nb_xmlParserCtxtPtr 3
443 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
444     if (no == 0) return(xmlNewParserCtxt());
445     if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
446     return(NULL);
447 }
448 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
449     if (val != NULL)
450         xmlFreeParserCtxt(val);
451 }
452
453 #define gen_nb_xmlSAXHandlerPtr 2
454 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
455 #ifdef LIBXML_SAX1_ENABLED
456     if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
457 #endif
458     return(NULL);
459 }
460 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
461 }
462
463 #define gen_nb_xmlValidCtxtPtr 2
464 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
465 #ifdef LIBXML_VALID_ENABLED
466     if (no == 0) return(xmlNewValidCtxt());
467 #endif
468     return(NULL);
469 }
470 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
471 #ifdef LIBXML_VALID_ENABLED
472     if (val != NULL)
473         xmlFreeValidCtxt(val);
474 #endif
475 }
476
477 #define gen_nb_xmlParserInputBufferPtr 8
478
479 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
480     if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
481     if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
482     if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
483     if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
484     if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
485     if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
486     if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
487     return(NULL);
488 }
489 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
490     xmlFreeParserInputBuffer(val);
491 }
492
493 #define gen_nb_xmlDocPtr 4
494 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
495     if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
496     if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
497     if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
498     return(NULL);
499 }
500 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
501     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
502         xmlFreeDoc(val);
503 }
504
505 #define gen_nb_xmlAttrPtr 2
506 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
507     if (no == 0) return(get_api_attr());
508     return(NULL);
509 }
510 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
511     if (no == 0) free_api_doc();
512 }
513
514 #define gen_nb_xmlDictPtr 2
515 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
516     if (no == 0) return(xmlDictCreate());
517     return(NULL);
518 }
519 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
520     if (val != NULL)
521         xmlDictFree(val);
522 }
523
524 #define gen_nb_xmlNodePtr 3
525 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
526     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
527     if (no == 1) return(get_api_root());
528     return(NULL);
529 /*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
530 }
531 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
532     if (no == 1) {
533         free_api_doc();
534     } else if (val != NULL) {
535         xmlUnlinkNode(val);
536         xmlFreeNode(val);
537     }
538 }
539
540 #define gen_nb_xmlDtdPtr 3
541 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
542     if (no == 0)
543         return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
544     if (no == 1) return(get_api_dtd());
545     return(NULL);
546 }
547 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
548     if (no == 1) free_api_doc();
549     else if (val != NULL) {
550         xmlUnlinkNode((xmlNodePtr) val);
551         xmlFreeNode((xmlNodePtr) val);
552     }
553 }
554
555 #define gen_nb_xmlNsPtr 2
556 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
557     if (no == 0) return(get_api_ns());
558     return(NULL);
559 }
560 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
561     if (no == 0) free_api_doc();
562 }
563
564 #define gen_nb_xmlNodePtr_in 3
565 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
566     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
567     if (no == 0) return(xmlNewText(BAD_CAST "text"));
568     return(NULL);
569 }
570 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
571 }
572
573 #ifdef LIBXML_WRITER_ENABLED
574 #define gen_nb_xmlTextWriterPtr 2
575 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
576     if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
577     return(NULL);
578 }
579 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
580     if (val != NULL) xmlFreeTextWriter(val);
581 }
582 #endif
583
584 #ifdef LIBXML_READER_ENABLED
585 #define gen_nb_xmlTextReaderPtr 4
586 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
587     if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
588     if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
589     if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
590     return(NULL);
591 }
592 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
593     if (val != NULL) xmlFreeTextReader(val);
594 }
595 #endif
596
597 #define gen_nb_xmlBufferPtr 3
598 static const xmlChar *static_buf_content = (xmlChar *)"a static buffer";
599 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
600     if (no == 0) return(xmlBufferCreate());
601     if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
602     return(NULL);
603 }
604 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
605     if (val != NULL) {
606         xmlBufferFree(val);
607     }
608 }
609
610 #define gen_nb_xmlListPtr 2
611 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
612     if (no == 0) return(xmlListCreate(NULL, NULL));
613     return(NULL);
614 }
615 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
616     if (val != NULL) {
617         xmlListDelete(val);
618     }
619 }
620
621 #define gen_nb_xmlHashTablePtr 2
622 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
623     if (no == 0) return(xmlHashCreate(10));
624     return(NULL);
625 }
626 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
627     if (val != NULL) {
628         xmlHashFree(val, NULL);
629     }
630 }
631
632 #include <libxml/xpathInternals.h>
633
634 #ifdef LIBXML_XPATH_ENABLED
635 #define gen_nb_xmlXPathObjectPtr 5
636 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
637     if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
638     if (no == 1) return(xmlXPathNewFloat(1.1));
639     if (no == 2) return(xmlXPathNewBoolean(1));
640     if (no == 3) return(xmlXPathNewNodeSet(NULL));
641     return(NULL);
642 }
643 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
644     if (val != NULL) {
645         xmlXPathFreeObject(val);
646     }
647 }
648 #endif
649
650 #ifdef LIBXML_OUTPUT_ENABLED
651 #define gen_nb_xmlOutputBufferPtr 2
652 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
653     if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
654     return(NULL);
655 }
656 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
657     if (val != NULL) {
658         xmlOutputBufferClose(val);
659     }
660 }
661 #endif
662
663 #ifdef LIBXML_FTP_ENABLED
664 #define gen_nb_xmlNanoFTPCtxtPtr 4
665 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
666     if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
667     if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
668     if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
669     return(NULL);
670 }
671 static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
672     if (val != NULL) {
673         xmlNanoFTPFreeCtxt(val);
674     }
675 }
676 #endif
677
678 #ifdef LIBXML_HTTP_ENABLED
679 #define gen_nb_xmlNanoHTTPCtxtPtr 1
680 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
681     if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
682     if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
683     if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
684     return(NULL);
685 }
686 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
687     if (val != NULL) {
688         xmlNanoHTTPClose(val);
689     }
690 }
691 #endif
692
693 #define gen_nb_xmlCharEncoding 4
694 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
695     if (no == 0) return(XML_CHAR_ENCODING_UTF8);
696     if (no == 1) return(XML_CHAR_ENCODING_NONE);
697     if (no == 2) return(XML_CHAR_ENCODING_8859_1);
698     return(XML_CHAR_ENCODING_ERROR);
699 }
700 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
701 }
702
703 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
704
705 #define gen_nb_xmlExpCtxtPtr 1
706 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
707     return(NULL);
708 }
709 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
710 }
711
712 #define gen_nb_xmlExpNodePtr 1
713 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
714     return(NULL);
715 }
716 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
717 }
718
719 #endif
720
721 #if defined(LIBXML_SCHEMAS_ENABLED)
722 #define gen_nb_xmlSchemaPtr 1
723 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
724     return(NULL);
725 }
726 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
727 }
728
729 #define gen_nb_xmlSchemaValidCtxtPtr 1
730 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
731     return(NULL);
732 }
733 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
734 }
735
736 #endif /* LIBXML_SCHEMAS_ENABLED */
737
738 #define gen_nb_xmlHashDeallocator 2
739 static void
740 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
741 }
742
743 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
744     if (no == 0) return(test_xmlHashDeallocator);
745     return(NULL);
746 }
747 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
748 }
749
750
751 static void desret_int(int val ATTRIBUTE_UNUSED) {
752 }
753 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
754 }
755 static void desret_long(long val ATTRIBUTE_UNUSED) {
756 }
757 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
758 }
759 static void desret_double(double val ATTRIBUTE_UNUSED) {
760 }
761 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
762 }
763 #if 0
764 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
765 }
766 #endif
767 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
768 }
769 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
770 }
771 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
772 }
773 static void desret_xmlChar_ptr(xmlChar *val) {
774     if (val != NULL)
775         xmlFree(val);
776 }
777 static void desret_xmlDocPtr(xmlDocPtr val) {
778     if (val != api_doc)
779         xmlFreeDoc(val);
780 }
781 static void desret_xmlDictPtr(xmlDictPtr val) {
782     xmlDictFree(val);
783 }
784 #ifdef LIBXML_OUTPUT_ENABLED
785 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
786     xmlOutputBufferClose(val);
787 }
788 #endif
789 #ifdef LIBXML_READER_ENABLED
790 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
791     xmlFreeTextReader(val);
792 }
793 #endif
794 static void desret_xmlNodePtr(xmlNodePtr val) {
795     if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
796         xmlUnlinkNode(val);
797         xmlFreeNode(val);
798     }
799 }
800 static void desret_xmlAttrPtr(xmlAttrPtr val) {
801     if (val != NULL) {
802         xmlUnlinkNode((xmlNodePtr) val);
803         xmlFreeNode((xmlNodePtr) val);
804     }
805 }
806 static void desret_xmlEntityPtr(xmlEntityPtr val) {
807     if (val != NULL) {
808         xmlUnlinkNode((xmlNodePtr) val);
809         xmlFreeNode((xmlNodePtr) val);
810     }
811 }
812 static void desret_xmlElementPtr(xmlElementPtr val) {
813     if (val != NULL) {
814         xmlUnlinkNode((xmlNodePtr) val);
815     }
816 }
817 static void desret_xmlAttributePtr(xmlAttributePtr val) {
818     if (val != NULL) {
819         xmlUnlinkNode((xmlNodePtr) val);
820     }
821 }
822 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
823 }
824 static void desret_xmlDtdPtr(xmlDtdPtr val) {
825     desret_xmlNodePtr((xmlNodePtr)val);
826 }
827 #ifdef LIBXML_XPATH_ENABLED
828 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
829     xmlXPathFreeObject(val);
830 }
831 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
832     xmlXPathFreeNodeSet(val);
833 }
834 #endif
835 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
836     xmlFreeParserCtxt(val);
837 }
838 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
839     xmlFreeParserInputBuffer(val);
840 }
841 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
842     xmlFreeInputStream(val);
843 }
844 #ifdef LIBXML_WRITER_ENABLED
845 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
846     xmlFreeTextWriter(val);
847 }
848 #endif
849 static void desret_xmlBufferPtr(xmlBufferPtr val) {
850     xmlBufferFree(val);
851 }
852 #ifdef LIBXML_SCHEMAS_ENABLED
853 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
854     xmlSchemaFreeParserCtxt(val);
855 }
856 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
857 }
858 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
859     xmlRelaxNGFreeParserCtxt(val);
860 }
861 #endif
862 #ifdef LIBXML_HTML_ENABLED
863 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
864 }
865 #endif
866 #ifdef LIBXML_HTTP_ENABLED
867 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
868     xmlNanoHTTPClose(val);
869 }
870 #endif
871 #ifdef LIBXML_FTP_ENABLED
872 static void desret_xmlNanoFTPCtxtPtr(void *val) {
873     xmlNanoFTPClose(val);
874 }
875 #endif
876 /* cut and pasted from autogenerated to avoid troubles */
877 #define gen_nb_const_xmlChar_ptr_ptr 1
878 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
879     return(NULL);
880 }
881 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
882 }
883
884 #define gen_nb_unsigned_char_ptr 1
885 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
886     return(NULL);
887 }
888 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
889 }
890
891 #define gen_nb_const_unsigned_char_ptr 1
892 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
893     return(NULL);
894 }
895 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
896 }
897
898 #ifdef LIBXML_HTML_ENABLED
899 #define gen_nb_const_htmlNodePtr 1
900 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
901     return(NULL);
902 }
903 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
904 }
905 #endif
906
907 #ifdef LIBXML_HTML_ENABLED
908 #define gen_nb_htmlDocPtr 3
909 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
910     if (no == 0) return(htmlNewDoc(NULL, NULL));
911     if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
912     return(NULL);
913 }
914 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
915     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
916         xmlFreeDoc(val);
917 }
918 static void desret_htmlDocPtr(htmlDocPtr val) {
919     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
920         xmlFreeDoc(val);
921 }
922 #define gen_nb_htmlParserCtxtPtr 3
923 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
924     if (no == 0) return(xmlNewParserCtxt());
925     if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
926     return(NULL);
927 }
928 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
929     if (val != NULL)
930         htmlFreeParserCtxt(val);
931 }
932 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
933     if (val != NULL)
934         htmlFreeParserCtxt(val);
935 }
936 #endif
937
938 #ifdef LIBXML_XPATH_ENABLED
939 #define gen_nb_xmlNodeSetPtr 1
940 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
941     return(NULL);
942 }
943 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
944 }
945 #endif
946
947 #ifdef LIBXML_DEBUG_ENABLED
948 #ifdef LIBXML_XPATH_ENABLED
949 #define gen_nb_xmlShellCtxtPtr 1
950 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
951     return(NULL);
952 }
953 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
954 }
955 #endif
956 #endif
957
958 #ifdef LIBXML_PATTERN_ENABLED
959 #define gen_nb_xmlPatternPtr 1
960 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
961     return(NULL);
962 }
963 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
964 }
965 #endif
966
967 #define gen_nb_xmlElementContentPtr 1
968 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
969     return(NULL);
970 }
971 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
972     if (val != NULL)
973         xmlFreeElementContent(val);
974 }
975 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
976     if (val != NULL)
977         xmlFreeElementContent(val);
978 }
979
980 #define gen_nb_xmlParserNodeInfoSeqPtr 1
981 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
982     return(NULL);
983 }
984 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
985 }
986
987 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
988 }
989
990 #define gen_nb_void_ptr_ptr 1
991 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
992     return(NULL);
993 }
994 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
995 }
996
997 /************************************************************************
998  *                                                                      *
999  *   WARNING: end of the manually maintained part of the test code      *
1000  *            do not remove or alter the CUT HERE line                  *
1001  *                                                                      *
1002  ************************************************************************/
1003
1004 /* CUT HERE: everything below that line is generated */
1005 #ifdef LIBXML_HTML_ENABLED
1006 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1007 }
1008
1009 #endif
1010
1011 #define gen_nb_xmlAttributeDefault 4
1012 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1013     if (no == 1) return(XML_ATTRIBUTE_FIXED);
1014     if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1015     if (no == 3) return(XML_ATTRIBUTE_NONE);
1016     if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1017     return(0);
1018 }
1019
1020 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1021 }
1022
1023 #define gen_nb_xmlAttributeType 4
1024 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1025     if (no == 1) return(XML_ATTRIBUTE_CDATA);
1026     if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1027     if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1028     if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1029     return(0);
1030 }
1031
1032 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1033 }
1034
1035 #define gen_nb_xmlBufferAllocationScheme 4
1036 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1037     if (no == 1) return(XML_BUFFER_ALLOC_BOUNDED);
1038     if (no == 2) return(XML_BUFFER_ALLOC_DOUBLEIT);
1039     if (no == 3) return(XML_BUFFER_ALLOC_EXACT);
1040     if (no == 4) return(XML_BUFFER_ALLOC_HYBRID);
1041     return(0);
1042 }
1043
1044 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1045 }
1046
1047 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1048 }
1049
1050 #ifdef LIBXML_CATALOG_ENABLED
1051 #define gen_nb_xmlCatalogAllow 4
1052 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1053     if (no == 1) return(XML_CATA_ALLOW_ALL);
1054     if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1055     if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1056     if (no == 4) return(XML_CATA_ALLOW_NONE);
1057     return(0);
1058 }
1059
1060 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1061 }
1062
1063 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1064 }
1065
1066 #endif
1067
1068 #ifdef LIBXML_CATALOG_ENABLED
1069 #define gen_nb_xmlCatalogPrefer 3
1070 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1071     if (no == 1) return(XML_CATA_PREFER_NONE);
1072     if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1073     if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1074     return(0);
1075 }
1076
1077 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1078 }
1079
1080 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1081 }
1082
1083 #endif
1084
1085 #define gen_nb_xmlElementContentType 4
1086 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1087     if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1088     if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1089     if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1090     if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1091     return(0);
1092 }
1093
1094 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1095 }
1096
1097 #define gen_nb_xmlElementTypeVal 4
1098 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1099     if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1100     if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1101     if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1102     if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1103     return(0);
1104 }
1105
1106 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1107 }
1108
1109 #define gen_nb_xmlFeature 4
1110 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1111     if (no == 1) return(XML_WITH_AUTOMATA);
1112     if (no == 2) return(XML_WITH_C14N);
1113     if (no == 3) return(XML_WITH_CATALOG);
1114     if (no == 4) return(XML_WITH_DEBUG);
1115     return(0);
1116 }
1117
1118 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1119 }
1120
1121 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1122 }
1123
1124 #ifdef LIBXML_SCHEMAS_ENABLED
1125 #define gen_nb_xmlSchemaValType 4
1126 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1127     if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1128     if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1129     if (no == 3) return(XML_SCHEMAS_ANYURI);
1130     if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1131     return(0);
1132 }
1133
1134 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1135 }
1136
1137 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1138 }
1139
1140 #endif
1141
1142 #ifdef LIBXML_SCHEMAS_ENABLED
1143 #define gen_nb_xmlSchemaWhitespaceValueType 4
1144 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1145     if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1146     if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1147     if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1148     if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1149     return(0);
1150 }
1151
1152 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1153 }
1154
1155 #endif
1156
1157 #include <libxml/HTMLparser.h>
1158 #include <libxml/HTMLtree.h>
1159 #include <libxml/SAX2.h>
1160 #include <libxml/c14n.h>
1161 #include <libxml/catalog.h>
1162 #include <libxml/chvalid.h>
1163 #include <libxml/debugXML.h>
1164 #include <libxml/dict.h>
1165 #include <libxml/encoding.h>
1166 #include <libxml/entities.h>
1167 #include <libxml/hash.h>
1168 #include <libxml/list.h>
1169 #include <libxml/nanoftp.h>
1170 #include <libxml/nanohttp.h>
1171 #include <libxml/parser.h>
1172 #include <libxml/parserInternals.h>
1173 #include <libxml/pattern.h>
1174 #include <libxml/relaxng.h>
1175 #include <libxml/schemasInternals.h>
1176 #include <libxml/schematron.h>
1177 #include <libxml/tree.h>
1178 #include <libxml/uri.h>
1179 #include <libxml/valid.h>
1180 #include <libxml/xinclude.h>
1181 #include <libxml/xmlIO.h>
1182 #include <libxml/xmlautomata.h>
1183 #include <libxml/xmlerror.h>
1184 #include <libxml/xmlmodule.h>
1185 #include <libxml/xmlreader.h>
1186 #include <libxml/xmlregexp.h>
1187 #include <libxml/xmlsave.h>
1188 #include <libxml/xmlschemas.h>
1189 #include <libxml/xmlschemastypes.h>
1190 #include <libxml/xmlstring.h>
1191 #include <libxml/xmlunicode.h>
1192 #include <libxml/xmlwriter.h>
1193 #include <libxml/xpath.h>
1194 #include <libxml/xpathInternals.h>
1195 #include <libxml/xpointer.h>
1196 static int test_HTMLparser(void);
1197 static int test_HTMLtree(void);
1198 static int test_SAX2(void);
1199 static int test_c14n(void);
1200 static int test_catalog(void);
1201 static int test_chvalid(void);
1202 static int test_debugXML(void);
1203 static int test_dict(void);
1204 static int test_encoding(void);
1205 static int test_entities(void);
1206 static int test_hash(void);
1207 static int test_list(void);
1208 static int test_nanoftp(void);
1209 static int test_nanohttp(void);
1210 static int test_parser(void);
1211 static int test_parserInternals(void);
1212 static int test_pattern(void);
1213 static int test_relaxng(void);
1214 static int test_schemasInternals(void);
1215 static int test_schematron(void);
1216 static int test_tree(void);
1217 static int test_uri(void);
1218 static int test_valid(void);
1219 static int test_xinclude(void);
1220 static int test_xmlIO(void);
1221 static int test_xmlautomata(void);
1222 static int test_xmlerror(void);
1223 static int test_xmlmodule(void);
1224 static int test_xmlreader(void);
1225 static int test_xmlregexp(void);
1226 static int test_xmlsave(void);
1227 static int test_xmlschemas(void);
1228 static int test_xmlschemastypes(void);
1229 static int test_xmlstring(void);
1230 static int test_xmlunicode(void);
1231 static int test_xmlwriter(void);
1232 static int test_xpath(void);
1233 static int test_xpathInternals(void);
1234 static int test_xpointer(void);
1235
1236 /**
1237  * testlibxml2:
1238  *
1239  * Main entry point of the tester for the full libxml2 module,
1240  * it calls all the tester entry point for each module.
1241  *
1242  * Returns the number of error found
1243  */
1244 static int
1245 testlibxml2(void)
1246 {
1247     int test_ret = 0;
1248
1249     test_ret += test_HTMLparser();
1250     test_ret += test_HTMLtree();
1251     test_ret += test_SAX2();
1252     test_ret += test_c14n();
1253     test_ret += test_catalog();
1254     test_ret += test_chvalid();
1255     test_ret += test_debugXML();
1256     test_ret += test_dict();
1257     test_ret += test_encoding();
1258     test_ret += test_entities();
1259     test_ret += test_hash();
1260     test_ret += test_list();
1261     test_ret += test_nanoftp();
1262     test_ret += test_nanohttp();
1263     test_ret += test_parser();
1264     test_ret += test_parserInternals();
1265     test_ret += test_pattern();
1266     test_ret += test_relaxng();
1267     test_ret += test_schemasInternals();
1268     test_ret += test_schematron();
1269     test_ret += test_tree();
1270     test_ret += test_uri();
1271     test_ret += test_valid();
1272     test_ret += test_xinclude();
1273     test_ret += test_xmlIO();
1274     test_ret += test_xmlautomata();
1275     test_ret += test_xmlerror();
1276     test_ret += test_xmlmodule();
1277     test_ret += test_xmlreader();
1278     test_ret += test_xmlregexp();
1279     test_ret += test_xmlsave();
1280     test_ret += test_xmlschemas();
1281     test_ret += test_xmlschemastypes();
1282     test_ret += test_xmlstring();
1283     test_ret += test_xmlunicode();
1284     test_ret += test_xmlwriter();
1285     test_ret += test_xpath();
1286     test_ret += test_xpathInternals();
1287     test_ret += test_xpointer();
1288
1289     printf("Total: %d functions, %d tests, %d errors\n",
1290            function_tests, call_tests, test_ret);
1291     return(test_ret);
1292 }
1293
1294
1295 static int
1296 test_UTF8ToHtml(void) {
1297     int test_ret = 0;
1298
1299 #if defined(LIBXML_HTML_ENABLED)
1300     int mem_base;
1301     int ret_val;
1302     unsigned char * out; /* a pointer to an array of bytes to store the result */
1303     int n_out;
1304     int * outlen; /* the length of @out */
1305     int n_outlen;
1306     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1307     int n_in;
1308     int * inlen; /* the length of @in */
1309     int n_inlen;
1310
1311     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1312     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1313     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1314     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1315         mem_base = xmlMemBlocks();
1316         out = gen_unsigned_char_ptr(n_out, 0);
1317         outlen = gen_int_ptr(n_outlen, 1);
1318         in = gen_const_unsigned_char_ptr(n_in, 2);
1319         inlen = gen_int_ptr(n_inlen, 3);
1320
1321         ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1322         desret_int(ret_val);
1323         call_tests++;
1324         des_unsigned_char_ptr(n_out, out, 0);
1325         des_int_ptr(n_outlen, outlen, 1);
1326         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1327         des_int_ptr(n_inlen, inlen, 3);
1328         xmlResetLastError();
1329         if (mem_base != xmlMemBlocks()) {
1330             printf("Leak of %d blocks found in UTF8ToHtml",
1331                    xmlMemBlocks() - mem_base);
1332             test_ret++;
1333             printf(" %d", n_out);
1334             printf(" %d", n_outlen);
1335             printf(" %d", n_in);
1336             printf(" %d", n_inlen);
1337             printf("\n");
1338         }
1339     }
1340     }
1341     }
1342     }
1343     function_tests++;
1344 #endif
1345
1346     return(test_ret);
1347 }
1348
1349 #ifdef LIBXML_HTML_ENABLED
1350
1351 #define gen_nb_const_htmlElemDesc_ptr 1
1352 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1353     return(NULL);
1354 }
1355 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1356 }
1357 #endif
1358
1359
1360 static int
1361 test_htmlAttrAllowed(void) {
1362     int test_ret = 0;
1363
1364 #if defined(LIBXML_HTML_ENABLED)
1365     int mem_base;
1366     htmlStatus ret_val;
1367     htmlElemDesc * elt; /* HTML element */
1368     int n_elt;
1369     xmlChar * attr; /* HTML attribute */
1370     int n_attr;
1371     int legacy; /* whether to allow deprecated attributes */
1372     int n_legacy;
1373
1374     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1375     for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1376     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1377         mem_base = xmlMemBlocks();
1378         elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1379         attr = gen_const_xmlChar_ptr(n_attr, 1);
1380         legacy = gen_int(n_legacy, 2);
1381
1382         ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1383         desret_htmlStatus(ret_val);
1384         call_tests++;
1385         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1386         des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1387         des_int(n_legacy, legacy, 2);
1388         xmlResetLastError();
1389         if (mem_base != xmlMemBlocks()) {
1390             printf("Leak of %d blocks found in htmlAttrAllowed",
1391                    xmlMemBlocks() - mem_base);
1392             test_ret++;
1393             printf(" %d", n_elt);
1394             printf(" %d", n_attr);
1395             printf(" %d", n_legacy);
1396             printf("\n");
1397         }
1398     }
1399     }
1400     }
1401     function_tests++;
1402 #endif
1403
1404     return(test_ret);
1405 }
1406
1407 #ifdef LIBXML_HTML_ENABLED
1408
1409 #define gen_nb_htmlNodePtr 1
1410 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1411     return(NULL);
1412 }
1413 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1414 }
1415 #endif
1416
1417
1418 static int
1419 test_htmlAutoCloseTag(void) {
1420     int test_ret = 0;
1421
1422 #if defined(LIBXML_HTML_ENABLED)
1423     int mem_base;
1424     int ret_val;
1425     htmlDocPtr doc; /* the HTML document */
1426     int n_doc;
1427     xmlChar * name; /* The tag name */
1428     int n_name;
1429     htmlNodePtr elem; /* the HTML element */
1430     int n_elem;
1431
1432     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1433     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1434     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1435         mem_base = xmlMemBlocks();
1436         doc = gen_htmlDocPtr(n_doc, 0);
1437         name = gen_const_xmlChar_ptr(n_name, 1);
1438         elem = gen_htmlNodePtr(n_elem, 2);
1439
1440         ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1441         desret_int(ret_val);
1442         call_tests++;
1443         des_htmlDocPtr(n_doc, doc, 0);
1444         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1445         des_htmlNodePtr(n_elem, elem, 2);
1446         xmlResetLastError();
1447         if (mem_base != xmlMemBlocks()) {
1448             printf("Leak of %d blocks found in htmlAutoCloseTag",
1449                    xmlMemBlocks() - mem_base);
1450             test_ret++;
1451             printf(" %d", n_doc);
1452             printf(" %d", n_name);
1453             printf(" %d", n_elem);
1454             printf("\n");
1455         }
1456     }
1457     }
1458     }
1459     function_tests++;
1460 #endif
1461
1462     return(test_ret);
1463 }
1464
1465
1466 static int
1467 test_htmlCreateMemoryParserCtxt(void) {
1468     int test_ret = 0;
1469
1470 #if defined(LIBXML_HTML_ENABLED)
1471     int mem_base;
1472     htmlParserCtxtPtr ret_val;
1473     char * buffer; /* a pointer to a char array */
1474     int n_buffer;
1475     int size; /* the size of the array */
1476     int n_size;
1477
1478     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1479     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1480         mem_base = xmlMemBlocks();
1481         buffer = gen_const_char_ptr(n_buffer, 0);
1482         size = gen_int(n_size, 1);
1483         if ((buffer != NULL) &&
1484             (size > (int) strlen((const char *) buffer) + 1))
1485             continue;
1486
1487         ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1488         desret_htmlParserCtxtPtr(ret_val);
1489         call_tests++;
1490         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1491         des_int(n_size, size, 1);
1492         xmlResetLastError();
1493         if (mem_base != xmlMemBlocks()) {
1494             printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1495                    xmlMemBlocks() - mem_base);
1496             test_ret++;
1497             printf(" %d", n_buffer);
1498             printf(" %d", n_size);
1499             printf("\n");
1500         }
1501     }
1502     }
1503     function_tests++;
1504 #endif
1505
1506     return(test_ret);
1507 }
1508
1509 #ifdef LIBXML_HTML_ENABLED
1510
1511 #define gen_nb_htmlSAXHandlerPtr 1
1512 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1513     return(NULL);
1514 }
1515 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1516 }
1517 #endif
1518
1519
1520 static int
1521 test_htmlCreatePushParserCtxt(void) {
1522     int test_ret = 0;
1523
1524 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1525     int mem_base;
1526     htmlParserCtxtPtr ret_val;
1527     htmlSAXHandlerPtr sax; /* a SAX handler */
1528     int n_sax;
1529     void * user_data; /* The user data returned on SAX callbacks */
1530     int n_user_data;
1531     char * chunk; /* a pointer to an array of chars */
1532     int n_chunk;
1533     int size; /* number of chars in the array */
1534     int n_size;
1535     const char * filename; /* an optional file name or URI */
1536     int n_filename;
1537     xmlCharEncoding enc; /* an optional encoding */
1538     int n_enc;
1539
1540     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1541     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1542     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1543     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1544     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1545     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1546         mem_base = xmlMemBlocks();
1547         sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1548         user_data = gen_userdata(n_user_data, 1);
1549         chunk = gen_const_char_ptr(n_chunk, 2);
1550         size = gen_int(n_size, 3);
1551         filename = gen_fileoutput(n_filename, 4);
1552         enc = gen_xmlCharEncoding(n_enc, 5);
1553         if ((chunk != NULL) &&
1554             (size > (int) strlen((const char *) chunk) + 1))
1555             continue;
1556
1557         ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1558         desret_htmlParserCtxtPtr(ret_val);
1559         call_tests++;
1560         des_htmlSAXHandlerPtr(n_sax, sax, 0);
1561         des_userdata(n_user_data, user_data, 1);
1562         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1563         des_int(n_size, size, 3);
1564         des_fileoutput(n_filename, filename, 4);
1565         des_xmlCharEncoding(n_enc, enc, 5);
1566         xmlResetLastError();
1567         if (mem_base != xmlMemBlocks()) {
1568             printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1569                    xmlMemBlocks() - mem_base);
1570             test_ret++;
1571             printf(" %d", n_sax);
1572             printf(" %d", n_user_data);
1573             printf(" %d", n_chunk);
1574             printf(" %d", n_size);
1575             printf(" %d", n_filename);
1576             printf(" %d", n_enc);
1577             printf("\n");
1578         }
1579     }
1580     }
1581     }
1582     }
1583     }
1584     }
1585     function_tests++;
1586 #endif
1587
1588     return(test_ret);
1589 }
1590
1591
1592 static int
1593 test_htmlCtxtReadDoc(void) {
1594     int test_ret = 0;
1595
1596 #if defined(LIBXML_HTML_ENABLED)
1597     int mem_base;
1598     htmlDocPtr ret_val;
1599     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1600     int n_ctxt;
1601     xmlChar * cur; /* a pointer to a zero terminated string */
1602     int n_cur;
1603     const char * URL; /* the base URL to use for the document */
1604     int n_URL;
1605     char * encoding; /* the document encoding, or NULL */
1606     int n_encoding;
1607     int options; /* a combination of htmlParserOption(s) */
1608     int n_options;
1609
1610     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1611     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1612     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1613     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1614     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1615         mem_base = xmlMemBlocks();
1616         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1617         cur = gen_const_xmlChar_ptr(n_cur, 1);
1618         URL = gen_filepath(n_URL, 2);
1619         encoding = gen_const_char_ptr(n_encoding, 3);
1620         options = gen_int(n_options, 4);
1621
1622         ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1623         desret_htmlDocPtr(ret_val);
1624         call_tests++;
1625         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1626         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1627         des_filepath(n_URL, URL, 2);
1628         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1629         des_int(n_options, options, 4);
1630         xmlResetLastError();
1631         if (mem_base != xmlMemBlocks()) {
1632             printf("Leak of %d blocks found in htmlCtxtReadDoc",
1633                    xmlMemBlocks() - mem_base);
1634             test_ret++;
1635             printf(" %d", n_ctxt);
1636             printf(" %d", n_cur);
1637             printf(" %d", n_URL);
1638             printf(" %d", n_encoding);
1639             printf(" %d", n_options);
1640             printf("\n");
1641         }
1642     }
1643     }
1644     }
1645     }
1646     }
1647     function_tests++;
1648 #endif
1649
1650     return(test_ret);
1651 }
1652
1653
1654 static int
1655 test_htmlCtxtReadFile(void) {
1656     int test_ret = 0;
1657
1658 #if defined(LIBXML_HTML_ENABLED)
1659     htmlDocPtr ret_val;
1660     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1661     int n_ctxt;
1662     const char * filename; /* a file or URL */
1663     int n_filename;
1664     char * encoding; /* the document encoding, or NULL */
1665     int n_encoding;
1666     int options; /* a combination of htmlParserOption(s) */
1667     int n_options;
1668
1669     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1670     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1671     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1672     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1673         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1674         filename = gen_filepath(n_filename, 1);
1675         encoding = gen_const_char_ptr(n_encoding, 2);
1676         options = gen_int(n_options, 3);
1677
1678         ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1679         desret_htmlDocPtr(ret_val);
1680         call_tests++;
1681         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1682         des_filepath(n_filename, filename, 1);
1683         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1684         des_int(n_options, options, 3);
1685         xmlResetLastError();
1686     }
1687     }
1688     }
1689     }
1690     function_tests++;
1691 #endif
1692
1693     return(test_ret);
1694 }
1695
1696
1697 static int
1698 test_htmlCtxtReadMemory(void) {
1699     int test_ret = 0;
1700
1701 #if defined(LIBXML_HTML_ENABLED)
1702     int mem_base;
1703     htmlDocPtr ret_val;
1704     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1705     int n_ctxt;
1706     char * buffer; /* a pointer to a char array */
1707     int n_buffer;
1708     int size; /* the size of the array */
1709     int n_size;
1710     const char * URL; /* the base URL to use for the document */
1711     int n_URL;
1712     char * encoding; /* the document encoding, or NULL */
1713     int n_encoding;
1714     int options; /* a combination of htmlParserOption(s) */
1715     int n_options;
1716
1717     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1718     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1719     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1720     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1721     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1722     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1723         mem_base = xmlMemBlocks();
1724         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1725         buffer = gen_const_char_ptr(n_buffer, 1);
1726         size = gen_int(n_size, 2);
1727         URL = gen_filepath(n_URL, 3);
1728         encoding = gen_const_char_ptr(n_encoding, 4);
1729         options = gen_int(n_options, 5);
1730         if ((buffer != NULL) &&
1731             (size > (int) strlen((const char *) buffer) + 1))
1732             continue;
1733
1734         ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1735         desret_htmlDocPtr(ret_val);
1736         call_tests++;
1737         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1738         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1739         des_int(n_size, size, 2);
1740         des_filepath(n_URL, URL, 3);
1741         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1742         des_int(n_options, options, 5);
1743         xmlResetLastError();
1744         if (mem_base != xmlMemBlocks()) {
1745             printf("Leak of %d blocks found in htmlCtxtReadMemory",
1746                    xmlMemBlocks() - mem_base);
1747             test_ret++;
1748             printf(" %d", n_ctxt);
1749             printf(" %d", n_buffer);
1750             printf(" %d", n_size);
1751             printf(" %d", n_URL);
1752             printf(" %d", n_encoding);
1753             printf(" %d", n_options);
1754             printf("\n");
1755         }
1756     }
1757     }
1758     }
1759     }
1760     }
1761     }
1762     function_tests++;
1763 #endif
1764
1765     return(test_ret);
1766 }
1767
1768
1769 static int
1770 test_htmlCtxtReset(void) {
1771     int test_ret = 0;
1772
1773 #if defined(LIBXML_HTML_ENABLED)
1774     int mem_base;
1775     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1776     int n_ctxt;
1777
1778     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1779         mem_base = xmlMemBlocks();
1780         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1781
1782         htmlCtxtReset(ctxt);
1783         call_tests++;
1784         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1785         xmlResetLastError();
1786         if (mem_base != xmlMemBlocks()) {
1787             printf("Leak of %d blocks found in htmlCtxtReset",
1788                    xmlMemBlocks() - mem_base);
1789             test_ret++;
1790             printf(" %d", n_ctxt);
1791             printf("\n");
1792         }
1793     }
1794     function_tests++;
1795 #endif
1796
1797     return(test_ret);
1798 }
1799
1800
1801 static int
1802 test_htmlCtxtUseOptions(void) {
1803     int test_ret = 0;
1804
1805 #if defined(LIBXML_HTML_ENABLED)
1806     int mem_base;
1807     int ret_val;
1808     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1809     int n_ctxt;
1810     int options; /* a combination of htmlParserOption(s) */
1811     int n_options;
1812
1813     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1814     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1815         mem_base = xmlMemBlocks();
1816         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1817         options = gen_int(n_options, 1);
1818
1819         ret_val = htmlCtxtUseOptions(ctxt, options);
1820         desret_int(ret_val);
1821         call_tests++;
1822         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1823         des_int(n_options, options, 1);
1824         xmlResetLastError();
1825         if (mem_base != xmlMemBlocks()) {
1826             printf("Leak of %d blocks found in htmlCtxtUseOptions",
1827                    xmlMemBlocks() - mem_base);
1828             test_ret++;
1829             printf(" %d", n_ctxt);
1830             printf(" %d", n_options);
1831             printf("\n");
1832         }
1833     }
1834     }
1835     function_tests++;
1836 #endif
1837
1838     return(test_ret);
1839 }
1840
1841
1842 static int
1843 test_htmlElementAllowedHere(void) {
1844     int test_ret = 0;
1845
1846 #if defined(LIBXML_HTML_ENABLED)
1847     int mem_base;
1848     int ret_val;
1849     htmlElemDesc * parent; /* HTML parent element */
1850     int n_parent;
1851     xmlChar * elt; /* HTML element */
1852     int n_elt;
1853
1854     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1855     for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1856         mem_base = xmlMemBlocks();
1857         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1858         elt = gen_const_xmlChar_ptr(n_elt, 1);
1859
1860         ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1861         desret_int(ret_val);
1862         call_tests++;
1863         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1864         des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1865         xmlResetLastError();
1866         if (mem_base != xmlMemBlocks()) {
1867             printf("Leak of %d blocks found in htmlElementAllowedHere",
1868                    xmlMemBlocks() - mem_base);
1869             test_ret++;
1870             printf(" %d", n_parent);
1871             printf(" %d", n_elt);
1872             printf("\n");
1873         }
1874     }
1875     }
1876     function_tests++;
1877 #endif
1878
1879     return(test_ret);
1880 }
1881
1882
1883 static int
1884 test_htmlElementStatusHere(void) {
1885     int test_ret = 0;
1886
1887 #if defined(LIBXML_HTML_ENABLED)
1888     int mem_base;
1889     htmlStatus ret_val;
1890     htmlElemDesc * parent; /* HTML parent element */
1891     int n_parent;
1892     htmlElemDesc * elt; /* HTML element */
1893     int n_elt;
1894
1895     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1896     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1897         mem_base = xmlMemBlocks();
1898         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1899         elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1900
1901         ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1902         desret_htmlStatus(ret_val);
1903         call_tests++;
1904         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1905         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1906         xmlResetLastError();
1907         if (mem_base != xmlMemBlocks()) {
1908             printf("Leak of %d blocks found in htmlElementStatusHere",
1909                    xmlMemBlocks() - mem_base);
1910             test_ret++;
1911             printf(" %d", n_parent);
1912             printf(" %d", n_elt);
1913             printf("\n");
1914         }
1915     }
1916     }
1917     function_tests++;
1918 #endif
1919
1920     return(test_ret);
1921 }
1922
1923
1924 static int
1925 test_htmlEncodeEntities(void) {
1926     int test_ret = 0;
1927
1928 #if defined(LIBXML_HTML_ENABLED)
1929     int mem_base;
1930     int ret_val;
1931     unsigned char * out; /* a pointer to an array of bytes to store the result */
1932     int n_out;
1933     int * outlen; /* the length of @out */
1934     int n_outlen;
1935     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1936     int n_in;
1937     int * inlen; /* the length of @in */
1938     int n_inlen;
1939     int quoteChar; /* the quote character to escape (' or ") or zero. */
1940     int n_quoteChar;
1941
1942     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1943     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1944     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1945     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1946     for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1947         mem_base = xmlMemBlocks();
1948         out = gen_unsigned_char_ptr(n_out, 0);
1949         outlen = gen_int_ptr(n_outlen, 1);
1950         in = gen_const_unsigned_char_ptr(n_in, 2);
1951         inlen = gen_int_ptr(n_inlen, 3);
1952         quoteChar = gen_int(n_quoteChar, 4);
1953
1954         ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1955         desret_int(ret_val);
1956         call_tests++;
1957         des_unsigned_char_ptr(n_out, out, 0);
1958         des_int_ptr(n_outlen, outlen, 1);
1959         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1960         des_int_ptr(n_inlen, inlen, 3);
1961         des_int(n_quoteChar, quoteChar, 4);
1962         xmlResetLastError();
1963         if (mem_base != xmlMemBlocks()) {
1964             printf("Leak of %d blocks found in htmlEncodeEntities",
1965                    xmlMemBlocks() - mem_base);
1966             test_ret++;
1967             printf(" %d", n_out);
1968             printf(" %d", n_outlen);
1969             printf(" %d", n_in);
1970             printf(" %d", n_inlen);
1971             printf(" %d", n_quoteChar);
1972             printf("\n");
1973         }
1974     }
1975     }
1976     }
1977     }
1978     }
1979     function_tests++;
1980 #endif
1981
1982     return(test_ret);
1983 }
1984
1985
1986 static int
1987 test_htmlEntityLookup(void) {
1988     int test_ret = 0;
1989
1990 #if defined(LIBXML_HTML_ENABLED)
1991     int mem_base;
1992     const htmlEntityDesc * ret_val;
1993     xmlChar * name; /* the entity name */
1994     int n_name;
1995
1996     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1997         mem_base = xmlMemBlocks();
1998         name = gen_const_xmlChar_ptr(n_name, 0);
1999
2000         ret_val = htmlEntityLookup((const xmlChar *)name);
2001         desret_const_htmlEntityDesc_ptr(ret_val);
2002         call_tests++;
2003         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2004         xmlResetLastError();
2005         if (mem_base != xmlMemBlocks()) {
2006             printf("Leak of %d blocks found in htmlEntityLookup",
2007                    xmlMemBlocks() - mem_base);
2008             test_ret++;
2009             printf(" %d", n_name);
2010             printf("\n");
2011         }
2012     }
2013     function_tests++;
2014 #endif
2015
2016     return(test_ret);
2017 }
2018
2019
2020 static int
2021 test_htmlEntityValueLookup(void) {
2022     int test_ret = 0;
2023
2024 #if defined(LIBXML_HTML_ENABLED)
2025     int mem_base;
2026     const htmlEntityDesc * ret_val;
2027     unsigned int value; /* the entity's unicode value */
2028     int n_value;
2029
2030     for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2031         mem_base = xmlMemBlocks();
2032         value = gen_unsigned_int(n_value, 0);
2033
2034         ret_val = htmlEntityValueLookup(value);
2035         desret_const_htmlEntityDesc_ptr(ret_val);
2036         call_tests++;
2037         des_unsigned_int(n_value, value, 0);
2038         xmlResetLastError();
2039         if (mem_base != xmlMemBlocks()) {
2040             printf("Leak of %d blocks found in htmlEntityValueLookup",
2041                    xmlMemBlocks() - mem_base);
2042             test_ret++;
2043             printf(" %d", n_value);
2044             printf("\n");
2045         }
2046     }
2047     function_tests++;
2048 #endif
2049
2050     return(test_ret);
2051 }
2052
2053
2054 static int
2055 test_htmlHandleOmittedElem(void) {
2056     int test_ret = 0;
2057
2058 #if defined(LIBXML_HTML_ENABLED)
2059     int mem_base;
2060     int ret_val;
2061     int val; /* int 0 or 1 */
2062     int n_val;
2063
2064     for (n_val = 0;n_val < gen_nb_int;n_val++) {
2065         mem_base = xmlMemBlocks();
2066         val = gen_int(n_val, 0);
2067
2068         ret_val = htmlHandleOmittedElem(val);
2069         desret_int(ret_val);
2070         call_tests++;
2071         des_int(n_val, val, 0);
2072         xmlResetLastError();
2073         if (mem_base != xmlMemBlocks()) {
2074             printf("Leak of %d blocks found in htmlHandleOmittedElem",
2075                    xmlMemBlocks() - mem_base);
2076             test_ret++;
2077             printf(" %d", n_val);
2078             printf("\n");
2079         }
2080     }
2081     function_tests++;
2082 #endif
2083
2084     return(test_ret);
2085 }
2086
2087
2088 static int
2089 test_htmlIsAutoClosed(void) {
2090     int test_ret = 0;
2091
2092 #if defined(LIBXML_HTML_ENABLED)
2093     int mem_base;
2094     int ret_val;
2095     htmlDocPtr doc; /* the HTML document */
2096     int n_doc;
2097     htmlNodePtr elem; /* the HTML element */
2098     int n_elem;
2099
2100     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2101     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2102         mem_base = xmlMemBlocks();
2103         doc = gen_htmlDocPtr(n_doc, 0);
2104         elem = gen_htmlNodePtr(n_elem, 1);
2105
2106         ret_val = htmlIsAutoClosed(doc, elem);
2107         desret_int(ret_val);
2108         call_tests++;
2109         des_htmlDocPtr(n_doc, doc, 0);
2110         des_htmlNodePtr(n_elem, elem, 1);
2111         xmlResetLastError();
2112         if (mem_base != xmlMemBlocks()) {
2113             printf("Leak of %d blocks found in htmlIsAutoClosed",
2114                    xmlMemBlocks() - mem_base);
2115             test_ret++;
2116             printf(" %d", n_doc);
2117             printf(" %d", n_elem);
2118             printf("\n");
2119         }
2120     }
2121     }
2122     function_tests++;
2123 #endif
2124
2125     return(test_ret);
2126 }
2127
2128
2129 static int
2130 test_htmlIsScriptAttribute(void) {
2131     int test_ret = 0;
2132
2133 #if defined(LIBXML_HTML_ENABLED)
2134     int mem_base;
2135     int ret_val;
2136     xmlChar * name; /* an attribute name */
2137     int n_name;
2138
2139     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2140         mem_base = xmlMemBlocks();
2141         name = gen_const_xmlChar_ptr(n_name, 0);
2142
2143         ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2144         desret_int(ret_val);
2145         call_tests++;
2146         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2147         xmlResetLastError();
2148         if (mem_base != xmlMemBlocks()) {
2149             printf("Leak of %d blocks found in htmlIsScriptAttribute",
2150                    xmlMemBlocks() - mem_base);
2151             test_ret++;
2152             printf(" %d", n_name);
2153             printf("\n");
2154         }
2155     }
2156     function_tests++;
2157 #endif
2158
2159     return(test_ret);
2160 }
2161
2162
2163 static int
2164 test_htmlNewParserCtxt(void) {
2165     int test_ret = 0;
2166
2167 #if defined(LIBXML_HTML_ENABLED)
2168     int mem_base;
2169     htmlParserCtxtPtr ret_val;
2170
2171         mem_base = xmlMemBlocks();
2172
2173         ret_val = htmlNewParserCtxt();
2174         desret_htmlParserCtxtPtr(ret_val);
2175         call_tests++;
2176         xmlResetLastError();
2177         if (mem_base != xmlMemBlocks()) {
2178             printf("Leak of %d blocks found in htmlNewParserCtxt",
2179                    xmlMemBlocks() - mem_base);
2180             test_ret++;
2181             printf("\n");
2182         }
2183     function_tests++;
2184 #endif
2185
2186     return(test_ret);
2187 }
2188
2189
2190 static int
2191 test_htmlNodeStatus(void) {
2192     int test_ret = 0;
2193
2194 #if defined(LIBXML_HTML_ENABLED)
2195     int mem_base;
2196     htmlStatus ret_val;
2197     htmlNodePtr node; /* an htmlNodePtr in a tree */
2198     int n_node;
2199     int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2200     int n_legacy;
2201
2202     for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2203     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2204         mem_base = xmlMemBlocks();
2205         node = gen_const_htmlNodePtr(n_node, 0);
2206         legacy = gen_int(n_legacy, 1);
2207
2208         ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2209         desret_htmlStatus(ret_val);
2210         call_tests++;
2211         des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2212         des_int(n_legacy, legacy, 1);
2213         xmlResetLastError();
2214         if (mem_base != xmlMemBlocks()) {
2215             printf("Leak of %d blocks found in htmlNodeStatus",
2216                    xmlMemBlocks() - mem_base);
2217             test_ret++;
2218             printf(" %d", n_node);
2219             printf(" %d", n_legacy);
2220             printf("\n");
2221         }
2222     }
2223     }
2224     function_tests++;
2225 #endif
2226
2227     return(test_ret);
2228 }
2229
2230
2231 static int
2232 test_htmlParseCharRef(void) {
2233     int test_ret = 0;
2234
2235 #if defined(LIBXML_HTML_ENABLED)
2236     int mem_base;
2237     int ret_val;
2238     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2239     int n_ctxt;
2240
2241     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2242         mem_base = xmlMemBlocks();
2243         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2244
2245         ret_val = htmlParseCharRef(ctxt);
2246         desret_int(ret_val);
2247         call_tests++;
2248         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2249         xmlResetLastError();
2250         if (mem_base != xmlMemBlocks()) {
2251             printf("Leak of %d blocks found in htmlParseCharRef",
2252                    xmlMemBlocks() - mem_base);
2253             test_ret++;
2254             printf(" %d", n_ctxt);
2255             printf("\n");
2256         }
2257     }
2258     function_tests++;
2259 #endif
2260
2261     return(test_ret);
2262 }
2263
2264
2265 static int
2266 test_htmlParseChunk(void) {
2267     int test_ret = 0;
2268
2269 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2270     int mem_base;
2271     int ret_val;
2272     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2273     int n_ctxt;
2274     char * chunk; /* an char array */
2275     int n_chunk;
2276     int size; /* the size in byte of the chunk */
2277     int n_size;
2278     int terminate; /* last chunk indicator */
2279     int n_terminate;
2280
2281     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2282     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2283     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2284     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2285         mem_base = xmlMemBlocks();
2286         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2287         chunk = gen_const_char_ptr(n_chunk, 1);
2288         size = gen_int(n_size, 2);
2289         terminate = gen_int(n_terminate, 3);
2290         if ((chunk != NULL) &&
2291             (size > (int) strlen((const char *) chunk) + 1))
2292             continue;
2293
2294         ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2295         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2296         desret_int(ret_val);
2297         call_tests++;
2298         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2299         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2300         des_int(n_size, size, 2);
2301         des_int(n_terminate, terminate, 3);
2302         xmlResetLastError();
2303         if (mem_base != xmlMemBlocks()) {
2304             printf("Leak of %d blocks found in htmlParseChunk",
2305                    xmlMemBlocks() - mem_base);
2306             test_ret++;
2307             printf(" %d", n_ctxt);
2308             printf(" %d", n_chunk);
2309             printf(" %d", n_size);
2310             printf(" %d", n_terminate);
2311             printf("\n");
2312         }
2313     }
2314     }
2315     }
2316     }
2317     function_tests++;
2318 #endif
2319
2320     return(test_ret);
2321 }
2322
2323
2324 static int
2325 test_htmlParseDoc(void) {
2326     int test_ret = 0;
2327
2328 #if defined(LIBXML_HTML_ENABLED)
2329     int mem_base;
2330     htmlDocPtr ret_val;
2331     xmlChar * cur; /* a pointer to an array of xmlChar */
2332     int n_cur;
2333     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2334     int n_encoding;
2335
2336     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2337     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2338         mem_base = xmlMemBlocks();
2339         cur = gen_const_xmlChar_ptr(n_cur, 0);
2340         encoding = gen_const_char_ptr(n_encoding, 1);
2341
2342         ret_val = htmlParseDoc((const xmlChar *)cur, (const char *)encoding);
2343         desret_htmlDocPtr(ret_val);
2344         call_tests++;
2345         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2346         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2347         xmlResetLastError();
2348         if (mem_base != xmlMemBlocks()) {
2349             printf("Leak of %d blocks found in htmlParseDoc",
2350                    xmlMemBlocks() - mem_base);
2351             test_ret++;
2352             printf(" %d", n_cur);
2353             printf(" %d", n_encoding);
2354             printf("\n");
2355         }
2356     }
2357     }
2358     function_tests++;
2359 #endif
2360
2361     return(test_ret);
2362 }
2363
2364
2365 static int
2366 test_htmlParseDocument(void) {
2367     int test_ret = 0;
2368
2369 #if defined(LIBXML_HTML_ENABLED)
2370     int mem_base;
2371     int ret_val;
2372     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2373     int n_ctxt;
2374
2375     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2376         mem_base = xmlMemBlocks();
2377         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2378
2379         ret_val = htmlParseDocument(ctxt);
2380         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2381         desret_int(ret_val);
2382         call_tests++;
2383         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2384         xmlResetLastError();
2385         if (mem_base != xmlMemBlocks()) {
2386             printf("Leak of %d blocks found in htmlParseDocument",
2387                    xmlMemBlocks() - mem_base);
2388             test_ret++;
2389             printf(" %d", n_ctxt);
2390             printf("\n");
2391         }
2392     }
2393     function_tests++;
2394 #endif
2395
2396     return(test_ret);
2397 }
2398
2399
2400 static int
2401 test_htmlParseElement(void) {
2402     int test_ret = 0;
2403
2404 #if defined(LIBXML_HTML_ENABLED)
2405     int mem_base;
2406     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2407     int n_ctxt;
2408
2409     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2410         mem_base = xmlMemBlocks();
2411         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2412
2413         htmlParseElement(ctxt);
2414         call_tests++;
2415         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2416         xmlResetLastError();
2417         if (mem_base != xmlMemBlocks()) {
2418             printf("Leak of %d blocks found in htmlParseElement",
2419                    xmlMemBlocks() - mem_base);
2420             test_ret++;
2421             printf(" %d", n_ctxt);
2422             printf("\n");
2423         }
2424     }
2425     function_tests++;
2426 #endif
2427
2428     return(test_ret);
2429 }
2430
2431
2432 static int
2433 test_htmlParseEntityRef(void) {
2434     int test_ret = 0;
2435
2436 #if defined(LIBXML_HTML_ENABLED)
2437     int mem_base;
2438     const htmlEntityDesc * ret_val;
2439     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2440     int n_ctxt;
2441     xmlChar ** str; /* location to store the entity name */
2442     int n_str;
2443
2444     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2445     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2446         mem_base = xmlMemBlocks();
2447         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2448         str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2449
2450         ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2451         desret_const_htmlEntityDesc_ptr(ret_val);
2452         call_tests++;
2453         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2454         des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2455         xmlResetLastError();
2456         if (mem_base != xmlMemBlocks()) {
2457             printf("Leak of %d blocks found in htmlParseEntityRef",
2458                    xmlMemBlocks() - mem_base);
2459             test_ret++;
2460             printf(" %d", n_ctxt);
2461             printf(" %d", n_str);
2462             printf("\n");
2463         }
2464     }
2465     }
2466     function_tests++;
2467 #endif
2468
2469     return(test_ret);
2470 }
2471
2472
2473 static int
2474 test_htmlParseFile(void) {
2475     int test_ret = 0;
2476
2477 #if defined(LIBXML_HTML_ENABLED)
2478     htmlDocPtr ret_val;
2479     const char * filename; /* the filename */
2480     int n_filename;
2481     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2482     int n_encoding;
2483
2484     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2485     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2486         filename = gen_filepath(n_filename, 0);
2487         encoding = gen_const_char_ptr(n_encoding, 1);
2488
2489         ret_val = htmlParseFile(filename, (const char *)encoding);
2490         desret_htmlDocPtr(ret_val);
2491         call_tests++;
2492         des_filepath(n_filename, filename, 0);
2493         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2494         xmlResetLastError();
2495     }
2496     }
2497     function_tests++;
2498 #endif
2499
2500     return(test_ret);
2501 }
2502
2503
2504 static int
2505 test_htmlReadDoc(void) {
2506     int test_ret = 0;
2507
2508 #if defined(LIBXML_HTML_ENABLED)
2509     int mem_base;
2510     htmlDocPtr ret_val;
2511     xmlChar * cur; /* a pointer to a zero terminated string */
2512     int n_cur;
2513     const char * URL; /* the base URL to use for the document */
2514     int n_URL;
2515     char * encoding; /* the document encoding, or NULL */
2516     int n_encoding;
2517     int options; /* a combination of htmlParserOption(s) */
2518     int n_options;
2519
2520     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2521     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2522     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2523     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2524         mem_base = xmlMemBlocks();
2525         cur = gen_const_xmlChar_ptr(n_cur, 0);
2526         URL = gen_filepath(n_URL, 1);
2527         encoding = gen_const_char_ptr(n_encoding, 2);
2528         options = gen_int(n_options, 3);
2529
2530         ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2531         desret_htmlDocPtr(ret_val);
2532         call_tests++;
2533         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2534         des_filepath(n_URL, URL, 1);
2535         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2536         des_int(n_options, options, 3);
2537         xmlResetLastError();
2538         if (mem_base != xmlMemBlocks()) {
2539             printf("Leak of %d blocks found in htmlReadDoc",
2540                    xmlMemBlocks() - mem_base);
2541             test_ret++;
2542             printf(" %d", n_cur);
2543             printf(" %d", n_URL);
2544             printf(" %d", n_encoding);
2545             printf(" %d", n_options);
2546             printf("\n");
2547         }
2548     }
2549     }
2550     }
2551     }
2552     function_tests++;
2553 #endif
2554
2555     return(test_ret);
2556 }
2557
2558
2559 static int
2560 test_htmlReadFile(void) {
2561     int test_ret = 0;
2562
2563 #if defined(LIBXML_HTML_ENABLED)
2564     int mem_base;
2565     htmlDocPtr ret_val;
2566     const char * filename; /* a file or URL */
2567     int n_filename;
2568     char * encoding; /* the document encoding, or NULL */
2569     int n_encoding;
2570     int options; /* a combination of htmlParserOption(s) */
2571     int n_options;
2572
2573     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2574     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2575     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2576         mem_base = xmlMemBlocks();
2577         filename = gen_filepath(n_filename, 0);
2578         encoding = gen_const_char_ptr(n_encoding, 1);
2579         options = gen_int(n_options, 2);
2580
2581         ret_val = htmlReadFile(filename, (const char *)encoding, options);
2582         desret_htmlDocPtr(ret_val);
2583         call_tests++;
2584         des_filepath(n_filename, filename, 0);
2585         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2586         des_int(n_options, options, 2);
2587         xmlResetLastError();
2588         if (mem_base != xmlMemBlocks()) {
2589             printf("Leak of %d blocks found in htmlReadFile",
2590                    xmlMemBlocks() - mem_base);
2591             test_ret++;
2592             printf(" %d", n_filename);
2593             printf(" %d", n_encoding);
2594             printf(" %d", n_options);
2595             printf("\n");
2596         }
2597     }
2598     }
2599     }
2600     function_tests++;
2601 #endif
2602
2603     return(test_ret);
2604 }
2605
2606
2607 static int
2608 test_htmlReadMemory(void) {
2609     int test_ret = 0;
2610
2611 #if defined(LIBXML_HTML_ENABLED)
2612     int mem_base;
2613     htmlDocPtr ret_val;
2614     char * buffer; /* a pointer to a char array */
2615     int n_buffer;
2616     int size; /* the size of the array */
2617     int n_size;
2618     const char * URL; /* the base URL to use for the document */
2619     int n_URL;
2620     char * encoding; /* the document encoding, or NULL */
2621     int n_encoding;
2622     int options; /* a combination of htmlParserOption(s) */
2623     int n_options;
2624
2625     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2626     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2627     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2628     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2629     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2630         mem_base = xmlMemBlocks();
2631         buffer = gen_const_char_ptr(n_buffer, 0);
2632         size = gen_int(n_size, 1);
2633         URL = gen_filepath(n_URL, 2);
2634         encoding = gen_const_char_ptr(n_encoding, 3);
2635         options = gen_int(n_options, 4);
2636         if ((buffer != NULL) &&
2637             (size > (int) strlen((const char *) buffer) + 1))
2638             continue;
2639
2640         ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2641         desret_htmlDocPtr(ret_val);
2642         call_tests++;
2643         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2644         des_int(n_size, size, 1);
2645         des_filepath(n_URL, URL, 2);
2646         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2647         des_int(n_options, options, 4);
2648         xmlResetLastError();
2649         if (mem_base != xmlMemBlocks()) {
2650             printf("Leak of %d blocks found in htmlReadMemory",
2651                    xmlMemBlocks() - mem_base);
2652             test_ret++;
2653             printf(" %d", n_buffer);
2654             printf(" %d", n_size);
2655             printf(" %d", n_URL);
2656             printf(" %d", n_encoding);
2657             printf(" %d", n_options);
2658             printf("\n");
2659         }
2660     }
2661     }
2662     }
2663     }
2664     }
2665     function_tests++;
2666 #endif
2667
2668     return(test_ret);
2669 }
2670
2671
2672 static int
2673 test_htmlSAXParseDoc(void) {
2674     int test_ret = 0;
2675
2676 #if defined(LIBXML_HTML_ENABLED)
2677     int mem_base;
2678     htmlDocPtr ret_val;
2679     xmlChar * cur; /* a pointer to an array of xmlChar */
2680     int n_cur;
2681     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2682     int n_encoding;
2683     htmlSAXHandlerPtr sax; /* the SAX handler block */
2684     int n_sax;
2685     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2686     int n_userData;
2687
2688     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2689     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2690     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2691     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2692         mem_base = xmlMemBlocks();
2693         cur = gen_const_xmlChar_ptr(n_cur, 0);
2694         encoding = gen_const_char_ptr(n_encoding, 1);
2695         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2696         userData = gen_userdata(n_userData, 3);
2697
2698         ret_val = htmlSAXParseDoc((const xmlChar *)cur, (const char *)encoding, sax, userData);
2699         desret_htmlDocPtr(ret_val);
2700         call_tests++;
2701         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2702         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2703         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2704         des_userdata(n_userData, userData, 3);
2705         xmlResetLastError();
2706         if (mem_base != xmlMemBlocks()) {
2707             printf("Leak of %d blocks found in htmlSAXParseDoc",
2708                    xmlMemBlocks() - mem_base);
2709             test_ret++;
2710             printf(" %d", n_cur);
2711             printf(" %d", n_encoding);
2712             printf(" %d", n_sax);
2713             printf(" %d", n_userData);
2714             printf("\n");
2715         }
2716     }
2717     }
2718     }
2719     }
2720     function_tests++;
2721 #endif
2722
2723     return(test_ret);
2724 }
2725
2726
2727 static int
2728 test_htmlSAXParseFile(void) {
2729     int test_ret = 0;
2730
2731 #if defined(LIBXML_HTML_ENABLED)
2732     int mem_base;
2733     htmlDocPtr ret_val;
2734     const char * filename; /* the filename */
2735     int n_filename;
2736     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2737     int n_encoding;
2738     htmlSAXHandlerPtr sax; /* the SAX handler block */
2739     int n_sax;
2740     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2741     int n_userData;
2742
2743     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2744     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2745     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2746     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2747         mem_base = xmlMemBlocks();
2748         filename = gen_filepath(n_filename, 0);
2749         encoding = gen_const_char_ptr(n_encoding, 1);
2750         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2751         userData = gen_userdata(n_userData, 3);
2752
2753         ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2754         desret_htmlDocPtr(ret_val);
2755         call_tests++;
2756         des_filepath(n_filename, filename, 0);
2757         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2758         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2759         des_userdata(n_userData, userData, 3);
2760         xmlResetLastError();
2761         if (mem_base != xmlMemBlocks()) {
2762             printf("Leak of %d blocks found in htmlSAXParseFile",
2763                    xmlMemBlocks() - mem_base);
2764             test_ret++;
2765             printf(" %d", n_filename);
2766             printf(" %d", n_encoding);
2767             printf(" %d", n_sax);
2768             printf(" %d", n_userData);
2769             printf("\n");
2770         }
2771     }
2772     }
2773     }
2774     }
2775     function_tests++;
2776 #endif
2777
2778     return(test_ret);
2779 }
2780
2781
2782 static int
2783 test_htmlTagLookup(void) {
2784     int test_ret = 0;
2785
2786
2787     /* missing type support */
2788     return(test_ret);
2789 }
2790
2791 static int
2792 test_HTMLparser(void) {
2793     int test_ret = 0;
2794         int rc = 0;
2795
2796     if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2797     rc = test_UTF8ToHtml();
2798         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2799     rc = test_htmlAttrAllowed();
2800         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2801     rc = test_htmlAutoCloseTag();
2802         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2803     rc = test_htmlCreateMemoryParserCtxt();
2804         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2805     rc = test_htmlCreatePushParserCtxt();
2806         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2807     rc = test_htmlCtxtReadDoc();
2808         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2809     rc = test_htmlCtxtReadFile();
2810         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2811     rc = test_htmlCtxtReadMemory();
2812         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2813     rc = test_htmlCtxtReset();
2814         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2815     rc = test_htmlCtxtUseOptions();
2816         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2817     rc = test_htmlElementAllowedHere();
2818         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2819     rc = test_htmlElementStatusHere();
2820         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2821     rc = test_htmlEncodeEntities();
2822         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2823     rc = test_htmlEntityLookup();
2824         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2825     rc = test_htmlEntityValueLookup();
2826         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2827     rc = test_htmlHandleOmittedElem();
2828         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2829     rc = test_htmlIsAutoClosed();
2830         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2831     rc = test_htmlIsScriptAttribute();
2832         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2833     rc = test_htmlNewParserCtxt();
2834         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2835     rc = test_htmlNodeStatus();
2836         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2837     rc = test_htmlParseCharRef();
2838         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2839     rc = test_htmlParseChunk();
2840         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2841     rc = test_htmlParseDoc();
2842         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2843     rc = test_htmlParseDocument();
2844         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2845     rc = test_htmlParseElement();
2846         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2847     rc = test_htmlParseEntityRef();
2848         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2849     rc = test_htmlParseFile();
2850         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2851     rc = test_htmlReadDoc();
2852         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2853     rc = test_htmlReadFile();
2854         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2855     rc = test_htmlReadMemory();
2856         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2857     rc = test_htmlSAXParseDoc();
2858         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2859     rc = test_htmlSAXParseFile();
2860         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2861     rc = test_htmlTagLookup();
2862         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
2863
2864     if (test_ret != 0)
2865         printf("Module HTMLparser: %d errors\n", test_ret);
2866     return(test_ret);
2867 }
2868
2869 static int
2870 test_htmlDocContentDumpFormatOutput(void) {
2871     int test_ret = 0;
2872
2873 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2874     int mem_base;
2875     xmlOutputBufferPtr buf; /* the HTML buffer output */
2876     int n_buf;
2877     xmlDocPtr cur; /* the document */
2878     int n_cur;
2879     char * encoding; /* the encoding string */
2880     int n_encoding;
2881     int format; /* should formatting spaces been added */
2882     int n_format;
2883
2884     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2885     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2886     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2887     for (n_format = 0;n_format < gen_nb_int;n_format++) {
2888         mem_base = xmlMemBlocks();
2889         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2890         cur = gen_xmlDocPtr(n_cur, 1);
2891         encoding = gen_const_char_ptr(n_encoding, 2);
2892         format = gen_int(n_format, 3);
2893
2894         htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2895         call_tests++;
2896         des_xmlOutputBufferPtr(n_buf, buf, 0);
2897         des_xmlDocPtr(n_cur, cur, 1);
2898         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2899         des_int(n_format, format, 3);
2900         xmlResetLastError();
2901         if (mem_base != xmlMemBlocks()) {
2902             printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2903                    xmlMemBlocks() - mem_base);
2904             test_ret++;
2905             printf(" %d", n_buf);
2906             printf(" %d", n_cur);
2907             printf(" %d", n_encoding);
2908             printf(" %d", n_format);
2909             printf("\n");
2910         }
2911     }
2912     }
2913     }
2914     }
2915     function_tests++;
2916 #endif
2917
2918     return(test_ret);
2919 }
2920
2921
2922 static int
2923 test_htmlDocContentDumpOutput(void) {
2924     int test_ret = 0;
2925
2926 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2927     int mem_base;
2928     xmlOutputBufferPtr buf; /* the HTML buffer output */
2929     int n_buf;
2930     xmlDocPtr cur; /* the document */
2931     int n_cur;
2932     char * encoding; /* the encoding string */
2933     int n_encoding;
2934
2935     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2936     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2937     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2938         mem_base = xmlMemBlocks();
2939         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2940         cur = gen_xmlDocPtr(n_cur, 1);
2941         encoding = gen_const_char_ptr(n_encoding, 2);
2942
2943         htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2944         call_tests++;
2945         des_xmlOutputBufferPtr(n_buf, buf, 0);
2946         des_xmlDocPtr(n_cur, cur, 1);
2947         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2948         xmlResetLastError();
2949         if (mem_base != xmlMemBlocks()) {
2950             printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2951                    xmlMemBlocks() - mem_base);
2952             test_ret++;
2953             printf(" %d", n_buf);
2954             printf(" %d", n_cur);
2955             printf(" %d", n_encoding);
2956             printf("\n");
2957         }
2958     }
2959     }
2960     }
2961     function_tests++;
2962 #endif
2963
2964     return(test_ret);
2965 }
2966
2967
2968 static int
2969 test_htmlDocDump(void) {
2970     int test_ret = 0;
2971
2972 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2973     int mem_base;
2974     int ret_val;
2975     FILE * f; /* the FILE* */
2976     int n_f;
2977     xmlDocPtr cur; /* the document */
2978     int n_cur;
2979
2980     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2981     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2982         mem_base = xmlMemBlocks();
2983         f = gen_FILE_ptr(n_f, 0);
2984         cur = gen_xmlDocPtr(n_cur, 1);
2985
2986         ret_val = htmlDocDump(f, cur);
2987         desret_int(ret_val);
2988         call_tests++;
2989         des_FILE_ptr(n_f, f, 0);
2990         des_xmlDocPtr(n_cur, cur, 1);
2991         xmlResetLastError();
2992         if (mem_base != xmlMemBlocks()) {
2993             printf("Leak of %d blocks found in htmlDocDump",
2994                    xmlMemBlocks() - mem_base);
2995             test_ret++;
2996             printf(" %d", n_f);
2997             printf(" %d", n_cur);
2998             printf("\n");
2999         }
3000     }
3001     }
3002     function_tests++;
3003 #endif
3004
3005     return(test_ret);
3006 }
3007
3008
3009 #define gen_nb_xmlChar_ptr_ptr 1
3010 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3011     return(NULL);
3012 }
3013 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3014 }
3015
3016 static int
3017 test_htmlDocDumpMemory(void) {
3018     int test_ret = 0;
3019
3020 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3021     int mem_base;
3022     xmlDocPtr cur; /* the document */
3023     int n_cur;
3024     xmlChar ** mem; /* OUT: the memory pointer */
3025     int n_mem;
3026     int * size; /* OUT: the memory length */
3027     int n_size;
3028
3029     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3030     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3031     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3032         mem_base = xmlMemBlocks();
3033         cur = gen_xmlDocPtr(n_cur, 0);
3034         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3035         size = gen_int_ptr(n_size, 2);
3036
3037         htmlDocDumpMemory(cur, mem, size);
3038         call_tests++;
3039         des_xmlDocPtr(n_cur, cur, 0);
3040         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3041         des_int_ptr(n_size, size, 2);
3042         xmlResetLastError();
3043         if (mem_base != xmlMemBlocks()) {
3044             printf("Leak of %d blocks found in htmlDocDumpMemory",
3045                    xmlMemBlocks() - mem_base);
3046             test_ret++;
3047             printf(" %d", n_cur);
3048             printf(" %d", n_mem);
3049             printf(" %d", n_size);
3050             printf("\n");
3051         }
3052     }
3053     }
3054     }
3055     function_tests++;
3056 #endif
3057
3058     return(test_ret);
3059 }
3060
3061
3062 static int
3063 test_htmlDocDumpMemoryFormat(void) {
3064     int test_ret = 0;
3065
3066 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3067     int mem_base;
3068     xmlDocPtr cur; /* the document */
3069     int n_cur;
3070     xmlChar ** mem; /* OUT: the memory pointer */
3071     int n_mem;
3072     int * size; /* OUT: the memory length */
3073     int n_size;
3074     int format; /* should formatting spaces been added */
3075     int n_format;
3076
3077     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3078     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3079     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3080     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3081         mem_base = xmlMemBlocks();
3082         cur = gen_xmlDocPtr(n_cur, 0);
3083         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3084         size = gen_int_ptr(n_size, 2);
3085         format = gen_int(n_format, 3);
3086
3087         htmlDocDumpMemoryFormat(cur, mem, size, format);
3088         call_tests++;
3089         des_xmlDocPtr(n_cur, cur, 0);
3090         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3091         des_int_ptr(n_size, size, 2);
3092         des_int(n_format, format, 3);
3093         xmlResetLastError();
3094         if (mem_base != xmlMemBlocks()) {
3095             printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3096                    xmlMemBlocks() - mem_base);
3097             test_ret++;
3098             printf(" %d", n_cur);
3099             printf(" %d", n_mem);
3100             printf(" %d", n_size);
3101             printf(" %d", n_format);
3102             printf("\n");
3103         }
3104     }
3105     }
3106     }
3107     }
3108     function_tests++;
3109 #endif
3110
3111     return(test_ret);
3112 }
3113
3114
3115 static int
3116 test_htmlGetMetaEncoding(void) {
3117     int test_ret = 0;
3118
3119 #if defined(LIBXML_HTML_ENABLED)
3120     int mem_base;
3121     const xmlChar * ret_val;
3122     htmlDocPtr doc; /* the document */
3123     int n_doc;
3124
3125     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3126         mem_base = xmlMemBlocks();
3127         doc = gen_htmlDocPtr(n_doc, 0);
3128
3129         ret_val = htmlGetMetaEncoding(doc);
3130         desret_const_xmlChar_ptr(ret_val);
3131         call_tests++;
3132         des_htmlDocPtr(n_doc, doc, 0);
3133         xmlResetLastError();
3134         if (mem_base != xmlMemBlocks()) {
3135             printf("Leak of %d blocks found in htmlGetMetaEncoding",
3136                    xmlMemBlocks() - mem_base);
3137             test_ret++;
3138             printf(" %d", n_doc);
3139             printf("\n");
3140         }
3141     }
3142     function_tests++;
3143 #endif
3144
3145     return(test_ret);
3146 }
3147
3148
3149 static int
3150 test_htmlIsBooleanAttr(void) {
3151     int test_ret = 0;
3152
3153 #if defined(LIBXML_HTML_ENABLED)
3154     int mem_base;
3155     int ret_val;
3156     xmlChar * name; /* the name of the attribute to check */
3157     int n_name;
3158
3159     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3160         mem_base = xmlMemBlocks();
3161         name = gen_const_xmlChar_ptr(n_name, 0);
3162
3163         ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3164         desret_int(ret_val);
3165         call_tests++;
3166         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3167         xmlResetLastError();
3168         if (mem_base != xmlMemBlocks()) {
3169             printf("Leak of %d blocks found in htmlIsBooleanAttr",
3170                    xmlMemBlocks() - mem_base);
3171             test_ret++;
3172             printf(" %d", n_name);
3173             printf("\n");
3174         }
3175     }
3176     function_tests++;
3177 #endif
3178
3179     return(test_ret);
3180 }
3181
3182
3183 static int
3184 test_htmlNewDoc(void) {
3185     int test_ret = 0;
3186
3187 #if defined(LIBXML_HTML_ENABLED)
3188     int mem_base;
3189     htmlDocPtr ret_val;
3190     xmlChar * URI; /* URI for the dtd, or NULL */
3191     int n_URI;
3192     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3193     int n_ExternalID;
3194
3195     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3196     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3197         mem_base = xmlMemBlocks();
3198         URI = gen_const_xmlChar_ptr(n_URI, 0);
3199         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3200
3201         ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3202         desret_htmlDocPtr(ret_val);
3203         call_tests++;
3204         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3205         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3206         xmlResetLastError();
3207         if (mem_base != xmlMemBlocks()) {
3208             printf("Leak of %d blocks found in htmlNewDoc",
3209                    xmlMemBlocks() - mem_base);
3210             test_ret++;
3211             printf(" %d", n_URI);
3212             printf(" %d", n_ExternalID);
3213             printf("\n");
3214         }
3215     }
3216     }
3217     function_tests++;
3218 #endif
3219
3220     return(test_ret);
3221 }
3222
3223
3224 static int
3225 test_htmlNewDocNoDtD(void) {
3226     int test_ret = 0;
3227
3228 #if defined(LIBXML_HTML_ENABLED)
3229     int mem_base;
3230     htmlDocPtr ret_val;
3231     xmlChar * URI; /* URI for the dtd, or NULL */
3232     int n_URI;
3233     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3234     int n_ExternalID;
3235
3236     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3237     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3238         mem_base = xmlMemBlocks();
3239         URI = gen_const_xmlChar_ptr(n_URI, 0);
3240         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3241
3242         ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3243         desret_htmlDocPtr(ret_val);
3244         call_tests++;
3245         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3246         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3247         xmlResetLastError();
3248         if (mem_base != xmlMemBlocks()) {
3249             printf("Leak of %d blocks found in htmlNewDocNoDtD",
3250                    xmlMemBlocks() - mem_base);
3251             test_ret++;
3252             printf(" %d", n_URI);
3253             printf(" %d", n_ExternalID);
3254             printf("\n");
3255         }
3256     }
3257     }
3258     function_tests++;
3259 #endif
3260
3261     return(test_ret);
3262 }
3263
3264
3265 static int
3266 test_htmlNodeDump(void) {
3267     int test_ret = 0;
3268
3269 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3270     int mem_base;
3271     int ret_val;
3272     xmlBufferPtr buf; /* the HTML buffer output */
3273     int n_buf;
3274     xmlDocPtr doc; /* the document */
3275     int n_doc;
3276     xmlNodePtr cur; /* the current node */
3277     int n_cur;
3278
3279     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3280     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3281     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3282         mem_base = xmlMemBlocks();
3283         buf = gen_xmlBufferPtr(n_buf, 0);
3284         doc = gen_xmlDocPtr(n_doc, 1);
3285         cur = gen_xmlNodePtr(n_cur, 2);
3286
3287         ret_val = htmlNodeDump(buf, doc, cur);
3288         desret_int(ret_val);
3289         call_tests++;
3290         des_xmlBufferPtr(n_buf, buf, 0);
3291         des_xmlDocPtr(n_doc, doc, 1);
3292         des_xmlNodePtr(n_cur, cur, 2);
3293         xmlResetLastError();
3294         if (mem_base != xmlMemBlocks()) {
3295             printf("Leak of %d blocks found in htmlNodeDump",
3296                    xmlMemBlocks() - mem_base);
3297             test_ret++;
3298             printf(" %d", n_buf);
3299             printf(" %d", n_doc);
3300             printf(" %d", n_cur);
3301             printf("\n");
3302         }
3303     }
3304     }
3305     }
3306     function_tests++;
3307 #endif
3308
3309     return(test_ret);
3310 }
3311
3312
3313 static int
3314 test_htmlNodeDumpFile(void) {
3315     int test_ret = 0;
3316
3317 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3318     int mem_base;
3319     FILE * out; /* the FILE pointer */
3320     int n_out;
3321     xmlDocPtr doc; /* the document */
3322     int n_doc;
3323     xmlNodePtr cur; /* the current node */
3324     int n_cur;
3325
3326     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3327     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3328     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3329         mem_base = xmlMemBlocks();
3330         out = gen_FILE_ptr(n_out, 0);
3331         doc = gen_xmlDocPtr(n_doc, 1);
3332         cur = gen_xmlNodePtr(n_cur, 2);
3333
3334         htmlNodeDumpFile(out, doc, cur);
3335         call_tests++;
3336         des_FILE_ptr(n_out, out, 0);
3337         des_xmlDocPtr(n_doc, doc, 1);
3338         des_xmlNodePtr(n_cur, cur, 2);
3339         xmlResetLastError();
3340         if (mem_base != xmlMemBlocks()) {
3341             printf("Leak of %d blocks found in htmlNodeDumpFile",
3342                    xmlMemBlocks() - mem_base);
3343             test_ret++;
3344             printf(" %d", n_out);
3345             printf(" %d", n_doc);
3346             printf(" %d", n_cur);
3347             printf("\n");
3348         }
3349     }
3350     }
3351     }
3352     function_tests++;
3353 #endif
3354
3355     return(test_ret);
3356 }
3357
3358
3359 static int
3360 test_htmlNodeDumpFileFormat(void) {
3361     int test_ret = 0;
3362
3363 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3364     int mem_base;
3365     int ret_val;
3366     FILE * out; /* the FILE pointer */
3367     int n_out;
3368     xmlDocPtr doc; /* the document */
3369     int n_doc;
3370     xmlNodePtr cur; /* the current node */
3371     int n_cur;
3372     char * encoding; /* the document encoding */
3373     int n_encoding;
3374     int format; /* should formatting spaces been added */
3375     int n_format;
3376
3377     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3378     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3379     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3380     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3381     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3382         mem_base = xmlMemBlocks();
3383         out = gen_FILE_ptr(n_out, 0);
3384         doc = gen_xmlDocPtr(n_doc, 1);
3385         cur = gen_xmlNodePtr(n_cur, 2);
3386         encoding = gen_const_char_ptr(n_encoding, 3);
3387         format = gen_int(n_format, 4);
3388
3389         ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3390         desret_int(ret_val);
3391         call_tests++;
3392         des_FILE_ptr(n_out, out, 0);
3393         des_xmlDocPtr(n_doc, doc, 1);
3394         des_xmlNodePtr(n_cur, cur, 2);
3395         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3396         des_int(n_format, format, 4);
3397         xmlResetLastError();
3398         if (mem_base != xmlMemBlocks()) {
3399             printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3400                    xmlMemBlocks() - mem_base);
3401             test_ret++;
3402             printf(" %d", n_out);
3403             printf(" %d", n_doc);
3404             printf(" %d", n_cur);
3405             printf(" %d", n_encoding);
3406             printf(" %d", n_format);
3407             printf("\n");
3408         }
3409     }
3410     }
3411     }
3412     }
3413     }
3414     function_tests++;
3415 #endif
3416
3417     return(test_ret);
3418 }
3419
3420
3421 static int
3422 test_htmlNodeDumpFormatOutput(void) {
3423     int test_ret = 0;
3424
3425 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3426     int mem_base;
3427     xmlOutputBufferPtr buf; /* the HTML buffer output */
3428     int n_buf;
3429     xmlDocPtr doc; /* the document */
3430     int n_doc;
3431     xmlNodePtr cur; /* the current node */
3432     int n_cur;
3433     char * encoding; /* the encoding string */
3434     int n_encoding;
3435     int format; /* should formatting spaces been added */
3436     int n_format;
3437
3438     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3439     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3440     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3441     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3442     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3443         mem_base = xmlMemBlocks();
3444         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3445         doc = gen_xmlDocPtr(n_doc, 1);
3446         cur = gen_xmlNodePtr(n_cur, 2);
3447         encoding = gen_const_char_ptr(n_encoding, 3);
3448         format = gen_int(n_format, 4);
3449
3450         htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3451         call_tests++;
3452         des_xmlOutputBufferPtr(n_buf, buf, 0);
3453         des_xmlDocPtr(n_doc, doc, 1);
3454         des_xmlNodePtr(n_cur, cur, 2);
3455         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3456         des_int(n_format, format, 4);
3457         xmlResetLastError();
3458         if (mem_base != xmlMemBlocks()) {
3459             printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3460                    xmlMemBlocks() - mem_base);
3461             test_ret++;
3462             printf(" %d", n_buf);
3463             printf(" %d", n_doc);
3464             printf(" %d", n_cur);
3465             printf(" %d", n_encoding);
3466             printf(" %d", n_format);
3467             printf("\n");
3468         }
3469     }
3470     }
3471     }
3472     }
3473     }
3474     function_tests++;
3475 #endif
3476
3477     return(test_ret);
3478 }
3479
3480
3481 static int
3482 test_htmlNodeDumpOutput(void) {
3483     int test_ret = 0;
3484
3485 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3486     int mem_base;
3487     xmlOutputBufferPtr buf; /* the HTML buffer output */
3488     int n_buf;
3489     xmlDocPtr doc; /* the document */
3490     int n_doc;
3491     xmlNodePtr cur; /* the current node */
3492     int n_cur;
3493     char * encoding; /* the encoding string */
3494     int n_encoding;
3495
3496     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3497     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3498     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3499     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3500         mem_base = xmlMemBlocks();
3501         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3502         doc = gen_xmlDocPtr(n_doc, 1);
3503         cur = gen_xmlNodePtr(n_cur, 2);
3504         encoding = gen_const_char_ptr(n_encoding, 3);
3505
3506         htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3507         call_tests++;
3508         des_xmlOutputBufferPtr(n_buf, buf, 0);
3509         des_xmlDocPtr(n_doc, doc, 1);
3510         des_xmlNodePtr(n_cur, cur, 2);
3511         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3512         xmlResetLastError();
3513         if (mem_base != xmlMemBlocks()) {
3514             printf("Leak of %d blocks found in htmlNodeDumpOutput",
3515                    xmlMemBlocks() - mem_base);
3516             test_ret++;
3517             printf(" %d", n_buf);
3518             printf(" %d", n_doc);
3519             printf(" %d", n_cur);
3520             printf(" %d", n_encoding);
3521             printf("\n");
3522         }
3523     }
3524     }
3525     }
3526     }
3527     function_tests++;
3528 #endif
3529
3530     return(test_ret);
3531 }
3532
3533
3534 static int
3535 test_htmlSaveFile(void) {
3536     int test_ret = 0;
3537
3538 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3539     int mem_base;
3540     int ret_val;
3541     const char * filename; /* the filename (or URL) */
3542     int n_filename;
3543     xmlDocPtr cur; /* the document */
3544     int n_cur;
3545
3546     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3547     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3548         mem_base = xmlMemBlocks();
3549         filename = gen_fileoutput(n_filename, 0);
3550         cur = gen_xmlDocPtr(n_cur, 1);
3551
3552         ret_val = htmlSaveFile(filename, cur);
3553         desret_int(ret_val);
3554         call_tests++;
3555         des_fileoutput(n_filename, filename, 0);
3556         des_xmlDocPtr(n_cur, cur, 1);
3557         xmlResetLastError();
3558         if (mem_base != xmlMemBlocks()) {
3559             printf("Leak of %d blocks found in htmlSaveFile",
3560                    xmlMemBlocks() - mem_base);
3561             test_ret++;
3562             printf(" %d", n_filename);
3563             printf(" %d", n_cur);
3564             printf("\n");
3565         }
3566     }
3567     }
3568     function_tests++;
3569 #endif
3570
3571     return(test_ret);
3572 }
3573
3574
3575 static int
3576 test_htmlSaveFileEnc(void) {
3577     int test_ret = 0;
3578
3579 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3580     int mem_base;
3581     int ret_val;
3582     const char * filename; /* the filename */
3583     int n_filename;
3584     xmlDocPtr cur; /* the document */
3585     int n_cur;
3586     char * encoding; /* the document encoding */
3587     int n_encoding;
3588
3589     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3590     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3591     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3592         mem_base = xmlMemBlocks();
3593         filename = gen_fileoutput(n_filename, 0);
3594         cur = gen_xmlDocPtr(n_cur, 1);
3595         encoding = gen_const_char_ptr(n_encoding, 2);
3596
3597         ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3598         desret_int(ret_val);
3599         call_tests++;
3600         des_fileoutput(n_filename, filename, 0);
3601         des_xmlDocPtr(n_cur, cur, 1);
3602         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3603         xmlResetLastError();
3604         if (mem_base != xmlMemBlocks()) {
3605             printf("Leak of %d blocks found in htmlSaveFileEnc",
3606                    xmlMemBlocks() - mem_base);
3607             test_ret++;
3608             printf(" %d", n_filename);
3609             printf(" %d", n_cur);
3610             printf(" %d", n_encoding);
3611             printf("\n");
3612         }
3613     }
3614     }
3615     }
3616     function_tests++;
3617 #endif
3618
3619     return(test_ret);
3620 }
3621
3622
3623 static int
3624 test_htmlSaveFileFormat(void) {
3625     int test_ret = 0;
3626
3627 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3628     int mem_base;
3629     int ret_val;
3630     const char * filename; /* the filename */
3631     int n_filename;
3632     xmlDocPtr cur; /* the document */
3633     int n_cur;
3634     char * encoding; /* the document encoding */
3635     int n_encoding;
3636     int format; /* should formatting spaces been added */
3637     int n_format;
3638
3639     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3640     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3641     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3642     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3643         mem_base = xmlMemBlocks();
3644         filename = gen_fileoutput(n_filename, 0);
3645         cur = gen_xmlDocPtr(n_cur, 1);
3646         encoding = gen_const_char_ptr(n_encoding, 2);
3647         format = gen_int(n_format, 3);
3648
3649         ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3650         desret_int(ret_val);
3651         call_tests++;
3652         des_fileoutput(n_filename, filename, 0);
3653         des_xmlDocPtr(n_cur, cur, 1);
3654         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3655         des_int(n_format, format, 3);
3656         xmlResetLastError();
3657         if (mem_base != xmlMemBlocks()) {
3658             printf("Leak of %d blocks found in htmlSaveFileFormat",
3659                    xmlMemBlocks() - mem_base);
3660             test_ret++;
3661             printf(" %d", n_filename);
3662             printf(" %d", n_cur);
3663             printf(" %d", n_encoding);
3664             printf(" %d", n_format);
3665             printf("\n");
3666         }
3667     }
3668     }
3669     }
3670     }
3671     function_tests++;
3672 #endif
3673
3674     return(test_ret);
3675 }
3676
3677
3678 static int
3679 test_htmlSetMetaEncoding(void) {
3680     int test_ret = 0;
3681
3682 #if defined(LIBXML_HTML_ENABLED)
3683     int mem_base;
3684     int ret_val;
3685     htmlDocPtr doc; /* the document */
3686     int n_doc;
3687     xmlChar * encoding; /* the encoding string */
3688     int n_encoding;
3689
3690     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3691     for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3692         mem_base = xmlMemBlocks();
3693         doc = gen_htmlDocPtr(n_doc, 0);
3694         encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3695
3696         ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3697         desret_int(ret_val);
3698         call_tests++;
3699         des_htmlDocPtr(n_doc, doc, 0);
3700         des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3701         xmlResetLastError();
3702         if (mem_base != xmlMemBlocks()) {
3703             printf("Leak of %d blocks found in htmlSetMetaEncoding",
3704                    xmlMemBlocks() - mem_base);
3705             test_ret++;
3706             printf(" %d", n_doc);
3707             printf(" %d", n_encoding);
3708             printf("\n");
3709         }
3710     }
3711     }
3712     function_tests++;
3713 #endif
3714
3715     return(test_ret);
3716 }
3717
3718 static int
3719 test_HTMLtree(void) {
3720     int test_ret = 0;
3721         int rc = 0;
3722
3723     if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3724     rc = test_htmlDocContentDumpFormatOutput();
3725         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3726     rc = test_htmlDocContentDumpOutput();
3727         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3728     rc = test_htmlDocDump();
3729         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3730     rc = test_htmlDocDumpMemory();
3731         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3732     rc = test_htmlDocDumpMemoryFormat();
3733         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3734     rc = test_htmlGetMetaEncoding();
3735         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3736     rc = test_htmlIsBooleanAttr();
3737         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3738     rc = test_htmlNewDoc();
3739         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3740     rc = test_htmlNewDocNoDtD();
3741         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3742     rc = test_htmlNodeDump();
3743         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3744     rc = test_htmlNodeDumpFile();
3745         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3746     rc = test_htmlNodeDumpFileFormat();
3747         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3748     rc = test_htmlNodeDumpFormatOutput();
3749         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3750     rc = test_htmlNodeDumpOutput();
3751         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3752     rc = test_htmlSaveFile();
3753         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3754     rc = test_htmlSaveFileEnc();
3755         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3756     rc = test_htmlSaveFileFormat();
3757         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3758     rc = test_htmlSetMetaEncoding();
3759         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
3760
3761     if (test_ret != 0)
3762         printf("Module HTMLtree: %d errors\n", test_ret);
3763     return(test_ret);
3764 }
3765
3766 static int
3767 test_docbDefaultSAXHandlerInit(void) {
3768     int test_ret = 0;
3769
3770 #if defined(LIBXML_DOCB_ENABLED)
3771 #ifdef LIBXML_DOCB_ENABLED
3772     int mem_base;
3773
3774         mem_base = xmlMemBlocks();
3775
3776         docbDefaultSAXHandlerInit();
3777         call_tests++;
3778         xmlResetLastError();
3779         if (mem_base != xmlMemBlocks()) {
3780             printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3781                    xmlMemBlocks() - mem_base);
3782             test_ret++;
3783             printf("\n");
3784         }
3785     function_tests++;
3786 #endif
3787 #endif
3788
3789     return(test_ret);
3790 }
3791
3792
3793 static int
3794 test_htmlDefaultSAXHandlerInit(void) {
3795     int test_ret = 0;
3796
3797 #if defined(LIBXML_HTML_ENABLED)
3798 #ifdef LIBXML_HTML_ENABLED
3799     int mem_base;
3800
3801         mem_base = xmlMemBlocks();
3802
3803         htmlDefaultSAXHandlerInit();
3804         call_tests++;
3805         xmlResetLastError();
3806         if (mem_base != xmlMemBlocks()) {
3807             printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3808                    xmlMemBlocks() - mem_base);
3809             test_ret++;
3810             printf("\n");
3811         }
3812     function_tests++;
3813 #endif
3814 #endif
3815
3816     return(test_ret);
3817 }
3818
3819
3820 static int
3821 test_xmlDefaultSAXHandlerInit(void) {
3822     int test_ret = 0;
3823
3824     int mem_base;
3825
3826         mem_base = xmlMemBlocks();
3827
3828         xmlDefaultSAXHandlerInit();
3829         call_tests++;
3830         xmlResetLastError();
3831         if (mem_base != xmlMemBlocks()) {
3832             printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3833                    xmlMemBlocks() - mem_base);
3834             test_ret++;
3835             printf("\n");
3836         }
3837     function_tests++;
3838
3839     return(test_ret);
3840 }
3841
3842
3843 #define gen_nb_xmlEnumerationPtr 1
3844 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3845     return(NULL);
3846 }
3847 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3848 }
3849
3850 static int
3851 test_xmlSAX2AttributeDecl(void) {
3852     int test_ret = 0;
3853
3854     int mem_base;
3855     void * ctx; /* the user data (XML parser context) */
3856     int n_ctx;
3857     xmlChar * elem; /* the name of the element */
3858     int n_elem;
3859     xmlChar * fullname; /* the attribute name */
3860     int n_fullname;
3861     int type; /* the attribute type */
3862     int n_type;
3863     int def; /* the type of default value */
3864     int n_def;
3865     xmlChar * defaultValue; /* the attribute default value */
3866     int n_defaultValue;
3867     xmlEnumerationPtr tree; /* the tree of enumerated value set */
3868     int n_tree;
3869
3870     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3871     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3872     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3873     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3874     for (n_def = 0;n_def < gen_nb_int;n_def++) {
3875     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3876     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3877         mem_base = xmlMemBlocks();
3878         ctx = gen_void_ptr(n_ctx, 0);
3879         elem = gen_const_xmlChar_ptr(n_elem, 1);
3880         fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3881         type = gen_int(n_type, 3);
3882         def = gen_int(n_def, 4);
3883         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3884         tree = gen_xmlEnumerationPtr(n_tree, 6);
3885
3886         xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3887         call_tests++;
3888         des_void_ptr(n_ctx, ctx, 0);
3889         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3890         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3891         des_int(n_type, type, 3);
3892         des_int(n_def, def, 4);
3893         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3894         des_xmlEnumerationPtr(n_tree, tree, 6);
3895         xmlResetLastError();
3896         if (mem_base != xmlMemBlocks()) {
3897             printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3898                    xmlMemBlocks() - mem_base);
3899             test_ret++;
3900             printf(" %d", n_ctx);
3901             printf(" %d", n_elem);
3902             printf(" %d", n_fullname);
3903             printf(" %d", n_type);
3904             printf(" %d", n_def);
3905             printf(" %d", n_defaultValue);
3906             printf(" %d", n_tree);
3907             printf("\n");
3908         }
3909     }
3910     }
3911     }
3912     }
3913     }
3914     }
3915     }
3916     function_tests++;
3917
3918     return(test_ret);
3919 }
3920
3921
3922 static int
3923 test_xmlSAX2CDataBlock(void) {
3924     int test_ret = 0;
3925
3926     int mem_base;
3927     void * ctx; /* the user data (XML parser context) */
3928     int n_ctx;
3929     xmlChar * value; /* The pcdata content */
3930     int n_value;
3931     int len; /* the block length */
3932     int n_len;
3933
3934     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3935     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3936     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3937         mem_base = xmlMemBlocks();
3938         ctx = gen_void_ptr(n_ctx, 0);
3939         value = gen_const_xmlChar_ptr(n_value, 1);
3940         len = gen_int(n_len, 2);
3941         if ((value != NULL) &&
3942             (len > (int) strlen((const char *) value) + 1))
3943             continue;
3944
3945         xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3946         call_tests++;
3947         des_void_ptr(n_ctx, ctx, 0);
3948         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3949         des_int(n_len, len, 2);
3950         xmlResetLastError();
3951         if (mem_base != xmlMemBlocks()) {
3952             printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3953                    xmlMemBlocks() - mem_base);
3954             test_ret++;
3955             printf(" %d", n_ctx);
3956             printf(" %d", n_value);
3957             printf(" %d", n_len);
3958             printf("\n");
3959         }
3960     }
3961     }
3962     }
3963     function_tests++;
3964
3965     return(test_ret);
3966 }
3967
3968
3969 static int
3970 test_xmlSAX2Characters(void) {
3971     int test_ret = 0;
3972
3973     int mem_base;
3974     void * ctx; /* the user data (XML parser context) */
3975     int n_ctx;
3976     xmlChar * ch; /* a xmlChar string */
3977     int n_ch;
3978     int len; /* the number of xmlChar */
3979     int n_len;
3980
3981     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3982     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3983     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3984         mem_base = xmlMemBlocks();
3985         ctx = gen_void_ptr(n_ctx, 0);
3986         ch = gen_const_xmlChar_ptr(n_ch, 1);
3987         len = gen_int(n_len, 2);
3988         if ((ch != NULL) &&
3989             (len > (int) strlen((const char *) ch) + 1))
3990             continue;
3991
3992         xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3993         call_tests++;
3994         des_void_ptr(n_ctx, ctx, 0);
3995         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3996         des_int(n_len, len, 2);
3997         xmlResetLastError();
3998         if (mem_base != xmlMemBlocks()) {
3999             printf("Leak of %d blocks found in xmlSAX2Characters",
4000                    xmlMemBlocks() - mem_base);
4001             test_ret++;
4002             printf(" %d", n_ctx);
4003             printf(" %d", n_ch);
4004             printf(" %d", n_len);
4005             printf("\n");
4006         }
4007     }
4008     }
4009     }
4010     function_tests++;
4011
4012     return(test_ret);
4013 }
4014
4015
4016 static int
4017 test_xmlSAX2Comment(void) {
4018     int test_ret = 0;
4019
4020     int mem_base;
4021     void * ctx; /* the user data (XML parser context) */
4022     int n_ctx;
4023     xmlChar * value; /* the xmlSAX2Comment content */
4024     int n_value;
4025
4026     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4027     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
4028         mem_base = xmlMemBlocks();
4029         ctx = gen_void_ptr(n_ctx, 0);
4030         value = gen_const_xmlChar_ptr(n_value, 1);
4031
4032         xmlSAX2Comment(ctx, (const xmlChar *)value);
4033         call_tests++;
4034         des_void_ptr(n_ctx, ctx, 0);
4035         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
4036         xmlResetLastError();
4037         if (mem_base != xmlMemBlocks()) {
4038             printf("Leak of %d blocks found in xmlSAX2Comment",
4039                    xmlMemBlocks() - mem_base);
4040             test_ret++;
4041             printf(" %d", n_ctx);
4042             printf(" %d", n_value);
4043             printf("\n");
4044         }
4045     }
4046     }
4047     function_tests++;
4048
4049     return(test_ret);
4050 }
4051
4052
4053 static int
4054 test_xmlSAX2ElementDecl(void) {
4055     int test_ret = 0;
4056
4057     int mem_base;
4058     void * ctx; /* the user data (XML parser context) */
4059     int n_ctx;
4060     xmlChar * name; /* the element name */
4061     int n_name;
4062     int type; /* the element type */
4063     int n_type;
4064     xmlElementContentPtr content; /* the element value tree */
4065     int n_content;
4066
4067     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4068     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4069     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4070     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4071         mem_base = xmlMemBlocks();
4072         ctx = gen_void_ptr(n_ctx, 0);
4073         name = gen_const_xmlChar_ptr(n_name, 1);
4074         type = gen_int(n_type, 2);
4075         content = gen_xmlElementContentPtr(n_content, 3);
4076
4077         xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4078         call_tests++;
4079         des_void_ptr(n_ctx, ctx, 0);
4080         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4081         des_int(n_type, type, 2);
4082         des_xmlElementContentPtr(n_content, content, 3);
4083         xmlResetLastError();
4084         if (mem_base != xmlMemBlocks()) {
4085             printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4086                    xmlMemBlocks() - mem_base);
4087             test_ret++;
4088             printf(" %d", n_ctx);
4089             printf(" %d", n_name);
4090             printf(" %d", n_type);
4091             printf(" %d", n_content);
4092             printf("\n");
4093         }
4094     }
4095     }
4096     }
4097     }
4098     function_tests++;
4099
4100     return(test_ret);
4101 }
4102
4103
4104 static int
4105 test_xmlSAX2EndDocument(void) {
4106     int test_ret = 0;
4107
4108     int mem_base;
4109     void * ctx; /* the user data (XML parser context) */
4110     int n_ctx;
4111
4112     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4113         mem_base = xmlMemBlocks();
4114         ctx = gen_void_ptr(n_ctx, 0);
4115
4116         xmlSAX2EndDocument(ctx);
4117         call_tests++;
4118         des_void_ptr(n_ctx, ctx, 0);
4119         xmlResetLastError();
4120         if (mem_base != xmlMemBlocks()) {
4121             printf("Leak of %d blocks found in xmlSAX2EndDocument",
4122                    xmlMemBlocks() - mem_base);
4123             test_ret++;
4124             printf(" %d", n_ctx);
4125             printf("\n");
4126         }
4127     }
4128     function_tests++;
4129
4130     return(test_ret);
4131 }
4132
4133
4134 static int
4135 test_xmlSAX2EndElement(void) {
4136     int test_ret = 0;
4137
4138 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
4139 #ifdef LIBXML_SAX1_ENABLED
4140     int mem_base;
4141     void * ctx; /* the user data (XML parser context) */
4142     int n_ctx;
4143     xmlChar * name; /* The element name */
4144     int n_name;
4145
4146     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4147     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4148         mem_base = xmlMemBlocks();
4149         ctx = gen_void_ptr(n_ctx, 0);
4150         name = gen_const_xmlChar_ptr(n_name, 1);
4151
4152         xmlSAX2EndElement(ctx, (const xmlChar *)name);
4153         call_tests++;
4154         des_void_ptr(n_ctx, ctx, 0);
4155         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4156         xmlResetLastError();
4157         if (mem_base != xmlMemBlocks()) {
4158             printf("Leak of %d blocks found in xmlSAX2EndElement",
4159                    xmlMemBlocks() - mem_base);
4160             test_ret++;
4161             printf(" %d", n_ctx);
4162             printf(" %d", n_name);
4163             printf("\n");
4164         }
4165     }
4166     }
4167     function_tests++;
4168 #endif
4169 #endif
4170
4171     return(test_ret);
4172 }
4173
4174
4175 static int
4176 test_xmlSAX2EndElementNs(void) {
4177     int test_ret = 0;
4178
4179     int mem_base;
4180     void * ctx; /* the user data (XML parser context) */
4181     int n_ctx;
4182     xmlChar * localname; /* the local name of the element */
4183     int n_localname;
4184     xmlChar * prefix; /* the element namespace prefix if available */
4185     int n_prefix;
4186     xmlChar * URI; /* the element namespace name if available */
4187     int n_URI;
4188
4189     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4190     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4191     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4192     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4193         mem_base = xmlMemBlocks();
4194         ctx = gen_void_ptr(n_ctx, 0);
4195         localname = gen_const_xmlChar_ptr(n_localname, 1);
4196         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4197         URI = gen_const_xmlChar_ptr(n_URI, 3);
4198
4199         xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4200         call_tests++;
4201         des_void_ptr(n_ctx, ctx, 0);
4202         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4203         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4204         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4205         xmlResetLastError();
4206         if (mem_base != xmlMemBlocks()) {
4207             printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4208                    xmlMemBlocks() - mem_base);
4209             test_ret++;
4210             printf(" %d", n_ctx);
4211             printf(" %d", n_localname);
4212             printf(" %d", n_prefix);
4213             printf(" %d", n_URI);
4214             printf("\n");
4215         }
4216     }
4217     }
4218     }
4219     }
4220     function_tests++;
4221
4222     return(test_ret);
4223 }
4224
4225
4226 static int
4227 test_xmlSAX2EntityDecl(void) {
4228     int test_ret = 0;
4229
4230     int mem_base;
4231     void * ctx; /* the user data (XML parser context) */
4232     int n_ctx;
4233     xmlChar * name; /* the entity name */
4234     int n_name;
4235     int type; /* the entity type */
4236     int n_type;
4237     xmlChar * publicId; /* The public ID of the entity */
4238     int n_publicId;
4239     xmlChar * systemId; /* The system ID of the entity */
4240     int n_systemId;
4241     xmlChar * content; /* the entity value (without processing). */
4242     int n_content;
4243
4244     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4245     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4246     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4247     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4248     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4249     for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4250         mem_base = xmlMemBlocks();
4251         ctx = gen_void_ptr(n_ctx, 0);
4252         name = gen_const_xmlChar_ptr(n_name, 1);
4253         type = gen_int(n_type, 2);
4254         publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4255         systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4256         content = gen_xmlChar_ptr(n_content, 5);
4257
4258         xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4259         call_tests++;
4260         des_void_ptr(n_ctx, ctx, 0);
4261         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4262         des_int(n_type, type, 2);
4263         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4264         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4265         des_xmlChar_ptr(n_content, content, 5);
4266         xmlResetLastError();
4267         if (mem_base != xmlMemBlocks()) {
4268             printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4269                    xmlMemBlocks() - mem_base);
4270             test_ret++;
4271             printf(" %d", n_ctx);
4272             printf(" %d", n_name);
4273             printf(" %d", n_type);
4274             printf(" %d", n_publicId);
4275             printf(" %d", n_systemId);
4276             printf(" %d", n_content);
4277             printf("\n");
4278         }
4279     }
4280     }
4281     }
4282     }
4283     }
4284     }
4285     function_tests++;
4286
4287     return(test_ret);
4288 }
4289
4290
4291 static int
4292 test_xmlSAX2ExternalSubset(void) {
4293     int test_ret = 0;
4294
4295     int mem_base;
4296     void * ctx; /* the user data (XML parser context) */
4297     int n_ctx;
4298     xmlChar * name; /* the root element name */
4299     int n_name;
4300     xmlChar * ExternalID; /* the external ID */
4301     int n_ExternalID;
4302     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4303     int n_SystemID;
4304
4305     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4306     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4307     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4308     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4309         mem_base = xmlMemBlocks();
4310         ctx = gen_void_ptr(n_ctx, 0);
4311         name = gen_const_xmlChar_ptr(n_name, 1);
4312         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4313         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4314
4315         xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4316         call_tests++;
4317         des_void_ptr(n_ctx, ctx, 0);
4318         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4319         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4320         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4321         xmlResetLastError();
4322         if (mem_base != xmlMemBlocks()) {
4323             printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4324                    xmlMemBlocks() - mem_base);
4325             test_ret++;
4326             printf(" %d", n_ctx);
4327             printf(" %d", n_name);
4328             printf(" %d", n_ExternalID);
4329             printf(" %d", n_SystemID);
4330             printf("\n");
4331         }
4332     }
4333     }
4334     }
4335     }
4336     function_tests++;
4337
4338     return(test_ret);
4339 }
4340
4341
4342 static int
4343 test_xmlSAX2GetColumnNumber(void) {
4344     int test_ret = 0;
4345
4346     int mem_base;
4347     int ret_val;
4348     void * ctx; /* the user data (XML parser context) */
4349     int n_ctx;
4350
4351     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4352         mem_base = xmlMemBlocks();
4353         ctx = gen_void_ptr(n_ctx, 0);
4354
4355         ret_val = xmlSAX2GetColumnNumber(ctx);
4356         desret_int(ret_val);
4357         call_tests++;
4358         des_void_ptr(n_ctx, ctx, 0);
4359         xmlResetLastError();
4360         if (mem_base != xmlMemBlocks()) {
4361             printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4362                    xmlMemBlocks() - mem_base);
4363             test_ret++;
4364             printf(" %d", n_ctx);
4365             printf("\n");
4366         }
4367     }
4368     function_tests++;
4369
4370     return(test_ret);
4371 }
4372
4373
4374 static int
4375 test_xmlSAX2GetEntity(void) {
4376     int test_ret = 0;
4377
4378     int mem_base;
4379     xmlEntityPtr ret_val;
4380     void * ctx; /* the user data (XML parser context) */
4381     int n_ctx;
4382     xmlChar * name; /* The entity name */
4383     int n_name;
4384
4385     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4386     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4387         mem_base = xmlMemBlocks();
4388         ctx = gen_void_ptr(n_ctx, 0);
4389         name = gen_const_xmlChar_ptr(n_name, 1);
4390
4391         ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4392         desret_xmlEntityPtr(ret_val);
4393         call_tests++;
4394         des_void_ptr(n_ctx, ctx, 0);
4395         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4396         xmlResetLastError();
4397         if (mem_base != xmlMemBlocks()) {
4398             printf("Leak of %d blocks found in xmlSAX2GetEntity",
4399                    xmlMemBlocks() - mem_base);
4400             test_ret++;
4401             printf(" %d", n_ctx);
4402             printf(" %d", n_name);
4403             printf("\n");
4404         }
4405     }
4406     }
4407     function_tests++;
4408
4409     return(test_ret);
4410 }
4411
4412
4413 static int
4414 test_xmlSAX2GetLineNumber(void) {
4415     int test_ret = 0;
4416
4417     int mem_base;
4418     int ret_val;
4419     void * ctx; /* the user data (XML parser context) */
4420     int n_ctx;
4421
4422     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4423         mem_base = xmlMemBlocks();
4424         ctx = gen_void_ptr(n_ctx, 0);
4425
4426         ret_val = xmlSAX2GetLineNumber(ctx);
4427         desret_int(ret_val);
4428         call_tests++;
4429         des_void_ptr(n_ctx, ctx, 0);
4430         xmlResetLastError();
4431         if (mem_base != xmlMemBlocks()) {
4432             printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4433                    xmlMemBlocks() - mem_base);
4434             test_ret++;
4435             printf(" %d", n_ctx);
4436             printf("\n");
4437         }
4438     }
4439     function_tests++;
4440
4441     return(test_ret);
4442 }
4443
4444
4445 static int
4446 test_xmlSAX2GetParameterEntity(void) {
4447     int test_ret = 0;
4448
4449     int mem_base;
4450     xmlEntityPtr ret_val;
4451     void * ctx; /* the user data (XML parser context) */
4452     int n_ctx;
4453     xmlChar * name; /* The entity name */
4454     int n_name;
4455
4456     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4457     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4458         mem_base = xmlMemBlocks();
4459         ctx = gen_void_ptr(n_ctx, 0);
4460         name = gen_const_xmlChar_ptr(n_name, 1);
4461
4462         ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4463         desret_xmlEntityPtr(ret_val);
4464         call_tests++;
4465         des_void_ptr(n_ctx, ctx, 0);
4466         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4467         xmlResetLastError();
4468         if (mem_base != xmlMemBlocks()) {
4469             printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4470                    xmlMemBlocks() - mem_base);
4471             test_ret++;
4472             printf(" %d", n_ctx);
4473             printf(" %d", n_name);
4474             printf("\n");
4475         }
4476     }
4477     }
4478     function_tests++;
4479
4480     return(test_ret);
4481 }
4482
4483
4484 static int
4485 test_xmlSAX2GetPublicId(void) {
4486     int test_ret = 0;
4487
4488     int mem_base;
4489     const xmlChar * ret_val;
4490     void * ctx; /* the user data (XML parser context) */
4491     int n_ctx;
4492
4493     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4494         mem_base = xmlMemBlocks();
4495         ctx = gen_void_ptr(n_ctx, 0);
4496
4497         ret_val = xmlSAX2GetPublicId(ctx);
4498         desret_const_xmlChar_ptr(ret_val);
4499         call_tests++;
4500         des_void_ptr(n_ctx, ctx, 0);
4501         xmlResetLastError();
4502         if (mem_base != xmlMemBlocks()) {
4503             printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4504                    xmlMemBlocks() - mem_base);
4505             test_ret++;
4506             printf(" %d", n_ctx);
4507             printf("\n");
4508         }
4509     }
4510     function_tests++;
4511
4512     return(test_ret);
4513 }
4514
4515
4516 static int
4517 test_xmlSAX2GetSystemId(void) {
4518     int test_ret = 0;
4519
4520     int mem_base;
4521     const xmlChar * ret_val;
4522     void * ctx; /* the user data (XML parser context) */
4523     int n_ctx;
4524
4525     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4526         mem_base = xmlMemBlocks();
4527         ctx = gen_void_ptr(n_ctx, 0);
4528
4529         ret_val = xmlSAX2GetSystemId(ctx);
4530         desret_const_xmlChar_ptr(ret_val);
4531         call_tests++;
4532         des_void_ptr(n_ctx, ctx, 0);
4533         xmlResetLastError();
4534         if (mem_base != xmlMemBlocks()) {
4535             printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4536                    xmlMemBlocks() - mem_base);
4537             test_ret++;
4538             printf(" %d", n_ctx);
4539             printf("\n");
4540         }
4541     }
4542     function_tests++;
4543
4544     return(test_ret);
4545 }
4546
4547
4548 static int
4549 test_xmlSAX2HasExternalSubset(void) {
4550     int test_ret = 0;
4551
4552     int mem_base;
4553     int ret_val;
4554     void * ctx; /* the user data (XML parser context) */
4555     int n_ctx;
4556
4557     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4558         mem_base = xmlMemBlocks();
4559         ctx = gen_void_ptr(n_ctx, 0);
4560
4561         ret_val = xmlSAX2HasExternalSubset(ctx);
4562         desret_int(ret_val);
4563         call_tests++;
4564         des_void_ptr(n_ctx, ctx, 0);
4565         xmlResetLastError();
4566         if (mem_base != xmlMemBlocks()) {
4567             printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4568                    xmlMemBlocks() - mem_base);
4569             test_ret++;
4570             printf(" %d", n_ctx);
4571             printf("\n");
4572         }
4573     }
4574     function_tests++;
4575
4576     return(test_ret);
4577 }
4578
4579
4580 static int
4581 test_xmlSAX2HasInternalSubset(void) {
4582     int test_ret = 0;
4583
4584     int mem_base;
4585     int ret_val;
4586     void * ctx; /* the user data (XML parser context) */
4587     int n_ctx;
4588
4589     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4590         mem_base = xmlMemBlocks();
4591         ctx = gen_void_ptr(n_ctx, 0);
4592
4593         ret_val = xmlSAX2HasInternalSubset(ctx);
4594         desret_int(ret_val);
4595         call_tests++;
4596         des_void_ptr(n_ctx, ctx, 0);
4597         xmlResetLastError();
4598         if (mem_base != xmlMemBlocks()) {
4599             printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4600                    xmlMemBlocks() - mem_base);
4601             test_ret++;
4602             printf(" %d", n_ctx);
4603             printf("\n");
4604         }
4605     }
4606     function_tests++;
4607
4608     return(test_ret);
4609 }
4610
4611
4612 static int
4613 test_xmlSAX2IgnorableWhitespace(void) {
4614     int test_ret = 0;
4615
4616     int mem_base;
4617     void * ctx; /* the user data (XML parser context) */
4618     int n_ctx;
4619     xmlChar * ch; /* a xmlChar string */
4620     int n_ch;
4621     int len; /* the number of xmlChar */
4622     int n_len;
4623
4624     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4625     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4626     for (n_len = 0;n_len < gen_nb_int;n_len++) {
4627         mem_base = xmlMemBlocks();
4628         ctx = gen_void_ptr(n_ctx, 0);
4629         ch = gen_const_xmlChar_ptr(n_ch, 1);
4630         len = gen_int(n_len, 2);
4631         if ((ch != NULL) &&
4632             (len > (int) strlen((const char *) ch) + 1))
4633             continue;
4634
4635         xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4636         call_tests++;
4637         des_void_ptr(n_ctx, ctx, 0);
4638         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4639         des_int(n_len, len, 2);
4640         xmlResetLastError();
4641         if (mem_base != xmlMemBlocks()) {
4642             printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4643                    xmlMemBlocks() - mem_base);
4644             test_ret++;
4645             printf(" %d", n_ctx);
4646             printf(" %d", n_ch);
4647             printf(" %d", n_len);
4648             printf("\n");
4649         }
4650     }
4651     }
4652     }
4653     function_tests++;
4654
4655     return(test_ret);
4656 }
4657
4658
4659 #define gen_nb_xmlSAXHandler_ptr 1
4660 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4661     return(NULL);
4662 }
4663 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4664 }
4665
4666 static int
4667 test_xmlSAX2InitDefaultSAXHandler(void) {
4668     int test_ret = 0;
4669
4670     int mem_base;
4671     xmlSAXHandler * hdlr; /* the SAX handler */
4672     int n_hdlr;
4673     int warning; /* flag if non-zero sets the handler warning procedure */
4674     int n_warning;
4675
4676     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4677     for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4678         mem_base = xmlMemBlocks();
4679         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4680         warning = gen_int(n_warning, 1);
4681
4682         xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4683         call_tests++;
4684         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4685         des_int(n_warning, warning, 1);
4686         xmlResetLastError();
4687         if (mem_base != xmlMemBlocks()) {
4688             printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4689                    xmlMemBlocks() - mem_base);
4690             test_ret++;
4691             printf(" %d", n_hdlr);
4692             printf(" %d", n_warning);
4693             printf("\n");
4694         }
4695     }
4696     }
4697     function_tests++;
4698
4699     return(test_ret);
4700 }
4701
4702
4703 static int
4704 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4705     int test_ret = 0;
4706
4707 #if defined(LIBXML_DOCB_ENABLED)
4708     int mem_base;
4709     xmlSAXHandler * hdlr; /* the SAX handler */
4710     int n_hdlr;
4711
4712     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4713         mem_base = xmlMemBlocks();
4714         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4715
4716         xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4717         call_tests++;
4718         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4719         xmlResetLastError();
4720         if (mem_base != xmlMemBlocks()) {
4721             printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4722                    xmlMemBlocks() - mem_base);
4723             test_ret++;
4724             printf(" %d", n_hdlr);
4725             printf("\n");
4726         }
4727     }
4728     function_tests++;
4729 #endif
4730
4731     return(test_ret);
4732 }
4733
4734
4735 static int
4736 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4737     int test_ret = 0;
4738
4739 #if defined(LIBXML_HTML_ENABLED)
4740     int mem_base;
4741     xmlSAXHandler * hdlr; /* the SAX handler */
4742     int n_hdlr;
4743
4744     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4745         mem_base = xmlMemBlocks();
4746         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4747
4748         xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4749         call_tests++;
4750         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4751         xmlResetLastError();
4752         if (mem_base != xmlMemBlocks()) {
4753             printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4754                    xmlMemBlocks() - mem_base);
4755             test_ret++;
4756             printf(" %d", n_hdlr);
4757             printf("\n");
4758         }
4759     }
4760     function_tests++;
4761 #endif
4762
4763     return(test_ret);
4764 }
4765
4766
4767 static int
4768 test_xmlSAX2InternalSubset(void) {
4769     int test_ret = 0;
4770
4771     int mem_base;
4772     void * ctx; /* the user data (XML parser context) */
4773     int n_ctx;
4774     xmlChar * name; /* the root element name */
4775     int n_name;
4776     xmlChar * ExternalID; /* the external ID */
4777     int n_ExternalID;
4778     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4779     int n_SystemID;
4780
4781     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4782     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4783     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4784     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4785         mem_base = xmlMemBlocks();
4786         ctx = gen_void_ptr(n_ctx, 0);
4787         name = gen_const_xmlChar_ptr(n_name, 1);
4788         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4789         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4790
4791         xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4792         call_tests++;
4793         des_void_ptr(n_ctx, ctx, 0);
4794         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4795         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4796         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4797         xmlResetLastError();
4798         if (mem_base != xmlMemBlocks()) {
4799             printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4800                    xmlMemBlocks() - mem_base);
4801             test_ret++;
4802             printf(" %d", n_ctx);
4803             printf(" %d", n_name);
4804             printf(" %d", n_ExternalID);
4805             printf(" %d", n_SystemID);
4806             printf("\n");
4807         }
4808     }
4809     }
4810     }
4811     }
4812     function_tests++;
4813
4814     return(test_ret);
4815 }
4816
4817
4818 static int
4819 test_xmlSAX2IsStandalone(void) {
4820     int test_ret = 0;
4821
4822     int mem_base;
4823     int ret_val;
4824     void * ctx; /* the user data (XML parser context) */
4825     int n_ctx;
4826
4827     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4828         mem_base = xmlMemBlocks();
4829         ctx = gen_void_ptr(n_ctx, 0);
4830
4831         ret_val = xmlSAX2IsStandalone(ctx);
4832         desret_int(ret_val);
4833         call_tests++;
4834         des_void_ptr(n_ctx, ctx, 0);
4835         xmlResetLastError();
4836         if (mem_base != xmlMemBlocks()) {
4837             printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4838                    xmlMemBlocks() - mem_base);
4839             test_ret++;
4840             printf(" %d", n_ctx);
4841             printf("\n");
4842         }
4843     }
4844     function_tests++;
4845
4846     return(test_ret);
4847 }
4848
4849
4850 static int
4851 test_xmlSAX2NotationDecl(void) {
4852     int test_ret = 0;
4853
4854     int mem_base;
4855     void * ctx; /* the user data (XML parser context) */
4856     int n_ctx;
4857     xmlChar * name; /* The name of the notation */
4858     int n_name;
4859     xmlChar * publicId; /* The public ID of the entity */
4860     int n_publicId;
4861     xmlChar * systemId; /* The system ID of the entity */
4862     int n_systemId;
4863
4864     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4865     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4866     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4867     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4868         mem_base = xmlMemBlocks();
4869         ctx = gen_void_ptr(n_ctx, 0);
4870         name = gen_const_xmlChar_ptr(n_name, 1);
4871         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4872         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4873
4874         xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4875         call_tests++;
4876         des_void_ptr(n_ctx, ctx, 0);
4877         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4878         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4879         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4880         xmlResetLastError();
4881         if (mem_base != xmlMemBlocks()) {
4882             printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4883                    xmlMemBlocks() - mem_base);
4884             test_ret++;
4885             printf(" %d", n_ctx);
4886             printf(" %d", n_name);
4887             printf(" %d", n_publicId);
4888             printf(" %d", n_systemId);
4889             printf("\n");
4890         }
4891     }
4892     }
4893     }
4894     }
4895     function_tests++;
4896
4897     return(test_ret);
4898 }
4899
4900
4901 static int
4902 test_xmlSAX2ProcessingInstruction(void) {
4903     int test_ret = 0;
4904
4905     int mem_base;
4906     void * ctx; /* the user data (XML parser context) */
4907     int n_ctx;
4908     xmlChar * target; /* the target name */
4909     int n_target;
4910     xmlChar * data; /* the PI data's */
4911     int n_data;
4912
4913     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4914     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4915     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4916         mem_base = xmlMemBlocks();
4917         ctx = gen_void_ptr(n_ctx, 0);
4918         target = gen_const_xmlChar_ptr(n_target, 1);
4919         data = gen_const_xmlChar_ptr(n_data, 2);
4920
4921         xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4922         call_tests++;
4923         des_void_ptr(n_ctx, ctx, 0);
4924         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4925         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4926         xmlResetLastError();
4927         if (mem_base != xmlMemBlocks()) {
4928             printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4929                    xmlMemBlocks() - mem_base);
4930             test_ret++;
4931             printf(" %d", n_ctx);
4932             printf(" %d", n_target);
4933             printf(" %d", n_data);
4934             printf("\n");
4935         }
4936     }
4937     }
4938     }
4939     function_tests++;
4940
4941     return(test_ret);
4942 }
4943
4944
4945 static int
4946 test_xmlSAX2Reference(void) {
4947     int test_ret = 0;
4948
4949     int mem_base;
4950     void * ctx; /* the user data (XML parser context) */
4951     int n_ctx;
4952     xmlChar * name; /* The entity name */
4953     int n_name;
4954
4955     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4956     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4957         mem_base = xmlMemBlocks();
4958         ctx = gen_void_ptr(n_ctx, 0);
4959         name = gen_const_xmlChar_ptr(n_name, 1);
4960
4961         xmlSAX2Reference(ctx, (const xmlChar *)name);
4962         call_tests++;
4963         des_void_ptr(n_ctx, ctx, 0);
4964         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4965         xmlResetLastError();
4966         if (mem_base != xmlMemBlocks()) {
4967             printf("Leak of %d blocks found in xmlSAX2Reference",
4968                    xmlMemBlocks() - mem_base);
4969             test_ret++;
4970             printf(" %d", n_ctx);
4971             printf(" %d", n_name);
4972             printf("\n");
4973         }
4974     }
4975     }
4976     function_tests++;
4977
4978     return(test_ret);
4979 }
4980
4981
4982 static int
4983 test_xmlSAX2ResolveEntity(void) {
4984     int test_ret = 0;
4985
4986     int mem_base;
4987     xmlParserInputPtr ret_val;
4988     void * ctx; /* the user data (XML parser context) */
4989     int n_ctx;
4990     xmlChar * publicId; /* The public ID of the entity */
4991     int n_publicId;
4992     xmlChar * systemId; /* The system ID of the entity */
4993     int n_systemId;
4994
4995     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4996     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4997     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4998         mem_base = xmlMemBlocks();
4999         ctx = gen_void_ptr(n_ctx, 0);
5000         publicId = gen_const_xmlChar_ptr(n_publicId, 1);
5001         systemId = gen_const_xmlChar_ptr(n_systemId, 2);
5002
5003         ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
5004         desret_xmlParserInputPtr(ret_val);
5005         call_tests++;
5006         des_void_ptr(n_ctx, ctx, 0);
5007         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
5008         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
5009         xmlResetLastError();
5010         if (mem_base != xmlMemBlocks()) {
5011             printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
5012                    xmlMemBlocks() - mem_base);
5013             test_ret++;
5014             printf(" %d", n_ctx);
5015             printf(" %d", n_publicId);
5016             printf(" %d", n_systemId);
5017             printf("\n");
5018         }
5019     }
5020     }
5021     }
5022     function_tests++;
5023
5024     return(test_ret);
5025 }
5026
5027
5028 #define gen_nb_xmlSAXLocatorPtr 1
5029 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5030     return(NULL);
5031 }
5032 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5033 }
5034
5035 static int
5036 test_xmlSAX2SetDocumentLocator(void) {
5037     int test_ret = 0;
5038
5039     int mem_base;
5040     void * ctx; /* the user data (XML parser context) */
5041     int n_ctx;
5042     xmlSAXLocatorPtr loc; /* A SAX Locator */
5043     int n_loc;
5044
5045     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5046     for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
5047         mem_base = xmlMemBlocks();
5048         ctx = gen_void_ptr(n_ctx, 0);
5049         loc = gen_xmlSAXLocatorPtr(n_loc, 1);
5050
5051         xmlSAX2SetDocumentLocator(ctx, loc);
5052         call_tests++;
5053         des_void_ptr(n_ctx, ctx, 0);
5054         des_xmlSAXLocatorPtr(n_loc, loc, 1);
5055         xmlResetLastError();
5056         if (mem_base != xmlMemBlocks()) {
5057             printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
5058                    xmlMemBlocks() - mem_base);
5059             test_ret++;
5060             printf(" %d", n_ctx);
5061             printf(" %d", n_loc);
5062             printf("\n");
5063         }
5064     }
5065     }
5066     function_tests++;
5067
5068     return(test_ret);
5069 }
5070
5071
5072 static int
5073 test_xmlSAX2StartDocument(void) {
5074     int test_ret = 0;
5075
5076     int mem_base;
5077     void * ctx; /* the user data (XML parser context) */
5078     int n_ctx;
5079
5080     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5081         mem_base = xmlMemBlocks();
5082         ctx = gen_void_ptr(n_ctx, 0);
5083
5084         xmlSAX2StartDocument(ctx);
5085         call_tests++;
5086         des_void_ptr(n_ctx, ctx, 0);
5087         xmlResetLastError();
5088         if (mem_base != xmlMemBlocks()) {
5089             printf("Leak of %d blocks found in xmlSAX2StartDocument",
5090                    xmlMemBlocks() - mem_base);
5091             test_ret++;
5092             printf(" %d", n_ctx);
5093             printf("\n");
5094         }
5095     }
5096     function_tests++;
5097
5098     return(test_ret);
5099 }
5100
5101
5102 static int
5103 test_xmlSAX2StartElement(void) {
5104     int test_ret = 0;
5105
5106 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
5107 #ifdef LIBXML_SAX1_ENABLED
5108     int mem_base;
5109     void * ctx; /* the user data (XML parser context) */
5110     int n_ctx;
5111     xmlChar * fullname; /* The element name, including namespace prefix */
5112     int n_fullname;
5113     xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5114     int n_atts;
5115
5116     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5117     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5118     for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5119         mem_base = xmlMemBlocks();
5120         ctx = gen_void_ptr(n_ctx, 0);
5121         fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5122         atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5123
5124         xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5125         call_tests++;
5126         des_void_ptr(n_ctx, ctx, 0);
5127         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5128         des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5129         xmlResetLastError();
5130         if (mem_base != xmlMemBlocks()) {
5131             printf("Leak of %d blocks found in xmlSAX2StartElement",
5132                    xmlMemBlocks() - mem_base);
5133             test_ret++;
5134             printf(" %d", n_ctx);
5135             printf(" %d", n_fullname);
5136             printf(" %d", n_atts);
5137             printf("\n");
5138         }
5139     }
5140     }
5141     }
5142     function_tests++;
5143 #endif
5144 #endif
5145
5146     return(test_ret);
5147 }
5148
5149
5150 static int
5151 test_xmlSAX2StartElementNs(void) {
5152     int test_ret = 0;
5153
5154     int mem_base;
5155     void * ctx; /* the user data (XML parser context) */
5156     int n_ctx;
5157     xmlChar * localname; /* the local name of the element */
5158     int n_localname;
5159     xmlChar * prefix; /* the element namespace prefix if available */
5160     int n_prefix;
5161     xmlChar * URI; /* the element namespace name if available */
5162     int n_URI;
5163     int nb_namespaces; /* number of namespace definitions on that node */
5164     int n_nb_namespaces;
5165     xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5166     int n_namespaces;
5167     int nb_attributes; /* the number of attributes on that node */
5168     int n_nb_attributes;
5169     int nb_defaulted; /* the number of defaulted attributes. */
5170     int n_nb_defaulted;
5171     xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5172     int n_attributes;
5173
5174     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5175     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5176     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5177     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5178     for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5179     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5180     for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5181     for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5182     for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5183         mem_base = xmlMemBlocks();
5184         ctx = gen_void_ptr(n_ctx, 0);
5185         localname = gen_const_xmlChar_ptr(n_localname, 1);
5186         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5187         URI = gen_const_xmlChar_ptr(n_URI, 3);
5188         nb_namespaces = gen_int(n_nb_namespaces, 4);
5189         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5190         nb_attributes = gen_int(n_nb_attributes, 6);
5191         nb_defaulted = gen_int(n_nb_defaulted, 7);
5192         attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5193
5194         xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5195         call_tests++;
5196         des_void_ptr(n_ctx, ctx, 0);
5197         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5198         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5199         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5200         des_int(n_nb_namespaces, nb_namespaces, 4);
5201         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5202         des_int(n_nb_attributes, nb_attributes, 6);
5203         des_int(n_nb_defaulted, nb_defaulted, 7);
5204         des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5205         xmlResetLastError();
5206         if (mem_base != xmlMemBlocks()) {
5207             printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5208                    xmlMemBlocks() - mem_base);
5209             test_ret++;
5210             printf(" %d", n_ctx);
5211             printf(" %d", n_localname);
5212             printf(" %d", n_prefix);
5213             printf(" %d", n_URI);
5214             printf(" %d", n_nb_namespaces);
5215             printf(" %d", n_namespaces);
5216             printf(" %d", n_nb_attributes);
5217             printf(" %d", n_nb_defaulted);
5218             printf(" %d", n_attributes);
5219             printf("\n");
5220         }
5221     }
5222     }
5223     }
5224     }
5225     }
5226     }
5227     }
5228     }
5229     }
5230     function_tests++;
5231
5232     return(test_ret);
5233 }
5234
5235
5236 static int
5237 test_xmlSAX2UnparsedEntityDecl(void) {
5238     int test_ret = 0;
5239
5240     int mem_base;
5241     void * ctx; /* the user data (XML parser context) */
5242     int n_ctx;
5243     xmlChar * name; /* The name of the entity */
5244     int n_name;
5245     xmlChar * publicId; /* The public ID of the entity */
5246     int n_publicId;
5247     xmlChar * systemId; /* The system ID of the entity */
5248     int n_systemId;
5249     xmlChar * notationName; /* the name of the notation */
5250     int n_notationName;
5251
5252     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5253     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5254     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5255     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5256     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5257         mem_base = xmlMemBlocks();
5258         ctx = gen_void_ptr(n_ctx, 0);
5259         name = gen_const_xmlChar_ptr(n_name, 1);
5260         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5261         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5262         notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5263
5264         xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5265         call_tests++;
5266         des_void_ptr(n_ctx, ctx, 0);
5267         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5268         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5269         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5270         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5271         xmlResetLastError();
5272         if (mem_base != xmlMemBlocks()) {
5273             printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5274                    xmlMemBlocks() - mem_base);
5275             test_ret++;
5276             printf(" %d", n_ctx);
5277             printf(" %d", n_name);
5278             printf(" %d", n_publicId);
5279             printf(" %d", n_systemId);
5280             printf(" %d", n_notationName);
5281             printf("\n");
5282         }
5283     }
5284     }
5285     }
5286     }
5287     }
5288     function_tests++;
5289
5290     return(test_ret);
5291 }
5292
5293
5294 static int
5295 test_xmlSAXDefaultVersion(void) {
5296     int test_ret = 0;
5297
5298 #if defined(LIBXML_SAX1_ENABLED)
5299 #ifdef LIBXML_SAX1_ENABLED
5300     int mem_base;
5301     int ret_val;
5302     int version; /* the version, 1 or 2 */
5303     int n_version;
5304
5305     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5306         mem_base = xmlMemBlocks();
5307         version = gen_int(n_version, 0);
5308
5309         ret_val = xmlSAXDefaultVersion(version);
5310         desret_int(ret_val);
5311         call_tests++;
5312         des_int(n_version, version, 0);
5313         xmlResetLastError();
5314         if (mem_base != xmlMemBlocks()) {
5315             printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5316                    xmlMemBlocks() - mem_base);
5317             test_ret++;
5318             printf(" %d", n_version);
5319             printf("\n");
5320         }
5321     }
5322     function_tests++;
5323 #endif
5324 #endif
5325
5326     return(test_ret);
5327 }
5328
5329
5330 static int
5331 test_xmlSAXVersion(void) {
5332     int test_ret = 0;
5333
5334     int mem_base;
5335     int ret_val;
5336     xmlSAXHandler * hdlr; /* the SAX handler */
5337     int n_hdlr;
5338     int version; /* the version, 1 or 2 */
5339     int n_version;
5340
5341     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5342     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5343         mem_base = xmlMemBlocks();
5344         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5345         version = gen_int(n_version, 1);
5346
5347         ret_val = xmlSAXVersion(hdlr, version);
5348         desret_int(ret_val);
5349         call_tests++;
5350         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5351         des_int(n_version, version, 1);
5352         xmlResetLastError();
5353         if (mem_base != xmlMemBlocks()) {
5354             printf("Leak of %d blocks found in xmlSAXVersion",
5355                    xmlMemBlocks() - mem_base);
5356             test_ret++;
5357             printf(" %d", n_hdlr);
5358             printf(" %d", n_version);
5359             printf("\n");
5360         }
5361     }
5362     }
5363     function_tests++;
5364
5365     return(test_ret);
5366 }
5367
5368 static int
5369 test_SAX2(void) {
5370     int test_ret = 0;
5371         int rc = 0;
5372
5373     if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5374     rc = test_docbDefaultSAXHandlerInit();
5375         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5376     rc = test_htmlDefaultSAXHandlerInit();
5377         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5378     rc = test_xmlDefaultSAXHandlerInit();
5379         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5380     rc = test_xmlSAX2AttributeDecl();
5381         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5382     rc = test_xmlSAX2CDataBlock();
5383         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5384     rc = test_xmlSAX2Characters();
5385         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5386     rc = test_xmlSAX2Comment();
5387         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5388     rc = test_xmlSAX2ElementDecl();
5389         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5390     rc = test_xmlSAX2EndDocument();
5391         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5392     rc = test_xmlSAX2EndElement();
5393         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5394     rc = test_xmlSAX2EndElementNs();
5395         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5396     rc = test_xmlSAX2EntityDecl();
5397         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5398     rc = test_xmlSAX2ExternalSubset();
5399         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5400     rc = test_xmlSAX2GetColumnNumber();
5401         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5402     rc = test_xmlSAX2GetEntity();
5403         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5404     rc = test_xmlSAX2GetLineNumber();
5405         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5406     rc = test_xmlSAX2GetParameterEntity();
5407         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5408     rc = test_xmlSAX2GetPublicId();
5409         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5410     rc = test_xmlSAX2GetSystemId();
5411         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5412     rc = test_xmlSAX2HasExternalSubset();
5413         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5414     rc = test_xmlSAX2HasInternalSubset();
5415         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5416     rc = test_xmlSAX2IgnorableWhitespace();
5417         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5418     rc = test_xmlSAX2InitDefaultSAXHandler();
5419         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5420     rc = test_xmlSAX2InitDocbDefaultSAXHandler();
5421         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5422     rc = test_xmlSAX2InitHtmlDefaultSAXHandler();
5423         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5424     rc = test_xmlSAX2InternalSubset();
5425         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5426     rc = test_xmlSAX2IsStandalone();
5427         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5428     rc = test_xmlSAX2NotationDecl();
5429         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5430     rc = test_xmlSAX2ProcessingInstruction();
5431         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5432     rc = test_xmlSAX2Reference();
5433         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5434     rc = test_xmlSAX2ResolveEntity();
5435         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5436     rc = test_xmlSAX2SetDocumentLocator();
5437         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5438     rc = test_xmlSAX2StartDocument();
5439         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5440     rc = test_xmlSAX2StartElement();
5441         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5442     rc = test_xmlSAX2StartElementNs();
5443         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5444     rc = test_xmlSAX2UnparsedEntityDecl();
5445         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5446     rc = test_xmlSAXDefaultVersion();
5447         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5448     rc = test_xmlSAXVersion();
5449
5450     if (test_ret != 0)
5451         printf("Module SAX2: %d errors\n", test_ret);
5452     return(test_ret);
5453 }
5454
5455 static int
5456 test_xmlC14NDocDumpMemory(void) {
5457     int test_ret = 0;
5458
5459 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5460     int mem_base;
5461     int ret_val;
5462     xmlDocPtr doc; /* the XML document for canonization */
5463     int n_doc;
5464     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5465     int n_nodes;
5466     int mode; /* the c14n mode (see @xmlC14NMode) */
5467     int n_mode;
5468     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) */
5469     int n_inclusive_ns_prefixes;
5470     int with_comments; /* include comments in the result (!=0) or not (==0) */
5471     int n_with_comments;
5472     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 */
5473     int n_doc_txt_ptr;
5474
5475     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5476     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5477     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5478     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5479     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5480     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5481         mem_base = xmlMemBlocks();
5482         doc = gen_xmlDocPtr(n_doc, 0);
5483         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5484         mode = gen_int(n_mode, 2);
5485         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5486         with_comments = gen_int(n_with_comments, 4);
5487         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5488
5489         ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5490         desret_int(ret_val);
5491         call_tests++;
5492         des_xmlDocPtr(n_doc, doc, 0);
5493         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5494         des_int(n_mode, mode, 2);
5495         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5496         des_int(n_with_comments, with_comments, 4);
5497         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5498         xmlResetLastError();
5499         if (mem_base != xmlMemBlocks()) {
5500             printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5501                    xmlMemBlocks() - mem_base);
5502             test_ret++;
5503             printf(" %d", n_doc);
5504             printf(" %d", n_nodes);
5505             printf(" %d", n_mode);
5506             printf(" %d", n_inclusive_ns_prefixes);
5507             printf(" %d", n_with_comments);
5508             printf(" %d", n_doc_txt_ptr);
5509             printf("\n");
5510         }
5511     }
5512     }
5513     }
5514     }
5515     }
5516     }
5517     function_tests++;
5518 #endif
5519
5520     return(test_ret);
5521 }
5522
5523
5524 static int
5525 test_xmlC14NDocSave(void) {
5526     int test_ret = 0;
5527
5528 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5529     int mem_base;
5530     int ret_val;
5531     xmlDocPtr doc; /* the XML document for canonization */
5532     int n_doc;
5533     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5534     int n_nodes;
5535     int mode; /* the c14n mode (see @xmlC14NMode) */
5536     int n_mode;
5537     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) */
5538     int n_inclusive_ns_prefixes;
5539     int with_comments; /* include comments in the result (!=0) or not (==0) */
5540     int n_with_comments;
5541     const char * filename; /* the filename to store canonical XML image */
5542     int n_filename;
5543     int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5544     int n_compression;
5545
5546     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5547     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5548     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5549     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5550     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5551     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5552     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5553         mem_base = xmlMemBlocks();
5554         doc = gen_xmlDocPtr(n_doc, 0);
5555         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5556         mode = gen_int(n_mode, 2);
5557         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5558         with_comments = gen_int(n_with_comments, 4);
5559         filename = gen_fileoutput(n_filename, 5);
5560         compression = gen_int(n_compression, 6);
5561
5562         ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5563         desret_int(ret_val);
5564         call_tests++;
5565         des_xmlDocPtr(n_doc, doc, 0);
5566         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5567         des_int(n_mode, mode, 2);
5568         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5569         des_int(n_with_comments, with_comments, 4);
5570         des_fileoutput(n_filename, filename, 5);
5571         des_int(n_compression, compression, 6);
5572         xmlResetLastError();
5573         if (mem_base != xmlMemBlocks()) {
5574             printf("Leak of %d blocks found in xmlC14NDocSave",
5575                    xmlMemBlocks() - mem_base);
5576             test_ret++;
5577             printf(" %d", n_doc);
5578             printf(" %d", n_nodes);
5579             printf(" %d", n_mode);
5580             printf(" %d", n_inclusive_ns_prefixes);
5581             printf(" %d", n_with_comments);
5582             printf(" %d", n_filename);
5583             printf(" %d", n_compression);
5584             printf("\n");
5585         }
5586     }
5587     }
5588     }
5589     }
5590     }
5591     }
5592     }
5593     function_tests++;
5594 #endif
5595
5596     return(test_ret);
5597 }
5598
5599
5600 static int
5601 test_xmlC14NDocSaveTo(void) {
5602     int test_ret = 0;
5603
5604 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5605     int mem_base;
5606     int ret_val;
5607     xmlDocPtr doc; /* the XML document for canonization */
5608     int n_doc;
5609     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5610     int n_nodes;
5611     int mode; /* the c14n mode (see @xmlC14NMode) */
5612     int n_mode;
5613     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) */
5614     int n_inclusive_ns_prefixes;
5615     int with_comments; /* include comments in the result (!=0) or not (==0) */
5616     int n_with_comments;
5617     xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5618     int n_buf;
5619
5620     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5621     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5622     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5623     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5624     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5625     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5626         mem_base = xmlMemBlocks();
5627         doc = gen_xmlDocPtr(n_doc, 0);
5628         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5629         mode = gen_int(n_mode, 2);
5630         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5631         with_comments = gen_int(n_with_comments, 4);
5632         buf = gen_xmlOutputBufferPtr(n_buf, 5);
5633
5634         ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5635         desret_int(ret_val);
5636         call_tests++;
5637         des_xmlDocPtr(n_doc, doc, 0);
5638         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5639         des_int(n_mode, mode, 2);
5640         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5641         des_int(n_with_comments, with_comments, 4);
5642         des_xmlOutputBufferPtr(n_buf, buf, 5);
5643         xmlResetLastError();
5644         if (mem_base != xmlMemBlocks()) {
5645             printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5646                    xmlMemBlocks() - mem_base);
5647             test_ret++;
5648             printf(" %d", n_doc);
5649             printf(" %d", n_nodes);
5650             printf(" %d", n_mode);
5651             printf(" %d", n_inclusive_ns_prefixes);
5652             printf(" %d", n_with_comments);
5653             printf(" %d", n_buf);
5654             printf("\n");
5655         }
5656     }
5657     }
5658     }
5659     }
5660     }
5661     }
5662     function_tests++;
5663 #endif
5664
5665     return(test_ret);
5666 }
5667
5668
5669 static int
5670 test_xmlC14NExecute(void) {
5671     int test_ret = 0;
5672
5673
5674     /* missing type support */
5675     return(test_ret);
5676 }
5677
5678 static int
5679 test_c14n(void) {
5680     int test_ret = 0;
5681         int rc = 0;
5682
5683     if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5684     rc = test_xmlC14NDocDumpMemory();
5685         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5686     rc = test_xmlC14NDocSave();
5687         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5688     rc = test_xmlC14NDocSaveTo();
5689         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5690     rc = test_xmlC14NExecute();
5691         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
5692
5693     if (test_ret != 0)
5694         printf("Module c14n: %d errors\n", test_ret);
5695     return(test_ret);
5696 }
5697 #ifdef LIBXML_CATALOG_ENABLED
5698
5699 #define gen_nb_xmlCatalogPtr 1
5700 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5701     return(NULL);
5702 }
5703 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5704 }
5705 #endif
5706
5707
5708 static int
5709 test_xmlACatalogAdd(void) {
5710     int test_ret = 0;
5711
5712 #if defined(LIBXML_CATALOG_ENABLED)
5713     int mem_base;
5714     int ret_val;
5715     xmlCatalogPtr catal; /* a Catalog */
5716     int n_catal;
5717     xmlChar * type; /* the type of record to add to the catalog */
5718     int n_type;
5719     xmlChar * orig; /* the system, public or prefix to match */
5720     int n_orig;
5721     xmlChar * replace; /* the replacement value for the match */
5722     int n_replace;
5723
5724     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5725     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5726     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5727     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5728         mem_base = xmlMemBlocks();
5729         catal = gen_xmlCatalogPtr(n_catal, 0);
5730         type = gen_const_xmlChar_ptr(n_type, 1);
5731         orig = gen_const_xmlChar_ptr(n_orig, 2);
5732         replace = gen_const_xmlChar_ptr(n_replace, 3);
5733
5734         ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5735         desret_int(ret_val);
5736         call_tests++;
5737         des_xmlCatalogPtr(n_catal, catal, 0);
5738         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5739         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5740         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5741         xmlResetLastError();
5742         if (mem_base != xmlMemBlocks()) {
5743             printf("Leak of %d blocks found in xmlACatalogAdd",
5744                    xmlMemBlocks() - mem_base);
5745             test_ret++;
5746             printf(" %d", n_catal);
5747             printf(" %d", n_type);
5748             printf(" %d", n_orig);
5749             printf(" %d", n_replace);
5750             printf("\n");
5751         }
5752     }
5753     }
5754     }
5755     }
5756     function_tests++;
5757 #endif
5758
5759     return(test_ret);
5760 }
5761
5762
5763 static int
5764 test_xmlACatalogDump(void) {
5765     int test_ret = 0;
5766
5767 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5768     int mem_base;
5769     xmlCatalogPtr catal; /* a Catalog */
5770     int n_catal;
5771     FILE * out; /* the file. */
5772     int n_out;
5773
5774     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5775     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5776         mem_base = xmlMemBlocks();
5777         catal = gen_xmlCatalogPtr(n_catal, 0);
5778         out = gen_FILE_ptr(n_out, 1);
5779
5780         xmlACatalogDump(catal, out);
5781         call_tests++;
5782         des_xmlCatalogPtr(n_catal, catal, 0);
5783         des_FILE_ptr(n_out, out, 1);
5784         xmlResetLastError();
5785         if (mem_base != xmlMemBlocks()) {
5786             printf("Leak of %d blocks found in xmlACatalogDump",
5787                    xmlMemBlocks() - mem_base);
5788             test_ret++;
5789             printf(" %d", n_catal);
5790             printf(" %d", n_out);
5791             printf("\n");
5792         }
5793     }
5794     }
5795     function_tests++;
5796 #endif
5797
5798     return(test_ret);
5799 }
5800
5801
5802 static int
5803 test_xmlACatalogRemove(void) {
5804     int test_ret = 0;
5805
5806 #if defined(LIBXML_CATALOG_ENABLED)
5807     int mem_base;
5808     int ret_val;
5809     xmlCatalogPtr catal; /* a Catalog */
5810     int n_catal;
5811     xmlChar * value; /* the value to remove */
5812     int n_value;
5813
5814     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5815     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5816         mem_base = xmlMemBlocks();
5817         catal = gen_xmlCatalogPtr(n_catal, 0);
5818         value = gen_const_xmlChar_ptr(n_value, 1);
5819
5820         ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5821         desret_int(ret_val);
5822         call_tests++;
5823         des_xmlCatalogPtr(n_catal, catal, 0);
5824         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5825         xmlResetLastError();
5826         if (mem_base != xmlMemBlocks()) {
5827             printf("Leak of %d blocks found in xmlACatalogRemove",
5828                    xmlMemBlocks() - mem_base);
5829             test_ret++;
5830             printf(" %d", n_catal);
5831             printf(" %d", n_value);
5832             printf("\n");
5833         }
5834     }
5835     }
5836     function_tests++;
5837 #endif
5838
5839     return(test_ret);
5840 }
5841
5842
5843 static int
5844 test_xmlACatalogResolve(void) {
5845     int test_ret = 0;
5846
5847 #if defined(LIBXML_CATALOG_ENABLED)
5848     int mem_base;
5849     xmlChar * ret_val;
5850     xmlCatalogPtr catal; /* a Catalog */
5851     int n_catal;
5852     xmlChar * pubID; /* the public ID string */
5853     int n_pubID;
5854     xmlChar * sysID; /* the system ID string */
5855     int n_sysID;
5856
5857     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5858     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5859     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5860         mem_base = xmlMemBlocks();
5861         catal = gen_xmlCatalogPtr(n_catal, 0);
5862         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5863         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5864
5865         ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5866         desret_xmlChar_ptr(ret_val);
5867         call_tests++;
5868         des_xmlCatalogPtr(n_catal, catal, 0);
5869         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5870         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5871         xmlResetLastError();
5872         if (mem_base != xmlMemBlocks()) {
5873             printf("Leak of %d blocks found in xmlACatalogResolve",
5874                    xmlMemBlocks() - mem_base);
5875             test_ret++;
5876             printf(" %d", n_catal);
5877             printf(" %d", n_pubID);
5878             printf(" %d", n_sysID);
5879             printf("\n");
5880         }
5881     }
5882     }
5883     }
5884     function_tests++;
5885 #endif
5886
5887     return(test_ret);
5888 }
5889
5890
5891 static int
5892 test_xmlACatalogResolvePublic(void) {
5893     int test_ret = 0;
5894
5895 #if defined(LIBXML_CATALOG_ENABLED)
5896     int mem_base;
5897     xmlChar * ret_val;
5898     xmlCatalogPtr catal; /* a Catalog */
5899     int n_catal;
5900     xmlChar * pubID; /* the public ID string */
5901     int n_pubID;
5902
5903     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5904     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5905         mem_base = xmlMemBlocks();
5906         catal = gen_xmlCatalogPtr(n_catal, 0);
5907         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5908
5909         ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5910         desret_xmlChar_ptr(ret_val);
5911         call_tests++;
5912         des_xmlCatalogPtr(n_catal, catal, 0);
5913         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5914         xmlResetLastError();
5915         if (mem_base != xmlMemBlocks()) {
5916             printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5917                    xmlMemBlocks() - mem_base);
5918             test_ret++;
5919             printf(" %d", n_catal);
5920             printf(" %d", n_pubID);
5921             printf("\n");
5922         }
5923     }
5924     }
5925     function_tests++;
5926 #endif
5927
5928     return(test_ret);
5929 }
5930
5931
5932 static int
5933 test_xmlACatalogResolveSystem(void) {
5934     int test_ret = 0;
5935
5936 #if defined(LIBXML_CATALOG_ENABLED)
5937     int mem_base;
5938     xmlChar * ret_val;
5939     xmlCatalogPtr catal; /* a Catalog */
5940     int n_catal;
5941     xmlChar * sysID; /* the system ID string */
5942     int n_sysID;
5943
5944     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5945     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5946         mem_base = xmlMemBlocks();
5947         catal = gen_xmlCatalogPtr(n_catal, 0);
5948         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5949
5950         ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5951         desret_xmlChar_ptr(ret_val);
5952         call_tests++;
5953         des_xmlCatalogPtr(n_catal, catal, 0);
5954         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5955         xmlResetLastError();
5956         if (mem_base != xmlMemBlocks()) {
5957             printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5958                    xmlMemBlocks() - mem_base);
5959             test_ret++;
5960             printf(" %d", n_catal);
5961             printf(" %d", n_sysID);
5962             printf("\n");
5963         }
5964     }
5965     }
5966     function_tests++;
5967 #endif
5968
5969     return(test_ret);
5970 }
5971
5972
5973 static int
5974 test_xmlACatalogResolveURI(void) {
5975     int test_ret = 0;
5976
5977 #if defined(LIBXML_CATALOG_ENABLED)
5978     int mem_base;
5979     xmlChar * ret_val;
5980     xmlCatalogPtr catal; /* a Catalog */
5981     int n_catal;
5982     xmlChar * URI; /* the URI */
5983     int n_URI;
5984
5985     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5986     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5987         mem_base = xmlMemBlocks();
5988         catal = gen_xmlCatalogPtr(n_catal, 0);
5989         URI = gen_const_xmlChar_ptr(n_URI, 1);
5990
5991         ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5992         desret_xmlChar_ptr(ret_val);
5993         call_tests++;
5994         des_xmlCatalogPtr(n_catal, catal, 0);
5995         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5996         xmlResetLastError();
5997         if (mem_base != xmlMemBlocks()) {
5998             printf("Leak of %d blocks found in xmlACatalogResolveURI",
5999                    xmlMemBlocks() - mem_base);
6000             test_ret++;
6001             printf(" %d", n_catal);
6002             printf(" %d", n_URI);
6003             printf("\n");
6004         }
6005     }
6006     }
6007     function_tests++;
6008 #endif
6009
6010     return(test_ret);
6011 }
6012
6013
6014 static int
6015 test_xmlCatalogAdd(void) {
6016     int test_ret = 0;
6017
6018 #if defined(LIBXML_CATALOG_ENABLED)
6019     int mem_base;
6020     int ret_val;
6021     xmlChar * type; /* the type of record to add to the catalog */
6022     int n_type;
6023     xmlChar * orig; /* the system, public or prefix to match */
6024     int n_orig;
6025     xmlChar * replace; /* the replacement value for the match */
6026     int n_replace;
6027
6028     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
6029     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
6030     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
6031         mem_base = xmlMemBlocks();
6032         type = gen_const_xmlChar_ptr(n_type, 0);
6033         orig = gen_const_xmlChar_ptr(n_orig, 1);
6034         replace = gen_const_xmlChar_ptr(n_replace, 2);
6035
6036         ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
6037         desret_int(ret_val);
6038         call_tests++;
6039         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
6040         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
6041         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
6042         xmlResetLastError();
6043         if (mem_base != xmlMemBlocks()) {
6044             printf("Leak of %d blocks found in xmlCatalogAdd",
6045                    xmlMemBlocks() - mem_base);
6046             test_ret++;
6047             printf(" %d", n_type);
6048             printf(" %d", n_orig);
6049             printf(" %d", n_replace);
6050             printf("\n");
6051         }
6052     }
6053     }
6054     }
6055     function_tests++;
6056 #endif
6057
6058     return(test_ret);
6059 }
6060
6061
6062 static int
6063 test_xmlCatalogCleanup(void) {
6064     int test_ret = 0;
6065
6066 #if defined(LIBXML_CATALOG_ENABLED)
6067
6068
6069         xmlCatalogCleanup();
6070         call_tests++;
6071         xmlResetLastError();
6072     function_tests++;
6073 #endif
6074
6075     return(test_ret);
6076 }
6077
6078
6079 static int
6080 test_xmlCatalogConvert(void) {
6081     int test_ret = 0;
6082
6083 #if defined(LIBXML_CATALOG_ENABLED)
6084     int ret_val;
6085
6086
6087         ret_val = xmlCatalogConvert();
6088         desret_int(ret_val);
6089         call_tests++;
6090         xmlResetLastError();
6091     function_tests++;
6092 #endif
6093
6094     return(test_ret);
6095 }
6096
6097
6098 static int
6099 test_xmlCatalogDump(void) {
6100     int test_ret = 0;
6101
6102 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
6103     int mem_base;
6104     FILE * out; /* the file. */
6105     int n_out;
6106
6107     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
6108         mem_base = xmlMemBlocks();
6109         out = gen_FILE_ptr(n_out, 0);
6110
6111         xmlCatalogDump(out);
6112         call_tests++;
6113         des_FILE_ptr(n_out, out, 0);
6114         xmlResetLastError();
6115         if (mem_base != xmlMemBlocks()) {
6116             printf("Leak of %d blocks found in xmlCatalogDump",
6117                    xmlMemBlocks() - mem_base);
6118             test_ret++;
6119             printf(" %d", n_out);
6120             printf("\n");
6121         }
6122     }
6123     function_tests++;
6124 #endif
6125
6126     return(test_ret);
6127 }
6128
6129
6130 static int
6131 test_xmlCatalogGetDefaults(void) {
6132     int test_ret = 0;
6133
6134 #if defined(LIBXML_CATALOG_ENABLED)
6135     int mem_base;
6136     xmlCatalogAllow ret_val;
6137
6138         mem_base = xmlMemBlocks();
6139
6140         ret_val = xmlCatalogGetDefaults();
6141         desret_xmlCatalogAllow(ret_val);
6142         call_tests++;
6143         xmlResetLastError();
6144         if (mem_base != xmlMemBlocks()) {
6145             printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6146                    xmlMemBlocks() - mem_base);
6147             test_ret++;
6148             printf("\n");
6149         }
6150     function_tests++;
6151 #endif
6152
6153     return(test_ret);
6154 }
6155
6156
6157 static int
6158 test_xmlCatalogIsEmpty(void) {
6159     int test_ret = 0;
6160
6161 #if defined(LIBXML_CATALOG_ENABLED)
6162     int mem_base;
6163     int ret_val;
6164     xmlCatalogPtr catal; /* should this create an SGML catalog */
6165     int n_catal;
6166
6167     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6168         mem_base = xmlMemBlocks();
6169         catal = gen_xmlCatalogPtr(n_catal, 0);
6170
6171         ret_val = xmlCatalogIsEmpty(catal);
6172         desret_int(ret_val);
6173         call_tests++;
6174         des_xmlCatalogPtr(n_catal, catal, 0);
6175         xmlResetLastError();
6176         if (mem_base != xmlMemBlocks()) {
6177             printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6178                    xmlMemBlocks() - mem_base);
6179             test_ret++;
6180             printf(" %d", n_catal);
6181             printf("\n");
6182         }
6183     }
6184     function_tests++;
6185 #endif
6186
6187     return(test_ret);
6188 }
6189
6190
6191 static int
6192 test_xmlCatalogLocalResolve(void) {
6193     int test_ret = 0;
6194
6195 #if defined(LIBXML_CATALOG_ENABLED)
6196     int mem_base;
6197     xmlChar * ret_val;
6198     void * catalogs; /* a document's list of catalogs */
6199     int n_catalogs;
6200     xmlChar * pubID; /* the public ID string */
6201     int n_pubID;
6202     xmlChar * sysID; /* the system ID string */
6203     int n_sysID;
6204
6205     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6206     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6207     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6208         mem_base = xmlMemBlocks();
6209         catalogs = gen_void_ptr(n_catalogs, 0);
6210         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6211         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6212
6213         ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6214         desret_xmlChar_ptr(ret_val);
6215         call_tests++;
6216         des_void_ptr(n_catalogs, catalogs, 0);
6217         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6218         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6219         xmlResetLastError();
6220         if (mem_base != xmlMemBlocks()) {
6221             printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6222                    xmlMemBlocks() - mem_base);
6223             test_ret++;
6224             printf(" %d", n_catalogs);
6225             printf(" %d", n_pubID);
6226             printf(" %d", n_sysID);
6227             printf("\n");
6228         }
6229     }
6230     }
6231     }
6232     function_tests++;
6233 #endif
6234
6235     return(test_ret);
6236 }
6237
6238
6239 static int
6240 test_xmlCatalogLocalResolveURI(void) {
6241     int test_ret = 0;
6242
6243 #if defined(LIBXML_CATALOG_ENABLED)
6244     int mem_base;
6245     xmlChar * ret_val;
6246     void * catalogs; /* a document's list of catalogs */
6247     int n_catalogs;
6248     xmlChar * URI; /* the URI */
6249     int n_URI;
6250
6251     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6252     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6253         mem_base = xmlMemBlocks();
6254         catalogs = gen_void_ptr(n_catalogs, 0);
6255         URI = gen_const_xmlChar_ptr(n_URI, 1);
6256
6257         ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6258         desret_xmlChar_ptr(ret_val);
6259         call_tests++;
6260         des_void_ptr(n_catalogs, catalogs, 0);
6261         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6262         xmlResetLastError();
6263         if (mem_base != xmlMemBlocks()) {
6264             printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6265                    xmlMemBlocks() - mem_base);
6266             test_ret++;
6267             printf(" %d", n_catalogs);
6268             printf(" %d", n_URI);
6269             printf("\n");
6270         }
6271     }
6272     }
6273     function_tests++;
6274 #endif
6275
6276     return(test_ret);
6277 }
6278
6279
6280 static int
6281 test_xmlCatalogRemove(void) {
6282     int test_ret = 0;
6283
6284 #if defined(LIBXML_CATALOG_ENABLED)
6285     int ret_val;
6286     xmlChar * value; /* the value to remove */
6287     int n_value;
6288
6289     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6290         value = gen_const_xmlChar_ptr(n_value, 0);
6291
6292         ret_val = xmlCatalogRemove((const xmlChar *)value);
6293         desret_int(ret_val);
6294         call_tests++;
6295         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6296         xmlResetLastError();
6297     }
6298     function_tests++;
6299 #endif
6300
6301     return(test_ret);
6302 }
6303
6304
6305 static int
6306 test_xmlCatalogResolve(void) {
6307     int test_ret = 0;
6308
6309 #if defined(LIBXML_CATALOG_ENABLED)
6310     xmlChar * ret_val;
6311     xmlChar * pubID; /* the public ID string */
6312     int n_pubID;
6313     xmlChar * sysID; /* the system ID string */
6314     int n_sysID;
6315
6316     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6317     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6318         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6319         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6320
6321         ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6322         desret_xmlChar_ptr(ret_val);
6323         call_tests++;
6324         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6325         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6326         xmlResetLastError();
6327     }
6328     }
6329     function_tests++;
6330 #endif
6331
6332     return(test_ret);
6333 }
6334
6335
6336 static int
6337 test_xmlCatalogResolvePublic(void) {
6338     int test_ret = 0;
6339
6340 #if defined(LIBXML_CATALOG_ENABLED)
6341     int mem_base;
6342     xmlChar * ret_val;
6343     xmlChar * pubID; /* the public ID string */
6344     int n_pubID;
6345
6346     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6347         mem_base = xmlMemBlocks();
6348         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6349
6350         ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6351         desret_xmlChar_ptr(ret_val);
6352         call_tests++;
6353         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6354         xmlResetLastError();
6355         if (mem_base != xmlMemBlocks()) {
6356             printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6357                    xmlMemBlocks() - mem_base);
6358             test_ret++;
6359             printf(" %d", n_pubID);
6360             printf("\n");
6361         }
6362     }
6363     function_tests++;
6364 #endif
6365
6366     return(test_ret);
6367 }
6368
6369
6370 static int
6371 test_xmlCatalogResolveSystem(void) {
6372     int test_ret = 0;
6373
6374 #if defined(LIBXML_CATALOG_ENABLED)
6375     int mem_base;
6376     xmlChar * ret_val;
6377     xmlChar * sysID; /* the system ID string */
6378     int n_sysID;
6379
6380     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6381         mem_base = xmlMemBlocks();
6382         sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6383
6384         ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6385         desret_xmlChar_ptr(ret_val);
6386         call_tests++;
6387         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6388         xmlResetLastError();
6389         if (mem_base != xmlMemBlocks()) {
6390             printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6391                    xmlMemBlocks() - mem_base);
6392             test_ret++;
6393             printf(" %d", n_sysID);
6394             printf("\n");
6395         }
6396     }
6397     function_tests++;
6398 #endif
6399
6400     return(test_ret);
6401 }
6402
6403
6404 static int
6405 test_xmlCatalogResolveURI(void) {
6406     int test_ret = 0;
6407
6408 #if defined(LIBXML_CATALOG_ENABLED)
6409     int mem_base;
6410     xmlChar * ret_val;
6411     xmlChar * URI; /* the URI */
6412     int n_URI;
6413
6414     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6415         mem_base = xmlMemBlocks();
6416         URI = gen_const_xmlChar_ptr(n_URI, 0);
6417
6418         ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6419         desret_xmlChar_ptr(ret_val);
6420         call_tests++;
6421         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6422         xmlResetLastError();
6423         if (mem_base != xmlMemBlocks()) {
6424             printf("Leak of %d blocks found in xmlCatalogResolveURI",
6425                    xmlMemBlocks() - mem_base);
6426             test_ret++;
6427             printf(" %d", n_URI);
6428             printf("\n");
6429         }
6430     }
6431     function_tests++;
6432 #endif
6433
6434     return(test_ret);
6435 }
6436
6437
6438 static int
6439 test_xmlCatalogSetDefaultPrefer(void) {
6440     int test_ret = 0;
6441
6442 #if defined(LIBXML_CATALOG_ENABLED)
6443     int mem_base;
6444     xmlCatalogPrefer ret_val;
6445     xmlCatalogPrefer prefer; /* the default preference for delegation */
6446     int n_prefer;
6447
6448     for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6449         mem_base = xmlMemBlocks();
6450         prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6451
6452         ret_val = xmlCatalogSetDefaultPrefer(prefer);
6453         desret_xmlCatalogPrefer(ret_val);
6454         call_tests++;
6455         des_xmlCatalogPrefer(n_prefer, prefer, 0);
6456         xmlResetLastError();
6457         if (mem_base != xmlMemBlocks()) {
6458             printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6459                    xmlMemBlocks() - mem_base);
6460             test_ret++;
6461             printf(" %d", n_prefer);
6462             printf("\n");
6463         }
6464     }
6465     function_tests++;
6466 #endif
6467
6468     return(test_ret);
6469 }
6470
6471
6472 static int
6473 test_xmlCatalogSetDefaults(void) {
6474     int test_ret = 0;
6475
6476 #if defined(LIBXML_CATALOG_ENABLED)
6477     int mem_base;
6478     xmlCatalogAllow allow; /* what catalogs should be accepted */
6479     int n_allow;
6480
6481     for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6482         mem_base = xmlMemBlocks();
6483         allow = gen_xmlCatalogAllow(n_allow, 0);
6484
6485         xmlCatalogSetDefaults(allow);
6486         call_tests++;
6487         des_xmlCatalogAllow(n_allow, allow, 0);
6488         xmlResetLastError();
6489         if (mem_base != xmlMemBlocks()) {
6490             printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6491                    xmlMemBlocks() - mem_base);
6492             test_ret++;
6493             printf(" %d", n_allow);
6494             printf("\n");
6495         }
6496     }
6497     function_tests++;
6498 #endif
6499
6500     return(test_ret);
6501 }
6502
6503
6504 static int
6505 test_xmlConvertSGMLCatalog(void) {
6506     int test_ret = 0;
6507
6508 #if defined(LIBXML_CATALOG_ENABLED)
6509     int mem_base;
6510     int ret_val;
6511     xmlCatalogPtr catal; /* the catalog */
6512     int n_catal;
6513
6514     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6515         mem_base = xmlMemBlocks();
6516         catal = gen_xmlCatalogPtr(n_catal, 0);
6517
6518         ret_val = xmlConvertSGMLCatalog(catal);
6519         desret_int(ret_val);
6520         call_tests++;
6521         des_xmlCatalogPtr(n_catal, catal, 0);
6522         xmlResetLastError();
6523         if (mem_base != xmlMemBlocks()) {
6524             printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6525                    xmlMemBlocks() - mem_base);
6526             test_ret++;
6527             printf(" %d", n_catal);
6528             printf("\n");
6529         }
6530     }
6531     function_tests++;
6532 #endif
6533
6534     return(test_ret);
6535 }
6536
6537
6538 static int
6539 test_xmlInitializeCatalog(void) {
6540     int test_ret = 0;
6541
6542 #if defined(LIBXML_CATALOG_ENABLED)
6543     int mem_base;
6544
6545         mem_base = xmlMemBlocks();
6546
6547         xmlInitializeCatalog();
6548         call_tests++;
6549         xmlResetLastError();
6550         if (mem_base != xmlMemBlocks()) {
6551             printf("Leak of %d blocks found in xmlInitializeCatalog",
6552                    xmlMemBlocks() - mem_base);
6553             test_ret++;
6554             printf("\n");
6555         }
6556     function_tests++;
6557 #endif
6558
6559     return(test_ret);
6560 }
6561
6562
6563 static int
6564 test_xmlLoadACatalog(void) {
6565     int test_ret = 0;
6566
6567
6568     /* missing type support */
6569     return(test_ret);
6570 }
6571
6572
6573 static int
6574 test_xmlLoadCatalog(void) {
6575     int test_ret = 0;
6576
6577 #if defined(LIBXML_CATALOG_ENABLED)
6578     int ret_val;
6579     const char * filename; /* a file path */
6580     int n_filename;
6581
6582     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6583         filename = gen_filepath(n_filename, 0);
6584
6585         ret_val = xmlLoadCatalog(filename);
6586         desret_int(ret_val);
6587         call_tests++;
6588         des_filepath(n_filename, filename, 0);
6589         xmlResetLastError();
6590     }
6591     function_tests++;
6592 #endif
6593
6594     return(test_ret);
6595 }
6596
6597
6598 static int
6599 test_xmlLoadCatalogs(void) {
6600     int test_ret = 0;
6601
6602 #if defined(LIBXML_CATALOG_ENABLED)
6603     char * pathss; /* a list of directories separated by a colon or a space. */
6604     int n_pathss;
6605
6606     for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6607         pathss = gen_const_char_ptr(n_pathss, 0);
6608
6609         xmlLoadCatalogs((const char *)pathss);
6610         call_tests++;
6611         des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6612         xmlResetLastError();
6613     }
6614     function_tests++;
6615 #endif
6616
6617     return(test_ret);
6618 }
6619
6620
6621 static int
6622 test_xmlLoadSGMLSuperCatalog(void) {
6623     int test_ret = 0;
6624
6625
6626     /* missing type support */
6627     return(test_ret);
6628 }
6629
6630
6631 static int
6632 test_xmlNewCatalog(void) {
6633     int test_ret = 0;
6634
6635
6636     /* missing type support */
6637     return(test_ret);
6638 }
6639
6640
6641 static int
6642 test_xmlParseCatalogFile(void) {
6643     int test_ret = 0;
6644
6645 #if defined(LIBXML_CATALOG_ENABLED)
6646     int mem_base;
6647     xmlDocPtr ret_val;
6648     const char * filename; /* the filename */
6649     int n_filename;
6650
6651     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6652         mem_base = xmlMemBlocks();
6653         filename = gen_filepath(n_filename, 0);
6654
6655         ret_val = xmlParseCatalogFile(filename);
6656         desret_xmlDocPtr(ret_val);
6657         call_tests++;
6658         des_filepath(n_filename, filename, 0);
6659         xmlResetLastError();
6660         if (mem_base != xmlMemBlocks()) {
6661             printf("Leak of %d blocks found in xmlParseCatalogFile",
6662                    xmlMemBlocks() - mem_base);
6663             test_ret++;
6664             printf(" %d", n_filename);
6665             printf("\n");
6666         }
6667     }
6668     function_tests++;
6669 #endif
6670
6671     return(test_ret);
6672 }
6673
6674 static int
6675 test_catalog(void) {
6676     int test_ret = 0;
6677         int rc = 0;
6678
6679     if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6680     rc = test_xmlACatalogAdd();
6681         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6682     rc = test_xmlACatalogDump();
6683         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6684     rc = test_xmlACatalogRemove();
6685         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6686     rc = test_xmlACatalogResolve();
6687         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6688     rc = test_xmlACatalogResolvePublic();
6689         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6690     rc = test_xmlACatalogResolveSystem();
6691         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6692     rc = test_xmlACatalogResolveURI();
6693         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6694     rc = test_xmlCatalogAdd();
6695         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6696     rc = test_xmlCatalogCleanup();
6697         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6698     rc = test_xmlCatalogConvert();
6699         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6700     rc = test_xmlCatalogDump();
6701         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6702     rc = test_xmlCatalogGetDefaults();
6703         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6704     rc = test_xmlCatalogIsEmpty();
6705         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6706     rc = test_xmlCatalogLocalResolve();
6707         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6708     rc = test_xmlCatalogLocalResolveURI();
6709         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6710     rc = test_xmlCatalogRemove();
6711         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6712     rc = test_xmlCatalogResolve();
6713         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6714     rc = test_xmlCatalogResolvePublic();
6715         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6716     rc = test_xmlCatalogResolveSystem();
6717         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6718     rc = test_xmlCatalogResolveURI();
6719         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6720     rc = test_xmlCatalogSetDefaultPrefer();
6721         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6722     rc = test_xmlCatalogSetDefaults();
6723         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6724     rc = test_xmlConvertSGMLCatalog();
6725         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6726     rc = test_xmlInitializeCatalog();
6727         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6728     rc = test_xmlLoadACatalog();
6729         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6730     rc = test_xmlLoadCatalog();
6731         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6732     rc = test_xmlLoadCatalogs();
6733         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6734     rc = test_xmlLoadSGMLSuperCatalog();
6735         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6736     rc = test_xmlNewCatalog();
6737         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6738     rc = test_xmlParseCatalogFile();
6739         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
6740
6741     if (test_ret != 0)
6742         printf("Module catalog: %d errors\n", test_ret);
6743     return(test_ret);
6744 }
6745
6746 #define gen_nb_const_xmlChRangeGroup_ptr 1
6747 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6748     return(NULL);
6749 }
6750 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6751 }
6752
6753 static int
6754 test_xmlCharInRange(void) {
6755     int test_ret = 0;
6756
6757     int mem_base;
6758     int ret_val;
6759     unsigned int val; /* character to be validated */
6760     int n_val;
6761     xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6762     int n_rptr;
6763
6764     for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6765     for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6766         mem_base = xmlMemBlocks();
6767         val = gen_unsigned_int(n_val, 0);
6768         rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6769
6770         ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6771         desret_int(ret_val);
6772         call_tests++;
6773         des_unsigned_int(n_val, val, 0);
6774         des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6775         xmlResetLastError();
6776         if (mem_base != xmlMemBlocks()) {
6777             printf("Leak of %d blocks found in xmlCharInRange",
6778                    xmlMemBlocks() - mem_base);
6779             test_ret++;
6780             printf(" %d", n_val);
6781             printf(" %d", n_rptr);
6782             printf("\n");
6783         }
6784     }
6785     }
6786     function_tests++;
6787
6788     return(test_ret);
6789 }
6790
6791
6792 static int
6793 test_xmlIsBaseChar(void) {
6794     int test_ret = 0;
6795
6796     int mem_base;
6797     int ret_val;
6798     unsigned int ch; /* character to validate */
6799     int n_ch;
6800
6801     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6802         mem_base = xmlMemBlocks();
6803         ch = gen_unsigned_int(n_ch, 0);
6804
6805         ret_val = xmlIsBaseChar(ch);
6806         desret_int(ret_val);
6807         call_tests++;
6808         des_unsigned_int(n_ch, ch, 0);
6809         xmlResetLastError();
6810         if (mem_base != xmlMemBlocks()) {
6811             printf("Leak of %d blocks found in xmlIsBaseChar",
6812                    xmlMemBlocks() - mem_base);
6813             test_ret++;
6814             printf(" %d", n_ch);
6815             printf("\n");
6816         }
6817     }
6818     function_tests++;
6819
6820     return(test_ret);
6821 }
6822
6823
6824 static int
6825 test_xmlIsBlank(void) {
6826     int test_ret = 0;
6827
6828     int mem_base;
6829     int ret_val;
6830     unsigned int ch; /* character to validate */
6831     int n_ch;
6832
6833     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6834         mem_base = xmlMemBlocks();
6835         ch = gen_unsigned_int(n_ch, 0);
6836
6837         ret_val = xmlIsBlank(ch);
6838         desret_int(ret_val);
6839         call_tests++;
6840         des_unsigned_int(n_ch, ch, 0);
6841         xmlResetLastError();
6842         if (mem_base != xmlMemBlocks()) {
6843             printf("Leak of %d blocks found in xmlIsBlank",
6844                    xmlMemBlocks() - mem_base);
6845             test_ret++;
6846             printf(" %d", n_ch);
6847             printf("\n");
6848         }
6849     }
6850     function_tests++;
6851
6852     return(test_ret);
6853 }
6854
6855
6856 static int
6857 test_xmlIsChar(void) {
6858     int test_ret = 0;
6859
6860     int mem_base;
6861     int ret_val;
6862     unsigned int ch; /* character to validate */
6863     int n_ch;
6864
6865     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6866         mem_base = xmlMemBlocks();
6867         ch = gen_unsigned_int(n_ch, 0);
6868
6869         ret_val = xmlIsChar(ch);
6870         desret_int(ret_val);
6871         call_tests++;
6872         des_unsigned_int(n_ch, ch, 0);
6873         xmlResetLastError();
6874         if (mem_base != xmlMemBlocks()) {
6875             printf("Leak of %d blocks found in xmlIsChar",
6876                    xmlMemBlocks() - mem_base);
6877             test_ret++;
6878             printf(" %d", n_ch);
6879             printf("\n");
6880         }
6881     }
6882     function_tests++;
6883
6884     return(test_ret);
6885 }
6886
6887
6888 static int
6889 test_xmlIsCombining(void) {
6890     int test_ret = 0;
6891
6892     int mem_base;
6893     int ret_val;
6894     unsigned int ch; /* character to validate */
6895     int n_ch;
6896
6897     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6898         mem_base = xmlMemBlocks();
6899         ch = gen_unsigned_int(n_ch, 0);
6900
6901         ret_val = xmlIsCombining(ch);
6902         desret_int(ret_val);
6903         call_tests++;
6904         des_unsigned_int(n_ch, ch, 0);
6905         xmlResetLastError();
6906         if (mem_base != xmlMemBlocks()) {
6907             printf("Leak of %d blocks found in xmlIsCombining",
6908                    xmlMemBlocks() - mem_base);
6909             test_ret++;
6910             printf(" %d", n_ch);
6911             printf("\n");
6912         }
6913     }
6914     function_tests++;
6915
6916     return(test_ret);
6917 }
6918
6919
6920 static int
6921 test_xmlIsDigit(void) {
6922     int test_ret = 0;
6923
6924     int mem_base;
6925     int ret_val;
6926     unsigned int ch; /* character to validate */
6927     int n_ch;
6928
6929     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6930         mem_base = xmlMemBlocks();
6931         ch = gen_unsigned_int(n_ch, 0);
6932
6933         ret_val = xmlIsDigit(ch);
6934         desret_int(ret_val);
6935         call_tests++;
6936         des_unsigned_int(n_ch, ch, 0);
6937         xmlResetLastError();
6938         if (mem_base != xmlMemBlocks()) {
6939             printf("Leak of %d blocks found in xmlIsDigit",
6940                    xmlMemBlocks() - mem_base);
6941             test_ret++;
6942             printf(" %d", n_ch);
6943             printf("\n");
6944         }
6945     }
6946     function_tests++;
6947
6948     return(test_ret);
6949 }
6950
6951
6952 static int
6953 test_xmlIsExtender(void) {
6954     int test_ret = 0;
6955
6956     int mem_base;
6957     int ret_val;
6958     unsigned int ch; /* character to validate */
6959     int n_ch;
6960
6961     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6962         mem_base = xmlMemBlocks();
6963         ch = gen_unsigned_int(n_ch, 0);
6964
6965         ret_val = xmlIsExtender(ch);
6966         desret_int(ret_val);
6967         call_tests++;
6968         des_unsigned_int(n_ch, ch, 0);
6969         xmlResetLastError();
6970         if (mem_base != xmlMemBlocks()) {
6971             printf("Leak of %d blocks found in xmlIsExtender",
6972                    xmlMemBlocks() - mem_base);
6973             test_ret++;
6974             printf(" %d", n_ch);
6975             printf("\n");
6976         }
6977     }
6978     function_tests++;
6979
6980     return(test_ret);
6981 }
6982
6983
6984 static int
6985 test_xmlIsIdeographic(void) {
6986     int test_ret = 0;
6987
6988     int mem_base;
6989     int ret_val;
6990     unsigned int ch; /* character to validate */
6991     int n_ch;
6992
6993     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6994         mem_base = xmlMemBlocks();
6995         ch = gen_unsigned_int(n_ch, 0);
6996
6997         ret_val = xmlIsIdeographic(ch);
6998         desret_int(ret_val);
6999         call_tests++;
7000         des_unsigned_int(n_ch, ch, 0);
7001         xmlResetLastError();
7002         if (mem_base != xmlMemBlocks()) {
7003             printf("Leak of %d blocks found in xmlIsIdeographic",
7004                    xmlMemBlocks() - mem_base);
7005             test_ret++;
7006             printf(" %d", n_ch);
7007             printf("\n");
7008         }
7009     }
7010     function_tests++;
7011
7012     return(test_ret);
7013 }
7014
7015
7016 static int
7017 test_xmlIsPubidChar(void) {
7018     int test_ret = 0;
7019
7020     int mem_base;
7021     int ret_val;
7022     unsigned int ch; /* character to validate */
7023     int n_ch;
7024
7025     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
7026         mem_base = xmlMemBlocks();
7027         ch = gen_unsigned_int(n_ch, 0);
7028
7029         ret_val = xmlIsPubidChar(ch);
7030         desret_int(ret_val);
7031         call_tests++;
7032         des_unsigned_int(n_ch, ch, 0);
7033         xmlResetLastError();
7034         if (mem_base != xmlMemBlocks()) {
7035             printf("Leak of %d blocks found in xmlIsPubidChar",
7036                    xmlMemBlocks() - mem_base);
7037             test_ret++;
7038             printf(" %d", n_ch);
7039             printf("\n");
7040         }
7041     }
7042     function_tests++;
7043
7044     return(test_ret);
7045 }
7046
7047 static int
7048 test_chvalid(void) {
7049     int test_ret = 0;
7050         int rc = 0;
7051
7052     if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
7053     rc = test_xmlCharInRange();
7054         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7055     rc = test_xmlIsBaseChar();
7056         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7057     rc = test_xmlIsBlank();
7058         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7059     rc = test_xmlIsChar();
7060         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7061     rc = test_xmlIsCombining();
7062         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7063     rc = test_xmlIsDigit();
7064         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7065     rc = test_xmlIsExtender();
7066         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7067     rc = test_xmlIsIdeographic();
7068         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7069     rc = test_xmlIsPubidChar();
7070         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
7071
7072     if (test_ret != 0)
7073         printf("Module chvalid: %d errors\n", test_ret);
7074     return(test_ret);
7075 }
7076
7077 static int
7078 test_xmlBoolToText(void) {
7079     int test_ret = 0;
7080
7081 #if defined(LIBXML_DEBUG_ENABLED)
7082     int mem_base;
7083     const char * ret_val;
7084     int boolval; /* a bool to turn into text */
7085     int n_boolval;
7086
7087     for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
7088         mem_base = xmlMemBlocks();
7089         boolval = gen_int(n_boolval, 0);
7090
7091         ret_val = xmlBoolToText(boolval);
7092         desret_const_char_ptr(ret_val);
7093         call_tests++;
7094         des_int(n_boolval, boolval, 0);
7095         xmlResetLastError();
7096         if (mem_base != xmlMemBlocks()) {
7097             printf("Leak of %d blocks found in xmlBoolToText",
7098                    xmlMemBlocks() - mem_base);
7099             test_ret++;
7100             printf(" %d", n_boolval);
7101             printf("\n");
7102         }
7103     }
7104     function_tests++;
7105 #endif
7106
7107     return(test_ret);
7108 }
7109
7110
7111 static int
7112 test_xmlDebugCheckDocument(void) {
7113     int test_ret = 0;
7114
7115 #if defined(LIBXML_DEBUG_ENABLED)
7116     int mem_base;
7117     int ret_val;
7118     FILE * output; /* the FILE * for the output */
7119     int n_output;
7120     xmlDocPtr doc; /* the document */
7121     int n_doc;
7122
7123     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7124     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7125         mem_base = xmlMemBlocks();
7126         output = gen_debug_FILE_ptr(n_output, 0);
7127         doc = gen_xmlDocPtr(n_doc, 1);
7128
7129         ret_val = xmlDebugCheckDocument(output, doc);
7130         desret_int(ret_val);
7131         call_tests++;
7132         des_debug_FILE_ptr(n_output, output, 0);
7133         des_xmlDocPtr(n_doc, doc, 1);
7134         xmlResetLastError();
7135         if (mem_base != xmlMemBlocks()) {
7136             printf("Leak of %d blocks found in xmlDebugCheckDocument",
7137                    xmlMemBlocks() - mem_base);
7138             test_ret++;
7139             printf(" %d", n_output);
7140             printf(" %d", n_doc);
7141             printf("\n");
7142         }
7143     }
7144     }
7145     function_tests++;
7146 #endif
7147
7148     return(test_ret);
7149 }
7150
7151
7152 static int
7153 test_xmlDebugDumpAttr(void) {
7154     int test_ret = 0;
7155
7156 #if defined(LIBXML_DEBUG_ENABLED)
7157     int mem_base;
7158     FILE * output; /* the FILE * for the output */
7159     int n_output;
7160     xmlAttrPtr attr; /* the attribute */
7161     int n_attr;
7162     int depth; /* the indentation level. */
7163     int n_depth;
7164
7165     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7166     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7167     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7168         mem_base = xmlMemBlocks();
7169         output = gen_debug_FILE_ptr(n_output, 0);
7170         attr = gen_xmlAttrPtr(n_attr, 1);
7171         depth = gen_int(n_depth, 2);
7172
7173         xmlDebugDumpAttr(output, attr, depth);
7174         call_tests++;
7175         des_debug_FILE_ptr(n_output, output, 0);
7176         des_xmlAttrPtr(n_attr, attr, 1);
7177         des_int(n_depth, depth, 2);
7178         xmlResetLastError();
7179         if (mem_base != xmlMemBlocks()) {
7180             printf("Leak of %d blocks found in xmlDebugDumpAttr",
7181                    xmlMemBlocks() - mem_base);
7182             test_ret++;
7183             printf(" %d", n_output);
7184             printf(" %d", n_attr);
7185             printf(" %d", n_depth);
7186             printf("\n");
7187         }
7188     }
7189     }
7190     }
7191     function_tests++;
7192 #endif
7193
7194     return(test_ret);
7195 }
7196
7197
7198 static int
7199 test_xmlDebugDumpAttrList(void) {
7200     int test_ret = 0;
7201
7202 #if defined(LIBXML_DEBUG_ENABLED)
7203     int mem_base;
7204     FILE * output; /* the FILE * for the output */
7205     int n_output;
7206     xmlAttrPtr attr; /* the attribute list */
7207     int n_attr;
7208     int depth; /* the indentation level. */
7209     int n_depth;
7210
7211     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7212     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7213     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7214         mem_base = xmlMemBlocks();
7215         output = gen_debug_FILE_ptr(n_output, 0);
7216         attr = gen_xmlAttrPtr(n_attr, 1);
7217         depth = gen_int(n_depth, 2);
7218
7219         xmlDebugDumpAttrList(output, attr, depth);
7220         call_tests++;
7221         des_debug_FILE_ptr(n_output, output, 0);
7222         des_xmlAttrPtr(n_attr, attr, 1);
7223         des_int(n_depth, depth, 2);
7224         xmlResetLastError();
7225         if (mem_base != xmlMemBlocks()) {
7226             printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7227                    xmlMemBlocks() - mem_base);
7228             test_ret++;
7229             printf(" %d", n_output);
7230             printf(" %d", n_attr);
7231             printf(" %d", n_depth);
7232             printf("\n");
7233         }
7234     }
7235     }
7236     }
7237     function_tests++;
7238 #endif
7239
7240     return(test_ret);
7241 }
7242
7243
7244 static int
7245 test_xmlDebugDumpDTD(void) {
7246     int test_ret = 0;
7247
7248 #if defined(LIBXML_DEBUG_ENABLED)
7249     int mem_base;
7250     FILE * output; /* the FILE * for the output */
7251     int n_output;
7252     xmlDtdPtr dtd; /* the DTD */
7253     int n_dtd;
7254
7255     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7256     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7257         mem_base = xmlMemBlocks();
7258         output = gen_debug_FILE_ptr(n_output, 0);
7259         dtd = gen_xmlDtdPtr(n_dtd, 1);
7260
7261         xmlDebugDumpDTD(output, dtd);
7262         call_tests++;
7263         des_debug_FILE_ptr(n_output, output, 0);
7264         des_xmlDtdPtr(n_dtd, dtd, 1);
7265         xmlResetLastError();
7266         if (mem_base != xmlMemBlocks()) {
7267             printf("Leak of %d blocks found in xmlDebugDumpDTD",
7268                    xmlMemBlocks() - mem_base);
7269             test_ret++;
7270             printf(" %d", n_output);
7271             printf(" %d", n_dtd);
7272             printf("\n");
7273         }
7274     }
7275     }
7276     function_tests++;
7277 #endif
7278
7279     return(test_ret);
7280 }
7281
7282
7283 static int
7284 test_xmlDebugDumpDocument(void) {
7285     int test_ret = 0;
7286
7287 #if defined(LIBXML_DEBUG_ENABLED)
7288     int mem_base;
7289     FILE * output; /* the FILE * for the output */
7290     int n_output;
7291     xmlDocPtr doc; /* the document */
7292     int n_doc;
7293
7294     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7295     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7296         mem_base = xmlMemBlocks();
7297         output = gen_debug_FILE_ptr(n_output, 0);
7298         doc = gen_xmlDocPtr(n_doc, 1);
7299
7300         xmlDebugDumpDocument(output, doc);
7301         call_tests++;
7302         des_debug_FILE_ptr(n_output, output, 0);
7303         des_xmlDocPtr(n_doc, doc, 1);
7304         xmlResetLastError();
7305         if (mem_base != xmlMemBlocks()) {
7306             printf("Leak of %d blocks found in xmlDebugDumpDocument",
7307                    xmlMemBlocks() - mem_base);
7308             test_ret++;
7309             printf(" %d", n_output);
7310             printf(" %d", n_doc);
7311             printf("\n");
7312         }
7313     }
7314     }
7315     function_tests++;
7316 #endif
7317
7318     return(test_ret);
7319 }
7320
7321
7322 static int
7323 test_xmlDebugDumpDocumentHead(void) {
7324     int test_ret = 0;
7325
7326 #if defined(LIBXML_DEBUG_ENABLED)
7327     int mem_base;
7328     FILE * output; /* the FILE * for the output */
7329     int n_output;
7330     xmlDocPtr doc; /* the document */
7331     int n_doc;
7332
7333     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7334     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7335         mem_base = xmlMemBlocks();
7336         output = gen_debug_FILE_ptr(n_output, 0);
7337         doc = gen_xmlDocPtr(n_doc, 1);
7338
7339         xmlDebugDumpDocumentHead(output, doc);
7340         call_tests++;
7341         des_debug_FILE_ptr(n_output, output, 0);
7342         des_xmlDocPtr(n_doc, doc, 1);
7343         xmlResetLastError();
7344         if (mem_base != xmlMemBlocks()) {
7345             printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7346                    xmlMemBlocks() - mem_base);
7347             test_ret++;
7348             printf(" %d", n_output);
7349             printf(" %d", n_doc);
7350             printf("\n");
7351         }
7352     }
7353     }
7354     function_tests++;
7355 #endif
7356
7357     return(test_ret);
7358 }
7359
7360
7361 static int
7362 test_xmlDebugDumpEntities(void) {
7363     int test_ret = 0;
7364
7365 #if defined(LIBXML_DEBUG_ENABLED)
7366     int mem_base;
7367     FILE * output; /* the FILE * for the output */
7368     int n_output;
7369     xmlDocPtr doc; /* the document */
7370     int n_doc;
7371
7372     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7373     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7374         mem_base = xmlMemBlocks();
7375         output = gen_debug_FILE_ptr(n_output, 0);
7376         doc = gen_xmlDocPtr(n_doc, 1);
7377
7378         xmlDebugDumpEntities(output, doc);
7379         call_tests++;
7380         des_debug_FILE_ptr(n_output, output, 0);
7381         des_xmlDocPtr(n_doc, doc, 1);
7382         xmlResetLastError();
7383         if (mem_base != xmlMemBlocks()) {
7384             printf("Leak of %d blocks found in xmlDebugDumpEntities",
7385                    xmlMemBlocks() - mem_base);
7386             test_ret++;
7387             printf(" %d", n_output);
7388             printf(" %d", n_doc);
7389             printf("\n");
7390         }
7391     }
7392     }
7393     function_tests++;
7394 #endif
7395
7396     return(test_ret);
7397 }
7398
7399
7400 static int
7401 test_xmlDebugDumpNode(void) {
7402     int test_ret = 0;
7403
7404 #if defined(LIBXML_DEBUG_ENABLED)
7405     int mem_base;
7406     FILE * output; /* the FILE * for the output */
7407     int n_output;
7408     xmlNodePtr node; /* the node */
7409     int n_node;
7410     int depth; /* the indentation level. */
7411     int n_depth;
7412
7413     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7414     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7415     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7416         mem_base = xmlMemBlocks();
7417         output = gen_debug_FILE_ptr(n_output, 0);
7418         node = gen_xmlNodePtr(n_node, 1);
7419         depth = gen_int(n_depth, 2);
7420
7421         xmlDebugDumpNode(output, node, depth);
7422         call_tests++;
7423         des_debug_FILE_ptr(n_output, output, 0);
7424         des_xmlNodePtr(n_node, node, 1);
7425         des_int(n_depth, depth, 2);
7426         xmlResetLastError();
7427         if (mem_base != xmlMemBlocks()) {
7428             printf("Leak of %d blocks found in xmlDebugDumpNode",
7429                    xmlMemBlocks() - mem_base);
7430             test_ret++;
7431             printf(" %d", n_output);
7432             printf(" %d", n_node);
7433             printf(" %d", n_depth);
7434             printf("\n");
7435         }
7436     }
7437     }
7438     }
7439     function_tests++;
7440 #endif
7441
7442     return(test_ret);
7443 }
7444
7445
7446 static int
7447 test_xmlDebugDumpNodeList(void) {
7448     int test_ret = 0;
7449
7450 #if defined(LIBXML_DEBUG_ENABLED)
7451     int mem_base;
7452     FILE * output; /* the FILE * for the output */
7453     int n_output;
7454     xmlNodePtr node; /* the node list */
7455     int n_node;
7456     int depth; /* the indentation level. */
7457     int n_depth;
7458
7459     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7460     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7461     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7462         mem_base = xmlMemBlocks();
7463         output = gen_debug_FILE_ptr(n_output, 0);
7464         node = gen_xmlNodePtr(n_node, 1);
7465         depth = gen_int(n_depth, 2);
7466
7467         xmlDebugDumpNodeList(output, node, depth);
7468         call_tests++;
7469         des_debug_FILE_ptr(n_output, output, 0);
7470         des_xmlNodePtr(n_node, node, 1);
7471         des_int(n_depth, depth, 2);
7472         xmlResetLastError();
7473         if (mem_base != xmlMemBlocks()) {
7474             printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7475                    xmlMemBlocks() - mem_base);
7476             test_ret++;
7477             printf(" %d", n_output);
7478             printf(" %d", n_node);
7479             printf(" %d", n_depth);
7480             printf("\n");
7481         }
7482     }
7483     }
7484     }
7485     function_tests++;
7486 #endif
7487
7488     return(test_ret);
7489 }
7490
7491
7492 static int
7493 test_xmlDebugDumpOneNode(void) {
7494     int test_ret = 0;
7495
7496 #if defined(LIBXML_DEBUG_ENABLED)
7497     int mem_base;
7498     FILE * output; /* the FILE * for the output */
7499     int n_output;
7500     xmlNodePtr node; /* the node */
7501     int n_node;
7502     int depth; /* the indentation level. */
7503     int n_depth;
7504
7505     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7506     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7507     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7508         mem_base = xmlMemBlocks();
7509         output = gen_debug_FILE_ptr(n_output, 0);
7510         node = gen_xmlNodePtr(n_node, 1);
7511         depth = gen_int(n_depth, 2);
7512
7513         xmlDebugDumpOneNode(output, node, depth);
7514         call_tests++;
7515         des_debug_FILE_ptr(n_output, output, 0);
7516         des_xmlNodePtr(n_node, node, 1);
7517         des_int(n_depth, depth, 2);
7518         xmlResetLastError();
7519         if (mem_base != xmlMemBlocks()) {
7520             printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7521                    xmlMemBlocks() - mem_base);
7522             test_ret++;
7523             printf(" %d", n_output);
7524             printf(" %d", n_node);
7525             printf(" %d", n_depth);
7526             printf("\n");
7527         }
7528     }
7529     }
7530     }
7531     function_tests++;
7532 #endif
7533
7534     return(test_ret);
7535 }
7536
7537
7538 static int
7539 test_xmlDebugDumpString(void) {
7540     int test_ret = 0;
7541
7542 #if defined(LIBXML_DEBUG_ENABLED)
7543     int mem_base;
7544     FILE * output; /* the FILE * for the output */
7545     int n_output;
7546     xmlChar * str; /* the string */
7547     int n_str;
7548
7549     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7550     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7551         mem_base = xmlMemBlocks();
7552         output = gen_debug_FILE_ptr(n_output, 0);
7553         str = gen_const_xmlChar_ptr(n_str, 1);
7554
7555         xmlDebugDumpString(output, (const xmlChar *)str);
7556         call_tests++;
7557         des_debug_FILE_ptr(n_output, output, 0);
7558         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7559         xmlResetLastError();
7560         if (mem_base != xmlMemBlocks()) {
7561             printf("Leak of %d blocks found in xmlDebugDumpString",
7562                    xmlMemBlocks() - mem_base);
7563             test_ret++;
7564             printf(" %d", n_output);
7565             printf(" %d", n_str);
7566             printf("\n");
7567         }
7568     }
7569     }
7570     function_tests++;
7571 #endif
7572
7573     return(test_ret);
7574 }
7575
7576
7577 static int
7578 test_xmlLsCountNode(void) {
7579     int test_ret = 0;
7580
7581 #if defined(LIBXML_DEBUG_ENABLED)
7582     int mem_base;
7583     int ret_val;
7584     xmlNodePtr node; /* the node to count */
7585     int n_node;
7586
7587     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7588         mem_base = xmlMemBlocks();
7589         node = gen_xmlNodePtr(n_node, 0);
7590
7591         ret_val = xmlLsCountNode(node);
7592         desret_int(ret_val);
7593         call_tests++;
7594         des_xmlNodePtr(n_node, node, 0);
7595         xmlResetLastError();
7596         if (mem_base != xmlMemBlocks()) {
7597             printf("Leak of %d blocks found in xmlLsCountNode",
7598                    xmlMemBlocks() - mem_base);
7599             test_ret++;
7600             printf(" %d", n_node);
7601             printf("\n");
7602         }
7603     }
7604     function_tests++;
7605 #endif
7606
7607     return(test_ret);
7608 }
7609
7610
7611 static int
7612 test_xmlLsOneNode(void) {
7613     int test_ret = 0;
7614
7615 #if defined(LIBXML_DEBUG_ENABLED)
7616     int mem_base;
7617     FILE * output; /* the FILE * for the output */
7618     int n_output;
7619     xmlNodePtr node; /* the node to dump */
7620     int n_node;
7621
7622     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7623     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7624         mem_base = xmlMemBlocks();
7625         output = gen_debug_FILE_ptr(n_output, 0);
7626         node = gen_xmlNodePtr(n_node, 1);
7627
7628         xmlLsOneNode(output, node);
7629         call_tests++;
7630         des_debug_FILE_ptr(n_output, output, 0);
7631         des_xmlNodePtr(n_node, node, 1);
7632         xmlResetLastError();
7633         if (mem_base != xmlMemBlocks()) {
7634             printf("Leak of %d blocks found in xmlLsOneNode",
7635                    xmlMemBlocks() - mem_base);
7636             test_ret++;
7637             printf(" %d", n_output);
7638             printf(" %d", n_node);
7639             printf("\n");
7640         }
7641     }
7642     }
7643     function_tests++;
7644 #endif
7645
7646     return(test_ret);
7647 }
7648
7649
7650 #define gen_nb_char_ptr 1
7651 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7652     return(NULL);
7653 }
7654 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7655 }
7656
7657 static int
7658 test_xmlShell(void) {
7659     int test_ret = 0;
7660
7661
7662     /* missing type support */
7663     return(test_ret);
7664 }
7665
7666
7667 static int
7668 test_xmlShellBase(void) {
7669     int test_ret = 0;
7670
7671 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7672     int mem_base;
7673     int ret_val;
7674     xmlShellCtxtPtr ctxt; /* the shell context */
7675     int n_ctxt;
7676     char * arg; /* unused */
7677     int n_arg;
7678     xmlNodePtr node; /* a node */
7679     int n_node;
7680     xmlNodePtr node2; /* unused */
7681     int n_node2;
7682
7683     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7684     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7685     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7686     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7687         mem_base = xmlMemBlocks();
7688         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7689         arg = gen_char_ptr(n_arg, 1);
7690         node = gen_xmlNodePtr(n_node, 2);
7691         node2 = gen_xmlNodePtr(n_node2, 3);
7692
7693         ret_val = xmlShellBase(ctxt, arg, node, node2);
7694         desret_int(ret_val);
7695         call_tests++;
7696         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7697         des_char_ptr(n_arg, arg, 1);
7698         des_xmlNodePtr(n_node, node, 2);
7699         des_xmlNodePtr(n_node2, node2, 3);
7700         xmlResetLastError();
7701         if (mem_base != xmlMemBlocks()) {
7702             printf("Leak of %d blocks found in xmlShellBase",
7703                    xmlMemBlocks() - mem_base);
7704             test_ret++;
7705             printf(" %d", n_ctxt);
7706             printf(" %d", n_arg);
7707             printf(" %d", n_node);
7708             printf(" %d", n_node2);
7709             printf("\n");
7710         }
7711     }
7712     }
7713     }
7714     }
7715     function_tests++;
7716 #endif
7717
7718     return(test_ret);
7719 }
7720
7721
7722 static int
7723 test_xmlShellCat(void) {
7724     int test_ret = 0;
7725
7726 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7727     int mem_base;
7728     int ret_val;
7729     xmlShellCtxtPtr ctxt; /* the shell context */
7730     int n_ctxt;
7731     char * arg; /* unused */
7732     int n_arg;
7733     xmlNodePtr node; /* a node */
7734     int n_node;
7735     xmlNodePtr node2; /* unused */
7736     int n_node2;
7737
7738     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7739     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7740     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7741     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7742         mem_base = xmlMemBlocks();
7743         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7744         arg = gen_char_ptr(n_arg, 1);
7745         node = gen_xmlNodePtr(n_node, 2);
7746         node2 = gen_xmlNodePtr(n_node2, 3);
7747
7748         ret_val = xmlShellCat(ctxt, arg, node, node2);
7749         desret_int(ret_val);
7750         call_tests++;
7751         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7752         des_char_ptr(n_arg, arg, 1);
7753         des_xmlNodePtr(n_node, node, 2);
7754         des_xmlNodePtr(n_node2, node2, 3);
7755         xmlResetLastError();
7756         if (mem_base != xmlMemBlocks()) {
7757             printf("Leak of %d blocks found in xmlShellCat",
7758                    xmlMemBlocks() - mem_base);
7759             test_ret++;
7760             printf(" %d", n_ctxt);
7761             printf(" %d", n_arg);
7762             printf(" %d", n_node);
7763             printf(" %d", n_node2);
7764             printf("\n");
7765         }
7766     }
7767     }
7768     }
7769     }
7770     function_tests++;
7771 #endif
7772
7773     return(test_ret);
7774 }
7775
7776
7777 static int
7778 test_xmlShellDir(void) {
7779     int test_ret = 0;
7780
7781 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7782     int mem_base;
7783     int ret_val;
7784     xmlShellCtxtPtr ctxt; /* the shell context */
7785     int n_ctxt;
7786     char * arg; /* unused */
7787     int n_arg;
7788     xmlNodePtr node; /* a node */
7789     int n_node;
7790     xmlNodePtr node2; /* unused */
7791     int n_node2;
7792
7793     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7794     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7795     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7796     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7797         mem_base = xmlMemBlocks();
7798         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7799         arg = gen_char_ptr(n_arg, 1);
7800         node = gen_xmlNodePtr(n_node, 2);
7801         node2 = gen_xmlNodePtr(n_node2, 3);
7802
7803         ret_val = xmlShellDir(ctxt, arg, node, node2);
7804         desret_int(ret_val);
7805         call_tests++;
7806         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7807         des_char_ptr(n_arg, arg, 1);
7808         des_xmlNodePtr(n_node, node, 2);
7809         des_xmlNodePtr(n_node2, node2, 3);
7810         xmlResetLastError();
7811         if (mem_base != xmlMemBlocks()) {
7812             printf("Leak of %d blocks found in xmlShellDir",
7813                    xmlMemBlocks() - mem_base);
7814             test_ret++;
7815             printf(" %d", n_ctxt);
7816             printf(" %d", n_arg);
7817             printf(" %d", n_node);
7818             printf(" %d", n_node2);
7819             printf("\n");
7820         }
7821     }
7822     }
7823     }
7824     }
7825     function_tests++;
7826 #endif
7827
7828     return(test_ret);
7829 }
7830
7831
7832 static int
7833 test_xmlShellDu(void) {
7834     int test_ret = 0;
7835
7836 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7837     int mem_base;
7838     int ret_val;
7839     xmlShellCtxtPtr ctxt; /* the shell context */
7840     int n_ctxt;
7841     char * arg; /* unused */
7842     int n_arg;
7843     xmlNodePtr tree; /* a node defining a subtree */
7844     int n_tree;
7845     xmlNodePtr node2; /* unused */
7846     int n_node2;
7847
7848     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7849     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7850     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7851     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7852         mem_base = xmlMemBlocks();
7853         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7854         arg = gen_char_ptr(n_arg, 1);
7855         tree = gen_xmlNodePtr(n_tree, 2);
7856         node2 = gen_xmlNodePtr(n_node2, 3);
7857
7858         ret_val = xmlShellDu(ctxt, arg, tree, node2);
7859         desret_int(ret_val);
7860         call_tests++;
7861         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7862         des_char_ptr(n_arg, arg, 1);
7863         des_xmlNodePtr(n_tree, tree, 2);
7864         des_xmlNodePtr(n_node2, node2, 3);
7865         xmlResetLastError();
7866         if (mem_base != xmlMemBlocks()) {
7867             printf("Leak of %d blocks found in xmlShellDu",
7868                    xmlMemBlocks() - mem_base);
7869             test_ret++;
7870             printf(" %d", n_ctxt);
7871             printf(" %d", n_arg);
7872             printf(" %d", n_tree);
7873             printf(" %d", n_node2);
7874             printf("\n");
7875         }
7876     }
7877     }
7878     }
7879     }
7880     function_tests++;
7881 #endif
7882
7883     return(test_ret);
7884 }
7885
7886
7887 static int
7888 test_xmlShellList(void) {
7889     int test_ret = 0;
7890
7891 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7892     int mem_base;
7893     int ret_val;
7894     xmlShellCtxtPtr ctxt; /* the shell context */
7895     int n_ctxt;
7896     char * arg; /* unused */
7897     int n_arg;
7898     xmlNodePtr node; /* a node */
7899     int n_node;
7900     xmlNodePtr node2; /* unused */
7901     int n_node2;
7902
7903     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7904     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7905     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7906     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7907         mem_base = xmlMemBlocks();
7908         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7909         arg = gen_char_ptr(n_arg, 1);
7910         node = gen_xmlNodePtr(n_node, 2);
7911         node2 = gen_xmlNodePtr(n_node2, 3);
7912
7913         ret_val = xmlShellList(ctxt, arg, node, node2);
7914         desret_int(ret_val);
7915         call_tests++;
7916         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7917         des_char_ptr(n_arg, arg, 1);
7918         des_xmlNodePtr(n_node, node, 2);
7919         des_xmlNodePtr(n_node2, node2, 3);
7920         xmlResetLastError();
7921         if (mem_base != xmlMemBlocks()) {
7922             printf("Leak of %d blocks found in xmlShellList",
7923                    xmlMemBlocks() - mem_base);
7924             test_ret++;
7925             printf(" %d", n_ctxt);
7926             printf(" %d", n_arg);
7927             printf(" %d", n_node);
7928             printf(" %d", n_node2);
7929             printf("\n");
7930         }
7931     }
7932     }
7933     }
7934     }
7935     function_tests++;
7936 #endif
7937
7938     return(test_ret);
7939 }
7940
7941
7942 static int
7943 test_xmlShellLoad(void) {
7944     int test_ret = 0;
7945
7946 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7947     int mem_base;
7948     int ret_val;
7949     xmlShellCtxtPtr ctxt; /* the shell context */
7950     int n_ctxt;
7951     char * filename; /* the file name */
7952     int n_filename;
7953     xmlNodePtr node; /* unused */
7954     int n_node;
7955     xmlNodePtr node2; /* unused */
7956     int n_node2;
7957
7958     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7959     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7960     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7961     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7962         mem_base = xmlMemBlocks();
7963         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7964         filename = gen_char_ptr(n_filename, 1);
7965         node = gen_xmlNodePtr(n_node, 2);
7966         node2 = gen_xmlNodePtr(n_node2, 3);
7967
7968         ret_val = xmlShellLoad(ctxt, filename, node, node2);
7969         desret_int(ret_val);
7970         call_tests++;
7971         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7972         des_char_ptr(n_filename, filename, 1);
7973         des_xmlNodePtr(n_node, node, 2);
7974         des_xmlNodePtr(n_node2, node2, 3);
7975         xmlResetLastError();
7976         if (mem_base != xmlMemBlocks()) {
7977             printf("Leak of %d blocks found in xmlShellLoad",
7978                    xmlMemBlocks() - mem_base);
7979             test_ret++;
7980             printf(" %d", n_ctxt);
7981             printf(" %d", n_filename);
7982             printf(" %d", n_node);
7983             printf(" %d", n_node2);
7984             printf("\n");
7985         }
7986     }
7987     }
7988     }
7989     }
7990     function_tests++;
7991 #endif
7992
7993     return(test_ret);
7994 }
7995
7996
7997 static int
7998 test_xmlShellPrintXPathResult(void) {
7999     int test_ret = 0;
8000
8001 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
8002     int mem_base;
8003     xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
8004     int n_list;
8005
8006     for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
8007         mem_base = xmlMemBlocks();
8008         list = gen_xmlXPathObjectPtr(n_list, 0);
8009
8010         xmlShellPrintXPathResult(list);
8011         call_tests++;
8012         des_xmlXPathObjectPtr(n_list, list, 0);
8013         xmlResetLastError();
8014         if (mem_base != xmlMemBlocks()) {
8015             printf("Leak of %d blocks found in xmlShellPrintXPathResult",
8016                    xmlMemBlocks() - mem_base);
8017             test_ret++;
8018             printf(" %d", n_list);
8019             printf("\n");
8020         }
8021     }
8022     function_tests++;
8023 #endif
8024
8025     return(test_ret);
8026 }
8027
8028
8029 static int
8030 test_xmlShellPwd(void) {
8031     int test_ret = 0;
8032
8033 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
8034     int mem_base;
8035     int ret_val;
8036     xmlShellCtxtPtr ctxt; /* the shell context */
8037     int n_ctxt;
8038     char * buffer; /* the output buffer */
8039     int n_buffer;
8040     xmlNodePtr node; /* a node */
8041     int n_node;
8042     xmlNodePtr node2; /* unused */
8043     int n_node2;
8044
8045     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8046     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
8047     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8048     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8049         mem_base = xmlMemBlocks();
8050         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8051         buffer = gen_char_ptr(n_buffer, 1);
8052         node = gen_xmlNodePtr(n_node, 2);
8053         node2 = gen_xmlNodePtr(n_node2, 3);
8054
8055         ret_val = xmlShellPwd(ctxt, buffer, node, node2);
8056         desret_int(ret_val);
8057         call_tests++;
8058         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8059         des_char_ptr(n_buffer, buffer, 1);
8060         des_xmlNodePtr(n_node, node, 2);
8061         des_xmlNodePtr(n_node2, node2, 3);
8062         xmlResetLastError();
8063         if (mem_base != xmlMemBlocks()) {
8064             printf("Leak of %d blocks found in xmlShellPwd",
8065                    xmlMemBlocks() - mem_base);
8066             test_ret++;
8067             printf(" %d", n_ctxt);
8068             printf(" %d", n_buffer);
8069             printf(" %d", n_node);
8070             printf(" %d", n_node2);
8071             printf("\n");
8072         }
8073     }
8074     }
8075     }
8076     }
8077     function_tests++;
8078 #endif
8079
8080     return(test_ret);
8081 }
8082
8083
8084 static int
8085 test_xmlShellSave(void) {
8086     int test_ret = 0;
8087
8088 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8089     int mem_base;
8090     int ret_val;
8091     xmlShellCtxtPtr ctxt; /* the shell context */
8092     int n_ctxt;
8093     char * filename; /* the file name (optional) */
8094     int n_filename;
8095     xmlNodePtr node; /* unused */
8096     int n_node;
8097     xmlNodePtr node2; /* unused */
8098     int n_node2;
8099
8100     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8101     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8102     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8103     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8104         mem_base = xmlMemBlocks();
8105         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8106         filename = gen_char_ptr(n_filename, 1);
8107         node = gen_xmlNodePtr(n_node, 2);
8108         node2 = gen_xmlNodePtr(n_node2, 3);
8109
8110         ret_val = xmlShellSave(ctxt, filename, node, node2);
8111         desret_int(ret_val);
8112         call_tests++;
8113         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8114         des_char_ptr(n_filename, filename, 1);
8115         des_xmlNodePtr(n_node, node, 2);
8116         des_xmlNodePtr(n_node2, node2, 3);
8117         xmlResetLastError();
8118         if (mem_base != xmlMemBlocks()) {
8119             printf("Leak of %d blocks found in xmlShellSave",
8120                    xmlMemBlocks() - mem_base);
8121             test_ret++;
8122             printf(" %d", n_ctxt);
8123             printf(" %d", n_filename);
8124             printf(" %d", n_node);
8125             printf(" %d", n_node2);
8126             printf("\n");
8127         }
8128     }
8129     }
8130     }
8131     }
8132     function_tests++;
8133 #endif
8134
8135     return(test_ret);
8136 }
8137
8138
8139 static int
8140 test_xmlShellValidate(void) {
8141     int test_ret = 0;
8142
8143 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
8144     int mem_base;
8145     int ret_val;
8146     xmlShellCtxtPtr ctxt; /* the shell context */
8147     int n_ctxt;
8148     char * dtd; /* the DTD URI (optional) */
8149     int n_dtd;
8150     xmlNodePtr node; /* unused */
8151     int n_node;
8152     xmlNodePtr node2; /* unused */
8153     int n_node2;
8154
8155     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8156     for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8157     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8158     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8159         mem_base = xmlMemBlocks();
8160         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8161         dtd = gen_char_ptr(n_dtd, 1);
8162         node = gen_xmlNodePtr(n_node, 2);
8163         node2 = gen_xmlNodePtr(n_node2, 3);
8164
8165         ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8166         desret_int(ret_val);
8167         call_tests++;
8168         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8169         des_char_ptr(n_dtd, dtd, 1);
8170         des_xmlNodePtr(n_node, node, 2);
8171         des_xmlNodePtr(n_node2, node2, 3);
8172         xmlResetLastError();
8173         if (mem_base != xmlMemBlocks()) {
8174             printf("Leak of %d blocks found in xmlShellValidate",
8175                    xmlMemBlocks() - mem_base);
8176             test_ret++;
8177             printf(" %d", n_ctxt);
8178             printf(" %d", n_dtd);
8179             printf(" %d", n_node);
8180             printf(" %d", n_node2);
8181             printf("\n");
8182         }
8183     }
8184     }
8185     }
8186     }
8187     function_tests++;
8188 #endif
8189
8190     return(test_ret);
8191 }
8192
8193
8194 static int
8195 test_xmlShellWrite(void) {
8196     int test_ret = 0;
8197
8198 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8199     int mem_base;
8200     int ret_val;
8201     xmlShellCtxtPtr ctxt; /* the shell context */
8202     int n_ctxt;
8203     char * filename; /* the file name */
8204     int n_filename;
8205     xmlNodePtr node; /* a node in the tree */
8206     int n_node;
8207     xmlNodePtr node2; /* unused */
8208     int n_node2;
8209
8210     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8211     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8212     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8213     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8214         mem_base = xmlMemBlocks();
8215         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8216         filename = gen_char_ptr(n_filename, 1);
8217         node = gen_xmlNodePtr(n_node, 2);
8218         node2 = gen_xmlNodePtr(n_node2, 3);
8219
8220         ret_val = xmlShellWrite(ctxt, filename, node, node2);
8221         desret_int(ret_val);
8222         call_tests++;
8223         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8224         des_char_ptr(n_filename, filename, 1);
8225         des_xmlNodePtr(n_node, node, 2);
8226         des_xmlNodePtr(n_node2, node2, 3);
8227         xmlResetLastError();
8228         if (mem_base != xmlMemBlocks()) {
8229             printf("Leak of %d blocks found in xmlShellWrite",
8230                    xmlMemBlocks() - mem_base);
8231             test_ret++;
8232             printf(" %d", n_ctxt);
8233             printf(" %d", n_filename);
8234             printf(" %d", n_node);
8235             printf(" %d", n_node2);
8236             printf("\n");
8237         }
8238     }
8239     }
8240     }
8241     }
8242     function_tests++;
8243 #endif
8244
8245     return(test_ret);
8246 }
8247
8248 static int
8249 test_debugXML(void) {
8250     int test_ret = 0;
8251         int rc = 0;
8252
8253     if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8254     rc = test_xmlBoolToText();
8255         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8256     rc = test_xmlDebugCheckDocument();
8257         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8258     rc = test_xmlDebugDumpAttr();
8259         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8260     rc = test_xmlDebugDumpAttrList();
8261         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8262     rc = test_xmlDebugDumpDTD();
8263         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8264     rc = test_xmlDebugDumpDocument();
8265         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8266     rc = test_xmlDebugDumpDocumentHead();
8267         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8268     rc = test_xmlDebugDumpEntities();
8269         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8270     rc = test_xmlDebugDumpNode();
8271         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8272     rc = test_xmlDebugDumpNodeList();
8273         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8274     rc = test_xmlDebugDumpOneNode();
8275         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8276     rc = test_xmlDebugDumpString();
8277         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8278     rc = test_xmlLsCountNode();
8279         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8280     rc = test_xmlLsOneNode();
8281         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8282     rc = test_xmlShell();
8283         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8284     rc = test_xmlShellBase();
8285         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8286     rc = test_xmlShellCat();
8287         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8288     rc = test_xmlShellDir();
8289         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8290     rc = test_xmlShellDu();
8291         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8292     rc = test_xmlShellList();
8293         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8294     rc = test_xmlShellLoad();
8295         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8296     rc = test_xmlShellPrintXPathResult();
8297         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8298     rc = test_xmlShellPwd();
8299         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8300     rc = test_xmlShellSave();
8301         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8302     rc = test_xmlShellValidate();
8303         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8304     rc = test_xmlShellWrite();
8305         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8306
8307     if (test_ret != 0)
8308         printf("Module debugXML: %d errors\n", test_ret);
8309     return(test_ret);
8310 }
8311
8312 static int
8313 test_xmlDictCleanup(void) {
8314     int test_ret = 0;
8315
8316     int mem_base;
8317
8318         mem_base = xmlMemBlocks();
8319
8320         xmlDictCleanup();
8321         call_tests++;
8322         xmlResetLastError();
8323         if (mem_base != xmlMemBlocks()) {
8324             printf("Leak of %d blocks found in xmlDictCleanup",
8325                    xmlMemBlocks() - mem_base);
8326             test_ret++;
8327             printf("\n");
8328         }
8329     function_tests++;
8330
8331     return(test_ret);
8332 }
8333
8334
8335 static int
8336 test_xmlDictCreate(void) {
8337     int test_ret = 0;
8338
8339     int mem_base;
8340     xmlDictPtr ret_val;
8341
8342         mem_base = xmlMemBlocks();
8343
8344         ret_val = xmlDictCreate();
8345         desret_xmlDictPtr(ret_val);
8346         call_tests++;
8347         xmlResetLastError();
8348         if (mem_base != xmlMemBlocks()) {
8349             printf("Leak of %d blocks found in xmlDictCreate",
8350                    xmlMemBlocks() - mem_base);
8351             test_ret++;
8352             printf("\n");
8353         }
8354     function_tests++;
8355
8356     return(test_ret);
8357 }
8358
8359
8360 static int
8361 test_xmlDictCreateSub(void) {
8362     int test_ret = 0;
8363
8364     int mem_base;
8365     xmlDictPtr ret_val;
8366     xmlDictPtr sub; /* an existing dictionary */
8367     int n_sub;
8368
8369     for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8370         mem_base = xmlMemBlocks();
8371         sub = gen_xmlDictPtr(n_sub, 0);
8372
8373         ret_val = xmlDictCreateSub(sub);
8374         desret_xmlDictPtr(ret_val);
8375         call_tests++;
8376         des_xmlDictPtr(n_sub, sub, 0);
8377         xmlResetLastError();
8378         if (mem_base != xmlMemBlocks()) {
8379             printf("Leak of %d blocks found in xmlDictCreateSub",
8380                    xmlMemBlocks() - mem_base);
8381             test_ret++;
8382             printf(" %d", n_sub);
8383             printf("\n");
8384         }
8385     }
8386     function_tests++;
8387
8388     return(test_ret);
8389 }
8390
8391
8392 static int
8393 test_xmlDictExists(void) {
8394     int test_ret = 0;
8395
8396     int mem_base;
8397     const xmlChar * ret_val;
8398     xmlDictPtr dict; /* the dictionary */
8399     int n_dict;
8400     xmlChar * name; /* the name of the userdata */
8401     int n_name;
8402     int len; /* the length of the name, if -1 it is recomputed */
8403     int n_len;
8404
8405     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8406     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8407     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8408         mem_base = xmlMemBlocks();
8409         dict = gen_xmlDictPtr(n_dict, 0);
8410         name = gen_const_xmlChar_ptr(n_name, 1);
8411         len = gen_int(n_len, 2);
8412         if ((name != NULL) &&
8413             (len > (int) strlen((const char *) name) + 1))
8414             continue;
8415
8416         ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8417         desret_const_xmlChar_ptr(ret_val);
8418         call_tests++;
8419         des_xmlDictPtr(n_dict, dict, 0);
8420         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8421         des_int(n_len, len, 2);
8422         xmlResetLastError();
8423         if (mem_base != xmlMemBlocks()) {
8424             printf("Leak of %d blocks found in xmlDictExists",
8425                    xmlMemBlocks() - mem_base);
8426             test_ret++;
8427             printf(" %d", n_dict);
8428             printf(" %d", n_name);
8429             printf(" %d", n_len);
8430             printf("\n");
8431         }
8432     }
8433     }
8434     }
8435     function_tests++;
8436
8437     return(test_ret);
8438 }
8439
8440
8441 static int
8442 test_xmlDictGetUsage(void) {
8443     int test_ret = 0;
8444
8445
8446     /* missing type support */
8447     return(test_ret);
8448 }
8449
8450
8451 static int
8452 test_xmlDictLookup(void) {
8453     int test_ret = 0;
8454
8455     int mem_base;
8456     const xmlChar * ret_val;
8457     xmlDictPtr dict; /* the dictionary */
8458     int n_dict;
8459     xmlChar * name; /* the name of the userdata */
8460     int n_name;
8461     int len; /* the length of the name, if -1 it is recomputed */
8462     int n_len;
8463
8464     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8465     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8466     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8467         mem_base = xmlMemBlocks();
8468         dict = gen_xmlDictPtr(n_dict, 0);
8469         name = gen_const_xmlChar_ptr(n_name, 1);
8470         len = gen_int(n_len, 2);
8471         if ((name != NULL) &&
8472             (len > (int) strlen((const char *) name) + 1))
8473             continue;
8474
8475         ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8476         desret_const_xmlChar_ptr(ret_val);
8477         call_tests++;
8478         des_xmlDictPtr(n_dict, dict, 0);
8479         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8480         des_int(n_len, len, 2);
8481         xmlResetLastError();
8482         if (mem_base != xmlMemBlocks()) {
8483             printf("Leak of %d blocks found in xmlDictLookup",
8484                    xmlMemBlocks() - mem_base);
8485             test_ret++;
8486             printf(" %d", n_dict);
8487             printf(" %d", n_name);
8488             printf(" %d", n_len);
8489             printf("\n");
8490         }
8491     }
8492     }
8493     }
8494     function_tests++;
8495
8496     return(test_ret);
8497 }
8498
8499
8500 static int
8501 test_xmlDictOwns(void) {
8502     int test_ret = 0;
8503
8504     int mem_base;
8505     int ret_val;
8506     xmlDictPtr dict; /* the dictionary */
8507     int n_dict;
8508     xmlChar * str; /* the string */
8509     int n_str;
8510
8511     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8512     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8513         mem_base = xmlMemBlocks();
8514         dict = gen_xmlDictPtr(n_dict, 0);
8515         str = gen_const_xmlChar_ptr(n_str, 1);
8516
8517         ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8518         desret_int(ret_val);
8519         call_tests++;
8520         des_xmlDictPtr(n_dict, dict, 0);
8521         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8522         xmlResetLastError();
8523         if (mem_base != xmlMemBlocks()) {
8524             printf("Leak of %d blocks found in xmlDictOwns",
8525                    xmlMemBlocks() - mem_base);
8526             test_ret++;
8527             printf(" %d", n_dict);
8528             printf(" %d", n_str);
8529             printf("\n");
8530         }
8531     }
8532     }
8533     function_tests++;
8534
8535     return(test_ret);
8536 }
8537
8538
8539 static int
8540 test_xmlDictQLookup(void) {
8541     int test_ret = 0;
8542
8543     int mem_base;
8544     const xmlChar * ret_val;
8545     xmlDictPtr dict; /* the dictionary */
8546     int n_dict;
8547     xmlChar * prefix; /* the prefix */
8548     int n_prefix;
8549     xmlChar * name; /* the name */
8550     int n_name;
8551
8552     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8553     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8554     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8555         mem_base = xmlMemBlocks();
8556         dict = gen_xmlDictPtr(n_dict, 0);
8557         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8558         name = gen_const_xmlChar_ptr(n_name, 2);
8559
8560         ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8561         desret_const_xmlChar_ptr(ret_val);
8562         call_tests++;
8563         des_xmlDictPtr(n_dict, dict, 0);
8564         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8565         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8566         xmlResetLastError();
8567         if (mem_base != xmlMemBlocks()) {
8568             printf("Leak of %d blocks found in xmlDictQLookup",
8569                    xmlMemBlocks() - mem_base);
8570             test_ret++;
8571             printf(" %d", n_dict);
8572             printf(" %d", n_prefix);
8573             printf(" %d", n_name);
8574             printf("\n");
8575         }
8576     }
8577     }
8578     }
8579     function_tests++;
8580
8581     return(test_ret);
8582 }
8583
8584
8585 static int
8586 test_xmlDictReference(void) {
8587     int test_ret = 0;
8588
8589     int mem_base;
8590     int ret_val;
8591     xmlDictPtr dict; /* the dictionary */
8592     int n_dict;
8593
8594     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8595         mem_base = xmlMemBlocks();
8596         dict = gen_xmlDictPtr(n_dict, 0);
8597
8598         ret_val = xmlDictReference(dict);
8599         xmlDictFree(dict);
8600         desret_int(ret_val);
8601         call_tests++;
8602         des_xmlDictPtr(n_dict, dict, 0);
8603         xmlResetLastError();
8604         if (mem_base != xmlMemBlocks()) {
8605             printf("Leak of %d blocks found in xmlDictReference",
8606                    xmlMemBlocks() - mem_base);
8607             test_ret++;
8608             printf(" %d", n_dict);
8609             printf("\n");
8610         }
8611     }
8612     function_tests++;
8613
8614     return(test_ret);
8615 }
8616
8617
8618 static int
8619 test_xmlDictSetLimit(void) {
8620     int test_ret = 0;
8621
8622
8623     /* missing type support */
8624     return(test_ret);
8625 }
8626
8627
8628 static int
8629 test_xmlDictSize(void) {
8630     int test_ret = 0;
8631
8632     int mem_base;
8633     int ret_val;
8634     xmlDictPtr dict; /* the dictionary */
8635     int n_dict;
8636
8637     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8638         mem_base = xmlMemBlocks();
8639         dict = gen_xmlDictPtr(n_dict, 0);
8640
8641         ret_val = xmlDictSize(dict);
8642         desret_int(ret_val);
8643         call_tests++;
8644         des_xmlDictPtr(n_dict, dict, 0);
8645         xmlResetLastError();
8646         if (mem_base != xmlMemBlocks()) {
8647             printf("Leak of %d blocks found in xmlDictSize",
8648                    xmlMemBlocks() - mem_base);
8649             test_ret++;
8650             printf(" %d", n_dict);
8651             printf("\n");
8652         }
8653     }
8654     function_tests++;
8655
8656     return(test_ret);
8657 }
8658
8659
8660 static int
8661 test_xmlInitializeDict(void) {
8662     int test_ret = 0;
8663
8664     int mem_base;
8665     int ret_val;
8666
8667         mem_base = xmlMemBlocks();
8668
8669         ret_val = xmlInitializeDict();
8670         desret_int(ret_val);
8671         call_tests++;
8672         xmlResetLastError();
8673         if (mem_base != xmlMemBlocks()) {
8674             printf("Leak of %d blocks found in xmlInitializeDict",
8675                    xmlMemBlocks() - mem_base);
8676             test_ret++;
8677             printf("\n");
8678         }
8679     function_tests++;
8680
8681     return(test_ret);
8682 }
8683
8684 static int
8685 test_dict(void) {
8686     int test_ret = 0;
8687         int rc = 0;
8688
8689     if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
8690     rc = test_xmlDictCleanup();
8691         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8692     rc = test_xmlDictCreate();
8693         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8694     rc = test_xmlDictCreateSub();
8695         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8696     rc = test_xmlDictExists();
8697         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8698     rc = test_xmlDictGetUsage();
8699         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8700     rc = test_xmlDictLookup();
8701         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8702     rc = test_xmlDictOwns();
8703         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8704     rc = test_xmlDictQLookup();
8705         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8706     rc = test_xmlDictReference();
8707         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8708     rc = test_xmlDictSetLimit();
8709         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8710     rc = test_xmlDictSize();
8711         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8712     rc = test_xmlInitializeDict();
8713         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
8714
8715     if (test_ret != 0)
8716         printf("Module dict: %d errors\n", test_ret);
8717     return(test_ret);
8718 }
8719
8720 static int
8721 test_UTF8Toisolat1(void) {
8722     int test_ret = 0;
8723
8724 #if defined(LIBXML_OUTPUT_ENABLED)
8725 #ifdef LIBXML_OUTPUT_ENABLED
8726     int mem_base;
8727     int ret_val;
8728     unsigned char * out; /* a pointer to an array of bytes to store the result */
8729     int n_out;
8730     int * outlen; /* the length of @out */
8731     int n_outlen;
8732     unsigned char * in; /* a pointer to an array of UTF-8 chars */
8733     int n_in;
8734     int * inlen; /* the length of @in */
8735     int n_inlen;
8736
8737     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8738     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8739     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8740     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8741         mem_base = xmlMemBlocks();
8742         out = gen_unsigned_char_ptr(n_out, 0);
8743         outlen = gen_int_ptr(n_outlen, 1);
8744         in = gen_const_unsigned_char_ptr(n_in, 2);
8745         inlen = gen_int_ptr(n_inlen, 3);
8746
8747         ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8748         desret_int(ret_val);
8749         call_tests++;
8750         des_unsigned_char_ptr(n_out, out, 0);
8751         des_int_ptr(n_outlen, outlen, 1);
8752         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8753         des_int_ptr(n_inlen, inlen, 3);
8754         xmlResetLastError();
8755         if (mem_base != xmlMemBlocks()) {
8756             printf("Leak of %d blocks found in UTF8Toisolat1",
8757                    xmlMemBlocks() - mem_base);
8758             test_ret++;
8759             printf(" %d", n_out);
8760             printf(" %d", n_outlen);
8761             printf(" %d", n_in);
8762             printf(" %d", n_inlen);
8763             printf("\n");
8764         }
8765     }
8766     }
8767     }
8768     }
8769     function_tests++;
8770 #endif
8771 #endif
8772
8773     return(test_ret);
8774 }
8775
8776
8777 static int
8778 test_isolat1ToUTF8(void) {
8779     int test_ret = 0;
8780
8781     int mem_base;
8782     int ret_val;
8783     unsigned char * out; /* a pointer to an array of bytes to store the result */
8784     int n_out;
8785     int * outlen; /* the length of @out */
8786     int n_outlen;
8787     unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8788     int n_in;
8789     int * inlen; /* the length of @in */
8790     int n_inlen;
8791
8792     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8793     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8794     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8795     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8796         mem_base = xmlMemBlocks();
8797         out = gen_unsigned_char_ptr(n_out, 0);
8798         outlen = gen_int_ptr(n_outlen, 1);
8799         in = gen_const_unsigned_char_ptr(n_in, 2);
8800         inlen = gen_int_ptr(n_inlen, 3);
8801
8802         ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8803         desret_int(ret_val);
8804         call_tests++;
8805         des_unsigned_char_ptr(n_out, out, 0);
8806         des_int_ptr(n_outlen, outlen, 1);
8807         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8808         des_int_ptr(n_inlen, inlen, 3);
8809         xmlResetLastError();
8810         if (mem_base != xmlMemBlocks()) {
8811             printf("Leak of %d blocks found in isolat1ToUTF8",
8812                    xmlMemBlocks() - mem_base);
8813             test_ret++;
8814             printf(" %d", n_out);
8815             printf(" %d", n_outlen);
8816             printf(" %d", n_in);
8817             printf(" %d", n_inlen);
8818             printf("\n");
8819         }
8820     }
8821     }
8822     }
8823     }
8824     function_tests++;
8825
8826     return(test_ret);
8827 }
8828
8829
8830 static int
8831 test_xmlAddEncodingAlias(void) {
8832     int test_ret = 0;
8833
8834     int ret_val;
8835     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8836     int n_name;
8837     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8838     int n_alias;
8839
8840     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8841     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8842         name = gen_const_char_ptr(n_name, 0);
8843         alias = gen_const_char_ptr(n_alias, 1);
8844
8845         ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8846         desret_int(ret_val);
8847         call_tests++;
8848         des_const_char_ptr(n_name, (const char *)name, 0);
8849         des_const_char_ptr(n_alias, (const char *)alias, 1);
8850         xmlResetLastError();
8851     }
8852     }
8853     function_tests++;
8854
8855     return(test_ret);
8856 }
8857
8858
8859 #define gen_nb_xmlCharEncodingHandler_ptr 1
8860 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8861     return(NULL);
8862 }
8863 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8864 }
8865
8866 static int
8867 test_xmlCharEncCloseFunc(void) {
8868     int test_ret = 0;
8869
8870     int mem_base;
8871     int ret_val;
8872     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8873     int n_handler;
8874
8875     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8876         mem_base = xmlMemBlocks();
8877         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8878
8879         ret_val = xmlCharEncCloseFunc(handler);
8880         desret_int(ret_val);
8881         call_tests++;
8882         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8883         xmlResetLastError();
8884         if (mem_base != xmlMemBlocks()) {
8885             printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8886                    xmlMemBlocks() - mem_base);
8887             test_ret++;
8888             printf(" %d", n_handler);
8889             printf("\n");
8890         }
8891     }
8892     function_tests++;
8893
8894     return(test_ret);
8895 }
8896
8897
8898 static int
8899 test_xmlCharEncFirstLine(void) {
8900     int test_ret = 0;
8901
8902     int mem_base;
8903     int ret_val;
8904     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8905     int n_handler;
8906     xmlBufferPtr out; /* an xmlBuffer for the output. */
8907     int n_out;
8908     xmlBufferPtr in; /* an xmlBuffer for the input */
8909     int n_in;
8910
8911     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8912     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8913     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8914         mem_base = xmlMemBlocks();
8915         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8916         out = gen_xmlBufferPtr(n_out, 1);
8917         in = gen_xmlBufferPtr(n_in, 2);
8918
8919         ret_val = xmlCharEncFirstLine(handler, out, in);
8920         desret_int(ret_val);
8921         call_tests++;
8922         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8923         des_xmlBufferPtr(n_out, out, 1);
8924         des_xmlBufferPtr(n_in, in, 2);
8925         xmlResetLastError();
8926         if (mem_base != xmlMemBlocks()) {
8927             printf("Leak of %d blocks found in xmlCharEncFirstLine",
8928                    xmlMemBlocks() - mem_base);
8929             test_ret++;
8930             printf(" %d", n_handler);
8931             printf(" %d", n_out);
8932             printf(" %d", n_in);
8933             printf("\n");
8934         }
8935     }
8936     }
8937     }
8938     function_tests++;
8939
8940     return(test_ret);
8941 }
8942
8943
8944 static int
8945 test_xmlCharEncInFunc(void) {
8946     int test_ret = 0;
8947
8948     int mem_base;
8949     int ret_val;
8950     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8951     int n_handler;
8952     xmlBufferPtr out; /* an xmlBuffer for the output. */
8953     int n_out;
8954     xmlBufferPtr in; /* an xmlBuffer for the input */
8955     int n_in;
8956
8957     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8958     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8959     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8960         mem_base = xmlMemBlocks();
8961         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8962         out = gen_xmlBufferPtr(n_out, 1);
8963         in = gen_xmlBufferPtr(n_in, 2);
8964
8965         ret_val = xmlCharEncInFunc(handler, out, in);
8966         desret_int(ret_val);
8967         call_tests++;
8968         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8969         des_xmlBufferPtr(n_out, out, 1);
8970         des_xmlBufferPtr(n_in, in, 2);
8971         xmlResetLastError();
8972         if (mem_base != xmlMemBlocks()) {
8973             printf("Leak of %d blocks found in xmlCharEncInFunc",
8974                    xmlMemBlocks() - mem_base);
8975             test_ret++;
8976             printf(" %d", n_handler);
8977             printf(" %d", n_out);
8978             printf(" %d", n_in);
8979             printf("\n");
8980         }
8981     }
8982     }
8983     }
8984     function_tests++;
8985
8986     return(test_ret);
8987 }
8988
8989
8990 static int
8991 test_xmlCharEncOutFunc(void) {
8992     int test_ret = 0;
8993
8994     int mem_base;
8995     int ret_val;
8996     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8997     int n_handler;
8998     xmlBufferPtr out; /* an xmlBuffer for the output. */
8999     int n_out;
9000     xmlBufferPtr in; /* an xmlBuffer for the input */
9001     int n_in;
9002
9003     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
9004     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
9005     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
9006         mem_base = xmlMemBlocks();
9007         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
9008         out = gen_xmlBufferPtr(n_out, 1);
9009         in = gen_xmlBufferPtr(n_in, 2);
9010
9011         ret_val = xmlCharEncOutFunc(handler, out, in);
9012         desret_int(ret_val);
9013         call_tests++;
9014         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
9015         des_xmlBufferPtr(n_out, out, 1);
9016         des_xmlBufferPtr(n_in, in, 2);
9017         xmlResetLastError();
9018         if (mem_base != xmlMemBlocks()) {
9019             printf("Leak of %d blocks found in xmlCharEncOutFunc",
9020                    xmlMemBlocks() - mem_base);
9021             test_ret++;
9022             printf(" %d", n_handler);
9023             printf(" %d", n_out);
9024             printf(" %d", n_in);
9025             printf("\n");
9026         }
9027     }
9028     }
9029     }
9030     function_tests++;
9031
9032     return(test_ret);
9033 }
9034
9035
9036 static int
9037 test_xmlCleanupCharEncodingHandlers(void) {
9038     int test_ret = 0;
9039
9040
9041
9042         xmlCleanupCharEncodingHandlers();
9043         call_tests++;
9044         xmlResetLastError();
9045     function_tests++;
9046
9047     return(test_ret);
9048 }
9049
9050
9051 static int
9052 test_xmlCleanupEncodingAliases(void) {
9053     int test_ret = 0;
9054
9055     int mem_base;
9056
9057         mem_base = xmlMemBlocks();
9058
9059         xmlCleanupEncodingAliases();
9060         call_tests++;
9061         xmlResetLastError();
9062         if (mem_base != xmlMemBlocks()) {
9063             printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
9064                    xmlMemBlocks() - mem_base);
9065             test_ret++;
9066             printf("\n");
9067         }
9068     function_tests++;
9069
9070     return(test_ret);
9071 }
9072
9073
9074 static int
9075 test_xmlDelEncodingAlias(void) {
9076     int test_ret = 0;
9077
9078     int mem_base;
9079     int ret_val;
9080     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
9081     int n_alias;
9082
9083     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9084         mem_base = xmlMemBlocks();
9085         alias = gen_const_char_ptr(n_alias, 0);
9086
9087         ret_val = xmlDelEncodingAlias((const char *)alias);
9088         desret_int(ret_val);
9089         call_tests++;
9090         des_const_char_ptr(n_alias, (const char *)alias, 0);
9091         xmlResetLastError();
9092         if (mem_base != xmlMemBlocks()) {
9093             printf("Leak of %d blocks found in xmlDelEncodingAlias",
9094                    xmlMemBlocks() - mem_base);
9095             test_ret++;
9096             printf(" %d", n_alias);
9097             printf("\n");
9098         }
9099     }
9100     function_tests++;
9101
9102     return(test_ret);
9103 }
9104
9105
9106 static int
9107 test_xmlDetectCharEncoding(void) {
9108     int test_ret = 0;
9109
9110     int mem_base;
9111     xmlCharEncoding ret_val;
9112     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). */
9113     int n_in;
9114     int len; /* pointer to the length of the buffer */
9115     int n_len;
9116
9117     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
9118     for (n_len = 0;n_len < gen_nb_int;n_len++) {
9119         mem_base = xmlMemBlocks();
9120         in = gen_const_unsigned_char_ptr(n_in, 0);
9121         len = gen_int(n_len, 1);
9122
9123         ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
9124         desret_xmlCharEncoding(ret_val);
9125         call_tests++;
9126         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
9127         des_int(n_len, len, 1);
9128         xmlResetLastError();
9129         if (mem_base != xmlMemBlocks()) {
9130             printf("Leak of %d blocks found in xmlDetectCharEncoding",
9131                    xmlMemBlocks() - mem_base);
9132             test_ret++;
9133             printf(" %d", n_in);
9134             printf(" %d", n_len);
9135             printf("\n");
9136         }
9137     }
9138     }
9139     function_tests++;
9140
9141     return(test_ret);
9142 }
9143
9144
9145 static int
9146 test_xmlFindCharEncodingHandler(void) {
9147     int test_ret = 0;
9148
9149
9150     /* missing type support */
9151     return(test_ret);
9152 }
9153
9154
9155 static int
9156 test_xmlGetCharEncodingHandler(void) {
9157     int test_ret = 0;
9158
9159
9160     /* missing type support */
9161     return(test_ret);
9162 }
9163
9164
9165 static int
9166 test_xmlGetCharEncodingName(void) {
9167     int test_ret = 0;
9168
9169     int mem_base;
9170     const char * ret_val;
9171     xmlCharEncoding enc; /* the encoding */
9172     int n_enc;
9173
9174     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
9175         mem_base = xmlMemBlocks();
9176         enc = gen_xmlCharEncoding(n_enc, 0);
9177
9178         ret_val = xmlGetCharEncodingName(enc);
9179         desret_const_char_ptr(ret_val);
9180         call_tests++;
9181         des_xmlCharEncoding(n_enc, enc, 0);
9182         xmlResetLastError();
9183         if (mem_base != xmlMemBlocks()) {
9184             printf("Leak of %d blocks found in xmlGetCharEncodingName",
9185                    xmlMemBlocks() - mem_base);
9186             test_ret++;
9187             printf(" %d", n_enc);
9188             printf("\n");
9189         }
9190     }
9191     function_tests++;
9192
9193     return(test_ret);
9194 }
9195
9196
9197 static int
9198 test_xmlGetEncodingAlias(void) {
9199     int test_ret = 0;
9200
9201     int mem_base;
9202     const char * ret_val;
9203     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
9204     int n_alias;
9205
9206     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
9207         mem_base = xmlMemBlocks();
9208         alias = gen_const_char_ptr(n_alias, 0);
9209
9210         ret_val = xmlGetEncodingAlias((const char *)alias);
9211         desret_const_char_ptr(ret_val);
9212         call_tests++;
9213         des_const_char_ptr(n_alias, (const char *)alias, 0);
9214         xmlResetLastError();
9215         if (mem_base != xmlMemBlocks()) {
9216             printf("Leak of %d blocks found in xmlGetEncodingAlias",
9217                    xmlMemBlocks() - mem_base);
9218             test_ret++;
9219             printf(" %d", n_alias);
9220             printf("\n");
9221         }
9222     }
9223     function_tests++;
9224
9225     return(test_ret);
9226 }
9227
9228
9229 static int
9230 test_xmlInitCharEncodingHandlers(void) {
9231     int test_ret = 0;
9232
9233
9234
9235         xmlInitCharEncodingHandlers();
9236         call_tests++;
9237         xmlResetLastError();
9238     function_tests++;
9239
9240     return(test_ret);
9241 }
9242
9243
9244 static int
9245 test_xmlNewCharEncodingHandler(void) {
9246     int test_ret = 0;
9247
9248
9249     /* missing type support */
9250     return(test_ret);
9251 }
9252
9253
9254 static int
9255 test_xmlParseCharEncoding(void) {
9256     int test_ret = 0;
9257
9258     int mem_base;
9259     xmlCharEncoding ret_val;
9260     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9261     int n_name;
9262
9263     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9264         mem_base = xmlMemBlocks();
9265         name = gen_const_char_ptr(n_name, 0);
9266
9267         ret_val = xmlParseCharEncoding((const char *)name);
9268         desret_xmlCharEncoding(ret_val);
9269         call_tests++;
9270         des_const_char_ptr(n_name, (const char *)name, 0);
9271         xmlResetLastError();
9272         if (mem_base != xmlMemBlocks()) {
9273             printf("Leak of %d blocks found in xmlParseCharEncoding",
9274                    xmlMemBlocks() - mem_base);
9275             test_ret++;
9276             printf(" %d", n_name);
9277             printf("\n");
9278         }
9279     }
9280     function_tests++;
9281
9282     return(test_ret);
9283 }
9284
9285
9286 #define gen_nb_xmlCharEncodingHandlerPtr 1
9287 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9288     return(NULL);
9289 }
9290 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9291 }
9292
9293 static int
9294 test_xmlRegisterCharEncodingHandler(void) {
9295     int test_ret = 0;
9296
9297     int mem_base;
9298     xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9299     int n_handler;
9300
9301     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9302         mem_base = xmlMemBlocks();
9303         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9304
9305         xmlRegisterCharEncodingHandler(handler);
9306         call_tests++;
9307         des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9308         xmlResetLastError();
9309         if (mem_base != xmlMemBlocks()) {
9310             printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9311                    xmlMemBlocks() - mem_base);
9312             test_ret++;
9313             printf(" %d", n_handler);
9314             printf("\n");
9315         }
9316     }
9317     function_tests++;
9318
9319     return(test_ret);
9320 }
9321
9322 static int
9323 test_encoding(void) {
9324     int test_ret = 0;
9325         int rc = 0;
9326
9327     if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9328     rc = test_UTF8Toisolat1();
9329         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9330     rc = test_isolat1ToUTF8();
9331         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9332     rc = test_xmlAddEncodingAlias();
9333         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9334     rc = test_xmlCharEncCloseFunc();
9335         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9336     rc = test_xmlCharEncFirstLine();
9337         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9338     rc = test_xmlCharEncInFunc();
9339         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9340     rc = test_xmlCharEncOutFunc();
9341         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9342     rc = test_xmlCleanupCharEncodingHandlers();
9343         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9344     rc = test_xmlCleanupEncodingAliases();
9345         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9346     rc = test_xmlDelEncodingAlias();
9347         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9348     rc = test_xmlDetectCharEncoding();
9349         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9350     rc = test_xmlFindCharEncodingHandler();
9351         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9352     rc = test_xmlGetCharEncodingHandler();
9353         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9354     rc = test_xmlGetCharEncodingName();
9355         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9356     rc = test_xmlGetEncodingAlias();
9357         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9358     rc = test_xmlInitCharEncodingHandlers();
9359         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9360     rc = test_xmlNewCharEncodingHandler();
9361         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9362     rc = test_xmlParseCharEncoding();
9363         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9364     rc = test_xmlRegisterCharEncodingHandler();
9365         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9366
9367     if (test_ret != 0)
9368         printf("Module encoding: %d errors\n", test_ret);
9369     return(test_ret);
9370 }
9371
9372 static int
9373 test_xmlAddDocEntity(void) {
9374     int test_ret = 0;
9375
9376     int mem_base;
9377     xmlEntityPtr ret_val;
9378     xmlDocPtr doc; /* the document */
9379     int n_doc;
9380     xmlChar * name; /* the entity name */
9381     int n_name;
9382     int type; /* the entity type XML_xxx_yyy_ENTITY */
9383     int n_type;
9384     xmlChar * ExternalID; /* the entity external ID if available */
9385     int n_ExternalID;
9386     xmlChar * SystemID; /* the entity system ID if available */
9387     int n_SystemID;
9388     xmlChar * content; /* the entity content */
9389     int n_content;
9390
9391     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9392     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9393     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9394     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9395     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9396     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9397         mem_base = xmlMemBlocks();
9398         doc = gen_xmlDocPtr(n_doc, 0);
9399         name = gen_const_xmlChar_ptr(n_name, 1);
9400         type = gen_int(n_type, 2);
9401         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9402         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9403         content = gen_const_xmlChar_ptr(n_content, 5);
9404
9405         ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9406         desret_xmlEntityPtr(ret_val);
9407         call_tests++;
9408         des_xmlDocPtr(n_doc, doc, 0);
9409         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9410         des_int(n_type, type, 2);
9411         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9412         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9413         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9414         xmlResetLastError();
9415         if (mem_base != xmlMemBlocks()) {
9416             printf("Leak of %d blocks found in xmlAddDocEntity",
9417                    xmlMemBlocks() - mem_base);
9418             test_ret++;
9419             printf(" %d", n_doc);
9420             printf(" %d", n_name);
9421             printf(" %d", n_type);
9422             printf(" %d", n_ExternalID);
9423             printf(" %d", n_SystemID);
9424             printf(" %d", n_content);
9425             printf("\n");
9426         }
9427     }
9428     }
9429     }
9430     }
9431     }
9432     }
9433     function_tests++;
9434
9435     return(test_ret);
9436 }
9437
9438
9439 static int
9440 test_xmlAddDtdEntity(void) {
9441     int test_ret = 0;
9442
9443     int mem_base;
9444     xmlEntityPtr ret_val;
9445     xmlDocPtr doc; /* the document */
9446     int n_doc;
9447     xmlChar * name; /* the entity name */
9448     int n_name;
9449     int type; /* the entity type XML_xxx_yyy_ENTITY */
9450     int n_type;
9451     xmlChar * ExternalID; /* the entity external ID if available */
9452     int n_ExternalID;
9453     xmlChar * SystemID; /* the entity system ID if available */
9454     int n_SystemID;
9455     xmlChar * content; /* the entity content */
9456     int n_content;
9457
9458     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9459     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9460     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9461     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9462     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9463     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9464         mem_base = xmlMemBlocks();
9465         doc = gen_xmlDocPtr(n_doc, 0);
9466         name = gen_const_xmlChar_ptr(n_name, 1);
9467         type = gen_int(n_type, 2);
9468         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9469         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9470         content = gen_const_xmlChar_ptr(n_content, 5);
9471
9472         ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9473         desret_xmlEntityPtr(ret_val);
9474         call_tests++;
9475         des_xmlDocPtr(n_doc, doc, 0);
9476         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9477         des_int(n_type, type, 2);
9478         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9479         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9480         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9481         xmlResetLastError();
9482         if (mem_base != xmlMemBlocks()) {
9483             printf("Leak of %d blocks found in xmlAddDtdEntity",
9484                    xmlMemBlocks() - mem_base);
9485             test_ret++;
9486             printf(" %d", n_doc);
9487             printf(" %d", n_name);
9488             printf(" %d", n_type);
9489             printf(" %d", n_ExternalID);
9490             printf(" %d", n_SystemID);
9491             printf(" %d", n_content);
9492             printf("\n");
9493         }
9494     }
9495     }
9496     }
9497     }
9498     }
9499     }
9500     function_tests++;
9501
9502     return(test_ret);
9503 }
9504
9505
9506 static int
9507 test_xmlCleanupPredefinedEntities(void) {
9508     int test_ret = 0;
9509
9510 #if defined(LIBXML_LEGACY_ENABLED)
9511 #ifdef LIBXML_LEGACY_ENABLED
9512     int mem_base;
9513
9514         mem_base = xmlMemBlocks();
9515
9516         xmlCleanupPredefinedEntities();
9517         call_tests++;
9518         xmlResetLastError();
9519         if (mem_base != xmlMemBlocks()) {
9520             printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9521                    xmlMemBlocks() - mem_base);
9522             test_ret++;
9523             printf("\n");
9524         }
9525     function_tests++;
9526 #endif
9527 #endif
9528
9529     return(test_ret);
9530 }
9531
9532
9533 #define gen_nb_xmlEntitiesTablePtr 1
9534 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9535     return(NULL);
9536 }
9537 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9538 }
9539
9540 static int
9541 test_xmlCopyEntitiesTable(void) {
9542     int test_ret = 0;
9543
9544
9545     /* missing type support */
9546     return(test_ret);
9547 }
9548
9549
9550 static int
9551 test_xmlCreateEntitiesTable(void) {
9552     int test_ret = 0;
9553
9554
9555     /* missing type support */
9556     return(test_ret);
9557 }
9558
9559
9560 static int
9561 test_xmlDumpEntitiesTable(void) {
9562     int test_ret = 0;
9563
9564 #if defined(LIBXML_OUTPUT_ENABLED)
9565     int mem_base;
9566     xmlBufferPtr buf; /* An XML buffer. */
9567     int n_buf;
9568     xmlEntitiesTablePtr table; /* An entity table */
9569     int n_table;
9570
9571     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9572     for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9573         mem_base = xmlMemBlocks();
9574         buf = gen_xmlBufferPtr(n_buf, 0);
9575         table = gen_xmlEntitiesTablePtr(n_table, 1);
9576
9577         xmlDumpEntitiesTable(buf, table);
9578         call_tests++;
9579         des_xmlBufferPtr(n_buf, buf, 0);
9580         des_xmlEntitiesTablePtr(n_table, table, 1);
9581         xmlResetLastError();
9582         if (mem_base != xmlMemBlocks()) {
9583             printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9584                    xmlMemBlocks() - mem_base);
9585             test_ret++;
9586             printf(" %d", n_buf);
9587             printf(" %d", n_table);
9588             printf("\n");
9589         }
9590     }
9591     }
9592     function_tests++;
9593 #endif
9594
9595     return(test_ret);
9596 }
9597
9598
9599 #define gen_nb_xmlEntityPtr 1
9600 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9601     return(NULL);
9602 }
9603 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9604 }
9605
9606 static int
9607 test_xmlDumpEntityDecl(void) {
9608     int test_ret = 0;
9609
9610 #if defined(LIBXML_OUTPUT_ENABLED)
9611     int mem_base;
9612     xmlBufferPtr buf; /* An XML buffer. */
9613     int n_buf;
9614     xmlEntityPtr ent; /* An entity table */
9615     int n_ent;
9616
9617     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9618     for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9619         mem_base = xmlMemBlocks();
9620         buf = gen_xmlBufferPtr(n_buf, 0);
9621         ent = gen_xmlEntityPtr(n_ent, 1);
9622
9623         xmlDumpEntityDecl(buf, ent);
9624         call_tests++;
9625         des_xmlBufferPtr(n_buf, buf, 0);
9626         des_xmlEntityPtr(n_ent, ent, 1);
9627         xmlResetLastError();
9628         if (mem_base != xmlMemBlocks()) {
9629             printf("Leak of %d blocks found in xmlDumpEntityDecl",
9630                    xmlMemBlocks() - mem_base);
9631             test_ret++;
9632             printf(" %d", n_buf);
9633             printf(" %d", n_ent);
9634             printf("\n");
9635         }
9636     }
9637     }
9638     function_tests++;
9639 #endif
9640
9641     return(test_ret);
9642 }
9643
9644
9645 static int
9646 test_xmlEncodeEntitiesReentrant(void) {
9647     int test_ret = 0;
9648
9649     int mem_base;
9650     xmlChar * ret_val;
9651     xmlDocPtr doc; /* the document containing the string */
9652     int n_doc;
9653     xmlChar * input; /* A string to convert to XML. */
9654     int n_input;
9655
9656     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9657     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9658         mem_base = xmlMemBlocks();
9659         doc = gen_xmlDocPtr(n_doc, 0);
9660         input = gen_const_xmlChar_ptr(n_input, 1);
9661
9662         ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9663         desret_xmlChar_ptr(ret_val);
9664         call_tests++;
9665         des_xmlDocPtr(n_doc, doc, 0);
9666         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9667         xmlResetLastError();
9668         if (mem_base != xmlMemBlocks()) {
9669             printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9670                    xmlMemBlocks() - mem_base);
9671             test_ret++;
9672             printf(" %d", n_doc);
9673             printf(" %d", n_input);
9674             printf("\n");
9675         }
9676     }
9677     }
9678     function_tests++;
9679
9680     return(test_ret);
9681 }
9682
9683
9684 #define gen_nb_const_xmlDoc_ptr 1
9685 static xmlDoc * gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9686     return(NULL);
9687 }
9688 static void des_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, const xmlDoc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9689 }
9690
9691 static int
9692 test_xmlEncodeSpecialChars(void) {
9693     int test_ret = 0;
9694
9695     int mem_base;
9696     xmlChar * ret_val;
9697     xmlDoc * doc; /* the document containing the string */
9698     int n_doc;
9699     xmlChar * input; /* A string to convert to XML. */
9700     int n_input;
9701
9702     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9703     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9704         mem_base = xmlMemBlocks();
9705         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9706         input = gen_const_xmlChar_ptr(n_input, 1);
9707
9708         ret_val = xmlEncodeSpecialChars((const xmlDoc *)doc, (const xmlChar *)input);
9709         desret_xmlChar_ptr(ret_val);
9710         call_tests++;
9711         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9712         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9713         xmlResetLastError();
9714         if (mem_base != xmlMemBlocks()) {
9715             printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9716                    xmlMemBlocks() - mem_base);
9717             test_ret++;
9718             printf(" %d", n_doc);
9719             printf(" %d", n_input);
9720             printf("\n");
9721         }
9722     }
9723     }
9724     function_tests++;
9725
9726     return(test_ret);
9727 }
9728
9729
9730 static int
9731 test_xmlGetDocEntity(void) {
9732     int test_ret = 0;
9733
9734     int mem_base;
9735     xmlEntityPtr ret_val;
9736     xmlDoc * doc; /* the document referencing the entity */
9737     int n_doc;
9738     xmlChar * name; /* the entity name */
9739     int n_name;
9740
9741     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
9742     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9743         mem_base = xmlMemBlocks();
9744         doc = gen_const_xmlDoc_ptr(n_doc, 0);
9745         name = gen_const_xmlChar_ptr(n_name, 1);
9746
9747         ret_val = xmlGetDocEntity((const xmlDoc *)doc, (const xmlChar *)name);
9748         desret_xmlEntityPtr(ret_val);
9749         call_tests++;
9750         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
9751         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9752         xmlResetLastError();
9753         if (mem_base != xmlMemBlocks()) {
9754             printf("Leak of %d blocks found in xmlGetDocEntity",
9755                    xmlMemBlocks() - mem_base);
9756             test_ret++;
9757             printf(" %d", n_doc);
9758             printf(" %d", n_name);
9759             printf("\n");
9760         }
9761     }
9762     }
9763     function_tests++;
9764
9765     return(test_ret);
9766 }
9767
9768
9769 static int
9770 test_xmlGetDtdEntity(void) {
9771     int test_ret = 0;
9772
9773     int mem_base;
9774     xmlEntityPtr ret_val;
9775     xmlDocPtr doc; /* the document referencing the entity */
9776     int n_doc;
9777     xmlChar * name; /* the entity name */
9778     int n_name;
9779
9780     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9781     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9782         mem_base = xmlMemBlocks();
9783         doc = gen_xmlDocPtr(n_doc, 0);
9784         name = gen_const_xmlChar_ptr(n_name, 1);
9785
9786         ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9787         desret_xmlEntityPtr(ret_val);
9788         call_tests++;
9789         des_xmlDocPtr(n_doc, doc, 0);
9790         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9791         xmlResetLastError();
9792         if (mem_base != xmlMemBlocks()) {
9793             printf("Leak of %d blocks found in xmlGetDtdEntity",
9794                    xmlMemBlocks() - mem_base);
9795             test_ret++;
9796             printf(" %d", n_doc);
9797             printf(" %d", n_name);
9798             printf("\n");
9799         }
9800     }
9801     }
9802     function_tests++;
9803
9804     return(test_ret);
9805 }
9806
9807
9808 static int
9809 test_xmlGetParameterEntity(void) {
9810     int test_ret = 0;
9811
9812     int mem_base;
9813     xmlEntityPtr ret_val;
9814     xmlDocPtr doc; /* the document referencing the entity */
9815     int n_doc;
9816     xmlChar * name; /* the entity name */
9817     int n_name;
9818
9819     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9820     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9821         mem_base = xmlMemBlocks();
9822         doc = gen_xmlDocPtr(n_doc, 0);
9823         name = gen_const_xmlChar_ptr(n_name, 1);
9824
9825         ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9826         desret_xmlEntityPtr(ret_val);
9827         call_tests++;
9828         des_xmlDocPtr(n_doc, doc, 0);
9829         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9830         xmlResetLastError();
9831         if (mem_base != xmlMemBlocks()) {
9832             printf("Leak of %d blocks found in xmlGetParameterEntity",
9833                    xmlMemBlocks() - mem_base);
9834             test_ret++;
9835             printf(" %d", n_doc);
9836             printf(" %d", n_name);
9837             printf("\n");
9838         }
9839     }
9840     }
9841     function_tests++;
9842
9843     return(test_ret);
9844 }
9845
9846
9847 static int
9848 test_xmlGetPredefinedEntity(void) {
9849     int test_ret = 0;
9850
9851     int mem_base;
9852     xmlEntityPtr ret_val;
9853     xmlChar * name; /* the entity name */
9854     int n_name;
9855
9856     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9857         mem_base = xmlMemBlocks();
9858         name = gen_const_xmlChar_ptr(n_name, 0);
9859
9860         ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9861         desret_xmlEntityPtr(ret_val);
9862         call_tests++;
9863         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9864         xmlResetLastError();
9865         if (mem_base != xmlMemBlocks()) {
9866             printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9867                    xmlMemBlocks() - mem_base);
9868             test_ret++;
9869             printf(" %d", n_name);
9870             printf("\n");
9871         }
9872     }
9873     function_tests++;
9874
9875     return(test_ret);
9876 }
9877
9878
9879 static int
9880 test_xmlInitializePredefinedEntities(void) {
9881     int test_ret = 0;
9882
9883 #if defined(LIBXML_LEGACY_ENABLED)
9884 #ifdef LIBXML_LEGACY_ENABLED
9885     int mem_base;
9886
9887         mem_base = xmlMemBlocks();
9888
9889         xmlInitializePredefinedEntities();
9890         call_tests++;
9891         xmlResetLastError();
9892         if (mem_base != xmlMemBlocks()) {
9893             printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9894                    xmlMemBlocks() - mem_base);
9895             test_ret++;
9896             printf("\n");
9897         }
9898     function_tests++;
9899 #endif
9900 #endif
9901
9902     return(test_ret);
9903 }
9904
9905
9906 static int
9907 test_xmlNewEntity(void) {
9908     int test_ret = 0;
9909
9910     int mem_base;
9911     xmlEntityPtr ret_val;
9912     xmlDocPtr doc; /* the document */
9913     int n_doc;
9914     xmlChar * name; /* the entity name */
9915     int n_name;
9916     int type; /* the entity type XML_xxx_yyy_ENTITY */
9917     int n_type;
9918     xmlChar * ExternalID; /* the entity external ID if available */
9919     int n_ExternalID;
9920     xmlChar * SystemID; /* the entity system ID if available */
9921     int n_SystemID;
9922     xmlChar * content; /* the entity content */
9923     int n_content;
9924
9925     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9926     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9927     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9928     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9929     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9930     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9931         mem_base = xmlMemBlocks();
9932         doc = gen_xmlDocPtr(n_doc, 0);
9933         name = gen_const_xmlChar_ptr(n_name, 1);
9934         type = gen_int(n_type, 2);
9935         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9936         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9937         content = gen_const_xmlChar_ptr(n_content, 5);
9938
9939         ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9940         desret_xmlEntityPtr(ret_val);
9941         call_tests++;
9942         des_xmlDocPtr(n_doc, doc, 0);
9943         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9944         des_int(n_type, type, 2);
9945         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9946         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9947         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9948         xmlResetLastError();
9949         if (mem_base != xmlMemBlocks()) {
9950             printf("Leak of %d blocks found in xmlNewEntity",
9951                    xmlMemBlocks() - mem_base);
9952             test_ret++;
9953             printf(" %d", n_doc);
9954             printf(" %d", n_name);
9955             printf(" %d", n_type);
9956             printf(" %d", n_ExternalID);
9957             printf(" %d", n_SystemID);
9958             printf(" %d", n_content);
9959             printf("\n");
9960         }
9961     }
9962     }
9963     }
9964     }
9965     }
9966     }
9967     function_tests++;
9968
9969     return(test_ret);
9970 }
9971
9972 static int
9973 test_entities(void) {
9974     int test_ret = 0;
9975         int rc = 0;
9976
9977     if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9978     rc = test_xmlAddDocEntity();
9979         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9980     rc = test_xmlAddDtdEntity();
9981         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9982     rc = test_xmlCleanupPredefinedEntities();
9983         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9984     rc = test_xmlCopyEntitiesTable();
9985         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9986     rc = test_xmlCreateEntitiesTable();
9987         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9988     rc = test_xmlDumpEntitiesTable();
9989         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9990     rc = test_xmlDumpEntityDecl();
9991         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9992     rc = test_xmlEncodeEntitiesReentrant();
9993         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9994     rc = test_xmlEncodeSpecialChars();
9995         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9996     rc = test_xmlGetDocEntity();
9997         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
9998     rc = test_xmlGetDtdEntity();
9999         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10000     rc = test_xmlGetParameterEntity();
10001         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10002     rc = test_xmlGetPredefinedEntity();
10003         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10004     rc = test_xmlInitializePredefinedEntities();
10005         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10006     rc = test_xmlNewEntity();
10007         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10008
10009     if (test_ret != 0)
10010         printf("Module entities: %d errors\n", test_ret);
10011     return(test_ret);
10012 }
10013
10014 static int
10015 test_xmlHashAddEntry(void) {
10016     int test_ret = 0;
10017
10018     int mem_base;
10019     int ret_val;
10020     xmlHashTablePtr table; /* the hash table */
10021     int n_table;
10022     xmlChar * name; /* the name of the userdata */
10023     int n_name;
10024     void * userdata; /* a pointer to the userdata */
10025     int n_userdata;
10026
10027     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10028     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10029     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10030         mem_base = xmlMemBlocks();
10031         table = gen_xmlHashTablePtr(n_table, 0);
10032         name = gen_const_xmlChar_ptr(n_name, 1);
10033         userdata = gen_userdata(n_userdata, 2);
10034
10035         ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
10036         desret_int(ret_val);
10037         call_tests++;
10038         des_xmlHashTablePtr(n_table, table, 0);
10039         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10040         des_userdata(n_userdata, userdata, 2);
10041         xmlResetLastError();
10042         if (mem_base != xmlMemBlocks()) {
10043             printf("Leak of %d blocks found in xmlHashAddEntry",
10044                    xmlMemBlocks() - mem_base);
10045             test_ret++;
10046             printf(" %d", n_table);
10047             printf(" %d", n_name);
10048             printf(" %d", n_userdata);
10049             printf("\n");
10050         }
10051     }
10052     }
10053     }
10054     function_tests++;
10055
10056     return(test_ret);
10057 }
10058
10059
10060 static int
10061 test_xmlHashAddEntry2(void) {
10062     int test_ret = 0;
10063
10064     int mem_base;
10065     int ret_val;
10066     xmlHashTablePtr table; /* the hash table */
10067     int n_table;
10068     xmlChar * name; /* the name of the userdata */
10069     int n_name;
10070     xmlChar * name2; /* a second name of the userdata */
10071     int n_name2;
10072     void * userdata; /* a pointer to the userdata */
10073     int n_userdata;
10074
10075     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10076     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10077     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10078     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10079         mem_base = xmlMemBlocks();
10080         table = gen_xmlHashTablePtr(n_table, 0);
10081         name = gen_const_xmlChar_ptr(n_name, 1);
10082         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10083         userdata = gen_userdata(n_userdata, 3);
10084
10085         ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
10086         desret_int(ret_val);
10087         call_tests++;
10088         des_xmlHashTablePtr(n_table, table, 0);
10089         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10090         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10091         des_userdata(n_userdata, userdata, 3);
10092         xmlResetLastError();
10093         if (mem_base != xmlMemBlocks()) {
10094             printf("Leak of %d blocks found in xmlHashAddEntry2",
10095                    xmlMemBlocks() - mem_base);
10096             test_ret++;
10097             printf(" %d", n_table);
10098             printf(" %d", n_name);
10099             printf(" %d", n_name2);
10100             printf(" %d", n_userdata);
10101             printf("\n");
10102         }
10103     }
10104     }
10105     }
10106     }
10107     function_tests++;
10108
10109     return(test_ret);
10110 }
10111
10112
10113 static int
10114 test_xmlHashAddEntry3(void) {
10115     int test_ret = 0;
10116
10117     int mem_base;
10118     int ret_val;
10119     xmlHashTablePtr table; /* the hash table */
10120     int n_table;
10121     xmlChar * name; /* the name of the userdata */
10122     int n_name;
10123     xmlChar * name2; /* a second name of the userdata */
10124     int n_name2;
10125     xmlChar * name3; /* a third name of the userdata */
10126     int n_name3;
10127     void * userdata; /* a pointer to the userdata */
10128     int n_userdata;
10129
10130     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10131     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10132     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10133     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10134     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10135         mem_base = xmlMemBlocks();
10136         table = gen_xmlHashTablePtr(n_table, 0);
10137         name = gen_const_xmlChar_ptr(n_name, 1);
10138         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10139         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10140         userdata = gen_userdata(n_userdata, 4);
10141
10142         ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
10143         desret_int(ret_val);
10144         call_tests++;
10145         des_xmlHashTablePtr(n_table, table, 0);
10146         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10147         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10148         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10149         des_userdata(n_userdata, userdata, 4);
10150         xmlResetLastError();
10151         if (mem_base != xmlMemBlocks()) {
10152             printf("Leak of %d blocks found in xmlHashAddEntry3",
10153                    xmlMemBlocks() - mem_base);
10154             test_ret++;
10155             printf(" %d", n_table);
10156             printf(" %d", n_name);
10157             printf(" %d", n_name2);
10158             printf(" %d", n_name3);
10159             printf(" %d", n_userdata);
10160             printf("\n");
10161         }
10162     }
10163     }
10164     }
10165     }
10166     }
10167     function_tests++;
10168
10169     return(test_ret);
10170 }
10171
10172
10173 static int
10174 test_xmlHashCopy(void) {
10175     int test_ret = 0;
10176
10177
10178     /* missing type support */
10179     return(test_ret);
10180 }
10181
10182
10183 static int
10184 test_xmlHashCreate(void) {
10185     int test_ret = 0;
10186
10187
10188     /* missing type support */
10189     return(test_ret);
10190 }
10191
10192
10193 static int
10194 test_xmlHashCreateDict(void) {
10195     int test_ret = 0;
10196
10197
10198     /* missing type support */
10199     return(test_ret);
10200 }
10201
10202
10203 static int
10204 test_xmlHashLookup(void) {
10205     int test_ret = 0;
10206
10207     int mem_base;
10208     void * ret_val;
10209     xmlHashTablePtr table; /* the hash table */
10210     int n_table;
10211     xmlChar * name; /* the name of the userdata */
10212     int n_name;
10213
10214     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10215     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10216         mem_base = xmlMemBlocks();
10217         table = gen_xmlHashTablePtr(n_table, 0);
10218         name = gen_const_xmlChar_ptr(n_name, 1);
10219
10220         ret_val = xmlHashLookup(table, (const xmlChar *)name);
10221         desret_void_ptr(ret_val);
10222         call_tests++;
10223         des_xmlHashTablePtr(n_table, table, 0);
10224         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10225         xmlResetLastError();
10226         if (mem_base != xmlMemBlocks()) {
10227             printf("Leak of %d blocks found in xmlHashLookup",
10228                    xmlMemBlocks() - mem_base);
10229             test_ret++;
10230             printf(" %d", n_table);
10231             printf(" %d", n_name);
10232             printf("\n");
10233         }
10234     }
10235     }
10236     function_tests++;
10237
10238     return(test_ret);
10239 }
10240
10241
10242 static int
10243 test_xmlHashLookup2(void) {
10244     int test_ret = 0;
10245
10246     int mem_base;
10247     void * ret_val;
10248     xmlHashTablePtr table; /* the hash table */
10249     int n_table;
10250     xmlChar * name; /* the name of the userdata */
10251     int n_name;
10252     xmlChar * name2; /* a second name of the userdata */
10253     int n_name2;
10254
10255     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10256     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10257     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10258         mem_base = xmlMemBlocks();
10259         table = gen_xmlHashTablePtr(n_table, 0);
10260         name = gen_const_xmlChar_ptr(n_name, 1);
10261         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10262
10263         ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
10264         desret_void_ptr(ret_val);
10265         call_tests++;
10266         des_xmlHashTablePtr(n_table, table, 0);
10267         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10268         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10269         xmlResetLastError();
10270         if (mem_base != xmlMemBlocks()) {
10271             printf("Leak of %d blocks found in xmlHashLookup2",
10272                    xmlMemBlocks() - mem_base);
10273             test_ret++;
10274             printf(" %d", n_table);
10275             printf(" %d", n_name);
10276             printf(" %d", n_name2);
10277             printf("\n");
10278         }
10279     }
10280     }
10281     }
10282     function_tests++;
10283
10284     return(test_ret);
10285 }
10286
10287
10288 static int
10289 test_xmlHashLookup3(void) {
10290     int test_ret = 0;
10291
10292     int mem_base;
10293     void * ret_val;
10294     xmlHashTablePtr table; /* the hash table */
10295     int n_table;
10296     xmlChar * name; /* the name of the userdata */
10297     int n_name;
10298     xmlChar * name2; /* a second name of the userdata */
10299     int n_name2;
10300     xmlChar * name3; /* a third name of the userdata */
10301     int n_name3;
10302
10303     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10304     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10305     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10306     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10307         mem_base = xmlMemBlocks();
10308         table = gen_xmlHashTablePtr(n_table, 0);
10309         name = gen_const_xmlChar_ptr(n_name, 1);
10310         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10311         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10312
10313         ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10314         desret_void_ptr(ret_val);
10315         call_tests++;
10316         des_xmlHashTablePtr(n_table, table, 0);
10317         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10318         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10319         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10320         xmlResetLastError();
10321         if (mem_base != xmlMemBlocks()) {
10322             printf("Leak of %d blocks found in xmlHashLookup3",
10323                    xmlMemBlocks() - mem_base);
10324             test_ret++;
10325             printf(" %d", n_table);
10326             printf(" %d", n_name);
10327             printf(" %d", n_name2);
10328             printf(" %d", n_name3);
10329             printf("\n");
10330         }
10331     }
10332     }
10333     }
10334     }
10335     function_tests++;
10336
10337     return(test_ret);
10338 }
10339
10340
10341 static int
10342 test_xmlHashQLookup(void) {
10343     int test_ret = 0;
10344
10345     int mem_base;
10346     void * ret_val;
10347     xmlHashTablePtr table; /* the hash table */
10348     int n_table;
10349     xmlChar * prefix; /* the prefix of the userdata */
10350     int n_prefix;
10351     xmlChar * name; /* the name of the userdata */
10352     int n_name;
10353
10354     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10355     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10356     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10357         mem_base = xmlMemBlocks();
10358         table = gen_xmlHashTablePtr(n_table, 0);
10359         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10360         name = gen_const_xmlChar_ptr(n_name, 2);
10361
10362         ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10363         desret_void_ptr(ret_val);
10364         call_tests++;
10365         des_xmlHashTablePtr(n_table, table, 0);
10366         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10367         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10368         xmlResetLastError();
10369         if (mem_base != xmlMemBlocks()) {
10370             printf("Leak of %d blocks found in xmlHashQLookup",
10371                    xmlMemBlocks() - mem_base);
10372             test_ret++;
10373             printf(" %d", n_table);
10374             printf(" %d", n_prefix);
10375             printf(" %d", n_name);
10376             printf("\n");
10377         }
10378     }
10379     }
10380     }
10381     function_tests++;
10382
10383     return(test_ret);
10384 }
10385
10386
10387 static int
10388 test_xmlHashQLookup2(void) {
10389     int test_ret = 0;
10390
10391     int mem_base;
10392     void * ret_val;
10393     xmlHashTablePtr table; /* the hash table */
10394     int n_table;
10395     xmlChar * prefix; /* the prefix of the userdata */
10396     int n_prefix;
10397     xmlChar * name; /* the name of the userdata */
10398     int n_name;
10399     xmlChar * prefix2; /* the second prefix of the userdata */
10400     int n_prefix2;
10401     xmlChar * name2; /* a second name of the userdata */
10402     int n_name2;
10403
10404     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10405     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10406     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10407     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10408     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10409         mem_base = xmlMemBlocks();
10410         table = gen_xmlHashTablePtr(n_table, 0);
10411         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10412         name = gen_const_xmlChar_ptr(n_name, 2);
10413         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10414         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10415
10416         ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10417         desret_void_ptr(ret_val);
10418         call_tests++;
10419         des_xmlHashTablePtr(n_table, table, 0);
10420         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10421         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10422         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10423         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10424         xmlResetLastError();
10425         if (mem_base != xmlMemBlocks()) {
10426             printf("Leak of %d blocks found in xmlHashQLookup2",
10427                    xmlMemBlocks() - mem_base);
10428             test_ret++;
10429             printf(" %d", n_table);
10430             printf(" %d", n_prefix);
10431             printf(" %d", n_name);
10432             printf(" %d", n_prefix2);
10433             printf(" %d", n_name2);
10434             printf("\n");
10435         }
10436     }
10437     }
10438     }
10439     }
10440     }
10441     function_tests++;
10442
10443     return(test_ret);
10444 }
10445
10446
10447 static int
10448 test_xmlHashQLookup3(void) {
10449     int test_ret = 0;
10450
10451     int mem_base;
10452     void * ret_val;
10453     xmlHashTablePtr table; /* the hash table */
10454     int n_table;
10455     xmlChar * prefix; /* the prefix of the userdata */
10456     int n_prefix;
10457     xmlChar * name; /* the name of the userdata */
10458     int n_name;
10459     xmlChar * prefix2; /* the second prefix of the userdata */
10460     int n_prefix2;
10461     xmlChar * name2; /* a second name of the userdata */
10462     int n_name2;
10463     xmlChar * prefix3; /* the third prefix of the userdata */
10464     int n_prefix3;
10465     xmlChar * name3; /* a third name of the userdata */
10466     int n_name3;
10467
10468     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10469     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10470     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10471     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10472     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10473     for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10474     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10475         mem_base = xmlMemBlocks();
10476         table = gen_xmlHashTablePtr(n_table, 0);
10477         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10478         name = gen_const_xmlChar_ptr(n_name, 2);
10479         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10480         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10481         prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10482         name3 = gen_const_xmlChar_ptr(n_name3, 6);
10483
10484         ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10485         desret_void_ptr(ret_val);
10486         call_tests++;
10487         des_xmlHashTablePtr(n_table, table, 0);
10488         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10489         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10490         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10491         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10492         des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10493         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10494         xmlResetLastError();
10495         if (mem_base != xmlMemBlocks()) {
10496             printf("Leak of %d blocks found in xmlHashQLookup3",
10497                    xmlMemBlocks() - mem_base);
10498             test_ret++;
10499             printf(" %d", n_table);
10500             printf(" %d", n_prefix);
10501             printf(" %d", n_name);
10502             printf(" %d", n_prefix2);
10503             printf(" %d", n_name2);
10504             printf(" %d", n_prefix3);
10505             printf(" %d", n_name3);
10506             printf("\n");
10507         }
10508     }
10509     }
10510     }
10511     }
10512     }
10513     }
10514     }
10515     function_tests++;
10516
10517     return(test_ret);
10518 }
10519
10520
10521 static int
10522 test_xmlHashRemoveEntry(void) {
10523     int test_ret = 0;
10524
10525     int mem_base;
10526     int ret_val;
10527     xmlHashTablePtr table; /* the hash table */
10528     int n_table;
10529     xmlChar * name; /* the name of the userdata */
10530     int n_name;
10531     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10532     int n_f;
10533
10534     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10535     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10536     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10537         mem_base = xmlMemBlocks();
10538         table = gen_xmlHashTablePtr(n_table, 0);
10539         name = gen_const_xmlChar_ptr(n_name, 1);
10540         f = gen_xmlHashDeallocator(n_f, 2);
10541
10542         ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10543         desret_int(ret_val);
10544         call_tests++;
10545         des_xmlHashTablePtr(n_table, table, 0);
10546         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10547         des_xmlHashDeallocator(n_f, f, 2);
10548         xmlResetLastError();
10549         if (mem_base != xmlMemBlocks()) {
10550             printf("Leak of %d blocks found in xmlHashRemoveEntry",
10551                    xmlMemBlocks() - mem_base);
10552             test_ret++;
10553             printf(" %d", n_table);
10554             printf(" %d", n_name);
10555             printf(" %d", n_f);
10556             printf("\n");
10557         }
10558     }
10559     }
10560     }
10561     function_tests++;
10562
10563     return(test_ret);
10564 }
10565
10566
10567 static int
10568 test_xmlHashRemoveEntry2(void) {
10569     int test_ret = 0;
10570
10571     int mem_base;
10572     int ret_val;
10573     xmlHashTablePtr table; /* the hash table */
10574     int n_table;
10575     xmlChar * name; /* the name of the userdata */
10576     int n_name;
10577     xmlChar * name2; /* a second name of the userdata */
10578     int n_name2;
10579     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10580     int n_f;
10581
10582     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10583     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10584     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10585     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10586         mem_base = xmlMemBlocks();
10587         table = gen_xmlHashTablePtr(n_table, 0);
10588         name = gen_const_xmlChar_ptr(n_name, 1);
10589         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10590         f = gen_xmlHashDeallocator(n_f, 3);
10591
10592         ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10593         desret_int(ret_val);
10594         call_tests++;
10595         des_xmlHashTablePtr(n_table, table, 0);
10596         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10597         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10598         des_xmlHashDeallocator(n_f, f, 3);
10599         xmlResetLastError();
10600         if (mem_base != xmlMemBlocks()) {
10601             printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10602                    xmlMemBlocks() - mem_base);
10603             test_ret++;
10604             printf(" %d", n_table);
10605             printf(" %d", n_name);
10606             printf(" %d", n_name2);
10607             printf(" %d", n_f);
10608             printf("\n");
10609         }
10610     }
10611     }
10612     }
10613     }
10614     function_tests++;
10615
10616     return(test_ret);
10617 }
10618
10619
10620 static int
10621 test_xmlHashRemoveEntry3(void) {
10622     int test_ret = 0;
10623
10624     int mem_base;
10625     int ret_val;
10626     xmlHashTablePtr table; /* the hash table */
10627     int n_table;
10628     xmlChar * name; /* the name of the userdata */
10629     int n_name;
10630     xmlChar * name2; /* a second name of the userdata */
10631     int n_name2;
10632     xmlChar * name3; /* a third name of the userdata */
10633     int n_name3;
10634     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10635     int n_f;
10636
10637     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10638     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10639     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10640     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10641     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10642         mem_base = xmlMemBlocks();
10643         table = gen_xmlHashTablePtr(n_table, 0);
10644         name = gen_const_xmlChar_ptr(n_name, 1);
10645         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10646         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10647         f = gen_xmlHashDeallocator(n_f, 4);
10648
10649         ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10650         desret_int(ret_val);
10651         call_tests++;
10652         des_xmlHashTablePtr(n_table, table, 0);
10653         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10654         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10655         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10656         des_xmlHashDeallocator(n_f, f, 4);
10657         xmlResetLastError();
10658         if (mem_base != xmlMemBlocks()) {
10659             printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10660                    xmlMemBlocks() - mem_base);
10661             test_ret++;
10662             printf(" %d", n_table);
10663             printf(" %d", n_name);
10664             printf(" %d", n_name2);
10665             printf(" %d", n_name3);
10666             printf(" %d", n_f);
10667             printf("\n");
10668         }
10669     }
10670     }
10671     }
10672     }
10673     }
10674     function_tests++;
10675
10676     return(test_ret);
10677 }
10678
10679
10680 static int
10681 test_xmlHashScan(void) {
10682     int test_ret = 0;
10683
10684
10685     /* missing type support */
10686     return(test_ret);
10687 }
10688
10689
10690 static int
10691 test_xmlHashScan3(void) {
10692     int test_ret = 0;
10693
10694
10695     /* missing type support */
10696     return(test_ret);
10697 }
10698
10699
10700 static int
10701 test_xmlHashScanFull(void) {
10702     int test_ret = 0;
10703
10704
10705     /* missing type support */
10706     return(test_ret);
10707 }
10708
10709
10710 static int
10711 test_xmlHashScanFull3(void) {
10712     int test_ret = 0;
10713
10714
10715     /* missing type support */
10716     return(test_ret);
10717 }
10718
10719
10720 static int
10721 test_xmlHashSize(void) {
10722     int test_ret = 0;
10723
10724     int mem_base;
10725     int ret_val;
10726     xmlHashTablePtr table; /* the hash table */
10727     int n_table;
10728
10729     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10730         mem_base = xmlMemBlocks();
10731         table = gen_xmlHashTablePtr(n_table, 0);
10732
10733         ret_val = xmlHashSize(table);
10734         desret_int(ret_val);
10735         call_tests++;
10736         des_xmlHashTablePtr(n_table, table, 0);
10737         xmlResetLastError();
10738         if (mem_base != xmlMemBlocks()) {
10739             printf("Leak of %d blocks found in xmlHashSize",
10740                    xmlMemBlocks() - mem_base);
10741             test_ret++;
10742             printf(" %d", n_table);
10743             printf("\n");
10744         }
10745     }
10746     function_tests++;
10747
10748     return(test_ret);
10749 }
10750
10751
10752 static int
10753 test_xmlHashUpdateEntry(void) {
10754     int test_ret = 0;
10755
10756     int mem_base;
10757     int ret_val;
10758     xmlHashTablePtr table; /* the hash table */
10759     int n_table;
10760     xmlChar * name; /* the name of the userdata */
10761     int n_name;
10762     void * userdata; /* a pointer to the userdata */
10763     int n_userdata;
10764     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10765     int n_f;
10766
10767     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10768     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10769     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10770     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10771         mem_base = xmlMemBlocks();
10772         table = gen_xmlHashTablePtr(n_table, 0);
10773         name = gen_const_xmlChar_ptr(n_name, 1);
10774         userdata = gen_userdata(n_userdata, 2);
10775         f = gen_xmlHashDeallocator(n_f, 3);
10776
10777         ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10778         desret_int(ret_val);
10779         call_tests++;
10780         des_xmlHashTablePtr(n_table, table, 0);
10781         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10782         des_userdata(n_userdata, userdata, 2);
10783         des_xmlHashDeallocator(n_f, f, 3);
10784         xmlResetLastError();
10785         if (mem_base != xmlMemBlocks()) {
10786             printf("Leak of %d blocks found in xmlHashUpdateEntry",
10787                    xmlMemBlocks() - mem_base);
10788             test_ret++;
10789             printf(" %d", n_table);
10790             printf(" %d", n_name);
10791             printf(" %d", n_userdata);
10792             printf(" %d", n_f);
10793             printf("\n");
10794         }
10795     }
10796     }
10797     }
10798     }
10799     function_tests++;
10800
10801     return(test_ret);
10802 }
10803
10804
10805 static int
10806 test_xmlHashUpdateEntry2(void) {
10807     int test_ret = 0;
10808
10809     int mem_base;
10810     int ret_val;
10811     xmlHashTablePtr table; /* the hash table */
10812     int n_table;
10813     xmlChar * name; /* the name of the userdata */
10814     int n_name;
10815     xmlChar * name2; /* a second name of the userdata */
10816     int n_name2;
10817     void * userdata; /* a pointer to the userdata */
10818     int n_userdata;
10819     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10820     int n_f;
10821
10822     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10823     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10824     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10825     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10826     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10827         mem_base = xmlMemBlocks();
10828         table = gen_xmlHashTablePtr(n_table, 0);
10829         name = gen_const_xmlChar_ptr(n_name, 1);
10830         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10831         userdata = gen_userdata(n_userdata, 3);
10832         f = gen_xmlHashDeallocator(n_f, 4);
10833
10834         ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10835         desret_int(ret_val);
10836         call_tests++;
10837         des_xmlHashTablePtr(n_table, table, 0);
10838         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10839         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10840         des_userdata(n_userdata, userdata, 3);
10841         des_xmlHashDeallocator(n_f, f, 4);
10842         xmlResetLastError();
10843         if (mem_base != xmlMemBlocks()) {
10844             printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10845                    xmlMemBlocks() - mem_base);
10846             test_ret++;
10847             printf(" %d", n_table);
10848             printf(" %d", n_name);
10849             printf(" %d", n_name2);
10850             printf(" %d", n_userdata);
10851             printf(" %d", n_f);
10852             printf("\n");
10853         }
10854     }
10855     }
10856     }
10857     }
10858     }
10859     function_tests++;
10860
10861     return(test_ret);
10862 }
10863
10864
10865 static int
10866 test_xmlHashUpdateEntry3(void) {
10867     int test_ret = 0;
10868
10869     int mem_base;
10870     int ret_val;
10871     xmlHashTablePtr table; /* the hash table */
10872     int n_table;
10873     xmlChar * name; /* the name of the userdata */
10874     int n_name;
10875     xmlChar * name2; /* a second name of the userdata */
10876     int n_name2;
10877     xmlChar * name3; /* a third name of the userdata */
10878     int n_name3;
10879     void * userdata; /* a pointer to the userdata */
10880     int n_userdata;
10881     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10882     int n_f;
10883
10884     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10885     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10886     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10887     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10888     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10889     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10890         mem_base = xmlMemBlocks();
10891         table = gen_xmlHashTablePtr(n_table, 0);
10892         name = gen_const_xmlChar_ptr(n_name, 1);
10893         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10894         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10895         userdata = gen_userdata(n_userdata, 4);
10896         f = gen_xmlHashDeallocator(n_f, 5);
10897
10898         ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10899         desret_int(ret_val);
10900         call_tests++;
10901         des_xmlHashTablePtr(n_table, table, 0);
10902         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10903         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10904         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10905         des_userdata(n_userdata, userdata, 4);
10906         des_xmlHashDeallocator(n_f, f, 5);
10907         xmlResetLastError();
10908         if (mem_base != xmlMemBlocks()) {
10909             printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10910                    xmlMemBlocks() - mem_base);
10911             test_ret++;
10912             printf(" %d", n_table);
10913             printf(" %d", n_name);
10914             printf(" %d", n_name2);
10915             printf(" %d", n_name3);
10916             printf(" %d", n_userdata);
10917             printf(" %d", n_f);
10918             printf("\n");
10919         }
10920     }
10921     }
10922     }
10923     }
10924     }
10925     }
10926     function_tests++;
10927
10928     return(test_ret);
10929 }
10930
10931 static int
10932 test_hash(void) {
10933     int test_ret = 0;
10934         int rc = 0;
10935
10936     if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10937     rc = test_xmlHashAddEntry();
10938         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10939     rc = test_xmlHashAddEntry2();
10940         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10941     rc = test_xmlHashAddEntry3();
10942         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10943     rc = test_xmlHashCopy();
10944         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10945     rc = test_xmlHashCreate();
10946         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10947     rc = test_xmlHashCreateDict();
10948         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10949     rc = test_xmlHashLookup();
10950         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10951     rc = test_xmlHashLookup2();
10952         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10953     rc = test_xmlHashLookup3();
10954         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10955     rc = test_xmlHashQLookup();
10956         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10957     rc = test_xmlHashQLookup2();
10958         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10959     rc = test_xmlHashQLookup3();
10960         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10961     rc = test_xmlHashRemoveEntry();
10962         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10963     rc = test_xmlHashRemoveEntry2();
10964         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10965     rc = test_xmlHashRemoveEntry3();
10966         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10967     rc = test_xmlHashScan();
10968         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10969     rc = test_xmlHashScan3();
10970         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10971     rc = test_xmlHashScanFull();
10972         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10973     rc = test_xmlHashScanFull3();
10974         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10975     rc = test_xmlHashSize();
10976         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10977     rc = test_xmlHashUpdateEntry();
10978         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10979     rc = test_xmlHashUpdateEntry2();
10980         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10981     rc = test_xmlHashUpdateEntry3();
10982         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
10983
10984     if (test_ret != 0)
10985         printf("Module hash: %d errors\n", test_ret);
10986     return(test_ret);
10987 }
10988
10989 #define gen_nb_xmlLinkPtr 1
10990 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10991     return(NULL);
10992 }
10993 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10994 }
10995
10996 static int
10997 test_xmlLinkGetData(void) {
10998     int test_ret = 0;
10999
11000     int mem_base;
11001     void * ret_val;
11002     xmlLinkPtr lk; /* a link */
11003     int n_lk;
11004
11005     for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
11006         mem_base = xmlMemBlocks();
11007         lk = gen_xmlLinkPtr(n_lk, 0);
11008
11009         ret_val = xmlLinkGetData(lk);
11010         desret_void_ptr(ret_val);
11011         call_tests++;
11012         des_xmlLinkPtr(n_lk, lk, 0);
11013         xmlResetLastError();
11014         if (mem_base != xmlMemBlocks()) {
11015             printf("Leak of %d blocks found in xmlLinkGetData",
11016                    xmlMemBlocks() - mem_base);
11017             test_ret++;
11018             printf(" %d", n_lk);
11019             printf("\n");
11020         }
11021     }
11022     function_tests++;
11023
11024     return(test_ret);
11025 }
11026
11027
11028 static int
11029 test_xmlListAppend(void) {
11030     int test_ret = 0;
11031
11032     int mem_base;
11033     int ret_val;
11034     xmlListPtr l; /* a list */
11035     int n_l;
11036     void * data; /* the data */
11037     int n_data;
11038
11039     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11040     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11041         mem_base = xmlMemBlocks();
11042         l = gen_xmlListPtr(n_l, 0);
11043         data = gen_userdata(n_data, 1);
11044
11045         ret_val = xmlListAppend(l, data);
11046         desret_int(ret_val);
11047         call_tests++;
11048         des_xmlListPtr(n_l, l, 0);
11049         des_userdata(n_data, data, 1);
11050         xmlResetLastError();
11051         if (mem_base != xmlMemBlocks()) {
11052             printf("Leak of %d blocks found in xmlListAppend",
11053                    xmlMemBlocks() - mem_base);
11054             test_ret++;
11055             printf(" %d", n_l);
11056             printf(" %d", n_data);
11057             printf("\n");
11058         }
11059     }
11060     }
11061     function_tests++;
11062
11063     return(test_ret);
11064 }
11065
11066
11067 static int
11068 test_xmlListClear(void) {
11069     int test_ret = 0;
11070
11071     int mem_base;
11072     xmlListPtr l; /* a list */
11073     int n_l;
11074
11075     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11076         mem_base = xmlMemBlocks();
11077         l = gen_xmlListPtr(n_l, 0);
11078
11079         xmlListClear(l);
11080         call_tests++;
11081         des_xmlListPtr(n_l, l, 0);
11082         xmlResetLastError();
11083         if (mem_base != xmlMemBlocks()) {
11084             printf("Leak of %d blocks found in xmlListClear",
11085                    xmlMemBlocks() - mem_base);
11086             test_ret++;
11087             printf(" %d", n_l);
11088             printf("\n");
11089         }
11090     }
11091     function_tests++;
11092
11093     return(test_ret);
11094 }
11095
11096
11097 #define gen_nb_const_xmlListPtr 1
11098 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11099     return(NULL);
11100 }
11101 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11102 }
11103
11104 static int
11105 test_xmlListCopy(void) {
11106     int test_ret = 0;
11107
11108     int mem_base;
11109     int ret_val;
11110     xmlListPtr cur; /* the new list */
11111     int n_cur;
11112     xmlListPtr old; /* the old list */
11113     int n_old;
11114
11115     for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
11116     for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
11117         mem_base = xmlMemBlocks();
11118         cur = gen_xmlListPtr(n_cur, 0);
11119         old = gen_const_xmlListPtr(n_old, 1);
11120
11121         ret_val = xmlListCopy(cur, (const xmlListPtr)old);
11122         desret_int(ret_val);
11123         call_tests++;
11124         des_xmlListPtr(n_cur, cur, 0);
11125         des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
11126         xmlResetLastError();
11127         if (mem_base != xmlMemBlocks()) {
11128             printf("Leak of %d blocks found in xmlListCopy",
11129                    xmlMemBlocks() - mem_base);
11130             test_ret++;
11131             printf(" %d", n_cur);
11132             printf(" %d", n_old);
11133             printf("\n");
11134         }
11135     }
11136     }
11137     function_tests++;
11138
11139     return(test_ret);
11140 }
11141
11142
11143 static int
11144 test_xmlListCreate(void) {
11145     int test_ret = 0;
11146
11147
11148     /* missing type support */
11149     return(test_ret);
11150 }
11151
11152
11153 static int
11154 test_xmlListDup(void) {
11155     int test_ret = 0;
11156
11157
11158     /* missing type support */
11159     return(test_ret);
11160 }
11161
11162
11163 static int
11164 test_xmlListEmpty(void) {
11165     int test_ret = 0;
11166
11167     int mem_base;
11168     int ret_val;
11169     xmlListPtr l; /* a list */
11170     int n_l;
11171
11172     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11173         mem_base = xmlMemBlocks();
11174         l = gen_xmlListPtr(n_l, 0);
11175
11176         ret_val = xmlListEmpty(l);
11177         desret_int(ret_val);
11178         call_tests++;
11179         des_xmlListPtr(n_l, l, 0);
11180         xmlResetLastError();
11181         if (mem_base != xmlMemBlocks()) {
11182             printf("Leak of %d blocks found in xmlListEmpty",
11183                    xmlMemBlocks() - mem_base);
11184             test_ret++;
11185             printf(" %d", n_l);
11186             printf("\n");
11187         }
11188     }
11189     function_tests++;
11190
11191     return(test_ret);
11192 }
11193
11194
11195 static int
11196 test_xmlListEnd(void) {
11197     int test_ret = 0;
11198
11199
11200     /* missing type support */
11201     return(test_ret);
11202 }
11203
11204
11205 static int
11206 test_xmlListFront(void) {
11207     int test_ret = 0;
11208
11209
11210     /* missing type support */
11211     return(test_ret);
11212 }
11213
11214
11215 static int
11216 test_xmlListInsert(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; /* the 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 = xmlListInsert(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 xmlListInsert",
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_xmlListMerge(void) {
11256     int test_ret = 0;
11257
11258     int mem_base;
11259     xmlListPtr l1; /* the original list */
11260     int n_l1;
11261     xmlListPtr l2; /* the new list */
11262     int n_l2;
11263
11264     for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
11265     for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
11266         mem_base = xmlMemBlocks();
11267         l1 = gen_xmlListPtr(n_l1, 0);
11268         l2 = gen_xmlListPtr(n_l2, 1);
11269
11270         xmlListMerge(l1, l2);
11271         call_tests++;
11272         des_xmlListPtr(n_l1, l1, 0);
11273         des_xmlListPtr(n_l2, l2, 1);
11274         xmlResetLastError();
11275         if (mem_base != xmlMemBlocks()) {
11276             printf("Leak of %d blocks found in xmlListMerge",
11277                    xmlMemBlocks() - mem_base);
11278             test_ret++;
11279             printf(" %d", n_l1);
11280             printf(" %d", n_l2);
11281             printf("\n");
11282         }
11283     }
11284     }
11285     function_tests++;
11286
11287     return(test_ret);
11288 }
11289
11290
11291 static int
11292 test_xmlListPopBack(void) {
11293     int test_ret = 0;
11294
11295     int mem_base;
11296     xmlListPtr l; /* a list */
11297     int n_l;
11298
11299     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11300         mem_base = xmlMemBlocks();
11301         l = gen_xmlListPtr(n_l, 0);
11302
11303         xmlListPopBack(l);
11304         call_tests++;
11305         des_xmlListPtr(n_l, l, 0);
11306         xmlResetLastError();
11307         if (mem_base != xmlMemBlocks()) {
11308             printf("Leak of %d blocks found in xmlListPopBack",
11309                    xmlMemBlocks() - mem_base);
11310             test_ret++;
11311             printf(" %d", n_l);
11312             printf("\n");
11313         }
11314     }
11315     function_tests++;
11316
11317     return(test_ret);
11318 }
11319
11320
11321 static int
11322 test_xmlListPopFront(void) {
11323     int test_ret = 0;
11324
11325     int mem_base;
11326     xmlListPtr l; /* a list */
11327     int n_l;
11328
11329     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11330         mem_base = xmlMemBlocks();
11331         l = gen_xmlListPtr(n_l, 0);
11332
11333         xmlListPopFront(l);
11334         call_tests++;
11335         des_xmlListPtr(n_l, l, 0);
11336         xmlResetLastError();
11337         if (mem_base != xmlMemBlocks()) {
11338             printf("Leak of %d blocks found in xmlListPopFront",
11339                    xmlMemBlocks() - mem_base);
11340             test_ret++;
11341             printf(" %d", n_l);
11342             printf("\n");
11343         }
11344     }
11345     function_tests++;
11346
11347     return(test_ret);
11348 }
11349
11350
11351 static int
11352 test_xmlListPushBack(void) {
11353     int test_ret = 0;
11354
11355     int mem_base;
11356     int ret_val;
11357     xmlListPtr l; /* a list */
11358     int n_l;
11359     void * data; /* new data */
11360     int n_data;
11361
11362     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11363     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11364         mem_base = xmlMemBlocks();
11365         l = gen_xmlListPtr(n_l, 0);
11366         data = gen_userdata(n_data, 1);
11367
11368         ret_val = xmlListPushBack(l, data);
11369         desret_int(ret_val);
11370         call_tests++;
11371         des_xmlListPtr(n_l, l, 0);
11372         des_userdata(n_data, data, 1);
11373         xmlResetLastError();
11374         if (mem_base != xmlMemBlocks()) {
11375             printf("Leak of %d blocks found in xmlListPushBack",
11376                    xmlMemBlocks() - mem_base);
11377             test_ret++;
11378             printf(" %d", n_l);
11379             printf(" %d", n_data);
11380             printf("\n");
11381         }
11382     }
11383     }
11384     function_tests++;
11385
11386     return(test_ret);
11387 }
11388
11389
11390 static int
11391 test_xmlListPushFront(void) {
11392     int test_ret = 0;
11393
11394     int mem_base;
11395     int ret_val;
11396     xmlListPtr l; /* a list */
11397     int n_l;
11398     void * data; /* new data */
11399     int n_data;
11400
11401     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11402     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11403         mem_base = xmlMemBlocks();
11404         l = gen_xmlListPtr(n_l, 0);
11405         data = gen_userdata(n_data, 1);
11406
11407         ret_val = xmlListPushFront(l, data);
11408         desret_int(ret_val);
11409         call_tests++;
11410         des_xmlListPtr(n_l, l, 0);
11411         des_userdata(n_data, data, 1);
11412         xmlResetLastError();
11413         if (mem_base != xmlMemBlocks()) {
11414             printf("Leak of %d blocks found in xmlListPushFront",
11415                    xmlMemBlocks() - mem_base);
11416             test_ret++;
11417             printf(" %d", n_l);
11418             printf(" %d", n_data);
11419             printf("\n");
11420         }
11421     }
11422     }
11423     function_tests++;
11424
11425     return(test_ret);
11426 }
11427
11428
11429 static int
11430 test_xmlListRemoveAll(void) {
11431     int test_ret = 0;
11432
11433     int mem_base;
11434     int ret_val;
11435     xmlListPtr l; /* a list */
11436     int n_l;
11437     void * data; /* list data */
11438     int n_data;
11439
11440     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11441     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11442         mem_base = xmlMemBlocks();
11443         l = gen_xmlListPtr(n_l, 0);
11444         data = gen_userdata(n_data, 1);
11445
11446         ret_val = xmlListRemoveAll(l, data);
11447         desret_int(ret_val);
11448         call_tests++;
11449         des_xmlListPtr(n_l, l, 0);
11450         des_userdata(n_data, data, 1);
11451         xmlResetLastError();
11452         if (mem_base != xmlMemBlocks()) {
11453             printf("Leak of %d blocks found in xmlListRemoveAll",
11454                    xmlMemBlocks() - mem_base);
11455             test_ret++;
11456             printf(" %d", n_l);
11457             printf(" %d", n_data);
11458             printf("\n");
11459         }
11460     }
11461     }
11462     function_tests++;
11463
11464     return(test_ret);
11465 }
11466
11467
11468 static int
11469 test_xmlListRemoveFirst(void) {
11470     int test_ret = 0;
11471
11472     int mem_base;
11473     int ret_val;
11474     xmlListPtr l; /* a list */
11475     int n_l;
11476     void * data; /* list data */
11477     int n_data;
11478
11479     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11480     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11481         mem_base = xmlMemBlocks();
11482         l = gen_xmlListPtr(n_l, 0);
11483         data = gen_userdata(n_data, 1);
11484
11485         ret_val = xmlListRemoveFirst(l, data);
11486         desret_int(ret_val);
11487         call_tests++;
11488         des_xmlListPtr(n_l, l, 0);
11489         des_userdata(n_data, data, 1);
11490         xmlResetLastError();
11491         if (mem_base != xmlMemBlocks()) {
11492             printf("Leak of %d blocks found in xmlListRemoveFirst",
11493                    xmlMemBlocks() - mem_base);
11494             test_ret++;
11495             printf(" %d", n_l);
11496             printf(" %d", n_data);
11497             printf("\n");
11498         }
11499     }
11500     }
11501     function_tests++;
11502
11503     return(test_ret);
11504 }
11505
11506
11507 static int
11508 test_xmlListRemoveLast(void) {
11509     int test_ret = 0;
11510
11511     int mem_base;
11512     int ret_val;
11513     xmlListPtr l; /* a list */
11514     int n_l;
11515     void * data; /* list data */
11516     int n_data;
11517
11518     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11519     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11520         mem_base = xmlMemBlocks();
11521         l = gen_xmlListPtr(n_l, 0);
11522         data = gen_userdata(n_data, 1);
11523
11524         ret_val = xmlListRemoveLast(l, data);
11525         desret_int(ret_val);
11526         call_tests++;
11527         des_xmlListPtr(n_l, l, 0);
11528         des_userdata(n_data, data, 1);
11529         xmlResetLastError();
11530         if (mem_base != xmlMemBlocks()) {
11531             printf("Leak of %d blocks found in xmlListRemoveLast",
11532                    xmlMemBlocks() - mem_base);
11533             test_ret++;
11534             printf(" %d", n_l);
11535             printf(" %d", n_data);
11536             printf("\n");
11537         }
11538     }
11539     }
11540     function_tests++;
11541
11542     return(test_ret);
11543 }
11544
11545
11546 static int
11547 test_xmlListReverse(void) {
11548     int test_ret = 0;
11549
11550     int mem_base;
11551     xmlListPtr l; /* a list */
11552     int n_l;
11553
11554     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11555         mem_base = xmlMemBlocks();
11556         l = gen_xmlListPtr(n_l, 0);
11557
11558         xmlListReverse(l);
11559         call_tests++;
11560         des_xmlListPtr(n_l, l, 0);
11561         xmlResetLastError();
11562         if (mem_base != xmlMemBlocks()) {
11563             printf("Leak of %d blocks found in xmlListReverse",
11564                    xmlMemBlocks() - mem_base);
11565             test_ret++;
11566             printf(" %d", n_l);
11567             printf("\n");
11568         }
11569     }
11570     function_tests++;
11571
11572     return(test_ret);
11573 }
11574
11575
11576 static int
11577 test_xmlListReverseSearch(void) {
11578     int test_ret = 0;
11579
11580     int mem_base;
11581     void * ret_val;
11582     xmlListPtr l; /* a list */
11583     int n_l;
11584     void * data; /* a search value */
11585     int n_data;
11586
11587     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11588     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11589         mem_base = xmlMemBlocks();
11590         l = gen_xmlListPtr(n_l, 0);
11591         data = gen_userdata(n_data, 1);
11592
11593         ret_val = xmlListReverseSearch(l, data);
11594         desret_void_ptr(ret_val);
11595         call_tests++;
11596         des_xmlListPtr(n_l, l, 0);
11597         des_userdata(n_data, data, 1);
11598         xmlResetLastError();
11599         if (mem_base != xmlMemBlocks()) {
11600             printf("Leak of %d blocks found in xmlListReverseSearch",
11601                    xmlMemBlocks() - mem_base);
11602             test_ret++;
11603             printf(" %d", n_l);
11604             printf(" %d", n_data);
11605             printf("\n");
11606         }
11607     }
11608     }
11609     function_tests++;
11610
11611     return(test_ret);
11612 }
11613
11614
11615 static int
11616 test_xmlListReverseWalk(void) {
11617     int test_ret = 0;
11618
11619
11620     /* missing type support */
11621     return(test_ret);
11622 }
11623
11624
11625 static int
11626 test_xmlListSearch(void) {
11627     int test_ret = 0;
11628
11629     int mem_base;
11630     void * ret_val;
11631     xmlListPtr l; /* a list */
11632     int n_l;
11633     void * data; /* a search value */
11634     int n_data;
11635
11636     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11637     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11638         mem_base = xmlMemBlocks();
11639         l = gen_xmlListPtr(n_l, 0);
11640         data = gen_userdata(n_data, 1);
11641
11642         ret_val = xmlListSearch(l, data);
11643         desret_void_ptr(ret_val);
11644         call_tests++;
11645         des_xmlListPtr(n_l, l, 0);
11646         des_userdata(n_data, data, 1);
11647         xmlResetLastError();
11648         if (mem_base != xmlMemBlocks()) {
11649             printf("Leak of %d blocks found in xmlListSearch",
11650                    xmlMemBlocks() - mem_base);
11651             test_ret++;
11652             printf(" %d", n_l);
11653             printf(" %d", n_data);
11654             printf("\n");
11655         }
11656     }
11657     }
11658     function_tests++;
11659
11660     return(test_ret);
11661 }
11662
11663
11664 static int
11665 test_xmlListSize(void) {
11666     int test_ret = 0;
11667
11668     int mem_base;
11669     int ret_val;
11670     xmlListPtr l; /* a list */
11671     int n_l;
11672
11673     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11674         mem_base = xmlMemBlocks();
11675         l = gen_xmlListPtr(n_l, 0);
11676
11677         ret_val = xmlListSize(l);
11678         desret_int(ret_val);
11679         call_tests++;
11680         des_xmlListPtr(n_l, l, 0);
11681         xmlResetLastError();
11682         if (mem_base != xmlMemBlocks()) {
11683             printf("Leak of %d blocks found in xmlListSize",
11684                    xmlMemBlocks() - mem_base);
11685             test_ret++;
11686             printf(" %d", n_l);
11687             printf("\n");
11688         }
11689     }
11690     function_tests++;
11691
11692     return(test_ret);
11693 }
11694
11695
11696 static int
11697 test_xmlListSort(void) {
11698     int test_ret = 0;
11699
11700     int mem_base;
11701     xmlListPtr l; /* a list */
11702     int n_l;
11703
11704     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11705         mem_base = xmlMemBlocks();
11706         l = gen_xmlListPtr(n_l, 0);
11707
11708         xmlListSort(l);
11709         call_tests++;
11710         des_xmlListPtr(n_l, l, 0);
11711         xmlResetLastError();
11712         if (mem_base != xmlMemBlocks()) {
11713             printf("Leak of %d blocks found in xmlListSort",
11714                    xmlMemBlocks() - mem_base);
11715             test_ret++;
11716             printf(" %d", n_l);
11717             printf("\n");
11718         }
11719     }
11720     function_tests++;
11721
11722     return(test_ret);
11723 }
11724
11725
11726 static int
11727 test_xmlListWalk(void) {
11728     int test_ret = 0;
11729
11730
11731     /* missing type support */
11732     return(test_ret);
11733 }
11734
11735 static int
11736 test_list(void) {
11737     int test_ret = 0;
11738         int rc = 0;
11739
11740     if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11741     rc = test_xmlLinkGetData();
11742         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11743     rc = test_xmlListAppend();
11744         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11745     rc = test_xmlListClear();
11746         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11747     rc = test_xmlListCopy();
11748         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11749     rc = test_xmlListCreate();
11750         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11751     rc = test_xmlListDup();
11752         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11753     rc = test_xmlListEmpty();
11754         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11755     rc = test_xmlListEnd();
11756         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11757     rc = test_xmlListFront();
11758         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11759     rc = test_xmlListInsert();
11760         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11761     rc = test_xmlListMerge();
11762         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11763     rc = test_xmlListPopBack();
11764         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11765     rc = test_xmlListPopFront();
11766         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11767     rc = test_xmlListPushBack();
11768         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11769     rc = test_xmlListPushFront();
11770         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11771     rc = test_xmlListRemoveAll();
11772         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11773     rc = test_xmlListRemoveFirst();
11774         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11775     rc = test_xmlListRemoveLast();
11776         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11777     rc = test_xmlListReverse();
11778         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11779     rc = test_xmlListReverseSearch();
11780         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11781     rc = test_xmlListReverseWalk();
11782         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11783     rc = test_xmlListSearch();
11784         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11785     rc = test_xmlListSize();
11786         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11787     rc = test_xmlListSort();
11788         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11789     rc = test_xmlListWalk();
11790         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
11791
11792     if (test_ret != 0)
11793         printf("Module list: %d errors\n", test_ret);
11794     return(test_ret);
11795 }
11796
11797 static int
11798 test_xmlNanoFTPCheckResponse(void) {
11799     int test_ret = 0;
11800
11801 #if defined(LIBXML_FTP_ENABLED)
11802     int mem_base;
11803     int ret_val;
11804     void * ctx; /* an FTP context */
11805     int n_ctx;
11806
11807     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11808         mem_base = xmlMemBlocks();
11809         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11810
11811         ret_val = xmlNanoFTPCheckResponse(ctx);
11812         desret_int(ret_val);
11813         call_tests++;
11814         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11815         xmlResetLastError();
11816         if (mem_base != xmlMemBlocks()) {
11817             printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11818                    xmlMemBlocks() - mem_base);
11819             test_ret++;
11820             printf(" %d", n_ctx);
11821             printf("\n");
11822         }
11823     }
11824     function_tests++;
11825 #endif
11826
11827     return(test_ret);
11828 }
11829
11830
11831 static int
11832 test_xmlNanoFTPCleanup(void) {
11833     int test_ret = 0;
11834
11835 #if defined(LIBXML_FTP_ENABLED)
11836     int mem_base;
11837
11838         mem_base = xmlMemBlocks();
11839
11840         xmlNanoFTPCleanup();
11841         call_tests++;
11842         xmlResetLastError();
11843         if (mem_base != xmlMemBlocks()) {
11844             printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11845                    xmlMemBlocks() - mem_base);
11846             test_ret++;
11847             printf("\n");
11848         }
11849     function_tests++;
11850 #endif
11851
11852     return(test_ret);
11853 }
11854
11855
11856 static int
11857 test_xmlNanoFTPCloseConnection(void) {
11858     int test_ret = 0;
11859
11860 #if defined(LIBXML_FTP_ENABLED)
11861     int mem_base;
11862     int ret_val;
11863     void * ctx; /* an FTP context */
11864     int n_ctx;
11865
11866     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11867         mem_base = xmlMemBlocks();
11868         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11869
11870         ret_val = xmlNanoFTPCloseConnection(ctx);
11871         desret_int(ret_val);
11872         call_tests++;
11873         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11874         xmlResetLastError();
11875         if (mem_base != xmlMemBlocks()) {
11876             printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11877                    xmlMemBlocks() - mem_base);
11878             test_ret++;
11879             printf(" %d", n_ctx);
11880             printf("\n");
11881         }
11882     }
11883     function_tests++;
11884 #endif
11885
11886     return(test_ret);
11887 }
11888
11889
11890 static int
11891 test_xmlNanoFTPCwd(void) {
11892     int test_ret = 0;
11893
11894 #if defined(LIBXML_FTP_ENABLED)
11895     int mem_base;
11896     int ret_val;
11897     void * ctx; /* an FTP context */
11898     int n_ctx;
11899     char * directory; /* a directory on the server */
11900     int n_directory;
11901
11902     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11903     for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11904         mem_base = xmlMemBlocks();
11905         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11906         directory = gen_const_char_ptr(n_directory, 1);
11907
11908         ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11909         desret_int(ret_val);
11910         call_tests++;
11911         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11912         des_const_char_ptr(n_directory, (const char *)directory, 1);
11913         xmlResetLastError();
11914         if (mem_base != xmlMemBlocks()) {
11915             printf("Leak of %d blocks found in xmlNanoFTPCwd",
11916                    xmlMemBlocks() - mem_base);
11917             test_ret++;
11918             printf(" %d", n_ctx);
11919             printf(" %d", n_directory);
11920             printf("\n");
11921         }
11922     }
11923     }
11924     function_tests++;
11925 #endif
11926
11927     return(test_ret);
11928 }
11929
11930
11931 static int
11932 test_xmlNanoFTPDele(void) {
11933     int test_ret = 0;
11934
11935 #if defined(LIBXML_FTP_ENABLED)
11936     int mem_base;
11937     int ret_val;
11938     void * ctx; /* an FTP context */
11939     int n_ctx;
11940     const char * file; /* a file or directory on the server */
11941     int n_file;
11942
11943     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11944     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11945         mem_base = xmlMemBlocks();
11946         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11947         file = gen_filepath(n_file, 1);
11948
11949         ret_val = xmlNanoFTPDele(ctx, file);
11950         desret_int(ret_val);
11951         call_tests++;
11952         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11953         des_filepath(n_file, file, 1);
11954         xmlResetLastError();
11955         if (mem_base != xmlMemBlocks()) {
11956             printf("Leak of %d blocks found in xmlNanoFTPDele",
11957                    xmlMemBlocks() - mem_base);
11958             test_ret++;
11959             printf(" %d", n_ctx);
11960             printf(" %d", n_file);
11961             printf("\n");
11962         }
11963     }
11964     }
11965     function_tests++;
11966 #endif
11967
11968     return(test_ret);
11969 }
11970
11971
11972 static int
11973 test_xmlNanoFTPGet(void) {
11974     int test_ret = 0;
11975
11976
11977     /* missing type support */
11978     return(test_ret);
11979 }
11980
11981
11982 static int
11983 test_xmlNanoFTPGetConnection(void) {
11984     int test_ret = 0;
11985
11986
11987     /* missing type support */
11988     return(test_ret);
11989 }
11990
11991
11992 static int
11993 test_xmlNanoFTPGetResponse(void) {
11994     int test_ret = 0;
11995
11996 #if defined(LIBXML_FTP_ENABLED)
11997     int mem_base;
11998     int ret_val;
11999     void * ctx; /* an FTP context */
12000     int n_ctx;
12001
12002     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12003         mem_base = xmlMemBlocks();
12004         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12005
12006         ret_val = xmlNanoFTPGetResponse(ctx);
12007         desret_int(ret_val);
12008         call_tests++;
12009         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12010         xmlResetLastError();
12011         if (mem_base != xmlMemBlocks()) {
12012             printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
12013                    xmlMemBlocks() - mem_base);
12014             test_ret++;
12015             printf(" %d", n_ctx);
12016             printf("\n");
12017         }
12018     }
12019     function_tests++;
12020 #endif
12021
12022     return(test_ret);
12023 }
12024
12025
12026 static int
12027 test_xmlNanoFTPGetSocket(void) {
12028     int test_ret = 0;
12029
12030
12031     /* missing type support */
12032     return(test_ret);
12033 }
12034
12035
12036 static int
12037 test_xmlNanoFTPInit(void) {
12038     int test_ret = 0;
12039
12040 #if defined(LIBXML_FTP_ENABLED)
12041     int mem_base;
12042
12043         mem_base = xmlMemBlocks();
12044
12045         xmlNanoFTPInit();
12046         call_tests++;
12047         xmlResetLastError();
12048         if (mem_base != xmlMemBlocks()) {
12049             printf("Leak of %d blocks found in xmlNanoFTPInit",
12050                    xmlMemBlocks() - mem_base);
12051             test_ret++;
12052             printf("\n");
12053         }
12054     function_tests++;
12055 #endif
12056
12057     return(test_ret);
12058 }
12059
12060
12061 static int
12062 test_xmlNanoFTPList(void) {
12063     int test_ret = 0;
12064
12065
12066     /* missing type support */
12067     return(test_ret);
12068 }
12069
12070
12071 static int
12072 test_xmlNanoFTPNewCtxt(void) {
12073     int test_ret = 0;
12074
12075 #if defined(LIBXML_FTP_ENABLED)
12076     int mem_base;
12077     void * ret_val;
12078     const char * URL; /* The URL used to initialize the context */
12079     int n_URL;
12080
12081     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12082         mem_base = xmlMemBlocks();
12083         URL = gen_filepath(n_URL, 0);
12084
12085         ret_val = xmlNanoFTPNewCtxt(URL);
12086         desret_xmlNanoFTPCtxtPtr(ret_val);
12087         call_tests++;
12088         des_filepath(n_URL, URL, 0);
12089         xmlResetLastError();
12090         if (mem_base != xmlMemBlocks()) {
12091             printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
12092                    xmlMemBlocks() - mem_base);
12093             test_ret++;
12094             printf(" %d", n_URL);
12095             printf("\n");
12096         }
12097     }
12098     function_tests++;
12099 #endif
12100
12101     return(test_ret);
12102 }
12103
12104
12105 static int
12106 test_xmlNanoFTPOpen(void) {
12107     int test_ret = 0;
12108
12109 #if defined(LIBXML_FTP_ENABLED)
12110     int mem_base;
12111     void * ret_val;
12112     const char * URL; /* the URL to the resource */
12113     int n_URL;
12114
12115     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12116         mem_base = xmlMemBlocks();
12117         URL = gen_filepath(n_URL, 0);
12118
12119         ret_val = xmlNanoFTPOpen(URL);
12120         desret_xmlNanoFTPCtxtPtr(ret_val);
12121         call_tests++;
12122         des_filepath(n_URL, URL, 0);
12123         xmlResetLastError();
12124         if (mem_base != xmlMemBlocks()) {
12125             printf("Leak of %d blocks found in xmlNanoFTPOpen",
12126                    xmlMemBlocks() - mem_base);
12127             test_ret++;
12128             printf(" %d", n_URL);
12129             printf("\n");
12130         }
12131     }
12132     function_tests++;
12133 #endif
12134
12135     return(test_ret);
12136 }
12137
12138
12139 static int
12140 test_xmlNanoFTPProxy(void) {
12141     int test_ret = 0;
12142
12143 #if defined(LIBXML_FTP_ENABLED)
12144     char * host; /* the proxy host name */
12145     int n_host;
12146     int port; /* the proxy port */
12147     int n_port;
12148     char * user; /* the proxy user name */
12149     int n_user;
12150     char * passwd; /* the proxy password */
12151     int n_passwd;
12152     int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
12153     int n_type;
12154
12155     for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
12156     for (n_port = 0;n_port < gen_nb_int;n_port++) {
12157     for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
12158     for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
12159     for (n_type = 0;n_type < gen_nb_int;n_type++) {
12160         host = gen_const_char_ptr(n_host, 0);
12161         port = gen_int(n_port, 1);
12162         user = gen_const_char_ptr(n_user, 2);
12163         passwd = gen_const_char_ptr(n_passwd, 3);
12164         type = gen_int(n_type, 4);
12165
12166         xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
12167         call_tests++;
12168         des_const_char_ptr(n_host, (const char *)host, 0);
12169         des_int(n_port, port, 1);
12170         des_const_char_ptr(n_user, (const char *)user, 2);
12171         des_const_char_ptr(n_passwd, (const char *)passwd, 3);
12172         des_int(n_type, type, 4);
12173         xmlResetLastError();
12174     }
12175     }
12176     }
12177     }
12178     }
12179     function_tests++;
12180 #endif
12181
12182     return(test_ret);
12183 }
12184
12185
12186 static int
12187 test_xmlNanoFTPQuit(void) {
12188     int test_ret = 0;
12189
12190 #if defined(LIBXML_FTP_ENABLED)
12191     int mem_base;
12192     int ret_val;
12193     void * ctx; /* an FTP context */
12194     int n_ctx;
12195
12196     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12197         mem_base = xmlMemBlocks();
12198         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12199
12200         ret_val = xmlNanoFTPQuit(ctx);
12201         desret_int(ret_val);
12202         call_tests++;
12203         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12204         xmlResetLastError();
12205         if (mem_base != xmlMemBlocks()) {
12206             printf("Leak of %d blocks found in xmlNanoFTPQuit",
12207                    xmlMemBlocks() - mem_base);
12208             test_ret++;
12209             printf(" %d", n_ctx);
12210             printf("\n");
12211         }
12212     }
12213     function_tests++;
12214 #endif
12215
12216     return(test_ret);
12217 }
12218
12219
12220 static int
12221 test_xmlNanoFTPRead(void) {
12222     int test_ret = 0;
12223
12224 #if defined(LIBXML_FTP_ENABLED)
12225     int mem_base;
12226     int ret_val;
12227     void * ctx; /* the FTP context */
12228     int n_ctx;
12229     void * dest; /* a buffer */
12230     int n_dest;
12231     int len; /* the buffer length */
12232     int n_len;
12233
12234     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12235     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12236     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12237         mem_base = xmlMemBlocks();
12238         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12239         dest = gen_void_ptr(n_dest, 1);
12240         len = gen_int(n_len, 2);
12241
12242         ret_val = xmlNanoFTPRead(ctx, dest, len);
12243         desret_int(ret_val);
12244         call_tests++;
12245         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12246         des_void_ptr(n_dest, dest, 1);
12247         des_int(n_len, len, 2);
12248         xmlResetLastError();
12249         if (mem_base != xmlMemBlocks()) {
12250             printf("Leak of %d blocks found in xmlNanoFTPRead",
12251                    xmlMemBlocks() - mem_base);
12252             test_ret++;
12253             printf(" %d", n_ctx);
12254             printf(" %d", n_dest);
12255             printf(" %d", n_len);
12256             printf("\n");
12257         }
12258     }
12259     }
12260     }
12261     function_tests++;
12262 #endif
12263
12264     return(test_ret);
12265 }
12266
12267
12268 static int
12269 test_xmlNanoFTPScanProxy(void) {
12270     int test_ret = 0;
12271
12272 #if defined(LIBXML_FTP_ENABLED)
12273     const char * URL; /* The proxy URL used to initialize the proxy context */
12274     int n_URL;
12275
12276     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12277         URL = gen_filepath(n_URL, 0);
12278
12279         xmlNanoFTPScanProxy(URL);
12280         call_tests++;
12281         des_filepath(n_URL, URL, 0);
12282         xmlResetLastError();
12283     }
12284     function_tests++;
12285 #endif
12286
12287     return(test_ret);
12288 }
12289
12290
12291 static int
12292 test_xmlNanoFTPUpdateURL(void) {
12293     int test_ret = 0;
12294
12295 #if defined(LIBXML_FTP_ENABLED)
12296     int mem_base;
12297     int ret_val;
12298     void * ctx; /* an FTP context */
12299     int n_ctx;
12300     const char * URL; /* The URL used to update the context */
12301     int n_URL;
12302
12303     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12304     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12305         mem_base = xmlMemBlocks();
12306         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12307         URL = gen_filepath(n_URL, 1);
12308
12309         ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12310         desret_int(ret_val);
12311         call_tests++;
12312         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12313         des_filepath(n_URL, URL, 1);
12314         xmlResetLastError();
12315         if (mem_base != xmlMemBlocks()) {
12316             printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12317                    xmlMemBlocks() - mem_base);
12318             test_ret++;
12319             printf(" %d", n_ctx);
12320             printf(" %d", n_URL);
12321             printf("\n");
12322         }
12323     }
12324     }
12325     function_tests++;
12326 #endif
12327
12328     return(test_ret);
12329 }
12330
12331 static int
12332 test_nanoftp(void) {
12333     int test_ret = 0;
12334         int rc = 0;
12335
12336     if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12337     rc = test_xmlNanoFTPCheckResponse();
12338         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12339     rc = test_xmlNanoFTPCleanup();
12340         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12341     rc = test_xmlNanoFTPCloseConnection();
12342         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12343     rc = test_xmlNanoFTPCwd();
12344         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12345     rc = test_xmlNanoFTPDele();
12346         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12347     rc = test_xmlNanoFTPGet();
12348         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12349     rc = test_xmlNanoFTPGetConnection();
12350         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12351     rc = test_xmlNanoFTPGetResponse();
12352         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12353     rc = test_xmlNanoFTPGetSocket();
12354         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12355     rc = test_xmlNanoFTPInit();
12356         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12357     rc = test_xmlNanoFTPList();
12358         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12359     rc = test_xmlNanoFTPNewCtxt();
12360         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12361     rc = test_xmlNanoFTPOpen();
12362         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12363     rc = test_xmlNanoFTPProxy();
12364         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12365     rc = test_xmlNanoFTPQuit();
12366         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12367     rc = test_xmlNanoFTPRead();
12368         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12369     rc = test_xmlNanoFTPScanProxy();
12370         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12371     rc = test_xmlNanoFTPUpdateURL();
12372         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12373
12374     if (test_ret != 0)
12375         printf("Module nanoftp: %d errors\n", test_ret);
12376     return(test_ret);
12377 }
12378
12379 static int
12380 test_xmlNanoHTTPAuthHeader(void) {
12381     int test_ret = 0;
12382
12383 #if defined(LIBXML_HTTP_ENABLED)
12384     int mem_base;
12385     const char * ret_val;
12386     void * ctx; /* the HTTP context */
12387     int n_ctx;
12388
12389     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12390         mem_base = xmlMemBlocks();
12391         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12392
12393         ret_val = xmlNanoHTTPAuthHeader(ctx);
12394         desret_const_char_ptr(ret_val);
12395         call_tests++;
12396         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12397         xmlResetLastError();
12398         if (mem_base != xmlMemBlocks()) {
12399             printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12400                    xmlMemBlocks() - mem_base);
12401             test_ret++;
12402             printf(" %d", n_ctx);
12403             printf("\n");
12404         }
12405     }
12406     function_tests++;
12407 #endif
12408
12409     return(test_ret);
12410 }
12411
12412
12413 static int
12414 test_xmlNanoHTTPCleanup(void) {
12415     int test_ret = 0;
12416
12417 #if defined(LIBXML_HTTP_ENABLED)
12418     int mem_base;
12419
12420         mem_base = xmlMemBlocks();
12421
12422         xmlNanoHTTPCleanup();
12423         call_tests++;
12424         xmlResetLastError();
12425         if (mem_base != xmlMemBlocks()) {
12426             printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12427                    xmlMemBlocks() - mem_base);
12428             test_ret++;
12429             printf("\n");
12430         }
12431     function_tests++;
12432 #endif
12433
12434     return(test_ret);
12435 }
12436
12437
12438 static int
12439 test_xmlNanoHTTPContentLength(void) {
12440     int test_ret = 0;
12441
12442 #if defined(LIBXML_HTTP_ENABLED)
12443     int mem_base;
12444     int ret_val;
12445     void * ctx; /* the HTTP context */
12446     int n_ctx;
12447
12448     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12449         mem_base = xmlMemBlocks();
12450         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12451
12452         ret_val = xmlNanoHTTPContentLength(ctx);
12453         desret_int(ret_val);
12454         call_tests++;
12455         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12456         xmlResetLastError();
12457         if (mem_base != xmlMemBlocks()) {
12458             printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12459                    xmlMemBlocks() - mem_base);
12460             test_ret++;
12461             printf(" %d", n_ctx);
12462             printf("\n");
12463         }
12464     }
12465     function_tests++;
12466 #endif
12467
12468     return(test_ret);
12469 }
12470
12471
12472 static int
12473 test_xmlNanoHTTPEncoding(void) {
12474     int test_ret = 0;
12475
12476 #if defined(LIBXML_HTTP_ENABLED)
12477     int mem_base;
12478     const char * ret_val;
12479     void * ctx; /* the HTTP context */
12480     int n_ctx;
12481
12482     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12483         mem_base = xmlMemBlocks();
12484         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12485
12486         ret_val = xmlNanoHTTPEncoding(ctx);
12487         desret_const_char_ptr(ret_val);
12488         call_tests++;
12489         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12490         xmlResetLastError();
12491         if (mem_base != xmlMemBlocks()) {
12492             printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12493                    xmlMemBlocks() - mem_base);
12494             test_ret++;
12495             printf(" %d", n_ctx);
12496             printf("\n");
12497         }
12498     }
12499     function_tests++;
12500 #endif
12501
12502     return(test_ret);
12503 }
12504
12505
12506 #define gen_nb_char_ptr_ptr 1
12507 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12508     return(NULL);
12509 }
12510 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12511 }
12512
12513 static int
12514 test_xmlNanoHTTPFetch(void) {
12515     int test_ret = 0;
12516
12517 #if defined(LIBXML_HTTP_ENABLED)
12518     int mem_base;
12519     int ret_val;
12520     const char * URL; /* The URL to load */
12521     int n_URL;
12522     const char * filename; /* the filename where the content should be saved */
12523     int n_filename;
12524     char ** contentType; /* if available the Content-Type information will be returned at that location */
12525     int n_contentType;
12526
12527     for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12528     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12529     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12530         mem_base = xmlMemBlocks();
12531         URL = gen_fileoutput(n_URL, 0);
12532         filename = gen_fileoutput(n_filename, 1);
12533         contentType = gen_char_ptr_ptr(n_contentType, 2);
12534
12535         ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12536         desret_int(ret_val);
12537         call_tests++;
12538         des_fileoutput(n_URL, URL, 0);
12539         des_fileoutput(n_filename, filename, 1);
12540         des_char_ptr_ptr(n_contentType, contentType, 2);
12541         xmlResetLastError();
12542         if (mem_base != xmlMemBlocks()) {
12543             printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12544                    xmlMemBlocks() - mem_base);
12545             test_ret++;
12546             printf(" %d", n_URL);
12547             printf(" %d", n_filename);
12548             printf(" %d", n_contentType);
12549             printf("\n");
12550         }
12551     }
12552     }
12553     }
12554     function_tests++;
12555 #endif
12556
12557     return(test_ret);
12558 }
12559
12560
12561 static int
12562 test_xmlNanoHTTPInit(void) {
12563     int test_ret = 0;
12564
12565 #if defined(LIBXML_HTTP_ENABLED)
12566     int mem_base;
12567
12568         mem_base = xmlMemBlocks();
12569
12570         xmlNanoHTTPInit();
12571         call_tests++;
12572         xmlResetLastError();
12573         if (mem_base != xmlMemBlocks()) {
12574             printf("Leak of %d blocks found in xmlNanoHTTPInit",
12575                    xmlMemBlocks() - mem_base);
12576             test_ret++;
12577             printf("\n");
12578         }
12579     function_tests++;
12580 #endif
12581
12582     return(test_ret);
12583 }
12584
12585
12586 static int
12587 test_xmlNanoHTTPMimeType(void) {
12588     int test_ret = 0;
12589
12590 #if defined(LIBXML_HTTP_ENABLED)
12591     int mem_base;
12592     const char * ret_val;
12593     void * ctx; /* the HTTP context */
12594     int n_ctx;
12595
12596     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12597         mem_base = xmlMemBlocks();
12598         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12599
12600         ret_val = xmlNanoHTTPMimeType(ctx);
12601         desret_const_char_ptr(ret_val);
12602         call_tests++;
12603         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12604         xmlResetLastError();
12605         if (mem_base != xmlMemBlocks()) {
12606             printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12607                    xmlMemBlocks() - mem_base);
12608             test_ret++;
12609             printf(" %d", n_ctx);
12610             printf("\n");
12611         }
12612     }
12613     function_tests++;
12614 #endif
12615
12616     return(test_ret);
12617 }
12618
12619
12620 static int
12621 test_xmlNanoHTTPOpen(void) {
12622     int test_ret = 0;
12623
12624 #if defined(LIBXML_HTTP_ENABLED)
12625     int mem_base;
12626     void * ret_val;
12627     const char * URL; /* The URL to load */
12628     int n_URL;
12629     char ** contentType; /* if available the Content-Type information will be returned at that location */
12630     int n_contentType;
12631
12632     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12633     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12634         mem_base = xmlMemBlocks();
12635         URL = gen_filepath(n_URL, 0);
12636         contentType = gen_char_ptr_ptr(n_contentType, 1);
12637
12638         ret_val = xmlNanoHTTPOpen(URL, contentType);
12639         desret_xmlNanoHTTPCtxtPtr(ret_val);
12640         call_tests++;
12641         des_filepath(n_URL, URL, 0);
12642         des_char_ptr_ptr(n_contentType, contentType, 1);
12643         xmlResetLastError();
12644         if (mem_base != xmlMemBlocks()) {
12645             printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12646                    xmlMemBlocks() - mem_base);
12647             test_ret++;
12648             printf(" %d", n_URL);
12649             printf(" %d", n_contentType);
12650             printf("\n");
12651         }
12652     }
12653     }
12654     function_tests++;
12655 #endif
12656
12657     return(test_ret);
12658 }
12659
12660
12661 static int
12662 test_xmlNanoHTTPOpenRedir(void) {
12663     int test_ret = 0;
12664
12665 #if defined(LIBXML_HTTP_ENABLED)
12666     int mem_base;
12667     void * ret_val;
12668     const char * URL; /* The URL to load */
12669     int n_URL;
12670     char ** contentType; /* if available the Content-Type information will be returned at that location */
12671     int n_contentType;
12672     char ** redir; /* if available the redirected URL will be returned */
12673     int n_redir;
12674
12675     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12676     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12677     for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12678         mem_base = xmlMemBlocks();
12679         URL = gen_filepath(n_URL, 0);
12680         contentType = gen_char_ptr_ptr(n_contentType, 1);
12681         redir = gen_char_ptr_ptr(n_redir, 2);
12682
12683         ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12684         desret_xmlNanoHTTPCtxtPtr(ret_val);
12685         call_tests++;
12686         des_filepath(n_URL, URL, 0);
12687         des_char_ptr_ptr(n_contentType, contentType, 1);
12688         des_char_ptr_ptr(n_redir, redir, 2);
12689         xmlResetLastError();
12690         if (mem_base != xmlMemBlocks()) {
12691             printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12692                    xmlMemBlocks() - mem_base);
12693             test_ret++;
12694             printf(" %d", n_URL);
12695             printf(" %d", n_contentType);
12696             printf(" %d", n_redir);
12697             printf("\n");
12698         }
12699     }
12700     }
12701     }
12702     function_tests++;
12703 #endif
12704
12705     return(test_ret);
12706 }
12707
12708
12709 static int
12710 test_xmlNanoHTTPRead(void) {
12711     int test_ret = 0;
12712
12713 #if defined(LIBXML_HTTP_ENABLED)
12714     int mem_base;
12715     int ret_val;
12716     void * ctx; /* the HTTP context */
12717     int n_ctx;
12718     void * dest; /* a buffer */
12719     int n_dest;
12720     int len; /* the buffer length */
12721     int n_len;
12722
12723     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12724     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12725     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12726         mem_base = xmlMemBlocks();
12727         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12728         dest = gen_void_ptr(n_dest, 1);
12729         len = gen_int(n_len, 2);
12730
12731         ret_val = xmlNanoHTTPRead(ctx, dest, len);
12732         desret_int(ret_val);
12733         call_tests++;
12734         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12735         des_void_ptr(n_dest, dest, 1);
12736         des_int(n_len, len, 2);
12737         xmlResetLastError();
12738         if (mem_base != xmlMemBlocks()) {
12739             printf("Leak of %d blocks found in xmlNanoHTTPRead",
12740                    xmlMemBlocks() - mem_base);
12741             test_ret++;
12742             printf(" %d", n_ctx);
12743             printf(" %d", n_dest);
12744             printf(" %d", n_len);
12745             printf("\n");
12746         }
12747     }
12748     }
12749     }
12750     function_tests++;
12751 #endif
12752
12753     return(test_ret);
12754 }
12755
12756
12757 static int
12758 test_xmlNanoHTTPRedir(void) {
12759     int test_ret = 0;
12760
12761
12762     /* missing type support */
12763     return(test_ret);
12764 }
12765
12766
12767 static int
12768 test_xmlNanoHTTPReturnCode(void) {
12769     int test_ret = 0;
12770
12771 #if defined(LIBXML_HTTP_ENABLED)
12772     int mem_base;
12773     int ret_val;
12774     void * ctx; /* the HTTP context */
12775     int n_ctx;
12776
12777     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12778         mem_base = xmlMemBlocks();
12779         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12780
12781         ret_val = xmlNanoHTTPReturnCode(ctx);
12782         desret_int(ret_val);
12783         call_tests++;
12784         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12785         xmlResetLastError();
12786         if (mem_base != xmlMemBlocks()) {
12787             printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12788                    xmlMemBlocks() - mem_base);
12789             test_ret++;
12790             printf(" %d", n_ctx);
12791             printf("\n");
12792         }
12793     }
12794     function_tests++;
12795 #endif
12796
12797     return(test_ret);
12798 }
12799
12800
12801 static int
12802 test_xmlNanoHTTPSave(void) {
12803     int test_ret = 0;
12804
12805 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12806     int mem_base;
12807     int ret_val;
12808     void * ctxt; /* the HTTP context */
12809     int n_ctxt;
12810     const char * filename; /* the filename where the content should be saved */
12811     int n_filename;
12812
12813     for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12814     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12815         mem_base = xmlMemBlocks();
12816         ctxt = gen_void_ptr(n_ctxt, 0);
12817         filename = gen_fileoutput(n_filename, 1);
12818
12819         ret_val = xmlNanoHTTPSave(ctxt, filename);
12820         desret_int(ret_val);
12821         call_tests++;
12822         des_void_ptr(n_ctxt, ctxt, 0);
12823         des_fileoutput(n_filename, filename, 1);
12824         xmlResetLastError();
12825         if (mem_base != xmlMemBlocks()) {
12826             printf("Leak of %d blocks found in xmlNanoHTTPSave",
12827                    xmlMemBlocks() - mem_base);
12828             test_ret++;
12829             printf(" %d", n_ctxt);
12830             printf(" %d", n_filename);
12831             printf("\n");
12832         }
12833     }
12834     }
12835     function_tests++;
12836 #endif
12837
12838     return(test_ret);
12839 }
12840
12841
12842 static int
12843 test_xmlNanoHTTPScanProxy(void) {
12844     int test_ret = 0;
12845
12846 #if defined(LIBXML_HTTP_ENABLED)
12847     const char * URL; /* The proxy URL used to initialize the proxy context */
12848     int n_URL;
12849
12850     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12851         URL = gen_filepath(n_URL, 0);
12852
12853         xmlNanoHTTPScanProxy(URL);
12854         call_tests++;
12855         des_filepath(n_URL, URL, 0);
12856         xmlResetLastError();
12857     }
12858     function_tests++;
12859 #endif
12860
12861     return(test_ret);
12862 }
12863
12864 static int
12865 test_nanohttp(void) {
12866     int test_ret = 0;
12867         int rc = 0;
12868
12869     if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12870     rc = test_xmlNanoHTTPAuthHeader();
12871         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12872     rc = test_xmlNanoHTTPCleanup();
12873         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12874     rc = test_xmlNanoHTTPContentLength();
12875         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12876     rc = test_xmlNanoHTTPEncoding();
12877         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12878     rc = test_xmlNanoHTTPFetch();
12879         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12880     rc = test_xmlNanoHTTPInit();
12881         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12882     rc = test_xmlNanoHTTPMimeType();
12883         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12884     rc = test_xmlNanoHTTPOpen();
12885         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12886     rc = test_xmlNanoHTTPOpenRedir();
12887         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12888     rc = test_xmlNanoHTTPRead();
12889         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12890     rc = test_xmlNanoHTTPRedir();
12891         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12892     rc = test_xmlNanoHTTPReturnCode();
12893         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12894     rc = test_xmlNanoHTTPSave();
12895         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12896     rc = test_xmlNanoHTTPScanProxy();
12897         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
12898
12899     if (test_ret != 0)
12900         printf("Module nanohttp: %d errors\n", test_ret);
12901     return(test_ret);
12902 }
12903
12904 static int
12905 test_xmlByteConsumed(void) {
12906     int test_ret = 0;
12907
12908     int mem_base;
12909     long ret_val;
12910     xmlParserCtxtPtr ctxt; /* an XML parser context */
12911     int n_ctxt;
12912
12913     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12914         mem_base = xmlMemBlocks();
12915         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12916
12917         ret_val = xmlByteConsumed(ctxt);
12918         desret_long(ret_val);
12919         call_tests++;
12920         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12921         xmlResetLastError();
12922         if (mem_base != xmlMemBlocks()) {
12923             printf("Leak of %d blocks found in xmlByteConsumed",
12924                    xmlMemBlocks() - mem_base);
12925             test_ret++;
12926             printf(" %d", n_ctxt);
12927             printf("\n");
12928         }
12929     }
12930     function_tests++;
12931
12932     return(test_ret);
12933 }
12934
12935
12936 static int
12937 test_xmlClearNodeInfoSeq(void) {
12938     int test_ret = 0;
12939
12940     int mem_base;
12941     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12942     int n_seq;
12943
12944     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12945         mem_base = xmlMemBlocks();
12946         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12947
12948         xmlClearNodeInfoSeq(seq);
12949         call_tests++;
12950         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12951         xmlResetLastError();
12952         if (mem_base != xmlMemBlocks()) {
12953             printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12954                    xmlMemBlocks() - mem_base);
12955             test_ret++;
12956             printf(" %d", n_seq);
12957             printf("\n");
12958         }
12959     }
12960     function_tests++;
12961
12962     return(test_ret);
12963 }
12964
12965
12966 static int
12967 test_xmlClearParserCtxt(void) {
12968     int test_ret = 0;
12969
12970     int mem_base;
12971     xmlParserCtxtPtr ctxt; /* an XML parser context */
12972     int n_ctxt;
12973
12974     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12975         mem_base = xmlMemBlocks();
12976         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12977
12978         xmlClearParserCtxt(ctxt);
12979         call_tests++;
12980         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12981         xmlResetLastError();
12982         if (mem_base != xmlMemBlocks()) {
12983             printf("Leak of %d blocks found in xmlClearParserCtxt",
12984                    xmlMemBlocks() - mem_base);
12985             test_ret++;
12986             printf(" %d", n_ctxt);
12987             printf("\n");
12988         }
12989     }
12990     function_tests++;
12991
12992     return(test_ret);
12993 }
12994
12995
12996 static int
12997 test_xmlCreateDocParserCtxt(void) {
12998     int test_ret = 0;
12999
13000     int mem_base;
13001     xmlParserCtxtPtr ret_val;
13002     xmlChar * cur; /* a pointer to an array of xmlChar */
13003     int n_cur;
13004
13005     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13006         mem_base = xmlMemBlocks();
13007         cur = gen_const_xmlChar_ptr(n_cur, 0);
13008
13009         ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
13010         desret_xmlParserCtxtPtr(ret_val);
13011         call_tests++;
13012         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13013         xmlResetLastError();
13014         if (mem_base != xmlMemBlocks()) {
13015             printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
13016                    xmlMemBlocks() - mem_base);
13017             test_ret++;
13018             printf(" %d", n_cur);
13019             printf("\n");
13020         }
13021     }
13022     function_tests++;
13023
13024     return(test_ret);
13025 }
13026
13027
13028 static int
13029 test_xmlCreatePushParserCtxt(void) {
13030     int test_ret = 0;
13031
13032 #if defined(LIBXML_PUSH_ENABLED)
13033     int mem_base;
13034     xmlParserCtxtPtr ret_val;
13035     xmlSAXHandlerPtr sax; /* a SAX handler */
13036     int n_sax;
13037     void * user_data; /* The user data returned on SAX callbacks */
13038     int n_user_data;
13039     char * chunk; /* a pointer to an array of chars */
13040     int n_chunk;
13041     int size; /* number of chars in the array */
13042     int n_size;
13043     const char * filename; /* an optional file name or URI */
13044     int n_filename;
13045
13046     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13047     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13048     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13049     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13050     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
13051         mem_base = xmlMemBlocks();
13052         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13053         user_data = gen_userdata(n_user_data, 1);
13054         chunk = gen_const_char_ptr(n_chunk, 2);
13055         size = gen_int(n_size, 3);
13056         filename = gen_fileoutput(n_filename, 4);
13057         if ((chunk != NULL) &&
13058             (size > (int) strlen((const char *) chunk) + 1))
13059             continue;
13060
13061         ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
13062         desret_xmlParserCtxtPtr(ret_val);
13063         call_tests++;
13064         des_xmlSAXHandlerPtr(n_sax, sax, 0);
13065         des_userdata(n_user_data, user_data, 1);
13066         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
13067         des_int(n_size, size, 3);
13068         des_fileoutput(n_filename, filename, 4);
13069         xmlResetLastError();
13070         if (mem_base != xmlMemBlocks()) {
13071             printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
13072                    xmlMemBlocks() - mem_base);
13073             test_ret++;
13074             printf(" %d", n_sax);
13075             printf(" %d", n_user_data);
13076             printf(" %d", n_chunk);
13077             printf(" %d", n_size);
13078             printf(" %d", n_filename);
13079             printf("\n");
13080         }
13081     }
13082     }
13083     }
13084     }
13085     }
13086     function_tests++;
13087 #endif
13088
13089     return(test_ret);
13090 }
13091
13092
13093 static int
13094 test_xmlCtxtReadDoc(void) {
13095     int test_ret = 0;
13096
13097     int mem_base;
13098     xmlDocPtr ret_val;
13099     xmlParserCtxtPtr ctxt; /* an XML parser context */
13100     int n_ctxt;
13101     xmlChar * cur; /* a pointer to a zero terminated string */
13102     int n_cur;
13103     const char * URL; /* the base URL to use for the document */
13104     int n_URL;
13105     char * encoding; /* the document encoding, or NULL */
13106     int n_encoding;
13107     int options; /* a combination of xmlParserOption */
13108     int n_options;
13109
13110     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13111     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13112     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13113     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13114     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13115         mem_base = xmlMemBlocks();
13116         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13117         cur = gen_const_xmlChar_ptr(n_cur, 1);
13118         URL = gen_filepath(n_URL, 2);
13119         encoding = gen_const_char_ptr(n_encoding, 3);
13120         options = gen_parseroptions(n_options, 4);
13121
13122         ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
13123         desret_xmlDocPtr(ret_val);
13124         call_tests++;
13125         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13126         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
13127         des_filepath(n_URL, URL, 2);
13128         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
13129         des_parseroptions(n_options, options, 4);
13130         xmlResetLastError();
13131         if (mem_base != xmlMemBlocks()) {
13132             printf("Leak of %d blocks found in xmlCtxtReadDoc",
13133                    xmlMemBlocks() - mem_base);
13134             test_ret++;
13135             printf(" %d", n_ctxt);
13136             printf(" %d", n_cur);
13137             printf(" %d", n_URL);
13138             printf(" %d", n_encoding);
13139             printf(" %d", n_options);
13140             printf("\n");
13141         }
13142     }
13143     }
13144     }
13145     }
13146     }
13147     function_tests++;
13148
13149     return(test_ret);
13150 }
13151
13152
13153 static int
13154 test_xmlCtxtReadFile(void) {
13155     int test_ret = 0;
13156
13157     int mem_base;
13158     xmlDocPtr ret_val;
13159     xmlParserCtxtPtr ctxt; /* an XML parser context */
13160     int n_ctxt;
13161     const char * filename; /* a file or URL */
13162     int n_filename;
13163     char * encoding; /* the document encoding, or NULL */
13164     int n_encoding;
13165     int options; /* a combination of xmlParserOption */
13166     int n_options;
13167
13168     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13169     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13170     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13171     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13172         mem_base = xmlMemBlocks();
13173         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13174         filename = gen_filepath(n_filename, 1);
13175         encoding = gen_const_char_ptr(n_encoding, 2);
13176         options = gen_parseroptions(n_options, 3);
13177
13178         ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
13179         desret_xmlDocPtr(ret_val);
13180         call_tests++;
13181         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13182         des_filepath(n_filename, filename, 1);
13183         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
13184         des_parseroptions(n_options, options, 3);
13185         xmlResetLastError();
13186         if (mem_base != xmlMemBlocks()) {
13187             printf("Leak of %d blocks found in xmlCtxtReadFile",
13188                    xmlMemBlocks() - mem_base);
13189             test_ret++;
13190             printf(" %d", n_ctxt);
13191             printf(" %d", n_filename);
13192             printf(" %d", n_encoding);
13193             printf(" %d", n_options);
13194             printf("\n");
13195         }
13196     }
13197     }
13198     }
13199     }
13200     function_tests++;
13201
13202     return(test_ret);
13203 }
13204
13205
13206 static int
13207 test_xmlCtxtReadMemory(void) {
13208     int test_ret = 0;
13209
13210     int mem_base;
13211     xmlDocPtr ret_val;
13212     xmlParserCtxtPtr ctxt; /* an XML parser context */
13213     int n_ctxt;
13214     char * buffer; /* a pointer to a char array */
13215     int n_buffer;
13216     int size; /* the size of the array */
13217     int n_size;
13218     const char * URL; /* the base URL to use for the document */
13219     int n_URL;
13220     char * encoding; /* the document encoding, or NULL */
13221     int n_encoding;
13222     int options; /* a combination of xmlParserOption */
13223     int n_options;
13224
13225     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13226     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
13227     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13228     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13229     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13230     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13231         mem_base = xmlMemBlocks();
13232         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13233         buffer = gen_const_char_ptr(n_buffer, 1);
13234         size = gen_int(n_size, 2);
13235         URL = gen_filepath(n_URL, 3);
13236         encoding = gen_const_char_ptr(n_encoding, 4);
13237         options = gen_parseroptions(n_options, 5);
13238         if ((buffer != NULL) &&
13239             (size > (int) strlen((const char *) buffer) + 1))
13240             continue;
13241
13242         ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
13243         desret_xmlDocPtr(ret_val);
13244         call_tests++;
13245         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13246         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
13247         des_int(n_size, size, 2);
13248         des_filepath(n_URL, URL, 3);
13249         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13250         des_parseroptions(n_options, options, 5);
13251         xmlResetLastError();
13252         if (mem_base != xmlMemBlocks()) {
13253             printf("Leak of %d blocks found in xmlCtxtReadMemory",
13254                    xmlMemBlocks() - mem_base);
13255             test_ret++;
13256             printf(" %d", n_ctxt);
13257             printf(" %d", n_buffer);
13258             printf(" %d", n_size);
13259             printf(" %d", n_URL);
13260             printf(" %d", n_encoding);
13261             printf(" %d", n_options);
13262             printf("\n");
13263         }
13264     }
13265     }
13266     }
13267     }
13268     }
13269     }
13270     function_tests++;
13271
13272     return(test_ret);
13273 }
13274
13275
13276 static int
13277 test_xmlCtxtReset(void) {
13278     int test_ret = 0;
13279
13280     int mem_base;
13281     xmlParserCtxtPtr ctxt; /* an XML parser context */
13282     int n_ctxt;
13283
13284     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13285         mem_base = xmlMemBlocks();
13286         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13287
13288         xmlCtxtReset(ctxt);
13289         call_tests++;
13290         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13291         xmlResetLastError();
13292         if (mem_base != xmlMemBlocks()) {
13293             printf("Leak of %d blocks found in xmlCtxtReset",
13294                    xmlMemBlocks() - mem_base);
13295             test_ret++;
13296             printf(" %d", n_ctxt);
13297             printf("\n");
13298         }
13299     }
13300     function_tests++;
13301
13302     return(test_ret);
13303 }
13304
13305
13306 static int
13307 test_xmlCtxtResetPush(void) {
13308     int test_ret = 0;
13309
13310     int mem_base;
13311     int ret_val;
13312     xmlParserCtxtPtr ctxt; /* an XML parser context */
13313     int n_ctxt;
13314     char * chunk; /* a pointer to an array of chars */
13315     int n_chunk;
13316     int size; /* number of chars in the array */
13317     int n_size;
13318     const char * filename; /* an optional file name or URI */
13319     int n_filename;
13320     char * encoding; /* the document encoding, or NULL */
13321     int n_encoding;
13322
13323     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13324     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13325     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13326     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13327     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13328         mem_base = xmlMemBlocks();
13329         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13330         chunk = gen_const_char_ptr(n_chunk, 1);
13331         size = gen_int(n_size, 2);
13332         filename = gen_filepath(n_filename, 3);
13333         encoding = gen_const_char_ptr(n_encoding, 4);
13334         if ((chunk != NULL) &&
13335             (size > (int) strlen((const char *) chunk) + 1))
13336             continue;
13337
13338         ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
13339         desret_int(ret_val);
13340         call_tests++;
13341         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13342         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13343         des_int(n_size, size, 2);
13344         des_filepath(n_filename, filename, 3);
13345         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13346         xmlResetLastError();
13347         if (mem_base != xmlMemBlocks()) {
13348             printf("Leak of %d blocks found in xmlCtxtResetPush",
13349                    xmlMemBlocks() - mem_base);
13350             test_ret++;
13351             printf(" %d", n_ctxt);
13352             printf(" %d", n_chunk);
13353             printf(" %d", n_size);
13354             printf(" %d", n_filename);
13355             printf(" %d", n_encoding);
13356             printf("\n");
13357         }
13358     }
13359     }
13360     }
13361     }
13362     }
13363     function_tests++;
13364
13365     return(test_ret);
13366 }
13367
13368
13369 static int
13370 test_xmlCtxtUseOptions(void) {
13371     int test_ret = 0;
13372
13373     int mem_base;
13374     int ret_val;
13375     xmlParserCtxtPtr ctxt; /* an XML parser context */
13376     int n_ctxt;
13377     int options; /* a combination of xmlParserOption */
13378     int n_options;
13379
13380     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13381     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13382         mem_base = xmlMemBlocks();
13383         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13384         options = gen_parseroptions(n_options, 1);
13385
13386         ret_val = xmlCtxtUseOptions(ctxt, options);
13387         desret_int(ret_val);
13388         call_tests++;
13389         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13390         des_parseroptions(n_options, options, 1);
13391         xmlResetLastError();
13392         if (mem_base != xmlMemBlocks()) {
13393             printf("Leak of %d blocks found in xmlCtxtUseOptions",
13394                    xmlMemBlocks() - mem_base);
13395             test_ret++;
13396             printf(" %d", n_ctxt);
13397             printf(" %d", n_options);
13398             printf("\n");
13399         }
13400     }
13401     }
13402     function_tests++;
13403
13404     return(test_ret);
13405 }
13406
13407
13408 static int
13409 test_xmlGetExternalEntityLoader(void) {
13410     int test_ret = 0;
13411
13412
13413     /* missing type support */
13414     return(test_ret);
13415 }
13416
13417
13418 static int
13419 test_xmlGetFeature(void) {
13420     int test_ret = 0;
13421
13422 #if defined(LIBXML_LEGACY_ENABLED)
13423 #ifdef LIBXML_LEGACY_ENABLED
13424     int mem_base;
13425     int ret_val;
13426     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13427     int n_ctxt;
13428     char * name; /* the feature name */
13429     int n_name;
13430     void * result; /* location to store the result */
13431     int n_result;
13432
13433     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13434     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13435     for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13436         mem_base = xmlMemBlocks();
13437         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13438         name = gen_const_char_ptr(n_name, 1);
13439         result = gen_void_ptr(n_result, 2);
13440
13441         ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13442         desret_int(ret_val);
13443         call_tests++;
13444         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13445         des_const_char_ptr(n_name, (const char *)name, 1);
13446         des_void_ptr(n_result, result, 2);
13447         xmlResetLastError();
13448         if (mem_base != xmlMemBlocks()) {
13449             printf("Leak of %d blocks found in xmlGetFeature",
13450                    xmlMemBlocks() - mem_base);
13451             test_ret++;
13452             printf(" %d", n_ctxt);
13453             printf(" %d", n_name);
13454             printf(" %d", n_result);
13455             printf("\n");
13456         }
13457     }
13458     }
13459     }
13460     function_tests++;
13461 #endif
13462 #endif
13463
13464     return(test_ret);
13465 }
13466
13467
13468 #define gen_nb_const_char_ptr_ptr 1
13469 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13470     return(NULL);
13471 }
13472 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13473 }
13474
13475 static int
13476 test_xmlGetFeaturesList(void) {
13477     int test_ret = 0;
13478
13479 #if defined(LIBXML_LEGACY_ENABLED)
13480 #ifdef LIBXML_LEGACY_ENABLED
13481     int mem_base;
13482     int ret_val;
13483     int * len; /* the length of the features name array (input/output) */
13484     int n_len;
13485     char ** result; /* an array of string to be filled with the features name. */
13486     int n_result;
13487
13488     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13489     for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13490         mem_base = xmlMemBlocks();
13491         len = gen_int_ptr(n_len, 0);
13492         result = gen_const_char_ptr_ptr(n_result, 1);
13493
13494         ret_val = xmlGetFeaturesList(len, (const char **)result);
13495         desret_int(ret_val);
13496         call_tests++;
13497         des_int_ptr(n_len, len, 0);
13498         des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13499         xmlResetLastError();
13500         if (mem_base != xmlMemBlocks()) {
13501             printf("Leak of %d blocks found in xmlGetFeaturesList",
13502                    xmlMemBlocks() - mem_base);
13503             test_ret++;
13504             printf(" %d", n_len);
13505             printf(" %d", n_result);
13506             printf("\n");
13507         }
13508     }
13509     }
13510     function_tests++;
13511 #endif
13512 #endif
13513
13514     return(test_ret);
13515 }
13516
13517
13518 static int
13519 test_xmlHasFeature(void) {
13520     int test_ret = 0;
13521
13522     int mem_base;
13523     int ret_val;
13524     xmlFeature feature; /* the feature to be examined */
13525     int n_feature;
13526
13527     for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13528         mem_base = xmlMemBlocks();
13529         feature = gen_xmlFeature(n_feature, 0);
13530
13531         ret_val = xmlHasFeature(feature);
13532         desret_int(ret_val);
13533         call_tests++;
13534         des_xmlFeature(n_feature, feature, 0);
13535         xmlResetLastError();
13536         if (mem_base != xmlMemBlocks()) {
13537             printf("Leak of %d blocks found in xmlHasFeature",
13538                    xmlMemBlocks() - mem_base);
13539             test_ret++;
13540             printf(" %d", n_feature);
13541             printf("\n");
13542         }
13543     }
13544     function_tests++;
13545
13546     return(test_ret);
13547 }
13548
13549
13550 static int
13551 test_xmlIOParseDTD(void) {
13552     int test_ret = 0;
13553
13554 #if defined(LIBXML_VALID_ENABLED)
13555 #ifdef LIBXML_VALID_ENABLED
13556     xmlDtdPtr ret_val;
13557     xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13558     int n_sax;
13559     xmlParserInputBufferPtr input; /* an Input Buffer */
13560     int n_input;
13561     xmlCharEncoding enc; /* the charset encoding if known */
13562     int n_enc;
13563
13564     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13565     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13566     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13567         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13568         input = gen_xmlParserInputBufferPtr(n_input, 1);
13569         enc = gen_xmlCharEncoding(n_enc, 2);
13570
13571         ret_val = xmlIOParseDTD(sax, input, enc);
13572         input = NULL;
13573         desret_xmlDtdPtr(ret_val);
13574         call_tests++;
13575         des_xmlSAXHandlerPtr(n_sax, sax, 0);
13576         des_xmlParserInputBufferPtr(n_input, input, 1);
13577         des_xmlCharEncoding(n_enc, enc, 2);
13578         xmlResetLastError();
13579     }
13580     }
13581     }
13582     function_tests++;
13583 #endif
13584 #endif
13585
13586     return(test_ret);
13587 }
13588
13589
13590 static int
13591 test_xmlInitNodeInfoSeq(void) {
13592     int test_ret = 0;
13593
13594     int mem_base;
13595     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13596     int n_seq;
13597
13598     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13599         mem_base = xmlMemBlocks();
13600         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13601
13602         xmlInitNodeInfoSeq(seq);
13603         call_tests++;
13604         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13605         xmlResetLastError();
13606         if (mem_base != xmlMemBlocks()) {
13607             printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13608                    xmlMemBlocks() - mem_base);
13609             test_ret++;
13610             printf(" %d", n_seq);
13611             printf("\n");
13612         }
13613     }
13614     function_tests++;
13615
13616     return(test_ret);
13617 }
13618
13619
13620 static int
13621 test_xmlInitParser(void) {
13622     int test_ret = 0;
13623
13624     int mem_base;
13625
13626         mem_base = xmlMemBlocks();
13627
13628         xmlInitParser();
13629         call_tests++;
13630         xmlResetLastError();
13631         if (mem_base != xmlMemBlocks()) {
13632             printf("Leak of %d blocks found in xmlInitParser",
13633                    xmlMemBlocks() - mem_base);
13634             test_ret++;
13635             printf("\n");
13636         }
13637     function_tests++;
13638
13639     return(test_ret);
13640 }
13641
13642
13643 static int
13644 test_xmlInitParserCtxt(void) {
13645     int test_ret = 0;
13646
13647     int mem_base;
13648     int ret_val;
13649     xmlParserCtxtPtr ctxt; /* an XML parser context */
13650     int n_ctxt;
13651
13652     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13653         mem_base = xmlMemBlocks();
13654         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13655
13656         ret_val = xmlInitParserCtxt(ctxt);
13657         desret_int(ret_val);
13658         call_tests++;
13659         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13660         xmlResetLastError();
13661         if (mem_base != xmlMemBlocks()) {
13662             printf("Leak of %d blocks found in xmlInitParserCtxt",
13663                    xmlMemBlocks() - mem_base);
13664             test_ret++;
13665             printf(" %d", n_ctxt);
13666             printf("\n");
13667         }
13668     }
13669     function_tests++;
13670
13671     return(test_ret);
13672 }
13673
13674
13675 static int
13676 test_xmlKeepBlanksDefault(void) {
13677     int test_ret = 0;
13678
13679     int mem_base;
13680     int ret_val;
13681     int val; /* int 0 or 1 */
13682     int n_val;
13683
13684     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13685         mem_base = xmlMemBlocks();
13686         val = gen_int(n_val, 0);
13687
13688         ret_val = xmlKeepBlanksDefault(val);
13689         desret_int(ret_val);
13690         call_tests++;
13691         des_int(n_val, val, 0);
13692         xmlResetLastError();
13693         if (mem_base != xmlMemBlocks()) {
13694             printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13695                    xmlMemBlocks() - mem_base);
13696             test_ret++;
13697             printf(" %d", n_val);
13698             printf("\n");
13699         }
13700     }
13701     function_tests++;
13702
13703     return(test_ret);
13704 }
13705
13706
13707 static int
13708 test_xmlLineNumbersDefault(void) {
13709     int test_ret = 0;
13710
13711     int mem_base;
13712     int ret_val;
13713     int val; /* int 0 or 1 */
13714     int n_val;
13715
13716     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13717         mem_base = xmlMemBlocks();
13718         val = gen_int(n_val, 0);
13719
13720         ret_val = xmlLineNumbersDefault(val);
13721         desret_int(ret_val);
13722         call_tests++;
13723         des_int(n_val, val, 0);
13724         xmlResetLastError();
13725         if (mem_base != xmlMemBlocks()) {
13726             printf("Leak of %d blocks found in xmlLineNumbersDefault",
13727                    xmlMemBlocks() - mem_base);
13728             test_ret++;
13729             printf(" %d", n_val);
13730             printf("\n");
13731         }
13732     }
13733     function_tests++;
13734
13735     return(test_ret);
13736 }
13737
13738
13739 static int
13740 test_xmlLoadExternalEntity(void) {
13741     int test_ret = 0;
13742
13743     int mem_base;
13744     xmlParserInputPtr ret_val;
13745     const char * URL; /* the URL for the entity to load */
13746     int n_URL;
13747     char * ID; /* the Public ID for the entity to load */
13748     int n_ID;
13749     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13750     int n_ctxt;
13751
13752     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13753     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13754     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13755         mem_base = xmlMemBlocks();
13756         URL = gen_filepath(n_URL, 0);
13757         ID = gen_const_char_ptr(n_ID, 1);
13758         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13759
13760         ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13761         desret_xmlParserInputPtr(ret_val);
13762         call_tests++;
13763         des_filepath(n_URL, URL, 0);
13764         des_const_char_ptr(n_ID, (const char *)ID, 1);
13765         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13766         xmlResetLastError();
13767         if (mem_base != xmlMemBlocks()) {
13768             printf("Leak of %d blocks found in xmlLoadExternalEntity",
13769                    xmlMemBlocks() - mem_base);
13770             test_ret++;
13771             printf(" %d", n_URL);
13772             printf(" %d", n_ID);
13773             printf(" %d", n_ctxt);
13774             printf("\n");
13775         }
13776     }
13777     }
13778     }
13779     function_tests++;
13780
13781     return(test_ret);
13782 }
13783
13784
13785 static int
13786 test_xmlNewIOInputStream(void) {
13787     int test_ret = 0;
13788
13789     int mem_base;
13790     xmlParserInputPtr ret_val;
13791     xmlParserCtxtPtr ctxt; /* an XML parser context */
13792     int n_ctxt;
13793     xmlParserInputBufferPtr input; /* an I/O Input */
13794     int n_input;
13795     xmlCharEncoding enc; /* the charset encoding if known */
13796     int n_enc;
13797
13798     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13799     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13800     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13801         mem_base = xmlMemBlocks();
13802         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13803         input = gen_xmlParserInputBufferPtr(n_input, 1);
13804         enc = gen_xmlCharEncoding(n_enc, 2);
13805
13806         ret_val = xmlNewIOInputStream(ctxt, input, enc);
13807         if (ret_val != NULL) input = NULL;
13808         desret_xmlParserInputPtr(ret_val);
13809         call_tests++;
13810         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13811         des_xmlParserInputBufferPtr(n_input, input, 1);
13812         des_xmlCharEncoding(n_enc, enc, 2);
13813         xmlResetLastError();
13814         if (mem_base != xmlMemBlocks()) {
13815             printf("Leak of %d blocks found in xmlNewIOInputStream",
13816                    xmlMemBlocks() - mem_base);
13817             test_ret++;
13818             printf(" %d", n_ctxt);
13819             printf(" %d", n_input);
13820             printf(" %d", n_enc);
13821             printf("\n");
13822         }
13823     }
13824     }
13825     }
13826     function_tests++;
13827
13828     return(test_ret);
13829 }
13830
13831
13832 static int
13833 test_xmlNewParserCtxt(void) {
13834     int test_ret = 0;
13835
13836     int mem_base;
13837     xmlParserCtxtPtr ret_val;
13838
13839         mem_base = xmlMemBlocks();
13840
13841         ret_val = xmlNewParserCtxt();
13842         desret_xmlParserCtxtPtr(ret_val);
13843         call_tests++;
13844         xmlResetLastError();
13845         if (mem_base != xmlMemBlocks()) {
13846             printf("Leak of %d blocks found in xmlNewParserCtxt",
13847                    xmlMemBlocks() - mem_base);
13848             test_ret++;
13849             printf("\n");
13850         }
13851     function_tests++;
13852
13853     return(test_ret);
13854 }
13855
13856
13857 #define gen_nb_xmlNodePtr_ptr 1
13858 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13859     return(NULL);
13860 }
13861 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13862 }
13863
13864 static int
13865 test_xmlParseBalancedChunkMemory(void) {
13866     int test_ret = 0;
13867
13868 #if defined(LIBXML_SAX1_ENABLED)
13869 #ifdef LIBXML_SAX1_ENABLED
13870     int mem_base;
13871     int ret_val;
13872     xmlDocPtr doc; /* the document the chunk pertains to */
13873     int n_doc;
13874     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13875     int n_sax;
13876     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13877     int n_user_data;
13878     int depth; /* Used for loop detection, use 0 */
13879     int n_depth;
13880     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13881     int n_string;
13882     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13883     int n_lst;
13884
13885     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13886     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13887     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13888     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13889     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13890     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13891         mem_base = xmlMemBlocks();
13892         doc = gen_xmlDocPtr(n_doc, 0);
13893         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13894         user_data = gen_userdata(n_user_data, 2);
13895         depth = gen_int(n_depth, 3);
13896         string = gen_const_xmlChar_ptr(n_string, 4);
13897         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13898         
13899 #ifdef LIBXML_SAX1_ENABLED
13900         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13901 #endif
13902
13903
13904         ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13905         desret_int(ret_val);
13906         call_tests++;
13907         des_xmlDocPtr(n_doc, doc, 0);
13908         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13909         des_userdata(n_user_data, user_data, 2);
13910         des_int(n_depth, depth, 3);
13911         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13912         des_xmlNodePtr_ptr(n_lst, lst, 5);
13913         xmlResetLastError();
13914         if (mem_base != xmlMemBlocks()) {
13915             printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13916                    xmlMemBlocks() - mem_base);
13917             test_ret++;
13918             printf(" %d", n_doc);
13919             printf(" %d", n_sax);
13920             printf(" %d", n_user_data);
13921             printf(" %d", n_depth);
13922             printf(" %d", n_string);
13923             printf(" %d", n_lst);
13924             printf("\n");
13925         }
13926     }
13927     }
13928     }
13929     }
13930     }
13931     }
13932     function_tests++;
13933 #endif
13934 #endif
13935
13936     return(test_ret);
13937 }
13938
13939
13940 static int
13941 test_xmlParseBalancedChunkMemoryRecover(void) {
13942     int test_ret = 0;
13943
13944 #if defined(LIBXML_SAX1_ENABLED)
13945 #ifdef LIBXML_SAX1_ENABLED
13946     int mem_base;
13947     int ret_val;
13948     xmlDocPtr doc; /* the document the chunk pertains to */
13949     int n_doc;
13950     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13951     int n_sax;
13952     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13953     int n_user_data;
13954     int depth; /* Used for loop detection, use 0 */
13955     int n_depth;
13956     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13957     int n_string;
13958     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13959     int n_lst;
13960     int recover; /* return nodes even if the data is broken (use 0) */
13961     int n_recover;
13962
13963     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13964     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13965     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13966     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13967     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13968     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13969     for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13970         mem_base = xmlMemBlocks();
13971         doc = gen_xmlDocPtr(n_doc, 0);
13972         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13973         user_data = gen_userdata(n_user_data, 2);
13974         depth = gen_int(n_depth, 3);
13975         string = gen_const_xmlChar_ptr(n_string, 4);
13976         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13977         recover = gen_int(n_recover, 6);
13978         
13979 #ifdef LIBXML_SAX1_ENABLED
13980         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13981 #endif
13982
13983
13984         ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13985         desret_int(ret_val);
13986         call_tests++;
13987         des_xmlDocPtr(n_doc, doc, 0);
13988         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13989         des_userdata(n_user_data, user_data, 2);
13990         des_int(n_depth, depth, 3);
13991         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13992         des_xmlNodePtr_ptr(n_lst, lst, 5);
13993         des_int(n_recover, recover, 6);
13994         xmlResetLastError();
13995         if (mem_base != xmlMemBlocks()) {
13996             printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13997                    xmlMemBlocks() - mem_base);
13998             test_ret++;
13999             printf(" %d", n_doc);
14000             printf(" %d", n_sax);
14001             printf(" %d", n_user_data);
14002             printf(" %d", n_depth);
14003             printf(" %d", n_string);
14004             printf(" %d", n_lst);
14005             printf(" %d", n_recover);
14006             printf("\n");
14007         }
14008     }
14009     }
14010     }
14011     }
14012     }
14013     }
14014     }
14015     function_tests++;
14016 #endif
14017 #endif
14018
14019     return(test_ret);
14020 }
14021
14022
14023 static int
14024 test_xmlParseChunk(void) {
14025     int test_ret = 0;
14026
14027 #if defined(LIBXML_PUSH_ENABLED)
14028     int mem_base;
14029     int ret_val;
14030     xmlParserCtxtPtr ctxt; /* an XML parser context */
14031     int n_ctxt;
14032     char * chunk; /* an char array */
14033     int n_chunk;
14034     int size; /* the size in byte of the chunk */
14035     int n_size;
14036     int terminate; /* last chunk indicator */
14037     int n_terminate;
14038
14039     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14040     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
14041     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14042     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
14043         mem_base = xmlMemBlocks();
14044         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14045         chunk = gen_const_char_ptr(n_chunk, 1);
14046         size = gen_int(n_size, 2);
14047         terminate = gen_int(n_terminate, 3);
14048         if ((chunk != NULL) &&
14049             (size > (int) strlen((const char *) chunk) + 1))
14050             continue;
14051
14052         ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
14053         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
14054         desret_int(ret_val);
14055         call_tests++;
14056         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14057         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
14058         des_int(n_size, size, 2);
14059         des_int(n_terminate, terminate, 3);
14060         xmlResetLastError();
14061         if (mem_base != xmlMemBlocks()) {
14062             printf("Leak of %d blocks found in xmlParseChunk",
14063                    xmlMemBlocks() - mem_base);
14064             test_ret++;
14065             printf(" %d", n_ctxt);
14066             printf(" %d", n_chunk);
14067             printf(" %d", n_size);
14068             printf(" %d", n_terminate);
14069             printf("\n");
14070         }
14071     }
14072     }
14073     }
14074     }
14075     function_tests++;
14076 #endif
14077
14078     return(test_ret);
14079 }
14080
14081
14082 static int
14083 test_xmlParseCtxtExternalEntity(void) {
14084     int test_ret = 0;
14085
14086     int mem_base;
14087     int ret_val;
14088     xmlParserCtxtPtr ctx; /* the existing parsing context */
14089     int n_ctx;
14090     xmlChar * URL; /* the URL for the entity to load */
14091     int n_URL;
14092     xmlChar * ID; /* the System ID for the entity to load */
14093     int n_ID;
14094     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14095     int n_lst;
14096
14097     for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
14098     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14099     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14100     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14101         mem_base = xmlMemBlocks();
14102         ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
14103         URL = gen_const_xmlChar_ptr(n_URL, 1);
14104         ID = gen_const_xmlChar_ptr(n_ID, 2);
14105         lst = gen_xmlNodePtr_ptr(n_lst, 3);
14106
14107         ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14108         desret_int(ret_val);
14109         call_tests++;
14110         des_xmlParserCtxtPtr(n_ctx, ctx, 0);
14111         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
14112         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
14113         des_xmlNodePtr_ptr(n_lst, lst, 3);
14114         xmlResetLastError();
14115         if (mem_base != xmlMemBlocks()) {
14116             printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
14117                    xmlMemBlocks() - mem_base);
14118             test_ret++;
14119             printf(" %d", n_ctx);
14120             printf(" %d", n_URL);
14121             printf(" %d", n_ID);
14122             printf(" %d", n_lst);
14123             printf("\n");
14124         }
14125     }
14126     }
14127     }
14128     }
14129     function_tests++;
14130
14131     return(test_ret);
14132 }
14133
14134
14135 static int
14136 test_xmlParseDTD(void) {
14137     int test_ret = 0;
14138
14139 #if defined(LIBXML_VALID_ENABLED)
14140 #ifdef LIBXML_VALID_ENABLED
14141     int mem_base;
14142     xmlDtdPtr ret_val;
14143     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14144     int n_ExternalID;
14145     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14146     int n_SystemID;
14147
14148     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14149     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14150         mem_base = xmlMemBlocks();
14151         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
14152         SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
14153
14154         ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14155         desret_xmlDtdPtr(ret_val);
14156         call_tests++;
14157         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
14158         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
14159         xmlResetLastError();
14160         if (mem_base != xmlMemBlocks()) {
14161             printf("Leak of %d blocks found in xmlParseDTD",
14162                    xmlMemBlocks() - mem_base);
14163             test_ret++;
14164             printf(" %d", n_ExternalID);
14165             printf(" %d", n_SystemID);
14166             printf("\n");
14167         }
14168     }
14169     }
14170     function_tests++;
14171 #endif
14172 #endif
14173
14174     return(test_ret);
14175 }
14176
14177
14178 static int
14179 test_xmlParseDoc(void) {
14180     int test_ret = 0;
14181
14182 #if defined(LIBXML_SAX1_ENABLED)
14183 #ifdef LIBXML_SAX1_ENABLED
14184     int mem_base;
14185     xmlDocPtr ret_val;
14186     xmlChar * cur; /* a pointer to an array of xmlChar */
14187     int n_cur;
14188
14189     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14190         mem_base = xmlMemBlocks();
14191         cur = gen_const_xmlChar_ptr(n_cur, 0);
14192
14193         ret_val = xmlParseDoc((const xmlChar *)cur);
14194         desret_xmlDocPtr(ret_val);
14195         call_tests++;
14196         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14197         xmlResetLastError();
14198         if (mem_base != xmlMemBlocks()) {
14199             printf("Leak of %d blocks found in xmlParseDoc",
14200                    xmlMemBlocks() - mem_base);
14201             test_ret++;
14202             printf(" %d", n_cur);
14203             printf("\n");
14204         }
14205     }
14206     function_tests++;
14207 #endif
14208 #endif
14209
14210     return(test_ret);
14211 }
14212
14213
14214 static int
14215 test_xmlParseDocument(void) {
14216     int test_ret = 0;
14217
14218     int mem_base;
14219     int ret_val;
14220     xmlParserCtxtPtr ctxt; /* an XML parser context */
14221     int n_ctxt;
14222
14223     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14224         mem_base = xmlMemBlocks();
14225         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14226
14227         ret_val = xmlParseDocument(ctxt);
14228         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
14229         desret_int(ret_val);
14230         call_tests++;
14231         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14232         xmlResetLastError();
14233         if (mem_base != xmlMemBlocks()) {
14234             printf("Leak of %d blocks found in xmlParseDocument",
14235                    xmlMemBlocks() - mem_base);
14236             test_ret++;
14237             printf(" %d", n_ctxt);
14238             printf("\n");
14239         }
14240     }
14241     function_tests++;
14242
14243     return(test_ret);
14244 }
14245
14246
14247 static int
14248 test_xmlParseEntity(void) {
14249     int test_ret = 0;
14250
14251 #if defined(LIBXML_SAX1_ENABLED)
14252 #ifdef LIBXML_SAX1_ENABLED
14253     int mem_base;
14254     xmlDocPtr ret_val;
14255     const char * filename; /* the filename */
14256     int n_filename;
14257
14258     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14259         mem_base = xmlMemBlocks();
14260         filename = gen_filepath(n_filename, 0);
14261
14262         ret_val = xmlParseEntity(filename);
14263         desret_xmlDocPtr(ret_val);
14264         call_tests++;
14265         des_filepath(n_filename, filename, 0);
14266         xmlResetLastError();
14267         if (mem_base != xmlMemBlocks()) {
14268             printf("Leak of %d blocks found in xmlParseEntity",
14269                    xmlMemBlocks() - mem_base);
14270             test_ret++;
14271             printf(" %d", n_filename);
14272             printf("\n");
14273         }
14274     }
14275     function_tests++;
14276 #endif
14277 #endif
14278
14279     return(test_ret);
14280 }
14281
14282
14283 static int
14284 test_xmlParseExtParsedEnt(void) {
14285     int test_ret = 0;
14286
14287     int mem_base;
14288     int ret_val;
14289     xmlParserCtxtPtr ctxt; /* an XML parser context */
14290     int n_ctxt;
14291
14292     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14293         mem_base = xmlMemBlocks();
14294         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14295
14296         ret_val = xmlParseExtParsedEnt(ctxt);
14297         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
14298         desret_int(ret_val);
14299         call_tests++;
14300         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14301         xmlResetLastError();
14302         if (mem_base != xmlMemBlocks()) {
14303             printf("Leak of %d blocks found in xmlParseExtParsedEnt",
14304                    xmlMemBlocks() - mem_base);
14305             test_ret++;
14306             printf(" %d", n_ctxt);
14307             printf("\n");
14308         }
14309     }
14310     function_tests++;
14311
14312     return(test_ret);
14313 }
14314
14315
14316 static int
14317 test_xmlParseExternalEntity(void) {
14318     int test_ret = 0;
14319
14320 #if defined(LIBXML_SAX1_ENABLED)
14321 #ifdef LIBXML_SAX1_ENABLED
14322     int mem_base;
14323     int ret_val;
14324     xmlDocPtr doc; /* the document the chunk pertains to */
14325     int n_doc;
14326     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
14327     int n_sax;
14328     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
14329     int n_user_data;
14330     int depth; /* Used for loop detection, use 0 */
14331     int n_depth;
14332     xmlChar * URL; /* the URL for the entity to load */
14333     int n_URL;
14334     xmlChar * ID; /* the System ID for the entity to load */
14335     int n_ID;
14336     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14337     int n_lst;
14338
14339     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14340     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14341     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14342     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14343     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14344     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14345     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14346         mem_base = xmlMemBlocks();
14347         doc = gen_xmlDocPtr(n_doc, 0);
14348         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14349         user_data = gen_userdata(n_user_data, 2);
14350         depth = gen_int(n_depth, 3);
14351         URL = gen_const_xmlChar_ptr(n_URL, 4);
14352         ID = gen_const_xmlChar_ptr(n_ID, 5);
14353         lst = gen_xmlNodePtr_ptr(n_lst, 6);
14354
14355         ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14356         desret_int(ret_val);
14357         call_tests++;
14358         des_xmlDocPtr(n_doc, doc, 0);
14359         des_xmlSAXHandlerPtr(n_sax, sax, 1);
14360         des_userdata(n_user_data, user_data, 2);
14361         des_int(n_depth, depth, 3);
14362         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14363         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14364         des_xmlNodePtr_ptr(n_lst, lst, 6);
14365         xmlResetLastError();
14366         if (mem_base != xmlMemBlocks()) {
14367             printf("Leak of %d blocks found in xmlParseExternalEntity",
14368                    xmlMemBlocks() - mem_base);
14369             test_ret++;
14370             printf(" %d", n_doc);
14371             printf(" %d", n_sax);
14372             printf(" %d", n_user_data);
14373             printf(" %d", n_depth);
14374             printf(" %d", n_URL);
14375             printf(" %d", n_ID);
14376             printf(" %d", n_lst);
14377             printf("\n");
14378         }
14379     }
14380     }
14381     }
14382     }
14383     }
14384     }
14385     }
14386     function_tests++;
14387 #endif
14388 #endif
14389
14390     return(test_ret);
14391 }
14392
14393
14394 static int
14395 test_xmlParseFile(void) {
14396     int test_ret = 0;
14397
14398 #if defined(LIBXML_SAX1_ENABLED)
14399 #ifdef LIBXML_SAX1_ENABLED
14400     int mem_base;
14401     xmlDocPtr ret_val;
14402     const char * filename; /* the filename */
14403     int n_filename;
14404
14405     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14406         mem_base = xmlMemBlocks();
14407         filename = gen_filepath(n_filename, 0);
14408
14409         ret_val = xmlParseFile(filename);
14410         desret_xmlDocPtr(ret_val);
14411         call_tests++;
14412         des_filepath(n_filename, filename, 0);
14413         xmlResetLastError();
14414         if (mem_base != xmlMemBlocks()) {
14415             printf("Leak of %d blocks found in xmlParseFile",
14416                    xmlMemBlocks() - mem_base);
14417             test_ret++;
14418             printf(" %d", n_filename);
14419             printf("\n");
14420         }
14421     }
14422     function_tests++;
14423 #endif
14424 #endif
14425
14426     return(test_ret);
14427 }
14428
14429
14430 static int
14431 test_xmlParseInNodeContext(void) {
14432     int test_ret = 0;
14433
14434     int mem_base;
14435     xmlParserErrors ret_val;
14436     xmlNodePtr node; /* the context node */
14437     int n_node;
14438     char * data; /* the input string */
14439     int n_data;
14440     int datalen; /* the input string length in bytes */
14441     int n_datalen;
14442     int options; /* a combination of xmlParserOption */
14443     int n_options;
14444     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14445     int n_lst;
14446
14447     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14448     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14449     for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14450     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14451     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14452         mem_base = xmlMemBlocks();
14453         node = gen_xmlNodePtr(n_node, 0);
14454         data = gen_const_char_ptr(n_data, 1);
14455         datalen = gen_int(n_datalen, 2);
14456         options = gen_parseroptions(n_options, 3);
14457         lst = gen_xmlNodePtr_ptr(n_lst, 4);
14458
14459         ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14460         desret_xmlParserErrors(ret_val);
14461         call_tests++;
14462         des_xmlNodePtr(n_node, node, 0);
14463         des_const_char_ptr(n_data, (const char *)data, 1);
14464         des_int(n_datalen, datalen, 2);
14465         des_parseroptions(n_options, options, 3);
14466         des_xmlNodePtr_ptr(n_lst, lst, 4);
14467         xmlResetLastError();
14468         if (mem_base != xmlMemBlocks()) {
14469             printf("Leak of %d blocks found in xmlParseInNodeContext",
14470                    xmlMemBlocks() - mem_base);
14471             test_ret++;
14472             printf(" %d", n_node);
14473             printf(" %d", n_data);
14474             printf(" %d", n_datalen);
14475             printf(" %d", n_options);
14476             printf(" %d", n_lst);
14477             printf("\n");
14478         }
14479     }
14480     }
14481     }
14482     }
14483     }
14484     function_tests++;
14485
14486     return(test_ret);
14487 }
14488
14489
14490 static int
14491 test_xmlParseMemory(void) {
14492     int test_ret = 0;
14493
14494 #if defined(LIBXML_SAX1_ENABLED)
14495 #ifdef LIBXML_SAX1_ENABLED
14496     int mem_base;
14497     xmlDocPtr ret_val;
14498     char * buffer; /* an pointer to a char array */
14499     int n_buffer;
14500     int size; /* the size of the array */
14501     int n_size;
14502
14503     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14504     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14505         mem_base = xmlMemBlocks();
14506         buffer = gen_const_char_ptr(n_buffer, 0);
14507         size = gen_int(n_size, 1);
14508         if ((buffer != NULL) &&
14509             (size > (int) strlen((const char *) buffer) + 1))
14510             continue;
14511
14512         ret_val = xmlParseMemory((const char *)buffer, size);
14513         desret_xmlDocPtr(ret_val);
14514         call_tests++;
14515         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14516         des_int(n_size, size, 1);
14517         xmlResetLastError();
14518         if (mem_base != xmlMemBlocks()) {
14519             printf("Leak of %d blocks found in xmlParseMemory",
14520                    xmlMemBlocks() - mem_base);
14521             test_ret++;
14522             printf(" %d", n_buffer);
14523             printf(" %d", n_size);
14524             printf("\n");
14525         }
14526     }
14527     }
14528     function_tests++;
14529 #endif
14530 #endif
14531
14532     return(test_ret);
14533 }
14534
14535
14536 #define gen_nb_const_xmlParserNodeInfoPtr 1
14537 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14538     return(NULL);
14539 }
14540 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14541 }
14542
14543 static int
14544 test_xmlParserAddNodeInfo(void) {
14545     int test_ret = 0;
14546
14547     int mem_base;
14548     xmlParserCtxtPtr ctxt; /* an XML parser context */
14549     int n_ctxt;
14550     xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14551     int n_info;
14552
14553     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14554     for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14555         mem_base = xmlMemBlocks();
14556         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14557         info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14558
14559         xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14560         call_tests++;
14561         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14562         des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14563         xmlResetLastError();
14564         if (mem_base != xmlMemBlocks()) {
14565             printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14566                    xmlMemBlocks() - mem_base);
14567             test_ret++;
14568             printf(" %d", n_ctxt);
14569             printf(" %d", n_info);
14570             printf("\n");
14571         }
14572     }
14573     }
14574     function_tests++;
14575
14576     return(test_ret);
14577 }
14578
14579
14580 #define gen_nb_const_xmlParserCtxtPtr 1
14581 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14582     return(NULL);
14583 }
14584 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14585 }
14586
14587 #define gen_nb_const_xmlNodePtr 1
14588 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14589     return(NULL);
14590 }
14591 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14592 }
14593
14594 static int
14595 test_xmlParserFindNodeInfo(void) {
14596     int test_ret = 0;
14597
14598     int mem_base;
14599     const xmlParserNodeInfo * ret_val;
14600     xmlParserCtxtPtr ctx; /* an XML parser context */
14601     int n_ctx;
14602     xmlNodePtr node; /* an XML node within the tree */
14603     int n_node;
14604
14605     for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14606     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14607         mem_base = xmlMemBlocks();
14608         ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14609         node = gen_const_xmlNodePtr(n_node, 1);
14610
14611         ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14612         desret_const_xmlParserNodeInfo_ptr(ret_val);
14613         call_tests++;
14614         des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14615         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14616         xmlResetLastError();
14617         if (mem_base != xmlMemBlocks()) {
14618             printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14619                    xmlMemBlocks() - mem_base);
14620             test_ret++;
14621             printf(" %d", n_ctx);
14622             printf(" %d", n_node);
14623             printf("\n");
14624         }
14625     }
14626     }
14627     function_tests++;
14628
14629     return(test_ret);
14630 }
14631
14632
14633 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14634 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14635     return(NULL);
14636 }
14637 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14638 }
14639
14640 static int
14641 test_xmlParserFindNodeInfoIndex(void) {
14642     int test_ret = 0;
14643
14644     int mem_base;
14645     unsigned long ret_val;
14646     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14647     int n_seq;
14648     xmlNodePtr node; /* an XML node pointer */
14649     int n_node;
14650
14651     for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14652     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14653         mem_base = xmlMemBlocks();
14654         seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14655         node = gen_const_xmlNodePtr(n_node, 1);
14656
14657         ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14658         desret_unsigned_long(ret_val);
14659         call_tests++;
14660         des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14661         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14662         xmlResetLastError();
14663         if (mem_base != xmlMemBlocks()) {
14664             printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14665                    xmlMemBlocks() - mem_base);
14666             test_ret++;
14667             printf(" %d", n_seq);
14668             printf(" %d", n_node);
14669             printf("\n");
14670         }
14671     }
14672     }
14673     function_tests++;
14674
14675     return(test_ret);
14676 }
14677
14678
14679 #define gen_nb_xmlParserInputPtr 1
14680 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14681     return(NULL);
14682 }
14683 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14684 }
14685
14686 static int
14687 test_xmlParserInputGrow(void) {
14688     int test_ret = 0;
14689
14690     int mem_base;
14691     int ret_val;
14692     xmlParserInputPtr in; /* an XML parser input */
14693     int n_in;
14694     int len; /* an indicative size for the lookahead */
14695     int n_len;
14696
14697     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14698     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14699         mem_base = xmlMemBlocks();
14700         in = gen_xmlParserInputPtr(n_in, 0);
14701         len = gen_int(n_len, 1);
14702
14703         ret_val = xmlParserInputGrow(in, len);
14704         desret_int(ret_val);
14705         call_tests++;
14706         des_xmlParserInputPtr(n_in, in, 0);
14707         des_int(n_len, len, 1);
14708         xmlResetLastError();
14709         if (mem_base != xmlMemBlocks()) {
14710             printf("Leak of %d blocks found in xmlParserInputGrow",
14711                    xmlMemBlocks() - mem_base);
14712             test_ret++;
14713             printf(" %d", n_in);
14714             printf(" %d", n_len);
14715             printf("\n");
14716         }
14717     }
14718     }
14719     function_tests++;
14720
14721     return(test_ret);
14722 }
14723
14724
14725 static int
14726 test_xmlParserInputRead(void) {
14727     int test_ret = 0;
14728
14729     int mem_base;
14730     int ret_val;
14731     xmlParserInputPtr in; /* an XML parser input */
14732     int n_in;
14733     int len; /* an indicative size for the lookahead */
14734     int n_len;
14735
14736     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14737     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14738         mem_base = xmlMemBlocks();
14739         in = gen_xmlParserInputPtr(n_in, 0);
14740         len = gen_int(n_len, 1);
14741
14742         ret_val = xmlParserInputRead(in, len);
14743         desret_int(ret_val);
14744         call_tests++;
14745         des_xmlParserInputPtr(n_in, in, 0);
14746         des_int(n_len, len, 1);
14747         xmlResetLastError();
14748         if (mem_base != xmlMemBlocks()) {
14749             printf("Leak of %d blocks found in xmlParserInputRead",
14750                    xmlMemBlocks() - mem_base);
14751             test_ret++;
14752             printf(" %d", n_in);
14753             printf(" %d", n_len);
14754             printf("\n");
14755         }
14756     }
14757     }
14758     function_tests++;
14759
14760     return(test_ret);
14761 }
14762
14763
14764 static int
14765 test_xmlPedanticParserDefault(void) {
14766     int test_ret = 0;
14767
14768     int mem_base;
14769     int ret_val;
14770     int val; /* int 0 or 1 */
14771     int n_val;
14772
14773     for (n_val = 0;n_val < gen_nb_int;n_val++) {
14774         mem_base = xmlMemBlocks();
14775         val = gen_int(n_val, 0);
14776
14777         ret_val = xmlPedanticParserDefault(val);
14778         desret_int(ret_val);
14779         call_tests++;
14780         des_int(n_val, val, 0);
14781         xmlResetLastError();
14782         if (mem_base != xmlMemBlocks()) {
14783             printf("Leak of %d blocks found in xmlPedanticParserDefault",
14784                    xmlMemBlocks() - mem_base);
14785             test_ret++;
14786             printf(" %d", n_val);
14787             printf("\n");
14788         }
14789     }
14790     function_tests++;
14791
14792     return(test_ret);
14793 }
14794
14795
14796 static int
14797 test_xmlReadDoc(void) {
14798     int test_ret = 0;
14799
14800     int mem_base;
14801     xmlDocPtr ret_val;
14802     xmlChar * cur; /* a pointer to a zero terminated string */
14803     int n_cur;
14804     const char * URL; /* the base URL to use for the document */
14805     int n_URL;
14806     char * encoding; /* the document encoding, or NULL */
14807     int n_encoding;
14808     int options; /* a combination of xmlParserOption */
14809     int n_options;
14810
14811     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14812     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14813     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14814     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14815         mem_base = xmlMemBlocks();
14816         cur = gen_const_xmlChar_ptr(n_cur, 0);
14817         URL = gen_filepath(n_URL, 1);
14818         encoding = gen_const_char_ptr(n_encoding, 2);
14819         options = gen_parseroptions(n_options, 3);
14820
14821         ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14822         desret_xmlDocPtr(ret_val);
14823         call_tests++;
14824         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14825         des_filepath(n_URL, URL, 1);
14826         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14827         des_parseroptions(n_options, options, 3);
14828         xmlResetLastError();
14829         if (mem_base != xmlMemBlocks()) {
14830             printf("Leak of %d blocks found in xmlReadDoc",
14831                    xmlMemBlocks() - mem_base);
14832             test_ret++;
14833             printf(" %d", n_cur);
14834             printf(" %d", n_URL);
14835             printf(" %d", n_encoding);
14836             printf(" %d", n_options);
14837             printf("\n");
14838         }
14839     }
14840     }
14841     }
14842     }
14843     function_tests++;
14844
14845     return(test_ret);
14846 }
14847
14848
14849 static int
14850 test_xmlReadFile(void) {
14851     int test_ret = 0;
14852
14853     int mem_base;
14854     xmlDocPtr ret_val;
14855     const char * filename; /* a file or URL */
14856     int n_filename;
14857     char * encoding; /* the document encoding, or NULL */
14858     int n_encoding;
14859     int options; /* a combination of xmlParserOption */
14860     int n_options;
14861
14862     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14863     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14864     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14865         mem_base = xmlMemBlocks();
14866         filename = gen_filepath(n_filename, 0);
14867         encoding = gen_const_char_ptr(n_encoding, 1);
14868         options = gen_parseroptions(n_options, 2);
14869
14870         ret_val = xmlReadFile(filename, (const char *)encoding, options);
14871         desret_xmlDocPtr(ret_val);
14872         call_tests++;
14873         des_filepath(n_filename, filename, 0);
14874         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14875         des_parseroptions(n_options, options, 2);
14876         xmlResetLastError();
14877         if (mem_base != xmlMemBlocks()) {
14878             printf("Leak of %d blocks found in xmlReadFile",
14879                    xmlMemBlocks() - mem_base);
14880             test_ret++;
14881             printf(" %d", n_filename);
14882             printf(" %d", n_encoding);
14883             printf(" %d", n_options);
14884             printf("\n");
14885         }
14886     }
14887     }
14888     }
14889     function_tests++;
14890
14891     return(test_ret);
14892 }
14893
14894
14895 static int
14896 test_xmlReadMemory(void) {
14897     int test_ret = 0;
14898
14899     int mem_base;
14900     xmlDocPtr ret_val;
14901     char * buffer; /* a pointer to a char array */
14902     int n_buffer;
14903     int size; /* the size of the array */
14904     int n_size;
14905     const char * URL; /* the base URL to use for the document */
14906     int n_URL;
14907     char * encoding; /* the document encoding, or NULL */
14908     int n_encoding;
14909     int options; /* a combination of xmlParserOption */
14910     int n_options;
14911
14912     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14913     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14914     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14915     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14916     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14917         mem_base = xmlMemBlocks();
14918         buffer = gen_const_char_ptr(n_buffer, 0);
14919         size = gen_int(n_size, 1);
14920         URL = gen_filepath(n_URL, 2);
14921         encoding = gen_const_char_ptr(n_encoding, 3);
14922         options = gen_parseroptions(n_options, 4);
14923         if ((buffer != NULL) &&
14924             (size > (int) strlen((const char *) buffer) + 1))
14925             continue;
14926
14927         ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14928         desret_xmlDocPtr(ret_val);
14929         call_tests++;
14930         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14931         des_int(n_size, size, 1);
14932         des_filepath(n_URL, URL, 2);
14933         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14934         des_parseroptions(n_options, options, 4);
14935         xmlResetLastError();
14936         if (mem_base != xmlMemBlocks()) {
14937             printf("Leak of %d blocks found in xmlReadMemory",
14938                    xmlMemBlocks() - mem_base);
14939             test_ret++;
14940             printf(" %d", n_buffer);
14941             printf(" %d", n_size);
14942             printf(" %d", n_URL);
14943             printf(" %d", n_encoding);
14944             printf(" %d", n_options);
14945             printf("\n");
14946         }
14947     }
14948     }
14949     }
14950     }
14951     }
14952     function_tests++;
14953
14954     return(test_ret);
14955 }
14956
14957
14958 static int
14959 test_xmlRecoverDoc(void) {
14960     int test_ret = 0;
14961
14962 #if defined(LIBXML_SAX1_ENABLED)
14963 #ifdef LIBXML_SAX1_ENABLED
14964     int mem_base;
14965     xmlDocPtr ret_val;
14966     xmlChar * cur; /* a pointer to an array of xmlChar */
14967     int n_cur;
14968
14969     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14970         mem_base = xmlMemBlocks();
14971         cur = gen_const_xmlChar_ptr(n_cur, 0);
14972
14973         ret_val = xmlRecoverDoc((const xmlChar *)cur);
14974         desret_xmlDocPtr(ret_val);
14975         call_tests++;
14976         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14977         xmlResetLastError();
14978         if (mem_base != xmlMemBlocks()) {
14979             printf("Leak of %d blocks found in xmlRecoverDoc",
14980                    xmlMemBlocks() - mem_base);
14981             test_ret++;
14982             printf(" %d", n_cur);
14983             printf("\n");
14984         }
14985     }
14986     function_tests++;
14987 #endif
14988 #endif
14989
14990     return(test_ret);
14991 }
14992
14993
14994 static int
14995 test_xmlRecoverFile(void) {
14996     int test_ret = 0;
14997
14998 #if defined(LIBXML_SAX1_ENABLED)
14999 #ifdef LIBXML_SAX1_ENABLED
15000     int mem_base;
15001     xmlDocPtr ret_val;
15002     const char * filename; /* the filename */
15003     int n_filename;
15004
15005     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15006         mem_base = xmlMemBlocks();
15007         filename = gen_filepath(n_filename, 0);
15008
15009         ret_val = xmlRecoverFile(filename);
15010         desret_xmlDocPtr(ret_val);
15011         call_tests++;
15012         des_filepath(n_filename, filename, 0);
15013         xmlResetLastError();
15014         if (mem_base != xmlMemBlocks()) {
15015             printf("Leak of %d blocks found in xmlRecoverFile",
15016                    xmlMemBlocks() - mem_base);
15017             test_ret++;
15018             printf(" %d", n_filename);
15019             printf("\n");
15020         }
15021     }
15022     function_tests++;
15023 #endif
15024 #endif
15025
15026     return(test_ret);
15027 }
15028
15029
15030 static int
15031 test_xmlRecoverMemory(void) {
15032     int test_ret = 0;
15033
15034 #if defined(LIBXML_SAX1_ENABLED)
15035 #ifdef LIBXML_SAX1_ENABLED
15036     int mem_base;
15037     xmlDocPtr ret_val;
15038     char * buffer; /* an pointer to a char array */
15039     int n_buffer;
15040     int size; /* the size of the array */
15041     int n_size;
15042
15043     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15044     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15045         mem_base = xmlMemBlocks();
15046         buffer = gen_const_char_ptr(n_buffer, 0);
15047         size = gen_int(n_size, 1);
15048         if ((buffer != NULL) &&
15049             (size > (int) strlen((const char *) buffer) + 1))
15050             continue;
15051
15052         ret_val = xmlRecoverMemory((const char *)buffer, size);
15053         desret_xmlDocPtr(ret_val);
15054         call_tests++;
15055         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15056         des_int(n_size, size, 1);
15057         xmlResetLastError();
15058         if (mem_base != xmlMemBlocks()) {
15059             printf("Leak of %d blocks found in xmlRecoverMemory",
15060                    xmlMemBlocks() - mem_base);
15061             test_ret++;
15062             printf(" %d", n_buffer);
15063             printf(" %d", n_size);
15064             printf("\n");
15065         }
15066     }
15067     }
15068     function_tests++;
15069 #endif
15070 #endif
15071
15072     return(test_ret);
15073 }
15074
15075
15076 static int
15077 test_xmlSAXParseDTD(void) {
15078     int test_ret = 0;
15079
15080 #if defined(LIBXML_VALID_ENABLED)
15081 #ifdef LIBXML_SAX1_ENABLED
15082     int mem_base;
15083     xmlDtdPtr ret_val;
15084     xmlSAXHandlerPtr sax; /* the SAX handler block */
15085     int n_sax;
15086     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
15087     int n_ExternalID;
15088     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
15089     int n_SystemID;
15090
15091     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15092     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
15093     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
15094         mem_base = xmlMemBlocks();
15095         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15096         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
15097         SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
15098
15099         ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
15100         desret_xmlDtdPtr(ret_val);
15101         call_tests++;
15102         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15103         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
15104         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
15105         xmlResetLastError();
15106         if (mem_base != xmlMemBlocks()) {
15107             printf("Leak of %d blocks found in xmlSAXParseDTD",
15108                    xmlMemBlocks() - mem_base);
15109             test_ret++;
15110             printf(" %d", n_sax);
15111             printf(" %d", n_ExternalID);
15112             printf(" %d", n_SystemID);
15113             printf("\n");
15114         }
15115     }
15116     }
15117     }
15118     function_tests++;
15119 #endif
15120 #endif
15121
15122     return(test_ret);
15123 }
15124
15125
15126 static int
15127 test_xmlSAXParseDoc(void) {
15128     int test_ret = 0;
15129
15130 #if defined(LIBXML_SAX1_ENABLED)
15131 #ifdef LIBXML_SAX1_ENABLED
15132     int mem_base;
15133     xmlDocPtr ret_val;
15134     xmlSAXHandlerPtr sax; /* the SAX handler block */
15135     int n_sax;
15136     xmlChar * cur; /* a pointer to an array of xmlChar */
15137     int n_cur;
15138     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15139     int n_recovery;
15140
15141     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15142     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
15143     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15144         mem_base = xmlMemBlocks();
15145         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15146         cur = gen_const_xmlChar_ptr(n_cur, 1);
15147         recovery = gen_int(n_recovery, 2);
15148
15149         ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
15150         desret_xmlDocPtr(ret_val);
15151         call_tests++;
15152         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15153         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
15154         des_int(n_recovery, recovery, 2);
15155         xmlResetLastError();
15156         if (mem_base != xmlMemBlocks()) {
15157             printf("Leak of %d blocks found in xmlSAXParseDoc",
15158                    xmlMemBlocks() - mem_base);
15159             test_ret++;
15160             printf(" %d", n_sax);
15161             printf(" %d", n_cur);
15162             printf(" %d", n_recovery);
15163             printf("\n");
15164         }
15165     }
15166     }
15167     }
15168     function_tests++;
15169 #endif
15170 #endif
15171
15172     return(test_ret);
15173 }
15174
15175
15176 static int
15177 test_xmlSAXParseEntity(void) {
15178     int test_ret = 0;
15179
15180 #if defined(LIBXML_SAX1_ENABLED)
15181 #ifdef LIBXML_SAX1_ENABLED
15182     int mem_base;
15183     xmlDocPtr ret_val;
15184     xmlSAXHandlerPtr sax; /* the SAX handler block */
15185     int n_sax;
15186     const char * filename; /* the filename */
15187     int n_filename;
15188
15189     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15190     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15191         mem_base = xmlMemBlocks();
15192         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15193         filename = gen_filepath(n_filename, 1);
15194
15195         ret_val = xmlSAXParseEntity(sax, filename);
15196         desret_xmlDocPtr(ret_val);
15197         call_tests++;
15198         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15199         des_filepath(n_filename, filename, 1);
15200         xmlResetLastError();
15201         if (mem_base != xmlMemBlocks()) {
15202             printf("Leak of %d blocks found in xmlSAXParseEntity",
15203                    xmlMemBlocks() - mem_base);
15204             test_ret++;
15205             printf(" %d", n_sax);
15206             printf(" %d", n_filename);
15207             printf("\n");
15208         }
15209     }
15210     }
15211     function_tests++;
15212 #endif
15213 #endif
15214
15215     return(test_ret);
15216 }
15217
15218
15219 static int
15220 test_xmlSAXParseFile(void) {
15221     int test_ret = 0;
15222
15223 #if defined(LIBXML_SAX1_ENABLED)
15224 #ifdef LIBXML_SAX1_ENABLED
15225     int mem_base;
15226     xmlDocPtr ret_val;
15227     xmlSAXHandlerPtr sax; /* the SAX handler block */
15228     int n_sax;
15229     const char * filename; /* the filename */
15230     int n_filename;
15231     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15232     int n_recovery;
15233
15234     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15235     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15236     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15237         mem_base = xmlMemBlocks();
15238         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15239         filename = gen_filepath(n_filename, 1);
15240         recovery = gen_int(n_recovery, 2);
15241
15242         ret_val = xmlSAXParseFile(sax, filename, recovery);
15243         desret_xmlDocPtr(ret_val);
15244         call_tests++;
15245         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15246         des_filepath(n_filename, filename, 1);
15247         des_int(n_recovery, recovery, 2);
15248         xmlResetLastError();
15249         if (mem_base != xmlMemBlocks()) {
15250             printf("Leak of %d blocks found in xmlSAXParseFile",
15251                    xmlMemBlocks() - mem_base);
15252             test_ret++;
15253             printf(" %d", n_sax);
15254             printf(" %d", n_filename);
15255             printf(" %d", n_recovery);
15256             printf("\n");
15257         }
15258     }
15259     }
15260     }
15261     function_tests++;
15262 #endif
15263 #endif
15264
15265     return(test_ret);
15266 }
15267
15268
15269 static int
15270 test_xmlSAXParseFileWithData(void) {
15271     int test_ret = 0;
15272
15273 #if defined(LIBXML_SAX1_ENABLED)
15274 #ifdef LIBXML_SAX1_ENABLED
15275     int mem_base;
15276     xmlDocPtr ret_val;
15277     xmlSAXHandlerPtr sax; /* the SAX handler block */
15278     int n_sax;
15279     const char * filename; /* the filename */
15280     int n_filename;
15281     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15282     int n_recovery;
15283     void * data; /* the userdata */
15284     int n_data;
15285
15286     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15287     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15288     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15289     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15290         mem_base = xmlMemBlocks();
15291         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15292         filename = gen_filepath(n_filename, 1);
15293         recovery = gen_int(n_recovery, 2);
15294         data = gen_userdata(n_data, 3);
15295
15296         ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
15297         desret_xmlDocPtr(ret_val);
15298         call_tests++;
15299         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15300         des_filepath(n_filename, filename, 1);
15301         des_int(n_recovery, recovery, 2);
15302         des_userdata(n_data, data, 3);
15303         xmlResetLastError();
15304         if (mem_base != xmlMemBlocks()) {
15305             printf("Leak of %d blocks found in xmlSAXParseFileWithData",
15306                    xmlMemBlocks() - mem_base);
15307             test_ret++;
15308             printf(" %d", n_sax);
15309             printf(" %d", n_filename);
15310             printf(" %d", n_recovery);
15311             printf(" %d", n_data);
15312             printf("\n");
15313         }
15314     }
15315     }
15316     }
15317     }
15318     function_tests++;
15319 #endif
15320 #endif
15321
15322     return(test_ret);
15323 }
15324
15325
15326 static int
15327 test_xmlSAXParseMemory(void) {
15328     int test_ret = 0;
15329
15330 #if defined(LIBXML_SAX1_ENABLED)
15331 #ifdef LIBXML_SAX1_ENABLED
15332     int mem_base;
15333     xmlDocPtr ret_val;
15334     xmlSAXHandlerPtr sax; /* the SAX handler block */
15335     int n_sax;
15336     char * buffer; /* an pointer to a char array */
15337     int n_buffer;
15338     int size; /* the size of the array */
15339     int n_size;
15340     int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
15341     int n_recovery;
15342
15343     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15344     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15345     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15346     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15347         mem_base = xmlMemBlocks();
15348         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15349         buffer = gen_const_char_ptr(n_buffer, 1);
15350         size = gen_int(n_size, 2);
15351         recovery = gen_int(n_recovery, 3);
15352         if ((buffer != NULL) &&
15353             (size > (int) strlen((const char *) buffer) + 1))
15354             continue;
15355
15356         ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15357         desret_xmlDocPtr(ret_val);
15358         call_tests++;
15359         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15360         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15361         des_int(n_size, size, 2);
15362         des_int(n_recovery, recovery, 3);
15363         xmlResetLastError();
15364         if (mem_base != xmlMemBlocks()) {
15365             printf("Leak of %d blocks found in xmlSAXParseMemory",
15366                    xmlMemBlocks() - mem_base);
15367             test_ret++;
15368             printf(" %d", n_sax);
15369             printf(" %d", n_buffer);
15370             printf(" %d", n_size);
15371             printf(" %d", n_recovery);
15372             printf("\n");
15373         }
15374     }
15375     }
15376     }
15377     }
15378     function_tests++;
15379 #endif
15380 #endif
15381
15382     return(test_ret);
15383 }
15384
15385
15386 static int
15387 test_xmlSAXParseMemoryWithData(void) {
15388     int test_ret = 0;
15389
15390 #if defined(LIBXML_SAX1_ENABLED)
15391 #ifdef LIBXML_SAX1_ENABLED
15392     int mem_base;
15393     xmlDocPtr ret_val;
15394     xmlSAXHandlerPtr sax; /* the SAX handler block */
15395     int n_sax;
15396     char * buffer; /* an pointer to a char array */
15397     int n_buffer;
15398     int size; /* the size of the array */
15399     int n_size;
15400     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15401     int n_recovery;
15402     void * data; /* the userdata */
15403     int n_data;
15404
15405     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15406     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15407     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15408     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15409     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15410         mem_base = xmlMemBlocks();
15411         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15412         buffer = gen_const_char_ptr(n_buffer, 1);
15413         size = gen_int(n_size, 2);
15414         recovery = gen_int(n_recovery, 3);
15415         data = gen_userdata(n_data, 4);
15416         if ((buffer != NULL) &&
15417             (size > (int) strlen((const char *) buffer) + 1))
15418             continue;
15419
15420         ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15421         desret_xmlDocPtr(ret_val);
15422         call_tests++;
15423         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15424         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15425         des_int(n_size, size, 2);
15426         des_int(n_recovery, recovery, 3);
15427         des_userdata(n_data, data, 4);
15428         xmlResetLastError();
15429         if (mem_base != xmlMemBlocks()) {
15430             printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15431                    xmlMemBlocks() - mem_base);
15432             test_ret++;
15433             printf(" %d", n_sax);
15434             printf(" %d", n_buffer);
15435             printf(" %d", n_size);
15436             printf(" %d", n_recovery);
15437             printf(" %d", n_data);
15438             printf("\n");
15439         }
15440     }
15441     }
15442     }
15443     }
15444     }
15445     function_tests++;
15446 #endif
15447 #endif
15448
15449     return(test_ret);
15450 }
15451
15452
15453 static int
15454 test_xmlSAXUserParseFile(void) {
15455     int test_ret = 0;
15456
15457 #if defined(LIBXML_SAX1_ENABLED)
15458 #ifdef LIBXML_SAX1_ENABLED
15459     int mem_base;
15460     int ret_val;
15461     xmlSAXHandlerPtr sax; /* a SAX handler */
15462     int n_sax;
15463     void * user_data; /* The user data returned on SAX callbacks */
15464     int n_user_data;
15465     const char * filename; /* a file name */
15466     int n_filename;
15467
15468     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15469     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15470     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15471         mem_base = xmlMemBlocks();
15472         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15473         user_data = gen_userdata(n_user_data, 1);
15474         filename = gen_filepath(n_filename, 2);
15475         
15476 #ifdef LIBXML_SAX1_ENABLED
15477         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15478 #endif
15479
15480
15481         ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15482         desret_int(ret_val);
15483         call_tests++;
15484         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15485         des_userdata(n_user_data, user_data, 1);
15486         des_filepath(n_filename, filename, 2);
15487         xmlResetLastError();
15488         if (mem_base != xmlMemBlocks()) {
15489             printf("Leak of %d blocks found in xmlSAXUserParseFile",
15490                    xmlMemBlocks() - mem_base);
15491             test_ret++;
15492             printf(" %d", n_sax);
15493             printf(" %d", n_user_data);
15494             printf(" %d", n_filename);
15495             printf("\n");
15496         }
15497     }
15498     }
15499     }
15500     function_tests++;
15501 #endif
15502 #endif
15503
15504     return(test_ret);
15505 }
15506
15507
15508 static int
15509 test_xmlSAXUserParseMemory(void) {
15510     int test_ret = 0;
15511
15512 #if defined(LIBXML_SAX1_ENABLED)
15513 #ifdef LIBXML_SAX1_ENABLED
15514     int mem_base;
15515     int ret_val;
15516     xmlSAXHandlerPtr sax; /* a SAX handler */
15517     int n_sax;
15518     void * user_data; /* The user data returned on SAX callbacks */
15519     int n_user_data;
15520     char * buffer; /* an in-memory XML document input */
15521     int n_buffer;
15522     int size; /* the length of the XML document in bytes */
15523     int n_size;
15524
15525     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15526     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15527     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15528     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15529         mem_base = xmlMemBlocks();
15530         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15531         user_data = gen_userdata(n_user_data, 1);
15532         buffer = gen_const_char_ptr(n_buffer, 2);
15533         size = gen_int(n_size, 3);
15534         if ((buffer != NULL) &&
15535             (size > (int) strlen((const char *) buffer) + 1))
15536             continue;
15537         
15538 #ifdef LIBXML_SAX1_ENABLED
15539         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15540 #endif
15541
15542
15543         ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15544         desret_int(ret_val);
15545         call_tests++;
15546         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15547         des_userdata(n_user_data, user_data, 1);
15548         des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15549         des_int(n_size, size, 3);
15550         xmlResetLastError();
15551         if (mem_base != xmlMemBlocks()) {
15552             printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15553                    xmlMemBlocks() - mem_base);
15554             test_ret++;
15555             printf(" %d", n_sax);
15556             printf(" %d", n_user_data);
15557             printf(" %d", n_buffer);
15558             printf(" %d", n_size);
15559             printf("\n");
15560         }
15561     }
15562     }
15563     }
15564     }
15565     function_tests++;
15566 #endif
15567 #endif
15568
15569     return(test_ret);
15570 }
15571
15572
15573 static int
15574 test_xmlSetExternalEntityLoader(void) {
15575     int test_ret = 0;
15576
15577
15578     /* missing type support */
15579     return(test_ret);
15580 }
15581
15582
15583 static int
15584 test_xmlSetFeature(void) {
15585     int test_ret = 0;
15586
15587 #if defined(LIBXML_LEGACY_ENABLED)
15588 #ifdef LIBXML_LEGACY_ENABLED
15589     int mem_base;
15590     int ret_val;
15591     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15592     int n_ctxt;
15593     char * name; /* the feature name */
15594     int n_name;
15595     void * value; /* pointer to the location of the new value */
15596     int n_value;
15597
15598     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15599     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15600     for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15601         mem_base = xmlMemBlocks();
15602         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15603         name = gen_const_char_ptr(n_name, 1);
15604         value = gen_void_ptr(n_value, 2);
15605
15606         ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15607         desret_int(ret_val);
15608         call_tests++;
15609         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15610         des_const_char_ptr(n_name, (const char *)name, 1);
15611         des_void_ptr(n_value, value, 2);
15612         xmlResetLastError();
15613         if (mem_base != xmlMemBlocks()) {
15614             printf("Leak of %d blocks found in xmlSetFeature",
15615                    xmlMemBlocks() - mem_base);
15616             test_ret++;
15617             printf(" %d", n_ctxt);
15618             printf(" %d", n_name);
15619             printf(" %d", n_value);
15620             printf("\n");
15621         }
15622     }
15623     }
15624     }
15625     function_tests++;
15626 #endif
15627 #endif
15628
15629     return(test_ret);
15630 }
15631
15632
15633 static int
15634 test_xmlSetupParserForBuffer(void) {
15635     int test_ret = 0;
15636
15637 #if defined(LIBXML_SAX1_ENABLED)
15638 #ifdef LIBXML_SAX1_ENABLED
15639     int mem_base;
15640     xmlParserCtxtPtr ctxt; /* an XML parser context */
15641     int n_ctxt;
15642     xmlChar * buffer; /* a xmlChar * buffer */
15643     int n_buffer;
15644     const char * filename; /* a file name */
15645     int n_filename;
15646
15647     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15648     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15649     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15650         mem_base = xmlMemBlocks();
15651         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15652         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15653         filename = gen_filepath(n_filename, 2);
15654
15655         xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15656         call_tests++;
15657         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15658         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15659         des_filepath(n_filename, filename, 2);
15660         xmlResetLastError();
15661         if (mem_base != xmlMemBlocks()) {
15662             printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15663                    xmlMemBlocks() - mem_base);
15664             test_ret++;
15665             printf(" %d", n_ctxt);
15666             printf(" %d", n_buffer);
15667             printf(" %d", n_filename);
15668             printf("\n");
15669         }
15670     }
15671     }
15672     }
15673     function_tests++;
15674 #endif
15675 #endif
15676
15677     return(test_ret);
15678 }
15679
15680
15681 static int
15682 test_xmlStopParser(void) {
15683     int test_ret = 0;
15684
15685 #ifdef LIBXML_PUSH_ENABLED
15686     int mem_base;
15687     xmlParserCtxtPtr ctxt; /* an XML parser context */
15688     int n_ctxt;
15689
15690     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15691         mem_base = xmlMemBlocks();
15692         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15693
15694         xmlStopParser(ctxt);
15695         call_tests++;
15696         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15697         xmlResetLastError();
15698         if (mem_base != xmlMemBlocks()) {
15699             printf("Leak of %d blocks found in xmlStopParser",
15700                    xmlMemBlocks() - mem_base);
15701             test_ret++;
15702             printf(" %d", n_ctxt);
15703             printf("\n");
15704         }
15705     }
15706     function_tests++;
15707 #endif
15708
15709     return(test_ret);
15710 }
15711
15712
15713 static int
15714 test_xmlSubstituteEntitiesDefault(void) {
15715     int test_ret = 0;
15716
15717     int mem_base;
15718     int ret_val;
15719     int val; /* int 0 or 1 */
15720     int n_val;
15721
15722     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15723         mem_base = xmlMemBlocks();
15724         val = gen_int(n_val, 0);
15725
15726         ret_val = xmlSubstituteEntitiesDefault(val);
15727         desret_int(ret_val);
15728         call_tests++;
15729         des_int(n_val, val, 0);
15730         xmlResetLastError();
15731         if (mem_base != xmlMemBlocks()) {
15732             printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15733                    xmlMemBlocks() - mem_base);
15734             test_ret++;
15735             printf(" %d", n_val);
15736             printf("\n");
15737         }
15738     }
15739     function_tests++;
15740
15741     return(test_ret);
15742 }
15743
15744 static int
15745 test_parser(void) {
15746     int test_ret = 0;
15747         int rc = 0;
15748
15749     if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15750     rc = test_xmlByteConsumed();
15751         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15752     rc = test_xmlClearNodeInfoSeq();
15753         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15754     rc = test_xmlClearParserCtxt();
15755         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15756     rc = test_xmlCreateDocParserCtxt();
15757         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15758     rc = test_xmlCreatePushParserCtxt();
15759         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15760     rc = test_xmlCtxtReadDoc();
15761         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15762     rc = test_xmlCtxtReadFile();
15763         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15764     rc = test_xmlCtxtReadMemory();
15765         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15766     rc = test_xmlCtxtReset();
15767         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15768     rc = test_xmlCtxtResetPush();
15769         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15770     rc = test_xmlCtxtUseOptions();
15771         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15772     rc = test_xmlGetExternalEntityLoader();
15773         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15774     rc = test_xmlGetFeature();
15775         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15776     rc = test_xmlGetFeaturesList();
15777         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15778     rc = test_xmlHasFeature();
15779         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15780     rc = test_xmlIOParseDTD();
15781         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15782     rc = test_xmlInitNodeInfoSeq();
15783         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15784     rc = test_xmlInitParser();
15785         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15786     rc = test_xmlInitParserCtxt();
15787         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15788     rc = test_xmlKeepBlanksDefault();
15789         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15790     rc = test_xmlLineNumbersDefault();
15791         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15792     rc = test_xmlLoadExternalEntity();
15793         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15794     rc = test_xmlNewIOInputStream();
15795         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15796     rc = test_xmlNewParserCtxt();
15797         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15798     rc = test_xmlParseBalancedChunkMemory();
15799         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15800     rc = test_xmlParseBalancedChunkMemoryRecover();
15801         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15802     rc = test_xmlParseChunk();
15803         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15804     rc = test_xmlParseCtxtExternalEntity();
15805         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15806     rc = test_xmlParseDTD();
15807         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15808     rc = test_xmlParseDoc();
15809         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15810     rc = test_xmlParseDocument();
15811         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15812     rc = test_xmlParseEntity();
15813         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15814     rc = test_xmlParseExtParsedEnt();
15815         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15816     rc = test_xmlParseExternalEntity();
15817         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15818     rc = test_xmlParseFile();
15819         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15820     rc = test_xmlParseInNodeContext();
15821         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15822     rc = test_xmlParseMemory();
15823         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15824     rc = test_xmlParserAddNodeInfo();
15825         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15826     rc = test_xmlParserFindNodeInfo();
15827         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15828     rc = test_xmlParserFindNodeInfoIndex();
15829         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15830     rc = test_xmlParserInputGrow();
15831         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15832     rc = test_xmlParserInputRead();
15833         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15834     rc = test_xmlPedanticParserDefault();
15835         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15836     rc = test_xmlReadDoc();
15837         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15838     rc = test_xmlReadFile();
15839         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15840     rc = test_xmlReadMemory();
15841         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15842     rc = test_xmlRecoverDoc();
15843         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15844     rc = test_xmlRecoverFile();
15845         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15846     rc = test_xmlRecoverMemory();
15847         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15848     rc = test_xmlSAXParseDTD();
15849         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15850     rc = test_xmlSAXParseDoc();
15851         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15852     rc = test_xmlSAXParseEntity();
15853         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15854     rc = test_xmlSAXParseFile();
15855         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15856     rc = test_xmlSAXParseFileWithData();
15857         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15858     rc = test_xmlSAXParseMemory();
15859         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15860     rc = test_xmlSAXParseMemoryWithData();
15861         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15862     rc = test_xmlSAXUserParseFile();
15863         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15864     rc = test_xmlSAXUserParseMemory();
15865         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15866     rc = test_xmlSetExternalEntityLoader();
15867         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15868     rc = test_xmlSetFeature();
15869         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15870     rc = test_xmlSetupParserForBuffer();
15871         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15872     rc = test_xmlStopParser();
15873         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15874     rc = test_xmlSubstituteEntitiesDefault();
15875         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
15876
15877     if (test_ret != 0)
15878         printf("Module parser: %d errors\n", test_ret);
15879     return(test_ret);
15880 }
15881
15882 static int
15883 test_htmlCreateFileParserCtxt(void) {
15884     int test_ret = 0;
15885
15886 #if defined(LIBXML_HTML_ENABLED)
15887     int mem_base;
15888     htmlParserCtxtPtr ret_val;
15889     const char * filename; /* the filename */
15890     int n_filename;
15891     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15892     int n_encoding;
15893
15894     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15895     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15896         mem_base = xmlMemBlocks();
15897         filename = gen_fileoutput(n_filename, 0);
15898         encoding = gen_const_char_ptr(n_encoding, 1);
15899
15900         ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15901         desret_htmlParserCtxtPtr(ret_val);
15902         call_tests++;
15903         des_fileoutput(n_filename, filename, 0);
15904         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15905         xmlResetLastError();
15906         if (mem_base != xmlMemBlocks()) {
15907             printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15908                    xmlMemBlocks() - mem_base);
15909             test_ret++;
15910             printf(" %d", n_filename);
15911             printf(" %d", n_encoding);
15912             printf("\n");
15913         }
15914     }
15915     }
15916     function_tests++;
15917 #endif
15918
15919     return(test_ret);
15920 }
15921
15922
15923 static int
15924 test_htmlInitAutoClose(void) {
15925     int test_ret = 0;
15926
15927 #if defined(LIBXML_HTML_ENABLED)
15928     int mem_base;
15929
15930         mem_base = xmlMemBlocks();
15931
15932         htmlInitAutoClose();
15933         call_tests++;
15934         xmlResetLastError();
15935         if (mem_base != xmlMemBlocks()) {
15936             printf("Leak of %d blocks found in htmlInitAutoClose",
15937                    xmlMemBlocks() - mem_base);
15938             test_ret++;
15939             printf("\n");
15940         }
15941     function_tests++;
15942 #endif
15943
15944     return(test_ret);
15945 }
15946
15947
15948 static int
15949 test_inputPop(void) {
15950     int test_ret = 0;
15951
15952     int mem_base;
15953     xmlParserInputPtr ret_val;
15954     xmlParserCtxtPtr ctxt; /* an XML parser context */
15955     int n_ctxt;
15956
15957     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15958         mem_base = xmlMemBlocks();
15959         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15960
15961         ret_val = inputPop(ctxt);
15962         desret_xmlParserInputPtr(ret_val);
15963         call_tests++;
15964         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15965         xmlResetLastError();
15966         if (mem_base != xmlMemBlocks()) {
15967             printf("Leak of %d blocks found in inputPop",
15968                    xmlMemBlocks() - mem_base);
15969             test_ret++;
15970             printf(" %d", n_ctxt);
15971             printf("\n");
15972         }
15973     }
15974     function_tests++;
15975
15976     return(test_ret);
15977 }
15978
15979
15980 static int
15981 test_inputPush(void) {
15982     int test_ret = 0;
15983
15984     int mem_base;
15985     int ret_val;
15986     xmlParserCtxtPtr ctxt; /* an XML parser context */
15987     int n_ctxt;
15988     xmlParserInputPtr value; /* the parser input */
15989     int n_value;
15990
15991     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15992     for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15993         mem_base = xmlMemBlocks();
15994         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15995         value = gen_xmlParserInputPtr(n_value, 1);
15996
15997         ret_val = inputPush(ctxt, value);
15998         desret_int(ret_val);
15999         call_tests++;
16000         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16001         des_xmlParserInputPtr(n_value, value, 1);
16002         xmlResetLastError();
16003         if (mem_base != xmlMemBlocks()) {
16004             printf("Leak of %d blocks found in inputPush",
16005                    xmlMemBlocks() - mem_base);
16006             test_ret++;
16007             printf(" %d", n_ctxt);
16008             printf(" %d", n_value);
16009             printf("\n");
16010         }
16011     }
16012     }
16013     function_tests++;
16014
16015     return(test_ret);
16016 }
16017
16018
16019 static int
16020 test_namePop(void) {
16021     int test_ret = 0;
16022
16023     int mem_base;
16024     const xmlChar * ret_val;
16025     xmlParserCtxtPtr ctxt; /* an XML parser context */
16026     int n_ctxt;
16027
16028     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16029         mem_base = xmlMemBlocks();
16030         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16031
16032         ret_val = namePop(ctxt);
16033         desret_const_xmlChar_ptr(ret_val);
16034         call_tests++;
16035         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16036         xmlResetLastError();
16037         if (mem_base != xmlMemBlocks()) {
16038             printf("Leak of %d blocks found in namePop",
16039                    xmlMemBlocks() - mem_base);
16040             test_ret++;
16041             printf(" %d", n_ctxt);
16042             printf("\n");
16043         }
16044     }
16045     function_tests++;
16046
16047     return(test_ret);
16048 }
16049
16050
16051 static int
16052 test_namePush(void) {
16053     int test_ret = 0;
16054
16055     int mem_base;
16056     int ret_val;
16057     xmlParserCtxtPtr ctxt; /* an XML parser context */
16058     int n_ctxt;
16059     xmlChar * value; /* the element name */
16060     int n_value;
16061
16062     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16063     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
16064         mem_base = xmlMemBlocks();
16065         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16066         value = gen_const_xmlChar_ptr(n_value, 1);
16067
16068         ret_val = namePush(ctxt, (const xmlChar *)value);
16069         desret_int(ret_val);
16070         call_tests++;
16071         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16072         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
16073         xmlResetLastError();
16074         if (mem_base != xmlMemBlocks()) {
16075             printf("Leak of %d blocks found in namePush",
16076                    xmlMemBlocks() - mem_base);
16077             test_ret++;
16078             printf(" %d", n_ctxt);
16079             printf(" %d", n_value);
16080             printf("\n");
16081         }
16082     }
16083     }
16084     function_tests++;
16085
16086     return(test_ret);
16087 }
16088
16089
16090 static int
16091 test_nodePop(void) {
16092     int test_ret = 0;
16093
16094     int mem_base;
16095     xmlNodePtr ret_val;
16096     xmlParserCtxtPtr ctxt; /* an XML parser context */
16097     int n_ctxt;
16098
16099     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16100         mem_base = xmlMemBlocks();
16101         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16102
16103         ret_val = nodePop(ctxt);
16104         desret_xmlNodePtr(ret_val);
16105         call_tests++;
16106         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16107         xmlResetLastError();
16108         if (mem_base != xmlMemBlocks()) {
16109             printf("Leak of %d blocks found in nodePop",
16110                    xmlMemBlocks() - mem_base);
16111             test_ret++;
16112             printf(" %d", n_ctxt);
16113             printf("\n");
16114         }
16115     }
16116     function_tests++;
16117
16118     return(test_ret);
16119 }
16120
16121
16122 static int
16123 test_nodePush(void) {
16124     int test_ret = 0;
16125
16126     int mem_base;
16127     int ret_val;
16128     xmlParserCtxtPtr ctxt; /* an XML parser context */
16129     int n_ctxt;
16130     xmlNodePtr value; /* the element node */
16131     int n_value;
16132
16133     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16134     for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
16135         mem_base = xmlMemBlocks();
16136         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16137         value = gen_xmlNodePtr(n_value, 1);
16138
16139         ret_val = nodePush(ctxt, value);
16140         desret_int(ret_val);
16141         call_tests++;
16142         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16143         des_xmlNodePtr(n_value, value, 1);
16144         xmlResetLastError();
16145         if (mem_base != xmlMemBlocks()) {
16146             printf("Leak of %d blocks found in nodePush",
16147                    xmlMemBlocks() - mem_base);
16148             test_ret++;
16149             printf(" %d", n_ctxt);
16150             printf(" %d", n_value);
16151             printf("\n");
16152         }
16153     }
16154     }
16155     function_tests++;
16156
16157     return(test_ret);
16158 }
16159
16160
16161 static int
16162 test_xmlCheckLanguageID(void) {
16163     int test_ret = 0;
16164
16165     int mem_base;
16166     int ret_val;
16167     xmlChar * lang; /* pointer to the string value */
16168     int n_lang;
16169
16170     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
16171         mem_base = xmlMemBlocks();
16172         lang = gen_const_xmlChar_ptr(n_lang, 0);
16173
16174         ret_val = xmlCheckLanguageID((const xmlChar *)lang);
16175         desret_int(ret_val);
16176         call_tests++;
16177         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
16178         xmlResetLastError();
16179         if (mem_base != xmlMemBlocks()) {
16180             printf("Leak of %d blocks found in xmlCheckLanguageID",
16181                    xmlMemBlocks() - mem_base);
16182             test_ret++;
16183             printf(" %d", n_lang);
16184             printf("\n");
16185         }
16186     }
16187     function_tests++;
16188
16189     return(test_ret);
16190 }
16191
16192
16193 static int
16194 test_xmlCopyChar(void) {
16195     int test_ret = 0;
16196
16197     int mem_base;
16198     int ret_val;
16199     int len; /* Ignored, compatibility */
16200     int n_len;
16201     xmlChar * out; /* pointer to an array of xmlChar */
16202     int n_out;
16203     int val; /* the char value */
16204     int n_val;
16205
16206     for (n_len = 0;n_len < gen_nb_int;n_len++) {
16207     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
16208     for (n_val = 0;n_val < gen_nb_int;n_val++) {
16209         mem_base = xmlMemBlocks();
16210         len = gen_int(n_len, 0);
16211         out = gen_xmlChar_ptr(n_out, 1);
16212         val = gen_int(n_val, 2);
16213
16214         ret_val = xmlCopyChar(len, out, val);
16215         desret_int(ret_val);
16216         call_tests++;
16217         des_int(n_len, len, 0);
16218         des_xmlChar_ptr(n_out, out, 1);
16219         des_int(n_val, val, 2);
16220         xmlResetLastError();
16221         if (mem_base != xmlMemBlocks()) {
16222             printf("Leak of %d blocks found in xmlCopyChar",
16223                    xmlMemBlocks() - mem_base);
16224             test_ret++;
16225             printf(" %d", n_len);
16226             printf(" %d", n_out);
16227             printf(" %d", n_val);
16228             printf("\n");
16229         }
16230     }
16231     }
16232     }
16233     function_tests++;
16234
16235     return(test_ret);
16236 }
16237
16238
16239 static int
16240 test_xmlCopyCharMultiByte(void) {
16241     int test_ret = 0;
16242
16243     int mem_base;
16244     int ret_val;
16245     xmlChar * out; /* pointer to an array of xmlChar */
16246     int n_out;
16247     int val; /* the char value */
16248     int n_val;
16249
16250     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
16251     for (n_val = 0;n_val < gen_nb_int;n_val++) {
16252         mem_base = xmlMemBlocks();
16253         out = gen_xmlChar_ptr(n_out, 0);
16254         val = gen_int(n_val, 1);
16255
16256         ret_val = xmlCopyCharMultiByte(out, val);
16257         desret_int(ret_val);
16258         call_tests++;
16259         des_xmlChar_ptr(n_out, out, 0);
16260         des_int(n_val, val, 1);
16261         xmlResetLastError();
16262         if (mem_base != xmlMemBlocks()) {
16263             printf("Leak of %d blocks found in xmlCopyCharMultiByte",
16264                    xmlMemBlocks() - mem_base);
16265             test_ret++;
16266             printf(" %d", n_out);
16267             printf(" %d", n_val);
16268             printf("\n");
16269         }
16270     }
16271     }
16272     function_tests++;
16273
16274     return(test_ret);
16275 }
16276
16277
16278 static int
16279 test_xmlCreateEntityParserCtxt(void) {
16280     int test_ret = 0;
16281
16282     int mem_base;
16283     xmlParserCtxtPtr ret_val;
16284     xmlChar * URL; /* the entity URL */
16285     int n_URL;
16286     xmlChar * ID; /* the entity PUBLIC ID */
16287     int n_ID;
16288     xmlChar * base; /* a possible base for the target URI */
16289     int n_base;
16290
16291     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
16292     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
16293     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
16294         mem_base = xmlMemBlocks();
16295         URL = gen_const_xmlChar_ptr(n_URL, 0);
16296         ID = gen_const_xmlChar_ptr(n_ID, 1);
16297         base = gen_const_xmlChar_ptr(n_base, 2);
16298
16299         ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
16300         desret_xmlParserCtxtPtr(ret_val);
16301         call_tests++;
16302         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
16303         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
16304         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
16305         xmlResetLastError();
16306         if (mem_base != xmlMemBlocks()) {
16307             printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
16308                    xmlMemBlocks() - mem_base);
16309             test_ret++;
16310             printf(" %d", n_URL);
16311             printf(" %d", n_ID);
16312             printf(" %d", n_base);
16313             printf("\n");
16314         }
16315     }
16316     }
16317     }
16318     function_tests++;
16319
16320     return(test_ret);
16321 }
16322
16323
16324 static int
16325 test_xmlCreateFileParserCtxt(void) {
16326     int test_ret = 0;
16327
16328     int mem_base;
16329     xmlParserCtxtPtr ret_val;
16330     const char * filename; /* the filename */
16331     int n_filename;
16332
16333     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
16334         mem_base = xmlMemBlocks();
16335         filename = gen_fileoutput(n_filename, 0);
16336
16337         ret_val = xmlCreateFileParserCtxt(filename);
16338         desret_xmlParserCtxtPtr(ret_val);
16339         call_tests++;
16340         des_fileoutput(n_filename, filename, 0);
16341         xmlResetLastError();
16342         if (mem_base != xmlMemBlocks()) {
16343             printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
16344                    xmlMemBlocks() - mem_base);
16345             test_ret++;
16346             printf(" %d", n_filename);
16347             printf("\n");
16348         }
16349     }
16350     function_tests++;
16351
16352     return(test_ret);
16353 }
16354
16355
16356 static int
16357 test_xmlCreateMemoryParserCtxt(void) {
16358     int test_ret = 0;
16359
16360     int mem_base;
16361     xmlParserCtxtPtr ret_val;
16362     char * buffer; /* a pointer to a char array */
16363     int n_buffer;
16364     int size; /* the size of the array */
16365     int n_size;
16366
16367     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
16368     for (n_size = 0;n_size < gen_nb_int;n_size++) {
16369         mem_base = xmlMemBlocks();
16370         buffer = gen_const_char_ptr(n_buffer, 0);
16371         size = gen_int(n_size, 1);
16372         if ((buffer != NULL) &&
16373             (size > (int) strlen((const char *) buffer) + 1))
16374             continue;
16375
16376         ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
16377         desret_xmlParserCtxtPtr(ret_val);
16378         call_tests++;
16379         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
16380         des_int(n_size, size, 1);
16381         xmlResetLastError();
16382         if (mem_base != xmlMemBlocks()) {
16383             printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
16384                    xmlMemBlocks() - mem_base);
16385             test_ret++;
16386             printf(" %d", n_buffer);
16387             printf(" %d", n_size);
16388             printf("\n");
16389         }
16390     }
16391     }
16392     function_tests++;
16393
16394     return(test_ret);
16395 }
16396
16397
16398 static int
16399 test_xmlCreateURLParserCtxt(void) {
16400     int test_ret = 0;
16401
16402     int mem_base;
16403     xmlParserCtxtPtr ret_val;
16404     const char * filename; /* the filename or URL */
16405     int n_filename;
16406     int options; /* a combination of xmlParserOption */
16407     int n_options;
16408
16409     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
16410     for (n_options = 0;n_options < gen_nb_int;n_options++) {
16411         mem_base = xmlMemBlocks();
16412         filename = gen_fileoutput(n_filename, 0);
16413         options = gen_int(n_options, 1);
16414
16415         ret_val = xmlCreateURLParserCtxt(filename, options);
16416         desret_xmlParserCtxtPtr(ret_val);
16417         call_tests++;
16418         des_fileoutput(n_filename, filename, 0);
16419         des_int(n_options, options, 1);
16420         xmlResetLastError();
16421         if (mem_base != xmlMemBlocks()) {
16422             printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
16423                    xmlMemBlocks() - mem_base);
16424             test_ret++;
16425             printf(" %d", n_filename);
16426             printf(" %d", n_options);
16427             printf("\n");
16428         }
16429     }
16430     }
16431     function_tests++;
16432
16433     return(test_ret);
16434 }
16435
16436
16437 static int
16438 test_xmlCurrentChar(void) {
16439     int test_ret = 0;
16440
16441     int mem_base;
16442     int ret_val;
16443     xmlParserCtxtPtr ctxt; /* the XML parser context */
16444     int n_ctxt;
16445     int * len; /* pointer to the length of the char read */
16446     int n_len;
16447
16448     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16449     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16450         mem_base = xmlMemBlocks();
16451         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16452         len = gen_int_ptr(n_len, 1);
16453
16454         ret_val = xmlCurrentChar(ctxt, len);
16455         desret_int(ret_val);
16456         call_tests++;
16457         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16458         des_int_ptr(n_len, len, 1);
16459         xmlResetLastError();
16460         if (mem_base != xmlMemBlocks()) {
16461             printf("Leak of %d blocks found in xmlCurrentChar",
16462                    xmlMemBlocks() - mem_base);
16463             test_ret++;
16464             printf(" %d", n_ctxt);
16465             printf(" %d", n_len);
16466             printf("\n");
16467         }
16468     }
16469     }
16470     function_tests++;
16471
16472     return(test_ret);
16473 }
16474
16475
16476 static int
16477 test_xmlErrMemory(void) {
16478     int test_ret = 0;
16479
16480     int mem_base;
16481     xmlParserCtxtPtr ctxt; /* an XML parser context */
16482     int n_ctxt;
16483     char * extra; /* extra informations */
16484     int n_extra;
16485
16486     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16487     for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16488         mem_base = xmlMemBlocks();
16489         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16490         extra = gen_const_char_ptr(n_extra, 1);
16491
16492         xmlErrMemory(ctxt, (const char *)extra);
16493         call_tests++;
16494         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16495         des_const_char_ptr(n_extra, (const char *)extra, 1);
16496         xmlResetLastError();
16497         if (mem_base != xmlMemBlocks()) {
16498             printf("Leak of %d blocks found in xmlErrMemory",
16499                    xmlMemBlocks() - mem_base);
16500             test_ret++;
16501             printf(" %d", n_ctxt);
16502             printf(" %d", n_extra);
16503             printf("\n");
16504         }
16505     }
16506     }
16507     function_tests++;
16508
16509     return(test_ret);
16510 }
16511
16512
16513 static int
16514 test_xmlIsLetter(void) {
16515     int test_ret = 0;
16516
16517     int mem_base;
16518     int ret_val;
16519     int c; /* an unicode character (int) */
16520     int n_c;
16521
16522     for (n_c = 0;n_c < gen_nb_int;n_c++) {
16523         mem_base = xmlMemBlocks();
16524         c = gen_int(n_c, 0);
16525
16526         ret_val = xmlIsLetter(c);
16527         desret_int(ret_val);
16528         call_tests++;
16529         des_int(n_c, c, 0);
16530         xmlResetLastError();
16531         if (mem_base != xmlMemBlocks()) {
16532             printf("Leak of %d blocks found in xmlIsLetter",
16533                    xmlMemBlocks() - mem_base);
16534             test_ret++;
16535             printf(" %d", n_c);
16536             printf("\n");
16537         }
16538     }
16539     function_tests++;
16540
16541     return(test_ret);
16542 }
16543
16544
16545 static int
16546 test_xmlNewEntityInputStream(void) {
16547     int test_ret = 0;
16548
16549     int mem_base;
16550     xmlParserInputPtr ret_val;
16551     xmlParserCtxtPtr ctxt; /* an XML parser context */
16552     int n_ctxt;
16553     xmlEntityPtr entity; /* an Entity pointer */
16554     int n_entity;
16555
16556     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16557     for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16558         mem_base = xmlMemBlocks();
16559         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16560         entity = gen_xmlEntityPtr(n_entity, 1);
16561
16562         ret_val = xmlNewEntityInputStream(ctxt, entity);
16563         desret_xmlParserInputPtr(ret_val);
16564         call_tests++;
16565         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16566         des_xmlEntityPtr(n_entity, entity, 1);
16567         xmlResetLastError();
16568         if (mem_base != xmlMemBlocks()) {
16569             printf("Leak of %d blocks found in xmlNewEntityInputStream",
16570                    xmlMemBlocks() - mem_base);
16571             test_ret++;
16572             printf(" %d", n_ctxt);
16573             printf(" %d", n_entity);
16574             printf("\n");
16575         }
16576     }
16577     }
16578     function_tests++;
16579
16580     return(test_ret);
16581 }
16582
16583
16584 static int
16585 test_xmlNewInputFromFile(void) {
16586     int test_ret = 0;
16587
16588     int mem_base;
16589     xmlParserInputPtr ret_val;
16590     xmlParserCtxtPtr ctxt; /* an XML parser context */
16591     int n_ctxt;
16592     const char * filename; /* the filename to use as entity */
16593     int n_filename;
16594
16595     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16596     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16597         mem_base = xmlMemBlocks();
16598         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16599         filename = gen_filepath(n_filename, 1);
16600
16601         ret_val = xmlNewInputFromFile(ctxt, filename);
16602         desret_xmlParserInputPtr(ret_val);
16603         call_tests++;
16604         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16605         des_filepath(n_filename, filename, 1);
16606         xmlResetLastError();
16607         if (mem_base != xmlMemBlocks()) {
16608             printf("Leak of %d blocks found in xmlNewInputFromFile",
16609                    xmlMemBlocks() - mem_base);
16610             test_ret++;
16611             printf(" %d", n_ctxt);
16612             printf(" %d", n_filename);
16613             printf("\n");
16614         }
16615     }
16616     }
16617     function_tests++;
16618
16619     return(test_ret);
16620 }
16621
16622
16623 static int
16624 test_xmlNewInputStream(void) {
16625     int test_ret = 0;
16626
16627     int mem_base;
16628     xmlParserInputPtr ret_val;
16629     xmlParserCtxtPtr ctxt; /* an XML parser context */
16630     int n_ctxt;
16631
16632     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16633         mem_base = xmlMemBlocks();
16634         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16635
16636         ret_val = xmlNewInputStream(ctxt);
16637         desret_xmlParserInputPtr(ret_val);
16638         call_tests++;
16639         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16640         xmlResetLastError();
16641         if (mem_base != xmlMemBlocks()) {
16642             printf("Leak of %d blocks found in xmlNewInputStream",
16643                    xmlMemBlocks() - mem_base);
16644             test_ret++;
16645             printf(" %d", n_ctxt);
16646             printf("\n");
16647         }
16648     }
16649     function_tests++;
16650
16651     return(test_ret);
16652 }
16653
16654
16655 static int
16656 test_xmlNewStringInputStream(void) {
16657     int test_ret = 0;
16658
16659     int mem_base;
16660     xmlParserInputPtr ret_val;
16661     xmlParserCtxtPtr ctxt; /* an XML parser context */
16662     int n_ctxt;
16663     xmlChar * buffer; /* an memory buffer */
16664     int n_buffer;
16665
16666     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16667     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16668         mem_base = xmlMemBlocks();
16669         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16670         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16671
16672         ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16673         desret_xmlParserInputPtr(ret_val);
16674         call_tests++;
16675         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16676         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16677         xmlResetLastError();
16678         if (mem_base != xmlMemBlocks()) {
16679             printf("Leak of %d blocks found in xmlNewStringInputStream",
16680                    xmlMemBlocks() - mem_base);
16681             test_ret++;
16682             printf(" %d", n_ctxt);
16683             printf(" %d", n_buffer);
16684             printf("\n");
16685         }
16686     }
16687     }
16688     function_tests++;
16689
16690     return(test_ret);
16691 }
16692
16693
16694 static int
16695 test_xmlNextChar(void) {
16696     int test_ret = 0;
16697
16698     int mem_base;
16699     xmlParserCtxtPtr ctxt; /* the XML parser context */
16700     int n_ctxt;
16701
16702     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16703         mem_base = xmlMemBlocks();
16704         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16705
16706         xmlNextChar(ctxt);
16707         call_tests++;
16708         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16709         xmlResetLastError();
16710         if (mem_base != xmlMemBlocks()) {
16711             printf("Leak of %d blocks found in xmlNextChar",
16712                    xmlMemBlocks() - mem_base);
16713             test_ret++;
16714             printf(" %d", n_ctxt);
16715             printf("\n");
16716         }
16717     }
16718     function_tests++;
16719
16720     return(test_ret);
16721 }
16722
16723
16724 static int
16725 test_xmlParserInputShrink(void) {
16726     int test_ret = 0;
16727
16728     int mem_base;
16729     xmlParserInputPtr in; /* an XML parser input */
16730     int n_in;
16731
16732     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16733         mem_base = xmlMemBlocks();
16734         in = gen_xmlParserInputPtr(n_in, 0);
16735
16736         xmlParserInputShrink(in);
16737         call_tests++;
16738         des_xmlParserInputPtr(n_in, in, 0);
16739         xmlResetLastError();
16740         if (mem_base != xmlMemBlocks()) {
16741             printf("Leak of %d blocks found in xmlParserInputShrink",
16742                    xmlMemBlocks() - mem_base);
16743             test_ret++;
16744             printf(" %d", n_in);
16745             printf("\n");
16746         }
16747     }
16748     function_tests++;
16749
16750     return(test_ret);
16751 }
16752
16753
16754 static int
16755 test_xmlPopInput(void) {
16756     int test_ret = 0;
16757
16758     int mem_base;
16759     xmlChar ret_val;
16760     xmlParserCtxtPtr ctxt; /* an XML parser context */
16761     int n_ctxt;
16762
16763     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16764         mem_base = xmlMemBlocks();
16765         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16766
16767         ret_val = xmlPopInput(ctxt);
16768         desret_xmlChar(ret_val);
16769         call_tests++;
16770         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16771         xmlResetLastError();
16772         if (mem_base != xmlMemBlocks()) {
16773             printf("Leak of %d blocks found in xmlPopInput",
16774                    xmlMemBlocks() - mem_base);
16775             test_ret++;
16776             printf(" %d", n_ctxt);
16777             printf("\n");
16778         }
16779     }
16780     function_tests++;
16781
16782     return(test_ret);
16783 }
16784
16785
16786 static int
16787 test_xmlPushInput(void) {
16788     int test_ret = 0;
16789
16790     int mem_base;
16791     int ret_val;
16792     xmlParserCtxtPtr ctxt; /* an XML parser context */
16793     int n_ctxt;
16794     xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16795     int n_input;
16796
16797     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16798     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16799         mem_base = xmlMemBlocks();
16800         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16801         input = gen_xmlParserInputPtr(n_input, 1);
16802
16803         ret_val = xmlPushInput(ctxt, input);
16804         desret_int(ret_val);
16805         call_tests++;
16806         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16807         des_xmlParserInputPtr(n_input, input, 1);
16808         xmlResetLastError();
16809         if (mem_base != xmlMemBlocks()) {
16810             printf("Leak of %d blocks found in xmlPushInput",
16811                    xmlMemBlocks() - mem_base);
16812             test_ret++;
16813             printf(" %d", n_ctxt);
16814             printf(" %d", n_input);
16815             printf("\n");
16816         }
16817     }
16818     }
16819     function_tests++;
16820
16821     return(test_ret);
16822 }
16823
16824
16825 static int
16826 test_xmlSetEntityReferenceFunc(void) {
16827     int test_ret = 0;
16828
16829
16830     /* missing type support */
16831     return(test_ret);
16832 }
16833
16834
16835 static int
16836 test_xmlSplitQName(void) {
16837     int test_ret = 0;
16838
16839     int mem_base;
16840     xmlChar * ret_val;
16841     xmlParserCtxtPtr ctxt; /* an XML parser context */
16842     int n_ctxt;
16843     xmlChar * name; /* an XML parser context */
16844     int n_name;
16845     xmlChar ** prefix; /* a xmlChar ** */
16846     int n_prefix;
16847
16848     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16849     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16850     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16851         mem_base = xmlMemBlocks();
16852         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16853         name = gen_const_xmlChar_ptr(n_name, 1);
16854         prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16855
16856         ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16857         desret_xmlChar_ptr(ret_val);
16858         call_tests++;
16859         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16860         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16861         des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16862         xmlResetLastError();
16863         if (mem_base != xmlMemBlocks()) {
16864             printf("Leak of %d blocks found in xmlSplitQName",
16865                    xmlMemBlocks() - mem_base);
16866             test_ret++;
16867             printf(" %d", n_ctxt);
16868             printf(" %d", n_name);
16869             printf(" %d", n_prefix);
16870             printf("\n");
16871         }
16872     }
16873     }
16874     }
16875     function_tests++;
16876
16877     return(test_ret);
16878 }
16879
16880
16881 static int
16882 test_xmlStringCurrentChar(void) {
16883     int test_ret = 0;
16884
16885     int mem_base;
16886     int ret_val;
16887     xmlParserCtxtPtr ctxt; /* the XML parser context */
16888     int n_ctxt;
16889     xmlChar * cur; /* pointer to the beginning of the char */
16890     int n_cur;
16891     int * len; /* pointer to the length of the char read */
16892     int n_len;
16893
16894     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16895     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16896     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16897         mem_base = xmlMemBlocks();
16898         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16899         cur = gen_const_xmlChar_ptr(n_cur, 1);
16900         len = gen_int_ptr(n_len, 2);
16901
16902         ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16903         desret_int(ret_val);
16904         call_tests++;
16905         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16906         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16907         des_int_ptr(n_len, len, 2);
16908         xmlResetLastError();
16909         if (mem_base != xmlMemBlocks()) {
16910             printf("Leak of %d blocks found in xmlStringCurrentChar",
16911                    xmlMemBlocks() - mem_base);
16912             test_ret++;
16913             printf(" %d", n_ctxt);
16914             printf(" %d", n_cur);
16915             printf(" %d", n_len);
16916             printf("\n");
16917         }
16918     }
16919     }
16920     }
16921     function_tests++;
16922
16923     return(test_ret);
16924 }
16925
16926
16927 static int
16928 test_xmlStringDecodeEntities(void) {
16929     int test_ret = 0;
16930
16931     int mem_base;
16932     xmlChar * ret_val;
16933     xmlParserCtxtPtr ctxt; /* the parser context */
16934     int n_ctxt;
16935     xmlChar * str; /* the input string */
16936     int n_str;
16937     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16938     int n_what;
16939     xmlChar end; /* an end marker xmlChar, 0 if none */
16940     int n_end;
16941     xmlChar end2; /* an end marker xmlChar, 0 if none */
16942     int n_end2;
16943     xmlChar end3; /* an end marker xmlChar, 0 if none */
16944     int n_end3;
16945
16946     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16947     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16948     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16949     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16950     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16951     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16952         mem_base = xmlMemBlocks();
16953         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16954         str = gen_const_xmlChar_ptr(n_str, 1);
16955         what = gen_int(n_what, 2);
16956         end = gen_xmlChar(n_end, 3);
16957         end2 = gen_xmlChar(n_end2, 4);
16958         end3 = gen_xmlChar(n_end3, 5);
16959
16960         ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16961         desret_xmlChar_ptr(ret_val);
16962         call_tests++;
16963         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16964         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16965         des_int(n_what, what, 2);
16966         des_xmlChar(n_end, end, 3);
16967         des_xmlChar(n_end2, end2, 4);
16968         des_xmlChar(n_end3, end3, 5);
16969         xmlResetLastError();
16970         if (mem_base != xmlMemBlocks()) {
16971             printf("Leak of %d blocks found in xmlStringDecodeEntities",
16972                    xmlMemBlocks() - mem_base);
16973             test_ret++;
16974             printf(" %d", n_ctxt);
16975             printf(" %d", n_str);
16976             printf(" %d", n_what);
16977             printf(" %d", n_end);
16978             printf(" %d", n_end2);
16979             printf(" %d", n_end3);
16980             printf("\n");
16981         }
16982     }
16983     }
16984     }
16985     }
16986     }
16987     }
16988     function_tests++;
16989
16990     return(test_ret);
16991 }
16992
16993
16994 static int
16995 test_xmlStringLenDecodeEntities(void) {
16996     int test_ret = 0;
16997
16998     int mem_base;
16999     xmlChar * ret_val;
17000     xmlParserCtxtPtr ctxt; /* the parser context */
17001     int n_ctxt;
17002     xmlChar * str; /* the input string */
17003     int n_str;
17004     int len; /* the string length */
17005     int n_len;
17006     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
17007     int n_what;
17008     xmlChar end; /* an end marker xmlChar, 0 if none */
17009     int n_end;
17010     xmlChar end2; /* an end marker xmlChar, 0 if none */
17011     int n_end2;
17012     xmlChar end3; /* an end marker xmlChar, 0 if none */
17013     int n_end3;
17014
17015     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
17016     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17017     for (n_len = 0;n_len < gen_nb_int;n_len++) {
17018     for (n_what = 0;n_what < gen_nb_int;n_what++) {
17019     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
17020     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
17021     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
17022         mem_base = xmlMemBlocks();
17023         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
17024         str = gen_const_xmlChar_ptr(n_str, 1);
17025         len = gen_int(n_len, 2);
17026         what = gen_int(n_what, 3);
17027         end = gen_xmlChar(n_end, 4);
17028         end2 = gen_xmlChar(n_end2, 5);
17029         end3 = gen_xmlChar(n_end3, 6);
17030         if ((str != NULL) &&
17031             (len > (int) strlen((const char *) str) + 1))
17032             continue;
17033
17034         ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
17035         desret_xmlChar_ptr(ret_val);
17036         call_tests++;
17037         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
17038         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
17039         des_int(n_len, len, 2);
17040         des_int(n_what, what, 3);
17041         des_xmlChar(n_end, end, 4);
17042         des_xmlChar(n_end2, end2, 5);
17043         des_xmlChar(n_end3, end3, 6);
17044         xmlResetLastError();
17045         if (mem_base != xmlMemBlocks()) {
17046             printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
17047                    xmlMemBlocks() - mem_base);
17048             test_ret++;
17049             printf(" %d", n_ctxt);
17050             printf(" %d", n_str);
17051             printf(" %d", n_len);
17052             printf(" %d", n_what);
17053             printf(" %d", n_end);
17054             printf(" %d", n_end2);
17055             printf(" %d", n_end3);
17056             printf("\n");
17057         }
17058     }
17059     }
17060     }
17061     }
17062     }
17063     }
17064     }
17065     function_tests++;
17066
17067     return(test_ret);
17068 }
17069
17070
17071 static int
17072 test_xmlSwitchEncoding(void) {
17073     int test_ret = 0;
17074
17075     int mem_base;
17076     int ret_val;
17077     xmlParserCtxtPtr ctxt; /* the parser context */
17078     int n_ctxt;
17079     xmlCharEncoding enc; /* the encoding value (number) */
17080     int n_enc;
17081
17082     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
17083     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
17084         mem_base = xmlMemBlocks();
17085         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
17086         enc = gen_xmlCharEncoding(n_enc, 1);
17087
17088         ret_val = xmlSwitchEncoding(ctxt, enc);
17089         desret_int(ret_val);
17090         call_tests++;
17091         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
17092         des_xmlCharEncoding(n_enc, enc, 1);
17093         xmlResetLastError();
17094         if (mem_base != xmlMemBlocks()) {
17095             printf("Leak of %d blocks found in xmlSwitchEncoding",
17096                    xmlMemBlocks() - mem_base);
17097             test_ret++;
17098             printf(" %d", n_ctxt);
17099             printf(" %d", n_enc);
17100             printf("\n");
17101         }
17102     }
17103     }
17104     function_tests++;
17105
17106     return(test_ret);
17107 }
17108
17109
17110 static int
17111 test_xmlSwitchInputEncoding(void) {
17112     int test_ret = 0;
17113
17114     int mem_base;
17115     int ret_val;
17116     xmlParserCtxtPtr ctxt; /* the parser context */
17117     int n_ctxt;
17118     xmlParserInputPtr input; /* the input stream */
17119     int n_input;
17120     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
17121     int n_handler;
17122
17123     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
17124     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
17125     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
17126         mem_base = xmlMemBlocks();
17127         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
17128         input = gen_xmlParserInputPtr(n_input, 1);
17129         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
17130
17131         ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
17132         desret_int(ret_val);
17133         call_tests++;
17134         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
17135         des_xmlParserInputPtr(n_input, input, 1);
17136         des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
17137         xmlResetLastError();
17138         if (mem_base != xmlMemBlocks()) {
17139             printf("Leak of %d blocks found in xmlSwitchInputEncoding",
17140                    xmlMemBlocks() - mem_base);
17141             test_ret++;
17142             printf(" %d", n_ctxt);
17143             printf(" %d", n_input);
17144             printf(" %d", n_handler);
17145             printf("\n");
17146         }
17147     }
17148     }
17149     }
17150     function_tests++;
17151
17152     return(test_ret);
17153 }
17154
17155
17156 static int
17157 test_xmlSwitchToEncoding(void) {
17158     int test_ret = 0;
17159
17160     int mem_base;
17161     int ret_val;
17162     xmlParserCtxtPtr ctxt; /* the parser context */
17163     int n_ctxt;
17164     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
17165     int n_handler;
17166
17167     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
17168     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
17169         mem_base = xmlMemBlocks();
17170         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
17171         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
17172
17173         ret_val = xmlSwitchToEncoding(ctxt, handler);
17174         desret_int(ret_val);
17175         call_tests++;
17176         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
17177         des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
17178         xmlResetLastError();
17179         if (mem_base != xmlMemBlocks()) {
17180             printf("Leak of %d blocks found in xmlSwitchToEncoding",
17181                    xmlMemBlocks() - mem_base);
17182             test_ret++;
17183             printf(" %d", n_ctxt);
17184             printf(" %d", n_handler);
17185             printf("\n");
17186         }
17187     }
17188     }
17189     function_tests++;
17190
17191     return(test_ret);
17192 }
17193
17194 static int
17195 test_parserInternals(void) {
17196     int test_ret = 0;
17197         int rc = 0;
17198
17199     if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
17200     rc = test_htmlCreateFileParserCtxt();
17201         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17202     rc = test_htmlInitAutoClose();
17203         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17204     rc = test_inputPop();
17205         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17206     rc = test_inputPush();
17207         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17208     rc = test_namePop();
17209         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17210     rc = test_namePush();
17211         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17212     rc = test_nodePop();
17213         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17214     rc = test_nodePush();
17215         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17216     rc = test_xmlCheckLanguageID();
17217         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17218     rc = test_xmlCopyChar();
17219         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17220     rc = test_xmlCopyCharMultiByte();
17221         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17222     rc = test_xmlCreateEntityParserCtxt();
17223         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17224     rc = test_xmlCreateFileParserCtxt();
17225         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17226     rc = test_xmlCreateMemoryParserCtxt();
17227         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17228     rc = test_xmlCreateURLParserCtxt();
17229         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17230     rc = test_xmlCurrentChar();
17231         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17232     rc = test_xmlErrMemory();
17233         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17234     rc = test_xmlIsLetter();
17235         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17236     rc = test_xmlNewEntityInputStream();
17237         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17238     rc = test_xmlNewInputFromFile();
17239         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17240     rc = test_xmlNewInputStream();
17241         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17242     rc = test_xmlNewStringInputStream();
17243         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17244     rc = test_xmlNextChar();
17245         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17246     rc = test_xmlParserInputShrink();
17247         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17248     rc = test_xmlPopInput();
17249         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17250     rc = test_xmlPushInput();
17251         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17252     rc = test_xmlSetEntityReferenceFunc();
17253         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17254     rc = test_xmlSplitQName();
17255         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17256     rc = test_xmlStringCurrentChar();
17257         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17258     rc = test_xmlStringDecodeEntities();
17259         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17260     rc = test_xmlStringLenDecodeEntities();
17261         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17262     rc = test_xmlSwitchEncoding();
17263         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17264     rc = test_xmlSwitchInputEncoding();
17265         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17266     rc = test_xmlSwitchToEncoding();
17267         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17268
17269     if (test_ret != 0)
17270         printf("Module parserInternals: %d errors\n", test_ret);
17271     return(test_ret);
17272 }
17273
17274 static int
17275 test_xmlPatternFromRoot(void) {
17276     int test_ret = 0;
17277
17278 #if defined(LIBXML_PATTERN_ENABLED)
17279     int mem_base;
17280     int ret_val;
17281     xmlPatternPtr comp; /* the precompiled pattern */
17282     int n_comp;
17283
17284     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17285         mem_base = xmlMemBlocks();
17286         comp = gen_xmlPatternPtr(n_comp, 0);
17287
17288         ret_val = xmlPatternFromRoot(comp);
17289         desret_int(ret_val);
17290         call_tests++;
17291         des_xmlPatternPtr(n_comp, comp, 0);
17292         xmlResetLastError();
17293         if (mem_base != xmlMemBlocks()) {
17294             printf("Leak of %d blocks found in xmlPatternFromRoot",
17295                    xmlMemBlocks() - mem_base);
17296             test_ret++;
17297             printf(" %d", n_comp);
17298             printf("\n");
17299         }
17300     }
17301     function_tests++;
17302 #endif
17303
17304     return(test_ret);
17305 }
17306
17307
17308 static int
17309 test_xmlPatternGetStreamCtxt(void) {
17310     int test_ret = 0;
17311
17312
17313     /* missing type support */
17314     return(test_ret);
17315 }
17316
17317
17318 static int
17319 test_xmlPatternMatch(void) {
17320     int test_ret = 0;
17321
17322 #if defined(LIBXML_PATTERN_ENABLED)
17323     int mem_base;
17324     int ret_val;
17325     xmlPatternPtr comp; /* the precompiled pattern */
17326     int n_comp;
17327     xmlNodePtr node; /* a node */
17328     int n_node;
17329
17330     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17331     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
17332         mem_base = xmlMemBlocks();
17333         comp = gen_xmlPatternPtr(n_comp, 0);
17334         node = gen_xmlNodePtr(n_node, 1);
17335
17336         ret_val = xmlPatternMatch(comp, node);
17337         desret_int(ret_val);
17338         call_tests++;
17339         des_xmlPatternPtr(n_comp, comp, 0);
17340         des_xmlNodePtr(n_node, node, 1);
17341         xmlResetLastError();
17342         if (mem_base != xmlMemBlocks()) {
17343             printf("Leak of %d blocks found in xmlPatternMatch",
17344                    xmlMemBlocks() - mem_base);
17345             test_ret++;
17346             printf(" %d", n_comp);
17347             printf(" %d", n_node);
17348             printf("\n");
17349         }
17350     }
17351     }
17352     function_tests++;
17353 #endif
17354
17355     return(test_ret);
17356 }
17357
17358
17359 static int
17360 test_xmlPatternMaxDepth(void) {
17361     int test_ret = 0;
17362
17363 #if defined(LIBXML_PATTERN_ENABLED)
17364     int mem_base;
17365     int ret_val;
17366     xmlPatternPtr comp; /* the precompiled pattern */
17367     int n_comp;
17368
17369     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17370         mem_base = xmlMemBlocks();
17371         comp = gen_xmlPatternPtr(n_comp, 0);
17372
17373         ret_val = xmlPatternMaxDepth(comp);
17374         desret_int(ret_val);
17375         call_tests++;
17376         des_xmlPatternPtr(n_comp, comp, 0);
17377         xmlResetLastError();
17378         if (mem_base != xmlMemBlocks()) {
17379             printf("Leak of %d blocks found in xmlPatternMaxDepth",
17380                    xmlMemBlocks() - mem_base);
17381             test_ret++;
17382             printf(" %d", n_comp);
17383             printf("\n");
17384         }
17385     }
17386     function_tests++;
17387 #endif
17388
17389     return(test_ret);
17390 }
17391
17392
17393 static int
17394 test_xmlPatternMinDepth(void) {
17395     int test_ret = 0;
17396
17397 #if defined(LIBXML_PATTERN_ENABLED)
17398     int mem_base;
17399     int ret_val;
17400     xmlPatternPtr comp; /* the precompiled pattern */
17401     int n_comp;
17402
17403     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17404         mem_base = xmlMemBlocks();
17405         comp = gen_xmlPatternPtr(n_comp, 0);
17406
17407         ret_val = xmlPatternMinDepth(comp);
17408         desret_int(ret_val);
17409         call_tests++;
17410         des_xmlPatternPtr(n_comp, comp, 0);
17411         xmlResetLastError();
17412         if (mem_base != xmlMemBlocks()) {
17413             printf("Leak of %d blocks found in xmlPatternMinDepth",
17414                    xmlMemBlocks() - mem_base);
17415             test_ret++;
17416             printf(" %d", n_comp);
17417             printf("\n");
17418         }
17419     }
17420     function_tests++;
17421 #endif
17422
17423     return(test_ret);
17424 }
17425
17426
17427 static int
17428 test_xmlPatternStreamable(void) {
17429     int test_ret = 0;
17430
17431 #if defined(LIBXML_PATTERN_ENABLED)
17432     int mem_base;
17433     int ret_val;
17434     xmlPatternPtr comp; /* the precompiled pattern */
17435     int n_comp;
17436
17437     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
17438         mem_base = xmlMemBlocks();
17439         comp = gen_xmlPatternPtr(n_comp, 0);
17440
17441         ret_val = xmlPatternStreamable(comp);
17442         desret_int(ret_val);
17443         call_tests++;
17444         des_xmlPatternPtr(n_comp, comp, 0);
17445         xmlResetLastError();
17446         if (mem_base != xmlMemBlocks()) {
17447             printf("Leak of %d blocks found in xmlPatternStreamable",
17448                    xmlMemBlocks() - mem_base);
17449             test_ret++;
17450             printf(" %d", n_comp);
17451             printf("\n");
17452         }
17453     }
17454     function_tests++;
17455 #endif
17456
17457     return(test_ret);
17458 }
17459
17460
17461 static int
17462 test_xmlPatterncompile(void) {
17463     int test_ret = 0;
17464
17465
17466     /* missing type support */
17467     return(test_ret);
17468 }
17469
17470 #ifdef LIBXML_PATTERN_ENABLED
17471
17472 #define gen_nb_xmlStreamCtxtPtr 1
17473 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17474     return(NULL);
17475 }
17476 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17477 }
17478 #endif
17479
17480
17481 static int
17482 test_xmlStreamPop(void) {
17483     int test_ret = 0;
17484
17485 #if defined(LIBXML_PATTERN_ENABLED)
17486     int mem_base;
17487     int ret_val;
17488     xmlStreamCtxtPtr stream; /* the stream context */
17489     int n_stream;
17490
17491     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17492         mem_base = xmlMemBlocks();
17493         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17494
17495         ret_val = xmlStreamPop(stream);
17496         desret_int(ret_val);
17497         call_tests++;
17498         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17499         xmlResetLastError();
17500         if (mem_base != xmlMemBlocks()) {
17501             printf("Leak of %d blocks found in xmlStreamPop",
17502                    xmlMemBlocks() - mem_base);
17503             test_ret++;
17504             printf(" %d", n_stream);
17505             printf("\n");
17506         }
17507     }
17508     function_tests++;
17509 #endif
17510
17511     return(test_ret);
17512 }
17513
17514
17515 static int
17516 test_xmlStreamPush(void) {
17517     int test_ret = 0;
17518
17519 #if defined(LIBXML_PATTERN_ENABLED)
17520     int mem_base;
17521     int ret_val;
17522     xmlStreamCtxtPtr stream; /* the stream context */
17523     int n_stream;
17524     xmlChar * name; /* the current name */
17525     int n_name;
17526     xmlChar * ns; /* the namespace name */
17527     int n_ns;
17528
17529     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17530     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17531     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17532         mem_base = xmlMemBlocks();
17533         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17534         name = gen_const_xmlChar_ptr(n_name, 1);
17535         ns = gen_const_xmlChar_ptr(n_ns, 2);
17536
17537         ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17538         desret_int(ret_val);
17539         call_tests++;
17540         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17541         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17542         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17543         xmlResetLastError();
17544         if (mem_base != xmlMemBlocks()) {
17545             printf("Leak of %d blocks found in xmlStreamPush",
17546                    xmlMemBlocks() - mem_base);
17547             test_ret++;
17548             printf(" %d", n_stream);
17549             printf(" %d", n_name);
17550             printf(" %d", n_ns);
17551             printf("\n");
17552         }
17553     }
17554     }
17555     }
17556     function_tests++;
17557 #endif
17558
17559     return(test_ret);
17560 }
17561
17562
17563 static int
17564 test_xmlStreamPushAttr(void) {
17565     int test_ret = 0;
17566
17567 #if defined(LIBXML_PATTERN_ENABLED)
17568     int mem_base;
17569     int ret_val;
17570     xmlStreamCtxtPtr stream; /* the stream context */
17571     int n_stream;
17572     xmlChar * name; /* the current name */
17573     int n_name;
17574     xmlChar * ns; /* the namespace name */
17575     int n_ns;
17576
17577     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17578     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17579     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17580         mem_base = xmlMemBlocks();
17581         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17582         name = gen_const_xmlChar_ptr(n_name, 1);
17583         ns = gen_const_xmlChar_ptr(n_ns, 2);
17584
17585         ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17586         desret_int(ret_val);
17587         call_tests++;
17588         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17589         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17590         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17591         xmlResetLastError();
17592         if (mem_base != xmlMemBlocks()) {
17593             printf("Leak of %d blocks found in xmlStreamPushAttr",
17594                    xmlMemBlocks() - mem_base);
17595             test_ret++;
17596             printf(" %d", n_stream);
17597             printf(" %d", n_name);
17598             printf(" %d", n_ns);
17599             printf("\n");
17600         }
17601     }
17602     }
17603     }
17604     function_tests++;
17605 #endif
17606
17607     return(test_ret);
17608 }
17609
17610
17611 static int
17612 test_xmlStreamPushNode(void) {
17613     int test_ret = 0;
17614
17615 #if defined(LIBXML_PATTERN_ENABLED)
17616     int mem_base;
17617     int ret_val;
17618     xmlStreamCtxtPtr stream; /* the stream context */
17619     int n_stream;
17620     xmlChar * name; /* the current name */
17621     int n_name;
17622     xmlChar * ns; /* the namespace name */
17623     int n_ns;
17624     int nodeType; /* the type of the node being pushed */
17625     int n_nodeType;
17626
17627     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17628     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17629     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17630     for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17631         mem_base = xmlMemBlocks();
17632         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17633         name = gen_const_xmlChar_ptr(n_name, 1);
17634         ns = gen_const_xmlChar_ptr(n_ns, 2);
17635         nodeType = gen_int(n_nodeType, 3);
17636
17637         ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17638         desret_int(ret_val);
17639         call_tests++;
17640         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17641         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17642         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17643         des_int(n_nodeType, nodeType, 3);
17644         xmlResetLastError();
17645         if (mem_base != xmlMemBlocks()) {
17646             printf("Leak of %d blocks found in xmlStreamPushNode",
17647                    xmlMemBlocks() - mem_base);
17648             test_ret++;
17649             printf(" %d", n_stream);
17650             printf(" %d", n_name);
17651             printf(" %d", n_ns);
17652             printf(" %d", n_nodeType);
17653             printf("\n");
17654         }
17655     }
17656     }
17657     }
17658     }
17659     function_tests++;
17660 #endif
17661
17662     return(test_ret);
17663 }
17664
17665
17666 static int
17667 test_xmlStreamWantsAnyNode(void) {
17668     int test_ret = 0;
17669
17670 #if defined(LIBXML_PATTERN_ENABLED)
17671     int mem_base;
17672     int ret_val;
17673     xmlStreamCtxtPtr streamCtxt; /* the stream context */
17674     int n_streamCtxt;
17675
17676     for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17677         mem_base = xmlMemBlocks();
17678         streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17679
17680         ret_val = xmlStreamWantsAnyNode(streamCtxt);
17681         desret_int(ret_val);
17682         call_tests++;
17683         des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17684         xmlResetLastError();
17685         if (mem_base != xmlMemBlocks()) {
17686             printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17687                    xmlMemBlocks() - mem_base);
17688             test_ret++;
17689             printf(" %d", n_streamCtxt);
17690             printf("\n");
17691         }
17692     }
17693     function_tests++;
17694 #endif
17695
17696     return(test_ret);
17697 }
17698
17699 static int
17700 test_pattern(void) {
17701     int test_ret = 0;
17702         int rc = 0;
17703
17704     if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17705     rc = test_xmlPatternFromRoot();
17706         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17707     rc = test_xmlPatternGetStreamCtxt();
17708         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17709     rc = test_xmlPatternMatch();
17710         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17711     rc = test_xmlPatternMaxDepth();
17712         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17713     rc = test_xmlPatternMinDepth();
17714         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17715     rc = test_xmlPatternStreamable();
17716         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17717     rc = test_xmlPatterncompile();
17718         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17719     rc = test_xmlStreamPop();
17720         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17721     rc = test_xmlStreamPush();
17722         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17723     rc = test_xmlStreamPushAttr();
17724         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17725     rc = test_xmlStreamPushNode();
17726         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17727     rc = test_xmlStreamWantsAnyNode();
17728         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
17729
17730     if (test_ret != 0)
17731         printf("Module pattern: %d errors\n", test_ret);
17732     return(test_ret);
17733 }
17734 #ifdef LIBXML_SCHEMAS_ENABLED
17735
17736 #define gen_nb_xmlRelaxNGPtr 1
17737 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17738     return(NULL);
17739 }
17740 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17741 }
17742 #endif
17743
17744
17745 static int
17746 test_xmlRelaxNGDump(void) {
17747     int test_ret = 0;
17748
17749 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17750     int mem_base;
17751     FILE * output; /* the file output */
17752     int n_output;
17753     xmlRelaxNGPtr schema; /* a schema structure */
17754     int n_schema;
17755
17756     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17757     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17758         mem_base = xmlMemBlocks();
17759         output = gen_FILE_ptr(n_output, 0);
17760         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17761
17762         xmlRelaxNGDump(output, schema);
17763         call_tests++;
17764         des_FILE_ptr(n_output, output, 0);
17765         des_xmlRelaxNGPtr(n_schema, schema, 1);
17766         xmlResetLastError();
17767         if (mem_base != xmlMemBlocks()) {
17768             printf("Leak of %d blocks found in xmlRelaxNGDump",
17769                    xmlMemBlocks() - mem_base);
17770             test_ret++;
17771             printf(" %d", n_output);
17772             printf(" %d", n_schema);
17773             printf("\n");
17774         }
17775     }
17776     }
17777     function_tests++;
17778 #endif
17779
17780     return(test_ret);
17781 }
17782
17783
17784 static int
17785 test_xmlRelaxNGDumpTree(void) {
17786     int test_ret = 0;
17787
17788 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17789     int mem_base;
17790     FILE * output; /* the file output */
17791     int n_output;
17792     xmlRelaxNGPtr schema; /* a schema structure */
17793     int n_schema;
17794
17795     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17796     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17797         mem_base = xmlMemBlocks();
17798         output = gen_FILE_ptr(n_output, 0);
17799         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17800
17801         xmlRelaxNGDumpTree(output, schema);
17802         call_tests++;
17803         des_FILE_ptr(n_output, output, 0);
17804         des_xmlRelaxNGPtr(n_schema, schema, 1);
17805         xmlResetLastError();
17806         if (mem_base != xmlMemBlocks()) {
17807             printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17808                    xmlMemBlocks() - mem_base);
17809             test_ret++;
17810             printf(" %d", n_output);
17811             printf(" %d", n_schema);
17812             printf("\n");
17813         }
17814     }
17815     }
17816     function_tests++;
17817 #endif
17818
17819     return(test_ret);
17820 }
17821
17822 #ifdef LIBXML_SCHEMAS_ENABLED
17823
17824 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17825 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17826     return(NULL);
17827 }
17828 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17829 }
17830 #endif
17831
17832 #ifdef LIBXML_SCHEMAS_ENABLED
17833
17834 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17835 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17836     return(NULL);
17837 }
17838 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17839 }
17840 #endif
17841
17842 #ifdef LIBXML_SCHEMAS_ENABLED
17843
17844 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17845 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17846     return(NULL);
17847 }
17848 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17849 }
17850 #endif
17851
17852
17853 static int
17854 test_xmlRelaxNGGetParserErrors(void) {
17855     int test_ret = 0;
17856
17857 #if defined(LIBXML_SCHEMAS_ENABLED)
17858     int mem_base;
17859     int ret_val;
17860     xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17861     int n_ctxt;
17862     xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17863     int n_err;
17864     xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17865     int n_warn;
17866     void ** ctx; /* contextual data for the callbacks result */
17867     int n_ctx;
17868
17869     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17870     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17871     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17872     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17873         mem_base = xmlMemBlocks();
17874         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17875         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17876         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17877         ctx = gen_void_ptr_ptr(n_ctx, 3);
17878
17879         ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17880         desret_int(ret_val);
17881         call_tests++;
17882         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17883         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17884         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17885         des_void_ptr_ptr(n_ctx, ctx, 3);
17886         xmlResetLastError();
17887         if (mem_base != xmlMemBlocks()) {
17888             printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17889                    xmlMemBlocks() - mem_base);
17890             test_ret++;
17891             printf(" %d", n_ctxt);
17892             printf(" %d", n_err);
17893             printf(" %d", n_warn);
17894             printf(" %d", n_ctx);
17895             printf("\n");
17896         }
17897     }
17898     }
17899     }
17900     }
17901     function_tests++;
17902 #endif
17903
17904     return(test_ret);
17905 }
17906
17907 #ifdef LIBXML_SCHEMAS_ENABLED
17908
17909 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17910 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17911     return(NULL);
17912 }
17913 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17914 }
17915 #endif
17916
17917
17918 static int
17919 test_xmlRelaxNGGetValidErrors(void) {
17920     int test_ret = 0;
17921
17922 #if defined(LIBXML_SCHEMAS_ENABLED)
17923     int mem_base;
17924     int ret_val;
17925     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17926     int n_ctxt;
17927     xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17928     int n_err;
17929     xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17930     int n_warn;
17931     void ** ctx; /* the functions context result */
17932     int n_ctx;
17933
17934     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17935     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17936     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17937     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17938         mem_base = xmlMemBlocks();
17939         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17940         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17941         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17942         ctx = gen_void_ptr_ptr(n_ctx, 3);
17943
17944         ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17945         desret_int(ret_val);
17946         call_tests++;
17947         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17948         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17949         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17950         des_void_ptr_ptr(n_ctx, ctx, 3);
17951         xmlResetLastError();
17952         if (mem_base != xmlMemBlocks()) {
17953             printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17954                    xmlMemBlocks() - mem_base);
17955             test_ret++;
17956             printf(" %d", n_ctxt);
17957             printf(" %d", n_err);
17958             printf(" %d", n_warn);
17959             printf(" %d", n_ctx);
17960             printf("\n");
17961         }
17962     }
17963     }
17964     }
17965     }
17966     function_tests++;
17967 #endif
17968
17969     return(test_ret);
17970 }
17971
17972
17973 static int
17974 test_xmlRelaxNGInitTypes(void) {
17975     int test_ret = 0;
17976
17977 #if defined(LIBXML_SCHEMAS_ENABLED)
17978     int mem_base;
17979     int ret_val;
17980
17981         mem_base = xmlMemBlocks();
17982
17983         ret_val = xmlRelaxNGInitTypes();
17984         desret_int(ret_val);
17985         call_tests++;
17986         xmlResetLastError();
17987         if (mem_base != xmlMemBlocks()) {
17988             printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17989                    xmlMemBlocks() - mem_base);
17990             test_ret++;
17991             printf("\n");
17992         }
17993     function_tests++;
17994 #endif
17995
17996     return(test_ret);
17997 }
17998
17999
18000 static int
18001 test_xmlRelaxNGNewDocParserCtxt(void) {
18002     int test_ret = 0;
18003
18004 #if defined(LIBXML_SCHEMAS_ENABLED)
18005     int mem_base;
18006     xmlRelaxNGParserCtxtPtr ret_val;
18007     xmlDocPtr doc; /* a preparsed document tree */
18008     int n_doc;
18009
18010     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18011         mem_base = xmlMemBlocks();
18012         doc = gen_xmlDocPtr(n_doc, 0);
18013
18014         ret_val = xmlRelaxNGNewDocParserCtxt(doc);
18015         desret_xmlRelaxNGParserCtxtPtr(ret_val);
18016         call_tests++;
18017         des_xmlDocPtr(n_doc, doc, 0);
18018         xmlResetLastError();
18019         if (mem_base != xmlMemBlocks()) {
18020             printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
18021                    xmlMemBlocks() - mem_base);
18022             test_ret++;
18023             printf(" %d", n_doc);
18024             printf("\n");
18025         }
18026     }
18027     function_tests++;
18028 #endif
18029
18030     return(test_ret);
18031 }
18032
18033
18034 static int
18035 test_xmlRelaxNGNewMemParserCtxt(void) {
18036     int test_ret = 0;
18037
18038 #if defined(LIBXML_SCHEMAS_ENABLED)
18039     int mem_base;
18040     xmlRelaxNGParserCtxtPtr ret_val;
18041     char * buffer; /* a pointer to a char array containing the schemas */
18042     int n_buffer;
18043     int size; /* the size of the array */
18044     int n_size;
18045
18046     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
18047     for (n_size = 0;n_size < gen_nb_int;n_size++) {
18048         mem_base = xmlMemBlocks();
18049         buffer = gen_const_char_ptr(n_buffer, 0);
18050         size = gen_int(n_size, 1);
18051         if ((buffer != NULL) &&
18052             (size > (int) strlen((const char *) buffer) + 1))
18053             continue;
18054
18055         ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
18056         desret_xmlRelaxNGParserCtxtPtr(ret_val);
18057         call_tests++;
18058         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
18059         des_int(n_size, size, 1);
18060         xmlResetLastError();
18061         if (mem_base != xmlMemBlocks()) {
18062             printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
18063                    xmlMemBlocks() - mem_base);
18064             test_ret++;
18065             printf(" %d", n_buffer);
18066             printf(" %d", n_size);
18067             printf("\n");
18068         }
18069     }
18070     }
18071     function_tests++;
18072 #endif
18073
18074     return(test_ret);
18075 }
18076
18077
18078 static int
18079 test_xmlRelaxNGNewParserCtxt(void) {
18080     int test_ret = 0;
18081
18082 #if defined(LIBXML_SCHEMAS_ENABLED)
18083     int mem_base;
18084     xmlRelaxNGParserCtxtPtr ret_val;
18085     char * URL; /* the location of the schema */
18086     int n_URL;
18087
18088     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
18089         mem_base = xmlMemBlocks();
18090         URL = gen_const_char_ptr(n_URL, 0);
18091
18092         ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
18093         desret_xmlRelaxNGParserCtxtPtr(ret_val);
18094         call_tests++;
18095         des_const_char_ptr(n_URL, (const char *)URL, 0);
18096         xmlResetLastError();
18097         if (mem_base != xmlMemBlocks()) {
18098             printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
18099                    xmlMemBlocks() - mem_base);
18100             test_ret++;
18101             printf(" %d", n_URL);
18102             printf("\n");
18103         }
18104     }
18105     function_tests++;
18106 #endif
18107
18108     return(test_ret);
18109 }
18110
18111
18112 static int
18113 test_xmlRelaxNGNewValidCtxt(void) {
18114     int test_ret = 0;
18115
18116
18117     /* missing type support */
18118     return(test_ret);
18119 }
18120
18121
18122 static int
18123 test_xmlRelaxNGParse(void) {
18124     int test_ret = 0;
18125
18126
18127     /* missing type support */
18128     return(test_ret);
18129 }
18130
18131
18132 static int
18133 test_xmlRelaxNGSetParserErrors(void) {
18134     int test_ret = 0;
18135
18136
18137     /* missing type support */
18138     return(test_ret);
18139 }
18140
18141
18142 static int
18143 test_xmlRelaxNGSetParserStructuredErrors(void) {
18144     int test_ret = 0;
18145
18146
18147     /* missing type support */
18148     return(test_ret);
18149 }
18150
18151
18152 static int
18153 test_xmlRelaxNGSetValidErrors(void) {
18154     int test_ret = 0;
18155
18156
18157     /* missing type support */
18158     return(test_ret);
18159 }
18160
18161
18162 static int
18163 test_xmlRelaxNGSetValidStructuredErrors(void) {
18164     int test_ret = 0;
18165
18166
18167     /* missing type support */
18168     return(test_ret);
18169 }
18170
18171
18172 static int
18173 test_xmlRelaxNGValidateDoc(void) {
18174     int test_ret = 0;
18175
18176 #if defined(LIBXML_SCHEMAS_ENABLED)
18177     int mem_base;
18178     int ret_val;
18179     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
18180     int n_ctxt;
18181     xmlDocPtr doc; /* a parsed document tree */
18182     int n_doc;
18183
18184     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18185     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18186         mem_base = xmlMemBlocks();
18187         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18188         doc = gen_xmlDocPtr(n_doc, 1);
18189
18190         ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
18191         desret_int(ret_val);
18192         call_tests++;
18193         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18194         des_xmlDocPtr(n_doc, doc, 1);
18195         xmlResetLastError();
18196         if (mem_base != xmlMemBlocks()) {
18197             printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
18198                    xmlMemBlocks() - mem_base);
18199             test_ret++;
18200             printf(" %d", n_ctxt);
18201             printf(" %d", n_doc);
18202             printf("\n");
18203         }
18204     }
18205     }
18206     function_tests++;
18207 #endif
18208
18209     return(test_ret);
18210 }
18211
18212
18213 static int
18214 test_xmlRelaxNGValidateFullElement(void) {
18215     int test_ret = 0;
18216
18217 #if defined(LIBXML_SCHEMAS_ENABLED)
18218     int mem_base;
18219     int ret_val;
18220     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
18221     int n_ctxt;
18222     xmlDocPtr doc; /* a document instance */
18223     int n_doc;
18224     xmlNodePtr elem; /* an element instance */
18225     int n_elem;
18226
18227     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18228     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18229     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
18230         mem_base = xmlMemBlocks();
18231         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18232         doc = gen_xmlDocPtr(n_doc, 1);
18233         elem = gen_xmlNodePtr(n_elem, 2);
18234
18235         ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
18236         desret_int(ret_val);
18237         call_tests++;
18238         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18239         des_xmlDocPtr(n_doc, doc, 1);
18240         des_xmlNodePtr(n_elem, elem, 2);
18241         xmlResetLastError();
18242         if (mem_base != xmlMemBlocks()) {
18243             printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
18244                    xmlMemBlocks() - mem_base);
18245             test_ret++;
18246             printf(" %d", n_ctxt);
18247             printf(" %d", n_doc);
18248             printf(" %d", n_elem);
18249             printf("\n");
18250         }
18251     }
18252     }
18253     }
18254     function_tests++;
18255 #endif
18256
18257     return(test_ret);
18258 }
18259
18260
18261 static int
18262 test_xmlRelaxNGValidatePopElement(void) {
18263     int test_ret = 0;
18264
18265 #if defined(LIBXML_SCHEMAS_ENABLED)
18266     int mem_base;
18267     int ret_val;
18268     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
18269     int n_ctxt;
18270     xmlDocPtr doc; /* a document instance */
18271     int n_doc;
18272     xmlNodePtr elem; /* an element instance */
18273     int n_elem;
18274
18275     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18276     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18277     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
18278         mem_base = xmlMemBlocks();
18279         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18280         doc = gen_xmlDocPtr(n_doc, 1);
18281         elem = gen_xmlNodePtr(n_elem, 2);
18282
18283         ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
18284         desret_int(ret_val);
18285         call_tests++;
18286         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18287         des_xmlDocPtr(n_doc, doc, 1);
18288         des_xmlNodePtr(n_elem, elem, 2);
18289         xmlResetLastError();
18290         if (mem_base != xmlMemBlocks()) {
18291             printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
18292                    xmlMemBlocks() - mem_base);
18293             test_ret++;
18294             printf(" %d", n_ctxt);
18295             printf(" %d", n_doc);
18296             printf(" %d", n_elem);
18297             printf("\n");
18298         }
18299     }
18300     }
18301     }
18302     function_tests++;
18303 #endif
18304
18305     return(test_ret);
18306 }
18307
18308
18309 static int
18310 test_xmlRelaxNGValidatePushCData(void) {
18311     int test_ret = 0;
18312
18313 #if defined(LIBXML_SCHEMAS_ENABLED)
18314     int mem_base;
18315     int ret_val;
18316     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
18317     int n_ctxt;
18318     xmlChar * data; /* some character data read */
18319     int n_data;
18320     int len; /* the length of the data */
18321     int n_len;
18322
18323     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18324     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
18325     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18326         mem_base = xmlMemBlocks();
18327         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18328         data = gen_const_xmlChar_ptr(n_data, 1);
18329         len = gen_int(n_len, 2);
18330         if ((data != NULL) &&
18331             (len > (int) strlen((const char *) data) + 1))
18332             continue;
18333
18334         ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
18335         desret_int(ret_val);
18336         call_tests++;
18337         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18338         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
18339         des_int(n_len, len, 2);
18340         xmlResetLastError();
18341         if (mem_base != xmlMemBlocks()) {
18342             printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
18343                    xmlMemBlocks() - mem_base);
18344             test_ret++;
18345             printf(" %d", n_ctxt);
18346             printf(" %d", n_data);
18347             printf(" %d", n_len);
18348             printf("\n");
18349         }
18350     }
18351     }
18352     }
18353     function_tests++;
18354 #endif
18355
18356     return(test_ret);
18357 }
18358
18359
18360 static int
18361 test_xmlRelaxNGValidatePushElement(void) {
18362     int test_ret = 0;
18363
18364 #if defined(LIBXML_SCHEMAS_ENABLED)
18365     int mem_base;
18366     int ret_val;
18367     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
18368     int n_ctxt;
18369     xmlDocPtr doc; /* a document instance */
18370     int n_doc;
18371     xmlNodePtr elem; /* an element instance */
18372     int n_elem;
18373
18374     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
18375     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18376     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
18377         mem_base = xmlMemBlocks();
18378         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
18379         doc = gen_xmlDocPtr(n_doc, 1);
18380         elem = gen_xmlNodePtr(n_elem, 2);
18381
18382         ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
18383         desret_int(ret_val);
18384         call_tests++;
18385         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
18386         des_xmlDocPtr(n_doc, doc, 1);
18387         des_xmlNodePtr(n_elem, elem, 2);
18388         xmlResetLastError();
18389         if (mem_base != xmlMemBlocks()) {
18390             printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
18391                    xmlMemBlocks() - mem_base);
18392             test_ret++;
18393             printf(" %d", n_ctxt);
18394             printf(" %d", n_doc);
18395             printf(" %d", n_elem);
18396             printf("\n");
18397         }
18398     }
18399     }
18400     }
18401     function_tests++;
18402 #endif
18403
18404     return(test_ret);
18405 }
18406
18407
18408 static int
18409 test_xmlRelaxParserSetFlag(void) {
18410     int test_ret = 0;
18411
18412 #if defined(LIBXML_SCHEMAS_ENABLED)
18413     int mem_base;
18414     int ret_val;
18415     xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
18416     int n_ctxt;
18417     int flags; /* a set of flags values */
18418     int n_flags;
18419
18420     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
18421     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
18422         mem_base = xmlMemBlocks();
18423         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
18424         flags = gen_int(n_flags, 1);
18425
18426         ret_val = xmlRelaxParserSetFlag(ctxt, flags);
18427         desret_int(ret_val);
18428         call_tests++;
18429         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
18430         des_int(n_flags, flags, 1);
18431         xmlResetLastError();
18432         if (mem_base != xmlMemBlocks()) {
18433             printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
18434                    xmlMemBlocks() - mem_base);
18435             test_ret++;
18436             printf(" %d", n_ctxt);
18437             printf(" %d", n_flags);
18438             printf("\n");
18439         }
18440     }
18441     }
18442     function_tests++;
18443 #endif
18444
18445     return(test_ret);
18446 }
18447
18448 static int
18449 test_relaxng(void) {
18450     int test_ret = 0;
18451         int rc = 0;
18452
18453     if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
18454     rc = test_xmlRelaxNGDump();
18455         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18456     rc = test_xmlRelaxNGDumpTree();
18457         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18458     rc = test_xmlRelaxNGGetParserErrors();
18459         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18460     rc = test_xmlRelaxNGGetValidErrors();
18461         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18462     rc = test_xmlRelaxNGInitTypes();
18463         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18464     rc = test_xmlRelaxNGNewDocParserCtxt();
18465         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18466     rc = test_xmlRelaxNGNewMemParserCtxt();
18467         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18468     rc = test_xmlRelaxNGNewParserCtxt();
18469         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18470     rc = test_xmlRelaxNGNewValidCtxt();
18471         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18472     rc = test_xmlRelaxNGParse();
18473         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18474     rc = test_xmlRelaxNGSetParserErrors();
18475         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18476     rc = test_xmlRelaxNGSetParserStructuredErrors();
18477         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18478     rc = test_xmlRelaxNGSetValidErrors();
18479         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18480     rc = test_xmlRelaxNGSetValidStructuredErrors();
18481         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18482     rc = test_xmlRelaxNGValidateDoc();
18483         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18484     rc = test_xmlRelaxNGValidateFullElement();
18485         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18486     rc = test_xmlRelaxNGValidatePopElement();
18487         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18488     rc = test_xmlRelaxNGValidatePushCData();
18489         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18490     rc = test_xmlRelaxNGValidatePushElement();
18491         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18492     rc = test_xmlRelaxParserSetFlag();
18493         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18494
18495     if (test_ret != 0)
18496         printf("Module relaxng: %d errors\n", test_ret);
18497     return(test_ret);
18498 }
18499 static int
18500 test_schemasInternals(void) {
18501     int test_ret = 0;
18502
18503     if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18504
18505     if (test_ret != 0)
18506         printf("Module schemasInternals: %d errors\n", test_ret);
18507     return(test_ret);
18508 }
18509
18510 static int
18511 test_xmlSchematronNewDocParserCtxt(void) {
18512     int test_ret = 0;
18513
18514
18515     /* missing type support */
18516     return(test_ret);
18517 }
18518
18519
18520 static int
18521 test_xmlSchematronNewMemParserCtxt(void) {
18522     int test_ret = 0;
18523
18524
18525     /* missing type support */
18526     return(test_ret);
18527 }
18528
18529
18530 static int
18531 test_xmlSchematronNewParserCtxt(void) {
18532     int test_ret = 0;
18533
18534
18535     /* missing type support */
18536     return(test_ret);
18537 }
18538
18539 #ifdef LIBXML_SCHEMATRON_ENABLED
18540
18541 #define gen_nb_xmlSchematronPtr 1
18542 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18543     return(NULL);
18544 }
18545 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18546 }
18547 #endif
18548
18549
18550 static int
18551 test_xmlSchematronNewValidCtxt(void) {
18552     int test_ret = 0;
18553
18554
18555     /* missing type support */
18556     return(test_ret);
18557 }
18558
18559 #ifdef LIBXML_SCHEMATRON_ENABLED
18560
18561 #define gen_nb_xmlSchematronParserCtxtPtr 1
18562 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18563     return(NULL);
18564 }
18565 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18566 }
18567 #endif
18568
18569
18570 static int
18571 test_xmlSchematronParse(void) {
18572     int test_ret = 0;
18573
18574
18575     /* missing type support */
18576     return(test_ret);
18577 }
18578
18579 #ifdef LIBXML_SCHEMATRON_ENABLED
18580
18581 #define gen_nb_xmlSchematronValidCtxtPtr 1
18582 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18583     return(NULL);
18584 }
18585 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18586 }
18587 #endif
18588
18589
18590 static int
18591 test_xmlSchematronSetValidStructuredErrors(void) {
18592     int test_ret = 0;
18593
18594
18595     /* missing type support */
18596     return(test_ret);
18597 }
18598
18599
18600 static int
18601 test_xmlSchematronValidateDoc(void) {
18602     int test_ret = 0;
18603
18604 #if defined(LIBXML_SCHEMATRON_ENABLED)
18605     int mem_base;
18606     int ret_val;
18607     xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18608     int n_ctxt;
18609     xmlDocPtr instance; /* the document instace tree */
18610     int n_instance;
18611
18612     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18613     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18614         mem_base = xmlMemBlocks();
18615         ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18616         instance = gen_xmlDocPtr(n_instance, 1);
18617
18618         ret_val = xmlSchematronValidateDoc(ctxt, instance);
18619         desret_int(ret_val);
18620         call_tests++;
18621         des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18622         des_xmlDocPtr(n_instance, instance, 1);
18623         xmlResetLastError();
18624         if (mem_base != xmlMemBlocks()) {
18625             printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18626                    xmlMemBlocks() - mem_base);
18627             test_ret++;
18628             printf(" %d", n_ctxt);
18629             printf(" %d", n_instance);
18630             printf("\n");
18631         }
18632     }
18633     }
18634     function_tests++;
18635 #endif
18636
18637     return(test_ret);
18638 }
18639
18640 static int
18641 test_schematron(void) {
18642     int test_ret = 0;
18643         int rc = 0;
18644
18645     if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18646     rc = test_xmlSchematronNewDocParserCtxt();
18647         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18648     rc = test_xmlSchematronNewMemParserCtxt();
18649         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18650     rc = test_xmlSchematronNewParserCtxt();
18651         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18652     rc = test_xmlSchematronNewValidCtxt();
18653         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18654     rc = test_xmlSchematronParse();
18655         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18656     rc = test_xmlSchematronSetValidStructuredErrors();
18657         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18658     rc = test_xmlSchematronValidateDoc();
18659         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
18660
18661     if (test_ret != 0)
18662         printf("Module schematron: %d errors\n", test_ret);
18663     return(test_ret);
18664 }
18665
18666 static int
18667 test_xmlAddChild(void) {
18668     int test_ret = 0;
18669
18670     int mem_base;
18671     xmlNodePtr ret_val;
18672     xmlNodePtr parent; /* the parent node */
18673     int n_parent;
18674     xmlNodePtr cur; /* the child node */
18675     int n_cur;
18676
18677     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18678     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18679         mem_base = xmlMemBlocks();
18680         parent = gen_xmlNodePtr(n_parent, 0);
18681         cur = gen_xmlNodePtr_in(n_cur, 1);
18682
18683         ret_val = xmlAddChild(parent, cur);
18684         if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18685         desret_xmlNodePtr(ret_val);
18686         call_tests++;
18687         des_xmlNodePtr(n_parent, parent, 0);
18688         des_xmlNodePtr_in(n_cur, cur, 1);
18689         xmlResetLastError();
18690         if (mem_base != xmlMemBlocks()) {
18691             printf("Leak of %d blocks found in xmlAddChild",
18692                    xmlMemBlocks() - mem_base);
18693             test_ret++;
18694             printf(" %d", n_parent);
18695             printf(" %d", n_cur);
18696             printf("\n");
18697         }
18698     }
18699     }
18700     function_tests++;
18701
18702     return(test_ret);
18703 }
18704
18705
18706 static int
18707 test_xmlAddChildList(void) {
18708     int test_ret = 0;
18709
18710     int mem_base;
18711     xmlNodePtr ret_val;
18712     xmlNodePtr parent; /* the parent node */
18713     int n_parent;
18714     xmlNodePtr cur; /* the first node in the list */
18715     int n_cur;
18716
18717     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18718     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18719         mem_base = xmlMemBlocks();
18720         parent = gen_xmlNodePtr(n_parent, 0);
18721         cur = gen_xmlNodePtr_in(n_cur, 1);
18722
18723         ret_val = xmlAddChildList(parent, cur);
18724         if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18725         desret_xmlNodePtr(ret_val);
18726         call_tests++;
18727         des_xmlNodePtr(n_parent, parent, 0);
18728         des_xmlNodePtr_in(n_cur, cur, 1);
18729         xmlResetLastError();
18730         if (mem_base != xmlMemBlocks()) {
18731             printf("Leak of %d blocks found in xmlAddChildList",
18732                    xmlMemBlocks() - mem_base);
18733             test_ret++;
18734             printf(" %d", n_parent);
18735             printf(" %d", n_cur);
18736             printf("\n");
18737         }
18738     }
18739     }
18740     function_tests++;
18741
18742     return(test_ret);
18743 }
18744
18745
18746 static int
18747 test_xmlAddNextSibling(void) {
18748     int test_ret = 0;
18749
18750     int mem_base;
18751     xmlNodePtr ret_val;
18752     xmlNodePtr cur; /* the child node */
18753     int n_cur;
18754     xmlNodePtr elem; /* the new node */
18755     int n_elem;
18756
18757     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18758     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18759         mem_base = xmlMemBlocks();
18760         cur = gen_xmlNodePtr(n_cur, 0);
18761         elem = gen_xmlNodePtr_in(n_elem, 1);
18762
18763         ret_val = xmlAddNextSibling(cur, elem);
18764         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18765         desret_xmlNodePtr(ret_val);
18766         call_tests++;
18767         des_xmlNodePtr(n_cur, cur, 0);
18768         des_xmlNodePtr_in(n_elem, elem, 1);
18769         xmlResetLastError();
18770         if (mem_base != xmlMemBlocks()) {
18771             printf("Leak of %d blocks found in xmlAddNextSibling",
18772                    xmlMemBlocks() - mem_base);
18773             test_ret++;
18774             printf(" %d", n_cur);
18775             printf(" %d", n_elem);
18776             printf("\n");
18777         }
18778     }
18779     }
18780     function_tests++;
18781
18782     return(test_ret);
18783 }
18784
18785
18786 static int
18787 test_xmlAddPrevSibling(void) {
18788     int test_ret = 0;
18789
18790 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
18791     int mem_base;
18792     xmlNodePtr ret_val;
18793     xmlNodePtr cur; /* the child node */
18794     int n_cur;
18795     xmlNodePtr elem; /* the new node */
18796     int n_elem;
18797
18798     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18799     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18800         mem_base = xmlMemBlocks();
18801         cur = gen_xmlNodePtr(n_cur, 0);
18802         elem = gen_xmlNodePtr_in(n_elem, 1);
18803
18804         ret_val = xmlAddPrevSibling(cur, elem);
18805         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18806         desret_xmlNodePtr(ret_val);
18807         call_tests++;
18808         des_xmlNodePtr(n_cur, cur, 0);
18809         des_xmlNodePtr_in(n_elem, elem, 1);
18810         xmlResetLastError();
18811         if (mem_base != xmlMemBlocks()) {
18812             printf("Leak of %d blocks found in xmlAddPrevSibling",
18813                    xmlMemBlocks() - mem_base);
18814             test_ret++;
18815             printf(" %d", n_cur);
18816             printf(" %d", n_elem);
18817             printf("\n");
18818         }
18819     }
18820     }
18821     function_tests++;
18822 #endif
18823
18824     return(test_ret);
18825 }
18826
18827
18828 static int
18829 test_xmlAddSibling(void) {
18830     int test_ret = 0;
18831
18832     int mem_base;
18833     xmlNodePtr ret_val;
18834     xmlNodePtr cur; /* the child node */
18835     int n_cur;
18836     xmlNodePtr elem; /* the new node */
18837     int n_elem;
18838
18839     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18840     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18841         mem_base = xmlMemBlocks();
18842         cur = gen_xmlNodePtr(n_cur, 0);
18843         elem = gen_xmlNodePtr_in(n_elem, 1);
18844
18845         ret_val = xmlAddSibling(cur, elem);
18846         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18847         desret_xmlNodePtr(ret_val);
18848         call_tests++;
18849         des_xmlNodePtr(n_cur, cur, 0);
18850         des_xmlNodePtr_in(n_elem, elem, 1);
18851         xmlResetLastError();
18852         if (mem_base != xmlMemBlocks()) {
18853             printf("Leak of %d blocks found in xmlAddSibling",
18854                    xmlMemBlocks() - mem_base);
18855             test_ret++;
18856             printf(" %d", n_cur);
18857             printf(" %d", n_elem);
18858             printf("\n");
18859         }
18860     }
18861     }
18862     function_tests++;
18863
18864     return(test_ret);
18865 }
18866
18867
18868 static int
18869 test_xmlAttrSerializeTxtContent(void) {
18870     int test_ret = 0;
18871
18872 #if defined(LIBXML_OUTPUT_ENABLED)
18873 #ifdef LIBXML_OUTPUT_ENABLED
18874     int mem_base;
18875     xmlBufferPtr buf; /* the XML buffer output */
18876     int n_buf;
18877     xmlDocPtr doc; /* the document */
18878     int n_doc;
18879     xmlAttrPtr attr; /* the attribute node */
18880     int n_attr;
18881     xmlChar * string; /* the text content */
18882     int n_string;
18883
18884     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18885     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18886     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18887     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18888         mem_base = xmlMemBlocks();
18889         buf = gen_xmlBufferPtr(n_buf, 0);
18890         doc = gen_xmlDocPtr(n_doc, 1);
18891         attr = gen_xmlAttrPtr(n_attr, 2);
18892         string = gen_const_xmlChar_ptr(n_string, 3);
18893
18894         xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18895         call_tests++;
18896         des_xmlBufferPtr(n_buf, buf, 0);
18897         des_xmlDocPtr(n_doc, doc, 1);
18898         des_xmlAttrPtr(n_attr, attr, 2);
18899         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18900         xmlResetLastError();
18901         if (mem_base != xmlMemBlocks()) {
18902             printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18903                    xmlMemBlocks() - mem_base);
18904             test_ret++;
18905             printf(" %d", n_buf);
18906             printf(" %d", n_doc);
18907             printf(" %d", n_attr);
18908             printf(" %d", n_string);
18909             printf("\n");
18910         }
18911     }
18912     }
18913     }
18914     }
18915     function_tests++;
18916 #endif
18917 #endif
18918
18919     return(test_ret);
18920 }
18921
18922
18923 #define gen_nb_const_xmlBuf_ptr 1
18924 static xmlBuf * gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18925     return(NULL);
18926 }
18927 static void des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, const xmlBuf * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18928 }
18929
18930 static int
18931 test_xmlBufContent(void) {
18932     int test_ret = 0;
18933
18934     int mem_base;
18935     xmlChar * ret_val;
18936     xmlBuf * buf; /* the buffer */
18937     int n_buf;
18938
18939     for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
18940         mem_base = xmlMemBlocks();
18941         buf = gen_const_xmlBuf_ptr(n_buf, 0);
18942
18943         ret_val = xmlBufContent((const xmlBuf *)buf);
18944         desret_xmlChar_ptr(ret_val);
18945         call_tests++;
18946         des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0);
18947         xmlResetLastError();
18948         if (mem_base != xmlMemBlocks()) {
18949             printf("Leak of %d blocks found in xmlBufContent",
18950                    xmlMemBlocks() - mem_base);
18951             test_ret++;
18952             printf(" %d", n_buf);
18953             printf("\n");
18954         }
18955     }
18956     function_tests++;
18957
18958     return(test_ret);
18959 }
18960
18961
18962 #define gen_nb_xmlBufPtr 1
18963 static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18964     return(NULL);
18965 }
18966 static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18967 }
18968
18969 static int
18970 test_xmlBufEnd(void) {
18971     int test_ret = 0;
18972
18973     int mem_base;
18974     xmlChar * ret_val;
18975     xmlBufPtr buf; /* the buffer */
18976     int n_buf;
18977
18978     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
18979         mem_base = xmlMemBlocks();
18980         buf = gen_xmlBufPtr(n_buf, 0);
18981
18982         ret_val = xmlBufEnd(buf);
18983         desret_xmlChar_ptr(ret_val);
18984         call_tests++;
18985         des_xmlBufPtr(n_buf, buf, 0);
18986         xmlResetLastError();
18987         if (mem_base != xmlMemBlocks()) {
18988             printf("Leak of %d blocks found in xmlBufEnd",
18989                    xmlMemBlocks() - mem_base);
18990             test_ret++;
18991             printf(" %d", n_buf);
18992             printf("\n");
18993         }
18994     }
18995     function_tests++;
18996
18997     return(test_ret);
18998 }
18999
19000
19001 #define gen_nb_const_xmlNode_ptr 1
19002 static xmlNode * gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19003     return(NULL);
19004 }
19005 static void des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, const xmlNode * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19006 }
19007
19008 static int
19009 test_xmlBufGetNodeContent(void) {
19010     int test_ret = 0;
19011
19012     int mem_base;
19013     int ret_val;
19014     xmlBufPtr buf; /* a buffer xmlBufPtr */
19015     int n_buf;
19016     xmlNode * cur; /* the node being read */
19017     int n_cur;
19018
19019     for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
19020     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
19021         mem_base = xmlMemBlocks();
19022         buf = gen_xmlBufPtr(n_buf, 0);
19023         cur = gen_const_xmlNode_ptr(n_cur, 1);
19024
19025         ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur);
19026         desret_int(ret_val);
19027         call_tests++;
19028         des_xmlBufPtr(n_buf, buf, 0);
19029         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
19030         xmlResetLastError();
19031         if (mem_base != xmlMemBlocks()) {
19032             printf("Leak of %d blocks found in xmlBufGetNodeContent",
19033                    xmlMemBlocks() - mem_base);
19034             test_ret++;
19035             printf(" %d", n_buf);
19036             printf(" %d", n_cur);
19037             printf("\n");
19038         }
19039     }
19040     }
19041     function_tests++;
19042
19043     return(test_ret);
19044 }
19045
19046
19047 static int
19048 test_xmlBufNodeDump(void) {
19049     int test_ret = 0;
19050
19051
19052     /* missing type support */
19053     return(test_ret);
19054 }
19055
19056
19057 static int
19058 test_xmlBufShrink(void) {
19059     int test_ret = 0;
19060
19061
19062     /* missing type support */
19063     return(test_ret);
19064 }
19065
19066
19067 #define gen_nb_const_xmlBufPtr 1
19068 static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19069     return(NULL);
19070 }
19071 static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19072 }
19073
19074 static int
19075 test_xmlBufUse(void) {
19076     int test_ret = 0;
19077
19078
19079     /* missing type support */
19080     return(test_ret);
19081 }
19082
19083
19084 static int
19085 test_xmlBufferAdd(void) {
19086     int test_ret = 0;
19087
19088     int mem_base;
19089     int ret_val;
19090     xmlBufferPtr buf; /* the buffer to dump */
19091     int n_buf;
19092     xmlChar * str; /* the #xmlChar string */
19093     int n_str;
19094     int len; /* the number of #xmlChar to add */
19095     int n_len;
19096
19097     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19098     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
19099     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19100         mem_base = xmlMemBlocks();
19101         buf = gen_xmlBufferPtr(n_buf, 0);
19102         str = gen_const_xmlChar_ptr(n_str, 1);
19103         len = gen_int(n_len, 2);
19104         if ((str != NULL) &&
19105             (len > (int) strlen((const char *) str) + 1))
19106             continue;
19107
19108         ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
19109         desret_int(ret_val);
19110         call_tests++;
19111         des_xmlBufferPtr(n_buf, buf, 0);
19112         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
19113         des_int(n_len, len, 2);
19114         xmlResetLastError();
19115         if (mem_base != xmlMemBlocks()) {
19116             printf("Leak of %d blocks found in xmlBufferAdd",
19117                    xmlMemBlocks() - mem_base);
19118             test_ret++;
19119             printf(" %d", n_buf);
19120             printf(" %d", n_str);
19121             printf(" %d", n_len);
19122             printf("\n");
19123         }
19124     }
19125     }
19126     }
19127     function_tests++;
19128
19129     return(test_ret);
19130 }
19131
19132
19133 static int
19134 test_xmlBufferAddHead(void) {
19135     int test_ret = 0;
19136
19137     int mem_base;
19138     int ret_val;
19139     xmlBufferPtr buf; /* the buffer */
19140     int n_buf;
19141     xmlChar * str; /* the #xmlChar string */
19142     int n_str;
19143     int len; /* the number of #xmlChar to add */
19144     int n_len;
19145
19146     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19147     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
19148     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19149         mem_base = xmlMemBlocks();
19150         buf = gen_xmlBufferPtr(n_buf, 0);
19151         str = gen_const_xmlChar_ptr(n_str, 1);
19152         len = gen_int(n_len, 2);
19153         if ((str != NULL) &&
19154             (len > (int) strlen((const char *) str) + 1))
19155             continue;
19156
19157         ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
19158         desret_int(ret_val);
19159         call_tests++;
19160         des_xmlBufferPtr(n_buf, buf, 0);
19161         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
19162         des_int(n_len, len, 2);
19163         xmlResetLastError();
19164         if (mem_base != xmlMemBlocks()) {
19165             printf("Leak of %d blocks found in xmlBufferAddHead",
19166                    xmlMemBlocks() - mem_base);
19167             test_ret++;
19168             printf(" %d", n_buf);
19169             printf(" %d", n_str);
19170             printf(" %d", n_len);
19171             printf("\n");
19172         }
19173     }
19174     }
19175     }
19176     function_tests++;
19177
19178     return(test_ret);
19179 }
19180
19181
19182 static int
19183 test_xmlBufferCCat(void) {
19184     int test_ret = 0;
19185
19186     int mem_base;
19187     int ret_val;
19188     xmlBufferPtr buf; /* the buffer to dump */
19189     int n_buf;
19190     char * str; /* the C char string */
19191     int n_str;
19192
19193     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19194     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
19195         mem_base = xmlMemBlocks();
19196         buf = gen_xmlBufferPtr(n_buf, 0);
19197         str = gen_const_char_ptr(n_str, 1);
19198
19199         ret_val = xmlBufferCCat(buf, (const char *)str);
19200         desret_int(ret_val);
19201         call_tests++;
19202         des_xmlBufferPtr(n_buf, buf, 0);
19203         des_const_char_ptr(n_str, (const char *)str, 1);
19204         xmlResetLastError();
19205         if (mem_base != xmlMemBlocks()) {
19206             printf("Leak of %d blocks found in xmlBufferCCat",
19207                    xmlMemBlocks() - mem_base);
19208             test_ret++;
19209             printf(" %d", n_buf);
19210             printf(" %d", n_str);
19211             printf("\n");
19212         }
19213     }
19214     }
19215     function_tests++;
19216
19217     return(test_ret);
19218 }
19219
19220
19221 static int
19222 test_xmlBufferCat(void) {
19223     int test_ret = 0;
19224
19225     int mem_base;
19226     int ret_val;
19227     xmlBufferPtr buf; /* the buffer to add to */
19228     int n_buf;
19229     xmlChar * str; /* the #xmlChar string */
19230     int n_str;
19231
19232     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19233     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
19234         mem_base = xmlMemBlocks();
19235         buf = gen_xmlBufferPtr(n_buf, 0);
19236         str = gen_const_xmlChar_ptr(n_str, 1);
19237
19238         ret_val = xmlBufferCat(buf, (const xmlChar *)str);
19239         desret_int(ret_val);
19240         call_tests++;
19241         des_xmlBufferPtr(n_buf, buf, 0);
19242         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
19243         xmlResetLastError();
19244         if (mem_base != xmlMemBlocks()) {
19245             printf("Leak of %d blocks found in xmlBufferCat",
19246                    xmlMemBlocks() - mem_base);
19247             test_ret++;
19248             printf(" %d", n_buf);
19249             printf(" %d", n_str);
19250             printf("\n");
19251         }
19252     }
19253     }
19254     function_tests++;
19255
19256     return(test_ret);
19257 }
19258
19259
19260 #define gen_nb_const_xmlBuffer_ptr 1
19261 static xmlBuffer * gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19262     return(NULL);
19263 }
19264 static void des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, const xmlBuffer * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19265 }
19266
19267 static int
19268 test_xmlBufferContent(void) {
19269     int test_ret = 0;
19270
19271     int mem_base;
19272     const xmlChar * ret_val;
19273     xmlBuffer * buf; /* the buffer */
19274     int n_buf;
19275
19276     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
19277         mem_base = xmlMemBlocks();
19278         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
19279
19280         ret_val = xmlBufferContent((const xmlBuffer *)buf);
19281         desret_const_xmlChar_ptr(ret_val);
19282         call_tests++;
19283         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
19284         xmlResetLastError();
19285         if (mem_base != xmlMemBlocks()) {
19286             printf("Leak of %d blocks found in xmlBufferContent",
19287                    xmlMemBlocks() - mem_base);
19288             test_ret++;
19289             printf(" %d", n_buf);
19290             printf("\n");
19291         }
19292     }
19293     function_tests++;
19294
19295     return(test_ret);
19296 }
19297
19298
19299 static int
19300 test_xmlBufferCreate(void) {
19301     int test_ret = 0;
19302
19303     int mem_base;
19304     xmlBufferPtr ret_val;
19305
19306         mem_base = xmlMemBlocks();
19307
19308         ret_val = xmlBufferCreate();
19309         desret_xmlBufferPtr(ret_val);
19310         call_tests++;
19311         xmlResetLastError();
19312         if (mem_base != xmlMemBlocks()) {
19313             printf("Leak of %d blocks found in xmlBufferCreate",
19314                    xmlMemBlocks() - mem_base);
19315             test_ret++;
19316             printf("\n");
19317         }
19318     function_tests++;
19319
19320     return(test_ret);
19321 }
19322
19323
19324 static int
19325 test_xmlBufferCreateSize(void) {
19326     int test_ret = 0;
19327
19328
19329     /* missing type support */
19330     return(test_ret);
19331 }
19332
19333
19334 static int
19335 test_xmlBufferCreateStatic(void) {
19336     int test_ret = 0;
19337
19338
19339     /* missing type support */
19340     return(test_ret);
19341 }
19342
19343
19344 static int
19345 test_xmlBufferDetach(void) {
19346     int test_ret = 0;
19347
19348     int mem_base;
19349     xmlChar * ret_val;
19350     xmlBufferPtr buf; /* the buffer */
19351     int n_buf;
19352
19353     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19354         mem_base = xmlMemBlocks();
19355         buf = gen_xmlBufferPtr(n_buf, 0);
19356
19357         ret_val = xmlBufferDetach(buf);
19358         desret_xmlChar_ptr(ret_val);
19359         call_tests++;
19360         des_xmlBufferPtr(n_buf, buf, 0);
19361         xmlResetLastError();
19362         if (mem_base != xmlMemBlocks()) {
19363             printf("Leak of %d blocks found in xmlBufferDetach",
19364                    xmlMemBlocks() - mem_base);
19365             test_ret++;
19366             printf(" %d", n_buf);
19367             printf("\n");
19368         }
19369     }
19370     function_tests++;
19371
19372     return(test_ret);
19373 }
19374
19375
19376 static int
19377 test_xmlBufferEmpty(void) {
19378     int test_ret = 0;
19379
19380     int mem_base;
19381     xmlBufferPtr buf; /* the buffer */
19382     int n_buf;
19383
19384     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19385         mem_base = xmlMemBlocks();
19386         buf = gen_xmlBufferPtr(n_buf, 0);
19387
19388         xmlBufferEmpty(buf);
19389         call_tests++;
19390         des_xmlBufferPtr(n_buf, buf, 0);
19391         xmlResetLastError();
19392         if (mem_base != xmlMemBlocks()) {
19393             printf("Leak of %d blocks found in xmlBufferEmpty",
19394                    xmlMemBlocks() - mem_base);
19395             test_ret++;
19396             printf(" %d", n_buf);
19397             printf("\n");
19398         }
19399     }
19400     function_tests++;
19401
19402     return(test_ret);
19403 }
19404
19405
19406 static int
19407 test_xmlBufferGrow(void) {
19408     int test_ret = 0;
19409
19410     int mem_base;
19411     int ret_val;
19412     xmlBufferPtr buf; /* the buffer */
19413     int n_buf;
19414     unsigned int len; /* the minimum free size to allocate */
19415     int n_len;
19416
19417     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19418     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19419         mem_base = xmlMemBlocks();
19420         buf = gen_xmlBufferPtr(n_buf, 0);
19421         len = gen_unsigned_int(n_len, 1);
19422
19423         ret_val = xmlBufferGrow(buf, len);
19424         desret_int(ret_val);
19425         call_tests++;
19426         des_xmlBufferPtr(n_buf, buf, 0);
19427         des_unsigned_int(n_len, len, 1);
19428         xmlResetLastError();
19429         if (mem_base != xmlMemBlocks()) {
19430             printf("Leak of %d blocks found in xmlBufferGrow",
19431                    xmlMemBlocks() - mem_base);
19432             test_ret++;
19433             printf(" %d", n_buf);
19434             printf(" %d", n_len);
19435             printf("\n");
19436         }
19437     }
19438     }
19439     function_tests++;
19440
19441     return(test_ret);
19442 }
19443
19444
19445 static int
19446 test_xmlBufferLength(void) {
19447     int test_ret = 0;
19448
19449     int mem_base;
19450     int ret_val;
19451     xmlBuffer * buf; /* the buffer */
19452     int n_buf;
19453
19454     for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
19455         mem_base = xmlMemBlocks();
19456         buf = gen_const_xmlBuffer_ptr(n_buf, 0);
19457
19458         ret_val = xmlBufferLength((const xmlBuffer *)buf);
19459         desret_int(ret_val);
19460         call_tests++;
19461         des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
19462         xmlResetLastError();
19463         if (mem_base != xmlMemBlocks()) {
19464             printf("Leak of %d blocks found in xmlBufferLength",
19465                    xmlMemBlocks() - mem_base);
19466             test_ret++;
19467             printf(" %d", n_buf);
19468             printf("\n");
19469         }
19470     }
19471     function_tests++;
19472
19473     return(test_ret);
19474 }
19475
19476
19477 static int
19478 test_xmlBufferResize(void) {
19479     int test_ret = 0;
19480
19481     int mem_base;
19482     int ret_val;
19483     xmlBufferPtr buf; /* the buffer to resize */
19484     int n_buf;
19485     unsigned int size; /* the desired size */
19486     int n_size;
19487
19488     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19489     for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
19490         mem_base = xmlMemBlocks();
19491         buf = gen_xmlBufferPtr(n_buf, 0);
19492         size = gen_unsigned_int(n_size, 1);
19493
19494         ret_val = xmlBufferResize(buf, size);
19495         desret_int(ret_val);
19496         call_tests++;
19497         des_xmlBufferPtr(n_buf, buf, 0);
19498         des_unsigned_int(n_size, size, 1);
19499         xmlResetLastError();
19500         if (mem_base != xmlMemBlocks()) {
19501             printf("Leak of %d blocks found in xmlBufferResize",
19502                    xmlMemBlocks() - mem_base);
19503             test_ret++;
19504             printf(" %d", n_buf);
19505             printf(" %d", n_size);
19506             printf("\n");
19507         }
19508     }
19509     }
19510     function_tests++;
19511
19512     return(test_ret);
19513 }
19514
19515
19516 static int
19517 test_xmlBufferSetAllocationScheme(void) {
19518     int test_ret = 0;
19519
19520     int mem_base;
19521     xmlBufferPtr buf; /* the buffer to tune */
19522     int n_buf;
19523     xmlBufferAllocationScheme scheme; /* allocation scheme to use */
19524     int n_scheme;
19525
19526     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19527     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
19528         mem_base = xmlMemBlocks();
19529         buf = gen_xmlBufferPtr(n_buf, 0);
19530         scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
19531
19532         xmlBufferSetAllocationScheme(buf, scheme);
19533         if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
19534         call_tests++;
19535         des_xmlBufferPtr(n_buf, buf, 0);
19536         des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
19537         xmlResetLastError();
19538         if (mem_base != xmlMemBlocks()) {
19539             printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
19540                    xmlMemBlocks() - mem_base);
19541             test_ret++;
19542             printf(" %d", n_buf);
19543             printf(" %d", n_scheme);
19544             printf("\n");
19545         }
19546     }
19547     }
19548     function_tests++;
19549
19550     return(test_ret);
19551 }
19552
19553
19554 static int
19555 test_xmlBufferShrink(void) {
19556     int test_ret = 0;
19557
19558     int mem_base;
19559     int ret_val;
19560     xmlBufferPtr buf; /* the buffer to dump */
19561     int n_buf;
19562     unsigned int len; /* the number of xmlChar to remove */
19563     int n_len;
19564
19565     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19566     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
19567         mem_base = xmlMemBlocks();
19568         buf = gen_xmlBufferPtr(n_buf, 0);
19569         len = gen_unsigned_int(n_len, 1);
19570
19571         ret_val = xmlBufferShrink(buf, len);
19572         desret_int(ret_val);
19573         call_tests++;
19574         des_xmlBufferPtr(n_buf, buf, 0);
19575         des_unsigned_int(n_len, len, 1);
19576         xmlResetLastError();
19577         if (mem_base != xmlMemBlocks()) {
19578             printf("Leak of %d blocks found in xmlBufferShrink",
19579                    xmlMemBlocks() - mem_base);
19580             test_ret++;
19581             printf(" %d", n_buf);
19582             printf(" %d", n_len);
19583             printf("\n");
19584         }
19585     }
19586     }
19587     function_tests++;
19588
19589     return(test_ret);
19590 }
19591
19592
19593 static int
19594 test_xmlBufferWriteCHAR(void) {
19595     int test_ret = 0;
19596
19597     int mem_base;
19598     xmlBufferPtr buf; /* the XML buffer */
19599     int n_buf;
19600     xmlChar * string; /* the string to add */
19601     int n_string;
19602
19603     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19604     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19605         mem_base = xmlMemBlocks();
19606         buf = gen_xmlBufferPtr(n_buf, 0);
19607         string = gen_const_xmlChar_ptr(n_string, 1);
19608
19609         xmlBufferWriteCHAR(buf, (const xmlChar *)string);
19610         call_tests++;
19611         des_xmlBufferPtr(n_buf, buf, 0);
19612         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19613         xmlResetLastError();
19614         if (mem_base != xmlMemBlocks()) {
19615             printf("Leak of %d blocks found in xmlBufferWriteCHAR",
19616                    xmlMemBlocks() - mem_base);
19617             test_ret++;
19618             printf(" %d", n_buf);
19619             printf(" %d", n_string);
19620             printf("\n");
19621         }
19622     }
19623     }
19624     function_tests++;
19625
19626     return(test_ret);
19627 }
19628
19629
19630 static int
19631 test_xmlBufferWriteChar(void) {
19632     int test_ret = 0;
19633
19634     int mem_base;
19635     xmlBufferPtr buf; /* the XML buffer output */
19636     int n_buf;
19637     char * string; /* the string to add */
19638     int n_string;
19639
19640     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19641     for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
19642         mem_base = xmlMemBlocks();
19643         buf = gen_xmlBufferPtr(n_buf, 0);
19644         string = gen_const_char_ptr(n_string, 1);
19645
19646         xmlBufferWriteChar(buf, (const char *)string);
19647         call_tests++;
19648         des_xmlBufferPtr(n_buf, buf, 0);
19649         des_const_char_ptr(n_string, (const char *)string, 1);
19650         xmlResetLastError();
19651         if (mem_base != xmlMemBlocks()) {
19652             printf("Leak of %d blocks found in xmlBufferWriteChar",
19653                    xmlMemBlocks() - mem_base);
19654             test_ret++;
19655             printf(" %d", n_buf);
19656             printf(" %d", n_string);
19657             printf("\n");
19658         }
19659     }
19660     }
19661     function_tests++;
19662
19663     return(test_ret);
19664 }
19665
19666
19667 static int
19668 test_xmlBufferWriteQuotedString(void) {
19669     int test_ret = 0;
19670
19671     int mem_base;
19672     xmlBufferPtr buf; /* the XML buffer output */
19673     int n_buf;
19674     xmlChar * string; /* the string to add */
19675     int n_string;
19676
19677     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
19678     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
19679         mem_base = xmlMemBlocks();
19680         buf = gen_xmlBufferPtr(n_buf, 0);
19681         string = gen_const_xmlChar_ptr(n_string, 1);
19682
19683         xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
19684         call_tests++;
19685         des_xmlBufferPtr(n_buf, buf, 0);
19686         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
19687         xmlResetLastError();
19688         if (mem_base != xmlMemBlocks()) {
19689             printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
19690                    xmlMemBlocks() - mem_base);
19691             test_ret++;
19692             printf(" %d", n_buf);
19693             printf(" %d", n_string);
19694             printf("\n");
19695         }
19696     }
19697     }
19698     function_tests++;
19699
19700     return(test_ret);
19701 }
19702
19703
19704 static int
19705 test_xmlBuildQName(void) {
19706     int test_ret = 0;
19707
19708     int mem_base;
19709     xmlChar * ret_val;
19710     xmlChar * ncname; /* the Name */
19711     int n_ncname;
19712     xmlChar * prefix; /* the prefix */
19713     int n_prefix;
19714     xmlChar * memory; /* preallocated memory */
19715     int n_memory;
19716     int len; /* preallocated memory length */
19717     int n_len;
19718
19719     for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19720     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19721     for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19722     for (n_len = 0;n_len < gen_nb_int;n_len++) {
19723         mem_base = xmlMemBlocks();
19724         ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19725         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19726         memory = gen_xmlChar_ptr(n_memory, 2);
19727         len = gen_int(n_len, 3);
19728         if ((prefix != NULL) &&
19729             (len > (int) strlen((const char *) prefix) + 1))
19730             continue;
19731
19732         ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19733         if ((ret_val != NULL) && (ret_val != ncname) &&
19734               (ret_val != prefix) && (ret_val != memory))
19735               xmlFree(ret_val);
19736           ret_val = NULL;
19737         desret_xmlChar_ptr(ret_val);
19738         call_tests++;
19739         des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19740         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19741         des_xmlChar_ptr(n_memory, memory, 2);
19742         des_int(n_len, len, 3);
19743         xmlResetLastError();
19744         if (mem_base != xmlMemBlocks()) {
19745             printf("Leak of %d blocks found in xmlBuildQName",
19746                    xmlMemBlocks() - mem_base);
19747             test_ret++;
19748             printf(" %d", n_ncname);
19749             printf(" %d", n_prefix);
19750             printf(" %d", n_memory);
19751             printf(" %d", n_len);
19752             printf("\n");
19753         }
19754     }
19755     }
19756     }
19757     }
19758     function_tests++;
19759
19760     return(test_ret);
19761 }
19762
19763
19764 static int
19765 test_xmlChildElementCount(void) {
19766     int test_ret = 0;
19767
19768 #if defined(LIBXML_TREE_ENABLED)
19769     int mem_base;
19770     unsigned long ret_val;
19771     xmlNodePtr parent; /* the parent node */
19772     int n_parent;
19773
19774     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19775         mem_base = xmlMemBlocks();
19776         parent = gen_xmlNodePtr(n_parent, 0);
19777
19778         ret_val = xmlChildElementCount(parent);
19779         desret_unsigned_long(ret_val);
19780         call_tests++;
19781         des_xmlNodePtr(n_parent, parent, 0);
19782         xmlResetLastError();
19783         if (mem_base != xmlMemBlocks()) {
19784             printf("Leak of %d blocks found in xmlChildElementCount",
19785                    xmlMemBlocks() - mem_base);
19786             test_ret++;
19787             printf(" %d", n_parent);
19788             printf("\n");
19789         }
19790     }
19791     function_tests++;
19792 #endif
19793
19794     return(test_ret);
19795 }
19796
19797
19798 static int
19799 test_xmlCopyDoc(void) {
19800     int test_ret = 0;
19801
19802 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19803     int mem_base;
19804     xmlDocPtr ret_val;
19805     xmlDocPtr doc; /* the document */
19806     int n_doc;
19807     int recursive; /* if not zero do a recursive copy. */
19808     int n_recursive;
19809
19810     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19811     for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19812         mem_base = xmlMemBlocks();
19813         doc = gen_xmlDocPtr(n_doc, 0);
19814         recursive = gen_int(n_recursive, 1);
19815
19816         ret_val = xmlCopyDoc(doc, recursive);
19817         desret_xmlDocPtr(ret_val);
19818         call_tests++;
19819         des_xmlDocPtr(n_doc, doc, 0);
19820         des_int(n_recursive, recursive, 1);
19821         xmlResetLastError();
19822         if (mem_base != xmlMemBlocks()) {
19823             printf("Leak of %d blocks found in xmlCopyDoc",
19824                    xmlMemBlocks() - mem_base);
19825             test_ret++;
19826             printf(" %d", n_doc);
19827             printf(" %d", n_recursive);
19828             printf("\n");
19829         }
19830     }
19831     }
19832     function_tests++;
19833 #endif
19834
19835     return(test_ret);
19836 }
19837
19838
19839 static int
19840 test_xmlCopyDtd(void) {
19841     int test_ret = 0;
19842
19843 #if defined(LIBXML_TREE_ENABLED)
19844     int mem_base;
19845     xmlDtdPtr ret_val;
19846     xmlDtdPtr dtd; /* the dtd */
19847     int n_dtd;
19848
19849     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19850         mem_base = xmlMemBlocks();
19851         dtd = gen_xmlDtdPtr(n_dtd, 0);
19852
19853         ret_val = xmlCopyDtd(dtd);
19854         desret_xmlDtdPtr(ret_val);
19855         call_tests++;
19856         des_xmlDtdPtr(n_dtd, dtd, 0);
19857         xmlResetLastError();
19858         if (mem_base != xmlMemBlocks()) {
19859             printf("Leak of %d blocks found in xmlCopyDtd",
19860                    xmlMemBlocks() - mem_base);
19861             test_ret++;
19862             printf(" %d", n_dtd);
19863             printf("\n");
19864         }
19865     }
19866     function_tests++;
19867 #endif
19868
19869     return(test_ret);
19870 }
19871
19872
19873 static int
19874 test_xmlCopyNamespace(void) {
19875     int test_ret = 0;
19876
19877     int mem_base;
19878     xmlNsPtr ret_val;
19879     xmlNsPtr cur; /* the namespace */
19880     int n_cur;
19881
19882     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19883         mem_base = xmlMemBlocks();
19884         cur = gen_xmlNsPtr(n_cur, 0);
19885
19886         ret_val = xmlCopyNamespace(cur);
19887         if (ret_val != NULL) xmlFreeNs(ret_val);
19888         desret_xmlNsPtr(ret_val);
19889         call_tests++;
19890         des_xmlNsPtr(n_cur, cur, 0);
19891         xmlResetLastError();
19892         if (mem_base != xmlMemBlocks()) {
19893             printf("Leak of %d blocks found in xmlCopyNamespace",
19894                    xmlMemBlocks() - mem_base);
19895             test_ret++;
19896             printf(" %d", n_cur);
19897             printf("\n");
19898         }
19899     }
19900     function_tests++;
19901
19902     return(test_ret);
19903 }
19904
19905
19906 static int
19907 test_xmlCopyNamespaceList(void) {
19908     int test_ret = 0;
19909
19910     int mem_base;
19911     xmlNsPtr ret_val;
19912     xmlNsPtr cur; /* the first namespace */
19913     int n_cur;
19914
19915     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19916         mem_base = xmlMemBlocks();
19917         cur = gen_xmlNsPtr(n_cur, 0);
19918
19919         ret_val = xmlCopyNamespaceList(cur);
19920         if (ret_val != NULL) xmlFreeNsList(ret_val);
19921         desret_xmlNsPtr(ret_val);
19922         call_tests++;
19923         des_xmlNsPtr(n_cur, cur, 0);
19924         xmlResetLastError();
19925         if (mem_base != xmlMemBlocks()) {
19926             printf("Leak of %d blocks found in xmlCopyNamespaceList",
19927                    xmlMemBlocks() - mem_base);
19928             test_ret++;
19929             printf(" %d", n_cur);
19930             printf("\n");
19931         }
19932     }
19933     function_tests++;
19934
19935     return(test_ret);
19936 }
19937
19938
19939 static int
19940 test_xmlCopyNode(void) {
19941     int test_ret = 0;
19942
19943     int mem_base;
19944     xmlNodePtr ret_val;
19945     xmlNodePtr node; /* the node */
19946     int n_node;
19947     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19948     int n_extended;
19949
19950     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19951     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19952         mem_base = xmlMemBlocks();
19953         node = gen_xmlNodePtr(n_node, 0);
19954         extended = gen_int(n_extended, 1);
19955
19956         ret_val = xmlCopyNode(node, extended);
19957         desret_xmlNodePtr(ret_val);
19958         call_tests++;
19959         des_xmlNodePtr(n_node, node, 0);
19960         des_int(n_extended, extended, 1);
19961         xmlResetLastError();
19962         if (mem_base != xmlMemBlocks()) {
19963             printf("Leak of %d blocks found in xmlCopyNode",
19964                    xmlMemBlocks() - mem_base);
19965             test_ret++;
19966             printf(" %d", n_node);
19967             printf(" %d", n_extended);
19968             printf("\n");
19969         }
19970     }
19971     }
19972     function_tests++;
19973
19974     return(test_ret);
19975 }
19976
19977
19978 static int
19979 test_xmlCopyNodeList(void) {
19980     int test_ret = 0;
19981
19982     int mem_base;
19983     xmlNodePtr ret_val;
19984     xmlNodePtr node; /* the first node in the list. */
19985     int n_node;
19986
19987     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19988         mem_base = xmlMemBlocks();
19989         node = gen_xmlNodePtr(n_node, 0);
19990
19991         ret_val = xmlCopyNodeList(node);
19992         desret_xmlNodePtr(ret_val);
19993         call_tests++;
19994         des_xmlNodePtr(n_node, node, 0);
19995         xmlResetLastError();
19996         if (mem_base != xmlMemBlocks()) {
19997             printf("Leak of %d blocks found in xmlCopyNodeList",
19998                    xmlMemBlocks() - mem_base);
19999             test_ret++;
20000             printf(" %d", n_node);
20001             printf("\n");
20002         }
20003     }
20004     function_tests++;
20005
20006     return(test_ret);
20007 }
20008
20009
20010 static int
20011 test_xmlCopyProp(void) {
20012     int test_ret = 0;
20013
20014     int mem_base;
20015     xmlAttrPtr ret_val;
20016     xmlNodePtr target; /* the element where the attribute will be grafted */
20017     int n_target;
20018     xmlAttrPtr cur; /* the attribute */
20019     int n_cur;
20020
20021     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
20022     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
20023         mem_base = xmlMemBlocks();
20024         target = gen_xmlNodePtr(n_target, 0);
20025         cur = gen_xmlAttrPtr(n_cur, 1);
20026
20027         ret_val = xmlCopyProp(target, cur);
20028         desret_xmlAttrPtr(ret_val);
20029         call_tests++;
20030         des_xmlNodePtr(n_target, target, 0);
20031         des_xmlAttrPtr(n_cur, cur, 1);
20032         xmlResetLastError();
20033         if (mem_base != xmlMemBlocks()) {
20034             printf("Leak of %d blocks found in xmlCopyProp",
20035                    xmlMemBlocks() - mem_base);
20036             test_ret++;
20037             printf(" %d", n_target);
20038             printf(" %d", n_cur);
20039             printf("\n");
20040         }
20041     }
20042     }
20043     function_tests++;
20044
20045     return(test_ret);
20046 }
20047
20048
20049 static int
20050 test_xmlCopyPropList(void) {
20051     int test_ret = 0;
20052
20053     int mem_base;
20054     xmlAttrPtr ret_val;
20055     xmlNodePtr target; /* the element where the attributes will be grafted */
20056     int n_target;
20057     xmlAttrPtr cur; /* the first attribute */
20058     int n_cur;
20059
20060     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
20061     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
20062         mem_base = xmlMemBlocks();
20063         target = gen_xmlNodePtr(n_target, 0);
20064         cur = gen_xmlAttrPtr(n_cur, 1);
20065
20066         ret_val = xmlCopyPropList(target, cur);
20067         desret_xmlAttrPtr(ret_val);
20068         call_tests++;
20069         des_xmlNodePtr(n_target, target, 0);
20070         des_xmlAttrPtr(n_cur, cur, 1);
20071         xmlResetLastError();
20072         if (mem_base != xmlMemBlocks()) {
20073             printf("Leak of %d blocks found in xmlCopyPropList",
20074                    xmlMemBlocks() - mem_base);
20075             test_ret++;
20076             printf(" %d", n_target);
20077             printf(" %d", n_cur);
20078             printf("\n");
20079         }
20080     }
20081     }
20082     function_tests++;
20083
20084     return(test_ret);
20085 }
20086
20087
20088 static int
20089 test_xmlCreateIntSubset(void) {
20090     int test_ret = 0;
20091
20092     int mem_base;
20093     xmlDtdPtr ret_val;
20094     xmlDocPtr doc; /* the document pointer */
20095     int n_doc;
20096     xmlChar * name; /* the DTD name */
20097     int n_name;
20098     xmlChar * ExternalID; /* the external (PUBLIC) ID */
20099     int n_ExternalID;
20100     xmlChar * SystemID; /* the system ID */
20101     int n_SystemID;
20102
20103     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20104     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20105     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
20106     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
20107         mem_base = xmlMemBlocks();
20108         doc = gen_xmlDocPtr(n_doc, 0);
20109         name = gen_const_xmlChar_ptr(n_name, 1);
20110         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
20111         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
20112
20113         ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
20114         desret_xmlDtdPtr(ret_val);
20115         call_tests++;
20116         des_xmlDocPtr(n_doc, doc, 0);
20117         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20118         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
20119         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
20120         xmlResetLastError();
20121         if (mem_base != xmlMemBlocks()) {
20122             printf("Leak of %d blocks found in xmlCreateIntSubset",
20123                    xmlMemBlocks() - mem_base);
20124             test_ret++;
20125             printf(" %d", n_doc);
20126             printf(" %d", n_name);
20127             printf(" %d", n_ExternalID);
20128             printf(" %d", n_SystemID);
20129             printf("\n");
20130         }
20131     }
20132     }
20133     }
20134     }
20135     function_tests++;
20136
20137     return(test_ret);
20138 }
20139
20140
20141 #define gen_nb_xmlDOMWrapCtxtPtr 1
20142 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
20143     return(NULL);
20144 }
20145 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
20146 }
20147
20148 static int
20149 test_xmlDOMWrapAdoptNode(void) {
20150     int test_ret = 0;
20151
20152     int mem_base;
20153     int ret_val;
20154     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
20155     int n_ctxt;
20156     xmlDocPtr sourceDoc; /* the optional sourceDoc */
20157     int n_sourceDoc;
20158     xmlNodePtr node; /* the node to start with */
20159     int n_node;
20160     xmlDocPtr destDoc; /* the destination doc */
20161     int n_destDoc;
20162     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
20163     int n_destParent;
20164     int options; /* option flags */
20165     int n_options;
20166
20167     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
20168     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
20169     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20170     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
20171     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
20172     for (n_options = 0;n_options < gen_nb_int;n_options++) {
20173         mem_base = xmlMemBlocks();
20174         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
20175         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
20176         node = gen_xmlNodePtr(n_node, 2);
20177         destDoc = gen_xmlDocPtr(n_destDoc, 3);
20178         destParent = gen_xmlNodePtr(n_destParent, 4);
20179         options = gen_int(n_options, 5);
20180
20181         ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
20182         if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
20183         desret_int(ret_val);
20184         call_tests++;
20185         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
20186         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
20187         des_xmlNodePtr(n_node, node, 2);
20188         des_xmlDocPtr(n_destDoc, destDoc, 3);
20189         des_xmlNodePtr(n_destParent, destParent, 4);
20190         des_int(n_options, options, 5);
20191         xmlResetLastError();
20192         if (mem_base != xmlMemBlocks()) {
20193             printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
20194                    xmlMemBlocks() - mem_base);
20195             test_ret++;
20196             printf(" %d", n_ctxt);
20197             printf(" %d", n_sourceDoc);
20198             printf(" %d", n_node);
20199             printf(" %d", n_destDoc);
20200             printf(" %d", n_destParent);
20201             printf(" %d", n_options);
20202             printf("\n");
20203         }
20204     }
20205     }
20206     }
20207     }
20208     }
20209     }
20210     function_tests++;
20211
20212     return(test_ret);
20213 }
20214
20215
20216 static int
20217 test_xmlDOMWrapCloneNode(void) {
20218     int test_ret = 0;
20219
20220     int mem_base;
20221     int ret_val;
20222     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
20223     int n_ctxt;
20224     xmlDocPtr sourceDoc; /* the optional sourceDoc */
20225     int n_sourceDoc;
20226     xmlNodePtr node; /* the node to start with */
20227     int n_node;
20228     xmlNodePtr * resNode; /* the clone of the given @node */
20229     int n_resNode;
20230     xmlDocPtr destDoc; /* the destination doc */
20231     int n_destDoc;
20232     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
20233     int n_destParent;
20234     int deep; /* descend into child if set */
20235     int n_deep;
20236     int options; /* option flags */
20237     int n_options;
20238
20239     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
20240     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
20241     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20242     for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
20243     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
20244     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
20245     for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
20246     for (n_options = 0;n_options < gen_nb_int;n_options++) {
20247         mem_base = xmlMemBlocks();
20248         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
20249         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
20250         node = gen_xmlNodePtr(n_node, 2);
20251         resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
20252         destDoc = gen_xmlDocPtr(n_destDoc, 4);
20253         destParent = gen_xmlNodePtr(n_destParent, 5);
20254         deep = gen_int(n_deep, 6);
20255         options = gen_int(n_options, 7);
20256
20257         ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
20258         desret_int(ret_val);
20259         call_tests++;
20260         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
20261         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
20262         des_xmlNodePtr(n_node, node, 2);
20263         des_xmlNodePtr_ptr(n_resNode, resNode, 3);
20264         des_xmlDocPtr(n_destDoc, destDoc, 4);
20265         des_xmlNodePtr(n_destParent, destParent, 5);
20266         des_int(n_deep, deep, 6);
20267         des_int(n_options, options, 7);
20268         xmlResetLastError();
20269         if (mem_base != xmlMemBlocks()) {
20270             printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
20271                    xmlMemBlocks() - mem_base);
20272             test_ret++;
20273             printf(" %d", n_ctxt);
20274             printf(" %d", n_sourceDoc);
20275             printf(" %d", n_node);
20276             printf(" %d", n_resNode);
20277             printf(" %d", n_destDoc);
20278             printf(" %d", n_destParent);
20279             printf(" %d", n_deep);
20280             printf(" %d", n_options);
20281             printf("\n");
20282         }
20283     }
20284     }
20285     }
20286     }
20287     }
20288     }
20289     }
20290     }
20291     function_tests++;
20292
20293     return(test_ret);
20294 }
20295
20296
20297 static int
20298 test_xmlDOMWrapNewCtxt(void) {
20299     int test_ret = 0;
20300
20301
20302     /* missing type support */
20303     return(test_ret);
20304 }
20305
20306
20307 static int
20308 test_xmlDOMWrapReconcileNamespaces(void) {
20309     int test_ret = 0;
20310
20311     int mem_base;
20312     int ret_val;
20313     xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
20314     int n_ctxt;
20315     xmlNodePtr elem; /* the element-node */
20316     int n_elem;
20317     int options; /* option flags */
20318     int n_options;
20319
20320     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
20321     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
20322     for (n_options = 0;n_options < gen_nb_int;n_options++) {
20323         mem_base = xmlMemBlocks();
20324         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
20325         elem = gen_xmlNodePtr(n_elem, 1);
20326         options = gen_int(n_options, 2);
20327
20328         ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
20329         desret_int(ret_val);
20330         call_tests++;
20331         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
20332         des_xmlNodePtr(n_elem, elem, 1);
20333         des_int(n_options, options, 2);
20334         xmlResetLastError();
20335         if (mem_base != xmlMemBlocks()) {
20336             printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
20337                    xmlMemBlocks() - mem_base);
20338             test_ret++;
20339             printf(" %d", n_ctxt);
20340             printf(" %d", n_elem);
20341             printf(" %d", n_options);
20342             printf("\n");
20343         }
20344     }
20345     }
20346     }
20347     function_tests++;
20348
20349     return(test_ret);
20350 }
20351
20352
20353 static int
20354 test_xmlDOMWrapRemoveNode(void) {
20355     int test_ret = 0;
20356
20357     int mem_base;
20358     int ret_val;
20359     xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
20360     int n_ctxt;
20361     xmlDocPtr doc; /* the doc */
20362     int n_doc;
20363     xmlNodePtr node; /* the node to be removed. */
20364     int n_node;
20365     int options; /* set of options, unused at the moment */
20366     int n_options;
20367
20368     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
20369     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20370     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20371     for (n_options = 0;n_options < gen_nb_int;n_options++) {
20372         mem_base = xmlMemBlocks();
20373         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
20374         doc = gen_xmlDocPtr(n_doc, 1);
20375         node = gen_xmlNodePtr(n_node, 2);
20376         options = gen_int(n_options, 3);
20377
20378         ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
20379         desret_int(ret_val);
20380         call_tests++;
20381         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
20382         des_xmlDocPtr(n_doc, doc, 1);
20383         des_xmlNodePtr(n_node, node, 2);
20384         des_int(n_options, options, 3);
20385         xmlResetLastError();
20386         if (mem_base != xmlMemBlocks()) {
20387             printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
20388                    xmlMemBlocks() - mem_base);
20389             test_ret++;
20390             printf(" %d", n_ctxt);
20391             printf(" %d", n_doc);
20392             printf(" %d", n_node);
20393             printf(" %d", n_options);
20394             printf("\n");
20395         }
20396     }
20397     }
20398     }
20399     }
20400     function_tests++;
20401
20402     return(test_ret);
20403 }
20404
20405
20406 static int
20407 test_xmlDocCopyNode(void) {
20408     int test_ret = 0;
20409
20410     int mem_base;
20411     xmlNodePtr ret_val;
20412     xmlNodePtr node; /* the node */
20413     int n_node;
20414     xmlDocPtr doc; /* the document */
20415     int n_doc;
20416     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
20417     int n_extended;
20418
20419     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20420     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20421     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
20422         mem_base = xmlMemBlocks();
20423         node = gen_xmlNodePtr(n_node, 0);
20424         doc = gen_xmlDocPtr(n_doc, 1);
20425         extended = gen_int(n_extended, 2);
20426
20427         ret_val = xmlDocCopyNode(node, doc, extended);
20428         desret_xmlNodePtr(ret_val);
20429         call_tests++;
20430         des_xmlNodePtr(n_node, node, 0);
20431         des_xmlDocPtr(n_doc, doc, 1);
20432         des_int(n_extended, extended, 2);
20433         xmlResetLastError();
20434         if (mem_base != xmlMemBlocks()) {
20435             printf("Leak of %d blocks found in xmlDocCopyNode",
20436                    xmlMemBlocks() - mem_base);
20437             test_ret++;
20438             printf(" %d", n_node);
20439             printf(" %d", n_doc);
20440             printf(" %d", n_extended);
20441             printf("\n");
20442         }
20443     }
20444     }
20445     }
20446     function_tests++;
20447
20448     return(test_ret);
20449 }
20450
20451
20452 static int
20453 test_xmlDocCopyNodeList(void) {
20454     int test_ret = 0;
20455
20456     int mem_base;
20457     xmlNodePtr ret_val;
20458     xmlDocPtr doc; /* the target document */
20459     int n_doc;
20460     xmlNodePtr node; /* the first node in the list. */
20461     int n_node;
20462
20463     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20464     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20465         mem_base = xmlMemBlocks();
20466         doc = gen_xmlDocPtr(n_doc, 0);
20467         node = gen_xmlNodePtr(n_node, 1);
20468
20469         ret_val = xmlDocCopyNodeList(doc, node);
20470         desret_xmlNodePtr(ret_val);
20471         call_tests++;
20472         des_xmlDocPtr(n_doc, doc, 0);
20473         des_xmlNodePtr(n_node, node, 1);
20474         xmlResetLastError();
20475         if (mem_base != xmlMemBlocks()) {
20476             printf("Leak of %d blocks found in xmlDocCopyNodeList",
20477                    xmlMemBlocks() - mem_base);
20478             test_ret++;
20479             printf(" %d", n_doc);
20480             printf(" %d", n_node);
20481             printf("\n");
20482         }
20483     }
20484     }
20485     function_tests++;
20486
20487     return(test_ret);
20488 }
20489
20490
20491 static int
20492 test_xmlDocDump(void) {
20493     int test_ret = 0;
20494
20495 #if defined(LIBXML_OUTPUT_ENABLED)
20496     int mem_base;
20497     int ret_val;
20498     FILE * f; /* the FILE* */
20499     int n_f;
20500     xmlDocPtr cur; /* the document */
20501     int n_cur;
20502
20503     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20504     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20505         mem_base = xmlMemBlocks();
20506         f = gen_FILE_ptr(n_f, 0);
20507         cur = gen_xmlDocPtr(n_cur, 1);
20508
20509         ret_val = xmlDocDump(f, cur);
20510         desret_int(ret_val);
20511         call_tests++;
20512         des_FILE_ptr(n_f, f, 0);
20513         des_xmlDocPtr(n_cur, cur, 1);
20514         xmlResetLastError();
20515         if (mem_base != xmlMemBlocks()) {
20516             printf("Leak of %d blocks found in xmlDocDump",
20517                    xmlMemBlocks() - mem_base);
20518             test_ret++;
20519             printf(" %d", n_f);
20520             printf(" %d", n_cur);
20521             printf("\n");
20522         }
20523     }
20524     }
20525     function_tests++;
20526 #endif
20527
20528     return(test_ret);
20529 }
20530
20531
20532 static int
20533 test_xmlDocDumpFormatMemory(void) {
20534     int test_ret = 0;
20535
20536 #if defined(LIBXML_OUTPUT_ENABLED)
20537     int mem_base;
20538     xmlDocPtr cur; /* the document */
20539     int n_cur;
20540     xmlChar ** mem; /* OUT: the memory pointer */
20541     int n_mem;
20542     int * size; /* OUT: the memory length */
20543     int n_size;
20544     int format; /* should formatting spaces been added */
20545     int n_format;
20546
20547     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20548     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20549     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20550     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20551         mem_base = xmlMemBlocks();
20552         cur = gen_xmlDocPtr(n_cur, 0);
20553         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20554         size = gen_int_ptr(n_size, 2);
20555         format = gen_int(n_format, 3);
20556
20557         xmlDocDumpFormatMemory(cur, mem, size, format);
20558         call_tests++;
20559         des_xmlDocPtr(n_cur, cur, 0);
20560         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20561         des_int_ptr(n_size, size, 2);
20562         des_int(n_format, format, 3);
20563         xmlResetLastError();
20564         if (mem_base != xmlMemBlocks()) {
20565             printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
20566                    xmlMemBlocks() - mem_base);
20567             test_ret++;
20568             printf(" %d", n_cur);
20569             printf(" %d", n_mem);
20570             printf(" %d", n_size);
20571             printf(" %d", n_format);
20572             printf("\n");
20573         }
20574     }
20575     }
20576     }
20577     }
20578     function_tests++;
20579 #endif
20580
20581     return(test_ret);
20582 }
20583
20584
20585 static int
20586 test_xmlDocDumpFormatMemoryEnc(void) {
20587     int test_ret = 0;
20588
20589 #if defined(LIBXML_OUTPUT_ENABLED)
20590     int mem_base;
20591     xmlDocPtr out_doc; /* Document to generate XML text from */
20592     int n_out_doc;
20593     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20594     int n_doc_txt_ptr;
20595     int * doc_txt_len; /* Length of the generated XML text */
20596     int n_doc_txt_len;
20597     char * txt_encoding; /* Character encoding to use when generating XML text */
20598     int n_txt_encoding;
20599     int format; /* should formatting spaces been added */
20600     int n_format;
20601
20602     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20603     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20604     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20605     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20606     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20607         mem_base = xmlMemBlocks();
20608         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20609         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20610         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20611         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20612         format = gen_int(n_format, 4);
20613
20614         xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
20615         call_tests++;
20616         des_xmlDocPtr(n_out_doc, out_doc, 0);
20617         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20618         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20619         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20620         des_int(n_format, format, 4);
20621         xmlResetLastError();
20622         if (mem_base != xmlMemBlocks()) {
20623             printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
20624                    xmlMemBlocks() - mem_base);
20625             test_ret++;
20626             printf(" %d", n_out_doc);
20627             printf(" %d", n_doc_txt_ptr);
20628             printf(" %d", n_doc_txt_len);
20629             printf(" %d", n_txt_encoding);
20630             printf(" %d", n_format);
20631             printf("\n");
20632         }
20633     }
20634     }
20635     }
20636     }
20637     }
20638     function_tests++;
20639 #endif
20640
20641     return(test_ret);
20642 }
20643
20644
20645 static int
20646 test_xmlDocDumpMemory(void) {
20647     int test_ret = 0;
20648
20649 #if defined(LIBXML_OUTPUT_ENABLED)
20650     int mem_base;
20651     xmlDocPtr cur; /* the document */
20652     int n_cur;
20653     xmlChar ** mem; /* OUT: the memory pointer */
20654     int n_mem;
20655     int * size; /* OUT: the memory length */
20656     int n_size;
20657
20658     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20659     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
20660     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
20661         mem_base = xmlMemBlocks();
20662         cur = gen_xmlDocPtr(n_cur, 0);
20663         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
20664         size = gen_int_ptr(n_size, 2);
20665
20666         xmlDocDumpMemory(cur, mem, size);
20667         call_tests++;
20668         des_xmlDocPtr(n_cur, cur, 0);
20669         des_xmlChar_ptr_ptr(n_mem, mem, 1);
20670         des_int_ptr(n_size, size, 2);
20671         xmlResetLastError();
20672         if (mem_base != xmlMemBlocks()) {
20673             printf("Leak of %d blocks found in xmlDocDumpMemory",
20674                    xmlMemBlocks() - mem_base);
20675             test_ret++;
20676             printf(" %d", n_cur);
20677             printf(" %d", n_mem);
20678             printf(" %d", n_size);
20679             printf("\n");
20680         }
20681     }
20682     }
20683     }
20684     function_tests++;
20685 #endif
20686
20687     return(test_ret);
20688 }
20689
20690
20691 static int
20692 test_xmlDocDumpMemoryEnc(void) {
20693     int test_ret = 0;
20694
20695 #if defined(LIBXML_OUTPUT_ENABLED)
20696     int mem_base;
20697     xmlDocPtr out_doc; /* Document to generate XML text from */
20698     int n_out_doc;
20699     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
20700     int n_doc_txt_ptr;
20701     int * doc_txt_len; /* Length of the generated XML text */
20702     int n_doc_txt_len;
20703     char * txt_encoding; /* Character encoding to use when generating XML text */
20704     int n_txt_encoding;
20705
20706     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20707     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20708     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20709     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20710         mem_base = xmlMemBlocks();
20711         out_doc = gen_xmlDocPtr(n_out_doc, 0);
20712         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20713         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20714         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20715
20716         xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20717         call_tests++;
20718         des_xmlDocPtr(n_out_doc, out_doc, 0);
20719         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20720         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20721         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20722         xmlResetLastError();
20723         if (mem_base != xmlMemBlocks()) {
20724             printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20725                    xmlMemBlocks() - mem_base);
20726             test_ret++;
20727             printf(" %d", n_out_doc);
20728             printf(" %d", n_doc_txt_ptr);
20729             printf(" %d", n_doc_txt_len);
20730             printf(" %d", n_txt_encoding);
20731             printf("\n");
20732         }
20733     }
20734     }
20735     }
20736     }
20737     function_tests++;
20738 #endif
20739
20740     return(test_ret);
20741 }
20742
20743
20744 static int
20745 test_xmlDocFormatDump(void) {
20746     int test_ret = 0;
20747
20748 #if defined(LIBXML_OUTPUT_ENABLED)
20749     int mem_base;
20750     int ret_val;
20751     FILE * f; /* the FILE* */
20752     int n_f;
20753     xmlDocPtr cur; /* the document */
20754     int n_cur;
20755     int format; /* should formatting spaces been added */
20756     int n_format;
20757
20758     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20759     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20760     for (n_format = 0;n_format < gen_nb_int;n_format++) {
20761         mem_base = xmlMemBlocks();
20762         f = gen_FILE_ptr(n_f, 0);
20763         cur = gen_xmlDocPtr(n_cur, 1);
20764         format = gen_int(n_format, 2);
20765
20766         ret_val = xmlDocFormatDump(f, cur, format);
20767         desret_int(ret_val);
20768         call_tests++;
20769         des_FILE_ptr(n_f, f, 0);
20770         des_xmlDocPtr(n_cur, cur, 1);
20771         des_int(n_format, format, 2);
20772         xmlResetLastError();
20773         if (mem_base != xmlMemBlocks()) {
20774             printf("Leak of %d blocks found in xmlDocFormatDump",
20775                    xmlMemBlocks() - mem_base);
20776             test_ret++;
20777             printf(" %d", n_f);
20778             printf(" %d", n_cur);
20779             printf(" %d", n_format);
20780             printf("\n");
20781         }
20782     }
20783     }
20784     }
20785     function_tests++;
20786 #endif
20787
20788     return(test_ret);
20789 }
20790
20791
20792 static int
20793 test_xmlDocGetRootElement(void) {
20794     int test_ret = 0;
20795
20796     int mem_base;
20797     xmlNodePtr ret_val;
20798     xmlDoc * doc; /* the document */
20799     int n_doc;
20800
20801     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
20802         mem_base = xmlMemBlocks();
20803         doc = gen_const_xmlDoc_ptr(n_doc, 0);
20804
20805         ret_val = xmlDocGetRootElement((const xmlDoc *)doc);
20806         desret_xmlNodePtr(ret_val);
20807         call_tests++;
20808         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
20809         xmlResetLastError();
20810         if (mem_base != xmlMemBlocks()) {
20811             printf("Leak of %d blocks found in xmlDocGetRootElement",
20812                    xmlMemBlocks() - mem_base);
20813             test_ret++;
20814             printf(" %d", n_doc);
20815             printf("\n");
20816         }
20817     }
20818     function_tests++;
20819
20820     return(test_ret);
20821 }
20822
20823
20824 static int
20825 test_xmlDocSetRootElement(void) {
20826     int test_ret = 0;
20827
20828 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20829     int mem_base;
20830     xmlNodePtr ret_val;
20831     xmlDocPtr doc; /* the document */
20832     int n_doc;
20833     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. */
20834     int n_root;
20835
20836     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20837     for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20838         mem_base = xmlMemBlocks();
20839         doc = gen_xmlDocPtr(n_doc, 0);
20840         root = gen_xmlNodePtr_in(n_root, 1);
20841
20842         ret_val = xmlDocSetRootElement(doc, root);
20843         if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20844         desret_xmlNodePtr(ret_val);
20845         call_tests++;
20846         des_xmlDocPtr(n_doc, doc, 0);
20847         des_xmlNodePtr_in(n_root, root, 1);
20848         xmlResetLastError();
20849         if (mem_base != xmlMemBlocks()) {
20850             printf("Leak of %d blocks found in xmlDocSetRootElement",
20851                    xmlMemBlocks() - mem_base);
20852             test_ret++;
20853             printf(" %d", n_doc);
20854             printf(" %d", n_root);
20855             printf("\n");
20856         }
20857     }
20858     }
20859     function_tests++;
20860 #endif
20861
20862     return(test_ret);
20863 }
20864
20865
20866 static int
20867 test_xmlElemDump(void) {
20868     int test_ret = 0;
20869
20870 #if defined(LIBXML_OUTPUT_ENABLED)
20871     int mem_base;
20872     FILE * f; /* the FILE * for the output */
20873     int n_f;
20874     xmlDocPtr doc; /* the document */
20875     int n_doc;
20876     xmlNodePtr cur; /* the current node */
20877     int n_cur;
20878
20879     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20880     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20881     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20882         mem_base = xmlMemBlocks();
20883         f = gen_FILE_ptr(n_f, 0);
20884         doc = gen_xmlDocPtr(n_doc, 1);
20885         cur = gen_xmlNodePtr(n_cur, 2);
20886
20887         xmlElemDump(f, doc, cur);
20888         call_tests++;
20889         des_FILE_ptr(n_f, f, 0);
20890         des_xmlDocPtr(n_doc, doc, 1);
20891         des_xmlNodePtr(n_cur, cur, 2);
20892         xmlResetLastError();
20893         if (mem_base != xmlMemBlocks()) {
20894             printf("Leak of %d blocks found in xmlElemDump",
20895                    xmlMemBlocks() - mem_base);
20896             test_ret++;
20897             printf(" %d", n_f);
20898             printf(" %d", n_doc);
20899             printf(" %d", n_cur);
20900             printf("\n");
20901         }
20902     }
20903     }
20904     }
20905     function_tests++;
20906 #endif
20907
20908     return(test_ret);
20909 }
20910
20911
20912 static int
20913 test_xmlFirstElementChild(void) {
20914     int test_ret = 0;
20915
20916 #if defined(LIBXML_TREE_ENABLED)
20917     int mem_base;
20918     xmlNodePtr ret_val;
20919     xmlNodePtr parent; /* the parent node */
20920     int n_parent;
20921
20922     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20923         mem_base = xmlMemBlocks();
20924         parent = gen_xmlNodePtr(n_parent, 0);
20925
20926         ret_val = xmlFirstElementChild(parent);
20927         desret_xmlNodePtr(ret_val);
20928         call_tests++;
20929         des_xmlNodePtr(n_parent, parent, 0);
20930         xmlResetLastError();
20931         if (mem_base != xmlMemBlocks()) {
20932             printf("Leak of %d blocks found in xmlFirstElementChild",
20933                    xmlMemBlocks() - mem_base);
20934             test_ret++;
20935             printf(" %d", n_parent);
20936             printf("\n");
20937         }
20938     }
20939     function_tests++;
20940 #endif
20941
20942     return(test_ret);
20943 }
20944
20945
20946 static int
20947 test_xmlGetBufferAllocationScheme(void) {
20948     int test_ret = 0;
20949
20950     int mem_base;
20951     xmlBufferAllocationScheme ret_val;
20952
20953         mem_base = xmlMemBlocks();
20954
20955         ret_val = xmlGetBufferAllocationScheme();
20956         desret_xmlBufferAllocationScheme(ret_val);
20957         call_tests++;
20958         xmlResetLastError();
20959         if (mem_base != xmlMemBlocks()) {
20960             printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20961                    xmlMemBlocks() - mem_base);
20962             test_ret++;
20963             printf("\n");
20964         }
20965     function_tests++;
20966
20967     return(test_ret);
20968 }
20969
20970
20971 static int
20972 test_xmlGetCompressMode(void) {
20973     int test_ret = 0;
20974
20975     int mem_base;
20976     int ret_val;
20977
20978         mem_base = xmlMemBlocks();
20979
20980         ret_val = xmlGetCompressMode();
20981         desret_int(ret_val);
20982         call_tests++;
20983         xmlResetLastError();
20984         if (mem_base != xmlMemBlocks()) {
20985             printf("Leak of %d blocks found in xmlGetCompressMode",
20986                    xmlMemBlocks() - mem_base);
20987             test_ret++;
20988             printf("\n");
20989         }
20990     function_tests++;
20991
20992     return(test_ret);
20993 }
20994
20995
20996 static int
20997 test_xmlGetDocCompressMode(void) {
20998     int test_ret = 0;
20999
21000     int mem_base;
21001     int ret_val;
21002     xmlDoc * doc; /* the document */
21003     int n_doc;
21004
21005     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21006         mem_base = xmlMemBlocks();
21007         doc = gen_const_xmlDoc_ptr(n_doc, 0);
21008
21009         ret_val = xmlGetDocCompressMode((const xmlDoc *)doc);
21010         desret_int(ret_val);
21011         call_tests++;
21012         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
21013         xmlResetLastError();
21014         if (mem_base != xmlMemBlocks()) {
21015             printf("Leak of %d blocks found in xmlGetDocCompressMode",
21016                    xmlMemBlocks() - mem_base);
21017             test_ret++;
21018             printf(" %d", n_doc);
21019             printf("\n");
21020         }
21021     }
21022     function_tests++;
21023
21024     return(test_ret);
21025 }
21026
21027
21028 static int
21029 test_xmlGetIntSubset(void) {
21030     int test_ret = 0;
21031
21032     int mem_base;
21033     xmlDtdPtr ret_val;
21034     xmlDoc * doc; /* the document pointer */
21035     int n_doc;
21036
21037     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
21038         mem_base = xmlMemBlocks();
21039         doc = gen_const_xmlDoc_ptr(n_doc, 0);
21040
21041         ret_val = xmlGetIntSubset((const xmlDoc *)doc);
21042         desret_xmlDtdPtr(ret_val);
21043         call_tests++;
21044         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
21045         xmlResetLastError();
21046         if (mem_base != xmlMemBlocks()) {
21047             printf("Leak of %d blocks found in xmlGetIntSubset",
21048                    xmlMemBlocks() - mem_base);
21049             test_ret++;
21050             printf(" %d", n_doc);
21051             printf("\n");
21052         }
21053     }
21054     function_tests++;
21055
21056     return(test_ret);
21057 }
21058
21059
21060 static int
21061 test_xmlGetLastChild(void) {
21062     int test_ret = 0;
21063
21064     int mem_base;
21065     xmlNodePtr ret_val;
21066     xmlNode * parent; /* the parent node */
21067     int n_parent;
21068
21069     for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
21070         mem_base = xmlMemBlocks();
21071         parent = gen_const_xmlNode_ptr(n_parent, 0);
21072
21073         ret_val = xmlGetLastChild((const xmlNode *)parent);
21074         desret_xmlNodePtr(ret_val);
21075         call_tests++;
21076         des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0);
21077         xmlResetLastError();
21078         if (mem_base != xmlMemBlocks()) {
21079             printf("Leak of %d blocks found in xmlGetLastChild",
21080                    xmlMemBlocks() - mem_base);
21081             test_ret++;
21082             printf(" %d", n_parent);
21083             printf("\n");
21084         }
21085     }
21086     function_tests++;
21087
21088     return(test_ret);
21089 }
21090
21091
21092 static int
21093 test_xmlGetLineNo(void) {
21094     int test_ret = 0;
21095
21096     int mem_base;
21097     long ret_val;
21098     xmlNode * node; /* valid node */
21099     int n_node;
21100
21101     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21102         mem_base = xmlMemBlocks();
21103         node = gen_const_xmlNode_ptr(n_node, 0);
21104
21105         ret_val = xmlGetLineNo((const xmlNode *)node);
21106         desret_long(ret_val);
21107         call_tests++;
21108         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21109         xmlResetLastError();
21110         if (mem_base != xmlMemBlocks()) {
21111             printf("Leak of %d blocks found in xmlGetLineNo",
21112                    xmlMemBlocks() - mem_base);
21113             test_ret++;
21114             printf(" %d", n_node);
21115             printf("\n");
21116         }
21117     }
21118     function_tests++;
21119
21120     return(test_ret);
21121 }
21122
21123
21124 static int
21125 test_xmlGetNoNsProp(void) {
21126     int test_ret = 0;
21127
21128     int mem_base;
21129     xmlChar * ret_val;
21130     xmlNode * node; /* the node */
21131     int n_node;
21132     xmlChar * name; /* the attribute name */
21133     int n_name;
21134
21135     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21136     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21137         mem_base = xmlMemBlocks();
21138         node = gen_const_xmlNode_ptr(n_node, 0);
21139         name = gen_const_xmlChar_ptr(n_name, 1);
21140
21141         ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name);
21142         desret_xmlChar_ptr(ret_val);
21143         call_tests++;
21144         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21145         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21146         xmlResetLastError();
21147         if (mem_base != xmlMemBlocks()) {
21148             printf("Leak of %d blocks found in xmlGetNoNsProp",
21149                    xmlMemBlocks() - mem_base);
21150             test_ret++;
21151             printf(" %d", n_node);
21152             printf(" %d", n_name);
21153             printf("\n");
21154         }
21155     }
21156     }
21157     function_tests++;
21158
21159     return(test_ret);
21160 }
21161
21162
21163 static int
21164 test_xmlGetNodePath(void) {
21165     int test_ret = 0;
21166
21167 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
21168     int mem_base;
21169     xmlChar * ret_val;
21170     xmlNode * node; /* a node */
21171     int n_node;
21172
21173     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21174         mem_base = xmlMemBlocks();
21175         node = gen_const_xmlNode_ptr(n_node, 0);
21176
21177         ret_val = xmlGetNodePath((const xmlNode *)node);
21178         desret_xmlChar_ptr(ret_val);
21179         call_tests++;
21180         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21181         xmlResetLastError();
21182         if (mem_base != xmlMemBlocks()) {
21183             printf("Leak of %d blocks found in xmlGetNodePath",
21184                    xmlMemBlocks() - mem_base);
21185             test_ret++;
21186             printf(" %d", n_node);
21187             printf("\n");
21188         }
21189     }
21190     function_tests++;
21191 #endif
21192
21193     return(test_ret);
21194 }
21195
21196
21197 static int
21198 test_xmlGetNsList(void) {
21199     int test_ret = 0;
21200
21201
21202     /* missing type support */
21203     return(test_ret);
21204 }
21205
21206
21207 static int
21208 test_xmlGetNsProp(void) {
21209     int test_ret = 0;
21210
21211     int mem_base;
21212     xmlChar * ret_val;
21213     xmlNode * node; /* the node */
21214     int n_node;
21215     xmlChar * name; /* the attribute name */
21216     int n_name;
21217     xmlChar * nameSpace; /* the URI of the namespace */
21218     int n_nameSpace;
21219
21220     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21221     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21222     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
21223         mem_base = xmlMemBlocks();
21224         node = gen_const_xmlNode_ptr(n_node, 0);
21225         name = gen_const_xmlChar_ptr(n_name, 1);
21226         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
21227
21228         ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
21229         desret_xmlChar_ptr(ret_val);
21230         call_tests++;
21231         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21232         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21233         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
21234         xmlResetLastError();
21235         if (mem_base != xmlMemBlocks()) {
21236             printf("Leak of %d blocks found in xmlGetNsProp",
21237                    xmlMemBlocks() - mem_base);
21238             test_ret++;
21239             printf(" %d", n_node);
21240             printf(" %d", n_name);
21241             printf(" %d", n_nameSpace);
21242             printf("\n");
21243         }
21244     }
21245     }
21246     }
21247     function_tests++;
21248
21249     return(test_ret);
21250 }
21251
21252
21253 static int
21254 test_xmlGetProp(void) {
21255     int test_ret = 0;
21256
21257     int mem_base;
21258     xmlChar * ret_val;
21259     xmlNode * node; /* the node */
21260     int n_node;
21261     xmlChar * name; /* the attribute name */
21262     int n_name;
21263
21264     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21265     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21266         mem_base = xmlMemBlocks();
21267         node = gen_const_xmlNode_ptr(n_node, 0);
21268         name = gen_const_xmlChar_ptr(n_name, 1);
21269
21270         ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name);
21271         desret_xmlChar_ptr(ret_val);
21272         call_tests++;
21273         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21274         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21275         xmlResetLastError();
21276         if (mem_base != xmlMemBlocks()) {
21277             printf("Leak of %d blocks found in xmlGetProp",
21278                    xmlMemBlocks() - mem_base);
21279             test_ret++;
21280             printf(" %d", n_node);
21281             printf(" %d", n_name);
21282             printf("\n");
21283         }
21284     }
21285     }
21286     function_tests++;
21287
21288     return(test_ret);
21289 }
21290
21291
21292 static int
21293 test_xmlHasNsProp(void) {
21294     int test_ret = 0;
21295
21296     int mem_base;
21297     xmlAttrPtr ret_val;
21298     xmlNode * node; /* the node */
21299     int n_node;
21300     xmlChar * name; /* the attribute name */
21301     int n_name;
21302     xmlChar * nameSpace; /* the URI of the namespace */
21303     int n_nameSpace;
21304
21305     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21306     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21307     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
21308         mem_base = xmlMemBlocks();
21309         node = gen_const_xmlNode_ptr(n_node, 0);
21310         name = gen_const_xmlChar_ptr(n_name, 1);
21311         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
21312
21313         ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
21314         desret_xmlAttrPtr(ret_val);
21315         call_tests++;
21316         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21317         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21318         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
21319         xmlResetLastError();
21320         if (mem_base != xmlMemBlocks()) {
21321             printf("Leak of %d blocks found in xmlHasNsProp",
21322                    xmlMemBlocks() - mem_base);
21323             test_ret++;
21324             printf(" %d", n_node);
21325             printf(" %d", n_name);
21326             printf(" %d", n_nameSpace);
21327             printf("\n");
21328         }
21329     }
21330     }
21331     }
21332     function_tests++;
21333
21334     return(test_ret);
21335 }
21336
21337
21338 static int
21339 test_xmlHasProp(void) {
21340     int test_ret = 0;
21341
21342     int mem_base;
21343     xmlAttrPtr ret_val;
21344     xmlNode * node; /* the node */
21345     int n_node;
21346     xmlChar * name; /* the attribute name */
21347     int n_name;
21348
21349     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21350     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21351         mem_base = xmlMemBlocks();
21352         node = gen_const_xmlNode_ptr(n_node, 0);
21353         name = gen_const_xmlChar_ptr(n_name, 1);
21354
21355         ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name);
21356         desret_xmlAttrPtr(ret_val);
21357         call_tests++;
21358         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21359         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21360         xmlResetLastError();
21361         if (mem_base != xmlMemBlocks()) {
21362             printf("Leak of %d blocks found in xmlHasProp",
21363                    xmlMemBlocks() - mem_base);
21364             test_ret++;
21365             printf(" %d", n_node);
21366             printf(" %d", n_name);
21367             printf("\n");
21368         }
21369     }
21370     }
21371     function_tests++;
21372
21373     return(test_ret);
21374 }
21375
21376
21377 static int
21378 test_xmlIsBlankNode(void) {
21379     int test_ret = 0;
21380
21381     int mem_base;
21382     int ret_val;
21383     xmlNode * node; /* the node */
21384     int n_node;
21385
21386     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
21387         mem_base = xmlMemBlocks();
21388         node = gen_const_xmlNode_ptr(n_node, 0);
21389
21390         ret_val = xmlIsBlankNode((const xmlNode *)node);
21391         desret_int(ret_val);
21392         call_tests++;
21393         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
21394         xmlResetLastError();
21395         if (mem_base != xmlMemBlocks()) {
21396             printf("Leak of %d blocks found in xmlIsBlankNode",
21397                    xmlMemBlocks() - mem_base);
21398             test_ret++;
21399             printf(" %d", n_node);
21400             printf("\n");
21401         }
21402     }
21403     function_tests++;
21404
21405     return(test_ret);
21406 }
21407
21408
21409 static int
21410 test_xmlIsXHTML(void) {
21411     int test_ret = 0;
21412
21413     int mem_base;
21414     int ret_val;
21415     xmlChar * systemID; /* the system identifier */
21416     int n_systemID;
21417     xmlChar * publicID; /* the public identifier */
21418     int n_publicID;
21419
21420     for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
21421     for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
21422         mem_base = xmlMemBlocks();
21423         systemID = gen_const_xmlChar_ptr(n_systemID, 0);
21424         publicID = gen_const_xmlChar_ptr(n_publicID, 1);
21425
21426         ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
21427         desret_int(ret_val);
21428         call_tests++;
21429         des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
21430         des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
21431         xmlResetLastError();
21432         if (mem_base != xmlMemBlocks()) {
21433             printf("Leak of %d blocks found in xmlIsXHTML",
21434                    xmlMemBlocks() - mem_base);
21435             test_ret++;
21436             printf(" %d", n_systemID);
21437             printf(" %d", n_publicID);
21438             printf("\n");
21439         }
21440     }
21441     }
21442     function_tests++;
21443
21444     return(test_ret);
21445 }
21446
21447
21448 static int
21449 test_xmlLastElementChild(void) {
21450     int test_ret = 0;
21451
21452 #if defined(LIBXML_TREE_ENABLED)
21453     int mem_base;
21454     xmlNodePtr ret_val;
21455     xmlNodePtr parent; /* the parent node */
21456     int n_parent;
21457
21458     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21459         mem_base = xmlMemBlocks();
21460         parent = gen_xmlNodePtr(n_parent, 0);
21461
21462         ret_val = xmlLastElementChild(parent);
21463         desret_xmlNodePtr(ret_val);
21464         call_tests++;
21465         des_xmlNodePtr(n_parent, parent, 0);
21466         xmlResetLastError();
21467         if (mem_base != xmlMemBlocks()) {
21468             printf("Leak of %d blocks found in xmlLastElementChild",
21469                    xmlMemBlocks() - mem_base);
21470             test_ret++;
21471             printf(" %d", n_parent);
21472             printf("\n");
21473         }
21474     }
21475     function_tests++;
21476 #endif
21477
21478     return(test_ret);
21479 }
21480
21481
21482 static int
21483 test_xmlNewCDataBlock(void) {
21484     int test_ret = 0;
21485
21486     int mem_base;
21487     xmlNodePtr ret_val;
21488     xmlDocPtr doc; /* the document */
21489     int n_doc;
21490     xmlChar * content; /* the CDATA block content content */
21491     int n_content;
21492     int len; /* the length of the block */
21493     int n_len;
21494
21495     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21496     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21497     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21498         mem_base = xmlMemBlocks();
21499         doc = gen_xmlDocPtr(n_doc, 0);
21500         content = gen_const_xmlChar_ptr(n_content, 1);
21501         len = gen_int(n_len, 2);
21502         if ((content != NULL) &&
21503             (len > (int) strlen((const char *) content) + 1))
21504             continue;
21505
21506         ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
21507         desret_xmlNodePtr(ret_val);
21508         call_tests++;
21509         des_xmlDocPtr(n_doc, doc, 0);
21510         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21511         des_int(n_len, len, 2);
21512         xmlResetLastError();
21513         if (mem_base != xmlMemBlocks()) {
21514             printf("Leak of %d blocks found in xmlNewCDataBlock",
21515                    xmlMemBlocks() - mem_base);
21516             test_ret++;
21517             printf(" %d", n_doc);
21518             printf(" %d", n_content);
21519             printf(" %d", n_len);
21520             printf("\n");
21521         }
21522     }
21523     }
21524     }
21525     function_tests++;
21526
21527     return(test_ret);
21528 }
21529
21530
21531 static int
21532 test_xmlNewCharRef(void) {
21533     int test_ret = 0;
21534
21535     int mem_base;
21536     xmlNodePtr ret_val;
21537     xmlDocPtr doc; /* the document */
21538     int n_doc;
21539     xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
21540     int n_name;
21541
21542     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21543     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21544         mem_base = xmlMemBlocks();
21545         doc = gen_xmlDocPtr(n_doc, 0);
21546         name = gen_const_xmlChar_ptr(n_name, 1);
21547
21548         ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
21549         desret_xmlNodePtr(ret_val);
21550         call_tests++;
21551         des_xmlDocPtr(n_doc, doc, 0);
21552         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21553         xmlResetLastError();
21554         if (mem_base != xmlMemBlocks()) {
21555             printf("Leak of %d blocks found in xmlNewCharRef",
21556                    xmlMemBlocks() - mem_base);
21557             test_ret++;
21558             printf(" %d", n_doc);
21559             printf(" %d", n_name);
21560             printf("\n");
21561         }
21562     }
21563     }
21564     function_tests++;
21565
21566     return(test_ret);
21567 }
21568
21569
21570 static int
21571 test_xmlNewChild(void) {
21572     int test_ret = 0;
21573
21574 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21575 #ifdef LIBXML_TREE_ENABLED
21576     int mem_base;
21577     xmlNodePtr ret_val;
21578     xmlNodePtr parent; /* the parent node */
21579     int n_parent;
21580     xmlNsPtr ns; /* a namespace if any */
21581     int n_ns;
21582     xmlChar * name; /* the name of the child */
21583     int n_name;
21584     xmlChar * content; /* the XML content of the child if any. */
21585     int n_content;
21586
21587     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21588     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21589     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21590     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21591         mem_base = xmlMemBlocks();
21592         parent = gen_xmlNodePtr(n_parent, 0);
21593         ns = gen_xmlNsPtr(n_ns, 1);
21594         name = gen_const_xmlChar_ptr(n_name, 2);
21595         content = gen_const_xmlChar_ptr(n_content, 3);
21596
21597         ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21598         desret_xmlNodePtr(ret_val);
21599         call_tests++;
21600         des_xmlNodePtr(n_parent, parent, 0);
21601         des_xmlNsPtr(n_ns, ns, 1);
21602         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21603         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21604         xmlResetLastError();
21605         if (mem_base != xmlMemBlocks()) {
21606             printf("Leak of %d blocks found in xmlNewChild",
21607                    xmlMemBlocks() - mem_base);
21608             test_ret++;
21609             printf(" %d", n_parent);
21610             printf(" %d", n_ns);
21611             printf(" %d", n_name);
21612             printf(" %d", n_content);
21613             printf("\n");
21614         }
21615     }
21616     }
21617     }
21618     }
21619     function_tests++;
21620 #endif
21621 #endif
21622
21623     return(test_ret);
21624 }
21625
21626
21627 static int
21628 test_xmlNewComment(void) {
21629     int test_ret = 0;
21630
21631     int mem_base;
21632     xmlNodePtr ret_val;
21633     xmlChar * content; /* the comment content */
21634     int n_content;
21635
21636     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21637         mem_base = xmlMemBlocks();
21638         content = gen_const_xmlChar_ptr(n_content, 0);
21639
21640         ret_val = xmlNewComment((const xmlChar *)content);
21641         desret_xmlNodePtr(ret_val);
21642         call_tests++;
21643         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21644         xmlResetLastError();
21645         if (mem_base != xmlMemBlocks()) {
21646             printf("Leak of %d blocks found in xmlNewComment",
21647                    xmlMemBlocks() - mem_base);
21648             test_ret++;
21649             printf(" %d", n_content);
21650             printf("\n");
21651         }
21652     }
21653     function_tests++;
21654
21655     return(test_ret);
21656 }
21657
21658
21659 static int
21660 test_xmlNewDoc(void) {
21661     int test_ret = 0;
21662
21663     int mem_base;
21664     xmlDocPtr ret_val;
21665     xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
21666     int n_version;
21667
21668     for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
21669         mem_base = xmlMemBlocks();
21670         version = gen_const_xmlChar_ptr(n_version, 0);
21671
21672         ret_val = xmlNewDoc((const xmlChar *)version);
21673         desret_xmlDocPtr(ret_val);
21674         call_tests++;
21675         des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
21676         xmlResetLastError();
21677         if (mem_base != xmlMemBlocks()) {
21678             printf("Leak of %d blocks found in xmlNewDoc",
21679                    xmlMemBlocks() - mem_base);
21680             test_ret++;
21681             printf(" %d", n_version);
21682             printf("\n");
21683         }
21684     }
21685     function_tests++;
21686
21687     return(test_ret);
21688 }
21689
21690
21691 static int
21692 test_xmlNewDocComment(void) {
21693     int test_ret = 0;
21694
21695     int mem_base;
21696     xmlNodePtr ret_val;
21697     xmlDocPtr doc; /* the document */
21698     int n_doc;
21699     xmlChar * content; /* the comment content */
21700     int n_content;
21701
21702     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21703     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21704         mem_base = xmlMemBlocks();
21705         doc = gen_xmlDocPtr(n_doc, 0);
21706         content = gen_const_xmlChar_ptr(n_content, 1);
21707
21708         ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21709         desret_xmlNodePtr(ret_val);
21710         call_tests++;
21711         des_xmlDocPtr(n_doc, doc, 0);
21712         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21713         xmlResetLastError();
21714         if (mem_base != xmlMemBlocks()) {
21715             printf("Leak of %d blocks found in xmlNewDocComment",
21716                    xmlMemBlocks() - mem_base);
21717             test_ret++;
21718             printf(" %d", n_doc);
21719             printf(" %d", n_content);
21720             printf("\n");
21721         }
21722     }
21723     }
21724     function_tests++;
21725
21726     return(test_ret);
21727 }
21728
21729
21730 static int
21731 test_xmlNewDocFragment(void) {
21732     int test_ret = 0;
21733
21734 #if defined(LIBXML_TREE_ENABLED)
21735     int mem_base;
21736     xmlNodePtr ret_val;
21737     xmlDocPtr doc; /* the document owning the fragment */
21738     int n_doc;
21739
21740     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21741         mem_base = xmlMemBlocks();
21742         doc = gen_xmlDocPtr(n_doc, 0);
21743
21744         ret_val = xmlNewDocFragment(doc);
21745         desret_xmlNodePtr(ret_val);
21746         call_tests++;
21747         des_xmlDocPtr(n_doc, doc, 0);
21748         xmlResetLastError();
21749         if (mem_base != xmlMemBlocks()) {
21750             printf("Leak of %d blocks found in xmlNewDocFragment",
21751                    xmlMemBlocks() - mem_base);
21752             test_ret++;
21753             printf(" %d", n_doc);
21754             printf("\n");
21755         }
21756     }
21757     function_tests++;
21758 #endif
21759
21760     return(test_ret);
21761 }
21762
21763
21764 static int
21765 test_xmlNewDocNode(void) {
21766     int test_ret = 0;
21767
21768     int mem_base;
21769     xmlNodePtr ret_val;
21770     xmlDocPtr doc; /* the document */
21771     int n_doc;
21772     xmlNsPtr ns; /* namespace if any */
21773     int n_ns;
21774     xmlChar * name; /* the node name */
21775     int n_name;
21776     xmlChar * content; /* the XML text content if any */
21777     int n_content;
21778
21779     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21780     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21781     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21782     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21783         mem_base = xmlMemBlocks();
21784         doc = gen_xmlDocPtr(n_doc, 0);
21785         ns = gen_xmlNsPtr(n_ns, 1);
21786         name = gen_const_xmlChar_ptr(n_name, 2);
21787         content = gen_const_xmlChar_ptr(n_content, 3);
21788
21789         ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21790         desret_xmlNodePtr(ret_val);
21791         call_tests++;
21792         des_xmlDocPtr(n_doc, doc, 0);
21793         des_xmlNsPtr(n_ns, ns, 1);
21794         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21795         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21796         xmlResetLastError();
21797         if (mem_base != xmlMemBlocks()) {
21798             printf("Leak of %d blocks found in xmlNewDocNode",
21799                    xmlMemBlocks() - mem_base);
21800             test_ret++;
21801             printf(" %d", n_doc);
21802             printf(" %d", n_ns);
21803             printf(" %d", n_name);
21804             printf(" %d", n_content);
21805             printf("\n");
21806         }
21807     }
21808     }
21809     }
21810     }
21811     function_tests++;
21812
21813     return(test_ret);
21814 }
21815
21816
21817 static int
21818 test_xmlNewDocNodeEatName(void) {
21819     int test_ret = 0;
21820
21821     int mem_base;
21822     xmlNodePtr ret_val;
21823     xmlDocPtr doc; /* the document */
21824     int n_doc;
21825     xmlNsPtr ns; /* namespace if any */
21826     int n_ns;
21827     xmlChar * name; /* the node name */
21828     int n_name;
21829     xmlChar * content; /* the XML text content if any */
21830     int n_content;
21831
21832     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21833     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21834     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21835     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21836         mem_base = xmlMemBlocks();
21837         doc = gen_xmlDocPtr(n_doc, 0);
21838         ns = gen_xmlNsPtr(n_ns, 1);
21839         name = gen_eaten_name(n_name, 2);
21840         content = gen_const_xmlChar_ptr(n_content, 3);
21841
21842         ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21843         desret_xmlNodePtr(ret_val);
21844         call_tests++;
21845         des_xmlDocPtr(n_doc, doc, 0);
21846         des_xmlNsPtr(n_ns, ns, 1);
21847         des_eaten_name(n_name, name, 2);
21848         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21849         xmlResetLastError();
21850         if (mem_base != xmlMemBlocks()) {
21851             printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21852                    xmlMemBlocks() - mem_base);
21853             test_ret++;
21854             printf(" %d", n_doc);
21855             printf(" %d", n_ns);
21856             printf(" %d", n_name);
21857             printf(" %d", n_content);
21858             printf("\n");
21859         }
21860     }
21861     }
21862     }
21863     }
21864     function_tests++;
21865
21866     return(test_ret);
21867 }
21868
21869
21870 static int
21871 test_xmlNewDocPI(void) {
21872     int test_ret = 0;
21873
21874     int mem_base;
21875     xmlNodePtr ret_val;
21876     xmlDocPtr doc; /* the target document */
21877     int n_doc;
21878     xmlChar * name; /* the processing instruction name */
21879     int n_name;
21880     xmlChar * content; /* the PI content */
21881     int n_content;
21882
21883     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21884     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21885     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21886         mem_base = xmlMemBlocks();
21887         doc = gen_xmlDocPtr(n_doc, 0);
21888         name = gen_const_xmlChar_ptr(n_name, 1);
21889         content = gen_const_xmlChar_ptr(n_content, 2);
21890
21891         ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21892         desret_xmlNodePtr(ret_val);
21893         call_tests++;
21894         des_xmlDocPtr(n_doc, doc, 0);
21895         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21896         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21897         xmlResetLastError();
21898         if (mem_base != xmlMemBlocks()) {
21899             printf("Leak of %d blocks found in xmlNewDocPI",
21900                    xmlMemBlocks() - mem_base);
21901             test_ret++;
21902             printf(" %d", n_doc);
21903             printf(" %d", n_name);
21904             printf(" %d", n_content);
21905             printf("\n");
21906         }
21907     }
21908     }
21909     }
21910     function_tests++;
21911
21912     return(test_ret);
21913 }
21914
21915
21916 static int
21917 test_xmlNewDocProp(void) {
21918     int test_ret = 0;
21919
21920     int mem_base;
21921     xmlAttrPtr ret_val;
21922     xmlDocPtr doc; /* the document */
21923     int n_doc;
21924     xmlChar * name; /* the name of the attribute */
21925     int n_name;
21926     xmlChar * value; /* the value of the attribute */
21927     int n_value;
21928
21929     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21930     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21931     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21932         mem_base = xmlMemBlocks();
21933         doc = gen_xmlDocPtr(n_doc, 0);
21934         name = gen_const_xmlChar_ptr(n_name, 1);
21935         value = gen_const_xmlChar_ptr(n_value, 2);
21936
21937         ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21938         desret_xmlAttrPtr(ret_val);
21939         call_tests++;
21940         des_xmlDocPtr(n_doc, doc, 0);
21941         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21942         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21943         xmlResetLastError();
21944         if (mem_base != xmlMemBlocks()) {
21945             printf("Leak of %d blocks found in xmlNewDocProp",
21946                    xmlMemBlocks() - mem_base);
21947             test_ret++;
21948             printf(" %d", n_doc);
21949             printf(" %d", n_name);
21950             printf(" %d", n_value);
21951             printf("\n");
21952         }
21953     }
21954     }
21955     }
21956     function_tests++;
21957
21958     return(test_ret);
21959 }
21960
21961
21962 static int
21963 test_xmlNewDocRawNode(void) {
21964     int test_ret = 0;
21965
21966 #if defined(LIBXML_TREE_ENABLED)
21967 #ifdef LIBXML_TREE_ENABLED
21968     int mem_base;
21969     xmlNodePtr ret_val;
21970     xmlDocPtr doc; /* the document */
21971     int n_doc;
21972     xmlNsPtr ns; /* namespace if any */
21973     int n_ns;
21974     xmlChar * name; /* the node name */
21975     int n_name;
21976     xmlChar * content; /* the text content if any */
21977     int n_content;
21978
21979     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21980     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21981     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21982     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21983         mem_base = xmlMemBlocks();
21984         doc = gen_xmlDocPtr(n_doc, 0);
21985         ns = gen_xmlNsPtr(n_ns, 1);
21986         name = gen_const_xmlChar_ptr(n_name, 2);
21987         content = gen_const_xmlChar_ptr(n_content, 3);
21988
21989         ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21990         desret_xmlNodePtr(ret_val);
21991         call_tests++;
21992         des_xmlDocPtr(n_doc, doc, 0);
21993         des_xmlNsPtr(n_ns, ns, 1);
21994         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21995         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21996         xmlResetLastError();
21997         if (mem_base != xmlMemBlocks()) {
21998             printf("Leak of %d blocks found in xmlNewDocRawNode",
21999                    xmlMemBlocks() - mem_base);
22000             test_ret++;
22001             printf(" %d", n_doc);
22002             printf(" %d", n_ns);
22003             printf(" %d", n_name);
22004             printf(" %d", n_content);
22005             printf("\n");
22006         }
22007     }
22008     }
22009     }
22010     }
22011     function_tests++;
22012 #endif
22013 #endif
22014
22015     return(test_ret);
22016 }
22017
22018
22019 static int
22020 test_xmlNewDocText(void) {
22021     int test_ret = 0;
22022
22023     int mem_base;
22024     xmlNodePtr ret_val;
22025     xmlDoc * doc; /* the document */
22026     int n_doc;
22027     xmlChar * content; /* the text content */
22028     int n_content;
22029
22030     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22031     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22032         mem_base = xmlMemBlocks();
22033         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22034         content = gen_const_xmlChar_ptr(n_content, 1);
22035
22036         ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content);
22037         desret_xmlNodePtr(ret_val);
22038         call_tests++;
22039         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22040         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22041         xmlResetLastError();
22042         if (mem_base != xmlMemBlocks()) {
22043             printf("Leak of %d blocks found in xmlNewDocText",
22044                    xmlMemBlocks() - mem_base);
22045             test_ret++;
22046             printf(" %d", n_doc);
22047             printf(" %d", n_content);
22048             printf("\n");
22049         }
22050     }
22051     }
22052     function_tests++;
22053
22054     return(test_ret);
22055 }
22056
22057
22058 static int
22059 test_xmlNewDocTextLen(void) {
22060     int test_ret = 0;
22061
22062     int mem_base;
22063     xmlNodePtr ret_val;
22064     xmlDocPtr doc; /* the document */
22065     int n_doc;
22066     xmlChar * content; /* the text content */
22067     int n_content;
22068     int len; /* the text len. */
22069     int n_len;
22070
22071     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22072     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22073     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22074         mem_base = xmlMemBlocks();
22075         doc = gen_xmlDocPtr(n_doc, 0);
22076         content = gen_const_xmlChar_ptr(n_content, 1);
22077         len = gen_int(n_len, 2);
22078         if ((content != NULL) &&
22079             (len > (int) strlen((const char *) content) + 1))
22080             continue;
22081
22082         ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
22083         desret_xmlNodePtr(ret_val);
22084         call_tests++;
22085         des_xmlDocPtr(n_doc, doc, 0);
22086         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22087         des_int(n_len, len, 2);
22088         xmlResetLastError();
22089         if (mem_base != xmlMemBlocks()) {
22090             printf("Leak of %d blocks found in xmlNewDocTextLen",
22091                    xmlMemBlocks() - mem_base);
22092             test_ret++;
22093             printf(" %d", n_doc);
22094             printf(" %d", n_content);
22095             printf(" %d", n_len);
22096             printf("\n");
22097         }
22098     }
22099     }
22100     }
22101     function_tests++;
22102
22103     return(test_ret);
22104 }
22105
22106
22107 static int
22108 test_xmlNewDtd(void) {
22109     int test_ret = 0;
22110
22111     int mem_base;
22112     xmlDtdPtr ret_val;
22113     xmlDocPtr doc; /* the document pointer */
22114     int n_doc;
22115     xmlChar * name; /* the DTD name */
22116     int n_name;
22117     xmlChar * ExternalID; /* the external ID */
22118     int n_ExternalID;
22119     xmlChar * SystemID; /* the system ID */
22120     int n_SystemID;
22121
22122     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22123     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22124     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
22125     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
22126         mem_base = xmlMemBlocks();
22127         doc = gen_xmlDocPtr(n_doc, 0);
22128         name = gen_const_xmlChar_ptr(n_name, 1);
22129         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
22130         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
22131
22132         ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
22133         desret_xmlDtdPtr(ret_val);
22134         call_tests++;
22135         des_xmlDocPtr(n_doc, doc, 0);
22136         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22137         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
22138         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
22139         xmlResetLastError();
22140         if (mem_base != xmlMemBlocks()) {
22141             printf("Leak of %d blocks found in xmlNewDtd",
22142                    xmlMemBlocks() - mem_base);
22143             test_ret++;
22144             printf(" %d", n_doc);
22145             printf(" %d", n_name);
22146             printf(" %d", n_ExternalID);
22147             printf(" %d", n_SystemID);
22148             printf("\n");
22149         }
22150     }
22151     }
22152     }
22153     }
22154     function_tests++;
22155
22156     return(test_ret);
22157 }
22158
22159
22160 static int
22161 test_xmlNewNode(void) {
22162     int test_ret = 0;
22163
22164     int mem_base;
22165     xmlNodePtr ret_val;
22166     xmlNsPtr ns; /* namespace if any */
22167     int n_ns;
22168     xmlChar * name; /* the node name */
22169     int n_name;
22170
22171     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22172     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22173         mem_base = xmlMemBlocks();
22174         ns = gen_xmlNsPtr(n_ns, 0);
22175         name = gen_const_xmlChar_ptr(n_name, 1);
22176
22177         ret_val = xmlNewNode(ns, (const xmlChar *)name);
22178         desret_xmlNodePtr(ret_val);
22179         call_tests++;
22180         des_xmlNsPtr(n_ns, ns, 0);
22181         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22182         xmlResetLastError();
22183         if (mem_base != xmlMemBlocks()) {
22184             printf("Leak of %d blocks found in xmlNewNode",
22185                    xmlMemBlocks() - mem_base);
22186             test_ret++;
22187             printf(" %d", n_ns);
22188             printf(" %d", n_name);
22189             printf("\n");
22190         }
22191     }
22192     }
22193     function_tests++;
22194
22195     return(test_ret);
22196 }
22197
22198
22199 static int
22200 test_xmlNewNodeEatName(void) {
22201     int test_ret = 0;
22202
22203     int mem_base;
22204     xmlNodePtr ret_val;
22205     xmlNsPtr ns; /* namespace if any */
22206     int n_ns;
22207     xmlChar * name; /* the node name */
22208     int n_name;
22209
22210     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22211     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
22212         mem_base = xmlMemBlocks();
22213         ns = gen_xmlNsPtr(n_ns, 0);
22214         name = gen_eaten_name(n_name, 1);
22215
22216         ret_val = xmlNewNodeEatName(ns, name);
22217         desret_xmlNodePtr(ret_val);
22218         call_tests++;
22219         des_xmlNsPtr(n_ns, ns, 0);
22220         des_eaten_name(n_name, name, 1);
22221         xmlResetLastError();
22222         if (mem_base != xmlMemBlocks()) {
22223             printf("Leak of %d blocks found in xmlNewNodeEatName",
22224                    xmlMemBlocks() - mem_base);
22225             test_ret++;
22226             printf(" %d", n_ns);
22227             printf(" %d", n_name);
22228             printf("\n");
22229         }
22230     }
22231     }
22232     function_tests++;
22233
22234     return(test_ret);
22235 }
22236
22237
22238 static int
22239 test_xmlNewNs(void) {
22240     int test_ret = 0;
22241
22242     int mem_base;
22243     xmlNsPtr ret_val;
22244     xmlNodePtr node; /* the element carrying the namespace */
22245     int n_node;
22246     xmlChar * href; /* the URI associated */
22247     int n_href;
22248     xmlChar * prefix; /* the prefix for the namespace */
22249     int n_prefix;
22250
22251     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22252     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22253     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
22254         mem_base = xmlMemBlocks();
22255         node = gen_xmlNodePtr(n_node, 0);
22256         href = gen_const_xmlChar_ptr(n_href, 1);
22257         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
22258
22259         ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
22260         if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
22261         desret_xmlNsPtr(ret_val);
22262         call_tests++;
22263         des_xmlNodePtr(n_node, node, 0);
22264         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
22265         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
22266         xmlResetLastError();
22267         if (mem_base != xmlMemBlocks()) {
22268             printf("Leak of %d blocks found in xmlNewNs",
22269                    xmlMemBlocks() - mem_base);
22270             test_ret++;
22271             printf(" %d", n_node);
22272             printf(" %d", n_href);
22273             printf(" %d", n_prefix);
22274             printf("\n");
22275         }
22276     }
22277     }
22278     }
22279     function_tests++;
22280
22281     return(test_ret);
22282 }
22283
22284
22285 static int
22286 test_xmlNewNsProp(void) {
22287     int test_ret = 0;
22288
22289     int mem_base;
22290     xmlAttrPtr ret_val;
22291     xmlNodePtr node; /* the holding node */
22292     int n_node;
22293     xmlNsPtr ns; /* the namespace */
22294     int n_ns;
22295     xmlChar * name; /* the name of the attribute */
22296     int n_name;
22297     xmlChar * value; /* the value of the attribute */
22298     int n_value;
22299
22300     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22301     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22302     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22303     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22304         mem_base = xmlMemBlocks();
22305         node = gen_xmlNodePtr(n_node, 0);
22306         ns = gen_xmlNsPtr(n_ns, 1);
22307         name = gen_const_xmlChar_ptr(n_name, 2);
22308         value = gen_const_xmlChar_ptr(n_value, 3);
22309
22310         ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
22311         desret_xmlAttrPtr(ret_val);
22312         call_tests++;
22313         des_xmlNodePtr(n_node, node, 0);
22314         des_xmlNsPtr(n_ns, ns, 1);
22315         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22316         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
22317         xmlResetLastError();
22318         if (mem_base != xmlMemBlocks()) {
22319             printf("Leak of %d blocks found in xmlNewNsProp",
22320                    xmlMemBlocks() - mem_base);
22321             test_ret++;
22322             printf(" %d", n_node);
22323             printf(" %d", n_ns);
22324             printf(" %d", n_name);
22325             printf(" %d", n_value);
22326             printf("\n");
22327         }
22328     }
22329     }
22330     }
22331     }
22332     function_tests++;
22333
22334     return(test_ret);
22335 }
22336
22337
22338 static int
22339 test_xmlNewNsPropEatName(void) {
22340     int test_ret = 0;
22341
22342     int mem_base;
22343     xmlAttrPtr ret_val;
22344     xmlNodePtr node; /* the holding node */
22345     int n_node;
22346     xmlNsPtr ns; /* the namespace */
22347     int n_ns;
22348     xmlChar * name; /* the name of the attribute */
22349     int n_name;
22350     xmlChar * value; /* the value of the attribute */
22351     int n_value;
22352
22353     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22354     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22355     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
22356     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22357         mem_base = xmlMemBlocks();
22358         node = gen_xmlNodePtr(n_node, 0);
22359         ns = gen_xmlNsPtr(n_ns, 1);
22360         name = gen_eaten_name(n_name, 2);
22361         value = gen_const_xmlChar_ptr(n_value, 3);
22362
22363         ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
22364         desret_xmlAttrPtr(ret_val);
22365         call_tests++;
22366         des_xmlNodePtr(n_node, node, 0);
22367         des_xmlNsPtr(n_ns, ns, 1);
22368         des_eaten_name(n_name, name, 2);
22369         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
22370         xmlResetLastError();
22371         if (mem_base != xmlMemBlocks()) {
22372             printf("Leak of %d blocks found in xmlNewNsPropEatName",
22373                    xmlMemBlocks() - mem_base);
22374             test_ret++;
22375             printf(" %d", n_node);
22376             printf(" %d", n_ns);
22377             printf(" %d", n_name);
22378             printf(" %d", n_value);
22379             printf("\n");
22380         }
22381     }
22382     }
22383     }
22384     }
22385     function_tests++;
22386
22387     return(test_ret);
22388 }
22389
22390
22391 static int
22392 test_xmlNewPI(void) {
22393     int test_ret = 0;
22394
22395     int mem_base;
22396     xmlNodePtr ret_val;
22397     xmlChar * name; /* the processing instruction name */
22398     int n_name;
22399     xmlChar * content; /* the PI content */
22400     int n_content;
22401
22402     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22403     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22404         mem_base = xmlMemBlocks();
22405         name = gen_const_xmlChar_ptr(n_name, 0);
22406         content = gen_const_xmlChar_ptr(n_content, 1);
22407
22408         ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
22409         desret_xmlNodePtr(ret_val);
22410         call_tests++;
22411         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22412         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22413         xmlResetLastError();
22414         if (mem_base != xmlMemBlocks()) {
22415             printf("Leak of %d blocks found in xmlNewPI",
22416                    xmlMemBlocks() - mem_base);
22417             test_ret++;
22418             printf(" %d", n_name);
22419             printf(" %d", n_content);
22420             printf("\n");
22421         }
22422     }
22423     }
22424     function_tests++;
22425
22426     return(test_ret);
22427 }
22428
22429
22430 static int
22431 test_xmlNewProp(void) {
22432     int test_ret = 0;
22433
22434 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22435 #ifdef LIBXML_TREE_ENABLED
22436     int mem_base;
22437     xmlAttrPtr ret_val;
22438     xmlNodePtr node; /* the holding node */
22439     int n_node;
22440     xmlChar * name; /* the name of the attribute */
22441     int n_name;
22442     xmlChar * value; /* the value of the attribute */
22443     int n_value;
22444
22445     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22446     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22447     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22448         mem_base = xmlMemBlocks();
22449         node = gen_xmlNodePtr(n_node, 0);
22450         name = gen_const_xmlChar_ptr(n_name, 1);
22451         value = gen_const_xmlChar_ptr(n_value, 2);
22452
22453         ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
22454         desret_xmlAttrPtr(ret_val);
22455         call_tests++;
22456         des_xmlNodePtr(n_node, node, 0);
22457         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22458         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22459         xmlResetLastError();
22460         if (mem_base != xmlMemBlocks()) {
22461             printf("Leak of %d blocks found in xmlNewProp",
22462                    xmlMemBlocks() - mem_base);
22463             test_ret++;
22464             printf(" %d", n_node);
22465             printf(" %d", n_name);
22466             printf(" %d", n_value);
22467             printf("\n");
22468         }
22469     }
22470     }
22471     }
22472     function_tests++;
22473 #endif
22474 #endif
22475
22476     return(test_ret);
22477 }
22478
22479
22480 static int
22481 test_xmlNewReference(void) {
22482     int test_ret = 0;
22483
22484     int mem_base;
22485     xmlNodePtr ret_val;
22486     xmlDoc * doc; /* the document */
22487     int n_doc;
22488     xmlChar * name; /* the reference name, or the reference string with & and ; */
22489     int n_name;
22490
22491     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22492     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22493         mem_base = xmlMemBlocks();
22494         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22495         name = gen_const_xmlChar_ptr(n_name, 1);
22496
22497         ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name);
22498         desret_xmlNodePtr(ret_val);
22499         call_tests++;
22500         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22501         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22502         xmlResetLastError();
22503         if (mem_base != xmlMemBlocks()) {
22504             printf("Leak of %d blocks found in xmlNewReference",
22505                    xmlMemBlocks() - mem_base);
22506             test_ret++;
22507             printf(" %d", n_doc);
22508             printf(" %d", n_name);
22509             printf("\n");
22510         }
22511     }
22512     }
22513     function_tests++;
22514
22515     return(test_ret);
22516 }
22517
22518
22519 static int
22520 test_xmlNewText(void) {
22521     int test_ret = 0;
22522
22523     int mem_base;
22524     xmlNodePtr ret_val;
22525     xmlChar * content; /* the text content */
22526     int n_content;
22527
22528     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22529         mem_base = xmlMemBlocks();
22530         content = gen_const_xmlChar_ptr(n_content, 0);
22531
22532         ret_val = xmlNewText((const xmlChar *)content);
22533         desret_xmlNodePtr(ret_val);
22534         call_tests++;
22535         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22536         xmlResetLastError();
22537         if (mem_base != xmlMemBlocks()) {
22538             printf("Leak of %d blocks found in xmlNewText",
22539                    xmlMemBlocks() - mem_base);
22540             test_ret++;
22541             printf(" %d", n_content);
22542             printf("\n");
22543         }
22544     }
22545     function_tests++;
22546
22547     return(test_ret);
22548 }
22549
22550
22551 static int
22552 test_xmlNewTextChild(void) {
22553     int test_ret = 0;
22554
22555 #if defined(LIBXML_TREE_ENABLED)
22556 #ifdef LIBXML_TREE_ENABLED
22557     int mem_base;
22558     xmlNodePtr ret_val;
22559     xmlNodePtr parent; /* the parent node */
22560     int n_parent;
22561     xmlNsPtr ns; /* a namespace if any */
22562     int n_ns;
22563     xmlChar * name; /* the name of the child */
22564     int n_name;
22565     xmlChar * content; /* the text content of the child if any. */
22566     int n_content;
22567
22568     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
22569     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22570     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22571     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22572         mem_base = xmlMemBlocks();
22573         parent = gen_xmlNodePtr(n_parent, 0);
22574         ns = gen_xmlNsPtr(n_ns, 1);
22575         name = gen_const_xmlChar_ptr(n_name, 2);
22576         content = gen_const_xmlChar_ptr(n_content, 3);
22577
22578         ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
22579         desret_xmlNodePtr(ret_val);
22580         call_tests++;
22581         des_xmlNodePtr(n_parent, parent, 0);
22582         des_xmlNsPtr(n_ns, ns, 1);
22583         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22584         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
22585         xmlResetLastError();
22586         if (mem_base != xmlMemBlocks()) {
22587             printf("Leak of %d blocks found in xmlNewTextChild",
22588                    xmlMemBlocks() - mem_base);
22589             test_ret++;
22590             printf(" %d", n_parent);
22591             printf(" %d", n_ns);
22592             printf(" %d", n_name);
22593             printf(" %d", n_content);
22594             printf("\n");
22595         }
22596     }
22597     }
22598     }
22599     }
22600     function_tests++;
22601 #endif
22602 #endif
22603
22604     return(test_ret);
22605 }
22606
22607
22608 static int
22609 test_xmlNewTextLen(void) {
22610     int test_ret = 0;
22611
22612     int mem_base;
22613     xmlNodePtr ret_val;
22614     xmlChar * content; /* the text content */
22615     int n_content;
22616     int len; /* the text len. */
22617     int n_len;
22618
22619     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22620     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22621         mem_base = xmlMemBlocks();
22622         content = gen_const_xmlChar_ptr(n_content, 0);
22623         len = gen_int(n_len, 1);
22624         if ((content != NULL) &&
22625             (len > (int) strlen((const char *) content) + 1))
22626             continue;
22627
22628         ret_val = xmlNewTextLen((const xmlChar *)content, len);
22629         desret_xmlNodePtr(ret_val);
22630         call_tests++;
22631         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
22632         des_int(n_len, len, 1);
22633         xmlResetLastError();
22634         if (mem_base != xmlMemBlocks()) {
22635             printf("Leak of %d blocks found in xmlNewTextLen",
22636                    xmlMemBlocks() - mem_base);
22637             test_ret++;
22638             printf(" %d", n_content);
22639             printf(" %d", n_len);
22640             printf("\n");
22641         }
22642     }
22643     }
22644     function_tests++;
22645
22646     return(test_ret);
22647 }
22648
22649
22650 static int
22651 test_xmlNextElementSibling(void) {
22652     int test_ret = 0;
22653
22654 #if defined(LIBXML_TREE_ENABLED)
22655     int mem_base;
22656     xmlNodePtr ret_val;
22657     xmlNodePtr node; /* the current node */
22658     int n_node;
22659
22660     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22661         mem_base = xmlMemBlocks();
22662         node = gen_xmlNodePtr(n_node, 0);
22663
22664         ret_val = xmlNextElementSibling(node);
22665         desret_xmlNodePtr(ret_val);
22666         call_tests++;
22667         des_xmlNodePtr(n_node, node, 0);
22668         xmlResetLastError();
22669         if (mem_base != xmlMemBlocks()) {
22670             printf("Leak of %d blocks found in xmlNextElementSibling",
22671                    xmlMemBlocks() - mem_base);
22672             test_ret++;
22673             printf(" %d", n_node);
22674             printf("\n");
22675         }
22676     }
22677     function_tests++;
22678 #endif
22679
22680     return(test_ret);
22681 }
22682
22683
22684 static int
22685 test_xmlNodeAddContent(void) {
22686     int test_ret = 0;
22687
22688     int mem_base;
22689     xmlNodePtr cur; /* the node being modified */
22690     int n_cur;
22691     xmlChar * content; /* extra content */
22692     int n_content;
22693
22694     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22695     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22696         mem_base = xmlMemBlocks();
22697         cur = gen_xmlNodePtr(n_cur, 0);
22698         content = gen_const_xmlChar_ptr(n_content, 1);
22699
22700         xmlNodeAddContent(cur, (const xmlChar *)content);
22701         call_tests++;
22702         des_xmlNodePtr(n_cur, cur, 0);
22703         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22704         xmlResetLastError();
22705         if (mem_base != xmlMemBlocks()) {
22706             printf("Leak of %d blocks found in xmlNodeAddContent",
22707                    xmlMemBlocks() - mem_base);
22708             test_ret++;
22709             printf(" %d", n_cur);
22710             printf(" %d", n_content);
22711             printf("\n");
22712         }
22713     }
22714     }
22715     function_tests++;
22716
22717     return(test_ret);
22718 }
22719
22720
22721 static int
22722 test_xmlNodeAddContentLen(void) {
22723     int test_ret = 0;
22724
22725     int mem_base;
22726     xmlNodePtr cur; /* the node being modified */
22727     int n_cur;
22728     xmlChar * content; /* extra content */
22729     int n_content;
22730     int len; /* the size of @content */
22731     int n_len;
22732
22733     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22734     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22735     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22736         mem_base = xmlMemBlocks();
22737         cur = gen_xmlNodePtr(n_cur, 0);
22738         content = gen_const_xmlChar_ptr(n_content, 1);
22739         len = gen_int(n_len, 2);
22740         if ((content != NULL) &&
22741             (len > (int) strlen((const char *) content) + 1))
22742             continue;
22743
22744         xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22745         call_tests++;
22746         des_xmlNodePtr(n_cur, cur, 0);
22747         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22748         des_int(n_len, len, 2);
22749         xmlResetLastError();
22750         if (mem_base != xmlMemBlocks()) {
22751             printf("Leak of %d blocks found in xmlNodeAddContentLen",
22752                    xmlMemBlocks() - mem_base);
22753             test_ret++;
22754             printf(" %d", n_cur);
22755             printf(" %d", n_content);
22756             printf(" %d", n_len);
22757             printf("\n");
22758         }
22759     }
22760     }
22761     }
22762     function_tests++;
22763
22764     return(test_ret);
22765 }
22766
22767
22768 static int
22769 test_xmlNodeBufGetContent(void) {
22770     int test_ret = 0;
22771
22772     int mem_base;
22773     int ret_val;
22774     xmlBufferPtr buffer; /* a buffer */
22775     int n_buffer;
22776     xmlNode * cur; /* the node being read */
22777     int n_cur;
22778
22779     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22780     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22781         mem_base = xmlMemBlocks();
22782         buffer = gen_xmlBufferPtr(n_buffer, 0);
22783         cur = gen_const_xmlNode_ptr(n_cur, 1);
22784
22785         ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur);
22786         desret_int(ret_val);
22787         call_tests++;
22788         des_xmlBufferPtr(n_buffer, buffer, 0);
22789         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22790         xmlResetLastError();
22791         if (mem_base != xmlMemBlocks()) {
22792             printf("Leak of %d blocks found in xmlNodeBufGetContent",
22793                    xmlMemBlocks() - mem_base);
22794             test_ret++;
22795             printf(" %d", n_buffer);
22796             printf(" %d", n_cur);
22797             printf("\n");
22798         }
22799     }
22800     }
22801     function_tests++;
22802
22803     return(test_ret);
22804 }
22805
22806
22807 static int
22808 test_xmlNodeDump(void) {
22809     int test_ret = 0;
22810
22811 #if defined(LIBXML_OUTPUT_ENABLED)
22812     int mem_base;
22813     int ret_val;
22814     xmlBufferPtr buf; /* the XML buffer output */
22815     int n_buf;
22816     xmlDocPtr doc; /* the document */
22817     int n_doc;
22818     xmlNodePtr cur; /* the current node */
22819     int n_cur;
22820     int level; /* the imbrication level for indenting */
22821     int n_level;
22822     int format; /* is formatting allowed */
22823     int n_format;
22824
22825     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22826     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22827     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22828     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22829     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22830         mem_base = xmlMemBlocks();
22831         buf = gen_xmlBufferPtr(n_buf, 0);
22832         doc = gen_xmlDocPtr(n_doc, 1);
22833         cur = gen_xmlNodePtr(n_cur, 2);
22834         level = gen_int(n_level, 3);
22835         format = gen_int(n_format, 4);
22836
22837         ret_val = xmlNodeDump(buf, doc, cur, level, format);
22838         desret_int(ret_val);
22839         call_tests++;
22840         des_xmlBufferPtr(n_buf, buf, 0);
22841         des_xmlDocPtr(n_doc, doc, 1);
22842         des_xmlNodePtr(n_cur, cur, 2);
22843         des_int(n_level, level, 3);
22844         des_int(n_format, format, 4);
22845         xmlResetLastError();
22846         if (mem_base != xmlMemBlocks()) {
22847             printf("Leak of %d blocks found in xmlNodeDump",
22848                    xmlMemBlocks() - mem_base);
22849             test_ret++;
22850             printf(" %d", n_buf);
22851             printf(" %d", n_doc);
22852             printf(" %d", n_cur);
22853             printf(" %d", n_level);
22854             printf(" %d", n_format);
22855             printf("\n");
22856         }
22857     }
22858     }
22859     }
22860     }
22861     }
22862     function_tests++;
22863 #endif
22864
22865     return(test_ret);
22866 }
22867
22868
22869 static int
22870 test_xmlNodeDumpOutput(void) {
22871     int test_ret = 0;
22872
22873 #if defined(LIBXML_OUTPUT_ENABLED)
22874     int mem_base;
22875     xmlOutputBufferPtr buf; /* the XML buffer output */
22876     int n_buf;
22877     xmlDocPtr doc; /* the document */
22878     int n_doc;
22879     xmlNodePtr cur; /* the current node */
22880     int n_cur;
22881     int level; /* the imbrication level for indenting */
22882     int n_level;
22883     int format; /* is formatting allowed */
22884     int n_format;
22885     char * encoding; /* an optional encoding string */
22886     int n_encoding;
22887
22888     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22889     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22890     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22891     for (n_level = 0;n_level < gen_nb_int;n_level++) {
22892     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22893     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22894         mem_base = xmlMemBlocks();
22895         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22896         doc = gen_xmlDocPtr(n_doc, 1);
22897         cur = gen_xmlNodePtr(n_cur, 2);
22898         level = gen_int(n_level, 3);
22899         format = gen_int(n_format, 4);
22900         encoding = gen_const_char_ptr(n_encoding, 5);
22901
22902         xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22903         call_tests++;
22904         des_xmlOutputBufferPtr(n_buf, buf, 0);
22905         des_xmlDocPtr(n_doc, doc, 1);
22906         des_xmlNodePtr(n_cur, cur, 2);
22907         des_int(n_level, level, 3);
22908         des_int(n_format, format, 4);
22909         des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22910         xmlResetLastError();
22911         if (mem_base != xmlMemBlocks()) {
22912             printf("Leak of %d blocks found in xmlNodeDumpOutput",
22913                    xmlMemBlocks() - mem_base);
22914             test_ret++;
22915             printf(" %d", n_buf);
22916             printf(" %d", n_doc);
22917             printf(" %d", n_cur);
22918             printf(" %d", n_level);
22919             printf(" %d", n_format);
22920             printf(" %d", n_encoding);
22921             printf("\n");
22922         }
22923     }
22924     }
22925     }
22926     }
22927     }
22928     }
22929     function_tests++;
22930 #endif
22931
22932     return(test_ret);
22933 }
22934
22935
22936 static int
22937 test_xmlNodeGetBase(void) {
22938     int test_ret = 0;
22939
22940     int mem_base;
22941     xmlChar * ret_val;
22942     xmlDoc * doc; /* the document the node pertains to */
22943     int n_doc;
22944     xmlNode * cur; /* the node being checked */
22945     int n_cur;
22946
22947     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
22948     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22949         mem_base = xmlMemBlocks();
22950         doc = gen_const_xmlDoc_ptr(n_doc, 0);
22951         cur = gen_const_xmlNode_ptr(n_cur, 1);
22952
22953         ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur);
22954         desret_xmlChar_ptr(ret_val);
22955         call_tests++;
22956         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
22957         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
22958         xmlResetLastError();
22959         if (mem_base != xmlMemBlocks()) {
22960             printf("Leak of %d blocks found in xmlNodeGetBase",
22961                    xmlMemBlocks() - mem_base);
22962             test_ret++;
22963             printf(" %d", n_doc);
22964             printf(" %d", n_cur);
22965             printf("\n");
22966         }
22967     }
22968     }
22969     function_tests++;
22970
22971     return(test_ret);
22972 }
22973
22974
22975 static int
22976 test_xmlNodeGetContent(void) {
22977     int test_ret = 0;
22978
22979     int mem_base;
22980     xmlChar * ret_val;
22981     xmlNode * cur; /* the node being read */
22982     int n_cur;
22983
22984     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
22985         mem_base = xmlMemBlocks();
22986         cur = gen_const_xmlNode_ptr(n_cur, 0);
22987
22988         ret_val = xmlNodeGetContent((const xmlNode *)cur);
22989         desret_xmlChar_ptr(ret_val);
22990         call_tests++;
22991         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
22992         xmlResetLastError();
22993         if (mem_base != xmlMemBlocks()) {
22994             printf("Leak of %d blocks found in xmlNodeGetContent",
22995                    xmlMemBlocks() - mem_base);
22996             test_ret++;
22997             printf(" %d", n_cur);
22998             printf("\n");
22999         }
23000     }
23001     function_tests++;
23002
23003     return(test_ret);
23004 }
23005
23006
23007 static int
23008 test_xmlNodeGetLang(void) {
23009     int test_ret = 0;
23010
23011     int mem_base;
23012     xmlChar * ret_val;
23013     xmlNode * cur; /* the node being checked */
23014     int n_cur;
23015
23016     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
23017         mem_base = xmlMemBlocks();
23018         cur = gen_const_xmlNode_ptr(n_cur, 0);
23019
23020         ret_val = xmlNodeGetLang((const xmlNode *)cur);
23021         desret_xmlChar_ptr(ret_val);
23022         call_tests++;
23023         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
23024         xmlResetLastError();
23025         if (mem_base != xmlMemBlocks()) {
23026             printf("Leak of %d blocks found in xmlNodeGetLang",
23027                    xmlMemBlocks() - mem_base);
23028             test_ret++;
23029             printf(" %d", n_cur);
23030             printf("\n");
23031         }
23032     }
23033     function_tests++;
23034
23035     return(test_ret);
23036 }
23037
23038
23039 static int
23040 test_xmlNodeGetSpacePreserve(void) {
23041     int test_ret = 0;
23042
23043     int mem_base;
23044     int ret_val;
23045     xmlNode * cur; /* the node being checked */
23046     int n_cur;
23047
23048     for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
23049         mem_base = xmlMemBlocks();
23050         cur = gen_const_xmlNode_ptr(n_cur, 0);
23051
23052         ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur);
23053         desret_int(ret_val);
23054         call_tests++;
23055         des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
23056         xmlResetLastError();
23057         if (mem_base != xmlMemBlocks()) {
23058             printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
23059                    xmlMemBlocks() - mem_base);
23060             test_ret++;
23061             printf(" %d", n_cur);
23062             printf("\n");
23063         }
23064     }
23065     function_tests++;
23066
23067     return(test_ret);
23068 }
23069
23070
23071 static int
23072 test_xmlNodeIsText(void) {
23073     int test_ret = 0;
23074
23075     int mem_base;
23076     int ret_val;
23077     xmlNode * node; /* the node */
23078     int n_node;
23079
23080     for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
23081         mem_base = xmlMemBlocks();
23082         node = gen_const_xmlNode_ptr(n_node, 0);
23083
23084         ret_val = xmlNodeIsText((const xmlNode *)node);
23085         desret_int(ret_val);
23086         call_tests++;
23087         des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
23088         xmlResetLastError();
23089         if (mem_base != xmlMemBlocks()) {
23090             printf("Leak of %d blocks found in xmlNodeIsText",
23091                    xmlMemBlocks() - mem_base);
23092             test_ret++;
23093             printf(" %d", n_node);
23094             printf("\n");
23095         }
23096     }
23097     function_tests++;
23098
23099     return(test_ret);
23100 }
23101
23102
23103 static int
23104 test_xmlNodeListGetRawString(void) {
23105     int test_ret = 0;
23106
23107 #if defined(LIBXML_TREE_ENABLED)
23108     int mem_base;
23109     xmlChar * ret_val;
23110     xmlDoc * doc; /* the document */
23111     int n_doc;
23112     xmlNode * list; /* a Node list */
23113     int n_list;
23114     int inLine; /* should we replace entity contents or show their external form */
23115     int n_inLine;
23116
23117     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
23118     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
23119     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
23120         mem_base = xmlMemBlocks();
23121         doc = gen_const_xmlDoc_ptr(n_doc, 0);
23122         list = gen_const_xmlNode_ptr(n_list, 1);
23123         inLine = gen_int(n_inLine, 2);
23124
23125         ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine);
23126         desret_xmlChar_ptr(ret_val);
23127         call_tests++;
23128         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
23129         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
23130         des_int(n_inLine, inLine, 2);
23131         xmlResetLastError();
23132         if (mem_base != xmlMemBlocks()) {
23133             printf("Leak of %d blocks found in xmlNodeListGetRawString",
23134                    xmlMemBlocks() - mem_base);
23135             test_ret++;
23136             printf(" %d", n_doc);
23137             printf(" %d", n_list);
23138             printf(" %d", n_inLine);
23139             printf("\n");
23140         }
23141     }
23142     }
23143     }
23144     function_tests++;
23145 #endif
23146
23147     return(test_ret);
23148 }
23149
23150
23151 static int
23152 test_xmlNodeListGetString(void) {
23153     int test_ret = 0;
23154
23155     int mem_base;
23156     xmlChar * ret_val;
23157     xmlDocPtr doc; /* the document */
23158     int n_doc;
23159     xmlNode * list; /* a Node list */
23160     int n_list;
23161     int inLine; /* should we replace entity contents or show their external form */
23162     int n_inLine;
23163
23164     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23165     for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
23166     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
23167         mem_base = xmlMemBlocks();
23168         doc = gen_xmlDocPtr(n_doc, 0);
23169         list = gen_const_xmlNode_ptr(n_list, 1);
23170         inLine = gen_int(n_inLine, 2);
23171
23172         ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine);
23173         desret_xmlChar_ptr(ret_val);
23174         call_tests++;
23175         des_xmlDocPtr(n_doc, doc, 0);
23176         des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
23177         des_int(n_inLine, inLine, 2);
23178         xmlResetLastError();
23179         if (mem_base != xmlMemBlocks()) {
23180             printf("Leak of %d blocks found in xmlNodeListGetString",
23181                    xmlMemBlocks() - mem_base);
23182             test_ret++;
23183             printf(" %d", n_doc);
23184             printf(" %d", n_list);
23185             printf(" %d", n_inLine);
23186             printf("\n");
23187         }
23188     }
23189     }
23190     }
23191     function_tests++;
23192
23193     return(test_ret);
23194 }
23195
23196
23197 static int
23198 test_xmlNodeSetBase(void) {
23199     int test_ret = 0;
23200
23201 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
23202     int mem_base;
23203     xmlNodePtr cur; /* the node being changed */
23204     int n_cur;
23205     xmlChar * uri; /* the new base URI */
23206     int n_uri;
23207
23208     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23209     for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
23210         mem_base = xmlMemBlocks();
23211         cur = gen_xmlNodePtr(n_cur, 0);
23212         uri = gen_const_xmlChar_ptr(n_uri, 1);
23213
23214         xmlNodeSetBase(cur, (const xmlChar *)uri);
23215         call_tests++;
23216         des_xmlNodePtr(n_cur, cur, 0);
23217         des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
23218         xmlResetLastError();
23219         if (mem_base != xmlMemBlocks()) {
23220             printf("Leak of %d blocks found in xmlNodeSetBase",
23221                    xmlMemBlocks() - mem_base);
23222             test_ret++;
23223             printf(" %d", n_cur);
23224             printf(" %d", n_uri);
23225             printf("\n");
23226         }
23227     }
23228     }
23229     function_tests++;
23230 #endif
23231
23232     return(test_ret);
23233 }
23234
23235
23236 static int
23237 test_xmlNodeSetContent(void) {
23238     int test_ret = 0;
23239
23240     int mem_base;
23241     xmlNodePtr cur; /* the node being modified */
23242     int n_cur;
23243     xmlChar * content; /* the new value of the content */
23244     int n_content;
23245
23246     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23247     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23248         mem_base = xmlMemBlocks();
23249         cur = gen_xmlNodePtr(n_cur, 0);
23250         content = gen_const_xmlChar_ptr(n_content, 1);
23251
23252         xmlNodeSetContent(cur, (const xmlChar *)content);
23253         call_tests++;
23254         des_xmlNodePtr(n_cur, cur, 0);
23255         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23256         xmlResetLastError();
23257         if (mem_base != xmlMemBlocks()) {
23258             printf("Leak of %d blocks found in xmlNodeSetContent",
23259                    xmlMemBlocks() - mem_base);
23260             test_ret++;
23261             printf(" %d", n_cur);
23262             printf(" %d", n_content);
23263             printf("\n");
23264         }
23265     }
23266     }
23267     function_tests++;
23268
23269     return(test_ret);
23270 }
23271
23272
23273 static int
23274 test_xmlNodeSetContentLen(void) {
23275     int test_ret = 0;
23276
23277 #if defined(LIBXML_TREE_ENABLED)
23278     int mem_base;
23279     xmlNodePtr cur; /* the node being modified */
23280     int n_cur;
23281     xmlChar * content; /* the new value of the content */
23282     int n_content;
23283     int len; /* the size of @content */
23284     int n_len;
23285
23286     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23287     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23288     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23289         mem_base = xmlMemBlocks();
23290         cur = gen_xmlNodePtr(n_cur, 0);
23291         content = gen_const_xmlChar_ptr(n_content, 1);
23292         len = gen_int(n_len, 2);
23293         if ((content != NULL) &&
23294             (len > (int) strlen((const char *) content) + 1))
23295             continue;
23296
23297         xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
23298         call_tests++;
23299         des_xmlNodePtr(n_cur, cur, 0);
23300         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23301         des_int(n_len, len, 2);
23302         xmlResetLastError();
23303         if (mem_base != xmlMemBlocks()) {
23304             printf("Leak of %d blocks found in xmlNodeSetContentLen",
23305                    xmlMemBlocks() - mem_base);
23306             test_ret++;
23307             printf(" %d", n_cur);
23308             printf(" %d", n_content);
23309             printf(" %d", n_len);
23310             printf("\n");
23311         }
23312     }
23313     }
23314     }
23315     function_tests++;
23316 #endif
23317
23318     return(test_ret);
23319 }
23320
23321
23322 static int
23323 test_xmlNodeSetLang(void) {
23324     int test_ret = 0;
23325
23326 #if defined(LIBXML_TREE_ENABLED)
23327     int mem_base;
23328     xmlNodePtr cur; /* the node being changed */
23329     int n_cur;
23330     xmlChar * lang; /* the language description */
23331     int n_lang;
23332
23333     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23334     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
23335         mem_base = xmlMemBlocks();
23336         cur = gen_xmlNodePtr(n_cur, 0);
23337         lang = gen_const_xmlChar_ptr(n_lang, 1);
23338
23339         xmlNodeSetLang(cur, (const xmlChar *)lang);
23340         call_tests++;
23341         des_xmlNodePtr(n_cur, cur, 0);
23342         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
23343         xmlResetLastError();
23344         if (mem_base != xmlMemBlocks()) {
23345             printf("Leak of %d blocks found in xmlNodeSetLang",
23346                    xmlMemBlocks() - mem_base);
23347             test_ret++;
23348             printf(" %d", n_cur);
23349             printf(" %d", n_lang);
23350             printf("\n");
23351         }
23352     }
23353     }
23354     function_tests++;
23355 #endif
23356
23357     return(test_ret);
23358 }
23359
23360
23361 static int
23362 test_xmlNodeSetName(void) {
23363     int test_ret = 0;
23364
23365 #if defined(LIBXML_TREE_ENABLED)
23366     int mem_base;
23367     xmlNodePtr cur; /* the node being changed */
23368     int n_cur;
23369     xmlChar * name; /* the new tag name */
23370     int n_name;
23371
23372     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23373     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23374         mem_base = xmlMemBlocks();
23375         cur = gen_xmlNodePtr(n_cur, 0);
23376         name = gen_const_xmlChar_ptr(n_name, 1);
23377
23378         xmlNodeSetName(cur, (const xmlChar *)name);
23379         call_tests++;
23380         des_xmlNodePtr(n_cur, cur, 0);
23381         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23382         xmlResetLastError();
23383         if (mem_base != xmlMemBlocks()) {
23384             printf("Leak of %d blocks found in xmlNodeSetName",
23385                    xmlMemBlocks() - mem_base);
23386             test_ret++;
23387             printf(" %d", n_cur);
23388             printf(" %d", n_name);
23389             printf("\n");
23390         }
23391     }
23392     }
23393     function_tests++;
23394 #endif
23395
23396     return(test_ret);
23397 }
23398
23399
23400 static int
23401 test_xmlNodeSetSpacePreserve(void) {
23402     int test_ret = 0;
23403
23404 #if defined(LIBXML_TREE_ENABLED)
23405     int mem_base;
23406     xmlNodePtr cur; /* the node being changed */
23407     int n_cur;
23408     int val; /* the xml:space value ("0": default, 1: "preserve") */
23409     int n_val;
23410
23411     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
23412     for (n_val = 0;n_val < gen_nb_int;n_val++) {
23413         mem_base = xmlMemBlocks();
23414         cur = gen_xmlNodePtr(n_cur, 0);
23415         val = gen_int(n_val, 1);
23416
23417         xmlNodeSetSpacePreserve(cur, val);
23418         call_tests++;
23419         des_xmlNodePtr(n_cur, cur, 0);
23420         des_int(n_val, val, 1);
23421         xmlResetLastError();
23422         if (mem_base != xmlMemBlocks()) {
23423             printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
23424                    xmlMemBlocks() - mem_base);
23425             test_ret++;
23426             printf(" %d", n_cur);
23427             printf(" %d", n_val);
23428             printf("\n");
23429         }
23430     }
23431     }
23432     function_tests++;
23433 #endif
23434
23435     return(test_ret);
23436 }
23437
23438
23439 static int
23440 test_xmlPreviousElementSibling(void) {
23441     int test_ret = 0;
23442
23443 #if defined(LIBXML_TREE_ENABLED)
23444     int mem_base;
23445     xmlNodePtr ret_val;
23446     xmlNodePtr node; /* the current node */
23447     int n_node;
23448
23449     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23450         mem_base = xmlMemBlocks();
23451         node = gen_xmlNodePtr(n_node, 0);
23452
23453         ret_val = xmlPreviousElementSibling(node);
23454         desret_xmlNodePtr(ret_val);
23455         call_tests++;
23456         des_xmlNodePtr(n_node, node, 0);
23457         xmlResetLastError();
23458         if (mem_base != xmlMemBlocks()) {
23459             printf("Leak of %d blocks found in xmlPreviousElementSibling",
23460                    xmlMemBlocks() - mem_base);
23461             test_ret++;
23462             printf(" %d", n_node);
23463             printf("\n");
23464         }
23465     }
23466     function_tests++;
23467 #endif
23468
23469     return(test_ret);
23470 }
23471
23472
23473 static int
23474 test_xmlReconciliateNs(void) {
23475     int test_ret = 0;
23476
23477 #if defined(LIBXML_TREE_ENABLED)
23478 #ifdef LIBXML_TREE_ENABLED
23479     int mem_base;
23480     int ret_val;
23481     xmlDocPtr doc; /* the document */
23482     int n_doc;
23483     xmlNodePtr tree; /* a node defining the subtree to reconciliate */
23484     int n_tree;
23485
23486     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23487     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
23488         mem_base = xmlMemBlocks();
23489         doc = gen_xmlDocPtr(n_doc, 0);
23490         tree = gen_xmlNodePtr(n_tree, 1);
23491
23492         ret_val = xmlReconciliateNs(doc, tree);
23493         desret_int(ret_val);
23494         call_tests++;
23495         des_xmlDocPtr(n_doc, doc, 0);
23496         des_xmlNodePtr(n_tree, tree, 1);
23497         xmlResetLastError();
23498         if (mem_base != xmlMemBlocks()) {
23499             printf("Leak of %d blocks found in xmlReconciliateNs",
23500                    xmlMemBlocks() - mem_base);
23501             test_ret++;
23502             printf(" %d", n_doc);
23503             printf(" %d", n_tree);
23504             printf("\n");
23505         }
23506     }
23507     }
23508     function_tests++;
23509 #endif
23510 #endif
23511
23512     return(test_ret);
23513 }
23514
23515
23516 static int
23517 test_xmlRemoveProp(void) {
23518     int test_ret = 0;
23519
23520     int mem_base;
23521     int ret_val;
23522     xmlAttrPtr cur; /* an attribute */
23523     int n_cur;
23524
23525     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
23526         mem_base = xmlMemBlocks();
23527         cur = gen_xmlAttrPtr(n_cur, 0);
23528
23529         ret_val = xmlRemoveProp(cur);
23530         cur = NULL;
23531         desret_int(ret_val);
23532         call_tests++;
23533         des_xmlAttrPtr(n_cur, cur, 0);
23534         xmlResetLastError();
23535         if (mem_base != xmlMemBlocks()) {
23536             printf("Leak of %d blocks found in xmlRemoveProp",
23537                    xmlMemBlocks() - mem_base);
23538             test_ret++;
23539             printf(" %d", n_cur);
23540             printf("\n");
23541         }
23542     }
23543     function_tests++;
23544
23545     return(test_ret);
23546 }
23547
23548
23549 static int
23550 test_xmlReplaceNode(void) {
23551     int test_ret = 0;
23552
23553 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
23554     int mem_base;
23555     xmlNodePtr ret_val;
23556     xmlNodePtr old; /* the old node */
23557     int n_old;
23558     xmlNodePtr cur; /* the node */
23559     int n_cur;
23560
23561     for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
23562     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
23563         mem_base = xmlMemBlocks();
23564         old = gen_xmlNodePtr(n_old, 0);
23565         cur = gen_xmlNodePtr_in(n_cur, 1);
23566
23567         ret_val = xmlReplaceNode(old, cur);
23568         if (cur != NULL) {
23569               xmlUnlinkNode(cur);
23570               xmlFreeNode(cur) ; cur = NULL ; }
23571           if (old != NULL) {
23572               xmlUnlinkNode(old);
23573               xmlFreeNode(old) ; old = NULL ; }
23574           ret_val = NULL;
23575         desret_xmlNodePtr(ret_val);
23576         call_tests++;
23577         des_xmlNodePtr(n_old, old, 0);
23578         des_xmlNodePtr_in(n_cur, cur, 1);
23579         xmlResetLastError();
23580         if (mem_base != xmlMemBlocks()) {
23581             printf("Leak of %d blocks found in xmlReplaceNode",
23582                    xmlMemBlocks() - mem_base);
23583             test_ret++;
23584             printf(" %d", n_old);
23585             printf(" %d", n_cur);
23586             printf("\n");
23587         }
23588     }
23589     }
23590     function_tests++;
23591 #endif
23592
23593     return(test_ret);
23594 }
23595
23596
23597 static int
23598 test_xmlSaveFile(void) {
23599     int test_ret = 0;
23600
23601 #if defined(LIBXML_OUTPUT_ENABLED)
23602     int mem_base;
23603     int ret_val;
23604     const char * filename; /* the filename (or URL) */
23605     int n_filename;
23606     xmlDocPtr cur; /* the document */
23607     int n_cur;
23608
23609     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23610     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23611         mem_base = xmlMemBlocks();
23612         filename = gen_fileoutput(n_filename, 0);
23613         cur = gen_xmlDocPtr(n_cur, 1);
23614
23615         ret_val = xmlSaveFile(filename, cur);
23616         desret_int(ret_val);
23617         call_tests++;
23618         des_fileoutput(n_filename, filename, 0);
23619         des_xmlDocPtr(n_cur, cur, 1);
23620         xmlResetLastError();
23621         if (mem_base != xmlMemBlocks()) {
23622             printf("Leak of %d blocks found in xmlSaveFile",
23623                    xmlMemBlocks() - mem_base);
23624             test_ret++;
23625             printf(" %d", n_filename);
23626             printf(" %d", n_cur);
23627             printf("\n");
23628         }
23629     }
23630     }
23631     function_tests++;
23632 #endif
23633
23634     return(test_ret);
23635 }
23636
23637
23638 static int
23639 test_xmlSaveFileEnc(void) {
23640     int test_ret = 0;
23641
23642 #if defined(LIBXML_OUTPUT_ENABLED)
23643     int mem_base;
23644     int ret_val;
23645     const char * filename; /* the filename (or URL) */
23646     int n_filename;
23647     xmlDocPtr cur; /* the document */
23648     int n_cur;
23649     char * encoding; /* the name of an encoding (or NULL) */
23650     int n_encoding;
23651
23652     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23653     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23654     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23655         mem_base = xmlMemBlocks();
23656         filename = gen_fileoutput(n_filename, 0);
23657         cur = gen_xmlDocPtr(n_cur, 1);
23658         encoding = gen_const_char_ptr(n_encoding, 2);
23659
23660         ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
23661         desret_int(ret_val);
23662         call_tests++;
23663         des_fileoutput(n_filename, filename, 0);
23664         des_xmlDocPtr(n_cur, cur, 1);
23665         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23666         xmlResetLastError();
23667         if (mem_base != xmlMemBlocks()) {
23668             printf("Leak of %d blocks found in xmlSaveFileEnc",
23669                    xmlMemBlocks() - mem_base);
23670             test_ret++;
23671             printf(" %d", n_filename);
23672             printf(" %d", n_cur);
23673             printf(" %d", n_encoding);
23674             printf("\n");
23675         }
23676     }
23677     }
23678     }
23679     function_tests++;
23680 #endif
23681
23682     return(test_ret);
23683 }
23684
23685
23686 static int
23687 test_xmlSaveFileTo(void) {
23688     int test_ret = 0;
23689
23690 #if defined(LIBXML_OUTPUT_ENABLED)
23691     int mem_base;
23692     int ret_val;
23693     xmlOutputBufferPtr buf; /* an output I/O buffer */
23694     int n_buf;
23695     xmlDocPtr cur; /* the document */
23696     int n_cur;
23697     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23698     int n_encoding;
23699
23700     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23701     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23702     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23703         mem_base = xmlMemBlocks();
23704         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23705         cur = gen_xmlDocPtr(n_cur, 1);
23706         encoding = gen_const_char_ptr(n_encoding, 2);
23707
23708         ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
23709         buf = NULL;
23710         desret_int(ret_val);
23711         call_tests++;
23712         des_xmlOutputBufferPtr(n_buf, buf, 0);
23713         des_xmlDocPtr(n_cur, cur, 1);
23714         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23715         xmlResetLastError();
23716         if (mem_base != xmlMemBlocks()) {
23717             printf("Leak of %d blocks found in xmlSaveFileTo",
23718                    xmlMemBlocks() - mem_base);
23719             test_ret++;
23720             printf(" %d", n_buf);
23721             printf(" %d", n_cur);
23722             printf(" %d", n_encoding);
23723             printf("\n");
23724         }
23725     }
23726     }
23727     }
23728     function_tests++;
23729 #endif
23730
23731     return(test_ret);
23732 }
23733
23734
23735 static int
23736 test_xmlSaveFormatFile(void) {
23737     int test_ret = 0;
23738
23739 #if defined(LIBXML_OUTPUT_ENABLED)
23740     int mem_base;
23741     int ret_val;
23742     const char * filename; /* the filename (or URL) */
23743     int n_filename;
23744     xmlDocPtr cur; /* the document */
23745     int n_cur;
23746     int format; /* should formatting spaces been added */
23747     int n_format;
23748
23749     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23750     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23751     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23752         mem_base = xmlMemBlocks();
23753         filename = gen_fileoutput(n_filename, 0);
23754         cur = gen_xmlDocPtr(n_cur, 1);
23755         format = gen_int(n_format, 2);
23756
23757         ret_val = xmlSaveFormatFile(filename, cur, format);
23758         desret_int(ret_val);
23759         call_tests++;
23760         des_fileoutput(n_filename, filename, 0);
23761         des_xmlDocPtr(n_cur, cur, 1);
23762         des_int(n_format, format, 2);
23763         xmlResetLastError();
23764         if (mem_base != xmlMemBlocks()) {
23765             printf("Leak of %d blocks found in xmlSaveFormatFile",
23766                    xmlMemBlocks() - mem_base);
23767             test_ret++;
23768             printf(" %d", n_filename);
23769             printf(" %d", n_cur);
23770             printf(" %d", n_format);
23771             printf("\n");
23772         }
23773     }
23774     }
23775     }
23776     function_tests++;
23777 #endif
23778
23779     return(test_ret);
23780 }
23781
23782
23783 static int
23784 test_xmlSaveFormatFileEnc(void) {
23785     int test_ret = 0;
23786
23787 #if defined(LIBXML_OUTPUT_ENABLED)
23788     int mem_base;
23789     int ret_val;
23790     const char * filename; /* the filename or URL to output */
23791     int n_filename;
23792     xmlDocPtr cur; /* the document being saved */
23793     int n_cur;
23794     char * encoding; /* the name of the encoding to use or NULL. */
23795     int n_encoding;
23796     int format; /* should formatting spaces be added. */
23797     int n_format;
23798
23799     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23800     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23801     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23802     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23803         mem_base = xmlMemBlocks();
23804         filename = gen_fileoutput(n_filename, 0);
23805         cur = gen_xmlDocPtr(n_cur, 1);
23806         encoding = gen_const_char_ptr(n_encoding, 2);
23807         format = gen_int(n_format, 3);
23808
23809         ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23810         desret_int(ret_val);
23811         call_tests++;
23812         des_fileoutput(n_filename, filename, 0);
23813         des_xmlDocPtr(n_cur, cur, 1);
23814         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23815         des_int(n_format, format, 3);
23816         xmlResetLastError();
23817         if (mem_base != xmlMemBlocks()) {
23818             printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23819                    xmlMemBlocks() - mem_base);
23820             test_ret++;
23821             printf(" %d", n_filename);
23822             printf(" %d", n_cur);
23823             printf(" %d", n_encoding);
23824             printf(" %d", n_format);
23825             printf("\n");
23826         }
23827     }
23828     }
23829     }
23830     }
23831     function_tests++;
23832 #endif
23833
23834     return(test_ret);
23835 }
23836
23837
23838 static int
23839 test_xmlSaveFormatFileTo(void) {
23840     int test_ret = 0;
23841
23842 #if defined(LIBXML_OUTPUT_ENABLED)
23843     int mem_base;
23844     int ret_val;
23845     xmlOutputBufferPtr buf; /* an output I/O buffer */
23846     int n_buf;
23847     xmlDocPtr cur; /* the document */
23848     int n_cur;
23849     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23850     int n_encoding;
23851     int format; /* should formatting spaces been added */
23852     int n_format;
23853
23854     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23855     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23856     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23857     for (n_format = 0;n_format < gen_nb_int;n_format++) {
23858         mem_base = xmlMemBlocks();
23859         buf = gen_xmlOutputBufferPtr(n_buf, 0);
23860         cur = gen_xmlDocPtr(n_cur, 1);
23861         encoding = gen_const_char_ptr(n_encoding, 2);
23862         format = gen_int(n_format, 3);
23863
23864         ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23865         buf = NULL;
23866         desret_int(ret_val);
23867         call_tests++;
23868         des_xmlOutputBufferPtr(n_buf, buf, 0);
23869         des_xmlDocPtr(n_cur, cur, 1);
23870         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23871         des_int(n_format, format, 3);
23872         xmlResetLastError();
23873         if (mem_base != xmlMemBlocks()) {
23874             printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23875                    xmlMemBlocks() - mem_base);
23876             test_ret++;
23877             printf(" %d", n_buf);
23878             printf(" %d", n_cur);
23879             printf(" %d", n_encoding);
23880             printf(" %d", n_format);
23881             printf("\n");
23882         }
23883     }
23884     }
23885     }
23886     }
23887     function_tests++;
23888 #endif
23889
23890     return(test_ret);
23891 }
23892
23893
23894 static int
23895 test_xmlSearchNs(void) {
23896     int test_ret = 0;
23897
23898     int mem_base;
23899     xmlNsPtr ret_val;
23900     xmlDocPtr doc; /* the document */
23901     int n_doc;
23902     xmlNodePtr node; /* the current node */
23903     int n_node;
23904     xmlChar * nameSpace; /* the namespace prefix */
23905     int n_nameSpace;
23906
23907     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23908     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23909     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23910         mem_base = xmlMemBlocks();
23911         doc = gen_xmlDocPtr(n_doc, 0);
23912         node = gen_xmlNodePtr(n_node, 1);
23913         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23914
23915         ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23916         desret_xmlNsPtr(ret_val);
23917         call_tests++;
23918         des_xmlDocPtr(n_doc, doc, 0);
23919         des_xmlNodePtr(n_node, node, 1);
23920         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23921         xmlResetLastError();
23922         if (mem_base != xmlMemBlocks()) {
23923             printf("Leak of %d blocks found in xmlSearchNs",
23924                    xmlMemBlocks() - mem_base);
23925             test_ret++;
23926             printf(" %d", n_doc);
23927             printf(" %d", n_node);
23928             printf(" %d", n_nameSpace);
23929             printf("\n");
23930         }
23931     }
23932     }
23933     }
23934     function_tests++;
23935
23936     return(test_ret);
23937 }
23938
23939
23940 static int
23941 test_xmlSearchNsByHref(void) {
23942     int test_ret = 0;
23943
23944     int mem_base;
23945     xmlNsPtr ret_val;
23946     xmlDocPtr doc; /* the document */
23947     int n_doc;
23948     xmlNodePtr node; /* the current node */
23949     int n_node;
23950     xmlChar * href; /* the namespace value */
23951     int n_href;
23952
23953     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23954     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23955     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23956         mem_base = xmlMemBlocks();
23957         doc = gen_xmlDocPtr(n_doc, 0);
23958         node = gen_xmlNodePtr(n_node, 1);
23959         href = gen_const_xmlChar_ptr(n_href, 2);
23960
23961         ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23962         desret_xmlNsPtr(ret_val);
23963         call_tests++;
23964         des_xmlDocPtr(n_doc, doc, 0);
23965         des_xmlNodePtr(n_node, node, 1);
23966         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23967         xmlResetLastError();
23968         if (mem_base != xmlMemBlocks()) {
23969             printf("Leak of %d blocks found in xmlSearchNsByHref",
23970                    xmlMemBlocks() - mem_base);
23971             test_ret++;
23972             printf(" %d", n_doc);
23973             printf(" %d", n_node);
23974             printf(" %d", n_href);
23975             printf("\n");
23976         }
23977     }
23978     }
23979     }
23980     function_tests++;
23981
23982     return(test_ret);
23983 }
23984
23985
23986 static int
23987 test_xmlSetBufferAllocationScheme(void) {
23988     int test_ret = 0;
23989
23990     int mem_base;
23991     xmlBufferAllocationScheme scheme; /* allocation method to use */
23992     int n_scheme;
23993
23994     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23995         mem_base = xmlMemBlocks();
23996         scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23997
23998         xmlSetBufferAllocationScheme(scheme);
23999         call_tests++;
24000         des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
24001         xmlResetLastError();
24002         if (mem_base != xmlMemBlocks()) {
24003             printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
24004                    xmlMemBlocks() - mem_base);
24005             test_ret++;
24006             printf(" %d", n_scheme);
24007             printf("\n");
24008         }
24009     }
24010     function_tests++;
24011
24012     return(test_ret);
24013 }
24014
24015
24016 static int
24017 test_xmlSetCompressMode(void) {
24018     int test_ret = 0;
24019
24020     int mem_base;
24021     int mode; /* the compression ratio */
24022     int n_mode;
24023
24024     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
24025         mem_base = xmlMemBlocks();
24026         mode = gen_int(n_mode, 0);
24027
24028         xmlSetCompressMode(mode);
24029         call_tests++;
24030         des_int(n_mode, mode, 0);
24031         xmlResetLastError();
24032         if (mem_base != xmlMemBlocks()) {
24033             printf("Leak of %d blocks found in xmlSetCompressMode",
24034                    xmlMemBlocks() - mem_base);
24035             test_ret++;
24036             printf(" %d", n_mode);
24037             printf("\n");
24038         }
24039     }
24040     function_tests++;
24041
24042     return(test_ret);
24043 }
24044
24045
24046 static int
24047 test_xmlSetDocCompressMode(void) {
24048     int test_ret = 0;
24049
24050     int mem_base;
24051     xmlDocPtr doc; /* the document */
24052     int n_doc;
24053     int mode; /* the compression ratio */
24054     int n_mode;
24055
24056     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24057     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
24058         mem_base = xmlMemBlocks();
24059         doc = gen_xmlDocPtr(n_doc, 0);
24060         mode = gen_int(n_mode, 1);
24061
24062         xmlSetDocCompressMode(doc, mode);
24063         call_tests++;
24064         des_xmlDocPtr(n_doc, doc, 0);
24065         des_int(n_mode, mode, 1);
24066         xmlResetLastError();
24067         if (mem_base != xmlMemBlocks()) {
24068             printf("Leak of %d blocks found in xmlSetDocCompressMode",
24069                    xmlMemBlocks() - mem_base);
24070             test_ret++;
24071             printf(" %d", n_doc);
24072             printf(" %d", n_mode);
24073             printf("\n");
24074         }
24075     }
24076     }
24077     function_tests++;
24078
24079     return(test_ret);
24080 }
24081
24082
24083 static int
24084 test_xmlSetNs(void) {
24085     int test_ret = 0;
24086
24087     int mem_base;
24088     xmlNodePtr node; /* a node in the document */
24089     int n_node;
24090     xmlNsPtr ns; /* a namespace pointer */
24091     int n_ns;
24092
24093     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24094     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
24095         mem_base = xmlMemBlocks();
24096         node = gen_xmlNodePtr(n_node, 0);
24097         ns = gen_xmlNsPtr(n_ns, 1);
24098
24099         xmlSetNs(node, ns);
24100         call_tests++;
24101         des_xmlNodePtr(n_node, node, 0);
24102         des_xmlNsPtr(n_ns, ns, 1);
24103         xmlResetLastError();
24104         if (mem_base != xmlMemBlocks()) {
24105             printf("Leak of %d blocks found in xmlSetNs",
24106                    xmlMemBlocks() - mem_base);
24107             test_ret++;
24108             printf(" %d", n_node);
24109             printf(" %d", n_ns);
24110             printf("\n");
24111         }
24112     }
24113     }
24114     function_tests++;
24115
24116     return(test_ret);
24117 }
24118
24119
24120 static int
24121 test_xmlSetNsProp(void) {
24122     int test_ret = 0;
24123
24124 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
24125     int mem_base;
24126     xmlAttrPtr ret_val;
24127     xmlNodePtr node; /* the node */
24128     int n_node;
24129     xmlNsPtr ns; /* the namespace definition */
24130     int n_ns;
24131     xmlChar * name; /* the attribute name */
24132     int n_name;
24133     xmlChar * value; /* the attribute value */
24134     int n_value;
24135
24136     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24137     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
24138     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24139     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24140         mem_base = xmlMemBlocks();
24141         node = gen_xmlNodePtr(n_node, 0);
24142         ns = gen_xmlNsPtr(n_ns, 1);
24143         name = gen_const_xmlChar_ptr(n_name, 2);
24144         value = gen_const_xmlChar_ptr(n_value, 3);
24145
24146         ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
24147         desret_xmlAttrPtr(ret_val);
24148         call_tests++;
24149         des_xmlNodePtr(n_node, node, 0);
24150         des_xmlNsPtr(n_ns, ns, 1);
24151         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24152         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
24153         xmlResetLastError();
24154         if (mem_base != xmlMemBlocks()) {
24155             printf("Leak of %d blocks found in xmlSetNsProp",
24156                    xmlMemBlocks() - mem_base);
24157             test_ret++;
24158             printf(" %d", n_node);
24159             printf(" %d", n_ns);
24160             printf(" %d", n_name);
24161             printf(" %d", n_value);
24162             printf("\n");
24163         }
24164     }
24165     }
24166     }
24167     }
24168     function_tests++;
24169 #endif
24170
24171     return(test_ret);
24172 }
24173
24174
24175 static int
24176 test_xmlSetProp(void) {
24177     int test_ret = 0;
24178
24179 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
24180     int mem_base;
24181     xmlAttrPtr ret_val;
24182     xmlNodePtr node; /* the node */
24183     int n_node;
24184     xmlChar * name; /* the attribute name (a QName) */
24185     int n_name;
24186     xmlChar * value; /* the attribute value */
24187     int n_value;
24188
24189     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24190     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24191     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24192         mem_base = xmlMemBlocks();
24193         node = gen_xmlNodePtr(n_node, 0);
24194         name = gen_const_xmlChar_ptr(n_name, 1);
24195         value = gen_const_xmlChar_ptr(n_value, 2);
24196
24197         ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
24198         desret_xmlAttrPtr(ret_val);
24199         call_tests++;
24200         des_xmlNodePtr(n_node, node, 0);
24201         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24202         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
24203         xmlResetLastError();
24204         if (mem_base != xmlMemBlocks()) {
24205             printf("Leak of %d blocks found in xmlSetProp",
24206                    xmlMemBlocks() - mem_base);
24207             test_ret++;
24208             printf(" %d", n_node);
24209             printf(" %d", n_name);
24210             printf(" %d", n_value);
24211             printf("\n");
24212         }
24213     }
24214     }
24215     }
24216     function_tests++;
24217 #endif
24218
24219     return(test_ret);
24220 }
24221
24222
24223 static int
24224 test_xmlSplitQName2(void) {
24225     int test_ret = 0;
24226
24227     int mem_base;
24228     xmlChar * ret_val;
24229     xmlChar * name; /* the full QName */
24230     int n_name;
24231     xmlChar ** prefix; /* a xmlChar ** */
24232     int n_prefix;
24233
24234     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24235     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
24236         mem_base = xmlMemBlocks();
24237         name = gen_const_xmlChar_ptr(n_name, 0);
24238         prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
24239
24240         ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
24241         desret_xmlChar_ptr(ret_val);
24242         call_tests++;
24243         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
24244         des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
24245         xmlResetLastError();
24246         if (mem_base != xmlMemBlocks()) {
24247             printf("Leak of %d blocks found in xmlSplitQName2",
24248                    xmlMemBlocks() - mem_base);
24249             test_ret++;
24250             printf(" %d", n_name);
24251             printf(" %d", n_prefix);
24252             printf("\n");
24253         }
24254     }
24255     }
24256     function_tests++;
24257
24258     return(test_ret);
24259 }
24260
24261
24262 static int
24263 test_xmlSplitQName3(void) {
24264     int test_ret = 0;
24265
24266     int mem_base;
24267     const xmlChar * ret_val;
24268     xmlChar * name; /* the full QName */
24269     int n_name;
24270     int * len; /* an int * */
24271     int n_len;
24272
24273     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24274     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
24275         mem_base = xmlMemBlocks();
24276         name = gen_const_xmlChar_ptr(n_name, 0);
24277         len = gen_int_ptr(n_len, 1);
24278
24279         ret_val = xmlSplitQName3((const xmlChar *)name, len);
24280         desret_const_xmlChar_ptr(ret_val);
24281         call_tests++;
24282         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
24283         des_int_ptr(n_len, len, 1);
24284         xmlResetLastError();
24285         if (mem_base != xmlMemBlocks()) {
24286             printf("Leak of %d blocks found in xmlSplitQName3",
24287                    xmlMemBlocks() - mem_base);
24288             test_ret++;
24289             printf(" %d", n_name);
24290             printf(" %d", n_len);
24291             printf("\n");
24292         }
24293     }
24294     }
24295     function_tests++;
24296
24297     return(test_ret);
24298 }
24299
24300
24301 static int
24302 test_xmlStringGetNodeList(void) {
24303     int test_ret = 0;
24304
24305     int mem_base;
24306     xmlNodePtr ret_val;
24307     xmlDoc * doc; /* the document */
24308     int n_doc;
24309     xmlChar * value; /* the value of the attribute */
24310     int n_value;
24311
24312     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
24313     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24314         mem_base = xmlMemBlocks();
24315         doc = gen_const_xmlDoc_ptr(n_doc, 0);
24316         value = gen_const_xmlChar_ptr(n_value, 1);
24317
24318         ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value);
24319         desret_xmlNodePtr(ret_val);
24320         call_tests++;
24321         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
24322         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
24323         xmlResetLastError();
24324         if (mem_base != xmlMemBlocks()) {
24325             printf("Leak of %d blocks found in xmlStringGetNodeList",
24326                    xmlMemBlocks() - mem_base);
24327             test_ret++;
24328             printf(" %d", n_doc);
24329             printf(" %d", n_value);
24330             printf("\n");
24331         }
24332     }
24333     }
24334     function_tests++;
24335
24336     return(test_ret);
24337 }
24338
24339
24340 static int
24341 test_xmlStringLenGetNodeList(void) {
24342     int test_ret = 0;
24343
24344     int mem_base;
24345     xmlNodePtr ret_val;
24346     xmlDoc * doc; /* the document */
24347     int n_doc;
24348     xmlChar * value; /* the value of the text */
24349     int n_value;
24350     int len; /* the length of the string value */
24351     int n_len;
24352
24353     for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
24354     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24355     for (n_len = 0;n_len < gen_nb_int;n_len++) {
24356         mem_base = xmlMemBlocks();
24357         doc = gen_const_xmlDoc_ptr(n_doc, 0);
24358         value = gen_const_xmlChar_ptr(n_value, 1);
24359         len = gen_int(n_len, 2);
24360         if ((value != NULL) &&
24361             (len > (int) strlen((const char *) value) + 1))
24362             continue;
24363
24364         ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len);
24365         desret_xmlNodePtr(ret_val);
24366         call_tests++;
24367         des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
24368         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
24369         des_int(n_len, len, 2);
24370         xmlResetLastError();
24371         if (mem_base != xmlMemBlocks()) {
24372             printf("Leak of %d blocks found in xmlStringLenGetNodeList",
24373                    xmlMemBlocks() - mem_base);
24374             test_ret++;
24375             printf(" %d", n_doc);
24376             printf(" %d", n_value);
24377             printf(" %d", n_len);
24378             printf("\n");
24379         }
24380     }
24381     }
24382     }
24383     function_tests++;
24384
24385     return(test_ret);
24386 }
24387
24388
24389 static int
24390 test_xmlTextConcat(void) {
24391     int test_ret = 0;
24392
24393     int mem_base;
24394     int ret_val;
24395     xmlNodePtr node; /* the node */
24396     int n_node;
24397     xmlChar * content; /* the content */
24398     int n_content;
24399     int len; /* @content length */
24400     int n_len;
24401
24402     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24403     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
24404     for (n_len = 0;n_len < gen_nb_int;n_len++) {
24405         mem_base = xmlMemBlocks();
24406         node = gen_xmlNodePtr(n_node, 0);
24407         content = gen_const_xmlChar_ptr(n_content, 1);
24408         len = gen_int(n_len, 2);
24409         if ((content != NULL) &&
24410             (len > (int) strlen((const char *) content) + 1))
24411             continue;
24412
24413         ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
24414         desret_int(ret_val);
24415         call_tests++;
24416         des_xmlNodePtr(n_node, node, 0);
24417         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
24418         des_int(n_len, len, 2);
24419         xmlResetLastError();
24420         if (mem_base != xmlMemBlocks()) {
24421             printf("Leak of %d blocks found in xmlTextConcat",
24422                    xmlMemBlocks() - mem_base);
24423             test_ret++;
24424             printf(" %d", n_node);
24425             printf(" %d", n_content);
24426             printf(" %d", n_len);
24427             printf("\n");
24428         }
24429     }
24430     }
24431     }
24432     function_tests++;
24433
24434     return(test_ret);
24435 }
24436
24437
24438 static int
24439 test_xmlTextMerge(void) {
24440     int test_ret = 0;
24441
24442     int mem_base;
24443     xmlNodePtr ret_val;
24444     xmlNodePtr first; /* the first text node */
24445     int n_first;
24446     xmlNodePtr second; /* the second text node being merged */
24447     int n_second;
24448
24449     for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
24450     for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
24451         mem_base = xmlMemBlocks();
24452         first = gen_xmlNodePtr_in(n_first, 0);
24453         second = gen_xmlNodePtr_in(n_second, 1);
24454
24455         ret_val = xmlTextMerge(first, second);
24456         if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
24457               xmlUnlinkNode(second);
24458               xmlFreeNode(second) ; second = NULL ; }
24459         desret_xmlNodePtr(ret_val);
24460         call_tests++;
24461         des_xmlNodePtr_in(n_first, first, 0);
24462         des_xmlNodePtr_in(n_second, second, 1);
24463         xmlResetLastError();
24464         if (mem_base != xmlMemBlocks()) {
24465             printf("Leak of %d blocks found in xmlTextMerge",
24466                    xmlMemBlocks() - mem_base);
24467             test_ret++;
24468             printf(" %d", n_first);
24469             printf(" %d", n_second);
24470             printf("\n");
24471         }
24472     }
24473     }
24474     function_tests++;
24475
24476     return(test_ret);
24477 }
24478
24479
24480 static int
24481 test_xmlUnsetNsProp(void) {
24482     int test_ret = 0;
24483
24484 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24485     int mem_base;
24486     int ret_val;
24487     xmlNodePtr node; /* the node */
24488     int n_node;
24489     xmlNsPtr ns; /* the namespace definition */
24490     int n_ns;
24491     xmlChar * name; /* the attribute name */
24492     int n_name;
24493
24494     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24495     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
24496     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24497         mem_base = xmlMemBlocks();
24498         node = gen_xmlNodePtr(n_node, 0);
24499         ns = gen_xmlNsPtr(n_ns, 1);
24500         name = gen_const_xmlChar_ptr(n_name, 2);
24501
24502         ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
24503         desret_int(ret_val);
24504         call_tests++;
24505         des_xmlNodePtr(n_node, node, 0);
24506         des_xmlNsPtr(n_ns, ns, 1);
24507         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24508         xmlResetLastError();
24509         if (mem_base != xmlMemBlocks()) {
24510             printf("Leak of %d blocks found in xmlUnsetNsProp",
24511                    xmlMemBlocks() - mem_base);
24512             test_ret++;
24513             printf(" %d", n_node);
24514             printf(" %d", n_ns);
24515             printf(" %d", n_name);
24516             printf("\n");
24517         }
24518     }
24519     }
24520     }
24521     function_tests++;
24522 #endif
24523
24524     return(test_ret);
24525 }
24526
24527
24528 static int
24529 test_xmlUnsetProp(void) {
24530     int test_ret = 0;
24531
24532 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24533     int mem_base;
24534     int ret_val;
24535     xmlNodePtr node; /* the node */
24536     int n_node;
24537     xmlChar * name; /* the attribute name */
24538     int n_name;
24539
24540     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
24541     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24542         mem_base = xmlMemBlocks();
24543         node = gen_xmlNodePtr(n_node, 0);
24544         name = gen_const_xmlChar_ptr(n_name, 1);
24545
24546         ret_val = xmlUnsetProp(node, (const xmlChar *)name);
24547         desret_int(ret_val);
24548         call_tests++;
24549         des_xmlNodePtr(n_node, node, 0);
24550         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24551         xmlResetLastError();
24552         if (mem_base != xmlMemBlocks()) {
24553             printf("Leak of %d blocks found in xmlUnsetProp",
24554                    xmlMemBlocks() - mem_base);
24555             test_ret++;
24556             printf(" %d", n_node);
24557             printf(" %d", n_name);
24558             printf("\n");
24559         }
24560     }
24561     }
24562     function_tests++;
24563 #endif
24564
24565     return(test_ret);
24566 }
24567
24568
24569 static int
24570 test_xmlValidateNCName(void) {
24571     int test_ret = 0;
24572
24573 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
24574 #ifdef LIBXML_TREE_ENABLED
24575     int mem_base;
24576     int ret_val;
24577     xmlChar * value; /* the value to check */
24578     int n_value;
24579     int space; /* allow spaces in front and end of the string */
24580     int n_space;
24581
24582     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24583     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24584         mem_base = xmlMemBlocks();
24585         value = gen_const_xmlChar_ptr(n_value, 0);
24586         space = gen_int(n_space, 1);
24587
24588         ret_val = xmlValidateNCName((const xmlChar *)value, space);
24589         desret_int(ret_val);
24590         call_tests++;
24591         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24592         des_int(n_space, space, 1);
24593         xmlResetLastError();
24594         if (mem_base != xmlMemBlocks()) {
24595             printf("Leak of %d blocks found in xmlValidateNCName",
24596                    xmlMemBlocks() - mem_base);
24597             test_ret++;
24598             printf(" %d", n_value);
24599             printf(" %d", n_space);
24600             printf("\n");
24601         }
24602     }
24603     }
24604     function_tests++;
24605 #endif
24606 #endif
24607
24608     return(test_ret);
24609 }
24610
24611
24612 static int
24613 test_xmlValidateNMToken(void) {
24614     int test_ret = 0;
24615
24616 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24617 #ifdef LIBXML_TREE_ENABLED
24618     int mem_base;
24619     int ret_val;
24620     xmlChar * value; /* the value to check */
24621     int n_value;
24622     int space; /* allow spaces in front and end of the string */
24623     int n_space;
24624
24625     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24626     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24627         mem_base = xmlMemBlocks();
24628         value = gen_const_xmlChar_ptr(n_value, 0);
24629         space = gen_int(n_space, 1);
24630
24631         ret_val = xmlValidateNMToken((const xmlChar *)value, space);
24632         desret_int(ret_val);
24633         call_tests++;
24634         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24635         des_int(n_space, space, 1);
24636         xmlResetLastError();
24637         if (mem_base != xmlMemBlocks()) {
24638             printf("Leak of %d blocks found in xmlValidateNMToken",
24639                    xmlMemBlocks() - mem_base);
24640             test_ret++;
24641             printf(" %d", n_value);
24642             printf(" %d", n_space);
24643             printf("\n");
24644         }
24645     }
24646     }
24647     function_tests++;
24648 #endif
24649 #endif
24650
24651     return(test_ret);
24652 }
24653
24654
24655 static int
24656 test_xmlValidateName(void) {
24657     int test_ret = 0;
24658
24659 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24660 #ifdef LIBXML_TREE_ENABLED
24661     int mem_base;
24662     int ret_val;
24663     xmlChar * value; /* the value to check */
24664     int n_value;
24665     int space; /* allow spaces in front and end of the string */
24666     int n_space;
24667
24668     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24669     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24670         mem_base = xmlMemBlocks();
24671         value = gen_const_xmlChar_ptr(n_value, 0);
24672         space = gen_int(n_space, 1);
24673
24674         ret_val = xmlValidateName((const xmlChar *)value, space);
24675         desret_int(ret_val);
24676         call_tests++;
24677         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24678         des_int(n_space, space, 1);
24679         xmlResetLastError();
24680         if (mem_base != xmlMemBlocks()) {
24681             printf("Leak of %d blocks found in xmlValidateName",
24682                    xmlMemBlocks() - mem_base);
24683             test_ret++;
24684             printf(" %d", n_value);
24685             printf(" %d", n_space);
24686             printf("\n");
24687         }
24688     }
24689     }
24690     function_tests++;
24691 #endif
24692 #endif
24693
24694     return(test_ret);
24695 }
24696
24697
24698 static int
24699 test_xmlValidateQName(void) {
24700     int test_ret = 0;
24701
24702 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
24703 #ifdef LIBXML_TREE_ENABLED
24704     int mem_base;
24705     int ret_val;
24706     xmlChar * value; /* the value to check */
24707     int n_value;
24708     int space; /* allow spaces in front and end of the string */
24709     int n_space;
24710
24711     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24712     for (n_space = 0;n_space < gen_nb_int;n_space++) {
24713         mem_base = xmlMemBlocks();
24714         value = gen_const_xmlChar_ptr(n_value, 0);
24715         space = gen_int(n_space, 1);
24716
24717         ret_val = xmlValidateQName((const xmlChar *)value, space);
24718         desret_int(ret_val);
24719         call_tests++;
24720         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
24721         des_int(n_space, space, 1);
24722         xmlResetLastError();
24723         if (mem_base != xmlMemBlocks()) {
24724             printf("Leak of %d blocks found in xmlValidateQName",
24725                    xmlMemBlocks() - mem_base);
24726             test_ret++;
24727             printf(" %d", n_value);
24728             printf(" %d", n_space);
24729             printf("\n");
24730         }
24731     }
24732     }
24733     function_tests++;
24734 #endif
24735 #endif
24736
24737     return(test_ret);
24738 }
24739
24740 static int
24741 test_tree(void) {
24742     int test_ret = 0;
24743         int rc = 0;
24744
24745     if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
24746     rc = test_xmlAddChild();
24747         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24748     rc = test_xmlAddChildList();
24749         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24750     rc = test_xmlAddNextSibling();
24751         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24752     rc = test_xmlAddPrevSibling();
24753         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24754     rc = test_xmlAddSibling();
24755         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24756     rc = test_xmlAttrSerializeTxtContent();
24757         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24758     rc = test_xmlBufContent();
24759         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24760     rc = test_xmlBufEnd();
24761         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24762     rc = test_xmlBufGetNodeContent();
24763         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24764     rc = test_xmlBufNodeDump();
24765         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24766     rc = test_xmlBufShrink();
24767         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24768     rc = test_xmlBufUse();
24769         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24770     rc = test_xmlBufferAdd();
24771         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24772     rc = test_xmlBufferAddHead();
24773         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24774     rc = test_xmlBufferCCat();
24775         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24776     rc = test_xmlBufferCat();
24777         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24778     rc = test_xmlBufferContent();
24779         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24780     rc = test_xmlBufferCreate();
24781         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24782     rc = test_xmlBufferCreateSize();
24783         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24784     rc = test_xmlBufferCreateStatic();
24785         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24786     rc = test_xmlBufferDetach();
24787         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24788     rc = test_xmlBufferEmpty();
24789         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24790     rc = test_xmlBufferGrow();
24791         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24792     rc = test_xmlBufferLength();
24793         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24794     rc = test_xmlBufferResize();
24795         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24796     rc = test_xmlBufferSetAllocationScheme();
24797         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24798     rc = test_xmlBufferShrink();
24799         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24800     rc = test_xmlBufferWriteCHAR();
24801         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24802     rc = test_xmlBufferWriteChar();
24803         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24804     rc = test_xmlBufferWriteQuotedString();
24805         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24806     rc = test_xmlBuildQName();
24807         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24808     rc = test_xmlChildElementCount();
24809         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24810     rc = test_xmlCopyDoc();
24811         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24812     rc = test_xmlCopyDtd();
24813         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24814     rc = test_xmlCopyNamespace();
24815         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24816     rc = test_xmlCopyNamespaceList();
24817         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24818     rc = test_xmlCopyNode();
24819         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24820     rc = test_xmlCopyNodeList();
24821         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24822     rc = test_xmlCopyProp();
24823         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24824     rc = test_xmlCopyPropList();
24825         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24826     rc = test_xmlCreateIntSubset();
24827         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24828     rc = test_xmlDOMWrapAdoptNode();
24829         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24830     rc = test_xmlDOMWrapCloneNode();
24831         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24832     rc = test_xmlDOMWrapNewCtxt();
24833         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24834     rc = test_xmlDOMWrapReconcileNamespaces();
24835         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24836     rc = test_xmlDOMWrapRemoveNode();
24837         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24838     rc = test_xmlDocCopyNode();
24839         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24840     rc = test_xmlDocCopyNodeList();
24841         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24842     rc = test_xmlDocDump();
24843         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24844     rc = test_xmlDocDumpFormatMemory();
24845         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24846     rc = test_xmlDocDumpFormatMemoryEnc();
24847         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24848     rc = test_xmlDocDumpMemory();
24849         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24850     rc = test_xmlDocDumpMemoryEnc();
24851         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24852     rc = test_xmlDocFormatDump();
24853         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24854     rc = test_xmlDocGetRootElement();
24855         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24856     rc = test_xmlDocSetRootElement();
24857         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24858     rc = test_xmlElemDump();
24859         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24860     rc = test_xmlFirstElementChild();
24861         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24862     rc = test_xmlGetBufferAllocationScheme();
24863         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24864     rc = test_xmlGetCompressMode();
24865         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24866     rc = test_xmlGetDocCompressMode();
24867         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24868     rc = test_xmlGetIntSubset();
24869         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24870     rc = test_xmlGetLastChild();
24871         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24872     rc = test_xmlGetLineNo();
24873         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24874     rc = test_xmlGetNoNsProp();
24875         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24876     rc = test_xmlGetNodePath();
24877         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24878     rc = test_xmlGetNsList();
24879         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24880     rc = test_xmlGetNsProp();
24881         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24882     rc = test_xmlGetProp();
24883         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24884     rc = test_xmlHasNsProp();
24885         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24886     rc = test_xmlHasProp();
24887         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24888     rc = test_xmlIsBlankNode();
24889         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24890     rc = test_xmlIsXHTML();
24891         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24892     rc = test_xmlLastElementChild();
24893         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24894     rc = test_xmlNewCDataBlock();
24895         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24896     rc = test_xmlNewCharRef();
24897         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24898     rc = test_xmlNewChild();
24899         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24900     rc = test_xmlNewComment();
24901         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24902     rc = test_xmlNewDoc();
24903         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24904     rc = test_xmlNewDocComment();
24905         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24906     rc = test_xmlNewDocFragment();
24907         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24908     rc = test_xmlNewDocNode();
24909         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24910     rc = test_xmlNewDocNodeEatName();
24911         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24912     rc = test_xmlNewDocPI();
24913         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24914     rc = test_xmlNewDocProp();
24915         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24916     rc = test_xmlNewDocRawNode();
24917         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24918     rc = test_xmlNewDocText();
24919         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24920     rc = test_xmlNewDocTextLen();
24921         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24922     rc = test_xmlNewDtd();
24923         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24924     rc = test_xmlNewNode();
24925         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24926     rc = test_xmlNewNodeEatName();
24927         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24928     rc = test_xmlNewNs();
24929         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24930     rc = test_xmlNewNsProp();
24931         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24932     rc = test_xmlNewNsPropEatName();
24933         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24934     rc = test_xmlNewPI();
24935         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24936     rc = test_xmlNewProp();
24937         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24938     rc = test_xmlNewReference();
24939         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24940     rc = test_xmlNewText();
24941         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24942     rc = test_xmlNewTextChild();
24943         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24944     rc = test_xmlNewTextLen();
24945         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24946     rc = test_xmlNextElementSibling();
24947         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24948     rc = test_xmlNodeAddContent();
24949         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24950     rc = test_xmlNodeAddContentLen();
24951         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24952     rc = test_xmlNodeBufGetContent();
24953         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24954     rc = test_xmlNodeDump();
24955         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24956     rc = test_xmlNodeDumpOutput();
24957         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24958     rc = test_xmlNodeGetBase();
24959         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24960     rc = test_xmlNodeGetContent();
24961         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24962     rc = test_xmlNodeGetLang();
24963         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24964     rc = test_xmlNodeGetSpacePreserve();
24965         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24966     rc = test_xmlNodeIsText();
24967         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24968     rc = test_xmlNodeListGetRawString();
24969         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24970     rc = test_xmlNodeListGetString();
24971         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24972     rc = test_xmlNodeSetBase();
24973         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24974     rc = test_xmlNodeSetContent();
24975         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24976     rc = test_xmlNodeSetContentLen();
24977         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24978     rc = test_xmlNodeSetLang();
24979         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24980     rc = test_xmlNodeSetName();
24981         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24982     rc = test_xmlNodeSetSpacePreserve();
24983         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24984     rc = test_xmlPreviousElementSibling();
24985         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24986     rc = test_xmlReconciliateNs();
24987         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24988     rc = test_xmlRemoveProp();
24989         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24990     rc = test_xmlReplaceNode();
24991         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24992     rc = test_xmlSaveFile();
24993         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24994     rc = test_xmlSaveFileEnc();
24995         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24996     rc = test_xmlSaveFileTo();
24997         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
24998     rc = test_xmlSaveFormatFile();
24999         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25000     rc = test_xmlSaveFormatFileEnc();
25001         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25002     rc = test_xmlSaveFormatFileTo();
25003         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25004     rc = test_xmlSearchNs();
25005         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25006     rc = test_xmlSearchNsByHref();
25007         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25008     rc = test_xmlSetBufferAllocationScheme();
25009         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25010     rc = test_xmlSetCompressMode();
25011         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25012     rc = test_xmlSetDocCompressMode();
25013         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25014     rc = test_xmlSetNs();
25015         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25016     rc = test_xmlSetNsProp();
25017         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25018     rc = test_xmlSetProp();
25019         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25020     rc = test_xmlSplitQName2();
25021         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25022     rc = test_xmlSplitQName3();
25023         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25024     rc = test_xmlStringGetNodeList();
25025         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25026     rc = test_xmlStringLenGetNodeList();
25027         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25028     rc = test_xmlTextConcat();
25029         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25030     rc = test_xmlTextMerge();
25031         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25032     rc = test_xmlUnsetNsProp();
25033         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25034     rc = test_xmlUnsetProp();
25035         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25036     rc = test_xmlValidateNCName();
25037         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25038     rc = test_xmlValidateNMToken();
25039         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25040     rc = test_xmlValidateName();
25041         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25042     rc = test_xmlValidateQName();
25043         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25044
25045     if (test_ret != 0)
25046         printf("Module tree: %d errors\n", test_ret);
25047     return(test_ret);
25048 }
25049
25050 static int
25051 test_xmlBuildRelativeURI(void) {
25052     int test_ret = 0;
25053
25054     int mem_base;
25055     xmlChar * ret_val;
25056     xmlChar * URI; /* the URI reference under consideration */
25057     int n_URI;
25058     xmlChar * base; /* the base value */
25059     int n_base;
25060
25061     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
25062     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
25063         mem_base = xmlMemBlocks();
25064         URI = gen_const_xmlChar_ptr(n_URI, 0);
25065         base = gen_const_xmlChar_ptr(n_base, 1);
25066
25067         ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
25068         desret_xmlChar_ptr(ret_val);
25069         call_tests++;
25070         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
25071         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
25072         xmlResetLastError();
25073         if (mem_base != xmlMemBlocks()) {
25074             printf("Leak of %d blocks found in xmlBuildRelativeURI",
25075                    xmlMemBlocks() - mem_base);
25076             test_ret++;
25077             printf(" %d", n_URI);
25078             printf(" %d", n_base);
25079             printf("\n");
25080         }
25081     }
25082     }
25083     function_tests++;
25084
25085     return(test_ret);
25086 }
25087
25088
25089 static int
25090 test_xmlBuildURI(void) {
25091     int test_ret = 0;
25092
25093     int mem_base;
25094     xmlChar * ret_val;
25095     xmlChar * URI; /* the URI instance found in the document */
25096     int n_URI;
25097     xmlChar * base; /* the base value */
25098     int n_base;
25099
25100     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
25101     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
25102         mem_base = xmlMemBlocks();
25103         URI = gen_const_xmlChar_ptr(n_URI, 0);
25104         base = gen_const_xmlChar_ptr(n_base, 1);
25105
25106         ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
25107         desret_xmlChar_ptr(ret_val);
25108         call_tests++;
25109         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
25110         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
25111         xmlResetLastError();
25112         if (mem_base != xmlMemBlocks()) {
25113             printf("Leak of %d blocks found in xmlBuildURI",
25114                    xmlMemBlocks() - mem_base);
25115             test_ret++;
25116             printf(" %d", n_URI);
25117             printf(" %d", n_base);
25118             printf("\n");
25119         }
25120     }
25121     }
25122     function_tests++;
25123
25124     return(test_ret);
25125 }
25126
25127
25128 static int
25129 test_xmlCanonicPath(void) {
25130     int test_ret = 0;
25131
25132     int mem_base;
25133     xmlChar * ret_val;
25134     xmlChar * path; /* the resource locator in a filesystem notation */
25135     int n_path;
25136
25137     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
25138         mem_base = xmlMemBlocks();
25139         path = gen_const_xmlChar_ptr(n_path, 0);
25140
25141         ret_val = xmlCanonicPath((const xmlChar *)path);
25142         desret_xmlChar_ptr(ret_val);
25143         call_tests++;
25144         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
25145         xmlResetLastError();
25146         if (mem_base != xmlMemBlocks()) {
25147             printf("Leak of %d blocks found in xmlCanonicPath",
25148                    xmlMemBlocks() - mem_base);
25149             test_ret++;
25150             printf(" %d", n_path);
25151             printf("\n");
25152         }
25153     }
25154     function_tests++;
25155
25156     return(test_ret);
25157 }
25158
25159
25160 static int
25161 test_xmlCreateURI(void) {
25162     int test_ret = 0;
25163
25164
25165     /* missing type support */
25166     return(test_ret);
25167 }
25168
25169
25170 static int
25171 test_xmlNormalizeURIPath(void) {
25172     int test_ret = 0;
25173
25174     int mem_base;
25175     int ret_val;
25176     char * path; /* pointer to the path string */
25177     int n_path;
25178
25179     for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
25180         mem_base = xmlMemBlocks();
25181         path = gen_char_ptr(n_path, 0);
25182
25183         ret_val = xmlNormalizeURIPath(path);
25184         desret_int(ret_val);
25185         call_tests++;
25186         des_char_ptr(n_path, path, 0);
25187         xmlResetLastError();
25188         if (mem_base != xmlMemBlocks()) {
25189             printf("Leak of %d blocks found in xmlNormalizeURIPath",
25190                    xmlMemBlocks() - mem_base);
25191             test_ret++;
25192             printf(" %d", n_path);
25193             printf("\n");
25194         }
25195     }
25196     function_tests++;
25197
25198     return(test_ret);
25199 }
25200
25201
25202 static int
25203 test_xmlParseURI(void) {
25204     int test_ret = 0;
25205
25206
25207     /* missing type support */
25208     return(test_ret);
25209 }
25210
25211
25212 static int
25213 test_xmlParseURIRaw(void) {
25214     int test_ret = 0;
25215
25216
25217     /* missing type support */
25218     return(test_ret);
25219 }
25220
25221
25222 #define gen_nb_xmlURIPtr 1
25223 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25224     return(NULL);
25225 }
25226 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25227 }
25228
25229 static int
25230 test_xmlParseURIReference(void) {
25231     int test_ret = 0;
25232
25233     int mem_base;
25234     int ret_val;
25235     xmlURIPtr uri; /* pointer to an URI structure */
25236     int n_uri;
25237     char * str; /* the string to analyze */
25238     int n_str;
25239
25240     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
25241     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
25242         mem_base = xmlMemBlocks();
25243         uri = gen_xmlURIPtr(n_uri, 0);
25244         str = gen_const_char_ptr(n_str, 1);
25245
25246         ret_val = xmlParseURIReference(uri, (const char *)str);
25247         desret_int(ret_val);
25248         call_tests++;
25249         des_xmlURIPtr(n_uri, uri, 0);
25250         des_const_char_ptr(n_str, (const char *)str, 1);
25251         xmlResetLastError();
25252         if (mem_base != xmlMemBlocks()) {
25253             printf("Leak of %d blocks found in xmlParseURIReference",
25254                    xmlMemBlocks() - mem_base);
25255             test_ret++;
25256             printf(" %d", n_uri);
25257             printf(" %d", n_str);
25258             printf("\n");
25259         }
25260     }
25261     }
25262     function_tests++;
25263
25264     return(test_ret);
25265 }
25266
25267
25268 static int
25269 test_xmlPathToURI(void) {
25270     int test_ret = 0;
25271
25272     int mem_base;
25273     xmlChar * ret_val;
25274     xmlChar * path; /* the resource locator in a filesystem notation */
25275     int n_path;
25276
25277     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
25278         mem_base = xmlMemBlocks();
25279         path = gen_const_xmlChar_ptr(n_path, 0);
25280
25281         ret_val = xmlPathToURI((const xmlChar *)path);
25282         desret_xmlChar_ptr(ret_val);
25283         call_tests++;
25284         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
25285         xmlResetLastError();
25286         if (mem_base != xmlMemBlocks()) {
25287             printf("Leak of %d blocks found in xmlPathToURI",
25288                    xmlMemBlocks() - mem_base);
25289             test_ret++;
25290             printf(" %d", n_path);
25291             printf("\n");
25292         }
25293     }
25294     function_tests++;
25295
25296     return(test_ret);
25297 }
25298
25299
25300 static int
25301 test_xmlPrintURI(void) {
25302     int test_ret = 0;
25303
25304     int mem_base;
25305     FILE * stream; /* a FILE* for the output */
25306     int n_stream;
25307     xmlURIPtr uri; /* pointer to an xmlURI */
25308     int n_uri;
25309
25310     for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
25311     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
25312         mem_base = xmlMemBlocks();
25313         stream = gen_FILE_ptr(n_stream, 0);
25314         uri = gen_xmlURIPtr(n_uri, 1);
25315
25316         xmlPrintURI(stream, uri);
25317         call_tests++;
25318         des_FILE_ptr(n_stream, stream, 0);
25319         des_xmlURIPtr(n_uri, uri, 1);
25320         xmlResetLastError();
25321         if (mem_base != xmlMemBlocks()) {
25322             printf("Leak of %d blocks found in xmlPrintURI",
25323                    xmlMemBlocks() - mem_base);
25324             test_ret++;
25325             printf(" %d", n_stream);
25326             printf(" %d", n_uri);
25327             printf("\n");
25328         }
25329     }
25330     }
25331     function_tests++;
25332
25333     return(test_ret);
25334 }
25335
25336
25337 static int
25338 test_xmlSaveUri(void) {
25339     int test_ret = 0;
25340
25341     int mem_base;
25342     xmlChar * ret_val;
25343     xmlURIPtr uri; /* pointer to an xmlURI */
25344     int n_uri;
25345
25346     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
25347         mem_base = xmlMemBlocks();
25348         uri = gen_xmlURIPtr(n_uri, 0);
25349
25350         ret_val = xmlSaveUri(uri);
25351         desret_xmlChar_ptr(ret_val);
25352         call_tests++;
25353         des_xmlURIPtr(n_uri, uri, 0);
25354         xmlResetLastError();
25355         if (mem_base != xmlMemBlocks()) {
25356             printf("Leak of %d blocks found in xmlSaveUri",
25357                    xmlMemBlocks() - mem_base);
25358             test_ret++;
25359             printf(" %d", n_uri);
25360             printf("\n");
25361         }
25362     }
25363     function_tests++;
25364
25365     return(test_ret);
25366 }
25367
25368
25369 static int
25370 test_xmlURIEscape(void) {
25371     int test_ret = 0;
25372
25373     int mem_base;
25374     xmlChar * ret_val;
25375     xmlChar * str; /* the string of the URI to escape */
25376     int n_str;
25377
25378     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
25379         mem_base = xmlMemBlocks();
25380         str = gen_const_xmlChar_ptr(n_str, 0);
25381
25382         ret_val = xmlURIEscape((const xmlChar *)str);
25383         desret_xmlChar_ptr(ret_val);
25384         call_tests++;
25385         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
25386         xmlResetLastError();
25387         if (mem_base != xmlMemBlocks()) {
25388             printf("Leak of %d blocks found in xmlURIEscape",
25389                    xmlMemBlocks() - mem_base);
25390             test_ret++;
25391             printf(" %d", n_str);
25392             printf("\n");
25393         }
25394     }
25395     function_tests++;
25396
25397     return(test_ret);
25398 }
25399
25400
25401 static int
25402 test_xmlURIEscapeStr(void) {
25403     int test_ret = 0;
25404
25405     int mem_base;
25406     xmlChar * ret_val;
25407     xmlChar * str; /* string to escape */
25408     int n_str;
25409     xmlChar * list; /* exception list string of chars not to escape */
25410     int n_list;
25411
25412     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
25413     for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
25414         mem_base = xmlMemBlocks();
25415         str = gen_const_xmlChar_ptr(n_str, 0);
25416         list = gen_const_xmlChar_ptr(n_list, 1);
25417
25418         ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
25419         desret_xmlChar_ptr(ret_val);
25420         call_tests++;
25421         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
25422         des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
25423         xmlResetLastError();
25424         if (mem_base != xmlMemBlocks()) {
25425             printf("Leak of %d blocks found in xmlURIEscapeStr",
25426                    xmlMemBlocks() - mem_base);
25427             test_ret++;
25428             printf(" %d", n_str);
25429             printf(" %d", n_list);
25430             printf("\n");
25431         }
25432     }
25433     }
25434     function_tests++;
25435
25436     return(test_ret);
25437 }
25438
25439
25440 static int
25441 test_xmlURIUnescapeString(void) {
25442     int test_ret = 0;
25443
25444
25445     /* missing type support */
25446     return(test_ret);
25447 }
25448
25449 static int
25450 test_uri(void) {
25451     int test_ret = 0;
25452         int rc = 0;
25453
25454     if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
25455     rc = test_xmlBuildRelativeURI();
25456         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25457     rc = test_xmlBuildURI();
25458         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25459     rc = test_xmlCanonicPath();
25460         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25461     rc = test_xmlCreateURI();
25462         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25463     rc = test_xmlNormalizeURIPath();
25464         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25465     rc = test_xmlParseURI();
25466         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25467     rc = test_xmlParseURIRaw();
25468         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25469     rc = test_xmlParseURIReference();
25470         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25471     rc = test_xmlPathToURI();
25472         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25473     rc = test_xmlPrintURI();
25474         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25475     rc = test_xmlSaveUri();
25476         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25477     rc = test_xmlURIEscape();
25478         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25479     rc = test_xmlURIEscapeStr();
25480         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25481     rc = test_xmlURIUnescapeString();
25482         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
25483
25484     if (test_ret != 0)
25485         printf("Module uri: %d errors\n", test_ret);
25486     return(test_ret);
25487 }
25488
25489 static int
25490 test_xmlAddAttributeDecl(void) {
25491     int test_ret = 0;
25492
25493     int mem_base;
25494     xmlAttributePtr ret_val;
25495     xmlValidCtxtPtr ctxt; /* the validation context */
25496     int n_ctxt;
25497     xmlDtdPtr dtd; /* pointer to the DTD */
25498     int n_dtd;
25499     xmlChar * elem; /* the element name */
25500     int n_elem;
25501     xmlChar * name; /* the attribute name */
25502     int n_name;
25503     xmlChar * ns; /* the attribute namespace prefix */
25504     int n_ns;
25505     xmlAttributeType type; /* the attribute type */
25506     int n_type;
25507     xmlAttributeDefault def; /* the attribute default type */
25508     int n_def;
25509     xmlChar * defaultValue; /* the attribute default value */
25510     int n_defaultValue;
25511     xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
25512     int n_tree;
25513
25514     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25515     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25516     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25517     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25518     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
25519     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25520     for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
25521     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
25522     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
25523         mem_base = xmlMemBlocks();
25524         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25525         dtd = gen_xmlDtdPtr(n_dtd, 1);
25526         elem = gen_const_xmlChar_ptr(n_elem, 2);
25527         name = gen_const_xmlChar_ptr(n_name, 3);
25528         ns = gen_const_xmlChar_ptr(n_ns, 4);
25529         type = gen_xmlAttributeType(n_type, 5);
25530         def = gen_xmlAttributeDefault(n_def, 6);
25531         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
25532         tree = gen_xmlEnumerationPtr(n_tree, 8);
25533
25534         ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
25535         desret_xmlAttributePtr(ret_val);
25536         call_tests++;
25537         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25538         des_xmlDtdPtr(n_dtd, dtd, 1);
25539         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
25540         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25541         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
25542         des_xmlAttributeType(n_type, type, 5);
25543         des_xmlAttributeDefault(n_def, def, 6);
25544         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
25545         des_xmlEnumerationPtr(n_tree, tree, 8);
25546         xmlResetLastError();
25547         if (mem_base != xmlMemBlocks()) {
25548             printf("Leak of %d blocks found in xmlAddAttributeDecl",
25549                    xmlMemBlocks() - mem_base);
25550             test_ret++;
25551             printf(" %d", n_ctxt);
25552             printf(" %d", n_dtd);
25553             printf(" %d", n_elem);
25554             printf(" %d", n_name);
25555             printf(" %d", n_ns);
25556             printf(" %d", n_type);
25557             printf(" %d", n_def);
25558             printf(" %d", n_defaultValue);
25559             printf(" %d", n_tree);
25560             printf("\n");
25561         }
25562     }
25563     }
25564     }
25565     }
25566     }
25567     }
25568     }
25569     }
25570     }
25571     function_tests++;
25572
25573     return(test_ret);
25574 }
25575
25576
25577 static int
25578 test_xmlAddElementDecl(void) {
25579     int test_ret = 0;
25580
25581     int mem_base;
25582     xmlElementPtr ret_val;
25583     xmlValidCtxtPtr ctxt; /* the validation context */
25584     int n_ctxt;
25585     xmlDtdPtr dtd; /* pointer to the DTD */
25586     int n_dtd;
25587     xmlChar * name; /* the entity name */
25588     int n_name;
25589     xmlElementTypeVal type; /* the element type */
25590     int n_type;
25591     xmlElementContentPtr content; /* the element content tree or NULL */
25592     int n_content;
25593
25594     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25595     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25596     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25597     for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
25598     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25599         mem_base = xmlMemBlocks();
25600         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25601         dtd = gen_xmlDtdPtr(n_dtd, 1);
25602         name = gen_const_xmlChar_ptr(n_name, 2);
25603         type = gen_xmlElementTypeVal(n_type, 3);
25604         content = gen_xmlElementContentPtr(n_content, 4);
25605
25606         ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
25607         desret_xmlElementPtr(ret_val);
25608         call_tests++;
25609         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25610         des_xmlDtdPtr(n_dtd, dtd, 1);
25611         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25612         des_xmlElementTypeVal(n_type, type, 3);
25613         des_xmlElementContentPtr(n_content, content, 4);
25614         xmlResetLastError();
25615         if (mem_base != xmlMemBlocks()) {
25616             printf("Leak of %d blocks found in xmlAddElementDecl",
25617                    xmlMemBlocks() - mem_base);
25618             test_ret++;
25619             printf(" %d", n_ctxt);
25620             printf(" %d", n_dtd);
25621             printf(" %d", n_name);
25622             printf(" %d", n_type);
25623             printf(" %d", n_content);
25624             printf("\n");
25625         }
25626     }
25627     }
25628     }
25629     }
25630     }
25631     function_tests++;
25632
25633     return(test_ret);
25634 }
25635
25636
25637 static int
25638 test_xmlAddID(void) {
25639     int test_ret = 0;
25640
25641
25642     /* missing type support */
25643     return(test_ret);
25644 }
25645
25646
25647 static int
25648 test_xmlAddNotationDecl(void) {
25649     int test_ret = 0;
25650
25651
25652     /* missing type support */
25653     return(test_ret);
25654 }
25655
25656
25657 static int
25658 test_xmlAddRef(void) {
25659     int test_ret = 0;
25660
25661
25662     /* missing type support */
25663     return(test_ret);
25664 }
25665
25666
25667 #define gen_nb_xmlAttributeTablePtr 1
25668 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25669     return(NULL);
25670 }
25671 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25672 }
25673
25674 static int
25675 test_xmlCopyAttributeTable(void) {
25676     int test_ret = 0;
25677
25678
25679     /* missing type support */
25680     return(test_ret);
25681 }
25682
25683
25684 static int
25685 test_xmlCopyDocElementContent(void) {
25686     int test_ret = 0;
25687
25688     int mem_base;
25689     xmlElementContentPtr ret_val;
25690     xmlDocPtr doc; /* the document owning the element declaration */
25691     int n_doc;
25692     xmlElementContentPtr cur; /* An element content pointer. */
25693     int n_cur;
25694
25695     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25696     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25697         mem_base = xmlMemBlocks();
25698         doc = gen_xmlDocPtr(n_doc, 0);
25699         cur = gen_xmlElementContentPtr(n_cur, 1);
25700
25701         ret_val = xmlCopyDocElementContent(doc, cur);
25702         desret_xmlElementContentPtr(ret_val);
25703         call_tests++;
25704         des_xmlDocPtr(n_doc, doc, 0);
25705         des_xmlElementContentPtr(n_cur, cur, 1);
25706         xmlResetLastError();
25707         if (mem_base != xmlMemBlocks()) {
25708             printf("Leak of %d blocks found in xmlCopyDocElementContent",
25709                    xmlMemBlocks() - mem_base);
25710             test_ret++;
25711             printf(" %d", n_doc);
25712             printf(" %d", n_cur);
25713             printf("\n");
25714         }
25715     }
25716     }
25717     function_tests++;
25718
25719     return(test_ret);
25720 }
25721
25722
25723 static int
25724 test_xmlCopyElementContent(void) {
25725     int test_ret = 0;
25726
25727     int mem_base;
25728     xmlElementContentPtr ret_val;
25729     xmlElementContentPtr cur; /* An element content pointer. */
25730     int n_cur;
25731
25732     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
25733         mem_base = xmlMemBlocks();
25734         cur = gen_xmlElementContentPtr(n_cur, 0);
25735
25736         ret_val = xmlCopyElementContent(cur);
25737         desret_xmlElementContentPtr(ret_val);
25738         call_tests++;
25739         des_xmlElementContentPtr(n_cur, cur, 0);
25740         xmlResetLastError();
25741         if (mem_base != xmlMemBlocks()) {
25742             printf("Leak of %d blocks found in xmlCopyElementContent",
25743                    xmlMemBlocks() - mem_base);
25744             test_ret++;
25745             printf(" %d", n_cur);
25746             printf("\n");
25747         }
25748     }
25749     function_tests++;
25750
25751     return(test_ret);
25752 }
25753
25754
25755 #define gen_nb_xmlElementTablePtr 1
25756 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25757     return(NULL);
25758 }
25759 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25760 }
25761
25762 static int
25763 test_xmlCopyElementTable(void) {
25764     int test_ret = 0;
25765
25766
25767     /* missing type support */
25768     return(test_ret);
25769 }
25770
25771
25772 static int
25773 test_xmlCopyEnumeration(void) {
25774     int test_ret = 0;
25775
25776
25777     /* missing type support */
25778     return(test_ret);
25779 }
25780
25781
25782 #define gen_nb_xmlNotationTablePtr 1
25783 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25784     return(NULL);
25785 }
25786 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25787 }
25788
25789 static int
25790 test_xmlCopyNotationTable(void) {
25791     int test_ret = 0;
25792
25793
25794     /* missing type support */
25795     return(test_ret);
25796 }
25797
25798
25799 static int
25800 test_xmlCreateEnumeration(void) {
25801     int test_ret = 0;
25802
25803
25804     /* missing type support */
25805     return(test_ret);
25806 }
25807
25808
25809 #define gen_nb_xmlAttributePtr 1
25810 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25811     return(NULL);
25812 }
25813 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25814 }
25815
25816 static int
25817 test_xmlDumpAttributeDecl(void) {
25818     int test_ret = 0;
25819
25820 #if defined(LIBXML_OUTPUT_ENABLED)
25821     int mem_base;
25822     xmlBufferPtr buf; /* the XML buffer output */
25823     int n_buf;
25824     xmlAttributePtr attr; /* An attribute declaration */
25825     int n_attr;
25826
25827     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25828     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25829         mem_base = xmlMemBlocks();
25830         buf = gen_xmlBufferPtr(n_buf, 0);
25831         attr = gen_xmlAttributePtr(n_attr, 1);
25832
25833         xmlDumpAttributeDecl(buf, attr);
25834         call_tests++;
25835         des_xmlBufferPtr(n_buf, buf, 0);
25836         des_xmlAttributePtr(n_attr, attr, 1);
25837         xmlResetLastError();
25838         if (mem_base != xmlMemBlocks()) {
25839             printf("Leak of %d blocks found in xmlDumpAttributeDecl",
25840                    xmlMemBlocks() - mem_base);
25841             test_ret++;
25842             printf(" %d", n_buf);
25843             printf(" %d", n_attr);
25844             printf("\n");
25845         }
25846     }
25847     }
25848     function_tests++;
25849 #endif
25850
25851     return(test_ret);
25852 }
25853
25854
25855 static int
25856 test_xmlDumpAttributeTable(void) {
25857     int test_ret = 0;
25858
25859 #if defined(LIBXML_OUTPUT_ENABLED)
25860     int mem_base;
25861     xmlBufferPtr buf; /* the XML buffer output */
25862     int n_buf;
25863     xmlAttributeTablePtr table; /* An attribute table */
25864     int n_table;
25865
25866     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25867     for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
25868         mem_base = xmlMemBlocks();
25869         buf = gen_xmlBufferPtr(n_buf, 0);
25870         table = gen_xmlAttributeTablePtr(n_table, 1);
25871
25872         xmlDumpAttributeTable(buf, table);
25873         call_tests++;
25874         des_xmlBufferPtr(n_buf, buf, 0);
25875         des_xmlAttributeTablePtr(n_table, table, 1);
25876         xmlResetLastError();
25877         if (mem_base != xmlMemBlocks()) {
25878             printf("Leak of %d blocks found in xmlDumpAttributeTable",
25879                    xmlMemBlocks() - mem_base);
25880             test_ret++;
25881             printf(" %d", n_buf);
25882             printf(" %d", n_table);
25883             printf("\n");
25884         }
25885     }
25886     }
25887     function_tests++;
25888 #endif
25889
25890     return(test_ret);
25891 }
25892
25893
25894 #define gen_nb_xmlElementPtr 1
25895 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25896     return(NULL);
25897 }
25898 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25899 }
25900
25901 static int
25902 test_xmlDumpElementDecl(void) {
25903     int test_ret = 0;
25904
25905 #if defined(LIBXML_OUTPUT_ENABLED)
25906     int mem_base;
25907     xmlBufferPtr buf; /* the XML buffer output */
25908     int n_buf;
25909     xmlElementPtr elem; /* An element table */
25910     int n_elem;
25911
25912     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25913     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25914         mem_base = xmlMemBlocks();
25915         buf = gen_xmlBufferPtr(n_buf, 0);
25916         elem = gen_xmlElementPtr(n_elem, 1);
25917
25918         xmlDumpElementDecl(buf, elem);
25919         call_tests++;
25920         des_xmlBufferPtr(n_buf, buf, 0);
25921         des_xmlElementPtr(n_elem, elem, 1);
25922         xmlResetLastError();
25923         if (mem_base != xmlMemBlocks()) {
25924             printf("Leak of %d blocks found in xmlDumpElementDecl",
25925                    xmlMemBlocks() - mem_base);
25926             test_ret++;
25927             printf(" %d", n_buf);
25928             printf(" %d", n_elem);
25929             printf("\n");
25930         }
25931     }
25932     }
25933     function_tests++;
25934 #endif
25935
25936     return(test_ret);
25937 }
25938
25939
25940 static int
25941 test_xmlDumpElementTable(void) {
25942     int test_ret = 0;
25943
25944 #if defined(LIBXML_OUTPUT_ENABLED)
25945     int mem_base;
25946     xmlBufferPtr buf; /* the XML buffer output */
25947     int n_buf;
25948     xmlElementTablePtr table; /* An element table */
25949     int n_table;
25950
25951     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25952     for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25953         mem_base = xmlMemBlocks();
25954         buf = gen_xmlBufferPtr(n_buf, 0);
25955         table = gen_xmlElementTablePtr(n_table, 1);
25956
25957         xmlDumpElementTable(buf, table);
25958         call_tests++;
25959         des_xmlBufferPtr(n_buf, buf, 0);
25960         des_xmlElementTablePtr(n_table, table, 1);
25961         xmlResetLastError();
25962         if (mem_base != xmlMemBlocks()) {
25963             printf("Leak of %d blocks found in xmlDumpElementTable",
25964                    xmlMemBlocks() - mem_base);
25965             test_ret++;
25966             printf(" %d", n_buf);
25967             printf(" %d", n_table);
25968             printf("\n");
25969         }
25970     }
25971     }
25972     function_tests++;
25973 #endif
25974
25975     return(test_ret);
25976 }
25977
25978
25979 #define gen_nb_xmlNotationPtr 1
25980 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25981     return(NULL);
25982 }
25983 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25984 }
25985
25986 static int
25987 test_xmlDumpNotationDecl(void) {
25988     int test_ret = 0;
25989
25990 #if defined(LIBXML_OUTPUT_ENABLED)
25991     int mem_base;
25992     xmlBufferPtr buf; /* the XML buffer output */
25993     int n_buf;
25994     xmlNotationPtr nota; /* A notation declaration */
25995     int n_nota;
25996
25997     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25998     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25999         mem_base = xmlMemBlocks();
26000         buf = gen_xmlBufferPtr(n_buf, 0);
26001         nota = gen_xmlNotationPtr(n_nota, 1);
26002
26003         xmlDumpNotationDecl(buf, nota);
26004         call_tests++;
26005         des_xmlBufferPtr(n_buf, buf, 0);
26006         des_xmlNotationPtr(n_nota, nota, 1);
26007         xmlResetLastError();
26008         if (mem_base != xmlMemBlocks()) {
26009             printf("Leak of %d blocks found in xmlDumpNotationDecl",
26010                    xmlMemBlocks() - mem_base);
26011             test_ret++;
26012             printf(" %d", n_buf);
26013             printf(" %d", n_nota);
26014             printf("\n");
26015         }
26016     }
26017     }
26018     function_tests++;
26019 #endif
26020
26021     return(test_ret);
26022 }
26023
26024
26025 static int
26026 test_xmlDumpNotationTable(void) {
26027     int test_ret = 0;
26028
26029 #if defined(LIBXML_OUTPUT_ENABLED)
26030     int mem_base;
26031     xmlBufferPtr buf; /* the XML buffer output */
26032     int n_buf;
26033     xmlNotationTablePtr table; /* A notation table */
26034     int n_table;
26035
26036     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
26037     for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
26038         mem_base = xmlMemBlocks();
26039         buf = gen_xmlBufferPtr(n_buf, 0);
26040         table = gen_xmlNotationTablePtr(n_table, 1);
26041
26042         xmlDumpNotationTable(buf, table);
26043         call_tests++;
26044         des_xmlBufferPtr(n_buf, buf, 0);
26045         des_xmlNotationTablePtr(n_table, table, 1);
26046         xmlResetLastError();
26047         if (mem_base != xmlMemBlocks()) {
26048             printf("Leak of %d blocks found in xmlDumpNotationTable",
26049                    xmlMemBlocks() - mem_base);
26050             test_ret++;
26051             printf(" %d", n_buf);
26052             printf(" %d", n_table);
26053             printf("\n");
26054         }
26055     }
26056     }
26057     function_tests++;
26058 #endif
26059
26060     return(test_ret);
26061 }
26062
26063
26064 static int
26065 test_xmlGetDtdAttrDesc(void) {
26066     int test_ret = 0;
26067
26068     int mem_base;
26069     xmlAttributePtr ret_val;
26070     xmlDtdPtr dtd; /* a pointer to the DtD to search */
26071     int n_dtd;
26072     xmlChar * elem; /* the element name */
26073     int n_elem;
26074     xmlChar * name; /* the attribute name */
26075     int n_name;
26076
26077     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26078     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
26079     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26080         mem_base = xmlMemBlocks();
26081         dtd = gen_xmlDtdPtr(n_dtd, 0);
26082         elem = gen_const_xmlChar_ptr(n_elem, 1);
26083         name = gen_const_xmlChar_ptr(n_name, 2);
26084
26085         ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
26086         desret_xmlAttributePtr(ret_val);
26087         call_tests++;
26088         des_xmlDtdPtr(n_dtd, dtd, 0);
26089         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
26090         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26091         xmlResetLastError();
26092         if (mem_base != xmlMemBlocks()) {
26093             printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
26094                    xmlMemBlocks() - mem_base);
26095             test_ret++;
26096             printf(" %d", n_dtd);
26097             printf(" %d", n_elem);
26098             printf(" %d", n_name);
26099             printf("\n");
26100         }
26101     }
26102     }
26103     }
26104     function_tests++;
26105
26106     return(test_ret);
26107 }
26108
26109
26110 static int
26111 test_xmlGetDtdElementDesc(void) {
26112     int test_ret = 0;
26113
26114     int mem_base;
26115     xmlElementPtr ret_val;
26116     xmlDtdPtr dtd; /* a pointer to the DtD to search */
26117     int n_dtd;
26118     xmlChar * name; /* the element name */
26119     int n_name;
26120
26121     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26122     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26123         mem_base = xmlMemBlocks();
26124         dtd = gen_xmlDtdPtr(n_dtd, 0);
26125         name = gen_const_xmlChar_ptr(n_name, 1);
26126
26127         ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
26128         desret_xmlElementPtr(ret_val);
26129         call_tests++;
26130         des_xmlDtdPtr(n_dtd, dtd, 0);
26131         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
26132         xmlResetLastError();
26133         if (mem_base != xmlMemBlocks()) {
26134             printf("Leak of %d blocks found in xmlGetDtdElementDesc",
26135                    xmlMemBlocks() - mem_base);
26136             test_ret++;
26137             printf(" %d", n_dtd);
26138             printf(" %d", n_name);
26139             printf("\n");
26140         }
26141     }
26142     }
26143     function_tests++;
26144
26145     return(test_ret);
26146 }
26147
26148
26149 static int
26150 test_xmlGetDtdNotationDesc(void) {
26151     int test_ret = 0;
26152
26153
26154     /* missing type support */
26155     return(test_ret);
26156 }
26157
26158
26159 static int
26160 test_xmlGetDtdQAttrDesc(void) {
26161     int test_ret = 0;
26162
26163     int mem_base;
26164     xmlAttributePtr ret_val;
26165     xmlDtdPtr dtd; /* a pointer to the DtD to search */
26166     int n_dtd;
26167     xmlChar * elem; /* the element name */
26168     int n_elem;
26169     xmlChar * name; /* the attribute name */
26170     int n_name;
26171     xmlChar * prefix; /* the attribute namespace prefix */
26172     int n_prefix;
26173
26174     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26175     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
26176     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26177     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26178         mem_base = xmlMemBlocks();
26179         dtd = gen_xmlDtdPtr(n_dtd, 0);
26180         elem = gen_const_xmlChar_ptr(n_elem, 1);
26181         name = gen_const_xmlChar_ptr(n_name, 2);
26182         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26183
26184         ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
26185         desret_xmlAttributePtr(ret_val);
26186         call_tests++;
26187         des_xmlDtdPtr(n_dtd, dtd, 0);
26188         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
26189         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26190         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26191         xmlResetLastError();
26192         if (mem_base != xmlMemBlocks()) {
26193             printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
26194                    xmlMemBlocks() - mem_base);
26195             test_ret++;
26196             printf(" %d", n_dtd);
26197             printf(" %d", n_elem);
26198             printf(" %d", n_name);
26199             printf(" %d", n_prefix);
26200             printf("\n");
26201         }
26202     }
26203     }
26204     }
26205     }
26206     function_tests++;
26207
26208     return(test_ret);
26209 }
26210
26211
26212 static int
26213 test_xmlGetDtdQElementDesc(void) {
26214     int test_ret = 0;
26215
26216     int mem_base;
26217     xmlElementPtr ret_val;
26218     xmlDtdPtr dtd; /* a pointer to the DtD to search */
26219     int n_dtd;
26220     xmlChar * name; /* the element name */
26221     int n_name;
26222     xmlChar * prefix; /* the element namespace prefix */
26223     int n_prefix;
26224
26225     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26226     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26227     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26228         mem_base = xmlMemBlocks();
26229         dtd = gen_xmlDtdPtr(n_dtd, 0);
26230         name = gen_const_xmlChar_ptr(n_name, 1);
26231         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
26232
26233         ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
26234         desret_xmlElementPtr(ret_val);
26235         call_tests++;
26236         des_xmlDtdPtr(n_dtd, dtd, 0);
26237         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
26238         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
26239         xmlResetLastError();
26240         if (mem_base != xmlMemBlocks()) {
26241             printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
26242                    xmlMemBlocks() - mem_base);
26243             test_ret++;
26244             printf(" %d", n_dtd);
26245             printf(" %d", n_name);
26246             printf(" %d", n_prefix);
26247             printf("\n");
26248         }
26249     }
26250     }
26251     }
26252     function_tests++;
26253
26254     return(test_ret);
26255 }
26256
26257
26258 static int
26259 test_xmlGetID(void) {
26260     int test_ret = 0;
26261
26262     int mem_base;
26263     xmlAttrPtr ret_val;
26264     xmlDocPtr doc; /* pointer to the document */
26265     int n_doc;
26266     xmlChar * ID; /* the ID value */
26267     int n_ID;
26268
26269     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26270     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
26271         mem_base = xmlMemBlocks();
26272         doc = gen_xmlDocPtr(n_doc, 0);
26273         ID = gen_const_xmlChar_ptr(n_ID, 1);
26274
26275         ret_val = xmlGetID(doc, (const xmlChar *)ID);
26276         desret_xmlAttrPtr(ret_val);
26277         call_tests++;
26278         des_xmlDocPtr(n_doc, doc, 0);
26279         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
26280         xmlResetLastError();
26281         if (mem_base != xmlMemBlocks()) {
26282             printf("Leak of %d blocks found in xmlGetID",
26283                    xmlMemBlocks() - mem_base);
26284             test_ret++;
26285             printf(" %d", n_doc);
26286             printf(" %d", n_ID);
26287             printf("\n");
26288         }
26289     }
26290     }
26291     function_tests++;
26292
26293     return(test_ret);
26294 }
26295
26296
26297 static int
26298 test_xmlGetRefs(void) {
26299     int test_ret = 0;
26300
26301
26302     /* missing type support */
26303     return(test_ret);
26304 }
26305
26306
26307 static int
26308 test_xmlIsID(void) {
26309     int test_ret = 0;
26310
26311     int mem_base;
26312     int ret_val;
26313     xmlDocPtr doc; /* the document */
26314     int n_doc;
26315     xmlNodePtr elem; /* the element carrying the attribute */
26316     int n_elem;
26317     xmlAttrPtr attr; /* the attribute */
26318     int n_attr;
26319
26320     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26321     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26322     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26323         mem_base = xmlMemBlocks();
26324         doc = gen_xmlDocPtr(n_doc, 0);
26325         elem = gen_xmlNodePtr(n_elem, 1);
26326         attr = gen_xmlAttrPtr(n_attr, 2);
26327
26328         ret_val = xmlIsID(doc, elem, attr);
26329         desret_int(ret_val);
26330         call_tests++;
26331         des_xmlDocPtr(n_doc, doc, 0);
26332         des_xmlNodePtr(n_elem, elem, 1);
26333         des_xmlAttrPtr(n_attr, attr, 2);
26334         xmlResetLastError();
26335         if (mem_base != xmlMemBlocks()) {
26336             printf("Leak of %d blocks found in xmlIsID",
26337                    xmlMemBlocks() - mem_base);
26338             test_ret++;
26339             printf(" %d", n_doc);
26340             printf(" %d", n_elem);
26341             printf(" %d", n_attr);
26342             printf("\n");
26343         }
26344     }
26345     }
26346     }
26347     function_tests++;
26348
26349     return(test_ret);
26350 }
26351
26352
26353 static int
26354 test_xmlIsMixedElement(void) {
26355     int test_ret = 0;
26356
26357     int mem_base;
26358     int ret_val;
26359     xmlDocPtr doc; /* the document */
26360     int n_doc;
26361     xmlChar * name; /* the element name */
26362     int n_name;
26363
26364     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26365     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26366         mem_base = xmlMemBlocks();
26367         doc = gen_xmlDocPtr(n_doc, 0);
26368         name = gen_const_xmlChar_ptr(n_name, 1);
26369
26370         ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
26371         desret_int(ret_val);
26372         call_tests++;
26373         des_xmlDocPtr(n_doc, doc, 0);
26374         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
26375         xmlResetLastError();
26376         if (mem_base != xmlMemBlocks()) {
26377             printf("Leak of %d blocks found in xmlIsMixedElement",
26378                    xmlMemBlocks() - mem_base);
26379             test_ret++;
26380             printf(" %d", n_doc);
26381             printf(" %d", n_name);
26382             printf("\n");
26383         }
26384     }
26385     }
26386     function_tests++;
26387
26388     return(test_ret);
26389 }
26390
26391
26392 static int
26393 test_xmlIsRef(void) {
26394     int test_ret = 0;
26395
26396     int mem_base;
26397     int ret_val;
26398     xmlDocPtr doc; /* the document */
26399     int n_doc;
26400     xmlNodePtr elem; /* the element carrying the attribute */
26401     int n_elem;
26402     xmlAttrPtr attr; /* the attribute */
26403     int n_attr;
26404
26405     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26406     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26407     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26408         mem_base = xmlMemBlocks();
26409         doc = gen_xmlDocPtr(n_doc, 0);
26410         elem = gen_xmlNodePtr(n_elem, 1);
26411         attr = gen_xmlAttrPtr(n_attr, 2);
26412
26413         ret_val = xmlIsRef(doc, elem, attr);
26414         desret_int(ret_val);
26415         call_tests++;
26416         des_xmlDocPtr(n_doc, doc, 0);
26417         des_xmlNodePtr(n_elem, elem, 1);
26418         des_xmlAttrPtr(n_attr, attr, 2);
26419         xmlResetLastError();
26420         if (mem_base != xmlMemBlocks()) {
26421             printf("Leak of %d blocks found in xmlIsRef",
26422                    xmlMemBlocks() - mem_base);
26423             test_ret++;
26424             printf(" %d", n_doc);
26425             printf(" %d", n_elem);
26426             printf(" %d", n_attr);
26427             printf("\n");
26428         }
26429     }
26430     }
26431     }
26432     function_tests++;
26433
26434     return(test_ret);
26435 }
26436
26437
26438 static int
26439 test_xmlNewDocElementContent(void) {
26440     int test_ret = 0;
26441
26442     int mem_base;
26443     xmlElementContentPtr ret_val;
26444     xmlDocPtr doc; /* the document */
26445     int n_doc;
26446     xmlChar * name; /* the subelement name or NULL */
26447     int n_name;
26448     xmlElementContentType type; /* the type of element content decl */
26449     int n_type;
26450
26451     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26452     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26453     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
26454         mem_base = xmlMemBlocks();
26455         doc = gen_xmlDocPtr(n_doc, 0);
26456         name = gen_const_xmlChar_ptr(n_name, 1);
26457         type = gen_xmlElementContentType(n_type, 2);
26458
26459         ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
26460         xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
26461         desret_xmlElementContentPtr(ret_val);
26462         call_tests++;
26463         des_xmlDocPtr(n_doc, doc, 0);
26464         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
26465         des_xmlElementContentType(n_type, type, 2);
26466         xmlResetLastError();
26467         if (mem_base != xmlMemBlocks()) {
26468             printf("Leak of %d blocks found in xmlNewDocElementContent",
26469                    xmlMemBlocks() - mem_base);
26470             test_ret++;
26471             printf(" %d", n_doc);
26472             printf(" %d", n_name);
26473             printf(" %d", n_type);
26474             printf("\n");
26475         }
26476     }
26477     }
26478     }
26479     function_tests++;
26480
26481     return(test_ret);
26482 }
26483
26484
26485 static int
26486 test_xmlNewElementContent(void) {
26487     int test_ret = 0;
26488
26489     int mem_base;
26490     xmlElementContentPtr ret_val;
26491     xmlChar * name; /* the subelement name or NULL */
26492     int n_name;
26493     xmlElementContentType type; /* the type of element content decl */
26494     int n_type;
26495
26496     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26497     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
26498         mem_base = xmlMemBlocks();
26499         name = gen_const_xmlChar_ptr(n_name, 0);
26500         type = gen_xmlElementContentType(n_type, 1);
26501
26502         ret_val = xmlNewElementContent((const xmlChar *)name, type);
26503         desret_xmlElementContentPtr(ret_val);
26504         call_tests++;
26505         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
26506         des_xmlElementContentType(n_type, type, 1);
26507         xmlResetLastError();
26508         if (mem_base != xmlMemBlocks()) {
26509             printf("Leak of %d blocks found in xmlNewElementContent",
26510                    xmlMemBlocks() - mem_base);
26511             test_ret++;
26512             printf(" %d", n_name);
26513             printf(" %d", n_type);
26514             printf("\n");
26515         }
26516     }
26517     }
26518     function_tests++;
26519
26520     return(test_ret);
26521 }
26522
26523
26524 static int
26525 test_xmlNewValidCtxt(void) {
26526     int test_ret = 0;
26527
26528
26529     /* missing type support */
26530     return(test_ret);
26531 }
26532
26533
26534 static int
26535 test_xmlRemoveID(void) {
26536     int test_ret = 0;
26537
26538     int mem_base;
26539     int ret_val;
26540     xmlDocPtr doc; /* the document */
26541     int n_doc;
26542     xmlAttrPtr attr; /* the attribute */
26543     int n_attr;
26544
26545     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26546     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26547         mem_base = xmlMemBlocks();
26548         doc = gen_xmlDocPtr(n_doc, 0);
26549         attr = gen_xmlAttrPtr(n_attr, 1);
26550
26551         ret_val = xmlRemoveID(doc, attr);
26552         desret_int(ret_val);
26553         call_tests++;
26554         des_xmlDocPtr(n_doc, doc, 0);
26555         des_xmlAttrPtr(n_attr, attr, 1);
26556         xmlResetLastError();
26557         if (mem_base != xmlMemBlocks()) {
26558             printf("Leak of %d blocks found in xmlRemoveID",
26559                    xmlMemBlocks() - mem_base);
26560             test_ret++;
26561             printf(" %d", n_doc);
26562             printf(" %d", n_attr);
26563             printf("\n");
26564         }
26565     }
26566     }
26567     function_tests++;
26568
26569     return(test_ret);
26570 }
26571
26572
26573 static int
26574 test_xmlRemoveRef(void) {
26575     int test_ret = 0;
26576
26577     int mem_base;
26578     int ret_val;
26579     xmlDocPtr doc; /* the document */
26580     int n_doc;
26581     xmlAttrPtr attr; /* the attribute */
26582     int n_attr;
26583
26584     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26585     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26586         mem_base = xmlMemBlocks();
26587         doc = gen_xmlDocPtr(n_doc, 0);
26588         attr = gen_xmlAttrPtr(n_attr, 1);
26589
26590         ret_val = xmlRemoveRef(doc, attr);
26591         desret_int(ret_val);
26592         call_tests++;
26593         des_xmlDocPtr(n_doc, doc, 0);
26594         des_xmlAttrPtr(n_attr, attr, 1);
26595         xmlResetLastError();
26596         if (mem_base != xmlMemBlocks()) {
26597             printf("Leak of %d blocks found in xmlRemoveRef",
26598                    xmlMemBlocks() - mem_base);
26599             test_ret++;
26600             printf(" %d", n_doc);
26601             printf(" %d", n_attr);
26602             printf("\n");
26603         }
26604     }
26605     }
26606     function_tests++;
26607
26608     return(test_ret);
26609 }
26610
26611
26612 static int
26613 test_xmlSnprintfElementContent(void) {
26614     int test_ret = 0;
26615
26616     int mem_base;
26617     char * buf; /* an output buffer */
26618     int n_buf;
26619     int size; /* the buffer size */
26620     int n_size;
26621     xmlElementContentPtr content; /* An element table */
26622     int n_content;
26623     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26624     int n_englob;
26625
26626     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26627     for (n_size = 0;n_size < gen_nb_int;n_size++) {
26628     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26629     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26630         mem_base = xmlMemBlocks();
26631         buf = gen_char_ptr(n_buf, 0);
26632         size = gen_int(n_size, 1);
26633         content = gen_xmlElementContentPtr(n_content, 2);
26634         englob = gen_int(n_englob, 3);
26635
26636         xmlSnprintfElementContent(buf, size, content, englob);
26637         call_tests++;
26638         des_char_ptr(n_buf, buf, 0);
26639         des_int(n_size, size, 1);
26640         des_xmlElementContentPtr(n_content, content, 2);
26641         des_int(n_englob, englob, 3);
26642         xmlResetLastError();
26643         if (mem_base != xmlMemBlocks()) {
26644             printf("Leak of %d blocks found in xmlSnprintfElementContent",
26645                    xmlMemBlocks() - mem_base);
26646             test_ret++;
26647             printf(" %d", n_buf);
26648             printf(" %d", n_size);
26649             printf(" %d", n_content);
26650             printf(" %d", n_englob);
26651             printf("\n");
26652         }
26653     }
26654     }
26655     }
26656     }
26657     function_tests++;
26658
26659     return(test_ret);
26660 }
26661
26662
26663 static int
26664 test_xmlSprintfElementContent(void) {
26665     int test_ret = 0;
26666
26667 #if defined(LIBXML_OUTPUT_ENABLED)
26668 #ifdef LIBXML_OUTPUT_ENABLED
26669     int mem_base;
26670     char * buf; /* an output buffer */
26671     int n_buf;
26672     xmlElementContentPtr content; /* An element table */
26673     int n_content;
26674     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
26675     int n_englob;
26676
26677     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
26678     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
26679     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
26680         mem_base = xmlMemBlocks();
26681         buf = gen_char_ptr(n_buf, 0);
26682         content = gen_xmlElementContentPtr(n_content, 1);
26683         englob = gen_int(n_englob, 2);
26684
26685         xmlSprintfElementContent(buf, content, englob);
26686         call_tests++;
26687         des_char_ptr(n_buf, buf, 0);
26688         des_xmlElementContentPtr(n_content, content, 1);
26689         des_int(n_englob, englob, 2);
26690         xmlResetLastError();
26691         if (mem_base != xmlMemBlocks()) {
26692             printf("Leak of %d blocks found in xmlSprintfElementContent",
26693                    xmlMemBlocks() - mem_base);
26694             test_ret++;
26695             printf(" %d", n_buf);
26696             printf(" %d", n_content);
26697             printf(" %d", n_englob);
26698             printf("\n");
26699         }
26700     }
26701     }
26702     }
26703     function_tests++;
26704 #endif
26705 #endif
26706
26707     return(test_ret);
26708 }
26709
26710
26711 static int
26712 test_xmlValidBuildContentModel(void) {
26713     int test_ret = 0;
26714
26715 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26716     int mem_base;
26717     int ret_val;
26718     xmlValidCtxtPtr ctxt; /* a validation context */
26719     int n_ctxt;
26720     xmlElementPtr elem; /* an element declaration node */
26721     int n_elem;
26722
26723     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26724     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26725         mem_base = xmlMemBlocks();
26726         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26727         elem = gen_xmlElementPtr(n_elem, 1);
26728
26729         ret_val = xmlValidBuildContentModel(ctxt, elem);
26730         desret_int(ret_val);
26731         call_tests++;
26732         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26733         des_xmlElementPtr(n_elem, elem, 1);
26734         xmlResetLastError();
26735         if (mem_base != xmlMemBlocks()) {
26736             printf("Leak of %d blocks found in xmlValidBuildContentModel",
26737                    xmlMemBlocks() - mem_base);
26738             test_ret++;
26739             printf(" %d", n_ctxt);
26740             printf(" %d", n_elem);
26741             printf("\n");
26742         }
26743     }
26744     }
26745     function_tests++;
26746 #endif
26747
26748     return(test_ret);
26749 }
26750
26751
26752 static int
26753 test_xmlValidCtxtNormalizeAttributeValue(void) {
26754     int test_ret = 0;
26755
26756 #if defined(LIBXML_VALID_ENABLED)
26757     int mem_base;
26758     xmlChar * ret_val;
26759     xmlValidCtxtPtr ctxt; /* the validation context or NULL */
26760     int n_ctxt;
26761     xmlDocPtr doc; /* the document */
26762     int n_doc;
26763     xmlNodePtr elem; /* the parent */
26764     int n_elem;
26765     xmlChar * name; /* the attribute name */
26766     int n_name;
26767     xmlChar * value; /* the attribute value */
26768     int n_value;
26769
26770     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26771     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26772     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26773     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26774     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26775         mem_base = xmlMemBlocks();
26776         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26777         doc = gen_xmlDocPtr(n_doc, 1);
26778         elem = gen_xmlNodePtr(n_elem, 2);
26779         name = gen_const_xmlChar_ptr(n_name, 3);
26780         value = gen_const_xmlChar_ptr(n_value, 4);
26781
26782         ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26783         desret_xmlChar_ptr(ret_val);
26784         call_tests++;
26785         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26786         des_xmlDocPtr(n_doc, doc, 1);
26787         des_xmlNodePtr(n_elem, elem, 2);
26788         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
26789         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26790         xmlResetLastError();
26791         if (mem_base != xmlMemBlocks()) {
26792             printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
26793                    xmlMemBlocks() - mem_base);
26794             test_ret++;
26795             printf(" %d", n_ctxt);
26796             printf(" %d", n_doc);
26797             printf(" %d", n_elem);
26798             printf(" %d", n_name);
26799             printf(" %d", n_value);
26800             printf("\n");
26801         }
26802     }
26803     }
26804     }
26805     }
26806     }
26807     function_tests++;
26808 #endif
26809
26810     return(test_ret);
26811 }
26812
26813
26814 #define gen_nb_xmlElementContent_ptr 1
26815 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26816     return(NULL);
26817 }
26818 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26819 }
26820
26821 static int
26822 test_xmlValidGetPotentialChildren(void) {
26823     int test_ret = 0;
26824
26825 #if defined(LIBXML_VALID_ENABLED)
26826 #ifdef LIBXML_VALID_ENABLED
26827     int mem_base;
26828     int ret_val;
26829     xmlElementContent * ctree; /* an element content tree */
26830     int n_ctree;
26831     xmlChar ** names; /* an array to store the list of child names */
26832     int n_names;
26833     int * len; /* a pointer to the number of element in the list */
26834     int n_len;
26835     int max; /* the size of the array */
26836     int n_max;
26837
26838     for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
26839     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26840     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
26841     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26842         mem_base = xmlMemBlocks();
26843         ctree = gen_xmlElementContent_ptr(n_ctree, 0);
26844         names = gen_const_xmlChar_ptr_ptr(n_names, 1);
26845         len = gen_int_ptr(n_len, 2);
26846         max = gen_int(n_max, 3);
26847
26848         ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
26849         desret_int(ret_val);
26850         call_tests++;
26851         des_xmlElementContent_ptr(n_ctree, ctree, 0);
26852         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
26853         des_int_ptr(n_len, len, 2);
26854         des_int(n_max, max, 3);
26855         xmlResetLastError();
26856         if (mem_base != xmlMemBlocks()) {
26857             printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
26858                    xmlMemBlocks() - mem_base);
26859             test_ret++;
26860             printf(" %d", n_ctree);
26861             printf(" %d", n_names);
26862             printf(" %d", n_len);
26863             printf(" %d", n_max);
26864             printf("\n");
26865         }
26866     }
26867     }
26868     }
26869     }
26870     function_tests++;
26871 #endif
26872 #endif
26873
26874     return(test_ret);
26875 }
26876
26877
26878 static int
26879 test_xmlValidGetValidElements(void) {
26880     int test_ret = 0;
26881
26882 #if defined(LIBXML_VALID_ENABLED)
26883 #ifdef LIBXML_VALID_ENABLED
26884     int mem_base;
26885     int ret_val;
26886     xmlNode * prev; /* an element to insert after */
26887     int n_prev;
26888     xmlNode * next; /* an element to insert next */
26889     int n_next;
26890     xmlChar ** names; /* an array to store the list of child names */
26891     int n_names;
26892     int max; /* the size of the array */
26893     int n_max;
26894
26895     for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
26896     for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26897     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26898     for (n_max = 0;n_max < gen_nb_int;n_max++) {
26899         mem_base = xmlMemBlocks();
26900         prev = gen_xmlNodePtr(n_prev, 0);
26901         next = gen_xmlNodePtr(n_next, 1);
26902         names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26903         max = gen_int(n_max, 3);
26904
26905         ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26906         desret_int(ret_val);
26907         call_tests++;
26908         des_xmlNodePtr(n_prev, prev, 0);
26909         des_xmlNodePtr(n_next, next, 1);
26910         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26911         des_int(n_max, max, 3);
26912         xmlResetLastError();
26913         if (mem_base != xmlMemBlocks()) {
26914             printf("Leak of %d blocks found in xmlValidGetValidElements",
26915                    xmlMemBlocks() - mem_base);
26916             test_ret++;
26917             printf(" %d", n_prev);
26918             printf(" %d", n_next);
26919             printf(" %d", n_names);
26920             printf(" %d", n_max);
26921             printf("\n");
26922         }
26923     }
26924     }
26925     }
26926     }
26927     function_tests++;
26928 #endif
26929 #endif
26930
26931     return(test_ret);
26932 }
26933
26934
26935 static int
26936 test_xmlValidNormalizeAttributeValue(void) {
26937     int test_ret = 0;
26938
26939 #if defined(LIBXML_VALID_ENABLED)
26940     int mem_base;
26941     xmlChar * ret_val;
26942     xmlDocPtr doc; /* the document */
26943     int n_doc;
26944     xmlNodePtr elem; /* the parent */
26945     int n_elem;
26946     xmlChar * name; /* the attribute name */
26947     int n_name;
26948     xmlChar * value; /* the attribute value */
26949     int n_value;
26950
26951     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26952     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26953     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26954     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26955         mem_base = xmlMemBlocks();
26956         doc = gen_xmlDocPtr(n_doc, 0);
26957         elem = gen_xmlNodePtr(n_elem, 1);
26958         name = gen_const_xmlChar_ptr(n_name, 2);
26959         value = gen_const_xmlChar_ptr(n_value, 3);
26960
26961         ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26962         desret_xmlChar_ptr(ret_val);
26963         call_tests++;
26964         des_xmlDocPtr(n_doc, doc, 0);
26965         des_xmlNodePtr(n_elem, elem, 1);
26966         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26967         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26968         xmlResetLastError();
26969         if (mem_base != xmlMemBlocks()) {
26970             printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26971                    xmlMemBlocks() - mem_base);
26972             test_ret++;
26973             printf(" %d", n_doc);
26974             printf(" %d", n_elem);
26975             printf(" %d", n_name);
26976             printf(" %d", n_value);
26977             printf("\n");
26978         }
26979     }
26980     }
26981     }
26982     }
26983     function_tests++;
26984 #endif
26985
26986     return(test_ret);
26987 }
26988
26989
26990 static int
26991 test_xmlValidateAttributeDecl(void) {
26992     int test_ret = 0;
26993
26994 #if defined(LIBXML_VALID_ENABLED)
26995     int mem_base;
26996     int ret_val;
26997     xmlValidCtxtPtr ctxt; /* the validation context */
26998     int n_ctxt;
26999     xmlDocPtr doc; /* a document instance */
27000     int n_doc;
27001     xmlAttributePtr attr; /* an attribute definition */
27002     int n_attr;
27003
27004     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27005     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27006     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
27007         mem_base = xmlMemBlocks();
27008         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27009         doc = gen_xmlDocPtr(n_doc, 1);
27010         attr = gen_xmlAttributePtr(n_attr, 2);
27011
27012         ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
27013         desret_int(ret_val);
27014         call_tests++;
27015         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27016         des_xmlDocPtr(n_doc, doc, 1);
27017         des_xmlAttributePtr(n_attr, attr, 2);
27018         xmlResetLastError();
27019         if (mem_base != xmlMemBlocks()) {
27020             printf("Leak of %d blocks found in xmlValidateAttributeDecl",
27021                    xmlMemBlocks() - mem_base);
27022             test_ret++;
27023             printf(" %d", n_ctxt);
27024             printf(" %d", n_doc);
27025             printf(" %d", n_attr);
27026             printf("\n");
27027         }
27028     }
27029     }
27030     }
27031     function_tests++;
27032 #endif
27033
27034     return(test_ret);
27035 }
27036
27037
27038 static int
27039 test_xmlValidateAttributeValue(void) {
27040     int test_ret = 0;
27041
27042 #if defined(LIBXML_VALID_ENABLED)
27043     int mem_base;
27044     int ret_val;
27045     xmlAttributeType type; /* an attribute type */
27046     int n_type;
27047     xmlChar * value; /* an attribute value */
27048     int n_value;
27049
27050     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
27051     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27052         mem_base = xmlMemBlocks();
27053         type = gen_xmlAttributeType(n_type, 0);
27054         value = gen_const_xmlChar_ptr(n_value, 1);
27055
27056         ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
27057         desret_int(ret_val);
27058         call_tests++;
27059         des_xmlAttributeType(n_type, type, 0);
27060         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
27061         xmlResetLastError();
27062         if (mem_base != xmlMemBlocks()) {
27063             printf("Leak of %d blocks found in xmlValidateAttributeValue",
27064                    xmlMemBlocks() - mem_base);
27065             test_ret++;
27066             printf(" %d", n_type);
27067             printf(" %d", n_value);
27068             printf("\n");
27069         }
27070     }
27071     }
27072     function_tests++;
27073 #endif
27074
27075     return(test_ret);
27076 }
27077
27078
27079 static int
27080 test_xmlValidateDocument(void) {
27081     int test_ret = 0;
27082
27083 #if defined(LIBXML_VALID_ENABLED)
27084     int mem_base;
27085     int ret_val;
27086     xmlValidCtxtPtr ctxt; /* the validation context */
27087     int n_ctxt;
27088     xmlDocPtr doc; /* a document instance */
27089     int n_doc;
27090
27091     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27092     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27093         mem_base = xmlMemBlocks();
27094         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27095         doc = gen_xmlDocPtr(n_doc, 1);
27096
27097         ret_val = xmlValidateDocument(ctxt, doc);
27098         desret_int(ret_val);
27099         call_tests++;
27100         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27101         des_xmlDocPtr(n_doc, doc, 1);
27102         xmlResetLastError();
27103         if (mem_base != xmlMemBlocks()) {
27104             printf("Leak of %d blocks found in xmlValidateDocument",
27105                    xmlMemBlocks() - mem_base);
27106             test_ret++;
27107             printf(" %d", n_ctxt);
27108             printf(" %d", n_doc);
27109             printf("\n");
27110         }
27111     }
27112     }
27113     function_tests++;
27114 #endif
27115
27116     return(test_ret);
27117 }
27118
27119
27120 static int
27121 test_xmlValidateDocumentFinal(void) {
27122     int test_ret = 0;
27123
27124 #if defined(LIBXML_VALID_ENABLED)
27125     int mem_base;
27126     int ret_val;
27127     xmlValidCtxtPtr ctxt; /* the validation context */
27128     int n_ctxt;
27129     xmlDocPtr doc; /* a document instance */
27130     int n_doc;
27131
27132     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27133     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27134         mem_base = xmlMemBlocks();
27135         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27136         doc = gen_xmlDocPtr(n_doc, 1);
27137
27138         ret_val = xmlValidateDocumentFinal(ctxt, doc);
27139         desret_int(ret_val);
27140         call_tests++;
27141         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27142         des_xmlDocPtr(n_doc, doc, 1);
27143         xmlResetLastError();
27144         if (mem_base != xmlMemBlocks()) {
27145             printf("Leak of %d blocks found in xmlValidateDocumentFinal",
27146                    xmlMemBlocks() - mem_base);
27147             test_ret++;
27148             printf(" %d", n_ctxt);
27149             printf(" %d", n_doc);
27150             printf("\n");
27151         }
27152     }
27153     }
27154     function_tests++;
27155 #endif
27156
27157     return(test_ret);
27158 }
27159
27160
27161 static int
27162 test_xmlValidateDtd(void) {
27163     int test_ret = 0;
27164
27165 #if defined(LIBXML_VALID_ENABLED)
27166     int mem_base;
27167     int ret_val;
27168     xmlValidCtxtPtr ctxt; /* the validation context */
27169     int n_ctxt;
27170     xmlDocPtr doc; /* a document instance */
27171     int n_doc;
27172     xmlDtdPtr dtd; /* a dtd instance */
27173     int n_dtd;
27174
27175     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27176     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27177     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
27178         mem_base = xmlMemBlocks();
27179         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27180         doc = gen_xmlDocPtr(n_doc, 1);
27181         dtd = gen_xmlDtdPtr(n_dtd, 2);
27182
27183         ret_val = xmlValidateDtd(ctxt, doc, dtd);
27184         desret_int(ret_val);
27185         call_tests++;
27186         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27187         des_xmlDocPtr(n_doc, doc, 1);
27188         des_xmlDtdPtr(n_dtd, dtd, 2);
27189         xmlResetLastError();
27190         if (mem_base != xmlMemBlocks()) {
27191             printf("Leak of %d blocks found in xmlValidateDtd",
27192                    xmlMemBlocks() - mem_base);
27193             test_ret++;
27194             printf(" %d", n_ctxt);
27195             printf(" %d", n_doc);
27196             printf(" %d", n_dtd);
27197             printf("\n");
27198         }
27199     }
27200     }
27201     }
27202     function_tests++;
27203 #endif
27204
27205     return(test_ret);
27206 }
27207
27208
27209 static int
27210 test_xmlValidateDtdFinal(void) {
27211     int test_ret = 0;
27212
27213 #if defined(LIBXML_VALID_ENABLED)
27214     int mem_base;
27215     int ret_val;
27216     xmlValidCtxtPtr ctxt; /* the validation context */
27217     int n_ctxt;
27218     xmlDocPtr doc; /* a document instance */
27219     int n_doc;
27220
27221     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27222     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27223         mem_base = xmlMemBlocks();
27224         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27225         doc = gen_xmlDocPtr(n_doc, 1);
27226
27227         ret_val = xmlValidateDtdFinal(ctxt, doc);
27228         desret_int(ret_val);
27229         call_tests++;
27230         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27231         des_xmlDocPtr(n_doc, doc, 1);
27232         xmlResetLastError();
27233         if (mem_base != xmlMemBlocks()) {
27234             printf("Leak of %d blocks found in xmlValidateDtdFinal",
27235                    xmlMemBlocks() - mem_base);
27236             test_ret++;
27237             printf(" %d", n_ctxt);
27238             printf(" %d", n_doc);
27239             printf("\n");
27240         }
27241     }
27242     }
27243     function_tests++;
27244 #endif
27245
27246     return(test_ret);
27247 }
27248
27249
27250 static int
27251 test_xmlValidateElement(void) {
27252     int test_ret = 0;
27253
27254 #if defined(LIBXML_VALID_ENABLED)
27255     int mem_base;
27256     int ret_val;
27257     xmlValidCtxtPtr ctxt; /* the validation context */
27258     int n_ctxt;
27259     xmlDocPtr doc; /* a document instance */
27260     int n_doc;
27261     xmlNodePtr elem; /* an element instance */
27262     int n_elem;
27263
27264     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27265     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27266     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27267         mem_base = xmlMemBlocks();
27268         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27269         doc = gen_xmlDocPtr(n_doc, 1);
27270         elem = gen_xmlNodePtr(n_elem, 2);
27271
27272         ret_val = xmlValidateElement(ctxt, doc, elem);
27273         desret_int(ret_val);
27274         call_tests++;
27275         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27276         des_xmlDocPtr(n_doc, doc, 1);
27277         des_xmlNodePtr(n_elem, elem, 2);
27278         xmlResetLastError();
27279         if (mem_base != xmlMemBlocks()) {
27280             printf("Leak of %d blocks found in xmlValidateElement",
27281                    xmlMemBlocks() - mem_base);
27282             test_ret++;
27283             printf(" %d", n_ctxt);
27284             printf(" %d", n_doc);
27285             printf(" %d", n_elem);
27286             printf("\n");
27287         }
27288     }
27289     }
27290     }
27291     function_tests++;
27292 #endif
27293
27294     return(test_ret);
27295 }
27296
27297
27298 static int
27299 test_xmlValidateElementDecl(void) {
27300     int test_ret = 0;
27301
27302 #if defined(LIBXML_VALID_ENABLED)
27303     int mem_base;
27304     int ret_val;
27305     xmlValidCtxtPtr ctxt; /* the validation context */
27306     int n_ctxt;
27307     xmlDocPtr doc; /* a document instance */
27308     int n_doc;
27309     xmlElementPtr elem; /* an element definition */
27310     int n_elem;
27311
27312     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27313     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27314     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
27315         mem_base = xmlMemBlocks();
27316         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27317         doc = gen_xmlDocPtr(n_doc, 1);
27318         elem = gen_xmlElementPtr(n_elem, 2);
27319
27320         ret_val = xmlValidateElementDecl(ctxt, doc, elem);
27321         desret_int(ret_val);
27322         call_tests++;
27323         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27324         des_xmlDocPtr(n_doc, doc, 1);
27325         des_xmlElementPtr(n_elem, elem, 2);
27326         xmlResetLastError();
27327         if (mem_base != xmlMemBlocks()) {
27328             printf("Leak of %d blocks found in xmlValidateElementDecl",
27329                    xmlMemBlocks() - mem_base);
27330             test_ret++;
27331             printf(" %d", n_ctxt);
27332             printf(" %d", n_doc);
27333             printf(" %d", n_elem);
27334             printf("\n");
27335         }
27336     }
27337     }
27338     }
27339     function_tests++;
27340 #endif
27341
27342     return(test_ret);
27343 }
27344
27345
27346 static int
27347 test_xmlValidateNameValue(void) {
27348     int test_ret = 0;
27349
27350 #if defined(LIBXML_VALID_ENABLED)
27351     int mem_base;
27352     int ret_val;
27353     xmlChar * value; /* an Name value */
27354     int n_value;
27355
27356     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27357         mem_base = xmlMemBlocks();
27358         value = gen_const_xmlChar_ptr(n_value, 0);
27359
27360         ret_val = xmlValidateNameValue((const xmlChar *)value);
27361         desret_int(ret_val);
27362         call_tests++;
27363         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
27364         xmlResetLastError();
27365         if (mem_base != xmlMemBlocks()) {
27366             printf("Leak of %d blocks found in xmlValidateNameValue",
27367                    xmlMemBlocks() - mem_base);
27368             test_ret++;
27369             printf(" %d", n_value);
27370             printf("\n");
27371         }
27372     }
27373     function_tests++;
27374 #endif
27375
27376     return(test_ret);
27377 }
27378
27379
27380 static int
27381 test_xmlValidateNamesValue(void) {
27382     int test_ret = 0;
27383
27384 #if defined(LIBXML_VALID_ENABLED)
27385     int mem_base;
27386     int ret_val;
27387     xmlChar * value; /* an Names value */
27388     int n_value;
27389
27390     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27391         mem_base = xmlMemBlocks();
27392         value = gen_const_xmlChar_ptr(n_value, 0);
27393
27394         ret_val = xmlValidateNamesValue((const xmlChar *)value);
27395         desret_int(ret_val);
27396         call_tests++;
27397         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
27398         xmlResetLastError();
27399         if (mem_base != xmlMemBlocks()) {
27400             printf("Leak of %d blocks found in xmlValidateNamesValue",
27401                    xmlMemBlocks() - mem_base);
27402             test_ret++;
27403             printf(" %d", n_value);
27404             printf("\n");
27405         }
27406     }
27407     function_tests++;
27408 #endif
27409
27410     return(test_ret);
27411 }
27412
27413
27414 static int
27415 test_xmlValidateNmtokenValue(void) {
27416     int test_ret = 0;
27417
27418 #if defined(LIBXML_VALID_ENABLED)
27419     int mem_base;
27420     int ret_val;
27421     xmlChar * value; /* an Nmtoken value */
27422     int n_value;
27423
27424     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27425         mem_base = xmlMemBlocks();
27426         value = gen_const_xmlChar_ptr(n_value, 0);
27427
27428         ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
27429         desret_int(ret_val);
27430         call_tests++;
27431         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
27432         xmlResetLastError();
27433         if (mem_base != xmlMemBlocks()) {
27434             printf("Leak of %d blocks found in xmlValidateNmtokenValue",
27435                    xmlMemBlocks() - mem_base);
27436             test_ret++;
27437             printf(" %d", n_value);
27438             printf("\n");
27439         }
27440     }
27441     function_tests++;
27442 #endif
27443
27444     return(test_ret);
27445 }
27446
27447
27448 static int
27449 test_xmlValidateNmtokensValue(void) {
27450     int test_ret = 0;
27451
27452 #if defined(LIBXML_VALID_ENABLED)
27453     int mem_base;
27454     int ret_val;
27455     xmlChar * value; /* an Nmtokens value */
27456     int n_value;
27457
27458     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27459         mem_base = xmlMemBlocks();
27460         value = gen_const_xmlChar_ptr(n_value, 0);
27461
27462         ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
27463         desret_int(ret_val);
27464         call_tests++;
27465         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
27466         xmlResetLastError();
27467         if (mem_base != xmlMemBlocks()) {
27468             printf("Leak of %d blocks found in xmlValidateNmtokensValue",
27469                    xmlMemBlocks() - mem_base);
27470             test_ret++;
27471             printf(" %d", n_value);
27472             printf("\n");
27473         }
27474     }
27475     function_tests++;
27476 #endif
27477
27478     return(test_ret);
27479 }
27480
27481
27482 static int
27483 test_xmlValidateNotationDecl(void) {
27484     int test_ret = 0;
27485
27486 #if defined(LIBXML_VALID_ENABLED)
27487     int mem_base;
27488     int ret_val;
27489     xmlValidCtxtPtr ctxt; /* the validation context */
27490     int n_ctxt;
27491     xmlDocPtr doc; /* a document instance */
27492     int n_doc;
27493     xmlNotationPtr nota; /* a notation definition */
27494     int n_nota;
27495
27496     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27497     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27498     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
27499         mem_base = xmlMemBlocks();
27500         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27501         doc = gen_xmlDocPtr(n_doc, 1);
27502         nota = gen_xmlNotationPtr(n_nota, 2);
27503
27504         ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
27505         desret_int(ret_val);
27506         call_tests++;
27507         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27508         des_xmlDocPtr(n_doc, doc, 1);
27509         des_xmlNotationPtr(n_nota, nota, 2);
27510         xmlResetLastError();
27511         if (mem_base != xmlMemBlocks()) {
27512             printf("Leak of %d blocks found in xmlValidateNotationDecl",
27513                    xmlMemBlocks() - mem_base);
27514             test_ret++;
27515             printf(" %d", n_ctxt);
27516             printf(" %d", n_doc);
27517             printf(" %d", n_nota);
27518             printf("\n");
27519         }
27520     }
27521     }
27522     }
27523     function_tests++;
27524 #endif
27525
27526     return(test_ret);
27527 }
27528
27529
27530 static int
27531 test_xmlValidateNotationUse(void) {
27532     int test_ret = 0;
27533
27534 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
27535     int mem_base;
27536     int ret_val;
27537     xmlValidCtxtPtr ctxt; /* the validation context */
27538     int n_ctxt;
27539     xmlDocPtr doc; /* the document */
27540     int n_doc;
27541     xmlChar * notationName; /* the notation name to check */
27542     int n_notationName;
27543
27544     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27545     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27546     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
27547         mem_base = xmlMemBlocks();
27548         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27549         doc = gen_xmlDocPtr(n_doc, 1);
27550         notationName = gen_const_xmlChar_ptr(n_notationName, 2);
27551
27552         ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
27553         desret_int(ret_val);
27554         call_tests++;
27555         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27556         des_xmlDocPtr(n_doc, doc, 1);
27557         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
27558         xmlResetLastError();
27559         if (mem_base != xmlMemBlocks()) {
27560             printf("Leak of %d blocks found in xmlValidateNotationUse",
27561                    xmlMemBlocks() - mem_base);
27562             test_ret++;
27563             printf(" %d", n_ctxt);
27564             printf(" %d", n_doc);
27565             printf(" %d", n_notationName);
27566             printf("\n");
27567         }
27568     }
27569     }
27570     }
27571     function_tests++;
27572 #endif
27573
27574     return(test_ret);
27575 }
27576
27577
27578 static int
27579 test_xmlValidateOneAttribute(void) {
27580     int test_ret = 0;
27581
27582 #if defined(LIBXML_VALID_ENABLED)
27583     int mem_base;
27584     int ret_val;
27585     xmlValidCtxtPtr ctxt; /* the validation context */
27586     int n_ctxt;
27587     xmlDocPtr doc; /* a document instance */
27588     int n_doc;
27589     xmlNodePtr elem; /* an element instance */
27590     int n_elem;
27591     xmlAttrPtr attr; /* an attribute instance */
27592     int n_attr;
27593     xmlChar * value; /* the attribute value (without entities processing) */
27594     int n_value;
27595
27596     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27597     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27598     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27599     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
27600     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27601         mem_base = xmlMemBlocks();
27602         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27603         doc = gen_xmlDocPtr(n_doc, 1);
27604         elem = gen_xmlNodePtr(n_elem, 2);
27605         attr = gen_xmlAttrPtr(n_attr, 3);
27606         value = gen_const_xmlChar_ptr(n_value, 4);
27607
27608         ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
27609         desret_int(ret_val);
27610         call_tests++;
27611         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27612         des_xmlDocPtr(n_doc, doc, 1);
27613         des_xmlNodePtr(n_elem, elem, 2);
27614         des_xmlAttrPtr(n_attr, attr, 3);
27615         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
27616         xmlResetLastError();
27617         if (mem_base != xmlMemBlocks()) {
27618             printf("Leak of %d blocks found in xmlValidateOneAttribute",
27619                    xmlMemBlocks() - mem_base);
27620             test_ret++;
27621             printf(" %d", n_ctxt);
27622             printf(" %d", n_doc);
27623             printf(" %d", n_elem);
27624             printf(" %d", n_attr);
27625             printf(" %d", n_value);
27626             printf("\n");
27627         }
27628     }
27629     }
27630     }
27631     }
27632     }
27633     function_tests++;
27634 #endif
27635
27636     return(test_ret);
27637 }
27638
27639
27640 static int
27641 test_xmlValidateOneElement(void) {
27642     int test_ret = 0;
27643
27644 #if defined(LIBXML_VALID_ENABLED)
27645     int mem_base;
27646     int ret_val;
27647     xmlValidCtxtPtr ctxt; /* the validation context */
27648     int n_ctxt;
27649     xmlDocPtr doc; /* a document instance */
27650     int n_doc;
27651     xmlNodePtr elem; /* an element instance */
27652     int n_elem;
27653
27654     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27655     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27656     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27657         mem_base = xmlMemBlocks();
27658         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27659         doc = gen_xmlDocPtr(n_doc, 1);
27660         elem = gen_xmlNodePtr(n_elem, 2);
27661
27662         ret_val = xmlValidateOneElement(ctxt, doc, elem);
27663         desret_int(ret_val);
27664         call_tests++;
27665         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27666         des_xmlDocPtr(n_doc, doc, 1);
27667         des_xmlNodePtr(n_elem, elem, 2);
27668         xmlResetLastError();
27669         if (mem_base != xmlMemBlocks()) {
27670             printf("Leak of %d blocks found in xmlValidateOneElement",
27671                    xmlMemBlocks() - mem_base);
27672             test_ret++;
27673             printf(" %d", n_ctxt);
27674             printf(" %d", n_doc);
27675             printf(" %d", n_elem);
27676             printf("\n");
27677         }
27678     }
27679     }
27680     }
27681     function_tests++;
27682 #endif
27683
27684     return(test_ret);
27685 }
27686
27687
27688 static int
27689 test_xmlValidateOneNamespace(void) {
27690     int test_ret = 0;
27691
27692 #if defined(LIBXML_VALID_ENABLED)
27693     int mem_base;
27694     int ret_val;
27695     xmlValidCtxtPtr ctxt; /* the validation context */
27696     int n_ctxt;
27697     xmlDocPtr doc; /* a document instance */
27698     int n_doc;
27699     xmlNodePtr elem; /* an element instance */
27700     int n_elem;
27701     xmlChar * prefix; /* the namespace prefix */
27702     int n_prefix;
27703     xmlNsPtr ns; /* an namespace declaration instance */
27704     int n_ns;
27705     xmlChar * value; /* the attribute value (without entities processing) */
27706     int n_value;
27707
27708     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27709     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27710     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27711     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
27712     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
27713     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
27714         mem_base = xmlMemBlocks();
27715         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27716         doc = gen_xmlDocPtr(n_doc, 1);
27717         elem = gen_xmlNodePtr(n_elem, 2);
27718         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
27719         ns = gen_xmlNsPtr(n_ns, 4);
27720         value = gen_const_xmlChar_ptr(n_value, 5);
27721
27722         ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
27723         desret_int(ret_val);
27724         call_tests++;
27725         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27726         des_xmlDocPtr(n_doc, doc, 1);
27727         des_xmlNodePtr(n_elem, elem, 2);
27728         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
27729         des_xmlNsPtr(n_ns, ns, 4);
27730         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
27731         xmlResetLastError();
27732         if (mem_base != xmlMemBlocks()) {
27733             printf("Leak of %d blocks found in xmlValidateOneNamespace",
27734                    xmlMemBlocks() - mem_base);
27735             test_ret++;
27736             printf(" %d", n_ctxt);
27737             printf(" %d", n_doc);
27738             printf(" %d", n_elem);
27739             printf(" %d", n_prefix);
27740             printf(" %d", n_ns);
27741             printf(" %d", n_value);
27742             printf("\n");
27743         }
27744     }
27745     }
27746     }
27747     }
27748     }
27749     }
27750     function_tests++;
27751 #endif
27752
27753     return(test_ret);
27754 }
27755
27756
27757 static int
27758 test_xmlValidatePopElement(void) {
27759     int test_ret = 0;
27760
27761 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27762     int mem_base;
27763     int ret_val;
27764     xmlValidCtxtPtr ctxt; /* the validation context */
27765     int n_ctxt;
27766     xmlDocPtr doc; /* a document instance */
27767     int n_doc;
27768     xmlNodePtr elem; /* an element instance */
27769     int n_elem;
27770     xmlChar * qname; /* the qualified name as appearing in the serialization */
27771     int n_qname;
27772
27773     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27774     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27775     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27776     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27777         mem_base = xmlMemBlocks();
27778         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27779         doc = gen_xmlDocPtr(n_doc, 1);
27780         elem = gen_xmlNodePtr(n_elem, 2);
27781         qname = gen_const_xmlChar_ptr(n_qname, 3);
27782
27783         ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
27784         desret_int(ret_val);
27785         call_tests++;
27786         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27787         des_xmlDocPtr(n_doc, doc, 1);
27788         des_xmlNodePtr(n_elem, elem, 2);
27789         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27790         xmlResetLastError();
27791         if (mem_base != xmlMemBlocks()) {
27792             printf("Leak of %d blocks found in xmlValidatePopElement",
27793                    xmlMemBlocks() - mem_base);
27794             test_ret++;
27795             printf(" %d", n_ctxt);
27796             printf(" %d", n_doc);
27797             printf(" %d", n_elem);
27798             printf(" %d", n_qname);
27799             printf("\n");
27800         }
27801     }
27802     }
27803     }
27804     }
27805     function_tests++;
27806 #endif
27807
27808     return(test_ret);
27809 }
27810
27811
27812 static int
27813 test_xmlValidatePushCData(void) {
27814     int test_ret = 0;
27815
27816 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27817     int mem_base;
27818     int ret_val;
27819     xmlValidCtxtPtr ctxt; /* the validation context */
27820     int n_ctxt;
27821     xmlChar * data; /* some character data read */
27822     int n_data;
27823     int len; /* the length of the data */
27824     int n_len;
27825
27826     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27827     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
27828     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27829         mem_base = xmlMemBlocks();
27830         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27831         data = gen_const_xmlChar_ptr(n_data, 1);
27832         len = gen_int(n_len, 2);
27833         if ((data != NULL) &&
27834             (len > (int) strlen((const char *) data) + 1))
27835             continue;
27836
27837         ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
27838         desret_int(ret_val);
27839         call_tests++;
27840         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27841         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
27842         des_int(n_len, len, 2);
27843         xmlResetLastError();
27844         if (mem_base != xmlMemBlocks()) {
27845             printf("Leak of %d blocks found in xmlValidatePushCData",
27846                    xmlMemBlocks() - mem_base);
27847             test_ret++;
27848             printf(" %d", n_ctxt);
27849             printf(" %d", n_data);
27850             printf(" %d", n_len);
27851             printf("\n");
27852         }
27853     }
27854     }
27855     }
27856     function_tests++;
27857 #endif
27858
27859     return(test_ret);
27860 }
27861
27862
27863 static int
27864 test_xmlValidatePushElement(void) {
27865     int test_ret = 0;
27866
27867 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
27868     int mem_base;
27869     int ret_val;
27870     xmlValidCtxtPtr ctxt; /* the validation context */
27871     int n_ctxt;
27872     xmlDocPtr doc; /* a document instance */
27873     int n_doc;
27874     xmlNodePtr elem; /* an element instance */
27875     int n_elem;
27876     xmlChar * qname; /* the qualified name as appearing in the serialization */
27877     int n_qname;
27878
27879     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27880     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27881     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
27882     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
27883         mem_base = xmlMemBlocks();
27884         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27885         doc = gen_xmlDocPtr(n_doc, 1);
27886         elem = gen_xmlNodePtr(n_elem, 2);
27887         qname = gen_const_xmlChar_ptr(n_qname, 3);
27888
27889         ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
27890         desret_int(ret_val);
27891         call_tests++;
27892         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27893         des_xmlDocPtr(n_doc, doc, 1);
27894         des_xmlNodePtr(n_elem, elem, 2);
27895         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
27896         xmlResetLastError();
27897         if (mem_base != xmlMemBlocks()) {
27898             printf("Leak of %d blocks found in xmlValidatePushElement",
27899                    xmlMemBlocks() - mem_base);
27900             test_ret++;
27901             printf(" %d", n_ctxt);
27902             printf(" %d", n_doc);
27903             printf(" %d", n_elem);
27904             printf(" %d", n_qname);
27905             printf("\n");
27906         }
27907     }
27908     }
27909     }
27910     }
27911     function_tests++;
27912 #endif
27913
27914     return(test_ret);
27915 }
27916
27917
27918 static int
27919 test_xmlValidateRoot(void) {
27920     int test_ret = 0;
27921
27922 #if defined(LIBXML_VALID_ENABLED)
27923     int mem_base;
27924     int ret_val;
27925     xmlValidCtxtPtr ctxt; /* the validation context */
27926     int n_ctxt;
27927     xmlDocPtr doc; /* a document instance */
27928     int n_doc;
27929
27930     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27931     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27932         mem_base = xmlMemBlocks();
27933         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27934         doc = gen_xmlDocPtr(n_doc, 1);
27935
27936         ret_val = xmlValidateRoot(ctxt, doc);
27937         desret_int(ret_val);
27938         call_tests++;
27939         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27940         des_xmlDocPtr(n_doc, doc, 1);
27941         xmlResetLastError();
27942         if (mem_base != xmlMemBlocks()) {
27943             printf("Leak of %d blocks found in xmlValidateRoot",
27944                    xmlMemBlocks() - mem_base);
27945             test_ret++;
27946             printf(" %d", n_ctxt);
27947             printf(" %d", n_doc);
27948             printf("\n");
27949         }
27950     }
27951     }
27952     function_tests++;
27953 #endif
27954
27955     return(test_ret);
27956 }
27957
27958 static int
27959 test_valid(void) {
27960     int test_ret = 0;
27961         int rc = 0;
27962
27963     if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27964     rc = test_xmlAddAttributeDecl();
27965         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27966     rc = test_xmlAddElementDecl();
27967         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27968     rc = test_xmlAddID();
27969         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27970     rc = test_xmlAddNotationDecl();
27971         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27972     rc = test_xmlAddRef();
27973         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27974     rc = test_xmlCopyAttributeTable();
27975         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27976     rc = test_xmlCopyDocElementContent();
27977         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27978     rc = test_xmlCopyElementContent();
27979         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27980     rc = test_xmlCopyElementTable();
27981         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27982     rc = test_xmlCopyEnumeration();
27983         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27984     rc = test_xmlCopyNotationTable();
27985         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27986     rc = test_xmlCreateEnumeration();
27987         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27988     rc = test_xmlDumpAttributeDecl();
27989         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27990     rc = test_xmlDumpAttributeTable();
27991         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27992     rc = test_xmlDumpElementDecl();
27993         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27994     rc = test_xmlDumpElementTable();
27995         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27996     rc = test_xmlDumpNotationDecl();
27997         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
27998     rc = test_xmlDumpNotationTable();
27999         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28000     rc = test_xmlGetDtdAttrDesc();
28001         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28002     rc = test_xmlGetDtdElementDesc();
28003         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28004     rc = test_xmlGetDtdNotationDesc();
28005         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28006     rc = test_xmlGetDtdQAttrDesc();
28007         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28008     rc = test_xmlGetDtdQElementDesc();
28009         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28010     rc = test_xmlGetID();
28011         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28012     rc = test_xmlGetRefs();
28013         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28014     rc = test_xmlIsID();
28015         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28016     rc = test_xmlIsMixedElement();
28017         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28018     rc = test_xmlIsRef();
28019         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28020     rc = test_xmlNewDocElementContent();
28021         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28022     rc = test_xmlNewElementContent();
28023         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28024     rc = test_xmlNewValidCtxt();
28025         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28026     rc = test_xmlRemoveID();
28027         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28028     rc = test_xmlRemoveRef();
28029         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28030     rc = test_xmlSnprintfElementContent();
28031         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28032     rc = test_xmlSprintfElementContent();
28033         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28034     rc = test_xmlValidBuildContentModel();
28035         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28036     rc = test_xmlValidCtxtNormalizeAttributeValue();
28037         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28038     rc = test_xmlValidGetPotentialChildren();
28039         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28040     rc = test_xmlValidGetValidElements();
28041         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28042     rc = test_xmlValidNormalizeAttributeValue();
28043         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28044     rc = test_xmlValidateAttributeDecl();
28045         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28046     rc = test_xmlValidateAttributeValue();
28047         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28048     rc = test_xmlValidateDocument();
28049         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28050     rc = test_xmlValidateDocumentFinal();
28051         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28052     rc = test_xmlValidateDtd();
28053         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28054     rc = test_xmlValidateDtdFinal();
28055         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28056     rc = test_xmlValidateElement();
28057         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28058     rc = test_xmlValidateElementDecl();
28059         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28060     rc = test_xmlValidateNameValue();
28061         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28062     rc = test_xmlValidateNamesValue();
28063         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28064     rc = test_xmlValidateNmtokenValue();
28065         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28066     rc = test_xmlValidateNmtokensValue();
28067         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28068     rc = test_xmlValidateNotationDecl();
28069         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28070     rc = test_xmlValidateNotationUse();
28071         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28072     rc = test_xmlValidateOneAttribute();
28073         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28074     rc = test_xmlValidateOneElement();
28075         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28076     rc = test_xmlValidateOneNamespace();
28077         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28078     rc = test_xmlValidatePopElement();
28079         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28080     rc = test_xmlValidatePushCData();
28081         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28082     rc = test_xmlValidatePushElement();
28083         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28084     rc = test_xmlValidateRoot();
28085         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28086
28087     if (test_ret != 0)
28088         printf("Module valid: %d errors\n", test_ret);
28089     return(test_ret);
28090 }
28091
28092 static int
28093 test_xmlXIncludeNewContext(void) {
28094     int test_ret = 0;
28095
28096
28097     /* missing type support */
28098     return(test_ret);
28099 }
28100
28101
28102 static int
28103 test_xmlXIncludeProcess(void) {
28104     int test_ret = 0;
28105
28106 #if defined(LIBXML_XINCLUDE_ENABLED)
28107     int mem_base;
28108     int ret_val;
28109     xmlDocPtr doc; /* an XML document */
28110     int n_doc;
28111
28112     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28113         mem_base = xmlMemBlocks();
28114         doc = gen_xmlDocPtr(n_doc, 0);
28115
28116         ret_val = xmlXIncludeProcess(doc);
28117         desret_int(ret_val);
28118         call_tests++;
28119         des_xmlDocPtr(n_doc, doc, 0);
28120         xmlResetLastError();
28121         if (mem_base != xmlMemBlocks()) {
28122             printf("Leak of %d blocks found in xmlXIncludeProcess",
28123                    xmlMemBlocks() - mem_base);
28124             test_ret++;
28125             printf(" %d", n_doc);
28126             printf("\n");
28127         }
28128     }
28129     function_tests++;
28130 #endif
28131
28132     return(test_ret);
28133 }
28134
28135
28136 static int
28137 test_xmlXIncludeProcessFlags(void) {
28138     int test_ret = 0;
28139
28140 #if defined(LIBXML_XINCLUDE_ENABLED)
28141     int mem_base;
28142     int ret_val;
28143     xmlDocPtr doc; /* an XML document */
28144     int n_doc;
28145     int flags; /* a set of xmlParserOption used for parsing XML includes */
28146     int n_flags;
28147
28148     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28149     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28150         mem_base = xmlMemBlocks();
28151         doc = gen_xmlDocPtr(n_doc, 0);
28152         flags = gen_int(n_flags, 1);
28153
28154         ret_val = xmlXIncludeProcessFlags(doc, flags);
28155         desret_int(ret_val);
28156         call_tests++;
28157         des_xmlDocPtr(n_doc, doc, 0);
28158         des_int(n_flags, flags, 1);
28159         xmlResetLastError();
28160         if (mem_base != xmlMemBlocks()) {
28161             printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
28162                    xmlMemBlocks() - mem_base);
28163             test_ret++;
28164             printf(" %d", n_doc);
28165             printf(" %d", n_flags);
28166             printf("\n");
28167         }
28168     }
28169     }
28170     function_tests++;
28171 #endif
28172
28173     return(test_ret);
28174 }
28175
28176
28177 static int
28178 test_xmlXIncludeProcessFlagsData(void) {
28179     int test_ret = 0;
28180
28181 #if defined(LIBXML_XINCLUDE_ENABLED)
28182     int mem_base;
28183     int ret_val;
28184     xmlDocPtr doc; /* an XML document */
28185     int n_doc;
28186     int flags; /* a set of xmlParserOption used for parsing XML includes */
28187     int n_flags;
28188     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
28189     int n_data;
28190
28191     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28192     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28193     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
28194         mem_base = xmlMemBlocks();
28195         doc = gen_xmlDocPtr(n_doc, 0);
28196         flags = gen_int(n_flags, 1);
28197         data = gen_userdata(n_data, 2);
28198
28199         ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
28200         desret_int(ret_val);
28201         call_tests++;
28202         des_xmlDocPtr(n_doc, doc, 0);
28203         des_int(n_flags, flags, 1);
28204         des_userdata(n_data, data, 2);
28205         xmlResetLastError();
28206         if (mem_base != xmlMemBlocks()) {
28207             printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
28208                    xmlMemBlocks() - mem_base);
28209             test_ret++;
28210             printf(" %d", n_doc);
28211             printf(" %d", n_flags);
28212             printf(" %d", n_data);
28213             printf("\n");
28214         }
28215     }
28216     }
28217     }
28218     function_tests++;
28219 #endif
28220
28221     return(test_ret);
28222 }
28223
28224 #ifdef LIBXML_XINCLUDE_ENABLED
28225
28226 #define gen_nb_xmlXIncludeCtxtPtr 1
28227 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28228     return(NULL);
28229 }
28230 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28231 }
28232 #endif
28233
28234
28235 static int
28236 test_xmlXIncludeProcessNode(void) {
28237     int test_ret = 0;
28238
28239 #if defined(LIBXML_XINCLUDE_ENABLED)
28240     int mem_base;
28241     int ret_val;
28242     xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
28243     int n_ctxt;
28244     xmlNodePtr node; /* a node in an XML document */
28245     int n_node;
28246
28247     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
28248     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
28249         mem_base = xmlMemBlocks();
28250         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
28251         node = gen_xmlNodePtr(n_node, 1);
28252
28253         ret_val = xmlXIncludeProcessNode(ctxt, node);
28254         desret_int(ret_val);
28255         call_tests++;
28256         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
28257         des_xmlNodePtr(n_node, node, 1);
28258         xmlResetLastError();
28259         if (mem_base != xmlMemBlocks()) {
28260             printf("Leak of %d blocks found in xmlXIncludeProcessNode",
28261                    xmlMemBlocks() - mem_base);
28262             test_ret++;
28263             printf(" %d", n_ctxt);
28264             printf(" %d", n_node);
28265             printf("\n");
28266         }
28267     }
28268     }
28269     function_tests++;
28270 #endif
28271
28272     return(test_ret);
28273 }
28274
28275
28276 static int
28277 test_xmlXIncludeProcessTree(void) {
28278     int test_ret = 0;
28279
28280 #if defined(LIBXML_XINCLUDE_ENABLED)
28281     int mem_base;
28282     int ret_val;
28283     xmlNodePtr tree; /* a node in an XML document */
28284     int n_tree;
28285
28286     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
28287         mem_base = xmlMemBlocks();
28288         tree = gen_xmlNodePtr(n_tree, 0);
28289
28290         ret_val = xmlXIncludeProcessTree(tree);
28291         desret_int(ret_val);
28292         call_tests++;
28293         des_xmlNodePtr(n_tree, tree, 0);
28294         xmlResetLastError();
28295         if (mem_base != xmlMemBlocks()) {
28296             printf("Leak of %d blocks found in xmlXIncludeProcessTree",
28297                    xmlMemBlocks() - mem_base);
28298             test_ret++;
28299             printf(" %d", n_tree);
28300             printf("\n");
28301         }
28302     }
28303     function_tests++;
28304 #endif
28305
28306     return(test_ret);
28307 }
28308
28309
28310 static int
28311 test_xmlXIncludeProcessTreeFlags(void) {
28312     int test_ret = 0;
28313
28314 #if defined(LIBXML_XINCLUDE_ENABLED)
28315     int mem_base;
28316     int ret_val;
28317     xmlNodePtr tree; /* a node in an XML document */
28318     int n_tree;
28319     int flags; /* a set of xmlParserOption used for parsing XML includes */
28320     int n_flags;
28321
28322     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
28323     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28324         mem_base = xmlMemBlocks();
28325         tree = gen_xmlNodePtr(n_tree, 0);
28326         flags = gen_int(n_flags, 1);
28327
28328         ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
28329         desret_int(ret_val);
28330         call_tests++;
28331         des_xmlNodePtr(n_tree, tree, 0);
28332         des_int(n_flags, flags, 1);
28333         xmlResetLastError();
28334         if (mem_base != xmlMemBlocks()) {
28335             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
28336                    xmlMemBlocks() - mem_base);
28337             test_ret++;
28338             printf(" %d", n_tree);
28339             printf(" %d", n_flags);
28340             printf("\n");
28341         }
28342     }
28343     }
28344     function_tests++;
28345 #endif
28346
28347     return(test_ret);
28348 }
28349
28350
28351 static int
28352 test_xmlXIncludeProcessTreeFlagsData(void) {
28353     int test_ret = 0;
28354
28355 #if defined(LIBXML_XINCLUDE_ENABLED)
28356     int mem_base;
28357     int ret_val;
28358     xmlNodePtr tree; /* an XML node */
28359     int n_tree;
28360     int flags; /* a set of xmlParserOption used for parsing XML includes */
28361     int n_flags;
28362     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
28363     int n_data;
28364
28365     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
28366     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28367     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
28368         mem_base = xmlMemBlocks();
28369         tree = gen_xmlNodePtr(n_tree, 0);
28370         flags = gen_int(n_flags, 1);
28371         data = gen_userdata(n_data, 2);
28372
28373         ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
28374         desret_int(ret_val);
28375         call_tests++;
28376         des_xmlNodePtr(n_tree, tree, 0);
28377         des_int(n_flags, flags, 1);
28378         des_userdata(n_data, data, 2);
28379         xmlResetLastError();
28380         if (mem_base != xmlMemBlocks()) {
28381             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
28382                    xmlMemBlocks() - mem_base);
28383             test_ret++;
28384             printf(" %d", n_tree);
28385             printf(" %d", n_flags);
28386             printf(" %d", n_data);
28387             printf("\n");
28388         }
28389     }
28390     }
28391     }
28392     function_tests++;
28393 #endif
28394
28395     return(test_ret);
28396 }
28397
28398
28399 static int
28400 test_xmlXIncludeSetFlags(void) {
28401     int test_ret = 0;
28402
28403 #if defined(LIBXML_XINCLUDE_ENABLED)
28404     int mem_base;
28405     int ret_val;
28406     xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
28407     int n_ctxt;
28408     int flags; /* a set of xmlParserOption used for parsing XML includes */
28409     int n_flags;
28410
28411     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
28412     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
28413         mem_base = xmlMemBlocks();
28414         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
28415         flags = gen_int(n_flags, 1);
28416
28417         ret_val = xmlXIncludeSetFlags(ctxt, flags);
28418         desret_int(ret_val);
28419         call_tests++;
28420         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
28421         des_int(n_flags, flags, 1);
28422         xmlResetLastError();
28423         if (mem_base != xmlMemBlocks()) {
28424             printf("Leak of %d blocks found in xmlXIncludeSetFlags",
28425                    xmlMemBlocks() - mem_base);
28426             test_ret++;
28427             printf(" %d", n_ctxt);
28428             printf(" %d", n_flags);
28429             printf("\n");
28430         }
28431     }
28432     }
28433     function_tests++;
28434 #endif
28435
28436     return(test_ret);
28437 }
28438
28439 static int
28440 test_xinclude(void) {
28441     int test_ret = 0;
28442         int rc = 0;
28443
28444     if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
28445     rc = test_xmlXIncludeNewContext();
28446         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28447     rc = test_xmlXIncludeProcess();
28448         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28449     rc = test_xmlXIncludeProcessFlags();
28450         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28451     rc = test_xmlXIncludeProcessFlagsData();
28452         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28453     rc = test_xmlXIncludeProcessNode();
28454         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28455     rc = test_xmlXIncludeProcessTree();
28456         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28457     rc = test_xmlXIncludeProcessTreeFlags();
28458         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28459     rc = test_xmlXIncludeProcessTreeFlagsData();
28460         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28461     rc = test_xmlXIncludeSetFlags();
28462         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
28463
28464     if (test_ret != 0)
28465         printf("Module xinclude: %d errors\n", test_ret);
28466     return(test_ret);
28467 }
28468
28469 static int
28470 test_xmlAllocOutputBuffer(void) {
28471     int test_ret = 0;
28472
28473 #if defined(LIBXML_OUTPUT_ENABLED)
28474     int mem_base;
28475     xmlOutputBufferPtr ret_val;
28476     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28477     int n_encoder;
28478
28479     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28480         mem_base = xmlMemBlocks();
28481         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
28482
28483         ret_val = xmlAllocOutputBuffer(encoder);
28484         desret_xmlOutputBufferPtr(ret_val);
28485         call_tests++;
28486         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
28487         xmlResetLastError();
28488         if (mem_base != xmlMemBlocks()) {
28489             printf("Leak of %d blocks found in xmlAllocOutputBuffer",
28490                    xmlMemBlocks() - mem_base);
28491             test_ret++;
28492             printf(" %d", n_encoder);
28493             printf("\n");
28494         }
28495     }
28496     function_tests++;
28497 #endif
28498
28499     return(test_ret);
28500 }
28501
28502
28503 static int
28504 test_xmlAllocParserInputBuffer(void) {
28505     int test_ret = 0;
28506
28507     int mem_base;
28508     xmlParserInputBufferPtr ret_val;
28509     xmlCharEncoding enc; /* the charset encoding if known */
28510     int n_enc;
28511
28512     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28513         mem_base = xmlMemBlocks();
28514         enc = gen_xmlCharEncoding(n_enc, 0);
28515
28516         ret_val = xmlAllocParserInputBuffer(enc);
28517         desret_xmlParserInputBufferPtr(ret_val);
28518         call_tests++;
28519         des_xmlCharEncoding(n_enc, enc, 0);
28520         xmlResetLastError();
28521         if (mem_base != xmlMemBlocks()) {
28522             printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
28523                    xmlMemBlocks() - mem_base);
28524             test_ret++;
28525             printf(" %d", n_enc);
28526             printf("\n");
28527         }
28528     }
28529     function_tests++;
28530
28531     return(test_ret);
28532 }
28533
28534
28535 static int
28536 test_xmlCheckFilename(void) {
28537     int test_ret = 0;
28538
28539     int mem_base;
28540     int ret_val;
28541     char * path; /* the path to check */
28542     int n_path;
28543
28544     for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
28545         mem_base = xmlMemBlocks();
28546         path = gen_const_char_ptr(n_path, 0);
28547
28548         ret_val = xmlCheckFilename((const char *)path);
28549         desret_int(ret_val);
28550         call_tests++;
28551         des_const_char_ptr(n_path, (const char *)path, 0);
28552         xmlResetLastError();
28553         if (mem_base != xmlMemBlocks()) {
28554             printf("Leak of %d blocks found in xmlCheckFilename",
28555                    xmlMemBlocks() - mem_base);
28556             test_ret++;
28557             printf(" %d", n_path);
28558             printf("\n");
28559         }
28560     }
28561     function_tests++;
28562
28563     return(test_ret);
28564 }
28565
28566
28567 static int
28568 test_xmlCheckHTTPInput(void) {
28569     int test_ret = 0;
28570
28571     int mem_base;
28572     xmlParserInputPtr ret_val;
28573     xmlParserCtxtPtr ctxt; /* an XML parser context */
28574     int n_ctxt;
28575     xmlParserInputPtr ret; /* an XML parser input */
28576     int n_ret;
28577
28578     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28579     for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
28580         mem_base = xmlMemBlocks();
28581         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
28582         ret = gen_xmlParserInputPtr(n_ret, 1);
28583
28584         ret_val = xmlCheckHTTPInput(ctxt, ret);
28585         desret_xmlParserInputPtr(ret_val);
28586         call_tests++;
28587         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
28588         des_xmlParserInputPtr(n_ret, ret, 1);
28589         xmlResetLastError();
28590         if (mem_base != xmlMemBlocks()) {
28591             printf("Leak of %d blocks found in xmlCheckHTTPInput",
28592                    xmlMemBlocks() - mem_base);
28593             test_ret++;
28594             printf(" %d", n_ctxt);
28595             printf(" %d", n_ret);
28596             printf("\n");
28597         }
28598     }
28599     }
28600     function_tests++;
28601
28602     return(test_ret);
28603 }
28604
28605
28606 static int
28607 test_xmlCleanupInputCallbacks(void) {
28608     int test_ret = 0;
28609
28610     int mem_base;
28611
28612         mem_base = xmlMemBlocks();
28613
28614         xmlCleanupInputCallbacks();
28615         call_tests++;
28616         xmlResetLastError();
28617         if (mem_base != xmlMemBlocks()) {
28618             printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
28619                    xmlMemBlocks() - mem_base);
28620             test_ret++;
28621             printf("\n");
28622         }
28623     function_tests++;
28624
28625     return(test_ret);
28626 }
28627
28628
28629 static int
28630 test_xmlCleanupOutputCallbacks(void) {
28631     int test_ret = 0;
28632
28633 #if defined(LIBXML_OUTPUT_ENABLED)
28634     int mem_base;
28635
28636         mem_base = xmlMemBlocks();
28637
28638         xmlCleanupOutputCallbacks();
28639         call_tests++;
28640         xmlResetLastError();
28641         if (mem_base != xmlMemBlocks()) {
28642             printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
28643                    xmlMemBlocks() - mem_base);
28644             test_ret++;
28645             printf("\n");
28646         }
28647     function_tests++;
28648 #endif
28649
28650     return(test_ret);
28651 }
28652
28653
28654 static int
28655 test_xmlFileClose(void) {
28656     int test_ret = 0;
28657
28658     int mem_base;
28659     int ret_val;
28660     void * context; /* the I/O context */
28661     int n_context;
28662
28663     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28664         mem_base = xmlMemBlocks();
28665         context = gen_void_ptr(n_context, 0);
28666
28667         ret_val = xmlFileClose(context);
28668         desret_int(ret_val);
28669         call_tests++;
28670         des_void_ptr(n_context, context, 0);
28671         xmlResetLastError();
28672         if (mem_base != xmlMemBlocks()) {
28673             printf("Leak of %d blocks found in xmlFileClose",
28674                    xmlMemBlocks() - mem_base);
28675             test_ret++;
28676             printf(" %d", n_context);
28677             printf("\n");
28678         }
28679     }
28680     function_tests++;
28681
28682     return(test_ret);
28683 }
28684
28685
28686 static int
28687 test_xmlFileMatch(void) {
28688     int test_ret = 0;
28689
28690     int mem_base;
28691     int ret_val;
28692     const char * filename; /* the URI for matching */
28693     int n_filename;
28694
28695     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28696         mem_base = xmlMemBlocks();
28697         filename = gen_filepath(n_filename, 0);
28698
28699         ret_val = xmlFileMatch(filename);
28700         desret_int(ret_val);
28701         call_tests++;
28702         des_filepath(n_filename, filename, 0);
28703         xmlResetLastError();
28704         if (mem_base != xmlMemBlocks()) {
28705             printf("Leak of %d blocks found in xmlFileMatch",
28706                    xmlMemBlocks() - mem_base);
28707             test_ret++;
28708             printf(" %d", n_filename);
28709             printf("\n");
28710         }
28711     }
28712     function_tests++;
28713
28714     return(test_ret);
28715 }
28716
28717
28718 static int
28719 test_xmlFileOpen(void) {
28720     int test_ret = 0;
28721
28722     int mem_base;
28723     void * ret_val;
28724     const char * filename; /* the URI for matching */
28725     int n_filename;
28726
28727     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28728         mem_base = xmlMemBlocks();
28729         filename = gen_filepath(n_filename, 0);
28730
28731         ret_val = xmlFileOpen(filename);
28732         desret_void_ptr(ret_val);
28733         call_tests++;
28734         des_filepath(n_filename, filename, 0);
28735         xmlResetLastError();
28736         if (mem_base != xmlMemBlocks()) {
28737             printf("Leak of %d blocks found in xmlFileOpen",
28738                    xmlMemBlocks() - mem_base);
28739             test_ret++;
28740             printf(" %d", n_filename);
28741             printf("\n");
28742         }
28743     }
28744     function_tests++;
28745
28746     return(test_ret);
28747 }
28748
28749
28750 static int
28751 test_xmlFileRead(void) {
28752     int test_ret = 0;
28753
28754     int mem_base;
28755     int ret_val;
28756     void * context; /* the I/O context */
28757     int n_context;
28758     char * buffer; /* where to drop data */
28759     int n_buffer;
28760     int len; /* number of bytes to write */
28761     int n_len;
28762
28763     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28764     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28765     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28766         mem_base = xmlMemBlocks();
28767         context = gen_void_ptr(n_context, 0);
28768         buffer = gen_char_ptr(n_buffer, 1);
28769         len = gen_int(n_len, 2);
28770
28771         ret_val = xmlFileRead(context, buffer, len);
28772         desret_int(ret_val);
28773         call_tests++;
28774         des_void_ptr(n_context, context, 0);
28775         des_char_ptr(n_buffer, buffer, 1);
28776         des_int(n_len, len, 2);
28777         xmlResetLastError();
28778         if (mem_base != xmlMemBlocks()) {
28779             printf("Leak of %d blocks found in xmlFileRead",
28780                    xmlMemBlocks() - mem_base);
28781             test_ret++;
28782             printf(" %d", n_context);
28783             printf(" %d", n_buffer);
28784             printf(" %d", n_len);
28785             printf("\n");
28786         }
28787     }
28788     }
28789     }
28790     function_tests++;
28791
28792     return(test_ret);
28793 }
28794
28795
28796 static int
28797 test_xmlIOFTPClose(void) {
28798     int test_ret = 0;
28799
28800 #if defined(LIBXML_FTP_ENABLED)
28801     int mem_base;
28802     int ret_val;
28803     void * context; /* the I/O context */
28804     int n_context;
28805
28806     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28807         mem_base = xmlMemBlocks();
28808         context = gen_void_ptr(n_context, 0);
28809
28810         ret_val = xmlIOFTPClose(context);
28811         desret_int(ret_val);
28812         call_tests++;
28813         des_void_ptr(n_context, context, 0);
28814         xmlResetLastError();
28815         if (mem_base != xmlMemBlocks()) {
28816             printf("Leak of %d blocks found in xmlIOFTPClose",
28817                    xmlMemBlocks() - mem_base);
28818             test_ret++;
28819             printf(" %d", n_context);
28820             printf("\n");
28821         }
28822     }
28823     function_tests++;
28824 #endif
28825
28826     return(test_ret);
28827 }
28828
28829
28830 static int
28831 test_xmlIOFTPMatch(void) {
28832     int test_ret = 0;
28833
28834 #if defined(LIBXML_FTP_ENABLED)
28835     int mem_base;
28836     int ret_val;
28837     const char * filename; /* the URI for matching */
28838     int n_filename;
28839
28840     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28841         mem_base = xmlMemBlocks();
28842         filename = gen_filepath(n_filename, 0);
28843
28844         ret_val = xmlIOFTPMatch(filename);
28845         desret_int(ret_val);
28846         call_tests++;
28847         des_filepath(n_filename, filename, 0);
28848         xmlResetLastError();
28849         if (mem_base != xmlMemBlocks()) {
28850             printf("Leak of %d blocks found in xmlIOFTPMatch",
28851                    xmlMemBlocks() - mem_base);
28852             test_ret++;
28853             printf(" %d", n_filename);
28854             printf("\n");
28855         }
28856     }
28857     function_tests++;
28858 #endif
28859
28860     return(test_ret);
28861 }
28862
28863
28864 static int
28865 test_xmlIOFTPOpen(void) {
28866     int test_ret = 0;
28867
28868 #if defined(LIBXML_FTP_ENABLED)
28869     int mem_base;
28870     void * ret_val;
28871     const char * filename; /* the URI for matching */
28872     int n_filename;
28873
28874     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28875         mem_base = xmlMemBlocks();
28876         filename = gen_filepath(n_filename, 0);
28877
28878         ret_val = xmlIOFTPOpen(filename);
28879         desret_void_ptr(ret_val);
28880         call_tests++;
28881         des_filepath(n_filename, filename, 0);
28882         xmlResetLastError();
28883         if (mem_base != xmlMemBlocks()) {
28884             printf("Leak of %d blocks found in xmlIOFTPOpen",
28885                    xmlMemBlocks() - mem_base);
28886             test_ret++;
28887             printf(" %d", n_filename);
28888             printf("\n");
28889         }
28890     }
28891     function_tests++;
28892 #endif
28893
28894     return(test_ret);
28895 }
28896
28897
28898 static int
28899 test_xmlIOFTPRead(void) {
28900     int test_ret = 0;
28901
28902 #if defined(LIBXML_FTP_ENABLED)
28903     int mem_base;
28904     int ret_val;
28905     void * context; /* the I/O context */
28906     int n_context;
28907     char * buffer; /* where to drop data */
28908     int n_buffer;
28909     int len; /* number of bytes to write */
28910     int n_len;
28911
28912     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28913     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28914     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28915         mem_base = xmlMemBlocks();
28916         context = gen_void_ptr(n_context, 0);
28917         buffer = gen_char_ptr(n_buffer, 1);
28918         len = gen_int(n_len, 2);
28919
28920         ret_val = xmlIOFTPRead(context, buffer, len);
28921         desret_int(ret_val);
28922         call_tests++;
28923         des_void_ptr(n_context, context, 0);
28924         des_char_ptr(n_buffer, buffer, 1);
28925         des_int(n_len, len, 2);
28926         xmlResetLastError();
28927         if (mem_base != xmlMemBlocks()) {
28928             printf("Leak of %d blocks found in xmlIOFTPRead",
28929                    xmlMemBlocks() - mem_base);
28930             test_ret++;
28931             printf(" %d", n_context);
28932             printf(" %d", n_buffer);
28933             printf(" %d", n_len);
28934             printf("\n");
28935         }
28936     }
28937     }
28938     }
28939     function_tests++;
28940 #endif
28941
28942     return(test_ret);
28943 }
28944
28945
28946 static int
28947 test_xmlIOHTTPClose(void) {
28948     int test_ret = 0;
28949
28950 #if defined(LIBXML_HTTP_ENABLED)
28951     int mem_base;
28952     int ret_val;
28953     void * context; /* the I/O context */
28954     int n_context;
28955
28956     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28957         mem_base = xmlMemBlocks();
28958         context = gen_void_ptr(n_context, 0);
28959
28960         ret_val = xmlIOHTTPClose(context);
28961         desret_int(ret_val);
28962         call_tests++;
28963         des_void_ptr(n_context, context, 0);
28964         xmlResetLastError();
28965         if (mem_base != xmlMemBlocks()) {
28966             printf("Leak of %d blocks found in xmlIOHTTPClose",
28967                    xmlMemBlocks() - mem_base);
28968             test_ret++;
28969             printf(" %d", n_context);
28970             printf("\n");
28971         }
28972     }
28973     function_tests++;
28974 #endif
28975
28976     return(test_ret);
28977 }
28978
28979
28980 static int
28981 test_xmlIOHTTPMatch(void) {
28982     int test_ret = 0;
28983
28984 #if defined(LIBXML_HTTP_ENABLED)
28985     int mem_base;
28986     int ret_val;
28987     const char * filename; /* the URI for matching */
28988     int n_filename;
28989
28990     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28991         mem_base = xmlMemBlocks();
28992         filename = gen_filepath(n_filename, 0);
28993
28994         ret_val = xmlIOHTTPMatch(filename);
28995         desret_int(ret_val);
28996         call_tests++;
28997         des_filepath(n_filename, filename, 0);
28998         xmlResetLastError();
28999         if (mem_base != xmlMemBlocks()) {
29000             printf("Leak of %d blocks found in xmlIOHTTPMatch",
29001                    xmlMemBlocks() - mem_base);
29002             test_ret++;
29003             printf(" %d", n_filename);
29004             printf("\n");
29005         }
29006     }
29007     function_tests++;
29008 #endif
29009
29010     return(test_ret);
29011 }
29012
29013
29014 static int
29015 test_xmlIOHTTPOpen(void) {
29016     int test_ret = 0;
29017
29018 #if defined(LIBXML_HTTP_ENABLED)
29019     int mem_base;
29020     void * ret_val;
29021     const char * filename; /* the URI for matching */
29022     int n_filename;
29023
29024     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29025         mem_base = xmlMemBlocks();
29026         filename = gen_filepath(n_filename, 0);
29027
29028         ret_val = xmlIOHTTPOpen(filename);
29029         desret_xmlNanoHTTPCtxtPtr(ret_val);
29030         call_tests++;
29031         des_filepath(n_filename, filename, 0);
29032         xmlResetLastError();
29033         if (mem_base != xmlMemBlocks()) {
29034             printf("Leak of %d blocks found in xmlIOHTTPOpen",
29035                    xmlMemBlocks() - mem_base);
29036             test_ret++;
29037             printf(" %d", n_filename);
29038             printf("\n");
29039         }
29040     }
29041     function_tests++;
29042 #endif
29043
29044     return(test_ret);
29045 }
29046
29047
29048 static int
29049 test_xmlIOHTTPRead(void) {
29050     int test_ret = 0;
29051
29052 #if defined(LIBXML_HTTP_ENABLED)
29053     int mem_base;
29054     int ret_val;
29055     void * context; /* the I/O context */
29056     int n_context;
29057     char * buffer; /* where to drop data */
29058     int n_buffer;
29059     int len; /* number of bytes to write */
29060     int n_len;
29061
29062     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
29063     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
29064     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29065         mem_base = xmlMemBlocks();
29066         context = gen_void_ptr(n_context, 0);
29067         buffer = gen_char_ptr(n_buffer, 1);
29068         len = gen_int(n_len, 2);
29069
29070         ret_val = xmlIOHTTPRead(context, buffer, len);
29071         desret_int(ret_val);
29072         call_tests++;
29073         des_void_ptr(n_context, context, 0);
29074         des_char_ptr(n_buffer, buffer, 1);
29075         des_int(n_len, len, 2);
29076         xmlResetLastError();
29077         if (mem_base != xmlMemBlocks()) {
29078             printf("Leak of %d blocks found in xmlIOHTTPRead",
29079                    xmlMemBlocks() - mem_base);
29080             test_ret++;
29081             printf(" %d", n_context);
29082             printf(" %d", n_buffer);
29083             printf(" %d", n_len);
29084             printf("\n");
29085         }
29086     }
29087     }
29088     }
29089     function_tests++;
29090 #endif
29091
29092     return(test_ret);
29093 }
29094
29095
29096 static int
29097 test_xmlNoNetExternalEntityLoader(void) {
29098     int test_ret = 0;
29099
29100     int mem_base;
29101     xmlParserInputPtr ret_val;
29102     const char * URL; /* the URL for the entity to load */
29103     int n_URL;
29104     char * ID; /* the System ID for the entity to load */
29105     int n_ID;
29106     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
29107     int n_ctxt;
29108
29109     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29110     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
29111     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
29112         mem_base = xmlMemBlocks();
29113         URL = gen_filepath(n_URL, 0);
29114         ID = gen_const_char_ptr(n_ID, 1);
29115         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
29116
29117         ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
29118         desret_xmlParserInputPtr(ret_val);
29119         call_tests++;
29120         des_filepath(n_URL, URL, 0);
29121         des_const_char_ptr(n_ID, (const char *)ID, 1);
29122         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
29123         xmlResetLastError();
29124         if (mem_base != xmlMemBlocks()) {
29125             printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
29126                    xmlMemBlocks() - mem_base);
29127             test_ret++;
29128             printf(" %d", n_URL);
29129             printf(" %d", n_ID);
29130             printf(" %d", n_ctxt);
29131             printf("\n");
29132         }
29133     }
29134     }
29135     }
29136     function_tests++;
29137
29138     return(test_ret);
29139 }
29140
29141
29142 static int
29143 test_xmlNormalizeWindowsPath(void) {
29144     int test_ret = 0;
29145
29146     int mem_base;
29147     xmlChar * ret_val;
29148     xmlChar * path; /* the input file path */
29149     int n_path;
29150
29151     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
29152         mem_base = xmlMemBlocks();
29153         path = gen_const_xmlChar_ptr(n_path, 0);
29154
29155         ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
29156         desret_xmlChar_ptr(ret_val);
29157         call_tests++;
29158         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
29159         xmlResetLastError();
29160         if (mem_base != xmlMemBlocks()) {
29161             printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
29162                    xmlMemBlocks() - mem_base);
29163             test_ret++;
29164             printf(" %d", n_path);
29165             printf("\n");
29166         }
29167     }
29168     function_tests++;
29169
29170     return(test_ret);
29171 }
29172
29173
29174 static int
29175 test_xmlOutputBufferCreateBuffer(void) {
29176     int test_ret = 0;
29177
29178 #if defined(LIBXML_OUTPUT_ENABLED)
29179     int mem_base;
29180     xmlOutputBufferPtr ret_val;
29181     xmlBufferPtr buffer; /* a xmlBufferPtr */
29182     int n_buffer;
29183     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
29184     int n_encoder;
29185
29186     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
29187     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
29188         mem_base = xmlMemBlocks();
29189         buffer = gen_xmlBufferPtr(n_buffer, 0);
29190         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
29191
29192         ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
29193         desret_xmlOutputBufferPtr(ret_val);
29194         call_tests++;
29195         des_xmlBufferPtr(n_buffer, buffer, 0);
29196         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
29197         xmlResetLastError();
29198         if (mem_base != xmlMemBlocks()) {
29199             printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
29200                    xmlMemBlocks() - mem_base);
29201             test_ret++;
29202             printf(" %d", n_buffer);
29203             printf(" %d", n_encoder);
29204             printf("\n");
29205         }
29206     }
29207     }
29208     function_tests++;
29209 #endif
29210
29211     return(test_ret);
29212 }
29213
29214
29215 static int
29216 test_xmlOutputBufferCreateFd(void) {
29217     int test_ret = 0;
29218
29219 #if defined(LIBXML_OUTPUT_ENABLED)
29220     int mem_base;
29221     xmlOutputBufferPtr ret_val;
29222     int fd; /* a file descriptor number */
29223     int n_fd;
29224     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
29225     int n_encoder;
29226
29227     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
29228     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
29229         mem_base = xmlMemBlocks();
29230         fd = gen_int(n_fd, 0);
29231         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
29232
29233         ret_val = xmlOutputBufferCreateFd(fd, encoder);
29234         desret_xmlOutputBufferPtr(ret_val);
29235         call_tests++;
29236         des_int(n_fd, fd, 0);
29237         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
29238         xmlResetLastError();
29239         if (mem_base != xmlMemBlocks()) {
29240             printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
29241                    xmlMemBlocks() - mem_base);
29242             test_ret++;
29243             printf(" %d", n_fd);
29244             printf(" %d", n_encoder);
29245             printf("\n");
29246         }
29247     }
29248     }
29249     function_tests++;
29250 #endif
29251
29252     return(test_ret);
29253 }
29254
29255
29256 static int
29257 test_xmlOutputBufferCreateFile(void) {
29258     int test_ret = 0;
29259
29260 #if defined(LIBXML_OUTPUT_ENABLED)
29261     int mem_base;
29262     xmlOutputBufferPtr ret_val;
29263     FILE * file; /* a FILE* */
29264     int n_file;
29265     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
29266     int n_encoder;
29267
29268     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
29269     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
29270         mem_base = xmlMemBlocks();
29271         file = gen_FILE_ptr(n_file, 0);
29272         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
29273
29274         ret_val = xmlOutputBufferCreateFile(file, encoder);
29275         desret_xmlOutputBufferPtr(ret_val);
29276         call_tests++;
29277         des_FILE_ptr(n_file, file, 0);
29278         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
29279         xmlResetLastError();
29280         if (mem_base != xmlMemBlocks()) {
29281             printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
29282                    xmlMemBlocks() - mem_base);
29283             test_ret++;
29284             printf(" %d", n_file);
29285             printf(" %d", n_encoder);
29286             printf("\n");
29287         }
29288     }
29289     }
29290     function_tests++;
29291 #endif
29292
29293     return(test_ret);
29294 }
29295
29296
29297 static int
29298 test_xmlOutputBufferCreateFilename(void) {
29299     int test_ret = 0;
29300
29301 #if defined(LIBXML_OUTPUT_ENABLED)
29302     int mem_base;
29303     xmlOutputBufferPtr ret_val;
29304     const char * URI; /* a C string containing the URI or filename */
29305     int n_URI;
29306     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
29307     int n_encoder;
29308     int compression; /* the compression ration (0 none, 9 max). */
29309     int n_compression;
29310
29311     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
29312     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
29313     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
29314         mem_base = xmlMemBlocks();
29315         URI = gen_fileoutput(n_URI, 0);
29316         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
29317         compression = gen_int(n_compression, 2);
29318
29319         ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
29320         desret_xmlOutputBufferPtr(ret_val);
29321         call_tests++;
29322         des_fileoutput(n_URI, URI, 0);
29323         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
29324         des_int(n_compression, compression, 2);
29325         xmlResetLastError();
29326         if (mem_base != xmlMemBlocks()) {
29327             printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
29328                    xmlMemBlocks() - mem_base);
29329             test_ret++;
29330             printf(" %d", n_URI);
29331             printf(" %d", n_encoder);
29332             printf(" %d", n_compression);
29333             printf("\n");
29334         }
29335     }
29336     }
29337     }
29338     function_tests++;
29339 #endif
29340
29341     return(test_ret);
29342 }
29343
29344
29345 static int
29346 test_xmlOutputBufferFlush(void) {
29347     int test_ret = 0;
29348
29349 #if defined(LIBXML_OUTPUT_ENABLED)
29350     int mem_base;
29351     int ret_val;
29352     xmlOutputBufferPtr out; /* a buffered output */
29353     int n_out;
29354
29355     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
29356         mem_base = xmlMemBlocks();
29357         out = gen_xmlOutputBufferPtr(n_out, 0);
29358
29359         ret_val = xmlOutputBufferFlush(out);
29360         desret_int(ret_val);
29361         call_tests++;
29362         des_xmlOutputBufferPtr(n_out, out, 0);
29363         xmlResetLastError();
29364         if (mem_base != xmlMemBlocks()) {
29365             printf("Leak of %d blocks found in xmlOutputBufferFlush",
29366                    xmlMemBlocks() - mem_base);
29367             test_ret++;
29368             printf(" %d", n_out);
29369             printf("\n");
29370         }
29371     }
29372     function_tests++;
29373 #endif
29374
29375     return(test_ret);
29376 }
29377
29378
29379 static int
29380 test_xmlOutputBufferGetContent(void) {
29381     int test_ret = 0;
29382
29383 #if defined(LIBXML_OUTPUT_ENABLED)
29384     int mem_base;
29385     const xmlChar * ret_val;
29386     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
29387     int n_out;
29388
29389     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
29390         mem_base = xmlMemBlocks();
29391         out = gen_xmlOutputBufferPtr(n_out, 0);
29392
29393         ret_val = xmlOutputBufferGetContent(out);
29394         desret_const_xmlChar_ptr(ret_val);
29395         call_tests++;
29396         des_xmlOutputBufferPtr(n_out, out, 0);
29397         xmlResetLastError();
29398         if (mem_base != xmlMemBlocks()) {
29399             printf("Leak of %d blocks found in xmlOutputBufferGetContent",
29400                    xmlMemBlocks() - mem_base);
29401             test_ret++;
29402             printf(" %d", n_out);
29403             printf("\n");
29404         }
29405     }
29406     function_tests++;
29407 #endif
29408
29409     return(test_ret);
29410 }
29411
29412
29413 static int
29414 test_xmlOutputBufferGetSize(void) {
29415     int test_ret = 0;
29416
29417
29418     /* missing type support */
29419     return(test_ret);
29420 }
29421
29422
29423 static int
29424 test_xmlOutputBufferWrite(void) {
29425     int test_ret = 0;
29426
29427 #if defined(LIBXML_OUTPUT_ENABLED)
29428     int mem_base;
29429     int ret_val;
29430     xmlOutputBufferPtr out; /* a buffered parser output */
29431     int n_out;
29432     int len; /* the size in bytes of the array. */
29433     int n_len;
29434     char * buf; /* an char array */
29435     int n_buf;
29436
29437     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
29438     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29439     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
29440         mem_base = xmlMemBlocks();
29441         out = gen_xmlOutputBufferPtr(n_out, 0);
29442         len = gen_int(n_len, 1);
29443         buf = gen_const_char_ptr(n_buf, 2);
29444         if ((buf != NULL) &&
29445             (len > (int) strlen((const char *) buf) + 1))
29446             continue;
29447
29448         ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
29449         desret_int(ret_val);
29450         call_tests++;
29451         des_xmlOutputBufferPtr(n_out, out, 0);
29452         des_int(n_len, len, 1);
29453         des_const_char_ptr(n_buf, (const char *)buf, 2);
29454         xmlResetLastError();
29455         if (mem_base != xmlMemBlocks()) {
29456             printf("Leak of %d blocks found in xmlOutputBufferWrite",
29457                    xmlMemBlocks() - mem_base);
29458             test_ret++;
29459             printf(" %d", n_out);
29460             printf(" %d", n_len);
29461             printf(" %d", n_buf);
29462             printf("\n");
29463         }
29464     }
29465     }
29466     }
29467     function_tests++;
29468 #endif
29469
29470     return(test_ret);
29471 }
29472
29473
29474 static int
29475 test_xmlOutputBufferWriteEscape(void) {
29476     int test_ret = 0;
29477
29478
29479     /* missing type support */
29480     return(test_ret);
29481 }
29482
29483
29484 static int
29485 test_xmlOutputBufferWriteString(void) {
29486     int test_ret = 0;
29487
29488 #if defined(LIBXML_OUTPUT_ENABLED)
29489     int mem_base;
29490     int ret_val;
29491     xmlOutputBufferPtr out; /* a buffered parser output */
29492     int n_out;
29493     char * str; /* a zero terminated C string */
29494     int n_str;
29495
29496     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
29497     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
29498         mem_base = xmlMemBlocks();
29499         out = gen_xmlOutputBufferPtr(n_out, 0);
29500         str = gen_const_char_ptr(n_str, 1);
29501
29502         ret_val = xmlOutputBufferWriteString(out, (const char *)str);
29503         desret_int(ret_val);
29504         call_tests++;
29505         des_xmlOutputBufferPtr(n_out, out, 0);
29506         des_const_char_ptr(n_str, (const char *)str, 1);
29507         xmlResetLastError();
29508         if (mem_base != xmlMemBlocks()) {
29509             printf("Leak of %d blocks found in xmlOutputBufferWriteString",
29510                    xmlMemBlocks() - mem_base);
29511             test_ret++;
29512             printf(" %d", n_out);
29513             printf(" %d", n_str);
29514             printf("\n");
29515         }
29516     }
29517     }
29518     function_tests++;
29519 #endif
29520
29521     return(test_ret);
29522 }
29523
29524
29525 static int
29526 test_xmlParserGetDirectory(void) {
29527     int test_ret = 0;
29528
29529
29530     /* missing type support */
29531     return(test_ret);
29532 }
29533
29534
29535 static int
29536 test_xmlParserInputBufferCreateFd(void) {
29537     int test_ret = 0;
29538
29539     int mem_base;
29540     xmlParserInputBufferPtr ret_val;
29541     int fd; /* a file descriptor number */
29542     int n_fd;
29543     xmlCharEncoding enc; /* the charset encoding if known */
29544     int n_enc;
29545
29546     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
29547     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29548         mem_base = xmlMemBlocks();
29549         fd = gen_int(n_fd, 0);
29550         enc = gen_xmlCharEncoding(n_enc, 1);
29551         if (fd >= 0) fd = -1;
29552
29553         ret_val = xmlParserInputBufferCreateFd(fd, enc);
29554         desret_xmlParserInputBufferPtr(ret_val);
29555         call_tests++;
29556         des_int(n_fd, fd, 0);
29557         des_xmlCharEncoding(n_enc, enc, 1);
29558         xmlResetLastError();
29559         if (mem_base != xmlMemBlocks()) {
29560             printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
29561                    xmlMemBlocks() - mem_base);
29562             test_ret++;
29563             printf(" %d", n_fd);
29564             printf(" %d", n_enc);
29565             printf("\n");
29566         }
29567     }
29568     }
29569     function_tests++;
29570
29571     return(test_ret);
29572 }
29573
29574
29575 static int
29576 test_xmlParserInputBufferCreateFile(void) {
29577     int test_ret = 0;
29578
29579     int mem_base;
29580     xmlParserInputBufferPtr ret_val;
29581     FILE * file; /* a FILE* */
29582     int n_file;
29583     xmlCharEncoding enc; /* the charset encoding if known */
29584     int n_enc;
29585
29586     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
29587     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29588         mem_base = xmlMemBlocks();
29589         file = gen_FILE_ptr(n_file, 0);
29590         enc = gen_xmlCharEncoding(n_enc, 1);
29591
29592         ret_val = xmlParserInputBufferCreateFile(file, enc);
29593         desret_xmlParserInputBufferPtr(ret_val);
29594         call_tests++;
29595         des_FILE_ptr(n_file, file, 0);
29596         des_xmlCharEncoding(n_enc, enc, 1);
29597         xmlResetLastError();
29598         if (mem_base != xmlMemBlocks()) {
29599             printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
29600                    xmlMemBlocks() - mem_base);
29601             test_ret++;
29602             printf(" %d", n_file);
29603             printf(" %d", n_enc);
29604             printf("\n");
29605         }
29606     }
29607     }
29608     function_tests++;
29609
29610     return(test_ret);
29611 }
29612
29613
29614 static int
29615 test_xmlParserInputBufferCreateFilename(void) {
29616     int test_ret = 0;
29617
29618     int mem_base;
29619     xmlParserInputBufferPtr ret_val;
29620     const char * URI; /* a C string containing the URI or filename */
29621     int n_URI;
29622     xmlCharEncoding enc; /* the charset encoding if known */
29623     int n_enc;
29624
29625     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
29626     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29627         mem_base = xmlMemBlocks();
29628         URI = gen_fileoutput(n_URI, 0);
29629         enc = gen_xmlCharEncoding(n_enc, 1);
29630
29631         ret_val = xmlParserInputBufferCreateFilename(URI, enc);
29632         desret_xmlParserInputBufferPtr(ret_val);
29633         call_tests++;
29634         des_fileoutput(n_URI, URI, 0);
29635         des_xmlCharEncoding(n_enc, enc, 1);
29636         xmlResetLastError();
29637         if (mem_base != xmlMemBlocks()) {
29638             printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
29639                    xmlMemBlocks() - mem_base);
29640             test_ret++;
29641             printf(" %d", n_URI);
29642             printf(" %d", n_enc);
29643             printf("\n");
29644         }
29645     }
29646     }
29647     function_tests++;
29648
29649     return(test_ret);
29650 }
29651
29652
29653 static int
29654 test_xmlParserInputBufferCreateMem(void) {
29655     int test_ret = 0;
29656
29657     int mem_base;
29658     xmlParserInputBufferPtr ret_val;
29659     char * mem; /* the memory input */
29660     int n_mem;
29661     int size; /* the length of the memory block */
29662     int n_size;
29663     xmlCharEncoding enc; /* the charset encoding if known */
29664     int n_enc;
29665
29666     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
29667     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29668     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29669         mem_base = xmlMemBlocks();
29670         mem = gen_const_char_ptr(n_mem, 0);
29671         size = gen_int(n_size, 1);
29672         enc = gen_xmlCharEncoding(n_enc, 2);
29673         if ((mem != NULL) &&
29674             (size > (int) strlen((const char *) mem) + 1))
29675             continue;
29676
29677         ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
29678         desret_xmlParserInputBufferPtr(ret_val);
29679         call_tests++;
29680         des_const_char_ptr(n_mem, (const char *)mem, 0);
29681         des_int(n_size, size, 1);
29682         des_xmlCharEncoding(n_enc, enc, 2);
29683         xmlResetLastError();
29684         if (mem_base != xmlMemBlocks()) {
29685             printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
29686                    xmlMemBlocks() - mem_base);
29687             test_ret++;
29688             printf(" %d", n_mem);
29689             printf(" %d", n_size);
29690             printf(" %d", n_enc);
29691             printf("\n");
29692         }
29693     }
29694     }
29695     }
29696     function_tests++;
29697
29698     return(test_ret);
29699 }
29700
29701
29702 static int
29703 test_xmlParserInputBufferCreateStatic(void) {
29704     int test_ret = 0;
29705
29706     int mem_base;
29707     xmlParserInputBufferPtr ret_val;
29708     char * mem; /* the memory input */
29709     int n_mem;
29710     int size; /* the length of the memory block */
29711     int n_size;
29712     xmlCharEncoding enc; /* the charset encoding if known */
29713     int n_enc;
29714
29715     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
29716     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29717     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
29718         mem_base = xmlMemBlocks();
29719         mem = gen_const_char_ptr(n_mem, 0);
29720         size = gen_int(n_size, 1);
29721         enc = gen_xmlCharEncoding(n_enc, 2);
29722         if ((mem != NULL) &&
29723             (size > (int) strlen((const char *) mem) + 1))
29724             continue;
29725
29726         ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
29727         desret_xmlParserInputBufferPtr(ret_val);
29728         call_tests++;
29729         des_const_char_ptr(n_mem, (const char *)mem, 0);
29730         des_int(n_size, size, 1);
29731         des_xmlCharEncoding(n_enc, enc, 2);
29732         xmlResetLastError();
29733         if (mem_base != xmlMemBlocks()) {
29734             printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
29735                    xmlMemBlocks() - mem_base);
29736             test_ret++;
29737             printf(" %d", n_mem);
29738             printf(" %d", n_size);
29739             printf(" %d", n_enc);
29740             printf("\n");
29741         }
29742     }
29743     }
29744     }
29745     function_tests++;
29746
29747     return(test_ret);
29748 }
29749
29750
29751 static int
29752 test_xmlParserInputBufferGrow(void) {
29753     int test_ret = 0;
29754
29755     int mem_base;
29756     int ret_val;
29757     xmlParserInputBufferPtr in; /* a buffered parser input */
29758     int n_in;
29759     int len; /* indicative value of the amount of chars to read */
29760     int n_len;
29761
29762     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29763     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29764         mem_base = xmlMemBlocks();
29765         in = gen_xmlParserInputBufferPtr(n_in, 0);
29766         len = gen_int(n_len, 1);
29767
29768         ret_val = xmlParserInputBufferGrow(in, len);
29769         desret_int(ret_val);
29770         call_tests++;
29771         des_xmlParserInputBufferPtr(n_in, in, 0);
29772         des_int(n_len, len, 1);
29773         xmlResetLastError();
29774         if (mem_base != xmlMemBlocks()) {
29775             printf("Leak of %d blocks found in xmlParserInputBufferGrow",
29776                    xmlMemBlocks() - mem_base);
29777             test_ret++;
29778             printf(" %d", n_in);
29779             printf(" %d", n_len);
29780             printf("\n");
29781         }
29782     }
29783     }
29784     function_tests++;
29785
29786     return(test_ret);
29787 }
29788
29789
29790 static int
29791 test_xmlParserInputBufferPush(void) {
29792     int test_ret = 0;
29793
29794     int mem_base;
29795     int ret_val;
29796     xmlParserInputBufferPtr in; /* a buffered parser input */
29797     int n_in;
29798     int len; /* the size in bytes of the array. */
29799     int n_len;
29800     char * buf; /* an char array */
29801     int n_buf;
29802
29803     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29804     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29805     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
29806         mem_base = xmlMemBlocks();
29807         in = gen_xmlParserInputBufferPtr(n_in, 0);
29808         len = gen_int(n_len, 1);
29809         buf = gen_const_char_ptr(n_buf, 2);
29810         if ((buf != NULL) &&
29811             (len > (int) strlen((const char *) buf) + 1))
29812             continue;
29813
29814         ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
29815         desret_int(ret_val);
29816         call_tests++;
29817         des_xmlParserInputBufferPtr(n_in, in, 0);
29818         des_int(n_len, len, 1);
29819         des_const_char_ptr(n_buf, (const char *)buf, 2);
29820         xmlResetLastError();
29821         if (mem_base != xmlMemBlocks()) {
29822             printf("Leak of %d blocks found in xmlParserInputBufferPush",
29823                    xmlMemBlocks() - mem_base);
29824             test_ret++;
29825             printf(" %d", n_in);
29826             printf(" %d", n_len);
29827             printf(" %d", n_buf);
29828             printf("\n");
29829         }
29830     }
29831     }
29832     }
29833     function_tests++;
29834
29835     return(test_ret);
29836 }
29837
29838
29839 static int
29840 test_xmlParserInputBufferRead(void) {
29841     int test_ret = 0;
29842
29843     int mem_base;
29844     int ret_val;
29845     xmlParserInputBufferPtr in; /* a buffered parser input */
29846     int n_in;
29847     int len; /* indicative value of the amount of chars to read */
29848     int n_len;
29849
29850     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
29851     for (n_len = 0;n_len < gen_nb_int;n_len++) {
29852         mem_base = xmlMemBlocks();
29853         in = gen_xmlParserInputBufferPtr(n_in, 0);
29854         len = gen_int(n_len, 1);
29855
29856         ret_val = xmlParserInputBufferRead(in, len);
29857         desret_int(ret_val);
29858         call_tests++;
29859         des_xmlParserInputBufferPtr(n_in, in, 0);
29860         des_int(n_len, len, 1);
29861         xmlResetLastError();
29862         if (mem_base != xmlMemBlocks()) {
29863             printf("Leak of %d blocks found in xmlParserInputBufferRead",
29864                    xmlMemBlocks() - mem_base);
29865             test_ret++;
29866             printf(" %d", n_in);
29867             printf(" %d", n_len);
29868             printf("\n");
29869         }
29870     }
29871     }
29872     function_tests++;
29873
29874     return(test_ret);
29875 }
29876
29877
29878 static int
29879 test_xmlPopInputCallbacks(void) {
29880     int test_ret = 0;
29881
29882     int mem_base;
29883     int ret_val;
29884
29885         mem_base = xmlMemBlocks();
29886
29887         ret_val = xmlPopInputCallbacks();
29888         desret_int(ret_val);
29889         call_tests++;
29890         xmlResetLastError();
29891         if (mem_base != xmlMemBlocks()) {
29892             printf("Leak of %d blocks found in xmlPopInputCallbacks",
29893                    xmlMemBlocks() - mem_base);
29894             test_ret++;
29895             printf("\n");
29896         }
29897     function_tests++;
29898
29899     return(test_ret);
29900 }
29901
29902
29903 static int
29904 test_xmlRegisterDefaultInputCallbacks(void) {
29905     int test_ret = 0;
29906
29907     int mem_base;
29908
29909         mem_base = xmlMemBlocks();
29910
29911         xmlRegisterDefaultInputCallbacks();
29912         call_tests++;
29913         xmlResetLastError();
29914         if (mem_base != xmlMemBlocks()) {
29915             printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
29916                    xmlMemBlocks() - mem_base);
29917             test_ret++;
29918             printf("\n");
29919         }
29920     function_tests++;
29921
29922     return(test_ret);
29923 }
29924
29925
29926 static int
29927 test_xmlRegisterDefaultOutputCallbacks(void) {
29928     int test_ret = 0;
29929
29930 #if defined(LIBXML_OUTPUT_ENABLED)
29931     int mem_base;
29932
29933         mem_base = xmlMemBlocks();
29934
29935         xmlRegisterDefaultOutputCallbacks();
29936         call_tests++;
29937         xmlResetLastError();
29938         if (mem_base != xmlMemBlocks()) {
29939             printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
29940                    xmlMemBlocks() - mem_base);
29941             test_ret++;
29942             printf("\n");
29943         }
29944     function_tests++;
29945 #endif
29946
29947     return(test_ret);
29948 }
29949
29950
29951 static int
29952 test_xmlRegisterHTTPPostCallbacks(void) {
29953     int test_ret = 0;
29954
29955 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
29956     int mem_base;
29957
29958         mem_base = xmlMemBlocks();
29959
29960         xmlRegisterHTTPPostCallbacks();
29961         call_tests++;
29962         xmlResetLastError();
29963         if (mem_base != xmlMemBlocks()) {
29964             printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
29965                    xmlMemBlocks() - mem_base);
29966             test_ret++;
29967             printf("\n");
29968         }
29969     function_tests++;
29970 #endif
29971
29972     return(test_ret);
29973 }
29974
29975 static int
29976 test_xmlIO(void) {
29977     int test_ret = 0;
29978         int rc = 0;
29979
29980     if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
29981     rc = test_xmlAllocOutputBuffer();
29982         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29983     rc = test_xmlAllocParserInputBuffer();
29984         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29985     rc = test_xmlCheckFilename();
29986         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29987     rc = test_xmlCheckHTTPInput();
29988         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29989     rc = test_xmlCleanupInputCallbacks();
29990         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29991     rc = test_xmlCleanupOutputCallbacks();
29992         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29993     rc = test_xmlFileClose();
29994         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29995     rc = test_xmlFileMatch();
29996         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29997     rc = test_xmlFileOpen();
29998         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
29999     rc = test_xmlFileRead();
30000         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30001     rc = test_xmlIOFTPClose();
30002         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30003     rc = test_xmlIOFTPMatch();
30004         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30005     rc = test_xmlIOFTPOpen();
30006         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30007     rc = test_xmlIOFTPRead();
30008         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30009     rc = test_xmlIOHTTPClose();
30010         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30011     rc = test_xmlIOHTTPMatch();
30012         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30013     rc = test_xmlIOHTTPOpen();
30014         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30015     rc = test_xmlIOHTTPRead();
30016         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30017     rc = test_xmlNoNetExternalEntityLoader();
30018         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30019     rc = test_xmlNormalizeWindowsPath();
30020         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30021     rc = test_xmlOutputBufferCreateBuffer();
30022         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30023     rc = test_xmlOutputBufferCreateFd();
30024         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30025     rc = test_xmlOutputBufferCreateFile();
30026         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30027     rc = test_xmlOutputBufferCreateFilename();
30028         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30029     rc = test_xmlOutputBufferFlush();
30030         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30031     rc = test_xmlOutputBufferGetContent();
30032         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30033     rc = test_xmlOutputBufferGetSize();
30034         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30035     rc = test_xmlOutputBufferWrite();
30036         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30037     rc = test_xmlOutputBufferWriteEscape();
30038         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30039     rc = test_xmlOutputBufferWriteString();
30040         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30041     rc = test_xmlParserGetDirectory();
30042         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30043     rc = test_xmlParserInputBufferCreateFd();
30044         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30045     rc = test_xmlParserInputBufferCreateFile();
30046         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30047     rc = test_xmlParserInputBufferCreateFilename();
30048         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30049     rc = test_xmlParserInputBufferCreateMem();
30050         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30051     rc = test_xmlParserInputBufferCreateStatic();
30052         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30053     rc = test_xmlParserInputBufferGrow();
30054         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30055     rc = test_xmlParserInputBufferPush();
30056         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30057     rc = test_xmlParserInputBufferRead();
30058         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30059     rc = test_xmlPopInputCallbacks();
30060         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30061     rc = test_xmlRegisterDefaultInputCallbacks();
30062         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30063     rc = test_xmlRegisterDefaultOutputCallbacks();
30064         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30065     rc = test_xmlRegisterHTTPPostCallbacks();
30066         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30067
30068     if (test_ret != 0)
30069         printf("Module xmlIO: %d errors\n", test_ret);
30070     return(test_ret);
30071 }
30072 #ifdef LIBXML_AUTOMATA_ENABLED
30073
30074 #define gen_nb_xmlAutomataPtr 1
30075 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30076     return(NULL);
30077 }
30078 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30079 }
30080 #endif
30081
30082
30083 static int
30084 test_xmlAutomataCompile(void) {
30085     int test_ret = 0;
30086
30087
30088     /* missing type support */
30089     return(test_ret);
30090 }
30091
30092
30093 static int
30094 test_xmlAutomataGetInitState(void) {
30095     int test_ret = 0;
30096
30097
30098     /* missing type support */
30099     return(test_ret);
30100 }
30101
30102
30103 static int
30104 test_xmlAutomataIsDeterminist(void) {
30105     int test_ret = 0;
30106
30107 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
30108     int mem_base;
30109     int ret_val;
30110     xmlAutomataPtr am; /* an automata */
30111     int n_am;
30112
30113     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
30114         mem_base = xmlMemBlocks();
30115         am = gen_xmlAutomataPtr(n_am, 0);
30116
30117         ret_val = xmlAutomataIsDeterminist(am);
30118         desret_int(ret_val);
30119         call_tests++;
30120         des_xmlAutomataPtr(n_am, am, 0);
30121         xmlResetLastError();
30122         if (mem_base != xmlMemBlocks()) {
30123             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
30124                    xmlMemBlocks() - mem_base);
30125             test_ret++;
30126             printf(" %d", n_am);
30127             printf("\n");
30128         }
30129     }
30130     function_tests++;
30131 #endif
30132
30133     return(test_ret);
30134 }
30135
30136 #ifdef LIBXML_AUTOMATA_ENABLED
30137
30138 #define gen_nb_xmlAutomataStatePtr 1
30139 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30140     return(NULL);
30141 }
30142 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30143 }
30144 #endif
30145
30146
30147 static int
30148 test_xmlAutomataNewAllTrans(void) {
30149     int test_ret = 0;
30150
30151
30152     /* missing type support */
30153     return(test_ret);
30154 }
30155
30156
30157 static int
30158 test_xmlAutomataNewCountTrans(void) {
30159     int test_ret = 0;
30160
30161
30162     /* missing type support */
30163     return(test_ret);
30164 }
30165
30166
30167 static int
30168 test_xmlAutomataNewCountTrans2(void) {
30169     int test_ret = 0;
30170
30171
30172     /* missing type support */
30173     return(test_ret);
30174 }
30175
30176
30177 static int
30178 test_xmlAutomataNewCountedTrans(void) {
30179     int test_ret = 0;
30180
30181
30182     /* missing type support */
30183     return(test_ret);
30184 }
30185
30186
30187 static int
30188 test_xmlAutomataNewCounter(void) {
30189     int test_ret = 0;
30190
30191 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
30192     int mem_base;
30193     int ret_val;
30194     xmlAutomataPtr am; /* an automata */
30195     int n_am;
30196     int min; /* the minimal value on the counter */
30197     int n_min;
30198     int max; /* the maximal value on the counter */
30199     int n_max;
30200
30201     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
30202     for (n_min = 0;n_min < gen_nb_int;n_min++) {
30203     for (n_max = 0;n_max < gen_nb_int;n_max++) {
30204         mem_base = xmlMemBlocks();
30205         am = gen_xmlAutomataPtr(n_am, 0);
30206         min = gen_int(n_min, 1);
30207         max = gen_int(n_max, 2);
30208
30209         ret_val = xmlAutomataNewCounter(am, min, max);
30210         desret_int(ret_val);
30211         call_tests++;
30212         des_xmlAutomataPtr(n_am, am, 0);
30213         des_int(n_min, min, 1);
30214         des_int(n_max, max, 2);
30215         xmlResetLastError();
30216         if (mem_base != xmlMemBlocks()) {
30217             printf("Leak of %d blocks found in xmlAutomataNewCounter",
30218                    xmlMemBlocks() - mem_base);
30219             test_ret++;
30220             printf(" %d", n_am);
30221             printf(" %d", n_min);
30222             printf(" %d", n_max);
30223             printf("\n");
30224         }
30225     }
30226     }
30227     }
30228     function_tests++;
30229 #endif
30230
30231     return(test_ret);
30232 }
30233
30234
30235 static int
30236 test_xmlAutomataNewCounterTrans(void) {
30237     int test_ret = 0;
30238
30239
30240     /* missing type support */
30241     return(test_ret);
30242 }
30243
30244
30245 static int
30246 test_xmlAutomataNewEpsilon(void) {
30247     int test_ret = 0;
30248
30249
30250     /* missing type support */
30251     return(test_ret);
30252 }
30253
30254
30255 static int
30256 test_xmlAutomataNewNegTrans(void) {
30257     int test_ret = 0;
30258
30259
30260     /* missing type support */
30261     return(test_ret);
30262 }
30263
30264
30265 static int
30266 test_xmlAutomataNewOnceTrans(void) {
30267     int test_ret = 0;
30268
30269
30270     /* missing type support */
30271     return(test_ret);
30272 }
30273
30274
30275 static int
30276 test_xmlAutomataNewOnceTrans2(void) {
30277     int test_ret = 0;
30278
30279
30280     /* missing type support */
30281     return(test_ret);
30282 }
30283
30284
30285 static int
30286 test_xmlAutomataNewState(void) {
30287     int test_ret = 0;
30288
30289
30290     /* missing type support */
30291     return(test_ret);
30292 }
30293
30294
30295 static int
30296 test_xmlAutomataNewTransition(void) {
30297     int test_ret = 0;
30298
30299
30300     /* missing type support */
30301     return(test_ret);
30302 }
30303
30304
30305 static int
30306 test_xmlAutomataNewTransition2(void) {
30307     int test_ret = 0;
30308
30309
30310     /* missing type support */
30311     return(test_ret);
30312 }
30313
30314
30315 static int
30316 test_xmlAutomataSetFinalState(void) {
30317     int test_ret = 0;
30318
30319 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
30320     int mem_base;
30321     int ret_val;
30322     xmlAutomataPtr am; /* an automata */
30323     int n_am;
30324     xmlAutomataStatePtr state; /* a state in this automata */
30325     int n_state;
30326
30327     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
30328     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
30329         mem_base = xmlMemBlocks();
30330         am = gen_xmlAutomataPtr(n_am, 0);
30331         state = gen_xmlAutomataStatePtr(n_state, 1);
30332
30333         ret_val = xmlAutomataSetFinalState(am, state);
30334         desret_int(ret_val);
30335         call_tests++;
30336         des_xmlAutomataPtr(n_am, am, 0);
30337         des_xmlAutomataStatePtr(n_state, state, 1);
30338         xmlResetLastError();
30339         if (mem_base != xmlMemBlocks()) {
30340             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
30341                    xmlMemBlocks() - mem_base);
30342             test_ret++;
30343             printf(" %d", n_am);
30344             printf(" %d", n_state);
30345             printf("\n");
30346         }
30347     }
30348     }
30349     function_tests++;
30350 #endif
30351
30352     return(test_ret);
30353 }
30354
30355
30356 static int
30357 test_xmlNewAutomata(void) {
30358     int test_ret = 0;
30359
30360
30361     /* missing type support */
30362     return(test_ret);
30363 }
30364
30365 static int
30366 test_xmlautomata(void) {
30367     int test_ret = 0;
30368         int rc = 0;
30369
30370     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
30371     rc = test_xmlAutomataCompile();
30372         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30373     rc = test_xmlAutomataGetInitState();
30374         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30375     rc = test_xmlAutomataIsDeterminist();
30376         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30377     rc = test_xmlAutomataNewAllTrans();
30378         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30379     rc = test_xmlAutomataNewCountTrans();
30380         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30381     rc = test_xmlAutomataNewCountTrans2();
30382         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30383     rc = test_xmlAutomataNewCountedTrans();
30384         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30385     rc = test_xmlAutomataNewCounter();
30386         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30387     rc = test_xmlAutomataNewCounterTrans();
30388         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30389     rc = test_xmlAutomataNewEpsilon();
30390         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30391     rc = test_xmlAutomataNewNegTrans();
30392         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30393     rc = test_xmlAutomataNewOnceTrans();
30394         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30395     rc = test_xmlAutomataNewOnceTrans2();
30396         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30397     rc = test_xmlAutomataNewState();
30398         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30399     rc = test_xmlAutomataNewTransition();
30400         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30401     rc = test_xmlAutomataNewTransition2();
30402         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30403     rc = test_xmlAutomataSetFinalState();
30404         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30405     rc = test_xmlNewAutomata();
30406         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30407
30408     if (test_ret != 0)
30409         printf("Module xmlautomata: %d errors\n", test_ret);
30410     return(test_ret);
30411 }
30412
30413 #define gen_nb_xmlGenericErrorFunc_ptr 1
30414 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30415     return(NULL);
30416 }
30417 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30418 }
30419
30420 static int
30421 test_initGenericErrorDefaultFunc(void) {
30422     int test_ret = 0;
30423
30424     int mem_base;
30425     xmlGenericErrorFunc * handler; /* the handler */
30426     int n_handler;
30427
30428     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
30429         mem_base = xmlMemBlocks();
30430         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
30431
30432         initGenericErrorDefaultFunc(handler);
30433         call_tests++;
30434         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
30435         xmlResetLastError();
30436         if (mem_base != xmlMemBlocks()) {
30437             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
30438                    xmlMemBlocks() - mem_base);
30439             test_ret++;
30440             printf(" %d", n_handler);
30441             printf("\n");
30442         }
30443     }
30444     function_tests++;
30445
30446     return(test_ret);
30447 }
30448
30449
30450 #define gen_nb_xmlErrorPtr 1
30451 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30452     return(NULL);
30453 }
30454 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30455 }
30456
30457 static int
30458 test_xmlCopyError(void) {
30459     int test_ret = 0;
30460
30461     int mem_base;
30462     int ret_val;
30463     xmlErrorPtr from; /* a source error */
30464     int n_from;
30465     xmlErrorPtr to; /* a target error */
30466     int n_to;
30467
30468     for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
30469     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
30470         mem_base = xmlMemBlocks();
30471         from = gen_xmlErrorPtr(n_from, 0);
30472         to = gen_xmlErrorPtr(n_to, 1);
30473
30474         ret_val = xmlCopyError(from, to);
30475         desret_int(ret_val);
30476         call_tests++;
30477         des_xmlErrorPtr(n_from, from, 0);
30478         des_xmlErrorPtr(n_to, to, 1);
30479         xmlResetLastError();
30480         if (mem_base != xmlMemBlocks()) {
30481             printf("Leak of %d blocks found in xmlCopyError",
30482                    xmlMemBlocks() - mem_base);
30483             test_ret++;
30484             printf(" %d", n_from);
30485             printf(" %d", n_to);
30486             printf("\n");
30487         }
30488     }
30489     }
30490     function_tests++;
30491
30492     return(test_ret);
30493 }
30494
30495
30496 static int
30497 test_xmlCtxtGetLastError(void) {
30498     int test_ret = 0;
30499
30500
30501     /* missing type support */
30502     return(test_ret);
30503 }
30504
30505
30506 static int
30507 test_xmlCtxtResetLastError(void) {
30508     int test_ret = 0;
30509
30510     int mem_base;
30511     void * ctx; /* an XML parser context */
30512     int n_ctx;
30513
30514     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
30515         mem_base = xmlMemBlocks();
30516         ctx = gen_void_ptr(n_ctx, 0);
30517
30518         xmlCtxtResetLastError(ctx);
30519         call_tests++;
30520         des_void_ptr(n_ctx, ctx, 0);
30521         xmlResetLastError();
30522         if (mem_base != xmlMemBlocks()) {
30523             printf("Leak of %d blocks found in xmlCtxtResetLastError",
30524                    xmlMemBlocks() - mem_base);
30525             test_ret++;
30526             printf(" %d", n_ctx);
30527             printf("\n");
30528         }
30529     }
30530     function_tests++;
30531
30532     return(test_ret);
30533 }
30534
30535
30536 static int
30537 test_xmlGetLastError(void) {
30538     int test_ret = 0;
30539
30540
30541     /* missing type support */
30542     return(test_ret);
30543 }
30544
30545
30546 static int
30547 test_xmlParserError(void) {
30548     int test_ret = 0;
30549
30550
30551     /* missing type support */
30552     return(test_ret);
30553 }
30554
30555
30556 static int
30557 test_xmlParserPrintFileContext(void) {
30558     int test_ret = 0;
30559
30560     int mem_base;
30561     xmlParserInputPtr input; /* an xmlParserInputPtr input */
30562     int n_input;
30563
30564     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
30565         mem_base = xmlMemBlocks();
30566         input = gen_xmlParserInputPtr(n_input, 0);
30567
30568         xmlParserPrintFileContext(input);
30569         call_tests++;
30570         des_xmlParserInputPtr(n_input, input, 0);
30571         xmlResetLastError();
30572         if (mem_base != xmlMemBlocks()) {
30573             printf("Leak of %d blocks found in xmlParserPrintFileContext",
30574                    xmlMemBlocks() - mem_base);
30575             test_ret++;
30576             printf(" %d", n_input);
30577             printf("\n");
30578         }
30579     }
30580     function_tests++;
30581
30582     return(test_ret);
30583 }
30584
30585
30586 static int
30587 test_xmlParserPrintFileInfo(void) {
30588     int test_ret = 0;
30589
30590     int mem_base;
30591     xmlParserInputPtr input; /* an xmlParserInputPtr input */
30592     int n_input;
30593
30594     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
30595         mem_base = xmlMemBlocks();
30596         input = gen_xmlParserInputPtr(n_input, 0);
30597
30598         xmlParserPrintFileInfo(input);
30599         call_tests++;
30600         des_xmlParserInputPtr(n_input, input, 0);
30601         xmlResetLastError();
30602         if (mem_base != xmlMemBlocks()) {
30603             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
30604                    xmlMemBlocks() - mem_base);
30605             test_ret++;
30606             printf(" %d", n_input);
30607             printf("\n");
30608         }
30609     }
30610     function_tests++;
30611
30612     return(test_ret);
30613 }
30614
30615
30616 static int
30617 test_xmlParserValidityError(void) {
30618     int test_ret = 0;
30619
30620
30621     /* missing type support */
30622     return(test_ret);
30623 }
30624
30625
30626 static int
30627 test_xmlParserValidityWarning(void) {
30628     int test_ret = 0;
30629
30630
30631     /* missing type support */
30632     return(test_ret);
30633 }
30634
30635
30636 static int
30637 test_xmlParserWarning(void) {
30638     int test_ret = 0;
30639
30640
30641     /* missing type support */
30642     return(test_ret);
30643 }
30644
30645
30646 static int
30647 test_xmlResetError(void) {
30648     int test_ret = 0;
30649
30650     int mem_base;
30651     xmlErrorPtr err; /* pointer to the error. */
30652     int n_err;
30653
30654     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
30655         mem_base = xmlMemBlocks();
30656         err = gen_xmlErrorPtr(n_err, 0);
30657
30658         xmlResetError(err);
30659         call_tests++;
30660         des_xmlErrorPtr(n_err, err, 0);
30661         xmlResetLastError();
30662         if (mem_base != xmlMemBlocks()) {
30663             printf("Leak of %d blocks found in xmlResetError",
30664                    xmlMemBlocks() - mem_base);
30665             test_ret++;
30666             printf(" %d", n_err);
30667             printf("\n");
30668         }
30669     }
30670     function_tests++;
30671
30672     return(test_ret);
30673 }
30674
30675
30676 static int
30677 test_xmlResetLastError(void) {
30678     int test_ret = 0;
30679
30680
30681
30682         xmlResetLastError();
30683         call_tests++;
30684         xmlResetLastError();
30685     function_tests++;
30686
30687     return(test_ret);
30688 }
30689
30690
30691 static int
30692 test_xmlSetGenericErrorFunc(void) {
30693     int test_ret = 0;
30694
30695
30696     /* missing type support */
30697     return(test_ret);
30698 }
30699
30700
30701 static int
30702 test_xmlSetStructuredErrorFunc(void) {
30703     int test_ret = 0;
30704
30705
30706     /* missing type support */
30707     return(test_ret);
30708 }
30709
30710 static int
30711 test_xmlerror(void) {
30712     int test_ret = 0;
30713         int rc = 0;
30714
30715     if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
30716     rc = test_initGenericErrorDefaultFunc();
30717         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30718     rc = test_xmlCopyError();
30719         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30720     rc = test_xmlCtxtGetLastError();
30721         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30722     rc = test_xmlCtxtResetLastError();
30723         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30724     rc = test_xmlGetLastError();
30725         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30726     rc = test_xmlParserError();
30727         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30728     rc = test_xmlParserPrintFileContext();
30729         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30730     rc = test_xmlParserPrintFileInfo();
30731         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30732     rc = test_xmlParserValidityError();
30733         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30734     rc = test_xmlParserValidityWarning();
30735         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30736     rc = test_xmlParserWarning();
30737         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30738     rc = test_xmlResetError();
30739         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30740     rc = test_xmlResetLastError();
30741         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30742     rc = test_xmlSetGenericErrorFunc();
30743         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30744     rc = test_xmlSetStructuredErrorFunc();
30745         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30746
30747     if (test_ret != 0)
30748         printf("Module xmlerror: %d errors\n", test_ret);
30749     return(test_ret);
30750 }
30751 #ifdef LIBXML_MODULES_ENABLED
30752
30753 #define gen_nb_xmlModulePtr 1
30754 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30755     return(NULL);
30756 }
30757 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30758 }
30759 #endif
30760
30761
30762 static int
30763 test_xmlModuleClose(void) {
30764     int test_ret = 0;
30765
30766 #if defined(LIBXML_MODULES_ENABLED)
30767     int mem_base;
30768     int ret_val;
30769     xmlModulePtr module; /* the module handle */
30770     int n_module;
30771
30772     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30773         mem_base = xmlMemBlocks();
30774         module = gen_xmlModulePtr(n_module, 0);
30775
30776         ret_val = xmlModuleClose(module);
30777         desret_int(ret_val);
30778         call_tests++;
30779         des_xmlModulePtr(n_module, module, 0);
30780         xmlResetLastError();
30781         if (mem_base != xmlMemBlocks()) {
30782             printf("Leak of %d blocks found in xmlModuleClose",
30783                    xmlMemBlocks() - mem_base);
30784             test_ret++;
30785             printf(" %d", n_module);
30786             printf("\n");
30787         }
30788     }
30789     function_tests++;
30790 #endif
30791
30792     return(test_ret);
30793 }
30794
30795
30796 static int
30797 test_xmlModuleOpen(void) {
30798     int test_ret = 0;
30799
30800
30801     /* missing type support */
30802     return(test_ret);
30803 }
30804
30805
30806 static int
30807 test_xmlModuleSymbol(void) {
30808     int test_ret = 0;
30809
30810 #if defined(LIBXML_MODULES_ENABLED)
30811     int mem_base;
30812     int ret_val;
30813     xmlModulePtr module; /* the module */
30814     int n_module;
30815     char * name; /* the name of the symbol */
30816     int n_name;
30817     void ** symbol; /* the resulting symbol address */
30818     int n_symbol;
30819
30820     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
30821     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
30822     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
30823         mem_base = xmlMemBlocks();
30824         module = gen_xmlModulePtr(n_module, 0);
30825         name = gen_const_char_ptr(n_name, 1);
30826         symbol = gen_void_ptr_ptr(n_symbol, 2);
30827
30828         ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
30829         desret_int(ret_val);
30830         call_tests++;
30831         des_xmlModulePtr(n_module, module, 0);
30832         des_const_char_ptr(n_name, (const char *)name, 1);
30833         des_void_ptr_ptr(n_symbol, symbol, 2);
30834         xmlResetLastError();
30835         if (mem_base != xmlMemBlocks()) {
30836             printf("Leak of %d blocks found in xmlModuleSymbol",
30837                    xmlMemBlocks() - mem_base);
30838             test_ret++;
30839             printf(" %d", n_module);
30840             printf(" %d", n_name);
30841             printf(" %d", n_symbol);
30842             printf("\n");
30843         }
30844     }
30845     }
30846     }
30847     function_tests++;
30848 #endif
30849
30850     return(test_ret);
30851 }
30852
30853 static int
30854 test_xmlmodule(void) {
30855     int test_ret = 0;
30856         int rc = 0;
30857
30858     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
30859     rc = test_xmlModuleClose();
30860         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30861     rc = test_xmlModuleOpen();
30862         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30863     rc = test_xmlModuleSymbol();
30864         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
30865
30866     if (test_ret != 0)
30867         printf("Module xmlmodule: %d errors\n", test_ret);
30868     return(test_ret);
30869 }
30870
30871 static int
30872 test_xmlNewTextReader(void) {
30873     int test_ret = 0;
30874
30875 #if defined(LIBXML_READER_ENABLED)
30876     int mem_base;
30877     xmlTextReaderPtr ret_val;
30878     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
30879     int n_input;
30880     const char * URI; /* the URI information for the source if available */
30881     int n_URI;
30882
30883     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
30884     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30885         mem_base = xmlMemBlocks();
30886         input = gen_xmlParserInputBufferPtr(n_input, 0);
30887         URI = gen_filepath(n_URI, 1);
30888
30889         ret_val = xmlNewTextReader(input, URI);
30890         desret_xmlTextReaderPtr(ret_val);
30891         call_tests++;
30892         des_xmlParserInputBufferPtr(n_input, input, 0);
30893         des_filepath(n_URI, URI, 1);
30894         xmlResetLastError();
30895         if (mem_base != xmlMemBlocks()) {
30896             printf("Leak of %d blocks found in xmlNewTextReader",
30897                    xmlMemBlocks() - mem_base);
30898             test_ret++;
30899             printf(" %d", n_input);
30900             printf(" %d", n_URI);
30901             printf("\n");
30902         }
30903     }
30904     }
30905     function_tests++;
30906 #endif
30907
30908     return(test_ret);
30909 }
30910
30911
30912 static int
30913 test_xmlNewTextReaderFilename(void) {
30914     int test_ret = 0;
30915
30916 #if defined(LIBXML_READER_ENABLED)
30917     int mem_base;
30918     xmlTextReaderPtr ret_val;
30919     const char * URI; /* the URI of the resource to process */
30920     int n_URI;
30921
30922     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
30923         mem_base = xmlMemBlocks();
30924         URI = gen_filepath(n_URI, 0);
30925
30926         ret_val = xmlNewTextReaderFilename(URI);
30927         desret_xmlTextReaderPtr(ret_val);
30928         call_tests++;
30929         des_filepath(n_URI, URI, 0);
30930         xmlResetLastError();
30931         if (mem_base != xmlMemBlocks()) {
30932             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
30933                    xmlMemBlocks() - mem_base);
30934             test_ret++;
30935             printf(" %d", n_URI);
30936             printf("\n");
30937         }
30938     }
30939     function_tests++;
30940 #endif
30941
30942     return(test_ret);
30943 }
30944
30945
30946 static int
30947 test_xmlReaderForDoc(void) {
30948     int test_ret = 0;
30949
30950 #if defined(LIBXML_READER_ENABLED)
30951     int mem_base;
30952     xmlTextReaderPtr ret_val;
30953     xmlChar * cur; /* a pointer to a zero terminated string */
30954     int n_cur;
30955     const char * URL; /* the base URL to use for the document */
30956     int n_URL;
30957     char * encoding; /* the document encoding, or NULL */
30958     int n_encoding;
30959     int options; /* a combination of xmlParserOption */
30960     int n_options;
30961
30962     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30963     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30964     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30965     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30966         mem_base = xmlMemBlocks();
30967         cur = gen_const_xmlChar_ptr(n_cur, 0);
30968         URL = gen_filepath(n_URL, 1);
30969         encoding = gen_const_char_ptr(n_encoding, 2);
30970         options = gen_parseroptions(n_options, 3);
30971
30972         ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
30973         desret_xmlTextReaderPtr(ret_val);
30974         call_tests++;
30975         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
30976         des_filepath(n_URL, URL, 1);
30977         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30978         des_parseroptions(n_options, options, 3);
30979         xmlResetLastError();
30980         if (mem_base != xmlMemBlocks()) {
30981             printf("Leak of %d blocks found in xmlReaderForDoc",
30982                    xmlMemBlocks() - mem_base);
30983             test_ret++;
30984             printf(" %d", n_cur);
30985             printf(" %d", n_URL);
30986             printf(" %d", n_encoding);
30987             printf(" %d", n_options);
30988             printf("\n");
30989         }
30990     }
30991     }
30992     }
30993     }
30994     function_tests++;
30995 #endif
30996
30997     return(test_ret);
30998 }
30999
31000
31001 static int
31002 test_xmlReaderForFile(void) {
31003     int test_ret = 0;
31004
31005 #if defined(LIBXML_READER_ENABLED)
31006     int mem_base;
31007     xmlTextReaderPtr ret_val;
31008     const char * filename; /* a file or URL */
31009     int n_filename;
31010     char * encoding; /* the document encoding, or NULL */
31011     int n_encoding;
31012     int options; /* a combination of xmlParserOption */
31013     int n_options;
31014
31015     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
31016     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
31017     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
31018         mem_base = xmlMemBlocks();
31019         filename = gen_filepath(n_filename, 0);
31020         encoding = gen_const_char_ptr(n_encoding, 1);
31021         options = gen_parseroptions(n_options, 2);
31022
31023         ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
31024         desret_xmlTextReaderPtr(ret_val);
31025         call_tests++;
31026         des_filepath(n_filename, filename, 0);
31027         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
31028         des_parseroptions(n_options, options, 2);
31029         xmlResetLastError();
31030         if (mem_base != xmlMemBlocks()) {
31031             printf("Leak of %d blocks found in xmlReaderForFile",
31032                    xmlMemBlocks() - mem_base);
31033             test_ret++;
31034             printf(" %d", n_filename);
31035             printf(" %d", n_encoding);
31036             printf(" %d", n_options);
31037             printf("\n");
31038         }
31039     }
31040     }
31041     }
31042     function_tests++;
31043 #endif
31044
31045     return(test_ret);
31046 }
31047
31048
31049 static int
31050 test_xmlReaderForMemory(void) {
31051     int test_ret = 0;
31052
31053 #if defined(LIBXML_READER_ENABLED)
31054     int mem_base;
31055     xmlTextReaderPtr ret_val;
31056     char * buffer; /* a pointer to a char array */
31057     int n_buffer;
31058     int size; /* the size of the array */
31059     int n_size;
31060     const char * URL; /* the base URL to use for the document */
31061     int n_URL;
31062     char * encoding; /* the document encoding, or NULL */
31063     int n_encoding;
31064     int options; /* a combination of xmlParserOption */
31065     int n_options;
31066
31067     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
31068     for (n_size = 0;n_size < gen_nb_int;n_size++) {
31069     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
31070     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
31071     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
31072         mem_base = xmlMemBlocks();
31073         buffer = gen_const_char_ptr(n_buffer, 0);
31074         size = gen_int(n_size, 1);
31075         URL = gen_filepath(n_URL, 2);
31076         encoding = gen_const_char_ptr(n_encoding, 3);
31077         options = gen_parseroptions(n_options, 4);
31078         if ((buffer != NULL) &&
31079             (size > (int) strlen((const char *) buffer) + 1))
31080             continue;
31081
31082         ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
31083         desret_xmlTextReaderPtr(ret_val);
31084         call_tests++;
31085         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
31086         des_int(n_size, size, 1);
31087         des_filepath(n_URL, URL, 2);
31088         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
31089         des_parseroptions(n_options, options, 4);
31090         xmlResetLastError();
31091         if (mem_base != xmlMemBlocks()) {
31092             printf("Leak of %d blocks found in xmlReaderForMemory",
31093                    xmlMemBlocks() - mem_base);
31094             test_ret++;
31095             printf(" %d", n_buffer);
31096             printf(" %d", n_size);
31097             printf(" %d", n_URL);
31098             printf(" %d", n_encoding);
31099             printf(" %d", n_options);
31100             printf("\n");
31101         }
31102     }
31103     }
31104     }
31105     }
31106     }
31107     function_tests++;
31108 #endif
31109
31110     return(test_ret);
31111 }
31112
31113
31114 static int
31115 test_xmlReaderNewDoc(void) {
31116     int test_ret = 0;
31117
31118 #if defined(LIBXML_READER_ENABLED)
31119     int mem_base;
31120     int ret_val;
31121     xmlTextReaderPtr reader; /* an XML reader */
31122     int n_reader;
31123     xmlChar * cur; /* a pointer to a zero terminated string */
31124     int n_cur;
31125     const char * URL; /* the base URL to use for the document */
31126     int n_URL;
31127     char * encoding; /* the document encoding, or NULL */
31128     int n_encoding;
31129     int options; /* a combination of xmlParserOption */
31130     int n_options;
31131
31132     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31133     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
31134     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
31135     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
31136     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
31137         mem_base = xmlMemBlocks();
31138         reader = gen_xmlTextReaderPtr(n_reader, 0);
31139         cur = gen_const_xmlChar_ptr(n_cur, 1);
31140         URL = gen_filepath(n_URL, 2);
31141         encoding = gen_const_char_ptr(n_encoding, 3);
31142         options = gen_parseroptions(n_options, 4);
31143
31144         ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
31145         desret_int(ret_val);
31146         call_tests++;
31147         des_xmlTextReaderPtr(n_reader, reader, 0);
31148         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
31149         des_filepath(n_URL, URL, 2);
31150         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
31151         des_parseroptions(n_options, options, 4);
31152         xmlResetLastError();
31153         if (mem_base != xmlMemBlocks()) {
31154             printf("Leak of %d blocks found in xmlReaderNewDoc",
31155                    xmlMemBlocks() - mem_base);
31156             test_ret++;
31157             printf(" %d", n_reader);
31158             printf(" %d", n_cur);
31159             printf(" %d", n_URL);
31160             printf(" %d", n_encoding);
31161             printf(" %d", n_options);
31162             printf("\n");
31163         }
31164     }
31165     }
31166     }
31167     }
31168     }
31169     function_tests++;
31170 #endif
31171
31172     return(test_ret);
31173 }
31174
31175
31176 static int
31177 test_xmlReaderNewFile(void) {
31178     int test_ret = 0;
31179
31180 #if defined(LIBXML_READER_ENABLED)
31181     int mem_base;
31182     int ret_val;
31183     xmlTextReaderPtr reader; /* an XML reader */
31184     int n_reader;
31185     const char * filename; /* a file or URL */
31186     int n_filename;
31187     char * encoding; /* the document encoding, or NULL */
31188     int n_encoding;
31189     int options; /* a combination of xmlParserOption */
31190     int n_options;
31191
31192     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31193     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
31194     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
31195     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
31196         mem_base = xmlMemBlocks();
31197         reader = gen_xmlTextReaderPtr(n_reader, 0);
31198         filename = gen_filepath(n_filename, 1);
31199         encoding = gen_const_char_ptr(n_encoding, 2);
31200         options = gen_parseroptions(n_options, 3);
31201
31202         ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
31203         desret_int(ret_val);
31204         call_tests++;
31205         des_xmlTextReaderPtr(n_reader, reader, 0);
31206         des_filepath(n_filename, filename, 1);
31207         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
31208         des_parseroptions(n_options, options, 3);
31209         xmlResetLastError();
31210         if (mem_base != xmlMemBlocks()) {
31211             printf("Leak of %d blocks found in xmlReaderNewFile",
31212                    xmlMemBlocks() - mem_base);
31213             test_ret++;
31214             printf(" %d", n_reader);
31215             printf(" %d", n_filename);
31216             printf(" %d", n_encoding);
31217             printf(" %d", n_options);
31218             printf("\n");
31219         }
31220     }
31221     }
31222     }
31223     }
31224     function_tests++;
31225 #endif
31226
31227     return(test_ret);
31228 }
31229
31230
31231 static int
31232 test_xmlReaderNewMemory(void) {
31233     int test_ret = 0;
31234
31235 #if defined(LIBXML_READER_ENABLED)
31236     int mem_base;
31237     int ret_val;
31238     xmlTextReaderPtr reader; /* an XML reader */
31239     int n_reader;
31240     char * buffer; /* a pointer to a char array */
31241     int n_buffer;
31242     int size; /* the size of the array */
31243     int n_size;
31244     const char * URL; /* the base URL to use for the document */
31245     int n_URL;
31246     char * encoding; /* the document encoding, or NULL */
31247     int n_encoding;
31248     int options; /* a combination of xmlParserOption */
31249     int n_options;
31250
31251     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31252     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
31253     for (n_size = 0;n_size < gen_nb_int;n_size++) {
31254     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
31255     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
31256     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
31257         mem_base = xmlMemBlocks();
31258         reader = gen_xmlTextReaderPtr(n_reader, 0);
31259         buffer = gen_const_char_ptr(n_buffer, 1);
31260         size = gen_int(n_size, 2);
31261         URL = gen_filepath(n_URL, 3);
31262         encoding = gen_const_char_ptr(n_encoding, 4);
31263         options = gen_parseroptions(n_options, 5);
31264         if ((buffer != NULL) &&
31265             (size > (int) strlen((const char *) buffer) + 1))
31266             continue;
31267
31268         ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
31269         desret_int(ret_val);
31270         call_tests++;
31271         des_xmlTextReaderPtr(n_reader, reader, 0);
31272         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
31273         des_int(n_size, size, 2);
31274         des_filepath(n_URL, URL, 3);
31275         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
31276         des_parseroptions(n_options, options, 5);
31277         xmlResetLastError();
31278         if (mem_base != xmlMemBlocks()) {
31279             printf("Leak of %d blocks found in xmlReaderNewMemory",
31280                    xmlMemBlocks() - mem_base);
31281             test_ret++;
31282             printf(" %d", n_reader);
31283             printf(" %d", n_buffer);
31284             printf(" %d", n_size);
31285             printf(" %d", n_URL);
31286             printf(" %d", n_encoding);
31287             printf(" %d", n_options);
31288             printf("\n");
31289         }
31290     }
31291     }
31292     }
31293     }
31294     }
31295     }
31296     function_tests++;
31297 #endif
31298
31299     return(test_ret);
31300 }
31301
31302
31303 static int
31304 test_xmlReaderNewWalker(void) {
31305     int test_ret = 0;
31306
31307 #if defined(LIBXML_READER_ENABLED)
31308     int mem_base;
31309     int ret_val;
31310     xmlTextReaderPtr reader; /* an XML reader */
31311     int n_reader;
31312     xmlDocPtr doc; /* a preparsed document */
31313     int n_doc;
31314
31315     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31316     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31317         mem_base = xmlMemBlocks();
31318         reader = gen_xmlTextReaderPtr(n_reader, 0);
31319         doc = gen_xmlDocPtr(n_doc, 1);
31320
31321         ret_val = xmlReaderNewWalker(reader, doc);
31322         desret_int(ret_val);
31323         call_tests++;
31324         des_xmlTextReaderPtr(n_reader, reader, 0);
31325         des_xmlDocPtr(n_doc, doc, 1);
31326         xmlResetLastError();
31327         if (mem_base != xmlMemBlocks()) {
31328             printf("Leak of %d blocks found in xmlReaderNewWalker",
31329                    xmlMemBlocks() - mem_base);
31330             test_ret++;
31331             printf(" %d", n_reader);
31332             printf(" %d", n_doc);
31333             printf("\n");
31334         }
31335     }
31336     }
31337     function_tests++;
31338 #endif
31339
31340     return(test_ret);
31341 }
31342
31343
31344 static int
31345 test_xmlReaderWalker(void) {
31346     int test_ret = 0;
31347
31348 #if defined(LIBXML_READER_ENABLED)
31349     int mem_base;
31350     xmlTextReaderPtr ret_val;
31351     xmlDocPtr doc; /* a preparsed document */
31352     int n_doc;
31353
31354     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31355         mem_base = xmlMemBlocks();
31356         doc = gen_xmlDocPtr(n_doc, 0);
31357
31358         ret_val = xmlReaderWalker(doc);
31359         desret_xmlTextReaderPtr(ret_val);
31360         call_tests++;
31361         des_xmlDocPtr(n_doc, doc, 0);
31362         xmlResetLastError();
31363         if (mem_base != xmlMemBlocks()) {
31364             printf("Leak of %d blocks found in xmlReaderWalker",
31365                    xmlMemBlocks() - mem_base);
31366             test_ret++;
31367             printf(" %d", n_doc);
31368             printf("\n");
31369         }
31370     }
31371     function_tests++;
31372 #endif
31373
31374     return(test_ret);
31375 }
31376
31377
31378 static int
31379 test_xmlTextReaderAttributeCount(void) {
31380     int test_ret = 0;
31381
31382 #if defined(LIBXML_READER_ENABLED)
31383     int mem_base;
31384     int ret_val;
31385     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31386     int n_reader;
31387
31388     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31389         mem_base = xmlMemBlocks();
31390         reader = gen_xmlTextReaderPtr(n_reader, 0);
31391
31392         ret_val = xmlTextReaderAttributeCount(reader);
31393         desret_int(ret_val);
31394         call_tests++;
31395         des_xmlTextReaderPtr(n_reader, reader, 0);
31396         xmlResetLastError();
31397         if (mem_base != xmlMemBlocks()) {
31398             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
31399                    xmlMemBlocks() - mem_base);
31400             test_ret++;
31401             printf(" %d", n_reader);
31402             printf("\n");
31403         }
31404     }
31405     function_tests++;
31406 #endif
31407
31408     return(test_ret);
31409 }
31410
31411
31412 static int
31413 test_xmlTextReaderBaseUri(void) {
31414     int test_ret = 0;
31415
31416 #if defined(LIBXML_READER_ENABLED)
31417     int mem_base;
31418     xmlChar * ret_val;
31419     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31420     int n_reader;
31421
31422     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31423         mem_base = xmlMemBlocks();
31424         reader = gen_xmlTextReaderPtr(n_reader, 0);
31425
31426         ret_val = xmlTextReaderBaseUri(reader);
31427         desret_xmlChar_ptr(ret_val);
31428         call_tests++;
31429         des_xmlTextReaderPtr(n_reader, reader, 0);
31430         xmlResetLastError();
31431         if (mem_base != xmlMemBlocks()) {
31432             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
31433                    xmlMemBlocks() - mem_base);
31434             test_ret++;
31435             printf(" %d", n_reader);
31436             printf("\n");
31437         }
31438     }
31439     function_tests++;
31440 #endif
31441
31442     return(test_ret);
31443 }
31444
31445
31446 static int
31447 test_xmlTextReaderByteConsumed(void) {
31448     int test_ret = 0;
31449
31450 #if defined(LIBXML_READER_ENABLED)
31451     int mem_base;
31452     long ret_val;
31453     xmlTextReaderPtr reader; /* an XML reader */
31454     int n_reader;
31455
31456     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31457         mem_base = xmlMemBlocks();
31458         reader = gen_xmlTextReaderPtr(n_reader, 0);
31459
31460         ret_val = xmlTextReaderByteConsumed(reader);
31461         desret_long(ret_val);
31462         call_tests++;
31463         des_xmlTextReaderPtr(n_reader, reader, 0);
31464         xmlResetLastError();
31465         if (mem_base != xmlMemBlocks()) {
31466             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
31467                    xmlMemBlocks() - mem_base);
31468             test_ret++;
31469             printf(" %d", n_reader);
31470             printf("\n");
31471         }
31472     }
31473     function_tests++;
31474 #endif
31475
31476     return(test_ret);
31477 }
31478
31479
31480 static int
31481 test_xmlTextReaderClose(void) {
31482     int test_ret = 0;
31483
31484 #if defined(LIBXML_READER_ENABLED)
31485     int mem_base;
31486     int ret_val;
31487     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31488     int n_reader;
31489
31490     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31491         mem_base = xmlMemBlocks();
31492         reader = gen_xmlTextReaderPtr(n_reader, 0);
31493
31494         ret_val = xmlTextReaderClose(reader);
31495         desret_int(ret_val);
31496         call_tests++;
31497         des_xmlTextReaderPtr(n_reader, reader, 0);
31498         xmlResetLastError();
31499         if (mem_base != xmlMemBlocks()) {
31500             printf("Leak of %d blocks found in xmlTextReaderClose",
31501                    xmlMemBlocks() - mem_base);
31502             test_ret++;
31503             printf(" %d", n_reader);
31504             printf("\n");
31505         }
31506     }
31507     function_tests++;
31508 #endif
31509
31510     return(test_ret);
31511 }
31512
31513
31514 static int
31515 test_xmlTextReaderConstBaseUri(void) {
31516     int test_ret = 0;
31517
31518 #if defined(LIBXML_READER_ENABLED)
31519     int mem_base;
31520     const xmlChar * ret_val;
31521     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31522     int n_reader;
31523
31524     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31525         mem_base = xmlMemBlocks();
31526         reader = gen_xmlTextReaderPtr(n_reader, 0);
31527
31528         ret_val = xmlTextReaderConstBaseUri(reader);
31529         desret_const_xmlChar_ptr(ret_val);
31530         call_tests++;
31531         des_xmlTextReaderPtr(n_reader, reader, 0);
31532         xmlResetLastError();
31533         if (mem_base != xmlMemBlocks()) {
31534             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
31535                    xmlMemBlocks() - mem_base);
31536             test_ret++;
31537             printf(" %d", n_reader);
31538             printf("\n");
31539         }
31540     }
31541     function_tests++;
31542 #endif
31543
31544     return(test_ret);
31545 }
31546
31547
31548 static int
31549 test_xmlTextReaderConstEncoding(void) {
31550     int test_ret = 0;
31551
31552 #if defined(LIBXML_READER_ENABLED)
31553     int mem_base;
31554     const xmlChar * ret_val;
31555     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31556     int n_reader;
31557
31558     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31559         mem_base = xmlMemBlocks();
31560         reader = gen_xmlTextReaderPtr(n_reader, 0);
31561
31562         ret_val = xmlTextReaderConstEncoding(reader);
31563         desret_const_xmlChar_ptr(ret_val);
31564         call_tests++;
31565         des_xmlTextReaderPtr(n_reader, reader, 0);
31566         xmlResetLastError();
31567         if (mem_base != xmlMemBlocks()) {
31568             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
31569                    xmlMemBlocks() - mem_base);
31570             test_ret++;
31571             printf(" %d", n_reader);
31572             printf("\n");
31573         }
31574     }
31575     function_tests++;
31576 #endif
31577
31578     return(test_ret);
31579 }
31580
31581
31582 static int
31583 test_xmlTextReaderConstLocalName(void) {
31584     int test_ret = 0;
31585
31586 #if defined(LIBXML_READER_ENABLED)
31587     int mem_base;
31588     const xmlChar * ret_val;
31589     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31590     int n_reader;
31591
31592     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31593         mem_base = xmlMemBlocks();
31594         reader = gen_xmlTextReaderPtr(n_reader, 0);
31595
31596         ret_val = xmlTextReaderConstLocalName(reader);
31597         desret_const_xmlChar_ptr(ret_val);
31598         call_tests++;
31599         des_xmlTextReaderPtr(n_reader, reader, 0);
31600         xmlResetLastError();
31601         if (mem_base != xmlMemBlocks()) {
31602             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
31603                    xmlMemBlocks() - mem_base);
31604             test_ret++;
31605             printf(" %d", n_reader);
31606             printf("\n");
31607         }
31608     }
31609     function_tests++;
31610 #endif
31611
31612     return(test_ret);
31613 }
31614
31615
31616 static int
31617 test_xmlTextReaderConstName(void) {
31618     int test_ret = 0;
31619
31620 #if defined(LIBXML_READER_ENABLED)
31621     int mem_base;
31622     const xmlChar * ret_val;
31623     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31624     int n_reader;
31625
31626     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31627         mem_base = xmlMemBlocks();
31628         reader = gen_xmlTextReaderPtr(n_reader, 0);
31629
31630         ret_val = xmlTextReaderConstName(reader);
31631         desret_const_xmlChar_ptr(ret_val);
31632         call_tests++;
31633         des_xmlTextReaderPtr(n_reader, reader, 0);
31634         xmlResetLastError();
31635         if (mem_base != xmlMemBlocks()) {
31636             printf("Leak of %d blocks found in xmlTextReaderConstName",
31637                    xmlMemBlocks() - mem_base);
31638             test_ret++;
31639             printf(" %d", n_reader);
31640             printf("\n");
31641         }
31642     }
31643     function_tests++;
31644 #endif
31645
31646     return(test_ret);
31647 }
31648
31649
31650 static int
31651 test_xmlTextReaderConstNamespaceUri(void) {
31652     int test_ret = 0;
31653
31654 #if defined(LIBXML_READER_ENABLED)
31655     int mem_base;
31656     const xmlChar * ret_val;
31657     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31658     int n_reader;
31659
31660     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31661         mem_base = xmlMemBlocks();
31662         reader = gen_xmlTextReaderPtr(n_reader, 0);
31663
31664         ret_val = xmlTextReaderConstNamespaceUri(reader);
31665         desret_const_xmlChar_ptr(ret_val);
31666         call_tests++;
31667         des_xmlTextReaderPtr(n_reader, reader, 0);
31668         xmlResetLastError();
31669         if (mem_base != xmlMemBlocks()) {
31670             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
31671                    xmlMemBlocks() - mem_base);
31672             test_ret++;
31673             printf(" %d", n_reader);
31674             printf("\n");
31675         }
31676     }
31677     function_tests++;
31678 #endif
31679
31680     return(test_ret);
31681 }
31682
31683
31684 static int
31685 test_xmlTextReaderConstPrefix(void) {
31686     int test_ret = 0;
31687
31688 #if defined(LIBXML_READER_ENABLED)
31689     int mem_base;
31690     const xmlChar * ret_val;
31691     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31692     int n_reader;
31693
31694     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31695         mem_base = xmlMemBlocks();
31696         reader = gen_xmlTextReaderPtr(n_reader, 0);
31697
31698         ret_val = xmlTextReaderConstPrefix(reader);
31699         desret_const_xmlChar_ptr(ret_val);
31700         call_tests++;
31701         des_xmlTextReaderPtr(n_reader, reader, 0);
31702         xmlResetLastError();
31703         if (mem_base != xmlMemBlocks()) {
31704             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
31705                    xmlMemBlocks() - mem_base);
31706             test_ret++;
31707             printf(" %d", n_reader);
31708             printf("\n");
31709         }
31710     }
31711     function_tests++;
31712 #endif
31713
31714     return(test_ret);
31715 }
31716
31717
31718 static int
31719 test_xmlTextReaderConstString(void) {
31720     int test_ret = 0;
31721
31722 #if defined(LIBXML_READER_ENABLED)
31723     int mem_base;
31724     const xmlChar * ret_val;
31725     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31726     int n_reader;
31727     xmlChar * str; /* the string to intern. */
31728     int n_str;
31729
31730     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31731     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
31732         mem_base = xmlMemBlocks();
31733         reader = gen_xmlTextReaderPtr(n_reader, 0);
31734         str = gen_const_xmlChar_ptr(n_str, 1);
31735
31736         ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
31737         desret_const_xmlChar_ptr(ret_val);
31738         call_tests++;
31739         des_xmlTextReaderPtr(n_reader, reader, 0);
31740         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
31741         xmlResetLastError();
31742         if (mem_base != xmlMemBlocks()) {
31743             printf("Leak of %d blocks found in xmlTextReaderConstString",
31744                    xmlMemBlocks() - mem_base);
31745             test_ret++;
31746             printf(" %d", n_reader);
31747             printf(" %d", n_str);
31748             printf("\n");
31749         }
31750     }
31751     }
31752     function_tests++;
31753 #endif
31754
31755     return(test_ret);
31756 }
31757
31758
31759 static int
31760 test_xmlTextReaderConstValue(void) {
31761     int test_ret = 0;
31762
31763 #if defined(LIBXML_READER_ENABLED)
31764     int mem_base;
31765     const xmlChar * ret_val;
31766     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31767     int n_reader;
31768
31769     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31770         mem_base = xmlMemBlocks();
31771         reader = gen_xmlTextReaderPtr(n_reader, 0);
31772
31773         ret_val = xmlTextReaderConstValue(reader);
31774         desret_const_xmlChar_ptr(ret_val);
31775         call_tests++;
31776         des_xmlTextReaderPtr(n_reader, reader, 0);
31777         xmlResetLastError();
31778         if (mem_base != xmlMemBlocks()) {
31779             printf("Leak of %d blocks found in xmlTextReaderConstValue",
31780                    xmlMemBlocks() - mem_base);
31781             test_ret++;
31782             printf(" %d", n_reader);
31783             printf("\n");
31784         }
31785     }
31786     function_tests++;
31787 #endif
31788
31789     return(test_ret);
31790 }
31791
31792
31793 static int
31794 test_xmlTextReaderConstXmlLang(void) {
31795     int test_ret = 0;
31796
31797 #if defined(LIBXML_READER_ENABLED)
31798     int mem_base;
31799     const xmlChar * ret_val;
31800     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31801     int n_reader;
31802
31803     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31804         mem_base = xmlMemBlocks();
31805         reader = gen_xmlTextReaderPtr(n_reader, 0);
31806
31807         ret_val = xmlTextReaderConstXmlLang(reader);
31808         desret_const_xmlChar_ptr(ret_val);
31809         call_tests++;
31810         des_xmlTextReaderPtr(n_reader, reader, 0);
31811         xmlResetLastError();
31812         if (mem_base != xmlMemBlocks()) {
31813             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
31814                    xmlMemBlocks() - mem_base);
31815             test_ret++;
31816             printf(" %d", n_reader);
31817             printf("\n");
31818         }
31819     }
31820     function_tests++;
31821 #endif
31822
31823     return(test_ret);
31824 }
31825
31826
31827 static int
31828 test_xmlTextReaderConstXmlVersion(void) {
31829     int test_ret = 0;
31830
31831 #if defined(LIBXML_READER_ENABLED)
31832     int mem_base;
31833     const xmlChar * ret_val;
31834     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31835     int n_reader;
31836
31837     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31838         mem_base = xmlMemBlocks();
31839         reader = gen_xmlTextReaderPtr(n_reader, 0);
31840
31841         ret_val = xmlTextReaderConstXmlVersion(reader);
31842         desret_const_xmlChar_ptr(ret_val);
31843         call_tests++;
31844         des_xmlTextReaderPtr(n_reader, reader, 0);
31845         xmlResetLastError();
31846         if (mem_base != xmlMemBlocks()) {
31847             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
31848                    xmlMemBlocks() - mem_base);
31849             test_ret++;
31850             printf(" %d", n_reader);
31851             printf("\n");
31852         }
31853     }
31854     function_tests++;
31855 #endif
31856
31857     return(test_ret);
31858 }
31859
31860
31861 static int
31862 test_xmlTextReaderCurrentDoc(void) {
31863     int test_ret = 0;
31864
31865 #if defined(LIBXML_READER_ENABLED)
31866     int mem_base;
31867     xmlDocPtr ret_val;
31868     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31869     int n_reader;
31870
31871     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31872         mem_base = xmlMemBlocks();
31873         reader = gen_xmlTextReaderPtr(n_reader, 0);
31874
31875         ret_val = xmlTextReaderCurrentDoc(reader);
31876         desret_xmlDocPtr(ret_val);
31877         call_tests++;
31878         des_xmlTextReaderPtr(n_reader, reader, 0);
31879         xmlResetLastError();
31880         if (mem_base != xmlMemBlocks()) {
31881             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
31882                    xmlMemBlocks() - mem_base);
31883             test_ret++;
31884             printf(" %d", n_reader);
31885             printf("\n");
31886         }
31887     }
31888     function_tests++;
31889 #endif
31890
31891     return(test_ret);
31892 }
31893
31894
31895 static int
31896 test_xmlTextReaderCurrentNode(void) {
31897     int test_ret = 0;
31898
31899 #if defined(LIBXML_READER_ENABLED)
31900     int mem_base;
31901     xmlNodePtr ret_val;
31902     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31903     int n_reader;
31904
31905     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31906         mem_base = xmlMemBlocks();
31907         reader = gen_xmlTextReaderPtr(n_reader, 0);
31908
31909         ret_val = xmlTextReaderCurrentNode(reader);
31910         desret_xmlNodePtr(ret_val);
31911         call_tests++;
31912         des_xmlTextReaderPtr(n_reader, reader, 0);
31913         xmlResetLastError();
31914         if (mem_base != xmlMemBlocks()) {
31915             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
31916                    xmlMemBlocks() - mem_base);
31917             test_ret++;
31918             printf(" %d", n_reader);
31919             printf("\n");
31920         }
31921     }
31922     function_tests++;
31923 #endif
31924
31925     return(test_ret);
31926 }
31927
31928
31929 static int
31930 test_xmlTextReaderDepth(void) {
31931     int test_ret = 0;
31932
31933 #if defined(LIBXML_READER_ENABLED)
31934     int mem_base;
31935     int ret_val;
31936     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31937     int n_reader;
31938
31939     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31940         mem_base = xmlMemBlocks();
31941         reader = gen_xmlTextReaderPtr(n_reader, 0);
31942
31943         ret_val = xmlTextReaderDepth(reader);
31944         desret_int(ret_val);
31945         call_tests++;
31946         des_xmlTextReaderPtr(n_reader, reader, 0);
31947         xmlResetLastError();
31948         if (mem_base != xmlMemBlocks()) {
31949             printf("Leak of %d blocks found in xmlTextReaderDepth",
31950                    xmlMemBlocks() - mem_base);
31951             test_ret++;
31952             printf(" %d", n_reader);
31953             printf("\n");
31954         }
31955     }
31956     function_tests++;
31957 #endif
31958
31959     return(test_ret);
31960 }
31961
31962
31963 static int
31964 test_xmlTextReaderExpand(void) {
31965     int test_ret = 0;
31966
31967 #if defined(LIBXML_READER_ENABLED)
31968     int mem_base;
31969     xmlNodePtr ret_val;
31970     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31971     int n_reader;
31972
31973     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31974         mem_base = xmlMemBlocks();
31975         reader = gen_xmlTextReaderPtr(n_reader, 0);
31976
31977         ret_val = xmlTextReaderExpand(reader);
31978         desret_xmlNodePtr(ret_val);
31979         call_tests++;
31980         des_xmlTextReaderPtr(n_reader, reader, 0);
31981         xmlResetLastError();
31982         if (mem_base != xmlMemBlocks()) {
31983             printf("Leak of %d blocks found in xmlTextReaderExpand",
31984                    xmlMemBlocks() - mem_base);
31985             test_ret++;
31986             printf(" %d", n_reader);
31987             printf("\n");
31988         }
31989     }
31990     function_tests++;
31991 #endif
31992
31993     return(test_ret);
31994 }
31995
31996
31997 static int
31998 test_xmlTextReaderGetAttribute(void) {
31999     int test_ret = 0;
32000
32001 #if defined(LIBXML_READER_ENABLED)
32002     int mem_base;
32003     xmlChar * ret_val;
32004     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32005     int n_reader;
32006     xmlChar * name; /* the qualified name of the attribute. */
32007     int n_name;
32008
32009     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32010     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
32011         mem_base = xmlMemBlocks();
32012         reader = gen_xmlTextReaderPtr(n_reader, 0);
32013         name = gen_const_xmlChar_ptr(n_name, 1);
32014
32015         ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
32016         desret_xmlChar_ptr(ret_val);
32017         call_tests++;
32018         des_xmlTextReaderPtr(n_reader, reader, 0);
32019         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
32020         xmlResetLastError();
32021         if (mem_base != xmlMemBlocks()) {
32022             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
32023                    xmlMemBlocks() - mem_base);
32024             test_ret++;
32025             printf(" %d", n_reader);
32026             printf(" %d", n_name);
32027             printf("\n");
32028         }
32029     }
32030     }
32031     function_tests++;
32032 #endif
32033
32034     return(test_ret);
32035 }
32036
32037
32038 static int
32039 test_xmlTextReaderGetAttributeNo(void) {
32040     int test_ret = 0;
32041
32042 #if defined(LIBXML_READER_ENABLED)
32043     int mem_base;
32044     xmlChar * ret_val;
32045     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32046     int n_reader;
32047     int no; /* the zero-based index of the attribute relative to the containing element */
32048     int n_no;
32049
32050     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32051     for (n_no = 0;n_no < gen_nb_int;n_no++) {
32052         mem_base = xmlMemBlocks();
32053         reader = gen_xmlTextReaderPtr(n_reader, 0);
32054         no = gen_int(n_no, 1);
32055
32056         ret_val = xmlTextReaderGetAttributeNo(reader, no);
32057         desret_xmlChar_ptr(ret_val);
32058         call_tests++;
32059         des_xmlTextReaderPtr(n_reader, reader, 0);
32060         des_int(n_no, no, 1);
32061         xmlResetLastError();
32062         if (mem_base != xmlMemBlocks()) {
32063             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
32064                    xmlMemBlocks() - mem_base);
32065             test_ret++;
32066             printf(" %d", n_reader);
32067             printf(" %d", n_no);
32068             printf("\n");
32069         }
32070     }
32071     }
32072     function_tests++;
32073 #endif
32074
32075     return(test_ret);
32076 }
32077
32078
32079 static int
32080 test_xmlTextReaderGetAttributeNs(void) {
32081     int test_ret = 0;
32082
32083 #if defined(LIBXML_READER_ENABLED)
32084     int mem_base;
32085     xmlChar * ret_val;
32086     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32087     int n_reader;
32088     xmlChar * localName; /* the local name of the attribute. */
32089     int n_localName;
32090     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
32091     int n_namespaceURI;
32092
32093     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32094     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
32095     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
32096         mem_base = xmlMemBlocks();
32097         reader = gen_xmlTextReaderPtr(n_reader, 0);
32098         localName = gen_const_xmlChar_ptr(n_localName, 1);
32099         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
32100
32101         ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
32102         desret_xmlChar_ptr(ret_val);
32103         call_tests++;
32104         des_xmlTextReaderPtr(n_reader, reader, 0);
32105         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
32106         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
32107         xmlResetLastError();
32108         if (mem_base != xmlMemBlocks()) {
32109             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
32110                    xmlMemBlocks() - mem_base);
32111             test_ret++;
32112             printf(" %d", n_reader);
32113             printf(" %d", n_localName);
32114             printf(" %d", n_namespaceURI);
32115             printf("\n");
32116         }
32117     }
32118     }
32119     }
32120     function_tests++;
32121 #endif
32122
32123     return(test_ret);
32124 }
32125
32126 #ifdef LIBXML_READER_ENABLED
32127
32128 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
32129 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32130     return(NULL);
32131 }
32132 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32133 }
32134 #endif
32135
32136
32137 static int
32138 test_xmlTextReaderGetErrorHandler(void) {
32139     int test_ret = 0;
32140
32141 #if defined(LIBXML_READER_ENABLED)
32142     int mem_base;
32143     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32144     int n_reader;
32145     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
32146     int n_f;
32147     void ** arg; /* a user argument */
32148     int n_arg;
32149
32150     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32151     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
32152     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
32153         mem_base = xmlMemBlocks();
32154         reader = gen_xmlTextReaderPtr(n_reader, 0);
32155         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
32156         arg = gen_void_ptr_ptr(n_arg, 2);
32157
32158         xmlTextReaderGetErrorHandler(reader, f, arg);
32159         call_tests++;
32160         des_xmlTextReaderPtr(n_reader, reader, 0);
32161         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
32162         des_void_ptr_ptr(n_arg, arg, 2);
32163         xmlResetLastError();
32164         if (mem_base != xmlMemBlocks()) {
32165             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
32166                    xmlMemBlocks() - mem_base);
32167             test_ret++;
32168             printf(" %d", n_reader);
32169             printf(" %d", n_f);
32170             printf(" %d", n_arg);
32171             printf("\n");
32172         }
32173     }
32174     }
32175     }
32176     function_tests++;
32177 #endif
32178
32179     return(test_ret);
32180 }
32181
32182
32183 static int
32184 test_xmlTextReaderGetParserColumnNumber(void) {
32185     int test_ret = 0;
32186
32187 #if defined(LIBXML_READER_ENABLED)
32188     int mem_base;
32189     int ret_val;
32190     xmlTextReaderPtr reader; /* the user data (XML reader context) */
32191     int n_reader;
32192
32193     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32194         mem_base = xmlMemBlocks();
32195         reader = gen_xmlTextReaderPtr(n_reader, 0);
32196
32197         ret_val = xmlTextReaderGetParserColumnNumber(reader);
32198         desret_int(ret_val);
32199         call_tests++;
32200         des_xmlTextReaderPtr(n_reader, reader, 0);
32201         xmlResetLastError();
32202         if (mem_base != xmlMemBlocks()) {
32203             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
32204                    xmlMemBlocks() - mem_base);
32205             test_ret++;
32206             printf(" %d", n_reader);
32207             printf("\n");
32208         }
32209     }
32210     function_tests++;
32211 #endif
32212
32213     return(test_ret);
32214 }
32215
32216
32217 static int
32218 test_xmlTextReaderGetParserLineNumber(void) {
32219     int test_ret = 0;
32220
32221 #if defined(LIBXML_READER_ENABLED)
32222     int mem_base;
32223     int ret_val;
32224     xmlTextReaderPtr reader; /* the user data (XML reader context) */
32225     int n_reader;
32226
32227     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32228         mem_base = xmlMemBlocks();
32229         reader = gen_xmlTextReaderPtr(n_reader, 0);
32230
32231         ret_val = xmlTextReaderGetParserLineNumber(reader);
32232         desret_int(ret_val);
32233         call_tests++;
32234         des_xmlTextReaderPtr(n_reader, reader, 0);
32235         xmlResetLastError();
32236         if (mem_base != xmlMemBlocks()) {
32237             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
32238                    xmlMemBlocks() - mem_base);
32239             test_ret++;
32240             printf(" %d", n_reader);
32241             printf("\n");
32242         }
32243     }
32244     function_tests++;
32245 #endif
32246
32247     return(test_ret);
32248 }
32249
32250
32251 static int
32252 test_xmlTextReaderGetParserProp(void) {
32253     int test_ret = 0;
32254
32255 #if defined(LIBXML_READER_ENABLED)
32256     int mem_base;
32257     int ret_val;
32258     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32259     int n_reader;
32260     int prop; /* the xmlParserProperties to get */
32261     int n_prop;
32262
32263     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32264     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32265         mem_base = xmlMemBlocks();
32266         reader = gen_xmlTextReaderPtr(n_reader, 0);
32267         prop = gen_int(n_prop, 1);
32268
32269         ret_val = xmlTextReaderGetParserProp(reader, prop);
32270         desret_int(ret_val);
32271         call_tests++;
32272         des_xmlTextReaderPtr(n_reader, reader, 0);
32273         des_int(n_prop, prop, 1);
32274         xmlResetLastError();
32275         if (mem_base != xmlMemBlocks()) {
32276             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
32277                    xmlMemBlocks() - mem_base);
32278             test_ret++;
32279             printf(" %d", n_reader);
32280             printf(" %d", n_prop);
32281             printf("\n");
32282         }
32283     }
32284     }
32285     function_tests++;
32286 #endif
32287
32288     return(test_ret);
32289 }
32290
32291
32292 static int
32293 test_xmlTextReaderGetRemainder(void) {
32294     int test_ret = 0;
32295
32296 #if defined(LIBXML_READER_ENABLED)
32297     int mem_base;
32298     xmlParserInputBufferPtr ret_val;
32299     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32300     int n_reader;
32301
32302     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32303         mem_base = xmlMemBlocks();
32304         reader = gen_xmlTextReaderPtr(n_reader, 0);
32305
32306         ret_val = xmlTextReaderGetRemainder(reader);
32307         desret_xmlParserInputBufferPtr(ret_val);
32308         call_tests++;
32309         des_xmlTextReaderPtr(n_reader, reader, 0);
32310         xmlResetLastError();
32311         if (mem_base != xmlMemBlocks()) {
32312             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
32313                    xmlMemBlocks() - mem_base);
32314             test_ret++;
32315             printf(" %d", n_reader);
32316             printf("\n");
32317         }
32318     }
32319     function_tests++;
32320 #endif
32321
32322     return(test_ret);
32323 }
32324
32325
32326 static int
32327 test_xmlTextReaderHasAttributes(void) {
32328     int test_ret = 0;
32329
32330 #if defined(LIBXML_READER_ENABLED)
32331     int mem_base;
32332     int ret_val;
32333     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32334     int n_reader;
32335
32336     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32337         mem_base = xmlMemBlocks();
32338         reader = gen_xmlTextReaderPtr(n_reader, 0);
32339
32340         ret_val = xmlTextReaderHasAttributes(reader);
32341         desret_int(ret_val);
32342         call_tests++;
32343         des_xmlTextReaderPtr(n_reader, reader, 0);
32344         xmlResetLastError();
32345         if (mem_base != xmlMemBlocks()) {
32346             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
32347                    xmlMemBlocks() - mem_base);
32348             test_ret++;
32349             printf(" %d", n_reader);
32350             printf("\n");
32351         }
32352     }
32353     function_tests++;
32354 #endif
32355
32356     return(test_ret);
32357 }
32358
32359
32360 static int
32361 test_xmlTextReaderHasValue(void) {
32362     int test_ret = 0;
32363
32364 #if defined(LIBXML_READER_ENABLED)
32365     int mem_base;
32366     int ret_val;
32367     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32368     int n_reader;
32369
32370     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32371         mem_base = xmlMemBlocks();
32372         reader = gen_xmlTextReaderPtr(n_reader, 0);
32373
32374         ret_val = xmlTextReaderHasValue(reader);
32375         desret_int(ret_val);
32376         call_tests++;
32377         des_xmlTextReaderPtr(n_reader, reader, 0);
32378         xmlResetLastError();
32379         if (mem_base != xmlMemBlocks()) {
32380             printf("Leak of %d blocks found in xmlTextReaderHasValue",
32381                    xmlMemBlocks() - mem_base);
32382             test_ret++;
32383             printf(" %d", n_reader);
32384             printf("\n");
32385         }
32386     }
32387     function_tests++;
32388 #endif
32389
32390     return(test_ret);
32391 }
32392
32393
32394 static int
32395 test_xmlTextReaderIsDefault(void) {
32396     int test_ret = 0;
32397
32398 #if defined(LIBXML_READER_ENABLED)
32399     int mem_base;
32400     int ret_val;
32401     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32402     int n_reader;
32403
32404     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32405         mem_base = xmlMemBlocks();
32406         reader = gen_xmlTextReaderPtr(n_reader, 0);
32407
32408         ret_val = xmlTextReaderIsDefault(reader);
32409         desret_int(ret_val);
32410         call_tests++;
32411         des_xmlTextReaderPtr(n_reader, reader, 0);
32412         xmlResetLastError();
32413         if (mem_base != xmlMemBlocks()) {
32414             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
32415                    xmlMemBlocks() - mem_base);
32416             test_ret++;
32417             printf(" %d", n_reader);
32418             printf("\n");
32419         }
32420     }
32421     function_tests++;
32422 #endif
32423
32424     return(test_ret);
32425 }
32426
32427
32428 static int
32429 test_xmlTextReaderIsEmptyElement(void) {
32430     int test_ret = 0;
32431
32432 #if defined(LIBXML_READER_ENABLED)
32433     int mem_base;
32434     int ret_val;
32435     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32436     int n_reader;
32437
32438     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32439         mem_base = xmlMemBlocks();
32440         reader = gen_xmlTextReaderPtr(n_reader, 0);
32441
32442         ret_val = xmlTextReaderIsEmptyElement(reader);
32443         desret_int(ret_val);
32444         call_tests++;
32445         des_xmlTextReaderPtr(n_reader, reader, 0);
32446         xmlResetLastError();
32447         if (mem_base != xmlMemBlocks()) {
32448             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
32449                    xmlMemBlocks() - mem_base);
32450             test_ret++;
32451             printf(" %d", n_reader);
32452             printf("\n");
32453         }
32454     }
32455     function_tests++;
32456 #endif
32457
32458     return(test_ret);
32459 }
32460
32461
32462 static int
32463 test_xmlTextReaderIsNamespaceDecl(void) {
32464     int test_ret = 0;
32465
32466 #if defined(LIBXML_READER_ENABLED)
32467     int mem_base;
32468     int ret_val;
32469     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32470     int n_reader;
32471
32472     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32473         mem_base = xmlMemBlocks();
32474         reader = gen_xmlTextReaderPtr(n_reader, 0);
32475
32476         ret_val = xmlTextReaderIsNamespaceDecl(reader);
32477         desret_int(ret_val);
32478         call_tests++;
32479         des_xmlTextReaderPtr(n_reader, reader, 0);
32480         xmlResetLastError();
32481         if (mem_base != xmlMemBlocks()) {
32482             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
32483                    xmlMemBlocks() - mem_base);
32484             test_ret++;
32485             printf(" %d", n_reader);
32486             printf("\n");
32487         }
32488     }
32489     function_tests++;
32490 #endif
32491
32492     return(test_ret);
32493 }
32494
32495
32496 static int
32497 test_xmlTextReaderIsValid(void) {
32498     int test_ret = 0;
32499
32500 #if defined(LIBXML_READER_ENABLED)
32501     int mem_base;
32502     int ret_val;
32503     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32504     int n_reader;
32505
32506     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32507         mem_base = xmlMemBlocks();
32508         reader = gen_xmlTextReaderPtr(n_reader, 0);
32509
32510         ret_val = xmlTextReaderIsValid(reader);
32511         desret_int(ret_val);
32512         call_tests++;
32513         des_xmlTextReaderPtr(n_reader, reader, 0);
32514         xmlResetLastError();
32515         if (mem_base != xmlMemBlocks()) {
32516             printf("Leak of %d blocks found in xmlTextReaderIsValid",
32517                    xmlMemBlocks() - mem_base);
32518             test_ret++;
32519             printf(" %d", n_reader);
32520             printf("\n");
32521         }
32522     }
32523     function_tests++;
32524 #endif
32525
32526     return(test_ret);
32527 }
32528
32529
32530 static int
32531 test_xmlTextReaderLocalName(void) {
32532     int test_ret = 0;
32533
32534 #if defined(LIBXML_READER_ENABLED)
32535     int mem_base;
32536     xmlChar * ret_val;
32537     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32538     int n_reader;
32539
32540     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32541         mem_base = xmlMemBlocks();
32542         reader = gen_xmlTextReaderPtr(n_reader, 0);
32543
32544         ret_val = xmlTextReaderLocalName(reader);
32545         desret_xmlChar_ptr(ret_val);
32546         call_tests++;
32547         des_xmlTextReaderPtr(n_reader, reader, 0);
32548         xmlResetLastError();
32549         if (mem_base != xmlMemBlocks()) {
32550             printf("Leak of %d blocks found in xmlTextReaderLocalName",
32551                    xmlMemBlocks() - mem_base);
32552             test_ret++;
32553             printf(" %d", n_reader);
32554             printf("\n");
32555         }
32556     }
32557     function_tests++;
32558 #endif
32559
32560     return(test_ret);
32561 }
32562
32563 #ifdef LIBXML_READER_ENABLED
32564
32565 #define gen_nb_xmlTextReaderLocatorPtr 1
32566 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32567     return(NULL);
32568 }
32569 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32570 }
32571 #endif
32572
32573
32574 static int
32575 test_xmlTextReaderLocatorBaseURI(void) {
32576     int test_ret = 0;
32577
32578 #if defined(LIBXML_READER_ENABLED)
32579     int mem_base;
32580     xmlChar * ret_val;
32581     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
32582     int n_locator;
32583
32584     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
32585         mem_base = xmlMemBlocks();
32586         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
32587
32588         ret_val = xmlTextReaderLocatorBaseURI(locator);
32589         desret_xmlChar_ptr(ret_val);
32590         call_tests++;
32591         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
32592         xmlResetLastError();
32593         if (mem_base != xmlMemBlocks()) {
32594             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
32595                    xmlMemBlocks() - mem_base);
32596             test_ret++;
32597             printf(" %d", n_locator);
32598             printf("\n");
32599         }
32600     }
32601     function_tests++;
32602 #endif
32603
32604     return(test_ret);
32605 }
32606
32607
32608 static int
32609 test_xmlTextReaderLocatorLineNumber(void) {
32610     int test_ret = 0;
32611
32612 #if defined(LIBXML_READER_ENABLED)
32613     int mem_base;
32614     int ret_val;
32615     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
32616     int n_locator;
32617
32618     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
32619         mem_base = xmlMemBlocks();
32620         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
32621
32622         ret_val = xmlTextReaderLocatorLineNumber(locator);
32623         desret_int(ret_val);
32624         call_tests++;
32625         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
32626         xmlResetLastError();
32627         if (mem_base != xmlMemBlocks()) {
32628             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
32629                    xmlMemBlocks() - mem_base);
32630             test_ret++;
32631             printf(" %d", n_locator);
32632             printf("\n");
32633         }
32634     }
32635     function_tests++;
32636 #endif
32637
32638     return(test_ret);
32639 }
32640
32641
32642 static int
32643 test_xmlTextReaderLookupNamespace(void) {
32644     int test_ret = 0;
32645
32646 #if defined(LIBXML_READER_ENABLED)
32647     int mem_base;
32648     xmlChar * ret_val;
32649     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32650     int n_reader;
32651     xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
32652     int n_prefix;
32653
32654     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32655     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
32656         mem_base = xmlMemBlocks();
32657         reader = gen_xmlTextReaderPtr(n_reader, 0);
32658         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
32659
32660         ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
32661         desret_xmlChar_ptr(ret_val);
32662         call_tests++;
32663         des_xmlTextReaderPtr(n_reader, reader, 0);
32664         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
32665         xmlResetLastError();
32666         if (mem_base != xmlMemBlocks()) {
32667             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
32668                    xmlMemBlocks() - mem_base);
32669             test_ret++;
32670             printf(" %d", n_reader);
32671             printf(" %d", n_prefix);
32672             printf("\n");
32673         }
32674     }
32675     }
32676     function_tests++;
32677 #endif
32678
32679     return(test_ret);
32680 }
32681
32682
32683 static int
32684 test_xmlTextReaderMoveToAttribute(void) {
32685     int test_ret = 0;
32686
32687 #if defined(LIBXML_READER_ENABLED)
32688     int mem_base;
32689     int ret_val;
32690     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32691     int n_reader;
32692     xmlChar * name; /* the qualified name of the attribute. */
32693     int n_name;
32694
32695     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32696     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
32697         mem_base = xmlMemBlocks();
32698         reader = gen_xmlTextReaderPtr(n_reader, 0);
32699         name = gen_const_xmlChar_ptr(n_name, 1);
32700
32701         ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
32702         desret_int(ret_val);
32703         call_tests++;
32704         des_xmlTextReaderPtr(n_reader, reader, 0);
32705         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
32706         xmlResetLastError();
32707         if (mem_base != xmlMemBlocks()) {
32708             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
32709                    xmlMemBlocks() - mem_base);
32710             test_ret++;
32711             printf(" %d", n_reader);
32712             printf(" %d", n_name);
32713             printf("\n");
32714         }
32715     }
32716     }
32717     function_tests++;
32718 #endif
32719
32720     return(test_ret);
32721 }
32722
32723
32724 static int
32725 test_xmlTextReaderMoveToAttributeNo(void) {
32726     int test_ret = 0;
32727
32728 #if defined(LIBXML_READER_ENABLED)
32729     int mem_base;
32730     int ret_val;
32731     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32732     int n_reader;
32733     int no; /* the zero-based index of the attribute relative to the containing element. */
32734     int n_no;
32735
32736     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32737     for (n_no = 0;n_no < gen_nb_int;n_no++) {
32738         mem_base = xmlMemBlocks();
32739         reader = gen_xmlTextReaderPtr(n_reader, 0);
32740         no = gen_int(n_no, 1);
32741
32742         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
32743         desret_int(ret_val);
32744         call_tests++;
32745         des_xmlTextReaderPtr(n_reader, reader, 0);
32746         des_int(n_no, no, 1);
32747         xmlResetLastError();
32748         if (mem_base != xmlMemBlocks()) {
32749             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
32750                    xmlMemBlocks() - mem_base);
32751             test_ret++;
32752             printf(" %d", n_reader);
32753             printf(" %d", n_no);
32754             printf("\n");
32755         }
32756     }
32757     }
32758     function_tests++;
32759 #endif
32760
32761     return(test_ret);
32762 }
32763
32764
32765 static int
32766 test_xmlTextReaderMoveToAttributeNs(void) {
32767     int test_ret = 0;
32768
32769 #if defined(LIBXML_READER_ENABLED)
32770     int mem_base;
32771     int ret_val;
32772     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32773     int n_reader;
32774     xmlChar * localName; /* the local name of the attribute. */
32775     int n_localName;
32776     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
32777     int n_namespaceURI;
32778
32779     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32780     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
32781     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
32782         mem_base = xmlMemBlocks();
32783         reader = gen_xmlTextReaderPtr(n_reader, 0);
32784         localName = gen_const_xmlChar_ptr(n_localName, 1);
32785         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
32786
32787         ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
32788         desret_int(ret_val);
32789         call_tests++;
32790         des_xmlTextReaderPtr(n_reader, reader, 0);
32791         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
32792         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
32793         xmlResetLastError();
32794         if (mem_base != xmlMemBlocks()) {
32795             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
32796                    xmlMemBlocks() - mem_base);
32797             test_ret++;
32798             printf(" %d", n_reader);
32799             printf(" %d", n_localName);
32800             printf(" %d", n_namespaceURI);
32801             printf("\n");
32802         }
32803     }
32804     }
32805     }
32806     function_tests++;
32807 #endif
32808
32809     return(test_ret);
32810 }
32811
32812
32813 static int
32814 test_xmlTextReaderMoveToElement(void) {
32815     int test_ret = 0;
32816
32817 #if defined(LIBXML_READER_ENABLED)
32818     int mem_base;
32819     int ret_val;
32820     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32821     int n_reader;
32822
32823     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32824         mem_base = xmlMemBlocks();
32825         reader = gen_xmlTextReaderPtr(n_reader, 0);
32826
32827         ret_val = xmlTextReaderMoveToElement(reader);
32828         desret_int(ret_val);
32829         call_tests++;
32830         des_xmlTextReaderPtr(n_reader, reader, 0);
32831         xmlResetLastError();
32832         if (mem_base != xmlMemBlocks()) {
32833             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
32834                    xmlMemBlocks() - mem_base);
32835             test_ret++;
32836             printf(" %d", n_reader);
32837             printf("\n");
32838         }
32839     }
32840     function_tests++;
32841 #endif
32842
32843     return(test_ret);
32844 }
32845
32846
32847 static int
32848 test_xmlTextReaderMoveToFirstAttribute(void) {
32849     int test_ret = 0;
32850
32851 #if defined(LIBXML_READER_ENABLED)
32852     int mem_base;
32853     int ret_val;
32854     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32855     int n_reader;
32856
32857     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32858         mem_base = xmlMemBlocks();
32859         reader = gen_xmlTextReaderPtr(n_reader, 0);
32860
32861         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
32862         desret_int(ret_val);
32863         call_tests++;
32864         des_xmlTextReaderPtr(n_reader, reader, 0);
32865         xmlResetLastError();
32866         if (mem_base != xmlMemBlocks()) {
32867             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
32868                    xmlMemBlocks() - mem_base);
32869             test_ret++;
32870             printf(" %d", n_reader);
32871             printf("\n");
32872         }
32873     }
32874     function_tests++;
32875 #endif
32876
32877     return(test_ret);
32878 }
32879
32880
32881 static int
32882 test_xmlTextReaderMoveToNextAttribute(void) {
32883     int test_ret = 0;
32884
32885 #if defined(LIBXML_READER_ENABLED)
32886     int mem_base;
32887     int ret_val;
32888     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32889     int n_reader;
32890
32891     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32892         mem_base = xmlMemBlocks();
32893         reader = gen_xmlTextReaderPtr(n_reader, 0);
32894
32895         ret_val = xmlTextReaderMoveToNextAttribute(reader);
32896         desret_int(ret_val);
32897         call_tests++;
32898         des_xmlTextReaderPtr(n_reader, reader, 0);
32899         xmlResetLastError();
32900         if (mem_base != xmlMemBlocks()) {
32901             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
32902                    xmlMemBlocks() - mem_base);
32903             test_ret++;
32904             printf(" %d", n_reader);
32905             printf("\n");
32906         }
32907     }
32908     function_tests++;
32909 #endif
32910
32911     return(test_ret);
32912 }
32913
32914
32915 static int
32916 test_xmlTextReaderName(void) {
32917     int test_ret = 0;
32918
32919 #if defined(LIBXML_READER_ENABLED)
32920     int mem_base;
32921     xmlChar * ret_val;
32922     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32923     int n_reader;
32924
32925     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32926         mem_base = xmlMemBlocks();
32927         reader = gen_xmlTextReaderPtr(n_reader, 0);
32928
32929         ret_val = xmlTextReaderName(reader);
32930         desret_xmlChar_ptr(ret_val);
32931         call_tests++;
32932         des_xmlTextReaderPtr(n_reader, reader, 0);
32933         xmlResetLastError();
32934         if (mem_base != xmlMemBlocks()) {
32935             printf("Leak of %d blocks found in xmlTextReaderName",
32936                    xmlMemBlocks() - mem_base);
32937             test_ret++;
32938             printf(" %d", n_reader);
32939             printf("\n");
32940         }
32941     }
32942     function_tests++;
32943 #endif
32944
32945     return(test_ret);
32946 }
32947
32948
32949 static int
32950 test_xmlTextReaderNamespaceUri(void) {
32951     int test_ret = 0;
32952
32953 #if defined(LIBXML_READER_ENABLED)
32954     int mem_base;
32955     xmlChar * ret_val;
32956     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32957     int n_reader;
32958
32959     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32960         mem_base = xmlMemBlocks();
32961         reader = gen_xmlTextReaderPtr(n_reader, 0);
32962
32963         ret_val = xmlTextReaderNamespaceUri(reader);
32964         desret_xmlChar_ptr(ret_val);
32965         call_tests++;
32966         des_xmlTextReaderPtr(n_reader, reader, 0);
32967         xmlResetLastError();
32968         if (mem_base != xmlMemBlocks()) {
32969             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
32970                    xmlMemBlocks() - mem_base);
32971             test_ret++;
32972             printf(" %d", n_reader);
32973             printf("\n");
32974         }
32975     }
32976     function_tests++;
32977 #endif
32978
32979     return(test_ret);
32980 }
32981
32982
32983 static int
32984 test_xmlTextReaderNext(void) {
32985     int test_ret = 0;
32986
32987 #if defined(LIBXML_READER_ENABLED)
32988     int mem_base;
32989     int ret_val;
32990     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32991     int n_reader;
32992
32993     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32994         mem_base = xmlMemBlocks();
32995         reader = gen_xmlTextReaderPtr(n_reader, 0);
32996
32997         ret_val = xmlTextReaderNext(reader);
32998         desret_int(ret_val);
32999         call_tests++;
33000         des_xmlTextReaderPtr(n_reader, reader, 0);
33001         xmlResetLastError();
33002         if (mem_base != xmlMemBlocks()) {
33003             printf("Leak of %d blocks found in xmlTextReaderNext",
33004                    xmlMemBlocks() - mem_base);
33005             test_ret++;
33006             printf(" %d", n_reader);
33007             printf("\n");
33008         }
33009     }
33010     function_tests++;
33011 #endif
33012
33013     return(test_ret);
33014 }
33015
33016
33017 static int
33018 test_xmlTextReaderNextSibling(void) {
33019     int test_ret = 0;
33020
33021 #if defined(LIBXML_READER_ENABLED)
33022     int mem_base;
33023     int ret_val;
33024     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33025     int n_reader;
33026
33027     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33028         mem_base = xmlMemBlocks();
33029         reader = gen_xmlTextReaderPtr(n_reader, 0);
33030
33031         ret_val = xmlTextReaderNextSibling(reader);
33032         desret_int(ret_val);
33033         call_tests++;
33034         des_xmlTextReaderPtr(n_reader, reader, 0);
33035         xmlResetLastError();
33036         if (mem_base != xmlMemBlocks()) {
33037             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
33038                    xmlMemBlocks() - mem_base);
33039             test_ret++;
33040             printf(" %d", n_reader);
33041             printf("\n");
33042         }
33043     }
33044     function_tests++;
33045 #endif
33046
33047     return(test_ret);
33048 }
33049
33050
33051 static int
33052 test_xmlTextReaderNodeType(void) {
33053     int test_ret = 0;
33054
33055 #if defined(LIBXML_READER_ENABLED)
33056     int mem_base;
33057     int ret_val;
33058     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33059     int n_reader;
33060
33061     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33062         mem_base = xmlMemBlocks();
33063         reader = gen_xmlTextReaderPtr(n_reader, 0);
33064
33065         ret_val = xmlTextReaderNodeType(reader);
33066         desret_int(ret_val);
33067         call_tests++;
33068         des_xmlTextReaderPtr(n_reader, reader, 0);
33069         xmlResetLastError();
33070         if (mem_base != xmlMemBlocks()) {
33071             printf("Leak of %d blocks found in xmlTextReaderNodeType",
33072                    xmlMemBlocks() - mem_base);
33073             test_ret++;
33074             printf(" %d", n_reader);
33075             printf("\n");
33076         }
33077     }
33078     function_tests++;
33079 #endif
33080
33081     return(test_ret);
33082 }
33083
33084
33085 static int
33086 test_xmlTextReaderNormalization(void) {
33087     int test_ret = 0;
33088
33089 #if defined(LIBXML_READER_ENABLED)
33090     int mem_base;
33091     int ret_val;
33092     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33093     int n_reader;
33094
33095     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33096         mem_base = xmlMemBlocks();
33097         reader = gen_xmlTextReaderPtr(n_reader, 0);
33098
33099         ret_val = xmlTextReaderNormalization(reader);
33100         desret_int(ret_val);
33101         call_tests++;
33102         des_xmlTextReaderPtr(n_reader, reader, 0);
33103         xmlResetLastError();
33104         if (mem_base != xmlMemBlocks()) {
33105             printf("Leak of %d blocks found in xmlTextReaderNormalization",
33106                    xmlMemBlocks() - mem_base);
33107             test_ret++;
33108             printf(" %d", n_reader);
33109             printf("\n");
33110         }
33111     }
33112     function_tests++;
33113 #endif
33114
33115     return(test_ret);
33116 }
33117
33118
33119 static int
33120 test_xmlTextReaderPrefix(void) {
33121     int test_ret = 0;
33122
33123 #if defined(LIBXML_READER_ENABLED)
33124     int mem_base;
33125     xmlChar * ret_val;
33126     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33127     int n_reader;
33128
33129     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33130         mem_base = xmlMemBlocks();
33131         reader = gen_xmlTextReaderPtr(n_reader, 0);
33132
33133         ret_val = xmlTextReaderPrefix(reader);
33134         desret_xmlChar_ptr(ret_val);
33135         call_tests++;
33136         des_xmlTextReaderPtr(n_reader, reader, 0);
33137         xmlResetLastError();
33138         if (mem_base != xmlMemBlocks()) {
33139             printf("Leak of %d blocks found in xmlTextReaderPrefix",
33140                    xmlMemBlocks() - mem_base);
33141             test_ret++;
33142             printf(" %d", n_reader);
33143             printf("\n");
33144         }
33145     }
33146     function_tests++;
33147 #endif
33148
33149     return(test_ret);
33150 }
33151
33152
33153 static int
33154 test_xmlTextReaderPreserve(void) {
33155     int test_ret = 0;
33156
33157 #if defined(LIBXML_READER_ENABLED)
33158     int mem_base;
33159     xmlNodePtr ret_val;
33160     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33161     int n_reader;
33162
33163     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33164         mem_base = xmlMemBlocks();
33165         reader = gen_xmlTextReaderPtr(n_reader, 0);
33166
33167         ret_val = xmlTextReaderPreserve(reader);
33168         desret_xmlNodePtr(ret_val);
33169         call_tests++;
33170         des_xmlTextReaderPtr(n_reader, reader, 0);
33171         xmlResetLastError();
33172         if (mem_base != xmlMemBlocks()) {
33173             printf("Leak of %d blocks found in xmlTextReaderPreserve",
33174                    xmlMemBlocks() - mem_base);
33175             test_ret++;
33176             printf(" %d", n_reader);
33177             printf("\n");
33178         }
33179     }
33180     function_tests++;
33181 #endif
33182
33183     return(test_ret);
33184 }
33185
33186
33187 static int
33188 test_xmlTextReaderPreservePattern(void) {
33189     int test_ret = 0;
33190
33191 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
33192 #ifdef LIBXML_PATTERN_ENABLED
33193     int mem_base;
33194     int ret_val;
33195     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33196     int n_reader;
33197     xmlChar * pattern; /* an XPath subset pattern */
33198     int n_pattern;
33199     xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
33200     int n_namespaces;
33201
33202     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33203     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
33204     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
33205         mem_base = xmlMemBlocks();
33206         reader = gen_xmlTextReaderPtr(n_reader, 0);
33207         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
33208         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
33209
33210         ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
33211         desret_int(ret_val);
33212         call_tests++;
33213         des_xmlTextReaderPtr(n_reader, reader, 0);
33214         des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
33215         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
33216         xmlResetLastError();
33217         if (mem_base != xmlMemBlocks()) {
33218             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
33219                    xmlMemBlocks() - mem_base);
33220             test_ret++;
33221             printf(" %d", n_reader);
33222             printf(" %d", n_pattern);
33223             printf(" %d", n_namespaces);
33224             printf("\n");
33225         }
33226     }
33227     }
33228     }
33229     function_tests++;
33230 #endif
33231 #endif
33232
33233     return(test_ret);
33234 }
33235
33236
33237 static int
33238 test_xmlTextReaderQuoteChar(void) {
33239     int test_ret = 0;
33240
33241 #if defined(LIBXML_READER_ENABLED)
33242     int mem_base;
33243     int ret_val;
33244     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33245     int n_reader;
33246
33247     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33248         mem_base = xmlMemBlocks();
33249         reader = gen_xmlTextReaderPtr(n_reader, 0);
33250
33251         ret_val = xmlTextReaderQuoteChar(reader);
33252         desret_int(ret_val);
33253         call_tests++;
33254         des_xmlTextReaderPtr(n_reader, reader, 0);
33255         xmlResetLastError();
33256         if (mem_base != xmlMemBlocks()) {
33257             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
33258                    xmlMemBlocks() - mem_base);
33259             test_ret++;
33260             printf(" %d", n_reader);
33261             printf("\n");
33262         }
33263     }
33264     function_tests++;
33265 #endif
33266
33267     return(test_ret);
33268 }
33269
33270
33271 static int
33272 test_xmlTextReaderRead(void) {
33273     int test_ret = 0;
33274
33275 #if defined(LIBXML_READER_ENABLED)
33276     int mem_base;
33277     int ret_val;
33278     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33279     int n_reader;
33280
33281     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33282         mem_base = xmlMemBlocks();
33283         reader = gen_xmlTextReaderPtr(n_reader, 0);
33284
33285         ret_val = xmlTextReaderRead(reader);
33286         desret_int(ret_val);
33287         call_tests++;
33288         des_xmlTextReaderPtr(n_reader, reader, 0);
33289         xmlResetLastError();
33290         if (mem_base != xmlMemBlocks()) {
33291             printf("Leak of %d blocks found in xmlTextReaderRead",
33292                    xmlMemBlocks() - mem_base);
33293             test_ret++;
33294             printf(" %d", n_reader);
33295             printf("\n");
33296         }
33297     }
33298     function_tests++;
33299 #endif
33300
33301     return(test_ret);
33302 }
33303
33304
33305 static int
33306 test_xmlTextReaderReadAttributeValue(void) {
33307     int test_ret = 0;
33308
33309 #if defined(LIBXML_READER_ENABLED)
33310     int mem_base;
33311     int ret_val;
33312     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33313     int n_reader;
33314
33315     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33316         mem_base = xmlMemBlocks();
33317         reader = gen_xmlTextReaderPtr(n_reader, 0);
33318
33319         ret_val = xmlTextReaderReadAttributeValue(reader);
33320         desret_int(ret_val);
33321         call_tests++;
33322         des_xmlTextReaderPtr(n_reader, reader, 0);
33323         xmlResetLastError();
33324         if (mem_base != xmlMemBlocks()) {
33325             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
33326                    xmlMemBlocks() - mem_base);
33327             test_ret++;
33328             printf(" %d", n_reader);
33329             printf("\n");
33330         }
33331     }
33332     function_tests++;
33333 #endif
33334
33335     return(test_ret);
33336 }
33337
33338
33339 static int
33340 test_xmlTextReaderReadState(void) {
33341     int test_ret = 0;
33342
33343 #if defined(LIBXML_READER_ENABLED)
33344     int mem_base;
33345     int ret_val;
33346     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33347     int n_reader;
33348
33349     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33350         mem_base = xmlMemBlocks();
33351         reader = gen_xmlTextReaderPtr(n_reader, 0);
33352
33353         ret_val = xmlTextReaderReadState(reader);
33354         desret_int(ret_val);
33355         call_tests++;
33356         des_xmlTextReaderPtr(n_reader, reader, 0);
33357         xmlResetLastError();
33358         if (mem_base != xmlMemBlocks()) {
33359             printf("Leak of %d blocks found in xmlTextReaderReadState",
33360                    xmlMemBlocks() - mem_base);
33361             test_ret++;
33362             printf(" %d", n_reader);
33363             printf("\n");
33364         }
33365     }
33366     function_tests++;
33367 #endif
33368
33369     return(test_ret);
33370 }
33371
33372
33373 static int
33374 test_xmlTextReaderRelaxNGSetSchema(void) {
33375     int test_ret = 0;
33376
33377 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33378     int mem_base;
33379     int ret_val;
33380     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33381     int n_reader;
33382     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
33383     int n_schema;
33384
33385     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33386     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
33387         mem_base = xmlMemBlocks();
33388         reader = gen_xmlTextReaderPtr(n_reader, 0);
33389         schema = gen_xmlRelaxNGPtr(n_schema, 1);
33390
33391         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
33392         desret_int(ret_val);
33393         call_tests++;
33394         des_xmlTextReaderPtr(n_reader, reader, 0);
33395         des_xmlRelaxNGPtr(n_schema, schema, 1);
33396         xmlResetLastError();
33397         if (mem_base != xmlMemBlocks()) {
33398             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
33399                    xmlMemBlocks() - mem_base);
33400             test_ret++;
33401             printf(" %d", n_reader);
33402             printf(" %d", n_schema);
33403             printf("\n");
33404         }
33405     }
33406     }
33407     function_tests++;
33408 #endif
33409
33410     return(test_ret);
33411 }
33412
33413
33414 static int
33415 test_xmlTextReaderRelaxNGValidate(void) {
33416     int test_ret = 0;
33417
33418 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33419     int mem_base;
33420     int ret_val;
33421     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33422     int n_reader;
33423     char * rng; /* the path to a RelaxNG schema or NULL */
33424     int n_rng;
33425
33426     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33427     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
33428         mem_base = xmlMemBlocks();
33429         reader = gen_xmlTextReaderPtr(n_reader, 0);
33430         rng = gen_const_char_ptr(n_rng, 1);
33431
33432         ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
33433         desret_int(ret_val);
33434         call_tests++;
33435         des_xmlTextReaderPtr(n_reader, reader, 0);
33436         des_const_char_ptr(n_rng, (const char *)rng, 1);
33437         xmlResetLastError();
33438         if (mem_base != xmlMemBlocks()) {
33439             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
33440                    xmlMemBlocks() - mem_base);
33441             test_ret++;
33442             printf(" %d", n_reader);
33443             printf(" %d", n_rng);
33444             printf("\n");
33445         }
33446     }
33447     }
33448     function_tests++;
33449 #endif
33450
33451     return(test_ret);
33452 }
33453
33454
33455 static int
33456 test_xmlTextReaderRelaxNGValidateCtxt(void) {
33457     int test_ret = 0;
33458
33459 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33460     int mem_base;
33461     int ret_val;
33462     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33463     int n_reader;
33464     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
33465     int n_ctxt;
33466     int options; /* options (not used yet) */
33467     int n_options;
33468
33469     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33470     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
33471     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
33472         mem_base = xmlMemBlocks();
33473         reader = gen_xmlTextReaderPtr(n_reader, 0);
33474         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
33475         options = gen_parseroptions(n_options, 2);
33476
33477         ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
33478         desret_int(ret_val);
33479         call_tests++;
33480         des_xmlTextReaderPtr(n_reader, reader, 0);
33481         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
33482         des_parseroptions(n_options, options, 2);
33483         xmlResetLastError();
33484         if (mem_base != xmlMemBlocks()) {
33485             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
33486                    xmlMemBlocks() - mem_base);
33487             test_ret++;
33488             printf(" %d", n_reader);
33489             printf(" %d", n_ctxt);
33490             printf(" %d", n_options);
33491             printf("\n");
33492         }
33493     }
33494     }
33495     }
33496     function_tests++;
33497 #endif
33498
33499     return(test_ret);
33500 }
33501
33502
33503 static int
33504 test_xmlTextReaderSchemaValidate(void) {
33505     int test_ret = 0;
33506
33507 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33508     int ret_val;
33509     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33510     int n_reader;
33511     char * xsd; /* the path to a W3C XSD schema or NULL */
33512     int n_xsd;
33513
33514     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33515     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
33516         reader = gen_xmlTextReaderPtr(n_reader, 0);
33517         xsd = gen_const_char_ptr(n_xsd, 1);
33518
33519         ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
33520         desret_int(ret_val);
33521         call_tests++;
33522         des_xmlTextReaderPtr(n_reader, reader, 0);
33523         des_const_char_ptr(n_xsd, (const char *)xsd, 1);
33524         xmlResetLastError();
33525     }
33526     }
33527     function_tests++;
33528 #endif
33529
33530     return(test_ret);
33531 }
33532
33533
33534 static int
33535 test_xmlTextReaderSchemaValidateCtxt(void) {
33536     int test_ret = 0;
33537
33538 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33539     int mem_base;
33540     int ret_val;
33541     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33542     int n_reader;
33543     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
33544     int n_ctxt;
33545     int options; /* options (not used yet) */
33546     int n_options;
33547
33548     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33549     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33550     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
33551         mem_base = xmlMemBlocks();
33552         reader = gen_xmlTextReaderPtr(n_reader, 0);
33553         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
33554         options = gen_parseroptions(n_options, 2);
33555
33556         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
33557         desret_int(ret_val);
33558         call_tests++;
33559         des_xmlTextReaderPtr(n_reader, reader, 0);
33560         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
33561         des_parseroptions(n_options, options, 2);
33562         xmlResetLastError();
33563         if (mem_base != xmlMemBlocks()) {
33564             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
33565                    xmlMemBlocks() - mem_base);
33566             test_ret++;
33567             printf(" %d", n_reader);
33568             printf(" %d", n_ctxt);
33569             printf(" %d", n_options);
33570             printf("\n");
33571         }
33572     }
33573     }
33574     }
33575     function_tests++;
33576 #endif
33577
33578     return(test_ret);
33579 }
33580
33581
33582 static int
33583 test_xmlTextReaderSetErrorHandler(void) {
33584     int test_ret = 0;
33585
33586
33587     /* missing type support */
33588     return(test_ret);
33589 }
33590
33591
33592 static int
33593 test_xmlTextReaderSetParserProp(void) {
33594     int test_ret = 0;
33595
33596 #if defined(LIBXML_READER_ENABLED)
33597     int mem_base;
33598     int ret_val;
33599     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33600     int n_reader;
33601     int prop; /* the xmlParserProperties to set */
33602     int n_prop;
33603     int value; /* usually 0 or 1 to (de)activate it */
33604     int n_value;
33605
33606     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33607     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
33608     for (n_value = 0;n_value < gen_nb_int;n_value++) {
33609         mem_base = xmlMemBlocks();
33610         reader = gen_xmlTextReaderPtr(n_reader, 0);
33611         prop = gen_int(n_prop, 1);
33612         value = gen_int(n_value, 2);
33613
33614         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
33615         desret_int(ret_val);
33616         call_tests++;
33617         des_xmlTextReaderPtr(n_reader, reader, 0);
33618         des_int(n_prop, prop, 1);
33619         des_int(n_value, value, 2);
33620         xmlResetLastError();
33621         if (mem_base != xmlMemBlocks()) {
33622             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
33623                    xmlMemBlocks() - mem_base);
33624             test_ret++;
33625             printf(" %d", n_reader);
33626             printf(" %d", n_prop);
33627             printf(" %d", n_value);
33628             printf("\n");
33629         }
33630     }
33631     }
33632     }
33633     function_tests++;
33634 #endif
33635
33636     return(test_ret);
33637 }
33638
33639
33640 static int
33641 test_xmlTextReaderSetSchema(void) {
33642     int test_ret = 0;
33643
33644 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
33645     int mem_base;
33646     int ret_val;
33647     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33648     int n_reader;
33649     xmlSchemaPtr schema; /* a precompiled Schema schema */
33650     int n_schema;
33651
33652     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33653     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33654         mem_base = xmlMemBlocks();
33655         reader = gen_xmlTextReaderPtr(n_reader, 0);
33656         schema = gen_xmlSchemaPtr(n_schema, 1);
33657
33658         ret_val = xmlTextReaderSetSchema(reader, schema);
33659         desret_int(ret_val);
33660         call_tests++;
33661         des_xmlTextReaderPtr(n_reader, reader, 0);
33662         des_xmlSchemaPtr(n_schema, schema, 1);
33663         xmlResetLastError();
33664         if (mem_base != xmlMemBlocks()) {
33665             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
33666                    xmlMemBlocks() - mem_base);
33667             test_ret++;
33668             printf(" %d", n_reader);
33669             printf(" %d", n_schema);
33670             printf("\n");
33671         }
33672     }
33673     }
33674     function_tests++;
33675 #endif
33676
33677     return(test_ret);
33678 }
33679
33680
33681 static int
33682 test_xmlTextReaderSetStructuredErrorHandler(void) {
33683     int test_ret = 0;
33684
33685
33686     /* missing type support */
33687     return(test_ret);
33688 }
33689
33690
33691 static int
33692 test_xmlTextReaderSetup(void) {
33693     int test_ret = 0;
33694
33695 #if defined(LIBXML_READER_ENABLED)
33696     int mem_base;
33697     int ret_val;
33698     xmlTextReaderPtr reader; /* an XML reader */
33699     int n_reader;
33700     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
33701     int n_input;
33702     const char * URL; /* the base URL to use for the document */
33703     int n_URL;
33704     char * encoding; /* the document encoding, or NULL */
33705     int n_encoding;
33706     int options; /* a combination of xmlParserOption */
33707     int n_options;
33708
33709     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33710     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
33711     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
33712     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
33713     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
33714         mem_base = xmlMemBlocks();
33715         reader = gen_xmlTextReaderPtr(n_reader, 0);
33716         input = gen_xmlParserInputBufferPtr(n_input, 1);
33717         URL = gen_filepath(n_URL, 2);
33718         encoding = gen_const_char_ptr(n_encoding, 3);
33719         options = gen_parseroptions(n_options, 4);
33720
33721         ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
33722         desret_int(ret_val);
33723         call_tests++;
33724         des_xmlTextReaderPtr(n_reader, reader, 0);
33725         des_filepath(n_URL, URL, 2);
33726         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
33727         des_parseroptions(n_options, options, 4);
33728         xmlResetLastError();
33729         if (mem_base != xmlMemBlocks()) {
33730             printf("Leak of %d blocks found in xmlTextReaderSetup",
33731                    xmlMemBlocks() - mem_base);
33732             test_ret++;
33733             printf(" %d", n_reader);
33734             printf(" %d", n_input);
33735             printf(" %d", n_URL);
33736             printf(" %d", n_encoding);
33737             printf(" %d", n_options);
33738             printf("\n");
33739         }
33740     }
33741     }
33742     }
33743     }
33744     }
33745     function_tests++;
33746 #endif
33747
33748     return(test_ret);
33749 }
33750
33751
33752 static int
33753 test_xmlTextReaderStandalone(void) {
33754     int test_ret = 0;
33755
33756 #if defined(LIBXML_READER_ENABLED)
33757     int mem_base;
33758     int ret_val;
33759     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33760     int n_reader;
33761
33762     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33763         mem_base = xmlMemBlocks();
33764         reader = gen_xmlTextReaderPtr(n_reader, 0);
33765
33766         ret_val = xmlTextReaderStandalone(reader);
33767         desret_int(ret_val);
33768         call_tests++;
33769         des_xmlTextReaderPtr(n_reader, reader, 0);
33770         xmlResetLastError();
33771         if (mem_base != xmlMemBlocks()) {
33772             printf("Leak of %d blocks found in xmlTextReaderStandalone",
33773                    xmlMemBlocks() - mem_base);
33774             test_ret++;
33775             printf(" %d", n_reader);
33776             printf("\n");
33777         }
33778     }
33779     function_tests++;
33780 #endif
33781
33782     return(test_ret);
33783 }
33784
33785
33786 static int
33787 test_xmlTextReaderValue(void) {
33788     int test_ret = 0;
33789
33790 #if defined(LIBXML_READER_ENABLED)
33791     int mem_base;
33792     xmlChar * ret_val;
33793     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33794     int n_reader;
33795
33796     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33797         mem_base = xmlMemBlocks();
33798         reader = gen_xmlTextReaderPtr(n_reader, 0);
33799
33800         ret_val = xmlTextReaderValue(reader);
33801         desret_xmlChar_ptr(ret_val);
33802         call_tests++;
33803         des_xmlTextReaderPtr(n_reader, reader, 0);
33804         xmlResetLastError();
33805         if (mem_base != xmlMemBlocks()) {
33806             printf("Leak of %d blocks found in xmlTextReaderValue",
33807                    xmlMemBlocks() - mem_base);
33808             test_ret++;
33809             printf(" %d", n_reader);
33810             printf("\n");
33811         }
33812     }
33813     function_tests++;
33814 #endif
33815
33816     return(test_ret);
33817 }
33818
33819
33820 static int
33821 test_xmlTextReaderXmlLang(void) {
33822     int test_ret = 0;
33823
33824 #if defined(LIBXML_READER_ENABLED)
33825     int mem_base;
33826     xmlChar * ret_val;
33827     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
33828     int n_reader;
33829
33830     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
33831         mem_base = xmlMemBlocks();
33832         reader = gen_xmlTextReaderPtr(n_reader, 0);
33833
33834         ret_val = xmlTextReaderXmlLang(reader);
33835         desret_xmlChar_ptr(ret_val);
33836         call_tests++;
33837         des_xmlTextReaderPtr(n_reader, reader, 0);
33838         xmlResetLastError();
33839         if (mem_base != xmlMemBlocks()) {
33840             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
33841                    xmlMemBlocks() - mem_base);
33842             test_ret++;
33843             printf(" %d", n_reader);
33844             printf("\n");
33845         }
33846     }
33847     function_tests++;
33848 #endif
33849
33850     return(test_ret);
33851 }
33852
33853 static int
33854 test_xmlreader(void) {
33855     int test_ret = 0;
33856         int rc = 0;
33857
33858     if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
33859     rc = test_xmlNewTextReader();
33860         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33861     rc = test_xmlNewTextReaderFilename();
33862         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33863     rc = test_xmlReaderForDoc();
33864         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33865     rc = test_xmlReaderForFile();
33866         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33867     rc = test_xmlReaderForMemory();
33868         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33869     rc = test_xmlReaderNewDoc();
33870         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33871     rc = test_xmlReaderNewFile();
33872         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33873     rc = test_xmlReaderNewMemory();
33874         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33875     rc = test_xmlReaderNewWalker();
33876         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33877     rc = test_xmlReaderWalker();
33878         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33879     rc = test_xmlTextReaderAttributeCount();
33880         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33881     rc = test_xmlTextReaderBaseUri();
33882         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33883     rc = test_xmlTextReaderByteConsumed();
33884         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33885     rc = test_xmlTextReaderClose();
33886         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33887     rc = test_xmlTextReaderConstBaseUri();
33888         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33889     rc = test_xmlTextReaderConstEncoding();
33890         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33891     rc = test_xmlTextReaderConstLocalName();
33892         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33893     rc = test_xmlTextReaderConstName();
33894         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33895     rc = test_xmlTextReaderConstNamespaceUri();
33896         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33897     rc = test_xmlTextReaderConstPrefix();
33898         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33899     rc = test_xmlTextReaderConstString();
33900         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33901     rc = test_xmlTextReaderConstValue();
33902         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33903     rc = test_xmlTextReaderConstXmlLang();
33904         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33905     rc = test_xmlTextReaderConstXmlVersion();
33906         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33907     rc = test_xmlTextReaderCurrentDoc();
33908         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33909     rc = test_xmlTextReaderCurrentNode();
33910         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33911     rc = test_xmlTextReaderDepth();
33912         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33913     rc = test_xmlTextReaderExpand();
33914         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33915     rc = test_xmlTextReaderGetAttribute();
33916         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33917     rc = test_xmlTextReaderGetAttributeNo();
33918         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33919     rc = test_xmlTextReaderGetAttributeNs();
33920         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33921     rc = test_xmlTextReaderGetErrorHandler();
33922         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33923     rc = test_xmlTextReaderGetParserColumnNumber();
33924         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33925     rc = test_xmlTextReaderGetParserLineNumber();
33926         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33927     rc = test_xmlTextReaderGetParserProp();
33928         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33929     rc = test_xmlTextReaderGetRemainder();
33930         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33931     rc = test_xmlTextReaderHasAttributes();
33932         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33933     rc = test_xmlTextReaderHasValue();
33934         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33935     rc = test_xmlTextReaderIsDefault();
33936         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33937     rc = test_xmlTextReaderIsEmptyElement();
33938         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33939     rc = test_xmlTextReaderIsNamespaceDecl();
33940         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33941     rc = test_xmlTextReaderIsValid();
33942         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33943     rc = test_xmlTextReaderLocalName();
33944         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33945     rc = test_xmlTextReaderLocatorBaseURI();
33946         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33947     rc = test_xmlTextReaderLocatorLineNumber();
33948         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33949     rc = test_xmlTextReaderLookupNamespace();
33950         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33951     rc = test_xmlTextReaderMoveToAttribute();
33952         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33953     rc = test_xmlTextReaderMoveToAttributeNo();
33954         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33955     rc = test_xmlTextReaderMoveToAttributeNs();
33956         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33957     rc = test_xmlTextReaderMoveToElement();
33958         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33959     rc = test_xmlTextReaderMoveToFirstAttribute();
33960         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33961     rc = test_xmlTextReaderMoveToNextAttribute();
33962         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33963     rc = test_xmlTextReaderName();
33964         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33965     rc = test_xmlTextReaderNamespaceUri();
33966         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33967     rc = test_xmlTextReaderNext();
33968         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33969     rc = test_xmlTextReaderNextSibling();
33970         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33971     rc = test_xmlTextReaderNodeType();
33972         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33973     rc = test_xmlTextReaderNormalization();
33974         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33975     rc = test_xmlTextReaderPrefix();
33976         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33977     rc = test_xmlTextReaderPreserve();
33978         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33979     rc = test_xmlTextReaderPreservePattern();
33980         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33981     rc = test_xmlTextReaderQuoteChar();
33982         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33983     rc = test_xmlTextReaderRead();
33984         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33985     rc = test_xmlTextReaderReadAttributeValue();
33986         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33987     rc = test_xmlTextReaderReadState();
33988         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33989     rc = test_xmlTextReaderRelaxNGSetSchema();
33990         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33991     rc = test_xmlTextReaderRelaxNGValidate();
33992         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33993     rc = test_xmlTextReaderRelaxNGValidateCtxt();
33994         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33995     rc = test_xmlTextReaderSchemaValidate();
33996         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33997     rc = test_xmlTextReaderSchemaValidateCtxt();
33998         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
33999     rc = test_xmlTextReaderSetErrorHandler();
34000         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34001     rc = test_xmlTextReaderSetParserProp();
34002         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34003     rc = test_xmlTextReaderSetSchema();
34004         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34005     rc = test_xmlTextReaderSetStructuredErrorHandler();
34006         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34007     rc = test_xmlTextReaderSetup();
34008         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34009     rc = test_xmlTextReaderStandalone();
34010         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34011     rc = test_xmlTextReaderValue();
34012         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34013     rc = test_xmlTextReaderXmlLang();
34014         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34015
34016     if (test_ret != 0)
34017         printf("Module xmlreader: %d errors\n", test_ret);
34018     return(test_ret);
34019 }
34020
34021 static int
34022 test_xmlExpCtxtNbCons(void) {
34023     int test_ret = 0;
34024
34025 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34026     int mem_base;
34027     int ret_val;
34028     xmlExpCtxtPtr ctxt; /* an expression context */
34029     int n_ctxt;
34030
34031     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
34032         mem_base = xmlMemBlocks();
34033         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
34034
34035         ret_val = xmlExpCtxtNbCons(ctxt);
34036         desret_int(ret_val);
34037         call_tests++;
34038         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
34039         xmlResetLastError();
34040         if (mem_base != xmlMemBlocks()) {
34041             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
34042                    xmlMemBlocks() - mem_base);
34043             test_ret++;
34044             printf(" %d", n_ctxt);
34045             printf("\n");
34046         }
34047     }
34048     function_tests++;
34049 #endif
34050
34051     return(test_ret);
34052 }
34053
34054
34055 static int
34056 test_xmlExpCtxtNbNodes(void) {
34057     int test_ret = 0;
34058
34059 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34060     int mem_base;
34061     int ret_val;
34062     xmlExpCtxtPtr ctxt; /* an expression context */
34063     int n_ctxt;
34064
34065     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
34066         mem_base = xmlMemBlocks();
34067         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
34068
34069         ret_val = xmlExpCtxtNbNodes(ctxt);
34070         desret_int(ret_val);
34071         call_tests++;
34072         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
34073         xmlResetLastError();
34074         if (mem_base != xmlMemBlocks()) {
34075             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
34076                    xmlMemBlocks() - mem_base);
34077             test_ret++;
34078             printf(" %d", n_ctxt);
34079             printf("\n");
34080         }
34081     }
34082     function_tests++;
34083 #endif
34084
34085     return(test_ret);
34086 }
34087
34088
34089 static int
34090 test_xmlExpDump(void) {
34091     int test_ret = 0;
34092
34093 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34094     int mem_base;
34095     xmlBufferPtr buf; /* a buffer to receive the output */
34096     int n_buf;
34097     xmlExpNodePtr expr; /* the compiled expression */
34098     int n_expr;
34099
34100     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
34101     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
34102         mem_base = xmlMemBlocks();
34103         buf = gen_xmlBufferPtr(n_buf, 0);
34104         expr = gen_xmlExpNodePtr(n_expr, 1);
34105
34106         xmlExpDump(buf, expr);
34107         call_tests++;
34108         des_xmlBufferPtr(n_buf, buf, 0);
34109         des_xmlExpNodePtr(n_expr, expr, 1);
34110         xmlResetLastError();
34111         if (mem_base != xmlMemBlocks()) {
34112             printf("Leak of %d blocks found in xmlExpDump",
34113                    xmlMemBlocks() - mem_base);
34114             test_ret++;
34115             printf(" %d", n_buf);
34116             printf(" %d", n_expr);
34117             printf("\n");
34118         }
34119     }
34120     }
34121     function_tests++;
34122 #endif
34123
34124     return(test_ret);
34125 }
34126
34127
34128 static int
34129 test_xmlExpExpDerive(void) {
34130     int test_ret = 0;
34131
34132
34133     /* missing type support */
34134     return(test_ret);
34135 }
34136
34137
34138 static int
34139 test_xmlExpGetLanguage(void) {
34140     int test_ret = 0;
34141
34142 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34143     int mem_base;
34144     int ret_val;
34145     xmlExpCtxtPtr ctxt; /* the expression context */
34146     int n_ctxt;
34147     xmlExpNodePtr exp; /* the expression */
34148     int n_exp;
34149     xmlChar ** langList; /* where to store the tokens */
34150     int n_langList;
34151     int len; /* the allocated length of @list */
34152     int n_len;
34153
34154     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
34155     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34156     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
34157     for (n_len = 0;n_len < gen_nb_int;n_len++) {
34158         mem_base = xmlMemBlocks();
34159         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
34160         exp = gen_xmlExpNodePtr(n_exp, 1);
34161         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
34162         len = gen_int(n_len, 3);
34163
34164         ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
34165         desret_int(ret_val);
34166         call_tests++;
34167         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
34168         des_xmlExpNodePtr(n_exp, exp, 1);
34169         des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
34170         des_int(n_len, len, 3);
34171         xmlResetLastError();
34172         if (mem_base != xmlMemBlocks()) {
34173             printf("Leak of %d blocks found in xmlExpGetLanguage",
34174                    xmlMemBlocks() - mem_base);
34175             test_ret++;
34176             printf(" %d", n_ctxt);
34177             printf(" %d", n_exp);
34178             printf(" %d", n_langList);
34179             printf(" %d", n_len);
34180             printf("\n");
34181         }
34182     }
34183     }
34184     }
34185     }
34186     function_tests++;
34187 #endif
34188
34189     return(test_ret);
34190 }
34191
34192
34193 static int
34194 test_xmlExpGetStart(void) {
34195     int test_ret = 0;
34196
34197 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34198     int mem_base;
34199     int ret_val;
34200     xmlExpCtxtPtr ctxt; /* the expression context */
34201     int n_ctxt;
34202     xmlExpNodePtr exp; /* the expression */
34203     int n_exp;
34204     xmlChar ** tokList; /* where to store the tokens */
34205     int n_tokList;
34206     int len; /* the allocated length of @list */
34207     int n_len;
34208
34209     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
34210     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34211     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
34212     for (n_len = 0;n_len < gen_nb_int;n_len++) {
34213         mem_base = xmlMemBlocks();
34214         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
34215         exp = gen_xmlExpNodePtr(n_exp, 1);
34216         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
34217         len = gen_int(n_len, 3);
34218
34219         ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
34220         desret_int(ret_val);
34221         call_tests++;
34222         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
34223         des_xmlExpNodePtr(n_exp, exp, 1);
34224         des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
34225         des_int(n_len, len, 3);
34226         xmlResetLastError();
34227         if (mem_base != xmlMemBlocks()) {
34228             printf("Leak of %d blocks found in xmlExpGetStart",
34229                    xmlMemBlocks() - mem_base);
34230             test_ret++;
34231             printf(" %d", n_ctxt);
34232             printf(" %d", n_exp);
34233             printf(" %d", n_tokList);
34234             printf(" %d", n_len);
34235             printf("\n");
34236         }
34237     }
34238     }
34239     }
34240     }
34241     function_tests++;
34242 #endif
34243
34244     return(test_ret);
34245 }
34246
34247
34248 static int
34249 test_xmlExpIsNillable(void) {
34250     int test_ret = 0;
34251
34252 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34253     int mem_base;
34254     int ret_val;
34255     xmlExpNodePtr exp; /* the expression */
34256     int n_exp;
34257
34258     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34259         mem_base = xmlMemBlocks();
34260         exp = gen_xmlExpNodePtr(n_exp, 0);
34261
34262         ret_val = xmlExpIsNillable(exp);
34263         desret_int(ret_val);
34264         call_tests++;
34265         des_xmlExpNodePtr(n_exp, exp, 0);
34266         xmlResetLastError();
34267         if (mem_base != xmlMemBlocks()) {
34268             printf("Leak of %d blocks found in xmlExpIsNillable",
34269                    xmlMemBlocks() - mem_base);
34270             test_ret++;
34271             printf(" %d", n_exp);
34272             printf("\n");
34273         }
34274     }
34275     function_tests++;
34276 #endif
34277
34278     return(test_ret);
34279 }
34280
34281
34282 static int
34283 test_xmlExpMaxToken(void) {
34284     int test_ret = 0;
34285
34286 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34287     int mem_base;
34288     int ret_val;
34289     xmlExpNodePtr expr; /* a compiled expression */
34290     int n_expr;
34291
34292     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
34293         mem_base = xmlMemBlocks();
34294         expr = gen_xmlExpNodePtr(n_expr, 0);
34295
34296         ret_val = xmlExpMaxToken(expr);
34297         desret_int(ret_val);
34298         call_tests++;
34299         des_xmlExpNodePtr(n_expr, expr, 0);
34300         xmlResetLastError();
34301         if (mem_base != xmlMemBlocks()) {
34302             printf("Leak of %d blocks found in xmlExpMaxToken",
34303                    xmlMemBlocks() - mem_base);
34304             test_ret++;
34305             printf(" %d", n_expr);
34306             printf("\n");
34307         }
34308     }
34309     function_tests++;
34310 #endif
34311
34312     return(test_ret);
34313 }
34314
34315
34316 static int
34317 test_xmlExpNewAtom(void) {
34318     int test_ret = 0;
34319
34320
34321     /* missing type support */
34322     return(test_ret);
34323 }
34324
34325
34326 static int
34327 test_xmlExpNewCtxt(void) {
34328     int test_ret = 0;
34329
34330
34331     /* missing type support */
34332     return(test_ret);
34333 }
34334
34335
34336 static int
34337 test_xmlExpNewOr(void) {
34338     int test_ret = 0;
34339
34340
34341     /* missing type support */
34342     return(test_ret);
34343 }
34344
34345
34346 static int
34347 test_xmlExpNewRange(void) {
34348     int test_ret = 0;
34349
34350
34351     /* missing type support */
34352     return(test_ret);
34353 }
34354
34355
34356 static int
34357 test_xmlExpNewSeq(void) {
34358     int test_ret = 0;
34359
34360
34361     /* missing type support */
34362     return(test_ret);
34363 }
34364
34365
34366 static int
34367 test_xmlExpParse(void) {
34368     int test_ret = 0;
34369
34370
34371     /* missing type support */
34372     return(test_ret);
34373 }
34374
34375
34376 static int
34377 test_xmlExpRef(void) {
34378     int test_ret = 0;
34379
34380 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34381     int mem_base;
34382     xmlExpNodePtr exp; /* the expression */
34383     int n_exp;
34384
34385     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34386         mem_base = xmlMemBlocks();
34387         exp = gen_xmlExpNodePtr(n_exp, 0);
34388
34389         xmlExpRef(exp);
34390         call_tests++;
34391         des_xmlExpNodePtr(n_exp, exp, 0);
34392         xmlResetLastError();
34393         if (mem_base != xmlMemBlocks()) {
34394             printf("Leak of %d blocks found in xmlExpRef",
34395                    xmlMemBlocks() - mem_base);
34396             test_ret++;
34397             printf(" %d", n_exp);
34398             printf("\n");
34399         }
34400     }
34401     function_tests++;
34402 #endif
34403
34404     return(test_ret);
34405 }
34406
34407
34408 static int
34409 test_xmlExpStringDerive(void) {
34410     int test_ret = 0;
34411
34412
34413     /* missing type support */
34414     return(test_ret);
34415 }
34416
34417
34418 static int
34419 test_xmlExpSubsume(void) {
34420     int test_ret = 0;
34421
34422 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
34423     int mem_base;
34424     int ret_val;
34425     xmlExpCtxtPtr ctxt; /* the expressions context */
34426     int n_ctxt;
34427     xmlExpNodePtr exp; /* the englobing expression */
34428     int n_exp;
34429     xmlExpNodePtr sub; /* the subexpression */
34430     int n_sub;
34431
34432     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
34433     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
34434     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
34435         mem_base = xmlMemBlocks();
34436         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
34437         exp = gen_xmlExpNodePtr(n_exp, 1);
34438         sub = gen_xmlExpNodePtr(n_sub, 2);
34439
34440         ret_val = xmlExpSubsume(ctxt, exp, sub);
34441         desret_int(ret_val);
34442         call_tests++;
34443         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
34444         des_xmlExpNodePtr(n_exp, exp, 1);
34445         des_xmlExpNodePtr(n_sub, sub, 2);
34446         xmlResetLastError();
34447         if (mem_base != xmlMemBlocks()) {
34448             printf("Leak of %d blocks found in xmlExpSubsume",
34449                    xmlMemBlocks() - mem_base);
34450             test_ret++;
34451             printf(" %d", n_ctxt);
34452             printf(" %d", n_exp);
34453             printf(" %d", n_sub);
34454             printf("\n");
34455         }
34456     }
34457     }
34458     }
34459     function_tests++;
34460 #endif
34461
34462     return(test_ret);
34463 }
34464
34465 #ifdef LIBXML_REGEXP_ENABLED
34466
34467 #define gen_nb_xmlRegExecCtxtPtr 1
34468 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34469     return(NULL);
34470 }
34471 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34472 }
34473 #endif
34474
34475
34476 static int
34477 test_xmlRegExecErrInfo(void) {
34478     int test_ret = 0;
34479
34480 #if defined(LIBXML_REGEXP_ENABLED)
34481     int mem_base;
34482     int ret_val;
34483     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
34484     int n_exec;
34485     xmlChar ** string; /* return value for the error string */
34486     int n_string;
34487     int * nbval; /* pointer to the number of accepted values IN/OUT */
34488     int n_nbval;
34489     int * nbneg; /* return number of negative transitions */
34490     int n_nbneg;
34491     xmlChar ** values; /* pointer to the array of acceptable values */
34492     int n_values;
34493     int * terminal; /* return value if this was a terminal state */
34494     int n_terminal;
34495
34496     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
34497     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
34498     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
34499     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
34500     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
34501     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
34502         mem_base = xmlMemBlocks();
34503         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
34504         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
34505         nbval = gen_int_ptr(n_nbval, 2);
34506         nbneg = gen_int_ptr(n_nbneg, 3);
34507         values = gen_xmlChar_ptr_ptr(n_values, 4);
34508         terminal = gen_int_ptr(n_terminal, 5);
34509
34510         ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
34511         desret_int(ret_val);
34512         call_tests++;
34513         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
34514         des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
34515         des_int_ptr(n_nbval, nbval, 2);
34516         des_int_ptr(n_nbneg, nbneg, 3);
34517         des_xmlChar_ptr_ptr(n_values, values, 4);
34518         des_int_ptr(n_terminal, terminal, 5);
34519         xmlResetLastError();
34520         if (mem_base != xmlMemBlocks()) {
34521             printf("Leak of %d blocks found in xmlRegExecErrInfo",
34522                    xmlMemBlocks() - mem_base);
34523             test_ret++;
34524             printf(" %d", n_exec);
34525             printf(" %d", n_string);
34526             printf(" %d", n_nbval);
34527             printf(" %d", n_nbneg);
34528             printf(" %d", n_values);
34529             printf(" %d", n_terminal);
34530             printf("\n");
34531         }
34532     }
34533     }
34534     }
34535     }
34536     }
34537     }
34538     function_tests++;
34539 #endif
34540
34541     return(test_ret);
34542 }
34543
34544
34545 static int
34546 test_xmlRegExecNextValues(void) {
34547     int test_ret = 0;
34548
34549 #if defined(LIBXML_REGEXP_ENABLED)
34550     int mem_base;
34551     int ret_val;
34552     xmlRegExecCtxtPtr exec; /* a regexp execution context */
34553     int n_exec;
34554     int * nbval; /* pointer to the number of accepted values IN/OUT */
34555     int n_nbval;
34556     int * nbneg; /* return number of negative transitions */
34557     int n_nbneg;
34558     xmlChar ** values; /* pointer to the array of acceptable values */
34559     int n_values;
34560     int * terminal; /* return value if this was a terminal state */
34561     int n_terminal;
34562
34563     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
34564     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
34565     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
34566     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
34567     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
34568         mem_base = xmlMemBlocks();
34569         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
34570         nbval = gen_int_ptr(n_nbval, 1);
34571         nbneg = gen_int_ptr(n_nbneg, 2);
34572         values = gen_xmlChar_ptr_ptr(n_values, 3);
34573         terminal = gen_int_ptr(n_terminal, 4);
34574
34575         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
34576         desret_int(ret_val);
34577         call_tests++;
34578         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
34579         des_int_ptr(n_nbval, nbval, 1);
34580         des_int_ptr(n_nbneg, nbneg, 2);
34581         des_xmlChar_ptr_ptr(n_values, values, 3);
34582         des_int_ptr(n_terminal, terminal, 4);
34583         xmlResetLastError();
34584         if (mem_base != xmlMemBlocks()) {
34585             printf("Leak of %d blocks found in xmlRegExecNextValues",
34586                    xmlMemBlocks() - mem_base);
34587             test_ret++;
34588             printf(" %d", n_exec);
34589             printf(" %d", n_nbval);
34590             printf(" %d", n_nbneg);
34591             printf(" %d", n_values);
34592             printf(" %d", n_terminal);
34593             printf("\n");
34594         }
34595     }
34596     }
34597     }
34598     }
34599     }
34600     function_tests++;
34601 #endif
34602
34603     return(test_ret);
34604 }
34605
34606
34607 static int
34608 test_xmlRegExecPushString(void) {
34609     int test_ret = 0;
34610
34611 #if defined(LIBXML_REGEXP_ENABLED)
34612     int mem_base;
34613     int ret_val;
34614     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
34615     int n_exec;
34616     xmlChar * value; /* a string token input */
34617     int n_value;
34618     void * data; /* data associated to the token to reuse in callbacks */
34619     int n_data;
34620
34621     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
34622     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34623     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
34624         mem_base = xmlMemBlocks();
34625         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
34626         value = gen_const_xmlChar_ptr(n_value, 1);
34627         data = gen_userdata(n_data, 2);
34628
34629         ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
34630         desret_int(ret_val);
34631         call_tests++;
34632         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
34633         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34634         des_userdata(n_data, data, 2);
34635         xmlResetLastError();
34636         if (mem_base != xmlMemBlocks()) {
34637             printf("Leak of %d blocks found in xmlRegExecPushString",
34638                    xmlMemBlocks() - mem_base);
34639             test_ret++;
34640             printf(" %d", n_exec);
34641             printf(" %d", n_value);
34642             printf(" %d", n_data);
34643             printf("\n");
34644         }
34645     }
34646     }
34647     }
34648     function_tests++;
34649 #endif
34650
34651     return(test_ret);
34652 }
34653
34654
34655 static int
34656 test_xmlRegExecPushString2(void) {
34657     int test_ret = 0;
34658
34659 #if defined(LIBXML_REGEXP_ENABLED)
34660     int mem_base;
34661     int ret_val;
34662     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
34663     int n_exec;
34664     xmlChar * value; /* the first string token input */
34665     int n_value;
34666     xmlChar * value2; /* the second string token input */
34667     int n_value2;
34668     void * data; /* data associated to the token to reuse in callbacks */
34669     int n_data;
34670
34671     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
34672     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34673     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
34674     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
34675         mem_base = xmlMemBlocks();
34676         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
34677         value = gen_const_xmlChar_ptr(n_value, 1);
34678         value2 = gen_const_xmlChar_ptr(n_value2, 2);
34679         data = gen_userdata(n_data, 3);
34680
34681         ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
34682         desret_int(ret_val);
34683         call_tests++;
34684         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
34685         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34686         des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
34687         des_userdata(n_data, data, 3);
34688         xmlResetLastError();
34689         if (mem_base != xmlMemBlocks()) {
34690             printf("Leak of %d blocks found in xmlRegExecPushString2",
34691                    xmlMemBlocks() - mem_base);
34692             test_ret++;
34693             printf(" %d", n_exec);
34694             printf(" %d", n_value);
34695             printf(" %d", n_value2);
34696             printf(" %d", n_data);
34697             printf("\n");
34698         }
34699     }
34700     }
34701     }
34702     }
34703     function_tests++;
34704 #endif
34705
34706     return(test_ret);
34707 }
34708
34709 #ifdef LIBXML_REGEXP_ENABLED
34710
34711 #define gen_nb_xmlRegexpPtr 1
34712 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34713     return(NULL);
34714 }
34715 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34716 }
34717 #endif
34718
34719
34720 static int
34721 test_xmlRegNewExecCtxt(void) {
34722     int test_ret = 0;
34723
34724
34725     /* missing type support */
34726     return(test_ret);
34727 }
34728
34729
34730 static int
34731 test_xmlRegexpCompile(void) {
34732     int test_ret = 0;
34733
34734
34735     /* missing type support */
34736     return(test_ret);
34737 }
34738
34739
34740 static int
34741 test_xmlRegexpExec(void) {
34742     int test_ret = 0;
34743
34744 #if defined(LIBXML_REGEXP_ENABLED)
34745     int mem_base;
34746     int ret_val;
34747     xmlRegexpPtr comp; /* the compiled regular expression */
34748     int n_comp;
34749     xmlChar * content; /* the value to check against the regular expression */
34750     int n_content;
34751
34752     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
34753     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
34754         mem_base = xmlMemBlocks();
34755         comp = gen_xmlRegexpPtr(n_comp, 0);
34756         content = gen_const_xmlChar_ptr(n_content, 1);
34757
34758         ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
34759         desret_int(ret_val);
34760         call_tests++;
34761         des_xmlRegexpPtr(n_comp, comp, 0);
34762         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
34763         xmlResetLastError();
34764         if (mem_base != xmlMemBlocks()) {
34765             printf("Leak of %d blocks found in xmlRegexpExec",
34766                    xmlMemBlocks() - mem_base);
34767             test_ret++;
34768             printf(" %d", n_comp);
34769             printf(" %d", n_content);
34770             printf("\n");
34771         }
34772     }
34773     }
34774     function_tests++;
34775 #endif
34776
34777     return(test_ret);
34778 }
34779
34780
34781 static int
34782 test_xmlRegexpIsDeterminist(void) {
34783     int test_ret = 0;
34784
34785 #if defined(LIBXML_REGEXP_ENABLED)
34786     int mem_base;
34787     int ret_val;
34788     xmlRegexpPtr comp; /* the compiled regular expression */
34789     int n_comp;
34790
34791     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
34792         mem_base = xmlMemBlocks();
34793         comp = gen_xmlRegexpPtr(n_comp, 0);
34794
34795         ret_val = xmlRegexpIsDeterminist(comp);
34796         desret_int(ret_val);
34797         call_tests++;
34798         des_xmlRegexpPtr(n_comp, comp, 0);
34799         xmlResetLastError();
34800         if (mem_base != xmlMemBlocks()) {
34801             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
34802                    xmlMemBlocks() - mem_base);
34803             test_ret++;
34804             printf(" %d", n_comp);
34805             printf("\n");
34806         }
34807     }
34808     function_tests++;
34809 #endif
34810
34811     return(test_ret);
34812 }
34813
34814
34815 static int
34816 test_xmlRegexpPrint(void) {
34817     int test_ret = 0;
34818
34819 #if defined(LIBXML_REGEXP_ENABLED)
34820     int mem_base;
34821     FILE * output; /* the file for the output debug */
34822     int n_output;
34823     xmlRegexpPtr regexp; /* the compiled regexp */
34824     int n_regexp;
34825
34826     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
34827     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
34828         mem_base = xmlMemBlocks();
34829         output = gen_FILE_ptr(n_output, 0);
34830         regexp = gen_xmlRegexpPtr(n_regexp, 1);
34831
34832         xmlRegexpPrint(output, regexp);
34833         call_tests++;
34834         des_FILE_ptr(n_output, output, 0);
34835         des_xmlRegexpPtr(n_regexp, regexp, 1);
34836         xmlResetLastError();
34837         if (mem_base != xmlMemBlocks()) {
34838             printf("Leak of %d blocks found in xmlRegexpPrint",
34839                    xmlMemBlocks() - mem_base);
34840             test_ret++;
34841             printf(" %d", n_output);
34842             printf(" %d", n_regexp);
34843             printf("\n");
34844         }
34845     }
34846     }
34847     function_tests++;
34848 #endif
34849
34850     return(test_ret);
34851 }
34852
34853 static int
34854 test_xmlregexp(void) {
34855     int test_ret = 0;
34856         int rc = 0;
34857
34858     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
34859     rc = test_xmlExpCtxtNbCons();
34860         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34861     rc = test_xmlExpCtxtNbNodes();
34862         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34863     rc = test_xmlExpDump();
34864         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34865     rc = test_xmlExpExpDerive();
34866         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34867     rc = test_xmlExpGetLanguage();
34868         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34869     rc = test_xmlExpGetStart();
34870         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34871     rc = test_xmlExpIsNillable();
34872         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34873     rc = test_xmlExpMaxToken();
34874         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34875     rc = test_xmlExpNewAtom();
34876         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34877     rc = test_xmlExpNewCtxt();
34878         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34879     rc = test_xmlExpNewOr();
34880         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34881     rc = test_xmlExpNewRange();
34882         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34883     rc = test_xmlExpNewSeq();
34884         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34885     rc = test_xmlExpParse();
34886         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34887     rc = test_xmlExpRef();
34888         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34889     rc = test_xmlExpStringDerive();
34890         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34891     rc = test_xmlExpSubsume();
34892         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34893     rc = test_xmlRegExecErrInfo();
34894         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34895     rc = test_xmlRegExecNextValues();
34896         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34897     rc = test_xmlRegExecPushString();
34898         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34899     rc = test_xmlRegExecPushString2();
34900         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34901     rc = test_xmlRegNewExecCtxt();
34902         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34903     rc = test_xmlRegexpCompile();
34904         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34905     rc = test_xmlRegexpExec();
34906         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34907     rc = test_xmlRegexpIsDeterminist();
34908         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34909     rc = test_xmlRegexpPrint();
34910         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
34911
34912     if (test_ret != 0)
34913         printf("Module xmlregexp: %d errors\n", test_ret);
34914     return(test_ret);
34915 }
34916 #ifdef LIBXML_OUTPUT_ENABLED
34917
34918 #define gen_nb_xmlSaveCtxtPtr 1
34919 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34920     return(NULL);
34921 }
34922 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34923 }
34924 #endif
34925
34926
34927 static int
34928 test_xmlSaveClose(void) {
34929     int test_ret = 0;
34930
34931 #if defined(LIBXML_OUTPUT_ENABLED)
34932     int mem_base;
34933     int ret_val;
34934     xmlSaveCtxtPtr ctxt; /* a document saving context */
34935     int n_ctxt;
34936
34937     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34938         mem_base = xmlMemBlocks();
34939         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34940
34941         ret_val = xmlSaveClose(ctxt);
34942         desret_int(ret_val);
34943         call_tests++;
34944         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34945         xmlResetLastError();
34946         if (mem_base != xmlMemBlocks()) {
34947             printf("Leak of %d blocks found in xmlSaveClose",
34948                    xmlMemBlocks() - mem_base);
34949             test_ret++;
34950             printf(" %d", n_ctxt);
34951             printf("\n");
34952         }
34953     }
34954     function_tests++;
34955 #endif
34956
34957     return(test_ret);
34958 }
34959
34960
34961 static int
34962 test_xmlSaveDoc(void) {
34963     int test_ret = 0;
34964
34965 #if defined(LIBXML_OUTPUT_ENABLED)
34966     int mem_base;
34967     long ret_val;
34968     xmlSaveCtxtPtr ctxt; /* a document saving context */
34969     int n_ctxt;
34970     xmlDocPtr doc; /* a document */
34971     int n_doc;
34972
34973     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
34974     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34975         mem_base = xmlMemBlocks();
34976         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
34977         doc = gen_xmlDocPtr(n_doc, 1);
34978
34979         ret_val = xmlSaveDoc(ctxt, doc);
34980         desret_long(ret_val);
34981         call_tests++;
34982         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
34983         des_xmlDocPtr(n_doc, doc, 1);
34984         xmlResetLastError();
34985         if (mem_base != xmlMemBlocks()) {
34986             printf("Leak of %d blocks found in xmlSaveDoc",
34987                    xmlMemBlocks() - mem_base);
34988             test_ret++;
34989             printf(" %d", n_ctxt);
34990             printf(" %d", n_doc);
34991             printf("\n");
34992         }
34993     }
34994     }
34995     function_tests++;
34996 #endif
34997
34998     return(test_ret);
34999 }
35000
35001
35002 static int
35003 test_xmlSaveFlush(void) {
35004     int test_ret = 0;
35005
35006 #if defined(LIBXML_OUTPUT_ENABLED)
35007     int mem_base;
35008     int ret_val;
35009     xmlSaveCtxtPtr ctxt; /* a document saving context */
35010     int n_ctxt;
35011
35012     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
35013         mem_base = xmlMemBlocks();
35014         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
35015
35016         ret_val = xmlSaveFlush(ctxt);
35017         desret_int(ret_val);
35018         call_tests++;
35019         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
35020         xmlResetLastError();
35021         if (mem_base != xmlMemBlocks()) {
35022             printf("Leak of %d blocks found in xmlSaveFlush",
35023                    xmlMemBlocks() - mem_base);
35024             test_ret++;
35025             printf(" %d", n_ctxt);
35026             printf("\n");
35027         }
35028     }
35029     function_tests++;
35030 #endif
35031
35032     return(test_ret);
35033 }
35034
35035
35036 static int
35037 test_xmlSaveSetAttrEscape(void) {
35038     int test_ret = 0;
35039
35040
35041     /* missing type support */
35042     return(test_ret);
35043 }
35044
35045
35046 static int
35047 test_xmlSaveSetEscape(void) {
35048     int test_ret = 0;
35049
35050
35051     /* missing type support */
35052     return(test_ret);
35053 }
35054
35055
35056 static int
35057 test_xmlSaveToBuffer(void) {
35058     int test_ret = 0;
35059
35060
35061     /* missing type support */
35062     return(test_ret);
35063 }
35064
35065
35066 static int
35067 test_xmlSaveToFd(void) {
35068     int test_ret = 0;
35069
35070
35071     /* missing type support */
35072     return(test_ret);
35073 }
35074
35075
35076 static int
35077 test_xmlSaveToFilename(void) {
35078     int test_ret = 0;
35079
35080
35081     /* missing type support */
35082     return(test_ret);
35083 }
35084
35085
35086 static int
35087 test_xmlSaveTree(void) {
35088     int test_ret = 0;
35089
35090 #if defined(LIBXML_OUTPUT_ENABLED)
35091     int mem_base;
35092     long ret_val;
35093     xmlSaveCtxtPtr ctxt; /* a document saving context */
35094     int n_ctxt;
35095     xmlNodePtr node; /* the top node of the subtree to save */
35096     int n_node;
35097
35098     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
35099     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35100         mem_base = xmlMemBlocks();
35101         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
35102         node = gen_xmlNodePtr(n_node, 1);
35103
35104         ret_val = xmlSaveTree(ctxt, node);
35105         desret_long(ret_val);
35106         call_tests++;
35107         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
35108         des_xmlNodePtr(n_node, node, 1);
35109         xmlResetLastError();
35110         if (mem_base != xmlMemBlocks()) {
35111             printf("Leak of %d blocks found in xmlSaveTree",
35112                    xmlMemBlocks() - mem_base);
35113             test_ret++;
35114             printf(" %d", n_ctxt);
35115             printf(" %d", n_node);
35116             printf("\n");
35117         }
35118     }
35119     }
35120     function_tests++;
35121 #endif
35122
35123     return(test_ret);
35124 }
35125
35126 static int
35127 test_xmlsave(void) {
35128     int test_ret = 0;
35129         int rc = 0;
35130
35131     if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
35132     rc = test_xmlSaveClose();
35133         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35134     rc = test_xmlSaveDoc();
35135         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35136     rc = test_xmlSaveFlush();
35137         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35138     rc = test_xmlSaveSetAttrEscape();
35139         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35140     rc = test_xmlSaveSetEscape();
35141         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35142     rc = test_xmlSaveToBuffer();
35143         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35144     rc = test_xmlSaveToFd();
35145         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35146     rc = test_xmlSaveToFilename();
35147         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35148     rc = test_xmlSaveTree();
35149         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35150
35151     if (test_ret != 0)
35152         printf("Module xmlsave: %d errors\n", test_ret);
35153     return(test_ret);
35154 }
35155
35156 static int
35157 test_xmlSchemaDump(void) {
35158     int test_ret = 0;
35159
35160 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
35161     int mem_base;
35162     FILE * output; /* the file output */
35163     int n_output;
35164     xmlSchemaPtr schema; /* a schema structure */
35165     int n_schema;
35166
35167     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
35168     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
35169         mem_base = xmlMemBlocks();
35170         output = gen_FILE_ptr(n_output, 0);
35171         schema = gen_xmlSchemaPtr(n_schema, 1);
35172
35173         xmlSchemaDump(output, schema);
35174         call_tests++;
35175         des_FILE_ptr(n_output, output, 0);
35176         des_xmlSchemaPtr(n_schema, schema, 1);
35177         xmlResetLastError();
35178         if (mem_base != xmlMemBlocks()) {
35179             printf("Leak of %d blocks found in xmlSchemaDump",
35180                    xmlMemBlocks() - mem_base);
35181             test_ret++;
35182             printf(" %d", n_output);
35183             printf(" %d", n_schema);
35184             printf("\n");
35185         }
35186     }
35187     }
35188     function_tests++;
35189 #endif
35190
35191     return(test_ret);
35192 }
35193
35194 #ifdef LIBXML_SCHEMAS_ENABLED
35195
35196 #define gen_nb_xmlSchemaParserCtxtPtr 1
35197 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35198     return(NULL);
35199 }
35200 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35201 }
35202 #endif
35203
35204 #ifdef LIBXML_SCHEMAS_ENABLED
35205
35206 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
35207 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35208     return(NULL);
35209 }
35210 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35211 }
35212 #endif
35213
35214 #ifdef LIBXML_SCHEMAS_ENABLED
35215
35216 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
35217 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35218     return(NULL);
35219 }
35220 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35221 }
35222 #endif
35223
35224
35225 static int
35226 test_xmlSchemaGetParserErrors(void) {
35227     int test_ret = 0;
35228
35229 #if defined(LIBXML_SCHEMAS_ENABLED)
35230     int mem_base;
35231     int ret_val;
35232     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
35233     int n_ctxt;
35234     xmlSchemaValidityErrorFunc * err; /* the error callback result */
35235     int n_err;
35236     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
35237     int n_warn;
35238     void ** ctx; /* contextual data for the callbacks result */
35239     int n_ctx;
35240
35241     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
35242     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
35243     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
35244     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
35245         mem_base = xmlMemBlocks();
35246         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
35247         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
35248         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
35249         ctx = gen_void_ptr_ptr(n_ctx, 3);
35250
35251         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
35252         desret_int(ret_val);
35253         call_tests++;
35254         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
35255         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
35256         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
35257         des_void_ptr_ptr(n_ctx, ctx, 3);
35258         xmlResetLastError();
35259         if (mem_base != xmlMemBlocks()) {
35260             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
35261                    xmlMemBlocks() - mem_base);
35262             test_ret++;
35263             printf(" %d", n_ctxt);
35264             printf(" %d", n_err);
35265             printf(" %d", n_warn);
35266             printf(" %d", n_ctx);
35267             printf("\n");
35268         }
35269     }
35270     }
35271     }
35272     }
35273     function_tests++;
35274 #endif
35275
35276     return(test_ret);
35277 }
35278
35279
35280 static int
35281 test_xmlSchemaGetValidErrors(void) {
35282     int test_ret = 0;
35283
35284 #if defined(LIBXML_SCHEMAS_ENABLED)
35285     int mem_base;
35286     int ret_val;
35287     xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
35288     int n_ctxt;
35289     xmlSchemaValidityErrorFunc * err; /* the error function result */
35290     int n_err;
35291     xmlSchemaValidityWarningFunc * warn; /* the warning function result */
35292     int n_warn;
35293     void ** ctx; /* the functions context result */
35294     int n_ctx;
35295
35296     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35297     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
35298     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
35299     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
35300         mem_base = xmlMemBlocks();
35301         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35302         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
35303         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
35304         ctx = gen_void_ptr_ptr(n_ctx, 3);
35305
35306         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
35307         desret_int(ret_val);
35308         call_tests++;
35309         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35310         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
35311         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
35312         des_void_ptr_ptr(n_ctx, ctx, 3);
35313         xmlResetLastError();
35314         if (mem_base != xmlMemBlocks()) {
35315             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
35316                    xmlMemBlocks() - mem_base);
35317             test_ret++;
35318             printf(" %d", n_ctxt);
35319             printf(" %d", n_err);
35320             printf(" %d", n_warn);
35321             printf(" %d", n_ctx);
35322             printf("\n");
35323         }
35324     }
35325     }
35326     }
35327     }
35328     function_tests++;
35329 #endif
35330
35331     return(test_ret);
35332 }
35333
35334
35335 static int
35336 test_xmlSchemaIsValid(void) {
35337     int test_ret = 0;
35338
35339 #if defined(LIBXML_SCHEMAS_ENABLED)
35340     int mem_base;
35341     int ret_val;
35342     xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
35343     int n_ctxt;
35344
35345     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35346         mem_base = xmlMemBlocks();
35347         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35348
35349         ret_val = xmlSchemaIsValid(ctxt);
35350         desret_int(ret_val);
35351         call_tests++;
35352         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35353         xmlResetLastError();
35354         if (mem_base != xmlMemBlocks()) {
35355             printf("Leak of %d blocks found in xmlSchemaIsValid",
35356                    xmlMemBlocks() - mem_base);
35357             test_ret++;
35358             printf(" %d", n_ctxt);
35359             printf("\n");
35360         }
35361     }
35362     function_tests++;
35363 #endif
35364
35365     return(test_ret);
35366 }
35367
35368
35369 static int
35370 test_xmlSchemaNewDocParserCtxt(void) {
35371     int test_ret = 0;
35372
35373 #if defined(LIBXML_SCHEMAS_ENABLED)
35374     int mem_base;
35375     xmlSchemaParserCtxtPtr ret_val;
35376     xmlDocPtr doc; /* a preparsed document tree */
35377     int n_doc;
35378
35379     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
35380         mem_base = xmlMemBlocks();
35381         doc = gen_xmlDocPtr(n_doc, 0);
35382
35383         ret_val = xmlSchemaNewDocParserCtxt(doc);
35384         desret_xmlSchemaParserCtxtPtr(ret_val);
35385         call_tests++;
35386         des_xmlDocPtr(n_doc, doc, 0);
35387         xmlResetLastError();
35388         if (mem_base != xmlMemBlocks()) {
35389             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
35390                    xmlMemBlocks() - mem_base);
35391             test_ret++;
35392             printf(" %d", n_doc);
35393             printf("\n");
35394         }
35395     }
35396     function_tests++;
35397 #endif
35398
35399     return(test_ret);
35400 }
35401
35402
35403 static int
35404 test_xmlSchemaNewMemParserCtxt(void) {
35405     int test_ret = 0;
35406
35407 #if defined(LIBXML_SCHEMAS_ENABLED)
35408     int mem_base;
35409     xmlSchemaParserCtxtPtr ret_val;
35410     char * buffer; /* a pointer to a char array containing the schemas */
35411     int n_buffer;
35412     int size; /* the size of the array */
35413     int n_size;
35414
35415     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
35416     for (n_size = 0;n_size < gen_nb_int;n_size++) {
35417         mem_base = xmlMemBlocks();
35418         buffer = gen_const_char_ptr(n_buffer, 0);
35419         size = gen_int(n_size, 1);
35420         if ((buffer != NULL) &&
35421             (size > (int) strlen((const char *) buffer) + 1))
35422             continue;
35423
35424         ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
35425         desret_xmlSchemaParserCtxtPtr(ret_val);
35426         call_tests++;
35427         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
35428         des_int(n_size, size, 1);
35429         xmlResetLastError();
35430         if (mem_base != xmlMemBlocks()) {
35431             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
35432                    xmlMemBlocks() - mem_base);
35433             test_ret++;
35434             printf(" %d", n_buffer);
35435             printf(" %d", n_size);
35436             printf("\n");
35437         }
35438     }
35439     }
35440     function_tests++;
35441 #endif
35442
35443     return(test_ret);
35444 }
35445
35446
35447 static int
35448 test_xmlSchemaNewParserCtxt(void) {
35449     int test_ret = 0;
35450
35451 #if defined(LIBXML_SCHEMAS_ENABLED)
35452     int mem_base;
35453     xmlSchemaParserCtxtPtr ret_val;
35454     char * URL; /* the location of the schema */
35455     int n_URL;
35456
35457     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
35458         mem_base = xmlMemBlocks();
35459         URL = gen_const_char_ptr(n_URL, 0);
35460
35461         ret_val = xmlSchemaNewParserCtxt((const char *)URL);
35462         desret_xmlSchemaParserCtxtPtr(ret_val);
35463         call_tests++;
35464         des_const_char_ptr(n_URL, (const char *)URL, 0);
35465         xmlResetLastError();
35466         if (mem_base != xmlMemBlocks()) {
35467             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
35468                    xmlMemBlocks() - mem_base);
35469             test_ret++;
35470             printf(" %d", n_URL);
35471             printf("\n");
35472         }
35473     }
35474     function_tests++;
35475 #endif
35476
35477     return(test_ret);
35478 }
35479
35480
35481 static int
35482 test_xmlSchemaNewValidCtxt(void) {
35483     int test_ret = 0;
35484
35485
35486     /* missing type support */
35487     return(test_ret);
35488 }
35489
35490
35491 static int
35492 test_xmlSchemaParse(void) {
35493     int test_ret = 0;
35494
35495
35496     /* missing type support */
35497     return(test_ret);
35498 }
35499
35500 #ifdef LIBXML_SCHEMAS_ENABLED
35501
35502 #define gen_nb_xmlSAXHandlerPtr_ptr 1
35503 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35504     return(NULL);
35505 }
35506 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35507 }
35508 #endif
35509
35510
35511 static int
35512 test_xmlSchemaSAXPlug(void) {
35513     int test_ret = 0;
35514
35515
35516     /* missing type support */
35517     return(test_ret);
35518 }
35519
35520 #ifdef LIBXML_SCHEMAS_ENABLED
35521
35522 #define gen_nb_xmlSchemaSAXPlugPtr 1
35523 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35524     return(NULL);
35525 }
35526 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35527 }
35528 #endif
35529
35530
35531 static int
35532 test_xmlSchemaSAXUnplug(void) {
35533     int test_ret = 0;
35534
35535 #if defined(LIBXML_SCHEMAS_ENABLED)
35536     int mem_base;
35537     int ret_val;
35538     xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
35539     int n_plug;
35540
35541     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
35542         mem_base = xmlMemBlocks();
35543         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
35544
35545         ret_val = xmlSchemaSAXUnplug(plug);
35546         desret_int(ret_val);
35547         call_tests++;
35548         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
35549         xmlResetLastError();
35550         if (mem_base != xmlMemBlocks()) {
35551             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
35552                    xmlMemBlocks() - mem_base);
35553             test_ret++;
35554             printf(" %d", n_plug);
35555             printf("\n");
35556         }
35557     }
35558     function_tests++;
35559 #endif
35560
35561     return(test_ret);
35562 }
35563
35564
35565 static int
35566 test_xmlSchemaSetParserErrors(void) {
35567     int test_ret = 0;
35568
35569
35570     /* missing type support */
35571     return(test_ret);
35572 }
35573
35574
35575 static int
35576 test_xmlSchemaSetParserStructuredErrors(void) {
35577     int test_ret = 0;
35578
35579
35580     /* missing type support */
35581     return(test_ret);
35582 }
35583
35584
35585 static int
35586 test_xmlSchemaSetValidErrors(void) {
35587     int test_ret = 0;
35588
35589
35590     /* missing type support */
35591     return(test_ret);
35592 }
35593
35594
35595 static int
35596 test_xmlSchemaSetValidOptions(void) {
35597     int test_ret = 0;
35598
35599 #if defined(LIBXML_SCHEMAS_ENABLED)
35600     int mem_base;
35601     int ret_val;
35602     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35603     int n_ctxt;
35604     int options; /* a combination of xmlSchemaValidOption */
35605     int n_options;
35606
35607     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35608     for (n_options = 0;n_options < gen_nb_int;n_options++) {
35609         mem_base = xmlMemBlocks();
35610         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35611         options = gen_int(n_options, 1);
35612
35613         ret_val = xmlSchemaSetValidOptions(ctxt, options);
35614         desret_int(ret_val);
35615         call_tests++;
35616         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35617         des_int(n_options, options, 1);
35618         xmlResetLastError();
35619         if (mem_base != xmlMemBlocks()) {
35620             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
35621                    xmlMemBlocks() - mem_base);
35622             test_ret++;
35623             printf(" %d", n_ctxt);
35624             printf(" %d", n_options);
35625             printf("\n");
35626         }
35627     }
35628     }
35629     function_tests++;
35630 #endif
35631
35632     return(test_ret);
35633 }
35634
35635
35636 static int
35637 test_xmlSchemaSetValidStructuredErrors(void) {
35638     int test_ret = 0;
35639
35640
35641     /* missing type support */
35642     return(test_ret);
35643 }
35644
35645
35646 static int
35647 test_xmlSchemaValidCtxtGetOptions(void) {
35648     int test_ret = 0;
35649
35650 #if defined(LIBXML_SCHEMAS_ENABLED)
35651     int mem_base;
35652     int ret_val;
35653     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35654     int n_ctxt;
35655
35656     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35657         mem_base = xmlMemBlocks();
35658         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35659
35660         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
35661         desret_int(ret_val);
35662         call_tests++;
35663         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35664         xmlResetLastError();
35665         if (mem_base != xmlMemBlocks()) {
35666             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
35667                    xmlMemBlocks() - mem_base);
35668             test_ret++;
35669             printf(" %d", n_ctxt);
35670             printf("\n");
35671         }
35672     }
35673     function_tests++;
35674 #endif
35675
35676     return(test_ret);
35677 }
35678
35679
35680 static int
35681 test_xmlSchemaValidCtxtGetParserCtxt(void) {
35682     int test_ret = 0;
35683
35684 #if defined(LIBXML_SCHEMAS_ENABLED)
35685     int mem_base;
35686     xmlParserCtxtPtr ret_val;
35687     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35688     int n_ctxt;
35689
35690     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35691         mem_base = xmlMemBlocks();
35692         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35693
35694         ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
35695         desret_xmlParserCtxtPtr(ret_val);
35696         call_tests++;
35697         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35698         xmlResetLastError();
35699         if (mem_base != xmlMemBlocks()) {
35700             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
35701                    xmlMemBlocks() - mem_base);
35702             test_ret++;
35703             printf(" %d", n_ctxt);
35704             printf("\n");
35705         }
35706     }
35707     function_tests++;
35708 #endif
35709
35710     return(test_ret);
35711 }
35712
35713
35714 static int
35715 test_xmlSchemaValidateDoc(void) {
35716     int test_ret = 0;
35717
35718 #if defined(LIBXML_SCHEMAS_ENABLED)
35719     int mem_base;
35720     int ret_val;
35721     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35722     int n_ctxt;
35723     xmlDocPtr doc; /* a parsed document tree */
35724     int n_doc;
35725
35726     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35727     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
35728         mem_base = xmlMemBlocks();
35729         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35730         doc = gen_xmlDocPtr(n_doc, 1);
35731
35732         ret_val = xmlSchemaValidateDoc(ctxt, doc);
35733         desret_int(ret_val);
35734         call_tests++;
35735         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35736         des_xmlDocPtr(n_doc, doc, 1);
35737         xmlResetLastError();
35738         if (mem_base != xmlMemBlocks()) {
35739             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
35740                    xmlMemBlocks() - mem_base);
35741             test_ret++;
35742             printf(" %d", n_ctxt);
35743             printf(" %d", n_doc);
35744             printf("\n");
35745         }
35746     }
35747     }
35748     function_tests++;
35749 #endif
35750
35751     return(test_ret);
35752 }
35753
35754
35755 static int
35756 test_xmlSchemaValidateFile(void) {
35757     int test_ret = 0;
35758
35759 #if defined(LIBXML_SCHEMAS_ENABLED)
35760     int mem_base;
35761     int ret_val;
35762     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35763     int n_ctxt;
35764     const char * filename; /* the URI of the instance */
35765     int n_filename;
35766     int options; /* a future set of options, currently unused */
35767     int n_options;
35768
35769     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35770     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
35771     for (n_options = 0;n_options < gen_nb_int;n_options++) {
35772         mem_base = xmlMemBlocks();
35773         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35774         filename = gen_filepath(n_filename, 1);
35775         options = gen_int(n_options, 2);
35776
35777         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
35778         desret_int(ret_val);
35779         call_tests++;
35780         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35781         des_filepath(n_filename, filename, 1);
35782         des_int(n_options, options, 2);
35783         xmlResetLastError();
35784         if (mem_base != xmlMemBlocks()) {
35785             printf("Leak of %d blocks found in xmlSchemaValidateFile",
35786                    xmlMemBlocks() - mem_base);
35787             test_ret++;
35788             printf(" %d", n_ctxt);
35789             printf(" %d", n_filename);
35790             printf(" %d", n_options);
35791             printf("\n");
35792         }
35793     }
35794     }
35795     }
35796     function_tests++;
35797 #endif
35798
35799     return(test_ret);
35800 }
35801
35802
35803 static int
35804 test_xmlSchemaValidateOneElement(void) {
35805     int test_ret = 0;
35806
35807 #if defined(LIBXML_SCHEMAS_ENABLED)
35808     int mem_base;
35809     int ret_val;
35810     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35811     int n_ctxt;
35812     xmlNodePtr elem; /* an element node */
35813     int n_elem;
35814
35815     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35816     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
35817         mem_base = xmlMemBlocks();
35818         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35819         elem = gen_xmlNodePtr(n_elem, 1);
35820
35821         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
35822         desret_int(ret_val);
35823         call_tests++;
35824         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35825         des_xmlNodePtr(n_elem, elem, 1);
35826         xmlResetLastError();
35827         if (mem_base != xmlMemBlocks()) {
35828             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
35829                    xmlMemBlocks() - mem_base);
35830             test_ret++;
35831             printf(" %d", n_ctxt);
35832             printf(" %d", n_elem);
35833             printf("\n");
35834         }
35835     }
35836     }
35837     function_tests++;
35838 #endif
35839
35840     return(test_ret);
35841 }
35842
35843
35844 static int
35845 test_xmlSchemaValidateSetFilename(void) {
35846     int test_ret = 0;
35847
35848 #if defined(LIBXML_SCHEMAS_ENABLED)
35849     int mem_base;
35850     xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
35851     int n_vctxt;
35852     const char * filename; /* the file name */
35853     int n_filename;
35854
35855     for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
35856     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
35857         mem_base = xmlMemBlocks();
35858         vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
35859         filename = gen_filepath(n_filename, 1);
35860
35861         xmlSchemaValidateSetFilename(vctxt, filename);
35862         call_tests++;
35863         des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
35864         des_filepath(n_filename, filename, 1);
35865         xmlResetLastError();
35866         if (mem_base != xmlMemBlocks()) {
35867             printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
35868                    xmlMemBlocks() - mem_base);
35869             test_ret++;
35870             printf(" %d", n_vctxt);
35871             printf(" %d", n_filename);
35872             printf("\n");
35873         }
35874     }
35875     }
35876     function_tests++;
35877 #endif
35878
35879     return(test_ret);
35880 }
35881
35882
35883 static int
35884 test_xmlSchemaValidateSetLocator(void) {
35885     int test_ret = 0;
35886
35887
35888     /* missing type support */
35889     return(test_ret);
35890 }
35891
35892
35893 static int
35894 test_xmlSchemaValidateStream(void) {
35895     int test_ret = 0;
35896
35897 #if defined(LIBXML_SCHEMAS_ENABLED)
35898     int mem_base;
35899     int ret_val;
35900     xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
35901     int n_ctxt;
35902     xmlParserInputBufferPtr input; /* the input to use for reading the data */
35903     int n_input;
35904     xmlCharEncoding enc; /* an optional encoding information */
35905     int n_enc;
35906     xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
35907     int n_sax;
35908     void * user_data; /* the context to provide to the SAX handler. */
35909     int n_user_data;
35910
35911     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
35912     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
35913     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
35914     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
35915     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
35916         mem_base = xmlMemBlocks();
35917         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
35918         input = gen_xmlParserInputBufferPtr(n_input, 1);
35919         enc = gen_xmlCharEncoding(n_enc, 2);
35920         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
35921         user_data = gen_userdata(n_user_data, 4);
35922
35923         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
35924         desret_int(ret_val);
35925         call_tests++;
35926         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
35927         des_xmlParserInputBufferPtr(n_input, input, 1);
35928         des_xmlCharEncoding(n_enc, enc, 2);
35929         des_xmlSAXHandlerPtr(n_sax, sax, 3);
35930         des_userdata(n_user_data, user_data, 4);
35931         xmlResetLastError();
35932         if (mem_base != xmlMemBlocks()) {
35933             printf("Leak of %d blocks found in xmlSchemaValidateStream",
35934                    xmlMemBlocks() - mem_base);
35935             test_ret++;
35936             printf(" %d", n_ctxt);
35937             printf(" %d", n_input);
35938             printf(" %d", n_enc);
35939             printf(" %d", n_sax);
35940             printf(" %d", n_user_data);
35941             printf("\n");
35942         }
35943     }
35944     }
35945     }
35946     }
35947     }
35948     function_tests++;
35949 #endif
35950
35951     return(test_ret);
35952 }
35953
35954 static int
35955 test_xmlschemas(void) {
35956     int test_ret = 0;
35957         int rc = 0;
35958
35959     if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
35960     rc = test_xmlSchemaDump();
35961         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35962     rc = test_xmlSchemaGetParserErrors();
35963         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35964     rc = test_xmlSchemaGetValidErrors();
35965         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35966     rc = test_xmlSchemaIsValid();
35967         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35968     rc = test_xmlSchemaNewDocParserCtxt();
35969         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35970     rc = test_xmlSchemaNewMemParserCtxt();
35971         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35972     rc = test_xmlSchemaNewParserCtxt();
35973         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35974     rc = test_xmlSchemaNewValidCtxt();
35975         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35976     rc = test_xmlSchemaParse();
35977         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35978     rc = test_xmlSchemaSAXPlug();
35979         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35980     rc = test_xmlSchemaSAXUnplug();
35981         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35982     rc = test_xmlSchemaSetParserErrors();
35983         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35984     rc = test_xmlSchemaSetParserStructuredErrors();
35985         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35986     rc = test_xmlSchemaSetValidErrors();
35987         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35988     rc = test_xmlSchemaSetValidOptions();
35989         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35990     rc = test_xmlSchemaSetValidStructuredErrors();
35991         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35992     rc = test_xmlSchemaValidCtxtGetOptions();
35993         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35994     rc = test_xmlSchemaValidCtxtGetParserCtxt();
35995         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35996     rc = test_xmlSchemaValidateDoc();
35997         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
35998     rc = test_xmlSchemaValidateFile();
35999         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
36000     rc = test_xmlSchemaValidateOneElement();
36001         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
36002     rc = test_xmlSchemaValidateSetFilename();
36003         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
36004     rc = test_xmlSchemaValidateSetLocator();
36005         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
36006     rc = test_xmlSchemaValidateStream();
36007         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
36008
36009     if (test_ret != 0)
36010         printf("Module xmlschemas: %d errors\n", test_ret);
36011     return(test_ret);
36012 }
36013 #ifdef LIBXML_SCHEMAS_ENABLED
36014
36015 #define gen_nb_xmlSchemaFacetPtr 1
36016 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36017     return(NULL);
36018 }
36019 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36020 }
36021 #endif
36022
36023 #ifdef LIBXML_SCHEMAS_ENABLED
36024
36025 #define gen_nb_xmlSchemaTypePtr 1
36026 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36027     return(NULL);
36028 }
36029 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36030 }
36031 #endif
36032
36033
36034 static int
36035 test_xmlSchemaCheckFacet(void) {
36036     int test_ret = 0;
36037
36038 #if defined(LIBXML_SCHEMAS_ENABLED)
36039     int mem_base;
36040     int ret_val;
36041     xmlSchemaFacetPtr facet; /* the facet */
36042     int n_facet;
36043     xmlSchemaTypePtr typeDecl; /* the schema type definition */
36044     int n_typeDecl;
36045     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
36046     int n_pctxt;
36047     xmlChar * name; /* the optional name of the type */
36048     int n_name;
36049
36050     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36051     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
36052     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
36053     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36054         mem_base = xmlMemBlocks();
36055         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36056         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
36057         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
36058         name = gen_const_xmlChar_ptr(n_name, 3);
36059
36060         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
36061         desret_int(ret_val);
36062         call_tests++;
36063         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36064         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
36065         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
36066         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
36067         xmlResetLastError();
36068         if (mem_base != xmlMemBlocks()) {
36069             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
36070                    xmlMemBlocks() - mem_base);
36071             test_ret++;
36072             printf(" %d", n_facet);
36073             printf(" %d", n_typeDecl);
36074             printf(" %d", n_pctxt);
36075             printf(" %d", n_name);
36076             printf("\n");
36077         }
36078     }
36079     }
36080     }
36081     }
36082     function_tests++;
36083 #endif
36084
36085     return(test_ret);
36086 }
36087
36088
36089 static int
36090 test_xmlSchemaCleanupTypes(void) {
36091     int test_ret = 0;
36092
36093 #if defined(LIBXML_SCHEMAS_ENABLED)
36094
36095
36096         xmlSchemaCleanupTypes();
36097         call_tests++;
36098         xmlResetLastError();
36099     function_tests++;
36100 #endif
36101
36102     return(test_ret);
36103 }
36104
36105
36106 static int
36107 test_xmlSchemaCollapseString(void) {
36108     int test_ret = 0;
36109
36110 #if defined(LIBXML_SCHEMAS_ENABLED)
36111     int mem_base;
36112     xmlChar * ret_val;
36113     xmlChar * value; /* a value */
36114     int n_value;
36115
36116     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36117         mem_base = xmlMemBlocks();
36118         value = gen_const_xmlChar_ptr(n_value, 0);
36119
36120         ret_val = xmlSchemaCollapseString((const xmlChar *)value);
36121         desret_xmlChar_ptr(ret_val);
36122         call_tests++;
36123         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
36124         xmlResetLastError();
36125         if (mem_base != xmlMemBlocks()) {
36126             printf("Leak of %d blocks found in xmlSchemaCollapseString",
36127                    xmlMemBlocks() - mem_base);
36128             test_ret++;
36129             printf(" %d", n_value);
36130             printf("\n");
36131         }
36132     }
36133     function_tests++;
36134 #endif
36135
36136     return(test_ret);
36137 }
36138
36139 #ifdef LIBXML_SCHEMAS_ENABLED
36140
36141 #define gen_nb_xmlSchemaValPtr 1
36142 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36143     return(NULL);
36144 }
36145 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36146 }
36147 #endif
36148
36149
36150 static int
36151 test_xmlSchemaCompareValues(void) {
36152     int test_ret = 0;
36153
36154 #if defined(LIBXML_SCHEMAS_ENABLED)
36155     int mem_base;
36156     int ret_val;
36157     xmlSchemaValPtr x; /* a first value */
36158     int n_x;
36159     xmlSchemaValPtr y; /* a second value */
36160     int n_y;
36161
36162     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
36163     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
36164         mem_base = xmlMemBlocks();
36165         x = gen_xmlSchemaValPtr(n_x, 0);
36166         y = gen_xmlSchemaValPtr(n_y, 1);
36167
36168         ret_val = xmlSchemaCompareValues(x, y);
36169         desret_int(ret_val);
36170         call_tests++;
36171         des_xmlSchemaValPtr(n_x, x, 0);
36172         des_xmlSchemaValPtr(n_y, y, 1);
36173         xmlResetLastError();
36174         if (mem_base != xmlMemBlocks()) {
36175             printf("Leak of %d blocks found in xmlSchemaCompareValues",
36176                    xmlMemBlocks() - mem_base);
36177             test_ret++;
36178             printf(" %d", n_x);
36179             printf(" %d", n_y);
36180             printf("\n");
36181         }
36182     }
36183     }
36184     function_tests++;
36185 #endif
36186
36187     return(test_ret);
36188 }
36189
36190
36191 static int
36192 test_xmlSchemaCompareValuesWhtsp(void) {
36193     int test_ret = 0;
36194
36195 #if defined(LIBXML_SCHEMAS_ENABLED)
36196     int mem_base;
36197     int ret_val;
36198     xmlSchemaValPtr x; /* a first value */
36199     int n_x;
36200     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
36201     int n_xws;
36202     xmlSchemaValPtr y; /* a second value */
36203     int n_y;
36204     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
36205     int n_yws;
36206
36207     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
36208     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
36209     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
36210     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
36211         mem_base = xmlMemBlocks();
36212         x = gen_xmlSchemaValPtr(n_x, 0);
36213         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
36214         y = gen_xmlSchemaValPtr(n_y, 2);
36215         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
36216
36217         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
36218         desret_int(ret_val);
36219         call_tests++;
36220         des_xmlSchemaValPtr(n_x, x, 0);
36221         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
36222         des_xmlSchemaValPtr(n_y, y, 2);
36223         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
36224         xmlResetLastError();
36225         if (mem_base != xmlMemBlocks()) {
36226             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
36227                    xmlMemBlocks() - mem_base);
36228             test_ret++;
36229             printf(" %d", n_x);
36230             printf(" %d", n_xws);
36231             printf(" %d", n_y);
36232             printf(" %d", n_yws);
36233             printf("\n");
36234         }
36235     }
36236     }
36237     }
36238     }
36239     function_tests++;
36240 #endif
36241
36242     return(test_ret);
36243 }
36244
36245
36246 static int
36247 test_xmlSchemaCopyValue(void) {
36248     int test_ret = 0;
36249
36250
36251     /* missing type support */
36252     return(test_ret);
36253 }
36254
36255
36256 static int
36257 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
36258     int test_ret = 0;
36259
36260 #if defined(LIBXML_SCHEMAS_ENABLED)
36261     int mem_base;
36262     xmlSchemaTypePtr ret_val;
36263     xmlSchemaTypePtr type; /* the built-in simple type. */
36264     int n_type;
36265
36266     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36267         mem_base = xmlMemBlocks();
36268         type = gen_xmlSchemaTypePtr(n_type, 0);
36269
36270         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
36271         desret_xmlSchemaTypePtr(ret_val);
36272         call_tests++;
36273         des_xmlSchemaTypePtr(n_type, type, 0);
36274         xmlResetLastError();
36275         if (mem_base != xmlMemBlocks()) {
36276             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
36277                    xmlMemBlocks() - mem_base);
36278             test_ret++;
36279             printf(" %d", n_type);
36280             printf("\n");
36281         }
36282     }
36283     function_tests++;
36284 #endif
36285
36286     return(test_ret);
36287 }
36288
36289
36290 static int
36291 test_xmlSchemaGetBuiltInType(void) {
36292     int test_ret = 0;
36293
36294 #if defined(LIBXML_SCHEMAS_ENABLED)
36295     xmlSchemaTypePtr ret_val;
36296     xmlSchemaValType type; /* the type of the built in type */
36297     int n_type;
36298
36299     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
36300         type = gen_xmlSchemaValType(n_type, 0);
36301
36302         ret_val = xmlSchemaGetBuiltInType(type);
36303         desret_xmlSchemaTypePtr(ret_val);
36304         call_tests++;
36305         des_xmlSchemaValType(n_type, type, 0);
36306         xmlResetLastError();
36307     }
36308     function_tests++;
36309 #endif
36310
36311     return(test_ret);
36312 }
36313
36314
36315 static int
36316 test_xmlSchemaGetCanonValue(void) {
36317     int test_ret = 0;
36318
36319 #if defined(LIBXML_SCHEMAS_ENABLED)
36320     int mem_base;
36321     int ret_val;
36322     xmlSchemaValPtr val; /* the precomputed value */
36323     int n_val;
36324     xmlChar ** retValue; /* the returned value */
36325     int n_retValue;
36326
36327     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36328     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
36329         mem_base = xmlMemBlocks();
36330         val = gen_xmlSchemaValPtr(n_val, 0);
36331         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
36332
36333         ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
36334         desret_int(ret_val);
36335         call_tests++;
36336         des_xmlSchemaValPtr(n_val, val, 0);
36337         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
36338         xmlResetLastError();
36339         if (mem_base != xmlMemBlocks()) {
36340             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
36341                    xmlMemBlocks() - mem_base);
36342             test_ret++;
36343             printf(" %d", n_val);
36344             printf(" %d", n_retValue);
36345             printf("\n");
36346         }
36347     }
36348     }
36349     function_tests++;
36350 #endif
36351
36352     return(test_ret);
36353 }
36354
36355
36356 static int
36357 test_xmlSchemaGetCanonValueWhtsp(void) {
36358     int test_ret = 0;
36359
36360 #if defined(LIBXML_SCHEMAS_ENABLED)
36361     int mem_base;
36362     int ret_val;
36363     xmlSchemaValPtr val; /* the precomputed value */
36364     int n_val;
36365     xmlChar ** retValue; /* the returned value */
36366     int n_retValue;
36367     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36368     int n_ws;
36369
36370     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36371     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
36372     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36373         mem_base = xmlMemBlocks();
36374         val = gen_xmlSchemaValPtr(n_val, 0);
36375         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
36376         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
36377
36378         ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
36379         desret_int(ret_val);
36380         call_tests++;
36381         des_xmlSchemaValPtr(n_val, val, 0);
36382         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
36383         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
36384         xmlResetLastError();
36385         if (mem_base != xmlMemBlocks()) {
36386             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
36387                    xmlMemBlocks() - mem_base);
36388             test_ret++;
36389             printf(" %d", n_val);
36390             printf(" %d", n_retValue);
36391             printf(" %d", n_ws);
36392             printf("\n");
36393         }
36394     }
36395     }
36396     }
36397     function_tests++;
36398 #endif
36399
36400     return(test_ret);
36401 }
36402
36403
36404 static int
36405 test_xmlSchemaGetFacetValueAsULong(void) {
36406     int test_ret = 0;
36407
36408 #if defined(LIBXML_SCHEMAS_ENABLED)
36409     int mem_base;
36410     unsigned long ret_val;
36411     xmlSchemaFacetPtr facet; /* an schemas type facet */
36412     int n_facet;
36413
36414     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36415         mem_base = xmlMemBlocks();
36416         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36417
36418         ret_val = xmlSchemaGetFacetValueAsULong(facet);
36419         desret_unsigned_long(ret_val);
36420         call_tests++;
36421         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36422         xmlResetLastError();
36423         if (mem_base != xmlMemBlocks()) {
36424             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
36425                    xmlMemBlocks() - mem_base);
36426             test_ret++;
36427             printf(" %d", n_facet);
36428             printf("\n");
36429         }
36430     }
36431     function_tests++;
36432 #endif
36433
36434     return(test_ret);
36435 }
36436
36437
36438 static int
36439 test_xmlSchemaGetPredefinedType(void) {
36440     int test_ret = 0;
36441
36442 #if defined(LIBXML_SCHEMAS_ENABLED)
36443     int mem_base;
36444     xmlSchemaTypePtr ret_val;
36445     xmlChar * name; /* the type name */
36446     int n_name;
36447     xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
36448     int n_ns;
36449
36450     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36451     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
36452         mem_base = xmlMemBlocks();
36453         name = gen_const_xmlChar_ptr(n_name, 0);
36454         ns = gen_const_xmlChar_ptr(n_ns, 1);
36455
36456         ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
36457         desret_xmlSchemaTypePtr(ret_val);
36458         call_tests++;
36459         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
36460         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
36461         xmlResetLastError();
36462         if (mem_base != xmlMemBlocks()) {
36463             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
36464                    xmlMemBlocks() - mem_base);
36465             test_ret++;
36466             printf(" %d", n_name);
36467             printf(" %d", n_ns);
36468             printf("\n");
36469         }
36470     }
36471     }
36472     function_tests++;
36473 #endif
36474
36475     return(test_ret);
36476 }
36477
36478
36479 static int
36480 test_xmlSchemaGetValType(void) {
36481     int test_ret = 0;
36482
36483 #if defined(LIBXML_SCHEMAS_ENABLED)
36484     int mem_base;
36485     xmlSchemaValType ret_val;
36486     xmlSchemaValPtr val; /* a schemas value */
36487     int n_val;
36488
36489     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36490         mem_base = xmlMemBlocks();
36491         val = gen_xmlSchemaValPtr(n_val, 0);
36492
36493         ret_val = xmlSchemaGetValType(val);
36494         desret_xmlSchemaValType(ret_val);
36495         call_tests++;
36496         des_xmlSchemaValPtr(n_val, val, 0);
36497         xmlResetLastError();
36498         if (mem_base != xmlMemBlocks()) {
36499             printf("Leak of %d blocks found in xmlSchemaGetValType",
36500                    xmlMemBlocks() - mem_base);
36501             test_ret++;
36502             printf(" %d", n_val);
36503             printf("\n");
36504         }
36505     }
36506     function_tests++;
36507 #endif
36508
36509     return(test_ret);
36510 }
36511
36512
36513 static int
36514 test_xmlSchemaInitTypes(void) {
36515     int test_ret = 0;
36516
36517 #if defined(LIBXML_SCHEMAS_ENABLED)
36518
36519
36520         xmlSchemaInitTypes();
36521         call_tests++;
36522         xmlResetLastError();
36523     function_tests++;
36524 #endif
36525
36526     return(test_ret);
36527 }
36528
36529
36530 static int
36531 test_xmlSchemaIsBuiltInTypeFacet(void) {
36532     int test_ret = 0;
36533
36534 #if defined(LIBXML_SCHEMAS_ENABLED)
36535     int mem_base;
36536     int ret_val;
36537     xmlSchemaTypePtr type; /* the built-in type */
36538     int n_type;
36539     int facetType; /* the facet type */
36540     int n_facetType;
36541
36542     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36543     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
36544         mem_base = xmlMemBlocks();
36545         type = gen_xmlSchemaTypePtr(n_type, 0);
36546         facetType = gen_int(n_facetType, 1);
36547
36548         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
36549         desret_int(ret_val);
36550         call_tests++;
36551         des_xmlSchemaTypePtr(n_type, type, 0);
36552         des_int(n_facetType, facetType, 1);
36553         xmlResetLastError();
36554         if (mem_base != xmlMemBlocks()) {
36555             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
36556                    xmlMemBlocks() - mem_base);
36557             test_ret++;
36558             printf(" %d", n_type);
36559             printf(" %d", n_facetType);
36560             printf("\n");
36561         }
36562     }
36563     }
36564     function_tests++;
36565 #endif
36566
36567     return(test_ret);
36568 }
36569
36570
36571 static int
36572 test_xmlSchemaNewFacet(void) {
36573     int test_ret = 0;
36574
36575
36576     /* missing type support */
36577     return(test_ret);
36578 }
36579
36580
36581 static int
36582 test_xmlSchemaNewNOTATIONValue(void) {
36583     int test_ret = 0;
36584
36585
36586     /* missing type support */
36587     return(test_ret);
36588 }
36589
36590
36591 static int
36592 test_xmlSchemaNewQNameValue(void) {
36593     int test_ret = 0;
36594
36595
36596     /* missing type support */
36597     return(test_ret);
36598 }
36599
36600
36601 static int
36602 test_xmlSchemaNewStringValue(void) {
36603     int test_ret = 0;
36604
36605
36606     /* missing type support */
36607     return(test_ret);
36608 }
36609
36610 #ifdef LIBXML_SCHEMAS_ENABLED
36611
36612 #define gen_nb_xmlSchemaValPtr_ptr 1
36613 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36614     return(NULL);
36615 }
36616 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
36617 }
36618 #endif
36619
36620
36621 static int
36622 test_xmlSchemaValPredefTypeNode(void) {
36623     int test_ret = 0;
36624
36625 #if defined(LIBXML_SCHEMAS_ENABLED)
36626     int mem_base;
36627     int ret_val;
36628     xmlSchemaTypePtr type; /* the predefined type */
36629     int n_type;
36630     xmlChar * value; /* the value to check */
36631     int n_value;
36632     xmlSchemaValPtr * val; /* the return computed value */
36633     int n_val;
36634     xmlNodePtr node; /* the node containing the value */
36635     int n_node;
36636
36637     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36638     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36639     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36640     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
36641         mem_base = xmlMemBlocks();
36642         type = gen_xmlSchemaTypePtr(n_type, 0);
36643         value = gen_const_xmlChar_ptr(n_value, 1);
36644         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36645         node = gen_xmlNodePtr(n_node, 3);
36646
36647         ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
36648         desret_int(ret_val);
36649         call_tests++;
36650         des_xmlSchemaTypePtr(n_type, type, 0);
36651         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36652         des_xmlSchemaValPtr_ptr(n_val, val, 2);
36653         des_xmlNodePtr(n_node, node, 3);
36654         xmlResetLastError();
36655         if (mem_base != xmlMemBlocks()) {
36656             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
36657                    xmlMemBlocks() - mem_base);
36658             test_ret++;
36659             printf(" %d", n_type);
36660             printf(" %d", n_value);
36661             printf(" %d", n_val);
36662             printf(" %d", n_node);
36663             printf("\n");
36664         }
36665     }
36666     }
36667     }
36668     }
36669     function_tests++;
36670 #endif
36671
36672     return(test_ret);
36673 }
36674
36675
36676 static int
36677 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
36678     int test_ret = 0;
36679
36680 #if defined(LIBXML_SCHEMAS_ENABLED)
36681     int mem_base;
36682     int ret_val;
36683     xmlSchemaTypePtr type; /* the predefined type */
36684     int n_type;
36685     xmlChar * value; /* the value to check */
36686     int n_value;
36687     xmlSchemaValPtr * val; /* the return computed value */
36688     int n_val;
36689     xmlNodePtr node; /* the node containing the value */
36690     int n_node;
36691
36692     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36693     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36694     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
36695     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
36696         mem_base = xmlMemBlocks();
36697         type = gen_xmlSchemaTypePtr(n_type, 0);
36698         value = gen_const_xmlChar_ptr(n_value, 1);
36699         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
36700         node = gen_xmlNodePtr(n_node, 3);
36701
36702         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
36703         desret_int(ret_val);
36704         call_tests++;
36705         des_xmlSchemaTypePtr(n_type, type, 0);
36706         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
36707         des_xmlSchemaValPtr_ptr(n_val, val, 2);
36708         des_xmlNodePtr(n_node, node, 3);
36709         xmlResetLastError();
36710         if (mem_base != xmlMemBlocks()) {
36711             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
36712                    xmlMemBlocks() - mem_base);
36713             test_ret++;
36714             printf(" %d", n_type);
36715             printf(" %d", n_value);
36716             printf(" %d", n_val);
36717             printf(" %d", n_node);
36718             printf("\n");
36719         }
36720     }
36721     }
36722     }
36723     }
36724     function_tests++;
36725 #endif
36726
36727     return(test_ret);
36728 }
36729
36730
36731 static int
36732 test_xmlSchemaValidateFacet(void) {
36733     int test_ret = 0;
36734
36735 #if defined(LIBXML_SCHEMAS_ENABLED)
36736     int mem_base;
36737     int ret_val;
36738     xmlSchemaTypePtr base; /* the base type */
36739     int n_base;
36740     xmlSchemaFacetPtr facet; /* the facet to check */
36741     int n_facet;
36742     xmlChar * value; /* the lexical repr of the value to validate */
36743     int n_value;
36744     xmlSchemaValPtr val; /* the precomputed value */
36745     int n_val;
36746
36747     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
36748     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36749     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36750     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36751         mem_base = xmlMemBlocks();
36752         base = gen_xmlSchemaTypePtr(n_base, 0);
36753         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
36754         value = gen_const_xmlChar_ptr(n_value, 2);
36755         val = gen_xmlSchemaValPtr(n_val, 3);
36756
36757         ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
36758         desret_int(ret_val);
36759         call_tests++;
36760         des_xmlSchemaTypePtr(n_base, base, 0);
36761         des_xmlSchemaFacetPtr(n_facet, facet, 1);
36762         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36763         des_xmlSchemaValPtr(n_val, val, 3);
36764         xmlResetLastError();
36765         if (mem_base != xmlMemBlocks()) {
36766             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
36767                    xmlMemBlocks() - mem_base);
36768             test_ret++;
36769             printf(" %d", n_base);
36770             printf(" %d", n_facet);
36771             printf(" %d", n_value);
36772             printf(" %d", n_val);
36773             printf("\n");
36774         }
36775     }
36776     }
36777     }
36778     }
36779     function_tests++;
36780 #endif
36781
36782     return(test_ret);
36783 }
36784
36785
36786 static int
36787 test_xmlSchemaValidateFacetWhtsp(void) {
36788     int test_ret = 0;
36789
36790 #if defined(LIBXML_SCHEMAS_ENABLED)
36791     int mem_base;
36792     int ret_val;
36793     xmlSchemaFacetPtr facet; /* the facet to check */
36794     int n_facet;
36795     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
36796     int n_fws;
36797     xmlSchemaValType valType; /* the built-in type of the value */
36798     int n_valType;
36799     xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
36800     int n_value;
36801     xmlSchemaValPtr val; /* the precomputed value */
36802     int n_val;
36803     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36804     int n_ws;
36805
36806     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36807     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
36808     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
36809     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36810     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36811     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36812         mem_base = xmlMemBlocks();
36813         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36814         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
36815         valType = gen_xmlSchemaValType(n_valType, 2);
36816         value = gen_const_xmlChar_ptr(n_value, 3);
36817         val = gen_xmlSchemaValPtr(n_val, 4);
36818         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
36819
36820         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
36821         desret_int(ret_val);
36822         call_tests++;
36823         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36824         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
36825         des_xmlSchemaValType(n_valType, valType, 2);
36826         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
36827         des_xmlSchemaValPtr(n_val, val, 4);
36828         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
36829         xmlResetLastError();
36830         if (mem_base != xmlMemBlocks()) {
36831             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
36832                    xmlMemBlocks() - mem_base);
36833             test_ret++;
36834             printf(" %d", n_facet);
36835             printf(" %d", n_fws);
36836             printf(" %d", n_valType);
36837             printf(" %d", n_value);
36838             printf(" %d", n_val);
36839             printf(" %d", n_ws);
36840             printf("\n");
36841         }
36842     }
36843     }
36844     }
36845     }
36846     }
36847     }
36848     function_tests++;
36849 #endif
36850
36851     return(test_ret);
36852 }
36853
36854
36855 static int
36856 test_xmlSchemaValidateLengthFacet(void) {
36857     int test_ret = 0;
36858
36859 #if defined(LIBXML_SCHEMAS_ENABLED)
36860     int mem_base;
36861     int ret_val;
36862     xmlSchemaTypePtr type; /* the built-in type */
36863     int n_type;
36864     xmlSchemaFacetPtr facet; /* the facet to check */
36865     int n_facet;
36866     xmlChar * value; /* the lexical repr. of the value to be validated */
36867     int n_value;
36868     xmlSchemaValPtr val; /* the precomputed value */
36869     int n_val;
36870     unsigned long * length; /* the actual length of the value */
36871     int n_length;
36872
36873     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
36874     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36875     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36876     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36877     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
36878         mem_base = xmlMemBlocks();
36879         type = gen_xmlSchemaTypePtr(n_type, 0);
36880         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
36881         value = gen_const_xmlChar_ptr(n_value, 2);
36882         val = gen_xmlSchemaValPtr(n_val, 3);
36883         length = gen_unsigned_long_ptr(n_length, 4);
36884
36885         ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
36886         desret_int(ret_val);
36887         call_tests++;
36888         des_xmlSchemaTypePtr(n_type, type, 0);
36889         des_xmlSchemaFacetPtr(n_facet, facet, 1);
36890         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36891         des_xmlSchemaValPtr(n_val, val, 3);
36892         des_unsigned_long_ptr(n_length, length, 4);
36893         xmlResetLastError();
36894         if (mem_base != xmlMemBlocks()) {
36895             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
36896                    xmlMemBlocks() - mem_base);
36897             test_ret++;
36898             printf(" %d", n_type);
36899             printf(" %d", n_facet);
36900             printf(" %d", n_value);
36901             printf(" %d", n_val);
36902             printf(" %d", n_length);
36903             printf("\n");
36904         }
36905     }
36906     }
36907     }
36908     }
36909     }
36910     function_tests++;
36911 #endif
36912
36913     return(test_ret);
36914 }
36915
36916
36917 static int
36918 test_xmlSchemaValidateLengthFacetWhtsp(void) {
36919     int test_ret = 0;
36920
36921 #if defined(LIBXML_SCHEMAS_ENABLED)
36922     int mem_base;
36923     int ret_val;
36924     xmlSchemaFacetPtr facet; /* the facet to check */
36925     int n_facet;
36926     xmlSchemaValType valType; /* the built-in type */
36927     int n_valType;
36928     xmlChar * value; /* the lexical repr. of the value to be validated */
36929     int n_value;
36930     xmlSchemaValPtr val; /* the precomputed value */
36931     int n_val;
36932     unsigned long * length; /* the actual length of the value */
36933     int n_length;
36934     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
36935     int n_ws;
36936
36937     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
36938     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
36939     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
36940     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
36941     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
36942     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
36943         mem_base = xmlMemBlocks();
36944         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
36945         valType = gen_xmlSchemaValType(n_valType, 1);
36946         value = gen_const_xmlChar_ptr(n_value, 2);
36947         val = gen_xmlSchemaValPtr(n_val, 3);
36948         length = gen_unsigned_long_ptr(n_length, 4);
36949         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
36950
36951         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
36952         desret_int(ret_val);
36953         call_tests++;
36954         des_xmlSchemaFacetPtr(n_facet, facet, 0);
36955         des_xmlSchemaValType(n_valType, valType, 1);
36956         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
36957         des_xmlSchemaValPtr(n_val, val, 3);
36958         des_unsigned_long_ptr(n_length, length, 4);
36959         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
36960         xmlResetLastError();
36961         if (mem_base != xmlMemBlocks()) {
36962             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
36963                    xmlMemBlocks() - mem_base);
36964             test_ret++;
36965             printf(" %d", n_facet);
36966             printf(" %d", n_valType);
36967             printf(" %d", n_value);
36968             printf(" %d", n_val);
36969             printf(" %d", n_length);
36970             printf(" %d", n_ws);
36971             printf("\n");
36972         }
36973     }
36974     }
36975     }
36976     }
36977     }
36978     }
36979     function_tests++;
36980 #endif
36981
36982     return(test_ret);
36983 }
36984
36985
36986 static int
36987 test_xmlSchemaValidateListSimpleTypeFacet(void) {
36988     int test_ret = 0;
36989
36990 #if defined(LIBXML_SCHEMAS_ENABLED)
36991     int mem_base;
36992     int ret_val;
36993     xmlSchemaFacetPtr facet; /* the facet to check */
36994     int n_facet;
36995     xmlChar * value; /* the lexical repr of the value to validate */
36996     int n_value;
36997     unsigned long actualLen; /* the number of list items */
36998     int n_actualLen;
36999     unsigned long * expectedLen; /* the resulting expected number of list items */
37000     int n_expectedLen;
37001
37002     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
37003     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
37004     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
37005     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
37006         mem_base = xmlMemBlocks();
37007         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
37008         value = gen_const_xmlChar_ptr(n_value, 1);
37009         actualLen = gen_unsigned_long(n_actualLen, 2);
37010         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
37011
37012         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
37013         desret_int(ret_val);
37014         call_tests++;
37015         des_xmlSchemaFacetPtr(n_facet, facet, 0);
37016         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
37017         des_unsigned_long(n_actualLen, actualLen, 2);
37018         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
37019         xmlResetLastError();
37020         if (mem_base != xmlMemBlocks()) {
37021             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
37022                    xmlMemBlocks() - mem_base);
37023             test_ret++;
37024             printf(" %d", n_facet);
37025             printf(" %d", n_value);
37026             printf(" %d", n_actualLen);
37027             printf(" %d", n_expectedLen);
37028             printf("\n");
37029         }
37030     }
37031     }
37032     }
37033     }
37034     function_tests++;
37035 #endif
37036
37037     return(test_ret);
37038 }
37039
37040
37041 static int
37042 test_xmlSchemaValidatePredefinedType(void) {
37043     int test_ret = 0;
37044
37045 #if defined(LIBXML_SCHEMAS_ENABLED)
37046     int mem_base;
37047     int ret_val;
37048     xmlSchemaTypePtr type; /* the predefined type */
37049     int n_type;
37050     xmlChar * value; /* the value to check */
37051     int n_value;
37052     xmlSchemaValPtr * val; /* the return computed value */
37053     int n_val;
37054
37055     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
37056     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
37057     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
37058         mem_base = xmlMemBlocks();
37059         type = gen_xmlSchemaTypePtr(n_type, 0);
37060         value = gen_const_xmlChar_ptr(n_value, 1);
37061         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
37062
37063         ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
37064         desret_int(ret_val);
37065         call_tests++;
37066         des_xmlSchemaTypePtr(n_type, type, 0);
37067         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
37068         des_xmlSchemaValPtr_ptr(n_val, val, 2);
37069         xmlResetLastError();
37070         if (mem_base != xmlMemBlocks()) {
37071             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
37072                    xmlMemBlocks() - mem_base);
37073             test_ret++;
37074             printf(" %d", n_type);
37075             printf(" %d", n_value);
37076             printf(" %d", n_val);
37077             printf("\n");
37078         }
37079     }
37080     }
37081     }
37082     function_tests++;
37083 #endif
37084
37085     return(test_ret);
37086 }
37087
37088
37089 static int
37090 test_xmlSchemaValueAppend(void) {
37091     int test_ret = 0;
37092
37093 #if defined(LIBXML_SCHEMAS_ENABLED)
37094     int mem_base;
37095     int ret_val;
37096     xmlSchemaValPtr prev; /* the value */
37097     int n_prev;
37098     xmlSchemaValPtr cur; /* the value to be appended */
37099     int n_cur;
37100
37101     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
37102     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
37103         mem_base = xmlMemBlocks();
37104         prev = gen_xmlSchemaValPtr(n_prev, 0);
37105         cur = gen_xmlSchemaValPtr(n_cur, 1);
37106
37107         ret_val = xmlSchemaValueAppend(prev, cur);
37108         desret_int(ret_val);
37109         call_tests++;
37110         des_xmlSchemaValPtr(n_prev, prev, 0);
37111         des_xmlSchemaValPtr(n_cur, cur, 1);
37112         xmlResetLastError();
37113         if (mem_base != xmlMemBlocks()) {
37114             printf("Leak of %d blocks found in xmlSchemaValueAppend",
37115                    xmlMemBlocks() - mem_base);
37116             test_ret++;
37117             printf(" %d", n_prev);
37118             printf(" %d", n_cur);
37119             printf("\n");
37120         }
37121     }
37122     }
37123     function_tests++;
37124 #endif
37125
37126     return(test_ret);
37127 }
37128
37129
37130 static int
37131 test_xmlSchemaValueGetAsBoolean(void) {
37132     int test_ret = 0;
37133
37134 #if defined(LIBXML_SCHEMAS_ENABLED)
37135     int mem_base;
37136     int ret_val;
37137     xmlSchemaValPtr val; /* the value */
37138     int n_val;
37139
37140     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
37141         mem_base = xmlMemBlocks();
37142         val = gen_xmlSchemaValPtr(n_val, 0);
37143
37144         ret_val = xmlSchemaValueGetAsBoolean(val);
37145         desret_int(ret_val);
37146         call_tests++;
37147         des_xmlSchemaValPtr(n_val, val, 0);
37148         xmlResetLastError();
37149         if (mem_base != xmlMemBlocks()) {
37150             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
37151                    xmlMemBlocks() - mem_base);
37152             test_ret++;
37153             printf(" %d", n_val);
37154             printf("\n");
37155         }
37156     }
37157     function_tests++;
37158 #endif
37159
37160     return(test_ret);
37161 }
37162
37163
37164 static int
37165 test_xmlSchemaValueGetAsString(void) {
37166     int test_ret = 0;
37167
37168 #if defined(LIBXML_SCHEMAS_ENABLED)
37169     int mem_base;
37170     const xmlChar * ret_val;
37171     xmlSchemaValPtr val; /* the value */
37172     int n_val;
37173
37174     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
37175         mem_base = xmlMemBlocks();
37176         val = gen_xmlSchemaValPtr(n_val, 0);
37177
37178         ret_val = xmlSchemaValueGetAsString(val);
37179         desret_const_xmlChar_ptr(ret_val);
37180         call_tests++;
37181         des_xmlSchemaValPtr(n_val, val, 0);
37182         xmlResetLastError();
37183         if (mem_base != xmlMemBlocks()) {
37184             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
37185                    xmlMemBlocks() - mem_base);
37186             test_ret++;
37187             printf(" %d", n_val);
37188             printf("\n");
37189         }
37190     }
37191     function_tests++;
37192 #endif
37193
37194     return(test_ret);
37195 }
37196
37197
37198 static int
37199 test_xmlSchemaValueGetNext(void) {
37200     int test_ret = 0;
37201
37202
37203     /* missing type support */
37204     return(test_ret);
37205 }
37206
37207
37208 static int
37209 test_xmlSchemaWhiteSpaceReplace(void) {
37210     int test_ret = 0;
37211
37212 #if defined(LIBXML_SCHEMAS_ENABLED)
37213     int mem_base;
37214     xmlChar * ret_val;
37215     xmlChar * value; /* a value */
37216     int n_value;
37217
37218     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
37219         mem_base = xmlMemBlocks();
37220         value = gen_const_xmlChar_ptr(n_value, 0);
37221
37222         ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
37223         desret_xmlChar_ptr(ret_val);
37224         call_tests++;
37225         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
37226         xmlResetLastError();
37227         if (mem_base != xmlMemBlocks()) {
37228             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
37229                    xmlMemBlocks() - mem_base);
37230             test_ret++;
37231             printf(" %d", n_value);
37232             printf("\n");
37233         }
37234     }
37235     function_tests++;
37236 #endif
37237
37238     return(test_ret);
37239 }
37240
37241 static int
37242 test_xmlschemastypes(void) {
37243     int test_ret = 0;
37244         int rc = 0;
37245
37246     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
37247     rc = test_xmlSchemaCheckFacet();
37248         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37249     rc = test_xmlSchemaCleanupTypes();
37250         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37251     rc = test_xmlSchemaCollapseString();
37252         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37253     rc = test_xmlSchemaCompareValues();
37254         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37255     rc = test_xmlSchemaCompareValuesWhtsp();
37256         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37257     rc = test_xmlSchemaCopyValue();
37258         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37259     rc = test_xmlSchemaGetBuiltInListSimpleTypeItemType();
37260         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37261     rc = test_xmlSchemaGetBuiltInType();
37262         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37263     rc = test_xmlSchemaGetCanonValue();
37264         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37265     rc = test_xmlSchemaGetCanonValueWhtsp();
37266         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37267     rc = test_xmlSchemaGetFacetValueAsULong();
37268         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37269     rc = test_xmlSchemaGetPredefinedType();
37270         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37271     rc = test_xmlSchemaGetValType();
37272         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37273     rc = test_xmlSchemaInitTypes();
37274         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37275     rc = test_xmlSchemaIsBuiltInTypeFacet();
37276         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37277     rc = test_xmlSchemaNewFacet();
37278         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37279     rc = test_xmlSchemaNewNOTATIONValue();
37280         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37281     rc = test_xmlSchemaNewQNameValue();
37282         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37283     rc = test_xmlSchemaNewStringValue();
37284         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37285     rc = test_xmlSchemaValPredefTypeNode();
37286         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37287     rc = test_xmlSchemaValPredefTypeNodeNoNorm();
37288         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37289     rc = test_xmlSchemaValidateFacet();
37290         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37291     rc = test_xmlSchemaValidateFacetWhtsp();
37292         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37293     rc = test_xmlSchemaValidateLengthFacet();
37294         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37295     rc = test_xmlSchemaValidateLengthFacetWhtsp();
37296         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37297     rc = test_xmlSchemaValidateListSimpleTypeFacet();
37298         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37299     rc = test_xmlSchemaValidatePredefinedType();
37300         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37301     rc = test_xmlSchemaValueAppend();
37302         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37303     rc = test_xmlSchemaValueGetAsBoolean();
37304         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37305     rc = test_xmlSchemaValueGetAsString();
37306         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37307     rc = test_xmlSchemaValueGetNext();
37308         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37309     rc = test_xmlSchemaWhiteSpaceReplace();
37310         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
37311
37312     if (test_ret != 0)
37313         printf("Module xmlschemastypes: %d errors\n", test_ret);
37314     return(test_ret);
37315 }
37316
37317 static int
37318 test_xmlCharStrdup(void) {
37319     int test_ret = 0;
37320
37321     int mem_base;
37322     xmlChar * ret_val;
37323     char * cur; /* the input char * */
37324     int n_cur;
37325
37326     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
37327         mem_base = xmlMemBlocks();
37328         cur = gen_const_char_ptr(n_cur, 0);
37329
37330         ret_val = xmlCharStrdup((const char *)cur);
37331         desret_xmlChar_ptr(ret_val);
37332         call_tests++;
37333         des_const_char_ptr(n_cur, (const char *)cur, 0);
37334         xmlResetLastError();
37335         if (mem_base != xmlMemBlocks()) {
37336             printf("Leak of %d blocks found in xmlCharStrdup",
37337                    xmlMemBlocks() - mem_base);
37338             test_ret++;
37339             printf(" %d", n_cur);
37340             printf("\n");
37341         }
37342     }
37343     function_tests++;
37344
37345     return(test_ret);
37346 }
37347
37348
37349 static int
37350 test_xmlCharStrndup(void) {
37351     int test_ret = 0;
37352
37353     int mem_base;
37354     xmlChar * ret_val;
37355     char * cur; /* the input char * */
37356     int n_cur;
37357     int len; /* the len of @cur */
37358     int n_len;
37359
37360     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
37361     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37362         mem_base = xmlMemBlocks();
37363         cur = gen_const_char_ptr(n_cur, 0);
37364         len = gen_int(n_len, 1);
37365         if ((cur != NULL) &&
37366             (len > (int) strlen((const char *) cur) + 1))
37367             continue;
37368
37369         ret_val = xmlCharStrndup((const char *)cur, len);
37370         desret_xmlChar_ptr(ret_val);
37371         call_tests++;
37372         des_const_char_ptr(n_cur, (const char *)cur, 0);
37373         des_int(n_len, len, 1);
37374         xmlResetLastError();
37375         if (mem_base != xmlMemBlocks()) {
37376             printf("Leak of %d blocks found in xmlCharStrndup",
37377                    xmlMemBlocks() - mem_base);
37378             test_ret++;
37379             printf(" %d", n_cur);
37380             printf(" %d", n_len);
37381             printf("\n");
37382         }
37383     }
37384     }
37385     function_tests++;
37386
37387     return(test_ret);
37388 }
37389
37390
37391 static int
37392 test_xmlCheckUTF8(void) {
37393     int test_ret = 0;
37394
37395     int mem_base;
37396     int ret_val;
37397     unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
37398     int n_utf;
37399
37400     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
37401         mem_base = xmlMemBlocks();
37402         utf = gen_const_unsigned_char_ptr(n_utf, 0);
37403
37404         ret_val = xmlCheckUTF8((const unsigned char *)utf);
37405         desret_int(ret_val);
37406         call_tests++;
37407         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
37408         xmlResetLastError();
37409         if (mem_base != xmlMemBlocks()) {
37410             printf("Leak of %d blocks found in xmlCheckUTF8",
37411                    xmlMemBlocks() - mem_base);
37412             test_ret++;
37413             printf(" %d", n_utf);
37414             printf("\n");
37415         }
37416     }
37417     function_tests++;
37418
37419     return(test_ret);
37420 }
37421
37422
37423 static int
37424 test_xmlGetUTF8Char(void) {
37425     int test_ret = 0;
37426
37427     int mem_base;
37428     int ret_val;
37429     unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
37430     int n_utf;
37431     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. */
37432     int n_len;
37433
37434     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
37435     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
37436         mem_base = xmlMemBlocks();
37437         utf = gen_const_unsigned_char_ptr(n_utf, 0);
37438         len = gen_int_ptr(n_len, 1);
37439
37440         ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
37441         desret_int(ret_val);
37442         call_tests++;
37443         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
37444         des_int_ptr(n_len, len, 1);
37445         xmlResetLastError();
37446         if (mem_base != xmlMemBlocks()) {
37447             printf("Leak of %d blocks found in xmlGetUTF8Char",
37448                    xmlMemBlocks() - mem_base);
37449             test_ret++;
37450             printf(" %d", n_utf);
37451             printf(" %d", n_len);
37452             printf("\n");
37453         }
37454     }
37455     }
37456     function_tests++;
37457
37458     return(test_ret);
37459 }
37460
37461
37462 static int
37463 test_xmlStrEqual(void) {
37464     int test_ret = 0;
37465
37466     int mem_base;
37467     int ret_val;
37468     xmlChar * str1; /* the first xmlChar * */
37469     int n_str1;
37470     xmlChar * str2; /* the second xmlChar * */
37471     int n_str2;
37472
37473     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37474     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37475         mem_base = xmlMemBlocks();
37476         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37477         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37478
37479         ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
37480         desret_int(ret_val);
37481         call_tests++;
37482         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37483         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37484         xmlResetLastError();
37485         if (mem_base != xmlMemBlocks()) {
37486             printf("Leak of %d blocks found in xmlStrEqual",
37487                    xmlMemBlocks() - mem_base);
37488             test_ret++;
37489             printf(" %d", n_str1);
37490             printf(" %d", n_str2);
37491             printf("\n");
37492         }
37493     }
37494     }
37495     function_tests++;
37496
37497     return(test_ret);
37498 }
37499
37500
37501 static int
37502 test_xmlStrPrintf(void) {
37503     int test_ret = 0;
37504
37505
37506     /* missing type support */
37507     return(test_ret);
37508 }
37509
37510
37511 static int
37512 test_xmlStrQEqual(void) {
37513     int test_ret = 0;
37514
37515     int mem_base;
37516     int ret_val;
37517     xmlChar * pref; /* the prefix of the QName */
37518     int n_pref;
37519     xmlChar * name; /* the localname of the QName */
37520     int n_name;
37521     xmlChar * str; /* the second xmlChar * */
37522     int n_str;
37523
37524     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
37525     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
37526     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37527         mem_base = xmlMemBlocks();
37528         pref = gen_const_xmlChar_ptr(n_pref, 0);
37529         name = gen_const_xmlChar_ptr(n_name, 1);
37530         str = gen_const_xmlChar_ptr(n_str, 2);
37531
37532         ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
37533         desret_int(ret_val);
37534         call_tests++;
37535         des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
37536         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
37537         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
37538         xmlResetLastError();
37539         if (mem_base != xmlMemBlocks()) {
37540             printf("Leak of %d blocks found in xmlStrQEqual",
37541                    xmlMemBlocks() - mem_base);
37542             test_ret++;
37543             printf(" %d", n_pref);
37544             printf(" %d", n_name);
37545             printf(" %d", n_str);
37546             printf("\n");
37547         }
37548     }
37549     }
37550     }
37551     function_tests++;
37552
37553     return(test_ret);
37554 }
37555
37556
37557 static int
37558 test_xmlStrVPrintf(void) {
37559     int test_ret = 0;
37560
37561
37562     /* missing type support */
37563     return(test_ret);
37564 }
37565
37566
37567 static int
37568 test_xmlStrcasecmp(void) {
37569     int test_ret = 0;
37570
37571     int mem_base;
37572     int ret_val;
37573     xmlChar * str1; /* the first xmlChar * */
37574     int n_str1;
37575     xmlChar * str2; /* the second xmlChar * */
37576     int n_str2;
37577
37578     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37579     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37580         mem_base = xmlMemBlocks();
37581         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37582         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37583
37584         ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
37585         desret_int(ret_val);
37586         call_tests++;
37587         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37588         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37589         xmlResetLastError();
37590         if (mem_base != xmlMemBlocks()) {
37591             printf("Leak of %d blocks found in xmlStrcasecmp",
37592                    xmlMemBlocks() - mem_base);
37593             test_ret++;
37594             printf(" %d", n_str1);
37595             printf(" %d", n_str2);
37596             printf("\n");
37597         }
37598     }
37599     }
37600     function_tests++;
37601
37602     return(test_ret);
37603 }
37604
37605
37606 static int
37607 test_xmlStrcasestr(void) {
37608     int test_ret = 0;
37609
37610     int mem_base;
37611     const xmlChar * ret_val;
37612     xmlChar * str; /* the xmlChar * array (haystack) */
37613     int n_str;
37614     xmlChar * val; /* the xmlChar to search (needle) */
37615     int n_val;
37616
37617     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37618     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
37619         mem_base = xmlMemBlocks();
37620         str = gen_const_xmlChar_ptr(n_str, 0);
37621         val = gen_const_xmlChar_ptr(n_val, 1);
37622
37623         ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
37624         desret_const_xmlChar_ptr(ret_val);
37625         call_tests++;
37626         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37627         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
37628         xmlResetLastError();
37629         if (mem_base != xmlMemBlocks()) {
37630             printf("Leak of %d blocks found in xmlStrcasestr",
37631                    xmlMemBlocks() - mem_base);
37632             test_ret++;
37633             printf(" %d", n_str);
37634             printf(" %d", n_val);
37635             printf("\n");
37636         }
37637     }
37638     }
37639     function_tests++;
37640
37641     return(test_ret);
37642 }
37643
37644
37645 static int
37646 test_xmlStrchr(void) {
37647     int test_ret = 0;
37648
37649     int mem_base;
37650     const xmlChar * ret_val;
37651     xmlChar * str; /* the xmlChar * array */
37652     int n_str;
37653     xmlChar val; /* the xmlChar to search */
37654     int n_val;
37655
37656     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37657     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
37658         mem_base = xmlMemBlocks();
37659         str = gen_const_xmlChar_ptr(n_str, 0);
37660         val = gen_xmlChar(n_val, 1);
37661
37662         ret_val = xmlStrchr((const xmlChar *)str, val);
37663         desret_const_xmlChar_ptr(ret_val);
37664         call_tests++;
37665         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37666         des_xmlChar(n_val, val, 1);
37667         xmlResetLastError();
37668         if (mem_base != xmlMemBlocks()) {
37669             printf("Leak of %d blocks found in xmlStrchr",
37670                    xmlMemBlocks() - mem_base);
37671             test_ret++;
37672             printf(" %d", n_str);
37673             printf(" %d", n_val);
37674             printf("\n");
37675         }
37676     }
37677     }
37678     function_tests++;
37679
37680     return(test_ret);
37681 }
37682
37683
37684 static int
37685 test_xmlStrcmp(void) {
37686     int test_ret = 0;
37687
37688     int mem_base;
37689     int ret_val;
37690     xmlChar * str1; /* the first xmlChar * */
37691     int n_str1;
37692     xmlChar * str2; /* the second xmlChar * */
37693     int n_str2;
37694
37695     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37696     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37697         mem_base = xmlMemBlocks();
37698         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37699         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37700
37701         ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
37702         desret_int(ret_val);
37703         call_tests++;
37704         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37705         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37706         xmlResetLastError();
37707         if (mem_base != xmlMemBlocks()) {
37708             printf("Leak of %d blocks found in xmlStrcmp",
37709                    xmlMemBlocks() - mem_base);
37710             test_ret++;
37711             printf(" %d", n_str1);
37712             printf(" %d", n_str2);
37713             printf("\n");
37714         }
37715     }
37716     }
37717     function_tests++;
37718
37719     return(test_ret);
37720 }
37721
37722
37723 static int
37724 test_xmlStrdup(void) {
37725     int test_ret = 0;
37726
37727     int mem_base;
37728     xmlChar * ret_val;
37729     xmlChar * cur; /* the input xmlChar * */
37730     int n_cur;
37731
37732     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
37733         mem_base = xmlMemBlocks();
37734         cur = gen_const_xmlChar_ptr(n_cur, 0);
37735
37736         ret_val = xmlStrdup((const xmlChar *)cur);
37737         desret_xmlChar_ptr(ret_val);
37738         call_tests++;
37739         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
37740         xmlResetLastError();
37741         if (mem_base != xmlMemBlocks()) {
37742             printf("Leak of %d blocks found in xmlStrdup",
37743                    xmlMemBlocks() - mem_base);
37744             test_ret++;
37745             printf(" %d", n_cur);
37746             printf("\n");
37747         }
37748     }
37749     function_tests++;
37750
37751     return(test_ret);
37752 }
37753
37754
37755 static int
37756 test_xmlStrlen(void) {
37757     int test_ret = 0;
37758
37759     int mem_base;
37760     int ret_val;
37761     xmlChar * str; /* the xmlChar * array */
37762     int n_str;
37763
37764     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37765         mem_base = xmlMemBlocks();
37766         str = gen_const_xmlChar_ptr(n_str, 0);
37767
37768         ret_val = xmlStrlen((const xmlChar *)str);
37769         desret_int(ret_val);
37770         call_tests++;
37771         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37772         xmlResetLastError();
37773         if (mem_base != xmlMemBlocks()) {
37774             printf("Leak of %d blocks found in xmlStrlen",
37775                    xmlMemBlocks() - mem_base);
37776             test_ret++;
37777             printf(" %d", n_str);
37778             printf("\n");
37779         }
37780     }
37781     function_tests++;
37782
37783     return(test_ret);
37784 }
37785
37786
37787 static int
37788 test_xmlStrncasecmp(void) {
37789     int test_ret = 0;
37790
37791     int mem_base;
37792     int ret_val;
37793     xmlChar * str1; /* the first xmlChar * */
37794     int n_str1;
37795     xmlChar * str2; /* the second xmlChar * */
37796     int n_str2;
37797     int len; /* the max comparison length */
37798     int n_len;
37799
37800     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37801     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37802     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37803         mem_base = xmlMemBlocks();
37804         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37805         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37806         len = gen_int(n_len, 2);
37807         if ((str2 != NULL) &&
37808             (len > (int) strlen((const char *) str2) + 1))
37809             continue;
37810
37811         ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
37812         desret_int(ret_val);
37813         call_tests++;
37814         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37815         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37816         des_int(n_len, len, 2);
37817         xmlResetLastError();
37818         if (mem_base != xmlMemBlocks()) {
37819             printf("Leak of %d blocks found in xmlStrncasecmp",
37820                    xmlMemBlocks() - mem_base);
37821             test_ret++;
37822             printf(" %d", n_str1);
37823             printf(" %d", n_str2);
37824             printf(" %d", n_len);
37825             printf("\n");
37826         }
37827     }
37828     }
37829     }
37830     function_tests++;
37831
37832     return(test_ret);
37833 }
37834
37835
37836 static int
37837 test_xmlStrncatNew(void) {
37838     int test_ret = 0;
37839
37840     int mem_base;
37841     xmlChar * ret_val;
37842     xmlChar * str1; /* first xmlChar string */
37843     int n_str1;
37844     xmlChar * str2; /* second xmlChar string */
37845     int n_str2;
37846     int len; /* the len of @str2 or < 0 */
37847     int n_len;
37848
37849     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37850     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37851     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37852         mem_base = xmlMemBlocks();
37853         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37854         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37855         len = gen_int(n_len, 2);
37856         if ((str2 != NULL) &&
37857             (len > (int) strlen((const char *) str2) + 1))
37858             continue;
37859
37860         ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
37861         desret_xmlChar_ptr(ret_val);
37862         call_tests++;
37863         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37864         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37865         des_int(n_len, len, 2);
37866         xmlResetLastError();
37867         if (mem_base != xmlMemBlocks()) {
37868             printf("Leak of %d blocks found in xmlStrncatNew",
37869                    xmlMemBlocks() - mem_base);
37870             test_ret++;
37871             printf(" %d", n_str1);
37872             printf(" %d", n_str2);
37873             printf(" %d", n_len);
37874             printf("\n");
37875         }
37876     }
37877     }
37878     }
37879     function_tests++;
37880
37881     return(test_ret);
37882 }
37883
37884
37885 static int
37886 test_xmlStrncmp(void) {
37887     int test_ret = 0;
37888
37889     int mem_base;
37890     int ret_val;
37891     xmlChar * str1; /* the first xmlChar * */
37892     int n_str1;
37893     xmlChar * str2; /* the second xmlChar * */
37894     int n_str2;
37895     int len; /* the max comparison length */
37896     int n_len;
37897
37898     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
37899     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
37900     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37901         mem_base = xmlMemBlocks();
37902         str1 = gen_const_xmlChar_ptr(n_str1, 0);
37903         str2 = gen_const_xmlChar_ptr(n_str2, 1);
37904         len = gen_int(n_len, 2);
37905         if ((str2 != NULL) &&
37906             (len > (int) strlen((const char *) str2) + 1))
37907             continue;
37908
37909         ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
37910         desret_int(ret_val);
37911         call_tests++;
37912         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
37913         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
37914         des_int(n_len, len, 2);
37915         xmlResetLastError();
37916         if (mem_base != xmlMemBlocks()) {
37917             printf("Leak of %d blocks found in xmlStrncmp",
37918                    xmlMemBlocks() - mem_base);
37919             test_ret++;
37920             printf(" %d", n_str1);
37921             printf(" %d", n_str2);
37922             printf(" %d", n_len);
37923             printf("\n");
37924         }
37925     }
37926     }
37927     }
37928     function_tests++;
37929
37930     return(test_ret);
37931 }
37932
37933
37934 static int
37935 test_xmlStrndup(void) {
37936     int test_ret = 0;
37937
37938     int mem_base;
37939     xmlChar * ret_val;
37940     xmlChar * cur; /* the input xmlChar * */
37941     int n_cur;
37942     int len; /* the len of @cur */
37943     int n_len;
37944
37945     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
37946     for (n_len = 0;n_len < gen_nb_int;n_len++) {
37947         mem_base = xmlMemBlocks();
37948         cur = gen_const_xmlChar_ptr(n_cur, 0);
37949         len = gen_int(n_len, 1);
37950         if ((cur != NULL) &&
37951             (len > (int) strlen((const char *) cur) + 1))
37952             continue;
37953
37954         ret_val = xmlStrndup((const xmlChar *)cur, len);
37955         desret_xmlChar_ptr(ret_val);
37956         call_tests++;
37957         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
37958         des_int(n_len, len, 1);
37959         xmlResetLastError();
37960         if (mem_base != xmlMemBlocks()) {
37961             printf("Leak of %d blocks found in xmlStrndup",
37962                    xmlMemBlocks() - mem_base);
37963             test_ret++;
37964             printf(" %d", n_cur);
37965             printf(" %d", n_len);
37966             printf("\n");
37967         }
37968     }
37969     }
37970     function_tests++;
37971
37972     return(test_ret);
37973 }
37974
37975
37976 static int
37977 test_xmlStrstr(void) {
37978     int test_ret = 0;
37979
37980     int mem_base;
37981     const xmlChar * ret_val;
37982     xmlChar * str; /* the xmlChar * array (haystack) */
37983     int n_str;
37984     xmlChar * val; /* the xmlChar to search (needle) */
37985     int n_val;
37986
37987     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
37988     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
37989         mem_base = xmlMemBlocks();
37990         str = gen_const_xmlChar_ptr(n_str, 0);
37991         val = gen_const_xmlChar_ptr(n_val, 1);
37992
37993         ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
37994         desret_const_xmlChar_ptr(ret_val);
37995         call_tests++;
37996         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
37997         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
37998         xmlResetLastError();
37999         if (mem_base != xmlMemBlocks()) {
38000             printf("Leak of %d blocks found in xmlStrstr",
38001                    xmlMemBlocks() - mem_base);
38002             test_ret++;
38003             printf(" %d", n_str);
38004             printf(" %d", n_val);
38005             printf("\n");
38006         }
38007     }
38008     }
38009     function_tests++;
38010
38011     return(test_ret);
38012 }
38013
38014
38015 static int
38016 test_xmlStrsub(void) {
38017     int test_ret = 0;
38018
38019     int mem_base;
38020     xmlChar * ret_val;
38021     xmlChar * str; /* the xmlChar * array (haystack) */
38022     int n_str;
38023     int start; /* the index of the first char (zero based) */
38024     int n_start;
38025     int len; /* the length of the substring */
38026     int n_len;
38027
38028     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
38029     for (n_start = 0;n_start < gen_nb_int;n_start++) {
38030     for (n_len = 0;n_len < gen_nb_int;n_len++) {
38031         mem_base = xmlMemBlocks();
38032         str = gen_const_xmlChar_ptr(n_str, 0);
38033         start = gen_int(n_start, 1);
38034         len = gen_int(n_len, 2);
38035         if ((str != NULL) &&
38036             (start > (int) strlen((const char *) str) + 1))
38037             continue;
38038         if ((str != NULL) &&
38039             (len > (int) strlen((const char *) str) + 1))
38040             continue;
38041
38042         ret_val = xmlStrsub((const xmlChar *)str, start, len);
38043         desret_xmlChar_ptr(ret_val);
38044         call_tests++;
38045         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
38046         des_int(n_start, start, 1);
38047         des_int(n_len, len, 2);
38048         xmlResetLastError();
38049         if (mem_base != xmlMemBlocks()) {
38050             printf("Leak of %d blocks found in xmlStrsub",
38051                    xmlMemBlocks() - mem_base);
38052             test_ret++;
38053             printf(" %d", n_str);
38054             printf(" %d", n_start);
38055             printf(" %d", n_len);
38056             printf("\n");
38057         }
38058     }
38059     }
38060     }
38061     function_tests++;
38062
38063     return(test_ret);
38064 }
38065
38066
38067 static int
38068 test_xmlUTF8Charcmp(void) {
38069     int test_ret = 0;
38070
38071     int mem_base;
38072     int ret_val;
38073     xmlChar * utf1; /* pointer to first UTF8 char */
38074     int n_utf1;
38075     xmlChar * utf2; /* pointer to second UTF8 char */
38076     int n_utf2;
38077
38078     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
38079     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
38080         mem_base = xmlMemBlocks();
38081         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
38082         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
38083
38084         ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
38085         desret_int(ret_val);
38086         call_tests++;
38087         des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
38088         des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
38089         xmlResetLastError();
38090         if (mem_base != xmlMemBlocks()) {
38091             printf("Leak of %d blocks found in xmlUTF8Charcmp",
38092                    xmlMemBlocks() - mem_base);
38093             test_ret++;
38094             printf(" %d", n_utf1);
38095             printf(" %d", n_utf2);
38096             printf("\n");
38097         }
38098     }
38099     }
38100     function_tests++;
38101
38102     return(test_ret);
38103 }
38104
38105
38106 static int
38107 test_xmlUTF8Size(void) {
38108     int test_ret = 0;
38109
38110     int mem_base;
38111     int ret_val;
38112     xmlChar * utf; /* pointer to the UTF8 character */
38113     int n_utf;
38114
38115     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38116         mem_base = xmlMemBlocks();
38117         utf = gen_const_xmlChar_ptr(n_utf, 0);
38118
38119         ret_val = xmlUTF8Size((const xmlChar *)utf);
38120         desret_int(ret_val);
38121         call_tests++;
38122         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38123         xmlResetLastError();
38124         if (mem_base != xmlMemBlocks()) {
38125             printf("Leak of %d blocks found in xmlUTF8Size",
38126                    xmlMemBlocks() - mem_base);
38127             test_ret++;
38128             printf(" %d", n_utf);
38129             printf("\n");
38130         }
38131     }
38132     function_tests++;
38133
38134     return(test_ret);
38135 }
38136
38137
38138 static int
38139 test_xmlUTF8Strlen(void) {
38140     int test_ret = 0;
38141
38142     int mem_base;
38143     int ret_val;
38144     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
38145     int n_utf;
38146
38147     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38148         mem_base = xmlMemBlocks();
38149         utf = gen_const_xmlChar_ptr(n_utf, 0);
38150
38151         ret_val = xmlUTF8Strlen((const xmlChar *)utf);
38152         desret_int(ret_val);
38153         call_tests++;
38154         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38155         xmlResetLastError();
38156         if (mem_base != xmlMemBlocks()) {
38157             printf("Leak of %d blocks found in xmlUTF8Strlen",
38158                    xmlMemBlocks() - mem_base);
38159             test_ret++;
38160             printf(" %d", n_utf);
38161             printf("\n");
38162         }
38163     }
38164     function_tests++;
38165
38166     return(test_ret);
38167 }
38168
38169
38170 static int
38171 test_xmlUTF8Strloc(void) {
38172     int test_ret = 0;
38173
38174     int mem_base;
38175     int ret_val;
38176     xmlChar * utf; /* the input UTF8 * */
38177     int n_utf;
38178     xmlChar * utfchar; /* the UTF8 character to be found */
38179     int n_utfchar;
38180
38181     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38182     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
38183         mem_base = xmlMemBlocks();
38184         utf = gen_const_xmlChar_ptr(n_utf, 0);
38185         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
38186
38187         ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
38188         desret_int(ret_val);
38189         call_tests++;
38190         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38191         des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
38192         xmlResetLastError();
38193         if (mem_base != xmlMemBlocks()) {
38194             printf("Leak of %d blocks found in xmlUTF8Strloc",
38195                    xmlMemBlocks() - mem_base);
38196             test_ret++;
38197             printf(" %d", n_utf);
38198             printf(" %d", n_utfchar);
38199             printf("\n");
38200         }
38201     }
38202     }
38203     function_tests++;
38204
38205     return(test_ret);
38206 }
38207
38208
38209 static int
38210 test_xmlUTF8Strndup(void) {
38211     int test_ret = 0;
38212
38213     int mem_base;
38214     xmlChar * ret_val;
38215     xmlChar * utf; /* the input UTF8 * */
38216     int n_utf;
38217     int len; /* the len of @utf (in chars) */
38218     int n_len;
38219
38220     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38221     for (n_len = 0;n_len < gen_nb_int;n_len++) {
38222         mem_base = xmlMemBlocks();
38223         utf = gen_const_xmlChar_ptr(n_utf, 0);
38224         len = gen_int(n_len, 1);
38225         if ((utf != NULL) &&
38226             (len > (int) strlen((const char *) utf) + 1))
38227             continue;
38228
38229         ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
38230         desret_xmlChar_ptr(ret_val);
38231         call_tests++;
38232         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38233         des_int(n_len, len, 1);
38234         xmlResetLastError();
38235         if (mem_base != xmlMemBlocks()) {
38236             printf("Leak of %d blocks found in xmlUTF8Strndup",
38237                    xmlMemBlocks() - mem_base);
38238             test_ret++;
38239             printf(" %d", n_utf);
38240             printf(" %d", n_len);
38241             printf("\n");
38242         }
38243     }
38244     }
38245     function_tests++;
38246
38247     return(test_ret);
38248 }
38249
38250
38251 static int
38252 test_xmlUTF8Strpos(void) {
38253     int test_ret = 0;
38254
38255     int mem_base;
38256     const xmlChar * ret_val;
38257     xmlChar * utf; /* the input UTF8 * */
38258     int n_utf;
38259     int pos; /* the position of the desired UTF8 char (in chars) */
38260     int n_pos;
38261
38262     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38263     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
38264         mem_base = xmlMemBlocks();
38265         utf = gen_const_xmlChar_ptr(n_utf, 0);
38266         pos = gen_int(n_pos, 1);
38267
38268         ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
38269         desret_const_xmlChar_ptr(ret_val);
38270         call_tests++;
38271         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38272         des_int(n_pos, pos, 1);
38273         xmlResetLastError();
38274         if (mem_base != xmlMemBlocks()) {
38275             printf("Leak of %d blocks found in xmlUTF8Strpos",
38276                    xmlMemBlocks() - mem_base);
38277             test_ret++;
38278             printf(" %d", n_utf);
38279             printf(" %d", n_pos);
38280             printf("\n");
38281         }
38282     }
38283     }
38284     function_tests++;
38285
38286     return(test_ret);
38287 }
38288
38289
38290 static int
38291 test_xmlUTF8Strsize(void) {
38292     int test_ret = 0;
38293
38294     int mem_base;
38295     int ret_val;
38296     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
38297     int n_utf;
38298     int len; /* the number of characters in the array */
38299     int n_len;
38300
38301     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38302     for (n_len = 0;n_len < gen_nb_int;n_len++) {
38303         mem_base = xmlMemBlocks();
38304         utf = gen_const_xmlChar_ptr(n_utf, 0);
38305         len = gen_int(n_len, 1);
38306         if ((utf != NULL) &&
38307             (len > (int) strlen((const char *) utf) + 1))
38308             continue;
38309
38310         ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
38311         desret_int(ret_val);
38312         call_tests++;
38313         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38314         des_int(n_len, len, 1);
38315         xmlResetLastError();
38316         if (mem_base != xmlMemBlocks()) {
38317             printf("Leak of %d blocks found in xmlUTF8Strsize",
38318                    xmlMemBlocks() - mem_base);
38319             test_ret++;
38320             printf(" %d", n_utf);
38321             printf(" %d", n_len);
38322             printf("\n");
38323         }
38324     }
38325     }
38326     function_tests++;
38327
38328     return(test_ret);
38329 }
38330
38331
38332 static int
38333 test_xmlUTF8Strsub(void) {
38334     int test_ret = 0;
38335
38336     int mem_base;
38337     xmlChar * ret_val;
38338     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
38339     int n_utf;
38340     int start; /* relative pos of first char */
38341     int n_start;
38342     int len; /* total number to copy */
38343     int n_len;
38344
38345     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
38346     for (n_start = 0;n_start < gen_nb_int;n_start++) {
38347     for (n_len = 0;n_len < gen_nb_int;n_len++) {
38348         mem_base = xmlMemBlocks();
38349         utf = gen_const_xmlChar_ptr(n_utf, 0);
38350         start = gen_int(n_start, 1);
38351         len = gen_int(n_len, 2);
38352         if ((utf != NULL) &&
38353             (start > (int) strlen((const char *) utf) + 1))
38354             continue;
38355         if ((utf != NULL) &&
38356             (len > (int) strlen((const char *) utf) + 1))
38357             continue;
38358
38359         ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
38360         desret_xmlChar_ptr(ret_val);
38361         call_tests++;
38362         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
38363         des_int(n_start, start, 1);
38364         des_int(n_len, len, 2);
38365         xmlResetLastError();
38366         if (mem_base != xmlMemBlocks()) {
38367             printf("Leak of %d blocks found in xmlUTF8Strsub",
38368                    xmlMemBlocks() - mem_base);
38369             test_ret++;
38370             printf(" %d", n_utf);
38371             printf(" %d", n_start);
38372             printf(" %d", n_len);
38373             printf("\n");
38374         }
38375     }
38376     }
38377     }
38378     function_tests++;
38379
38380     return(test_ret);
38381 }
38382
38383 static int
38384 test_xmlstring(void) {
38385     int test_ret = 0;
38386         int rc = 0;
38387
38388     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
38389     rc = test_xmlCharStrdup();
38390         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38391     rc = test_xmlCharStrndup();
38392         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38393     rc = test_xmlCheckUTF8();
38394         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38395     rc = test_xmlGetUTF8Char();
38396         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38397     rc = test_xmlStrEqual();
38398         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38399     rc = test_xmlStrPrintf();
38400         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38401     rc = test_xmlStrQEqual();
38402         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38403     rc = test_xmlStrVPrintf();
38404         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38405     rc = test_xmlStrcasecmp();
38406         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38407     rc = test_xmlStrcasestr();
38408         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38409     rc = test_xmlStrchr();
38410         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38411     rc = test_xmlStrcmp();
38412         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38413     rc = test_xmlStrdup();
38414         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38415     rc = test_xmlStrlen();
38416         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38417     rc = test_xmlStrncasecmp();
38418         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38419     rc = test_xmlStrncatNew();
38420         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38421     rc = test_xmlStrncmp();
38422         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38423     rc = test_xmlStrndup();
38424         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38425     rc = test_xmlStrstr();
38426         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38427     rc = test_xmlStrsub();
38428         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38429     rc = test_xmlUTF8Charcmp();
38430         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38431     rc = test_xmlUTF8Size();
38432         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38433     rc = test_xmlUTF8Strlen();
38434         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38435     rc = test_xmlUTF8Strloc();
38436         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38437     rc = test_xmlUTF8Strndup();
38438         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38439     rc = test_xmlUTF8Strpos();
38440         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38441     rc = test_xmlUTF8Strsize();
38442         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38443     rc = test_xmlUTF8Strsub();
38444         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
38445
38446     if (test_ret != 0)
38447         printf("Module xmlstring: %d errors\n", test_ret);
38448     return(test_ret);
38449 }
38450
38451 static int
38452 test_xmlUCSIsAegeanNumbers(void) {
38453     int test_ret = 0;
38454
38455 #if defined(LIBXML_UNICODE_ENABLED)
38456     int mem_base;
38457     int ret_val;
38458     int code; /* UCS code point */
38459     int n_code;
38460
38461     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38462         mem_base = xmlMemBlocks();
38463         code = gen_int(n_code, 0);
38464
38465         ret_val = xmlUCSIsAegeanNumbers(code);
38466         desret_int(ret_val);
38467         call_tests++;
38468         des_int(n_code, code, 0);
38469         xmlResetLastError();
38470         if (mem_base != xmlMemBlocks()) {
38471             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
38472                    xmlMemBlocks() - mem_base);
38473             test_ret++;
38474             printf(" %d", n_code);
38475             printf("\n");
38476         }
38477     }
38478     function_tests++;
38479 #endif
38480
38481     return(test_ret);
38482 }
38483
38484
38485 static int
38486 test_xmlUCSIsAlphabeticPresentationForms(void) {
38487     int test_ret = 0;
38488
38489 #if defined(LIBXML_UNICODE_ENABLED)
38490     int mem_base;
38491     int ret_val;
38492     int code; /* UCS code point */
38493     int n_code;
38494
38495     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38496         mem_base = xmlMemBlocks();
38497         code = gen_int(n_code, 0);
38498
38499         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
38500         desret_int(ret_val);
38501         call_tests++;
38502         des_int(n_code, code, 0);
38503         xmlResetLastError();
38504         if (mem_base != xmlMemBlocks()) {
38505             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
38506                    xmlMemBlocks() - mem_base);
38507             test_ret++;
38508             printf(" %d", n_code);
38509             printf("\n");
38510         }
38511     }
38512     function_tests++;
38513 #endif
38514
38515     return(test_ret);
38516 }
38517
38518
38519 static int
38520 test_xmlUCSIsArabic(void) {
38521     int test_ret = 0;
38522
38523 #if defined(LIBXML_UNICODE_ENABLED)
38524     int mem_base;
38525     int ret_val;
38526     int code; /* UCS code point */
38527     int n_code;
38528
38529     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38530         mem_base = xmlMemBlocks();
38531         code = gen_int(n_code, 0);
38532
38533         ret_val = xmlUCSIsArabic(code);
38534         desret_int(ret_val);
38535         call_tests++;
38536         des_int(n_code, code, 0);
38537         xmlResetLastError();
38538         if (mem_base != xmlMemBlocks()) {
38539             printf("Leak of %d blocks found in xmlUCSIsArabic",
38540                    xmlMemBlocks() - mem_base);
38541             test_ret++;
38542             printf(" %d", n_code);
38543             printf("\n");
38544         }
38545     }
38546     function_tests++;
38547 #endif
38548
38549     return(test_ret);
38550 }
38551
38552
38553 static int
38554 test_xmlUCSIsArabicPresentationFormsA(void) {
38555     int test_ret = 0;
38556
38557 #if defined(LIBXML_UNICODE_ENABLED)
38558     int mem_base;
38559     int ret_val;
38560     int code; /* UCS code point */
38561     int n_code;
38562
38563     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38564         mem_base = xmlMemBlocks();
38565         code = gen_int(n_code, 0);
38566
38567         ret_val = xmlUCSIsArabicPresentationFormsA(code);
38568         desret_int(ret_val);
38569         call_tests++;
38570         des_int(n_code, code, 0);
38571         xmlResetLastError();
38572         if (mem_base != xmlMemBlocks()) {
38573             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
38574                    xmlMemBlocks() - mem_base);
38575             test_ret++;
38576             printf(" %d", n_code);
38577             printf("\n");
38578         }
38579     }
38580     function_tests++;
38581 #endif
38582
38583     return(test_ret);
38584 }
38585
38586
38587 static int
38588 test_xmlUCSIsArabicPresentationFormsB(void) {
38589     int test_ret = 0;
38590
38591 #if defined(LIBXML_UNICODE_ENABLED)
38592     int mem_base;
38593     int ret_val;
38594     int code; /* UCS code point */
38595     int n_code;
38596
38597     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38598         mem_base = xmlMemBlocks();
38599         code = gen_int(n_code, 0);
38600
38601         ret_val = xmlUCSIsArabicPresentationFormsB(code);
38602         desret_int(ret_val);
38603         call_tests++;
38604         des_int(n_code, code, 0);
38605         xmlResetLastError();
38606         if (mem_base != xmlMemBlocks()) {
38607             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
38608                    xmlMemBlocks() - mem_base);
38609             test_ret++;
38610             printf(" %d", n_code);
38611             printf("\n");
38612         }
38613     }
38614     function_tests++;
38615 #endif
38616
38617     return(test_ret);
38618 }
38619
38620
38621 static int
38622 test_xmlUCSIsArmenian(void) {
38623     int test_ret = 0;
38624
38625 #if defined(LIBXML_UNICODE_ENABLED)
38626     int mem_base;
38627     int ret_val;
38628     int code; /* UCS code point */
38629     int n_code;
38630
38631     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38632         mem_base = xmlMemBlocks();
38633         code = gen_int(n_code, 0);
38634
38635         ret_val = xmlUCSIsArmenian(code);
38636         desret_int(ret_val);
38637         call_tests++;
38638         des_int(n_code, code, 0);
38639         xmlResetLastError();
38640         if (mem_base != xmlMemBlocks()) {
38641             printf("Leak of %d blocks found in xmlUCSIsArmenian",
38642                    xmlMemBlocks() - mem_base);
38643             test_ret++;
38644             printf(" %d", n_code);
38645             printf("\n");
38646         }
38647     }
38648     function_tests++;
38649 #endif
38650
38651     return(test_ret);
38652 }
38653
38654
38655 static int
38656 test_xmlUCSIsArrows(void) {
38657     int test_ret = 0;
38658
38659 #if defined(LIBXML_UNICODE_ENABLED)
38660     int mem_base;
38661     int ret_val;
38662     int code; /* UCS code point */
38663     int n_code;
38664
38665     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38666         mem_base = xmlMemBlocks();
38667         code = gen_int(n_code, 0);
38668
38669         ret_val = xmlUCSIsArrows(code);
38670         desret_int(ret_val);
38671         call_tests++;
38672         des_int(n_code, code, 0);
38673         xmlResetLastError();
38674         if (mem_base != xmlMemBlocks()) {
38675             printf("Leak of %d blocks found in xmlUCSIsArrows",
38676                    xmlMemBlocks() - mem_base);
38677             test_ret++;
38678             printf(" %d", n_code);
38679             printf("\n");
38680         }
38681     }
38682     function_tests++;
38683 #endif
38684
38685     return(test_ret);
38686 }
38687
38688
38689 static int
38690 test_xmlUCSIsBasicLatin(void) {
38691     int test_ret = 0;
38692
38693 #if defined(LIBXML_UNICODE_ENABLED)
38694     int mem_base;
38695     int ret_val;
38696     int code; /* UCS code point */
38697     int n_code;
38698
38699     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38700         mem_base = xmlMemBlocks();
38701         code = gen_int(n_code, 0);
38702
38703         ret_val = xmlUCSIsBasicLatin(code);
38704         desret_int(ret_val);
38705         call_tests++;
38706         des_int(n_code, code, 0);
38707         xmlResetLastError();
38708         if (mem_base != xmlMemBlocks()) {
38709             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
38710                    xmlMemBlocks() - mem_base);
38711             test_ret++;
38712             printf(" %d", n_code);
38713             printf("\n");
38714         }
38715     }
38716     function_tests++;
38717 #endif
38718
38719     return(test_ret);
38720 }
38721
38722
38723 static int
38724 test_xmlUCSIsBengali(void) {
38725     int test_ret = 0;
38726
38727 #if defined(LIBXML_UNICODE_ENABLED)
38728     int mem_base;
38729     int ret_val;
38730     int code; /* UCS code point */
38731     int n_code;
38732
38733     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38734         mem_base = xmlMemBlocks();
38735         code = gen_int(n_code, 0);
38736
38737         ret_val = xmlUCSIsBengali(code);
38738         desret_int(ret_val);
38739         call_tests++;
38740         des_int(n_code, code, 0);
38741         xmlResetLastError();
38742         if (mem_base != xmlMemBlocks()) {
38743             printf("Leak of %d blocks found in xmlUCSIsBengali",
38744                    xmlMemBlocks() - mem_base);
38745             test_ret++;
38746             printf(" %d", n_code);
38747             printf("\n");
38748         }
38749     }
38750     function_tests++;
38751 #endif
38752
38753     return(test_ret);
38754 }
38755
38756
38757 static int
38758 test_xmlUCSIsBlock(void) {
38759     int test_ret = 0;
38760
38761 #if defined(LIBXML_UNICODE_ENABLED)
38762     int mem_base;
38763     int ret_val;
38764     int code; /* UCS code point */
38765     int n_code;
38766     char * block; /* UCS block name */
38767     int n_block;
38768
38769     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38770     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
38771         mem_base = xmlMemBlocks();
38772         code = gen_int(n_code, 0);
38773         block = gen_const_char_ptr(n_block, 1);
38774
38775         ret_val = xmlUCSIsBlock(code, (const char *)block);
38776         desret_int(ret_val);
38777         call_tests++;
38778         des_int(n_code, code, 0);
38779         des_const_char_ptr(n_block, (const char *)block, 1);
38780         xmlResetLastError();
38781         if (mem_base != xmlMemBlocks()) {
38782             printf("Leak of %d blocks found in xmlUCSIsBlock",
38783                    xmlMemBlocks() - mem_base);
38784             test_ret++;
38785             printf(" %d", n_code);
38786             printf(" %d", n_block);
38787             printf("\n");
38788         }
38789     }
38790     }
38791     function_tests++;
38792 #endif
38793
38794     return(test_ret);
38795 }
38796
38797
38798 static int
38799 test_xmlUCSIsBlockElements(void) {
38800     int test_ret = 0;
38801
38802 #if defined(LIBXML_UNICODE_ENABLED)
38803     int mem_base;
38804     int ret_val;
38805     int code; /* UCS code point */
38806     int n_code;
38807
38808     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38809         mem_base = xmlMemBlocks();
38810         code = gen_int(n_code, 0);
38811
38812         ret_val = xmlUCSIsBlockElements(code);
38813         desret_int(ret_val);
38814         call_tests++;
38815         des_int(n_code, code, 0);
38816         xmlResetLastError();
38817         if (mem_base != xmlMemBlocks()) {
38818             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
38819                    xmlMemBlocks() - mem_base);
38820             test_ret++;
38821             printf(" %d", n_code);
38822             printf("\n");
38823         }
38824     }
38825     function_tests++;
38826 #endif
38827
38828     return(test_ret);
38829 }
38830
38831
38832 static int
38833 test_xmlUCSIsBopomofo(void) {
38834     int test_ret = 0;
38835
38836 #if defined(LIBXML_UNICODE_ENABLED)
38837     int mem_base;
38838     int ret_val;
38839     int code; /* UCS code point */
38840     int n_code;
38841
38842     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38843         mem_base = xmlMemBlocks();
38844         code = gen_int(n_code, 0);
38845
38846         ret_val = xmlUCSIsBopomofo(code);
38847         desret_int(ret_val);
38848         call_tests++;
38849         des_int(n_code, code, 0);
38850         xmlResetLastError();
38851         if (mem_base != xmlMemBlocks()) {
38852             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
38853                    xmlMemBlocks() - mem_base);
38854             test_ret++;
38855             printf(" %d", n_code);
38856             printf("\n");
38857         }
38858     }
38859     function_tests++;
38860 #endif
38861
38862     return(test_ret);
38863 }
38864
38865
38866 static int
38867 test_xmlUCSIsBopomofoExtended(void) {
38868     int test_ret = 0;
38869
38870 #if defined(LIBXML_UNICODE_ENABLED)
38871     int mem_base;
38872     int ret_val;
38873     int code; /* UCS code point */
38874     int n_code;
38875
38876     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38877         mem_base = xmlMemBlocks();
38878         code = gen_int(n_code, 0);
38879
38880         ret_val = xmlUCSIsBopomofoExtended(code);
38881         desret_int(ret_val);
38882         call_tests++;
38883         des_int(n_code, code, 0);
38884         xmlResetLastError();
38885         if (mem_base != xmlMemBlocks()) {
38886             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
38887                    xmlMemBlocks() - mem_base);
38888             test_ret++;
38889             printf(" %d", n_code);
38890             printf("\n");
38891         }
38892     }
38893     function_tests++;
38894 #endif
38895
38896     return(test_ret);
38897 }
38898
38899
38900 static int
38901 test_xmlUCSIsBoxDrawing(void) {
38902     int test_ret = 0;
38903
38904 #if defined(LIBXML_UNICODE_ENABLED)
38905     int mem_base;
38906     int ret_val;
38907     int code; /* UCS code point */
38908     int n_code;
38909
38910     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38911         mem_base = xmlMemBlocks();
38912         code = gen_int(n_code, 0);
38913
38914         ret_val = xmlUCSIsBoxDrawing(code);
38915         desret_int(ret_val);
38916         call_tests++;
38917         des_int(n_code, code, 0);
38918         xmlResetLastError();
38919         if (mem_base != xmlMemBlocks()) {
38920             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
38921                    xmlMemBlocks() - mem_base);
38922             test_ret++;
38923             printf(" %d", n_code);
38924             printf("\n");
38925         }
38926     }
38927     function_tests++;
38928 #endif
38929
38930     return(test_ret);
38931 }
38932
38933
38934 static int
38935 test_xmlUCSIsBraillePatterns(void) {
38936     int test_ret = 0;
38937
38938 #if defined(LIBXML_UNICODE_ENABLED)
38939     int mem_base;
38940     int ret_val;
38941     int code; /* UCS code point */
38942     int n_code;
38943
38944     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38945         mem_base = xmlMemBlocks();
38946         code = gen_int(n_code, 0);
38947
38948         ret_val = xmlUCSIsBraillePatterns(code);
38949         desret_int(ret_val);
38950         call_tests++;
38951         des_int(n_code, code, 0);
38952         xmlResetLastError();
38953         if (mem_base != xmlMemBlocks()) {
38954             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
38955                    xmlMemBlocks() - mem_base);
38956             test_ret++;
38957             printf(" %d", n_code);
38958             printf("\n");
38959         }
38960     }
38961     function_tests++;
38962 #endif
38963
38964     return(test_ret);
38965 }
38966
38967
38968 static int
38969 test_xmlUCSIsBuhid(void) {
38970     int test_ret = 0;
38971
38972 #if defined(LIBXML_UNICODE_ENABLED)
38973     int mem_base;
38974     int ret_val;
38975     int code; /* UCS code point */
38976     int n_code;
38977
38978     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38979         mem_base = xmlMemBlocks();
38980         code = gen_int(n_code, 0);
38981
38982         ret_val = xmlUCSIsBuhid(code);
38983         desret_int(ret_val);
38984         call_tests++;
38985         des_int(n_code, code, 0);
38986         xmlResetLastError();
38987         if (mem_base != xmlMemBlocks()) {
38988             printf("Leak of %d blocks found in xmlUCSIsBuhid",
38989                    xmlMemBlocks() - mem_base);
38990             test_ret++;
38991             printf(" %d", n_code);
38992             printf("\n");
38993         }
38994     }
38995     function_tests++;
38996 #endif
38997
38998     return(test_ret);
38999 }
39000
39001
39002 static int
39003 test_xmlUCSIsByzantineMusicalSymbols(void) {
39004     int test_ret = 0;
39005
39006 #if defined(LIBXML_UNICODE_ENABLED)
39007     int mem_base;
39008     int ret_val;
39009     int code; /* UCS code point */
39010     int n_code;
39011
39012     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39013         mem_base = xmlMemBlocks();
39014         code = gen_int(n_code, 0);
39015
39016         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
39017         desret_int(ret_val);
39018         call_tests++;
39019         des_int(n_code, code, 0);
39020         xmlResetLastError();
39021         if (mem_base != xmlMemBlocks()) {
39022             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
39023                    xmlMemBlocks() - mem_base);
39024             test_ret++;
39025             printf(" %d", n_code);
39026             printf("\n");
39027         }
39028     }
39029     function_tests++;
39030 #endif
39031
39032     return(test_ret);
39033 }
39034
39035
39036 static int
39037 test_xmlUCSIsCJKCompatibility(void) {
39038     int test_ret = 0;
39039
39040 #if defined(LIBXML_UNICODE_ENABLED)
39041     int mem_base;
39042     int ret_val;
39043     int code; /* UCS code point */
39044     int n_code;
39045
39046     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39047         mem_base = xmlMemBlocks();
39048         code = gen_int(n_code, 0);
39049
39050         ret_val = xmlUCSIsCJKCompatibility(code);
39051         desret_int(ret_val);
39052         call_tests++;
39053         des_int(n_code, code, 0);
39054         xmlResetLastError();
39055         if (mem_base != xmlMemBlocks()) {
39056             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
39057                    xmlMemBlocks() - mem_base);
39058             test_ret++;
39059             printf(" %d", n_code);
39060             printf("\n");
39061         }
39062     }
39063     function_tests++;
39064 #endif
39065
39066     return(test_ret);
39067 }
39068
39069
39070 static int
39071 test_xmlUCSIsCJKCompatibilityForms(void) {
39072     int test_ret = 0;
39073
39074 #if defined(LIBXML_UNICODE_ENABLED)
39075     int mem_base;
39076     int ret_val;
39077     int code; /* UCS code point */
39078     int n_code;
39079
39080     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39081         mem_base = xmlMemBlocks();
39082         code = gen_int(n_code, 0);
39083
39084         ret_val = xmlUCSIsCJKCompatibilityForms(code);
39085         desret_int(ret_val);
39086         call_tests++;
39087         des_int(n_code, code, 0);
39088         xmlResetLastError();
39089         if (mem_base != xmlMemBlocks()) {
39090             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
39091                    xmlMemBlocks() - mem_base);
39092             test_ret++;
39093             printf(" %d", n_code);
39094             printf("\n");
39095         }
39096     }
39097     function_tests++;
39098 #endif
39099
39100     return(test_ret);
39101 }
39102
39103
39104 static int
39105 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
39106     int test_ret = 0;
39107
39108 #if defined(LIBXML_UNICODE_ENABLED)
39109     int mem_base;
39110     int ret_val;
39111     int code; /* UCS code point */
39112     int n_code;
39113
39114     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39115         mem_base = xmlMemBlocks();
39116         code = gen_int(n_code, 0);
39117
39118         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
39119         desret_int(ret_val);
39120         call_tests++;
39121         des_int(n_code, code, 0);
39122         xmlResetLastError();
39123         if (mem_base != xmlMemBlocks()) {
39124             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
39125                    xmlMemBlocks() - mem_base);
39126             test_ret++;
39127             printf(" %d", n_code);
39128             printf("\n");
39129         }
39130     }
39131     function_tests++;
39132 #endif
39133
39134     return(test_ret);
39135 }
39136
39137
39138 static int
39139 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
39140     int test_ret = 0;
39141
39142 #if defined(LIBXML_UNICODE_ENABLED)
39143     int mem_base;
39144     int ret_val;
39145     int code; /* UCS code point */
39146     int n_code;
39147
39148     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39149         mem_base = xmlMemBlocks();
39150         code = gen_int(n_code, 0);
39151
39152         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
39153         desret_int(ret_val);
39154         call_tests++;
39155         des_int(n_code, code, 0);
39156         xmlResetLastError();
39157         if (mem_base != xmlMemBlocks()) {
39158             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
39159                    xmlMemBlocks() - mem_base);
39160             test_ret++;
39161             printf(" %d", n_code);
39162             printf("\n");
39163         }
39164     }
39165     function_tests++;
39166 #endif
39167
39168     return(test_ret);
39169 }
39170
39171
39172 static int
39173 test_xmlUCSIsCJKRadicalsSupplement(void) {
39174     int test_ret = 0;
39175
39176 #if defined(LIBXML_UNICODE_ENABLED)
39177     int mem_base;
39178     int ret_val;
39179     int code; /* UCS code point */
39180     int n_code;
39181
39182     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39183         mem_base = xmlMemBlocks();
39184         code = gen_int(n_code, 0);
39185
39186         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
39187         desret_int(ret_val);
39188         call_tests++;
39189         des_int(n_code, code, 0);
39190         xmlResetLastError();
39191         if (mem_base != xmlMemBlocks()) {
39192             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
39193                    xmlMemBlocks() - mem_base);
39194             test_ret++;
39195             printf(" %d", n_code);
39196             printf("\n");
39197         }
39198     }
39199     function_tests++;
39200 #endif
39201
39202     return(test_ret);
39203 }
39204
39205
39206 static int
39207 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
39208     int test_ret = 0;
39209
39210 #if defined(LIBXML_UNICODE_ENABLED)
39211     int mem_base;
39212     int ret_val;
39213     int code; /* UCS code point */
39214     int n_code;
39215
39216     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39217         mem_base = xmlMemBlocks();
39218         code = gen_int(n_code, 0);
39219
39220         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
39221         desret_int(ret_val);
39222         call_tests++;
39223         des_int(n_code, code, 0);
39224         xmlResetLastError();
39225         if (mem_base != xmlMemBlocks()) {
39226             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
39227                    xmlMemBlocks() - mem_base);
39228             test_ret++;
39229             printf(" %d", n_code);
39230             printf("\n");
39231         }
39232     }
39233     function_tests++;
39234 #endif
39235
39236     return(test_ret);
39237 }
39238
39239
39240 static int
39241 test_xmlUCSIsCJKUnifiedIdeographs(void) {
39242     int test_ret = 0;
39243
39244 #if defined(LIBXML_UNICODE_ENABLED)
39245     int mem_base;
39246     int ret_val;
39247     int code; /* UCS code point */
39248     int n_code;
39249
39250     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39251         mem_base = xmlMemBlocks();
39252         code = gen_int(n_code, 0);
39253
39254         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
39255         desret_int(ret_val);
39256         call_tests++;
39257         des_int(n_code, code, 0);
39258         xmlResetLastError();
39259         if (mem_base != xmlMemBlocks()) {
39260             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
39261                    xmlMemBlocks() - mem_base);
39262             test_ret++;
39263             printf(" %d", n_code);
39264             printf("\n");
39265         }
39266     }
39267     function_tests++;
39268 #endif
39269
39270     return(test_ret);
39271 }
39272
39273
39274 static int
39275 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
39276     int test_ret = 0;
39277
39278 #if defined(LIBXML_UNICODE_ENABLED)
39279     int mem_base;
39280     int ret_val;
39281     int code; /* UCS code point */
39282     int n_code;
39283
39284     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39285         mem_base = xmlMemBlocks();
39286         code = gen_int(n_code, 0);
39287
39288         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
39289         desret_int(ret_val);
39290         call_tests++;
39291         des_int(n_code, code, 0);
39292         xmlResetLastError();
39293         if (mem_base != xmlMemBlocks()) {
39294             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
39295                    xmlMemBlocks() - mem_base);
39296             test_ret++;
39297             printf(" %d", n_code);
39298             printf("\n");
39299         }
39300     }
39301     function_tests++;
39302 #endif
39303
39304     return(test_ret);
39305 }
39306
39307
39308 static int
39309 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
39310     int test_ret = 0;
39311
39312 #if defined(LIBXML_UNICODE_ENABLED)
39313     int mem_base;
39314     int ret_val;
39315     int code; /* UCS code point */
39316     int n_code;
39317
39318     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39319         mem_base = xmlMemBlocks();
39320         code = gen_int(n_code, 0);
39321
39322         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
39323         desret_int(ret_val);
39324         call_tests++;
39325         des_int(n_code, code, 0);
39326         xmlResetLastError();
39327         if (mem_base != xmlMemBlocks()) {
39328             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
39329                    xmlMemBlocks() - mem_base);
39330             test_ret++;
39331             printf(" %d", n_code);
39332             printf("\n");
39333         }
39334     }
39335     function_tests++;
39336 #endif
39337
39338     return(test_ret);
39339 }
39340
39341
39342 static int
39343 test_xmlUCSIsCat(void) {
39344     int test_ret = 0;
39345
39346 #if defined(LIBXML_UNICODE_ENABLED)
39347     int mem_base;
39348     int ret_val;
39349     int code; /* UCS code point */
39350     int n_code;
39351     char * cat; /* UCS Category name */
39352     int n_cat;
39353
39354     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39355     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
39356         mem_base = xmlMemBlocks();
39357         code = gen_int(n_code, 0);
39358         cat = gen_const_char_ptr(n_cat, 1);
39359
39360         ret_val = xmlUCSIsCat(code, (const char *)cat);
39361         desret_int(ret_val);
39362         call_tests++;
39363         des_int(n_code, code, 0);
39364         des_const_char_ptr(n_cat, (const char *)cat, 1);
39365         xmlResetLastError();
39366         if (mem_base != xmlMemBlocks()) {
39367             printf("Leak of %d blocks found in xmlUCSIsCat",
39368                    xmlMemBlocks() - mem_base);
39369             test_ret++;
39370             printf(" %d", n_code);
39371             printf(" %d", n_cat);
39372             printf("\n");
39373         }
39374     }
39375     }
39376     function_tests++;
39377 #endif
39378
39379     return(test_ret);
39380 }
39381
39382
39383 static int
39384 test_xmlUCSIsCatC(void) {
39385     int test_ret = 0;
39386
39387 #if defined(LIBXML_UNICODE_ENABLED)
39388     int mem_base;
39389     int ret_val;
39390     int code; /* UCS code point */
39391     int n_code;
39392
39393     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39394         mem_base = xmlMemBlocks();
39395         code = gen_int(n_code, 0);
39396
39397         ret_val = xmlUCSIsCatC(code);
39398         desret_int(ret_val);
39399         call_tests++;
39400         des_int(n_code, code, 0);
39401         xmlResetLastError();
39402         if (mem_base != xmlMemBlocks()) {
39403             printf("Leak of %d blocks found in xmlUCSIsCatC",
39404                    xmlMemBlocks() - mem_base);
39405             test_ret++;
39406             printf(" %d", n_code);
39407             printf("\n");
39408         }
39409     }
39410     function_tests++;
39411 #endif
39412
39413     return(test_ret);
39414 }
39415
39416
39417 static int
39418 test_xmlUCSIsCatCc(void) {
39419     int test_ret = 0;
39420
39421 #if defined(LIBXML_UNICODE_ENABLED)
39422     int mem_base;
39423     int ret_val;
39424     int code; /* UCS code point */
39425     int n_code;
39426
39427     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39428         mem_base = xmlMemBlocks();
39429         code = gen_int(n_code, 0);
39430
39431         ret_val = xmlUCSIsCatCc(code);
39432         desret_int(ret_val);
39433         call_tests++;
39434         des_int(n_code, code, 0);
39435         xmlResetLastError();
39436         if (mem_base != xmlMemBlocks()) {
39437             printf("Leak of %d blocks found in xmlUCSIsCatCc",
39438                    xmlMemBlocks() - mem_base);
39439             test_ret++;
39440             printf(" %d", n_code);
39441             printf("\n");
39442         }
39443     }
39444     function_tests++;
39445 #endif
39446
39447     return(test_ret);
39448 }
39449
39450
39451 static int
39452 test_xmlUCSIsCatCf(void) {
39453     int test_ret = 0;
39454
39455 #if defined(LIBXML_UNICODE_ENABLED)
39456     int mem_base;
39457     int ret_val;
39458     int code; /* UCS code point */
39459     int n_code;
39460
39461     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39462         mem_base = xmlMemBlocks();
39463         code = gen_int(n_code, 0);
39464
39465         ret_val = xmlUCSIsCatCf(code);
39466         desret_int(ret_val);
39467         call_tests++;
39468         des_int(n_code, code, 0);
39469         xmlResetLastError();
39470         if (mem_base != xmlMemBlocks()) {
39471             printf("Leak of %d blocks found in xmlUCSIsCatCf",
39472                    xmlMemBlocks() - mem_base);
39473             test_ret++;
39474             printf(" %d", n_code);
39475             printf("\n");
39476         }
39477     }
39478     function_tests++;
39479 #endif
39480
39481     return(test_ret);
39482 }
39483
39484
39485 static int
39486 test_xmlUCSIsCatCo(void) {
39487     int test_ret = 0;
39488
39489 #if defined(LIBXML_UNICODE_ENABLED)
39490     int mem_base;
39491     int ret_val;
39492     int code; /* UCS code point */
39493     int n_code;
39494
39495     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39496         mem_base = xmlMemBlocks();
39497         code = gen_int(n_code, 0);
39498
39499         ret_val = xmlUCSIsCatCo(code);
39500         desret_int(ret_val);
39501         call_tests++;
39502         des_int(n_code, code, 0);
39503         xmlResetLastError();
39504         if (mem_base != xmlMemBlocks()) {
39505             printf("Leak of %d blocks found in xmlUCSIsCatCo",
39506                    xmlMemBlocks() - mem_base);
39507             test_ret++;
39508             printf(" %d", n_code);
39509             printf("\n");
39510         }
39511     }
39512     function_tests++;
39513 #endif
39514
39515     return(test_ret);
39516 }
39517
39518
39519 static int
39520 test_xmlUCSIsCatCs(void) {
39521     int test_ret = 0;
39522
39523 #if defined(LIBXML_UNICODE_ENABLED)
39524     int mem_base;
39525     int ret_val;
39526     int code; /* UCS code point */
39527     int n_code;
39528
39529     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39530         mem_base = xmlMemBlocks();
39531         code = gen_int(n_code, 0);
39532
39533         ret_val = xmlUCSIsCatCs(code);
39534         desret_int(ret_val);
39535         call_tests++;
39536         des_int(n_code, code, 0);
39537         xmlResetLastError();
39538         if (mem_base != xmlMemBlocks()) {
39539             printf("Leak of %d blocks found in xmlUCSIsCatCs",
39540                    xmlMemBlocks() - mem_base);
39541             test_ret++;
39542             printf(" %d", n_code);
39543             printf("\n");
39544         }
39545     }
39546     function_tests++;
39547 #endif
39548
39549     return(test_ret);
39550 }
39551
39552
39553 static int
39554 test_xmlUCSIsCatL(void) {
39555     int test_ret = 0;
39556
39557 #if defined(LIBXML_UNICODE_ENABLED)
39558     int mem_base;
39559     int ret_val;
39560     int code; /* UCS code point */
39561     int n_code;
39562
39563     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39564         mem_base = xmlMemBlocks();
39565         code = gen_int(n_code, 0);
39566
39567         ret_val = xmlUCSIsCatL(code);
39568         desret_int(ret_val);
39569         call_tests++;
39570         des_int(n_code, code, 0);
39571         xmlResetLastError();
39572         if (mem_base != xmlMemBlocks()) {
39573             printf("Leak of %d blocks found in xmlUCSIsCatL",
39574                    xmlMemBlocks() - mem_base);
39575             test_ret++;
39576             printf(" %d", n_code);
39577             printf("\n");
39578         }
39579     }
39580     function_tests++;
39581 #endif
39582
39583     return(test_ret);
39584 }
39585
39586
39587 static int
39588 test_xmlUCSIsCatLl(void) {
39589     int test_ret = 0;
39590
39591 #if defined(LIBXML_UNICODE_ENABLED)
39592     int mem_base;
39593     int ret_val;
39594     int code; /* UCS code point */
39595     int n_code;
39596
39597     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39598         mem_base = xmlMemBlocks();
39599         code = gen_int(n_code, 0);
39600
39601         ret_val = xmlUCSIsCatLl(code);
39602         desret_int(ret_val);
39603         call_tests++;
39604         des_int(n_code, code, 0);
39605         xmlResetLastError();
39606         if (mem_base != xmlMemBlocks()) {
39607             printf("Leak of %d blocks found in xmlUCSIsCatLl",
39608                    xmlMemBlocks() - mem_base);
39609             test_ret++;
39610             printf(" %d", n_code);
39611             printf("\n");
39612         }
39613     }
39614     function_tests++;
39615 #endif
39616
39617     return(test_ret);
39618 }
39619
39620
39621 static int
39622 test_xmlUCSIsCatLm(void) {
39623     int test_ret = 0;
39624
39625 #if defined(LIBXML_UNICODE_ENABLED)
39626     int mem_base;
39627     int ret_val;
39628     int code; /* UCS code point */
39629     int n_code;
39630
39631     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39632         mem_base = xmlMemBlocks();
39633         code = gen_int(n_code, 0);
39634
39635         ret_val = xmlUCSIsCatLm(code);
39636         desret_int(ret_val);
39637         call_tests++;
39638         des_int(n_code, code, 0);
39639         xmlResetLastError();
39640         if (mem_base != xmlMemBlocks()) {
39641             printf("Leak of %d blocks found in xmlUCSIsCatLm",
39642                    xmlMemBlocks() - mem_base);
39643             test_ret++;
39644             printf(" %d", n_code);
39645             printf("\n");
39646         }
39647     }
39648     function_tests++;
39649 #endif
39650
39651     return(test_ret);
39652 }
39653
39654
39655 static int
39656 test_xmlUCSIsCatLo(void) {
39657     int test_ret = 0;
39658
39659 #if defined(LIBXML_UNICODE_ENABLED)
39660     int mem_base;
39661     int ret_val;
39662     int code; /* UCS code point */
39663     int n_code;
39664
39665     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39666         mem_base = xmlMemBlocks();
39667         code = gen_int(n_code, 0);
39668
39669         ret_val = xmlUCSIsCatLo(code);
39670         desret_int(ret_val);
39671         call_tests++;
39672         des_int(n_code, code, 0);
39673         xmlResetLastError();
39674         if (mem_base != xmlMemBlocks()) {
39675             printf("Leak of %d blocks found in xmlUCSIsCatLo",
39676                    xmlMemBlocks() - mem_base);
39677             test_ret++;
39678             printf(" %d", n_code);
39679             printf("\n");
39680         }
39681     }
39682     function_tests++;
39683 #endif
39684
39685     return(test_ret);
39686 }
39687
39688
39689 static int
39690 test_xmlUCSIsCatLt(void) {
39691     int test_ret = 0;
39692
39693 #if defined(LIBXML_UNICODE_ENABLED)
39694     int mem_base;
39695     int ret_val;
39696     int code; /* UCS code point */
39697     int n_code;
39698
39699     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39700         mem_base = xmlMemBlocks();
39701         code = gen_int(n_code, 0);
39702
39703         ret_val = xmlUCSIsCatLt(code);
39704         desret_int(ret_val);
39705         call_tests++;
39706         des_int(n_code, code, 0);
39707         xmlResetLastError();
39708         if (mem_base != xmlMemBlocks()) {
39709             printf("Leak of %d blocks found in xmlUCSIsCatLt",
39710                    xmlMemBlocks() - mem_base);
39711             test_ret++;
39712             printf(" %d", n_code);
39713             printf("\n");
39714         }
39715     }
39716     function_tests++;
39717 #endif
39718
39719     return(test_ret);
39720 }
39721
39722
39723 static int
39724 test_xmlUCSIsCatLu(void) {
39725     int test_ret = 0;
39726
39727 #if defined(LIBXML_UNICODE_ENABLED)
39728     int mem_base;
39729     int ret_val;
39730     int code; /* UCS code point */
39731     int n_code;
39732
39733     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39734         mem_base = xmlMemBlocks();
39735         code = gen_int(n_code, 0);
39736
39737         ret_val = xmlUCSIsCatLu(code);
39738         desret_int(ret_val);
39739         call_tests++;
39740         des_int(n_code, code, 0);
39741         xmlResetLastError();
39742         if (mem_base != xmlMemBlocks()) {
39743             printf("Leak of %d blocks found in xmlUCSIsCatLu",
39744                    xmlMemBlocks() - mem_base);
39745             test_ret++;
39746             printf(" %d", n_code);
39747             printf("\n");
39748         }
39749     }
39750     function_tests++;
39751 #endif
39752
39753     return(test_ret);
39754 }
39755
39756
39757 static int
39758 test_xmlUCSIsCatM(void) {
39759     int test_ret = 0;
39760
39761 #if defined(LIBXML_UNICODE_ENABLED)
39762     int mem_base;
39763     int ret_val;
39764     int code; /* UCS code point */
39765     int n_code;
39766
39767     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39768         mem_base = xmlMemBlocks();
39769         code = gen_int(n_code, 0);
39770
39771         ret_val = xmlUCSIsCatM(code);
39772         desret_int(ret_val);
39773         call_tests++;
39774         des_int(n_code, code, 0);
39775         xmlResetLastError();
39776         if (mem_base != xmlMemBlocks()) {
39777             printf("Leak of %d blocks found in xmlUCSIsCatM",
39778                    xmlMemBlocks() - mem_base);
39779             test_ret++;
39780             printf(" %d", n_code);
39781             printf("\n");
39782         }
39783     }
39784     function_tests++;
39785 #endif
39786
39787     return(test_ret);
39788 }
39789
39790
39791 static int
39792 test_xmlUCSIsCatMc(void) {
39793     int test_ret = 0;
39794
39795 #if defined(LIBXML_UNICODE_ENABLED)
39796     int mem_base;
39797     int ret_val;
39798     int code; /* UCS code point */
39799     int n_code;
39800
39801     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39802         mem_base = xmlMemBlocks();
39803         code = gen_int(n_code, 0);
39804
39805         ret_val = xmlUCSIsCatMc(code);
39806         desret_int(ret_val);
39807         call_tests++;
39808         des_int(n_code, code, 0);
39809         xmlResetLastError();
39810         if (mem_base != xmlMemBlocks()) {
39811             printf("Leak of %d blocks found in xmlUCSIsCatMc",
39812                    xmlMemBlocks() - mem_base);
39813             test_ret++;
39814             printf(" %d", n_code);
39815             printf("\n");
39816         }
39817     }
39818     function_tests++;
39819 #endif
39820
39821     return(test_ret);
39822 }
39823
39824
39825 static int
39826 test_xmlUCSIsCatMe(void) {
39827     int test_ret = 0;
39828
39829 #if defined(LIBXML_UNICODE_ENABLED)
39830     int mem_base;
39831     int ret_val;
39832     int code; /* UCS code point */
39833     int n_code;
39834
39835     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39836         mem_base = xmlMemBlocks();
39837         code = gen_int(n_code, 0);
39838
39839         ret_val = xmlUCSIsCatMe(code);
39840         desret_int(ret_val);
39841         call_tests++;
39842         des_int(n_code, code, 0);
39843         xmlResetLastError();
39844         if (mem_base != xmlMemBlocks()) {
39845             printf("Leak of %d blocks found in xmlUCSIsCatMe",
39846                    xmlMemBlocks() - mem_base);
39847             test_ret++;
39848             printf(" %d", n_code);
39849             printf("\n");
39850         }
39851     }
39852     function_tests++;
39853 #endif
39854
39855     return(test_ret);
39856 }
39857
39858
39859 static int
39860 test_xmlUCSIsCatMn(void) {
39861     int test_ret = 0;
39862
39863 #if defined(LIBXML_UNICODE_ENABLED)
39864     int mem_base;
39865     int ret_val;
39866     int code; /* UCS code point */
39867     int n_code;
39868
39869     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39870         mem_base = xmlMemBlocks();
39871         code = gen_int(n_code, 0);
39872
39873         ret_val = xmlUCSIsCatMn(code);
39874         desret_int(ret_val);
39875         call_tests++;
39876         des_int(n_code, code, 0);
39877         xmlResetLastError();
39878         if (mem_base != xmlMemBlocks()) {
39879             printf("Leak of %d blocks found in xmlUCSIsCatMn",
39880                    xmlMemBlocks() - mem_base);
39881             test_ret++;
39882             printf(" %d", n_code);
39883             printf("\n");
39884         }
39885     }
39886     function_tests++;
39887 #endif
39888
39889     return(test_ret);
39890 }
39891
39892
39893 static int
39894 test_xmlUCSIsCatN(void) {
39895     int test_ret = 0;
39896
39897 #if defined(LIBXML_UNICODE_ENABLED)
39898     int mem_base;
39899     int ret_val;
39900     int code; /* UCS code point */
39901     int n_code;
39902
39903     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39904         mem_base = xmlMemBlocks();
39905         code = gen_int(n_code, 0);
39906
39907         ret_val = xmlUCSIsCatN(code);
39908         desret_int(ret_val);
39909         call_tests++;
39910         des_int(n_code, code, 0);
39911         xmlResetLastError();
39912         if (mem_base != xmlMemBlocks()) {
39913             printf("Leak of %d blocks found in xmlUCSIsCatN",
39914                    xmlMemBlocks() - mem_base);
39915             test_ret++;
39916             printf(" %d", n_code);
39917             printf("\n");
39918         }
39919     }
39920     function_tests++;
39921 #endif
39922
39923     return(test_ret);
39924 }
39925
39926
39927 static int
39928 test_xmlUCSIsCatNd(void) {
39929     int test_ret = 0;
39930
39931 #if defined(LIBXML_UNICODE_ENABLED)
39932     int mem_base;
39933     int ret_val;
39934     int code; /* UCS code point */
39935     int n_code;
39936
39937     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39938         mem_base = xmlMemBlocks();
39939         code = gen_int(n_code, 0);
39940
39941         ret_val = xmlUCSIsCatNd(code);
39942         desret_int(ret_val);
39943         call_tests++;
39944         des_int(n_code, code, 0);
39945         xmlResetLastError();
39946         if (mem_base != xmlMemBlocks()) {
39947             printf("Leak of %d blocks found in xmlUCSIsCatNd",
39948                    xmlMemBlocks() - mem_base);
39949             test_ret++;
39950             printf(" %d", n_code);
39951             printf("\n");
39952         }
39953     }
39954     function_tests++;
39955 #endif
39956
39957     return(test_ret);
39958 }
39959
39960
39961 static int
39962 test_xmlUCSIsCatNl(void) {
39963     int test_ret = 0;
39964
39965 #if defined(LIBXML_UNICODE_ENABLED)
39966     int mem_base;
39967     int ret_val;
39968     int code; /* UCS code point */
39969     int n_code;
39970
39971     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39972         mem_base = xmlMemBlocks();
39973         code = gen_int(n_code, 0);
39974
39975         ret_val = xmlUCSIsCatNl(code);
39976         desret_int(ret_val);
39977         call_tests++;
39978         des_int(n_code, code, 0);
39979         xmlResetLastError();
39980         if (mem_base != xmlMemBlocks()) {
39981             printf("Leak of %d blocks found in xmlUCSIsCatNl",
39982                    xmlMemBlocks() - mem_base);
39983             test_ret++;
39984             printf(" %d", n_code);
39985             printf("\n");
39986         }
39987     }
39988     function_tests++;
39989 #endif
39990
39991     return(test_ret);
39992 }
39993
39994
39995 static int
39996 test_xmlUCSIsCatNo(void) {
39997     int test_ret = 0;
39998
39999 #if defined(LIBXML_UNICODE_ENABLED)
40000     int mem_base;
40001     int ret_val;
40002     int code; /* UCS code point */
40003     int n_code;
40004
40005     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40006         mem_base = xmlMemBlocks();
40007         code = gen_int(n_code, 0);
40008
40009         ret_val = xmlUCSIsCatNo(code);
40010         desret_int(ret_val);
40011         call_tests++;
40012         des_int(n_code, code, 0);
40013         xmlResetLastError();
40014         if (mem_base != xmlMemBlocks()) {
40015             printf("Leak of %d blocks found in xmlUCSIsCatNo",
40016                    xmlMemBlocks() - mem_base);
40017             test_ret++;
40018             printf(" %d", n_code);
40019             printf("\n");
40020         }
40021     }
40022     function_tests++;
40023 #endif
40024
40025     return(test_ret);
40026 }
40027
40028
40029 static int
40030 test_xmlUCSIsCatP(void) {
40031     int test_ret = 0;
40032
40033 #if defined(LIBXML_UNICODE_ENABLED)
40034     int mem_base;
40035     int ret_val;
40036     int code; /* UCS code point */
40037     int n_code;
40038
40039     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40040         mem_base = xmlMemBlocks();
40041         code = gen_int(n_code, 0);
40042
40043         ret_val = xmlUCSIsCatP(code);
40044         desret_int(ret_val);
40045         call_tests++;
40046         des_int(n_code, code, 0);
40047         xmlResetLastError();
40048         if (mem_base != xmlMemBlocks()) {
40049             printf("Leak of %d blocks found in xmlUCSIsCatP",
40050                    xmlMemBlocks() - mem_base);
40051             test_ret++;
40052             printf(" %d", n_code);
40053             printf("\n");
40054         }
40055     }
40056     function_tests++;
40057 #endif
40058
40059     return(test_ret);
40060 }
40061
40062
40063 static int
40064 test_xmlUCSIsCatPc(void) {
40065     int test_ret = 0;
40066
40067 #if defined(LIBXML_UNICODE_ENABLED)
40068     int mem_base;
40069     int ret_val;
40070     int code; /* UCS code point */
40071     int n_code;
40072
40073     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40074         mem_base = xmlMemBlocks();
40075         code = gen_int(n_code, 0);
40076
40077         ret_val = xmlUCSIsCatPc(code);
40078         desret_int(ret_val);
40079         call_tests++;
40080         des_int(n_code, code, 0);
40081         xmlResetLastError();
40082         if (mem_base != xmlMemBlocks()) {
40083             printf("Leak of %d blocks found in xmlUCSIsCatPc",
40084                    xmlMemBlocks() - mem_base);
40085             test_ret++;
40086             printf(" %d", n_code);
40087             printf("\n");
40088         }
40089     }
40090     function_tests++;
40091 #endif
40092
40093     return(test_ret);
40094 }
40095
40096
40097 static int
40098 test_xmlUCSIsCatPd(void) {
40099     int test_ret = 0;
40100
40101 #if defined(LIBXML_UNICODE_ENABLED)
40102     int mem_base;
40103     int ret_val;
40104     int code; /* UCS code point */
40105     int n_code;
40106
40107     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40108         mem_base = xmlMemBlocks();
40109         code = gen_int(n_code, 0);
40110
40111         ret_val = xmlUCSIsCatPd(code);
40112         desret_int(ret_val);
40113         call_tests++;
40114         des_int(n_code, code, 0);
40115         xmlResetLastError();
40116         if (mem_base != xmlMemBlocks()) {
40117             printf("Leak of %d blocks found in xmlUCSIsCatPd",
40118                    xmlMemBlocks() - mem_base);
40119             test_ret++;
40120             printf(" %d", n_code);
40121             printf("\n");
40122         }
40123     }
40124     function_tests++;
40125 #endif
40126
40127     return(test_ret);
40128 }
40129
40130
40131 static int
40132 test_xmlUCSIsCatPe(void) {
40133     int test_ret = 0;
40134
40135 #if defined(LIBXML_UNICODE_ENABLED)
40136     int mem_base;
40137     int ret_val;
40138     int code; /* UCS code point */
40139     int n_code;
40140
40141     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40142         mem_base = xmlMemBlocks();
40143         code = gen_int(n_code, 0);
40144
40145         ret_val = xmlUCSIsCatPe(code);
40146         desret_int(ret_val);
40147         call_tests++;
40148         des_int(n_code, code, 0);
40149         xmlResetLastError();
40150         if (mem_base != xmlMemBlocks()) {
40151             printf("Leak of %d blocks found in xmlUCSIsCatPe",
40152                    xmlMemBlocks() - mem_base);
40153             test_ret++;
40154             printf(" %d", n_code);
40155             printf("\n");
40156         }
40157     }
40158     function_tests++;
40159 #endif
40160
40161     return(test_ret);
40162 }
40163
40164
40165 static int
40166 test_xmlUCSIsCatPf(void) {
40167     int test_ret = 0;
40168
40169 #if defined(LIBXML_UNICODE_ENABLED)
40170     int mem_base;
40171     int ret_val;
40172     int code; /* UCS code point */
40173     int n_code;
40174
40175     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40176         mem_base = xmlMemBlocks();
40177         code = gen_int(n_code, 0);
40178
40179         ret_val = xmlUCSIsCatPf(code);
40180         desret_int(ret_val);
40181         call_tests++;
40182         des_int(n_code, code, 0);
40183         xmlResetLastError();
40184         if (mem_base != xmlMemBlocks()) {
40185             printf("Leak of %d blocks found in xmlUCSIsCatPf",
40186                    xmlMemBlocks() - mem_base);
40187             test_ret++;
40188             printf(" %d", n_code);
40189             printf("\n");
40190         }
40191     }
40192     function_tests++;
40193 #endif
40194
40195     return(test_ret);
40196 }
40197
40198
40199 static int
40200 test_xmlUCSIsCatPi(void) {
40201     int test_ret = 0;
40202
40203 #if defined(LIBXML_UNICODE_ENABLED)
40204     int mem_base;
40205     int ret_val;
40206     int code; /* UCS code point */
40207     int n_code;
40208
40209     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40210         mem_base = xmlMemBlocks();
40211         code = gen_int(n_code, 0);
40212
40213         ret_val = xmlUCSIsCatPi(code);
40214         desret_int(ret_val);
40215         call_tests++;
40216         des_int(n_code, code, 0);
40217         xmlResetLastError();
40218         if (mem_base != xmlMemBlocks()) {
40219             printf("Leak of %d blocks found in xmlUCSIsCatPi",
40220                    xmlMemBlocks() - mem_base);
40221             test_ret++;
40222             printf(" %d", n_code);
40223             printf("\n");
40224         }
40225     }
40226     function_tests++;
40227 #endif
40228
40229     return(test_ret);
40230 }
40231
40232
40233 static int
40234 test_xmlUCSIsCatPo(void) {
40235     int test_ret = 0;
40236
40237 #if defined(LIBXML_UNICODE_ENABLED)
40238     int mem_base;
40239     int ret_val;
40240     int code; /* UCS code point */
40241     int n_code;
40242
40243     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40244         mem_base = xmlMemBlocks();
40245         code = gen_int(n_code, 0);
40246
40247         ret_val = xmlUCSIsCatPo(code);
40248         desret_int(ret_val);
40249         call_tests++;
40250         des_int(n_code, code, 0);
40251         xmlResetLastError();
40252         if (mem_base != xmlMemBlocks()) {
40253             printf("Leak of %d blocks found in xmlUCSIsCatPo",
40254                    xmlMemBlocks() - mem_base);
40255             test_ret++;
40256             printf(" %d", n_code);
40257             printf("\n");
40258         }
40259     }
40260     function_tests++;
40261 #endif
40262
40263     return(test_ret);
40264 }
40265
40266
40267 static int
40268 test_xmlUCSIsCatPs(void) {
40269     int test_ret = 0;
40270
40271 #if defined(LIBXML_UNICODE_ENABLED)
40272     int mem_base;
40273     int ret_val;
40274     int code; /* UCS code point */
40275     int n_code;
40276
40277     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40278         mem_base = xmlMemBlocks();
40279         code = gen_int(n_code, 0);
40280
40281         ret_val = xmlUCSIsCatPs(code);
40282         desret_int(ret_val);
40283         call_tests++;
40284         des_int(n_code, code, 0);
40285         xmlResetLastError();
40286         if (mem_base != xmlMemBlocks()) {
40287             printf("Leak of %d blocks found in xmlUCSIsCatPs",
40288                    xmlMemBlocks() - mem_base);
40289             test_ret++;
40290             printf(" %d", n_code);
40291             printf("\n");
40292         }
40293     }
40294     function_tests++;
40295 #endif
40296
40297     return(test_ret);
40298 }
40299
40300
40301 static int
40302 test_xmlUCSIsCatS(void) {
40303     int test_ret = 0;
40304
40305 #if defined(LIBXML_UNICODE_ENABLED)
40306     int mem_base;
40307     int ret_val;
40308     int code; /* UCS code point */
40309     int n_code;
40310
40311     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40312         mem_base = xmlMemBlocks();
40313         code = gen_int(n_code, 0);
40314
40315         ret_val = xmlUCSIsCatS(code);
40316         desret_int(ret_val);
40317         call_tests++;
40318         des_int(n_code, code, 0);
40319         xmlResetLastError();
40320         if (mem_base != xmlMemBlocks()) {
40321             printf("Leak of %d blocks found in xmlUCSIsCatS",
40322                    xmlMemBlocks() - mem_base);
40323             test_ret++;
40324             printf(" %d", n_code);
40325             printf("\n");
40326         }
40327     }
40328     function_tests++;
40329 #endif
40330
40331     return(test_ret);
40332 }
40333
40334
40335 static int
40336 test_xmlUCSIsCatSc(void) {
40337     int test_ret = 0;
40338
40339 #if defined(LIBXML_UNICODE_ENABLED)
40340     int mem_base;
40341     int ret_val;
40342     int code; /* UCS code point */
40343     int n_code;
40344
40345     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40346         mem_base = xmlMemBlocks();
40347         code = gen_int(n_code, 0);
40348
40349         ret_val = xmlUCSIsCatSc(code);
40350         desret_int(ret_val);
40351         call_tests++;
40352         des_int(n_code, code, 0);
40353         xmlResetLastError();
40354         if (mem_base != xmlMemBlocks()) {
40355             printf("Leak of %d blocks found in xmlUCSIsCatSc",
40356                    xmlMemBlocks() - mem_base);
40357             test_ret++;
40358             printf(" %d", n_code);
40359             printf("\n");
40360         }
40361     }
40362     function_tests++;
40363 #endif
40364
40365     return(test_ret);
40366 }
40367
40368
40369 static int
40370 test_xmlUCSIsCatSk(void) {
40371     int test_ret = 0;
40372
40373 #if defined(LIBXML_UNICODE_ENABLED)
40374     int mem_base;
40375     int ret_val;
40376     int code; /* UCS code point */
40377     int n_code;
40378
40379     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40380         mem_base = xmlMemBlocks();
40381         code = gen_int(n_code, 0);
40382
40383         ret_val = xmlUCSIsCatSk(code);
40384         desret_int(ret_val);
40385         call_tests++;
40386         des_int(n_code, code, 0);
40387         xmlResetLastError();
40388         if (mem_base != xmlMemBlocks()) {
40389             printf("Leak of %d blocks found in xmlUCSIsCatSk",
40390                    xmlMemBlocks() - mem_base);
40391             test_ret++;
40392             printf(" %d", n_code);
40393             printf("\n");
40394         }
40395     }
40396     function_tests++;
40397 #endif
40398
40399     return(test_ret);
40400 }
40401
40402
40403 static int
40404 test_xmlUCSIsCatSm(void) {
40405     int test_ret = 0;
40406
40407 #if defined(LIBXML_UNICODE_ENABLED)
40408     int mem_base;
40409     int ret_val;
40410     int code; /* UCS code point */
40411     int n_code;
40412
40413     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40414         mem_base = xmlMemBlocks();
40415         code = gen_int(n_code, 0);
40416
40417         ret_val = xmlUCSIsCatSm(code);
40418         desret_int(ret_val);
40419         call_tests++;
40420         des_int(n_code, code, 0);
40421         xmlResetLastError();
40422         if (mem_base != xmlMemBlocks()) {
40423             printf("Leak of %d blocks found in xmlUCSIsCatSm",
40424                    xmlMemBlocks() - mem_base);
40425             test_ret++;
40426             printf(" %d", n_code);
40427             printf("\n");
40428         }
40429     }
40430     function_tests++;
40431 #endif
40432
40433     return(test_ret);
40434 }
40435
40436
40437 static int
40438 test_xmlUCSIsCatSo(void) {
40439     int test_ret = 0;
40440
40441 #if defined(LIBXML_UNICODE_ENABLED)
40442     int mem_base;
40443     int ret_val;
40444     int code; /* UCS code point */
40445     int n_code;
40446
40447     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40448         mem_base = xmlMemBlocks();
40449         code = gen_int(n_code, 0);
40450
40451         ret_val = xmlUCSIsCatSo(code);
40452         desret_int(ret_val);
40453         call_tests++;
40454         des_int(n_code, code, 0);
40455         xmlResetLastError();
40456         if (mem_base != xmlMemBlocks()) {
40457             printf("Leak of %d blocks found in xmlUCSIsCatSo",
40458                    xmlMemBlocks() - mem_base);
40459             test_ret++;
40460             printf(" %d", n_code);
40461             printf("\n");
40462         }
40463     }
40464     function_tests++;
40465 #endif
40466
40467     return(test_ret);
40468 }
40469
40470
40471 static int
40472 test_xmlUCSIsCatZ(void) {
40473     int test_ret = 0;
40474
40475 #if defined(LIBXML_UNICODE_ENABLED)
40476     int mem_base;
40477     int ret_val;
40478     int code; /* UCS code point */
40479     int n_code;
40480
40481     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40482         mem_base = xmlMemBlocks();
40483         code = gen_int(n_code, 0);
40484
40485         ret_val = xmlUCSIsCatZ(code);
40486         desret_int(ret_val);
40487         call_tests++;
40488         des_int(n_code, code, 0);
40489         xmlResetLastError();
40490         if (mem_base != xmlMemBlocks()) {
40491             printf("Leak of %d blocks found in xmlUCSIsCatZ",
40492                    xmlMemBlocks() - mem_base);
40493             test_ret++;
40494             printf(" %d", n_code);
40495             printf("\n");
40496         }
40497     }
40498     function_tests++;
40499 #endif
40500
40501     return(test_ret);
40502 }
40503
40504
40505 static int
40506 test_xmlUCSIsCatZl(void) {
40507     int test_ret = 0;
40508
40509 #if defined(LIBXML_UNICODE_ENABLED)
40510     int mem_base;
40511     int ret_val;
40512     int code; /* UCS code point */
40513     int n_code;
40514
40515     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40516         mem_base = xmlMemBlocks();
40517         code = gen_int(n_code, 0);
40518
40519         ret_val = xmlUCSIsCatZl(code);
40520         desret_int(ret_val);
40521         call_tests++;
40522         des_int(n_code, code, 0);
40523         xmlResetLastError();
40524         if (mem_base != xmlMemBlocks()) {
40525             printf("Leak of %d blocks found in xmlUCSIsCatZl",
40526                    xmlMemBlocks() - mem_base);
40527             test_ret++;
40528             printf(" %d", n_code);
40529             printf("\n");
40530         }
40531     }
40532     function_tests++;
40533 #endif
40534
40535     return(test_ret);
40536 }
40537
40538
40539 static int
40540 test_xmlUCSIsCatZp(void) {
40541     int test_ret = 0;
40542
40543 #if defined(LIBXML_UNICODE_ENABLED)
40544     int mem_base;
40545     int ret_val;
40546     int code; /* UCS code point */
40547     int n_code;
40548
40549     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40550         mem_base = xmlMemBlocks();
40551         code = gen_int(n_code, 0);
40552
40553         ret_val = xmlUCSIsCatZp(code);
40554         desret_int(ret_val);
40555         call_tests++;
40556         des_int(n_code, code, 0);
40557         xmlResetLastError();
40558         if (mem_base != xmlMemBlocks()) {
40559             printf("Leak of %d blocks found in xmlUCSIsCatZp",
40560                    xmlMemBlocks() - mem_base);
40561             test_ret++;
40562             printf(" %d", n_code);
40563             printf("\n");
40564         }
40565     }
40566     function_tests++;
40567 #endif
40568
40569     return(test_ret);
40570 }
40571
40572
40573 static int
40574 test_xmlUCSIsCatZs(void) {
40575     int test_ret = 0;
40576
40577 #if defined(LIBXML_UNICODE_ENABLED)
40578     int mem_base;
40579     int ret_val;
40580     int code; /* UCS code point */
40581     int n_code;
40582
40583     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40584         mem_base = xmlMemBlocks();
40585         code = gen_int(n_code, 0);
40586
40587         ret_val = xmlUCSIsCatZs(code);
40588         desret_int(ret_val);
40589         call_tests++;
40590         des_int(n_code, code, 0);
40591         xmlResetLastError();
40592         if (mem_base != xmlMemBlocks()) {
40593             printf("Leak of %d blocks found in xmlUCSIsCatZs",
40594                    xmlMemBlocks() - mem_base);
40595             test_ret++;
40596             printf(" %d", n_code);
40597             printf("\n");
40598         }
40599     }
40600     function_tests++;
40601 #endif
40602
40603     return(test_ret);
40604 }
40605
40606
40607 static int
40608 test_xmlUCSIsCherokee(void) {
40609     int test_ret = 0;
40610
40611 #if defined(LIBXML_UNICODE_ENABLED)
40612     int mem_base;
40613     int ret_val;
40614     int code; /* UCS code point */
40615     int n_code;
40616
40617     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40618         mem_base = xmlMemBlocks();
40619         code = gen_int(n_code, 0);
40620
40621         ret_val = xmlUCSIsCherokee(code);
40622         desret_int(ret_val);
40623         call_tests++;
40624         des_int(n_code, code, 0);
40625         xmlResetLastError();
40626         if (mem_base != xmlMemBlocks()) {
40627             printf("Leak of %d blocks found in xmlUCSIsCherokee",
40628                    xmlMemBlocks() - mem_base);
40629             test_ret++;
40630             printf(" %d", n_code);
40631             printf("\n");
40632         }
40633     }
40634     function_tests++;
40635 #endif
40636
40637     return(test_ret);
40638 }
40639
40640
40641 static int
40642 test_xmlUCSIsCombiningDiacriticalMarks(void) {
40643     int test_ret = 0;
40644
40645 #if defined(LIBXML_UNICODE_ENABLED)
40646     int mem_base;
40647     int ret_val;
40648     int code; /* UCS code point */
40649     int n_code;
40650
40651     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40652         mem_base = xmlMemBlocks();
40653         code = gen_int(n_code, 0);
40654
40655         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
40656         desret_int(ret_val);
40657         call_tests++;
40658         des_int(n_code, code, 0);
40659         xmlResetLastError();
40660         if (mem_base != xmlMemBlocks()) {
40661             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
40662                    xmlMemBlocks() - mem_base);
40663             test_ret++;
40664             printf(" %d", n_code);
40665             printf("\n");
40666         }
40667     }
40668     function_tests++;
40669 #endif
40670
40671     return(test_ret);
40672 }
40673
40674
40675 static int
40676 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
40677     int test_ret = 0;
40678
40679 #if defined(LIBXML_UNICODE_ENABLED)
40680     int mem_base;
40681     int ret_val;
40682     int code; /* UCS code point */
40683     int n_code;
40684
40685     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40686         mem_base = xmlMemBlocks();
40687         code = gen_int(n_code, 0);
40688
40689         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
40690         desret_int(ret_val);
40691         call_tests++;
40692         des_int(n_code, code, 0);
40693         xmlResetLastError();
40694         if (mem_base != xmlMemBlocks()) {
40695             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
40696                    xmlMemBlocks() - mem_base);
40697             test_ret++;
40698             printf(" %d", n_code);
40699             printf("\n");
40700         }
40701     }
40702     function_tests++;
40703 #endif
40704
40705     return(test_ret);
40706 }
40707
40708
40709 static int
40710 test_xmlUCSIsCombiningHalfMarks(void) {
40711     int test_ret = 0;
40712
40713 #if defined(LIBXML_UNICODE_ENABLED)
40714     int mem_base;
40715     int ret_val;
40716     int code; /* UCS code point */
40717     int n_code;
40718
40719     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40720         mem_base = xmlMemBlocks();
40721         code = gen_int(n_code, 0);
40722
40723         ret_val = xmlUCSIsCombiningHalfMarks(code);
40724         desret_int(ret_val);
40725         call_tests++;
40726         des_int(n_code, code, 0);
40727         xmlResetLastError();
40728         if (mem_base != xmlMemBlocks()) {
40729             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
40730                    xmlMemBlocks() - mem_base);
40731             test_ret++;
40732             printf(" %d", n_code);
40733             printf("\n");
40734         }
40735     }
40736     function_tests++;
40737 #endif
40738
40739     return(test_ret);
40740 }
40741
40742
40743 static int
40744 test_xmlUCSIsCombiningMarksforSymbols(void) {
40745     int test_ret = 0;
40746
40747 #if defined(LIBXML_UNICODE_ENABLED)
40748     int mem_base;
40749     int ret_val;
40750     int code; /* UCS code point */
40751     int n_code;
40752
40753     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40754         mem_base = xmlMemBlocks();
40755         code = gen_int(n_code, 0);
40756
40757         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
40758         desret_int(ret_val);
40759         call_tests++;
40760         des_int(n_code, code, 0);
40761         xmlResetLastError();
40762         if (mem_base != xmlMemBlocks()) {
40763             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
40764                    xmlMemBlocks() - mem_base);
40765             test_ret++;
40766             printf(" %d", n_code);
40767             printf("\n");
40768         }
40769     }
40770     function_tests++;
40771 #endif
40772
40773     return(test_ret);
40774 }
40775
40776
40777 static int
40778 test_xmlUCSIsControlPictures(void) {
40779     int test_ret = 0;
40780
40781 #if defined(LIBXML_UNICODE_ENABLED)
40782     int mem_base;
40783     int ret_val;
40784     int code; /* UCS code point */
40785     int n_code;
40786
40787     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40788         mem_base = xmlMemBlocks();
40789         code = gen_int(n_code, 0);
40790
40791         ret_val = xmlUCSIsControlPictures(code);
40792         desret_int(ret_val);
40793         call_tests++;
40794         des_int(n_code, code, 0);
40795         xmlResetLastError();
40796         if (mem_base != xmlMemBlocks()) {
40797             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
40798                    xmlMemBlocks() - mem_base);
40799             test_ret++;
40800             printf(" %d", n_code);
40801             printf("\n");
40802         }
40803     }
40804     function_tests++;
40805 #endif
40806
40807     return(test_ret);
40808 }
40809
40810
40811 static int
40812 test_xmlUCSIsCurrencySymbols(void) {
40813     int test_ret = 0;
40814
40815 #if defined(LIBXML_UNICODE_ENABLED)
40816     int mem_base;
40817     int ret_val;
40818     int code; /* UCS code point */
40819     int n_code;
40820
40821     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40822         mem_base = xmlMemBlocks();
40823         code = gen_int(n_code, 0);
40824
40825         ret_val = xmlUCSIsCurrencySymbols(code);
40826         desret_int(ret_val);
40827         call_tests++;
40828         des_int(n_code, code, 0);
40829         xmlResetLastError();
40830         if (mem_base != xmlMemBlocks()) {
40831             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
40832                    xmlMemBlocks() - mem_base);
40833             test_ret++;
40834             printf(" %d", n_code);
40835             printf("\n");
40836         }
40837     }
40838     function_tests++;
40839 #endif
40840
40841     return(test_ret);
40842 }
40843
40844
40845 static int
40846 test_xmlUCSIsCypriotSyllabary(void) {
40847     int test_ret = 0;
40848
40849 #if defined(LIBXML_UNICODE_ENABLED)
40850     int mem_base;
40851     int ret_val;
40852     int code; /* UCS code point */
40853     int n_code;
40854
40855     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40856         mem_base = xmlMemBlocks();
40857         code = gen_int(n_code, 0);
40858
40859         ret_val = xmlUCSIsCypriotSyllabary(code);
40860         desret_int(ret_val);
40861         call_tests++;
40862         des_int(n_code, code, 0);
40863         xmlResetLastError();
40864         if (mem_base != xmlMemBlocks()) {
40865             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
40866                    xmlMemBlocks() - mem_base);
40867             test_ret++;
40868             printf(" %d", n_code);
40869             printf("\n");
40870         }
40871     }
40872     function_tests++;
40873 #endif
40874
40875     return(test_ret);
40876 }
40877
40878
40879 static int
40880 test_xmlUCSIsCyrillic(void) {
40881     int test_ret = 0;
40882
40883 #if defined(LIBXML_UNICODE_ENABLED)
40884     int mem_base;
40885     int ret_val;
40886     int code; /* UCS code point */
40887     int n_code;
40888
40889     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40890         mem_base = xmlMemBlocks();
40891         code = gen_int(n_code, 0);
40892
40893         ret_val = xmlUCSIsCyrillic(code);
40894         desret_int(ret_val);
40895         call_tests++;
40896         des_int(n_code, code, 0);
40897         xmlResetLastError();
40898         if (mem_base != xmlMemBlocks()) {
40899             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
40900                    xmlMemBlocks() - mem_base);
40901             test_ret++;
40902             printf(" %d", n_code);
40903             printf("\n");
40904         }
40905     }
40906     function_tests++;
40907 #endif
40908
40909     return(test_ret);
40910 }
40911
40912
40913 static int
40914 test_xmlUCSIsCyrillicSupplement(void) {
40915     int test_ret = 0;
40916
40917 #if defined(LIBXML_UNICODE_ENABLED)
40918     int mem_base;
40919     int ret_val;
40920     int code; /* UCS code point */
40921     int n_code;
40922
40923     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40924         mem_base = xmlMemBlocks();
40925         code = gen_int(n_code, 0);
40926
40927         ret_val = xmlUCSIsCyrillicSupplement(code);
40928         desret_int(ret_val);
40929         call_tests++;
40930         des_int(n_code, code, 0);
40931         xmlResetLastError();
40932         if (mem_base != xmlMemBlocks()) {
40933             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
40934                    xmlMemBlocks() - mem_base);
40935             test_ret++;
40936             printf(" %d", n_code);
40937             printf("\n");
40938         }
40939     }
40940     function_tests++;
40941 #endif
40942
40943     return(test_ret);
40944 }
40945
40946
40947 static int
40948 test_xmlUCSIsDeseret(void) {
40949     int test_ret = 0;
40950
40951 #if defined(LIBXML_UNICODE_ENABLED)
40952     int mem_base;
40953     int ret_val;
40954     int code; /* UCS code point */
40955     int n_code;
40956
40957     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40958         mem_base = xmlMemBlocks();
40959         code = gen_int(n_code, 0);
40960
40961         ret_val = xmlUCSIsDeseret(code);
40962         desret_int(ret_val);
40963         call_tests++;
40964         des_int(n_code, code, 0);
40965         xmlResetLastError();
40966         if (mem_base != xmlMemBlocks()) {
40967             printf("Leak of %d blocks found in xmlUCSIsDeseret",
40968                    xmlMemBlocks() - mem_base);
40969             test_ret++;
40970             printf(" %d", n_code);
40971             printf("\n");
40972         }
40973     }
40974     function_tests++;
40975 #endif
40976
40977     return(test_ret);
40978 }
40979
40980
40981 static int
40982 test_xmlUCSIsDevanagari(void) {
40983     int test_ret = 0;
40984
40985 #if defined(LIBXML_UNICODE_ENABLED)
40986     int mem_base;
40987     int ret_val;
40988     int code; /* UCS code point */
40989     int n_code;
40990
40991     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40992         mem_base = xmlMemBlocks();
40993         code = gen_int(n_code, 0);
40994
40995         ret_val = xmlUCSIsDevanagari(code);
40996         desret_int(ret_val);
40997         call_tests++;
40998         des_int(n_code, code, 0);
40999         xmlResetLastError();
41000         if (mem_base != xmlMemBlocks()) {
41001             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
41002                    xmlMemBlocks() - mem_base);
41003             test_ret++;
41004             printf(" %d", n_code);
41005             printf("\n");
41006         }
41007     }
41008     function_tests++;
41009 #endif
41010
41011     return(test_ret);
41012 }
41013
41014
41015 static int
41016 test_xmlUCSIsDingbats(void) {
41017     int test_ret = 0;
41018
41019 #if defined(LIBXML_UNICODE_ENABLED)
41020     int mem_base;
41021     int ret_val;
41022     int code; /* UCS code point */
41023     int n_code;
41024
41025     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41026         mem_base = xmlMemBlocks();
41027         code = gen_int(n_code, 0);
41028
41029         ret_val = xmlUCSIsDingbats(code);
41030         desret_int(ret_val);
41031         call_tests++;
41032         des_int(n_code, code, 0);
41033         xmlResetLastError();
41034         if (mem_base != xmlMemBlocks()) {
41035             printf("Leak of %d blocks found in xmlUCSIsDingbats",
41036                    xmlMemBlocks() - mem_base);
41037             test_ret++;
41038             printf(" %d", n_code);
41039             printf("\n");
41040         }
41041     }
41042     function_tests++;
41043 #endif
41044
41045     return(test_ret);
41046 }
41047
41048
41049 static int
41050 test_xmlUCSIsEnclosedAlphanumerics(void) {
41051     int test_ret = 0;
41052
41053 #if defined(LIBXML_UNICODE_ENABLED)
41054     int mem_base;
41055     int ret_val;
41056     int code; /* UCS code point */
41057     int n_code;
41058
41059     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41060         mem_base = xmlMemBlocks();
41061         code = gen_int(n_code, 0);
41062
41063         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
41064         desret_int(ret_val);
41065         call_tests++;
41066         des_int(n_code, code, 0);
41067         xmlResetLastError();
41068         if (mem_base != xmlMemBlocks()) {
41069             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
41070                    xmlMemBlocks() - mem_base);
41071             test_ret++;
41072             printf(" %d", n_code);
41073             printf("\n");
41074         }
41075     }
41076     function_tests++;
41077 #endif
41078
41079     return(test_ret);
41080 }
41081
41082
41083 static int
41084 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
41085     int test_ret = 0;
41086
41087 #if defined(LIBXML_UNICODE_ENABLED)
41088     int mem_base;
41089     int ret_val;
41090     int code; /* UCS code point */
41091     int n_code;
41092
41093     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41094         mem_base = xmlMemBlocks();
41095         code = gen_int(n_code, 0);
41096
41097         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
41098         desret_int(ret_val);
41099         call_tests++;
41100         des_int(n_code, code, 0);
41101         xmlResetLastError();
41102         if (mem_base != xmlMemBlocks()) {
41103             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
41104                    xmlMemBlocks() - mem_base);
41105             test_ret++;
41106             printf(" %d", n_code);
41107             printf("\n");
41108         }
41109     }
41110     function_tests++;
41111 #endif
41112
41113     return(test_ret);
41114 }
41115
41116
41117 static int
41118 test_xmlUCSIsEthiopic(void) {
41119     int test_ret = 0;
41120
41121 #if defined(LIBXML_UNICODE_ENABLED)
41122     int mem_base;
41123     int ret_val;
41124     int code; /* UCS code point */
41125     int n_code;
41126
41127     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41128         mem_base = xmlMemBlocks();
41129         code = gen_int(n_code, 0);
41130
41131         ret_val = xmlUCSIsEthiopic(code);
41132         desret_int(ret_val);
41133         call_tests++;
41134         des_int(n_code, code, 0);
41135         xmlResetLastError();
41136         if (mem_base != xmlMemBlocks()) {
41137             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
41138                    xmlMemBlocks() - mem_base);
41139             test_ret++;
41140             printf(" %d", n_code);
41141             printf("\n");
41142         }
41143     }
41144     function_tests++;
41145 #endif
41146
41147     return(test_ret);
41148 }
41149
41150
41151 static int
41152 test_xmlUCSIsGeneralPunctuation(void) {
41153     int test_ret = 0;
41154
41155 #if defined(LIBXML_UNICODE_ENABLED)
41156     int mem_base;
41157     int ret_val;
41158     int code; /* UCS code point */
41159     int n_code;
41160
41161     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41162         mem_base = xmlMemBlocks();
41163         code = gen_int(n_code, 0);
41164
41165         ret_val = xmlUCSIsGeneralPunctuation(code);
41166         desret_int(ret_val);
41167         call_tests++;
41168         des_int(n_code, code, 0);
41169         xmlResetLastError();
41170         if (mem_base != xmlMemBlocks()) {
41171             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
41172                    xmlMemBlocks() - mem_base);
41173             test_ret++;
41174             printf(" %d", n_code);
41175             printf("\n");
41176         }
41177     }
41178     function_tests++;
41179 #endif
41180
41181     return(test_ret);
41182 }
41183
41184
41185 static int
41186 test_xmlUCSIsGeometricShapes(void) {
41187     int test_ret = 0;
41188
41189 #if defined(LIBXML_UNICODE_ENABLED)
41190     int mem_base;
41191     int ret_val;
41192     int code; /* UCS code point */
41193     int n_code;
41194
41195     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41196         mem_base = xmlMemBlocks();
41197         code = gen_int(n_code, 0);
41198
41199         ret_val = xmlUCSIsGeometricShapes(code);
41200         desret_int(ret_val);
41201         call_tests++;
41202         des_int(n_code, code, 0);
41203         xmlResetLastError();
41204         if (mem_base != xmlMemBlocks()) {
41205             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
41206                    xmlMemBlocks() - mem_base);
41207             test_ret++;
41208             printf(" %d", n_code);
41209             printf("\n");
41210         }
41211     }
41212     function_tests++;
41213 #endif
41214
41215     return(test_ret);
41216 }
41217
41218
41219 static int
41220 test_xmlUCSIsGeorgian(void) {
41221     int test_ret = 0;
41222
41223 #if defined(LIBXML_UNICODE_ENABLED)
41224     int mem_base;
41225     int ret_val;
41226     int code; /* UCS code point */
41227     int n_code;
41228
41229     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41230         mem_base = xmlMemBlocks();
41231         code = gen_int(n_code, 0);
41232
41233         ret_val = xmlUCSIsGeorgian(code);
41234         desret_int(ret_val);
41235         call_tests++;
41236         des_int(n_code, code, 0);
41237         xmlResetLastError();
41238         if (mem_base != xmlMemBlocks()) {
41239             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
41240                    xmlMemBlocks() - mem_base);
41241             test_ret++;
41242             printf(" %d", n_code);
41243             printf("\n");
41244         }
41245     }
41246     function_tests++;
41247 #endif
41248
41249     return(test_ret);
41250 }
41251
41252
41253 static int
41254 test_xmlUCSIsGothic(void) {
41255     int test_ret = 0;
41256
41257 #if defined(LIBXML_UNICODE_ENABLED)
41258     int mem_base;
41259     int ret_val;
41260     int code; /* UCS code point */
41261     int n_code;
41262
41263     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41264         mem_base = xmlMemBlocks();
41265         code = gen_int(n_code, 0);
41266
41267         ret_val = xmlUCSIsGothic(code);
41268         desret_int(ret_val);
41269         call_tests++;
41270         des_int(n_code, code, 0);
41271         xmlResetLastError();
41272         if (mem_base != xmlMemBlocks()) {
41273             printf("Leak of %d blocks found in xmlUCSIsGothic",
41274                    xmlMemBlocks() - mem_base);
41275             test_ret++;
41276             printf(" %d", n_code);
41277             printf("\n");
41278         }
41279     }
41280     function_tests++;
41281 #endif
41282
41283     return(test_ret);
41284 }
41285
41286
41287 static int
41288 test_xmlUCSIsGreek(void) {
41289     int test_ret = 0;
41290
41291 #if defined(LIBXML_UNICODE_ENABLED)
41292     int mem_base;
41293     int ret_val;
41294     int code; /* UCS code point */
41295     int n_code;
41296
41297     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41298         mem_base = xmlMemBlocks();
41299         code = gen_int(n_code, 0);
41300
41301         ret_val = xmlUCSIsGreek(code);
41302         desret_int(ret_val);
41303         call_tests++;
41304         des_int(n_code, code, 0);
41305         xmlResetLastError();
41306         if (mem_base != xmlMemBlocks()) {
41307             printf("Leak of %d blocks found in xmlUCSIsGreek",
41308                    xmlMemBlocks() - mem_base);
41309             test_ret++;
41310             printf(" %d", n_code);
41311             printf("\n");
41312         }
41313     }
41314     function_tests++;
41315 #endif
41316
41317     return(test_ret);
41318 }
41319
41320
41321 static int
41322 test_xmlUCSIsGreekExtended(void) {
41323     int test_ret = 0;
41324
41325 #if defined(LIBXML_UNICODE_ENABLED)
41326     int mem_base;
41327     int ret_val;
41328     int code; /* UCS code point */
41329     int n_code;
41330
41331     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41332         mem_base = xmlMemBlocks();
41333         code = gen_int(n_code, 0);
41334
41335         ret_val = xmlUCSIsGreekExtended(code);
41336         desret_int(ret_val);
41337         call_tests++;
41338         des_int(n_code, code, 0);
41339         xmlResetLastError();
41340         if (mem_base != xmlMemBlocks()) {
41341             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
41342                    xmlMemBlocks() - mem_base);
41343             test_ret++;
41344             printf(" %d", n_code);
41345             printf("\n");
41346         }
41347     }
41348     function_tests++;
41349 #endif
41350
41351     return(test_ret);
41352 }
41353
41354
41355 static int
41356 test_xmlUCSIsGreekandCoptic(void) {
41357     int test_ret = 0;
41358
41359 #if defined(LIBXML_UNICODE_ENABLED)
41360     int mem_base;
41361     int ret_val;
41362     int code; /* UCS code point */
41363     int n_code;
41364
41365     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41366         mem_base = xmlMemBlocks();
41367         code = gen_int(n_code, 0);
41368
41369         ret_val = xmlUCSIsGreekandCoptic(code);
41370         desret_int(ret_val);
41371         call_tests++;
41372         des_int(n_code, code, 0);
41373         xmlResetLastError();
41374         if (mem_base != xmlMemBlocks()) {
41375             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
41376                    xmlMemBlocks() - mem_base);
41377             test_ret++;
41378             printf(" %d", n_code);
41379             printf("\n");
41380         }
41381     }
41382     function_tests++;
41383 #endif
41384
41385     return(test_ret);
41386 }
41387
41388
41389 static int
41390 test_xmlUCSIsGujarati(void) {
41391     int test_ret = 0;
41392
41393 #if defined(LIBXML_UNICODE_ENABLED)
41394     int mem_base;
41395     int ret_val;
41396     int code; /* UCS code point */
41397     int n_code;
41398
41399     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41400         mem_base = xmlMemBlocks();
41401         code = gen_int(n_code, 0);
41402
41403         ret_val = xmlUCSIsGujarati(code);
41404         desret_int(ret_val);
41405         call_tests++;
41406         des_int(n_code, code, 0);
41407         xmlResetLastError();
41408         if (mem_base != xmlMemBlocks()) {
41409             printf("Leak of %d blocks found in xmlUCSIsGujarati",
41410                    xmlMemBlocks() - mem_base);
41411             test_ret++;
41412             printf(" %d", n_code);
41413             printf("\n");
41414         }
41415     }
41416     function_tests++;
41417 #endif
41418
41419     return(test_ret);
41420 }
41421
41422
41423 static int
41424 test_xmlUCSIsGurmukhi(void) {
41425     int test_ret = 0;
41426
41427 #if defined(LIBXML_UNICODE_ENABLED)
41428     int mem_base;
41429     int ret_val;
41430     int code; /* UCS code point */
41431     int n_code;
41432
41433     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41434         mem_base = xmlMemBlocks();
41435         code = gen_int(n_code, 0);
41436
41437         ret_val = xmlUCSIsGurmukhi(code);
41438         desret_int(ret_val);
41439         call_tests++;
41440         des_int(n_code, code, 0);
41441         xmlResetLastError();
41442         if (mem_base != xmlMemBlocks()) {
41443             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
41444                    xmlMemBlocks() - mem_base);
41445             test_ret++;
41446             printf(" %d", n_code);
41447             printf("\n");
41448         }
41449     }
41450     function_tests++;
41451 #endif
41452
41453     return(test_ret);
41454 }
41455
41456
41457 static int
41458 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
41459     int test_ret = 0;
41460
41461 #if defined(LIBXML_UNICODE_ENABLED)
41462     int mem_base;
41463     int ret_val;
41464     int code; /* UCS code point */
41465     int n_code;
41466
41467     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41468         mem_base = xmlMemBlocks();
41469         code = gen_int(n_code, 0);
41470
41471         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
41472         desret_int(ret_val);
41473         call_tests++;
41474         des_int(n_code, code, 0);
41475         xmlResetLastError();
41476         if (mem_base != xmlMemBlocks()) {
41477             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
41478                    xmlMemBlocks() - mem_base);
41479             test_ret++;
41480             printf(" %d", n_code);
41481             printf("\n");
41482         }
41483     }
41484     function_tests++;
41485 #endif
41486
41487     return(test_ret);
41488 }
41489
41490
41491 static int
41492 test_xmlUCSIsHangulCompatibilityJamo(void) {
41493     int test_ret = 0;
41494
41495 #if defined(LIBXML_UNICODE_ENABLED)
41496     int mem_base;
41497     int ret_val;
41498     int code; /* UCS code point */
41499     int n_code;
41500
41501     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41502         mem_base = xmlMemBlocks();
41503         code = gen_int(n_code, 0);
41504
41505         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
41506         desret_int(ret_val);
41507         call_tests++;
41508         des_int(n_code, code, 0);
41509         xmlResetLastError();
41510         if (mem_base != xmlMemBlocks()) {
41511             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
41512                    xmlMemBlocks() - mem_base);
41513             test_ret++;
41514             printf(" %d", n_code);
41515             printf("\n");
41516         }
41517     }
41518     function_tests++;
41519 #endif
41520
41521     return(test_ret);
41522 }
41523
41524
41525 static int
41526 test_xmlUCSIsHangulJamo(void) {
41527     int test_ret = 0;
41528
41529 #if defined(LIBXML_UNICODE_ENABLED)
41530     int mem_base;
41531     int ret_val;
41532     int code; /* UCS code point */
41533     int n_code;
41534
41535     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41536         mem_base = xmlMemBlocks();
41537         code = gen_int(n_code, 0);
41538
41539         ret_val = xmlUCSIsHangulJamo(code);
41540         desret_int(ret_val);
41541         call_tests++;
41542         des_int(n_code, code, 0);
41543         xmlResetLastError();
41544         if (mem_base != xmlMemBlocks()) {
41545             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
41546                    xmlMemBlocks() - mem_base);
41547             test_ret++;
41548             printf(" %d", n_code);
41549             printf("\n");
41550         }
41551     }
41552     function_tests++;
41553 #endif
41554
41555     return(test_ret);
41556 }
41557
41558
41559 static int
41560 test_xmlUCSIsHangulSyllables(void) {
41561     int test_ret = 0;
41562
41563 #if defined(LIBXML_UNICODE_ENABLED)
41564     int mem_base;
41565     int ret_val;
41566     int code; /* UCS code point */
41567     int n_code;
41568
41569     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41570         mem_base = xmlMemBlocks();
41571         code = gen_int(n_code, 0);
41572
41573         ret_val = xmlUCSIsHangulSyllables(code);
41574         desret_int(ret_val);
41575         call_tests++;
41576         des_int(n_code, code, 0);
41577         xmlResetLastError();
41578         if (mem_base != xmlMemBlocks()) {
41579             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
41580                    xmlMemBlocks() - mem_base);
41581             test_ret++;
41582             printf(" %d", n_code);
41583             printf("\n");
41584         }
41585     }
41586     function_tests++;
41587 #endif
41588
41589     return(test_ret);
41590 }
41591
41592
41593 static int
41594 test_xmlUCSIsHanunoo(void) {
41595     int test_ret = 0;
41596
41597 #if defined(LIBXML_UNICODE_ENABLED)
41598     int mem_base;
41599     int ret_val;
41600     int code; /* UCS code point */
41601     int n_code;
41602
41603     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41604         mem_base = xmlMemBlocks();
41605         code = gen_int(n_code, 0);
41606
41607         ret_val = xmlUCSIsHanunoo(code);
41608         desret_int(ret_val);
41609         call_tests++;
41610         des_int(n_code, code, 0);
41611         xmlResetLastError();
41612         if (mem_base != xmlMemBlocks()) {
41613             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
41614                    xmlMemBlocks() - mem_base);
41615             test_ret++;
41616             printf(" %d", n_code);
41617             printf("\n");
41618         }
41619     }
41620     function_tests++;
41621 #endif
41622
41623     return(test_ret);
41624 }
41625
41626
41627 static int
41628 test_xmlUCSIsHebrew(void) {
41629     int test_ret = 0;
41630
41631 #if defined(LIBXML_UNICODE_ENABLED)
41632     int mem_base;
41633     int ret_val;
41634     int code; /* UCS code point */
41635     int n_code;
41636
41637     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41638         mem_base = xmlMemBlocks();
41639         code = gen_int(n_code, 0);
41640
41641         ret_val = xmlUCSIsHebrew(code);
41642         desret_int(ret_val);
41643         call_tests++;
41644         des_int(n_code, code, 0);
41645         xmlResetLastError();
41646         if (mem_base != xmlMemBlocks()) {
41647             printf("Leak of %d blocks found in xmlUCSIsHebrew",
41648                    xmlMemBlocks() - mem_base);
41649             test_ret++;
41650             printf(" %d", n_code);
41651             printf("\n");
41652         }
41653     }
41654     function_tests++;
41655 #endif
41656
41657     return(test_ret);
41658 }
41659
41660
41661 static int
41662 test_xmlUCSIsHighPrivateUseSurrogates(void) {
41663     int test_ret = 0;
41664
41665 #if defined(LIBXML_UNICODE_ENABLED)
41666     int mem_base;
41667     int ret_val;
41668     int code; /* UCS code point */
41669     int n_code;
41670
41671     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41672         mem_base = xmlMemBlocks();
41673         code = gen_int(n_code, 0);
41674
41675         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
41676         desret_int(ret_val);
41677         call_tests++;
41678         des_int(n_code, code, 0);
41679         xmlResetLastError();
41680         if (mem_base != xmlMemBlocks()) {
41681             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
41682                    xmlMemBlocks() - mem_base);
41683             test_ret++;
41684             printf(" %d", n_code);
41685             printf("\n");
41686         }
41687     }
41688     function_tests++;
41689 #endif
41690
41691     return(test_ret);
41692 }
41693
41694
41695 static int
41696 test_xmlUCSIsHighSurrogates(void) {
41697     int test_ret = 0;
41698
41699 #if defined(LIBXML_UNICODE_ENABLED)
41700     int mem_base;
41701     int ret_val;
41702     int code; /* UCS code point */
41703     int n_code;
41704
41705     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41706         mem_base = xmlMemBlocks();
41707         code = gen_int(n_code, 0);
41708
41709         ret_val = xmlUCSIsHighSurrogates(code);
41710         desret_int(ret_val);
41711         call_tests++;
41712         des_int(n_code, code, 0);
41713         xmlResetLastError();
41714         if (mem_base != xmlMemBlocks()) {
41715             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
41716                    xmlMemBlocks() - mem_base);
41717             test_ret++;
41718             printf(" %d", n_code);
41719             printf("\n");
41720         }
41721     }
41722     function_tests++;
41723 #endif
41724
41725     return(test_ret);
41726 }
41727
41728
41729 static int
41730 test_xmlUCSIsHiragana(void) {
41731     int test_ret = 0;
41732
41733 #if defined(LIBXML_UNICODE_ENABLED)
41734     int mem_base;
41735     int ret_val;
41736     int code; /* UCS code point */
41737     int n_code;
41738
41739     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41740         mem_base = xmlMemBlocks();
41741         code = gen_int(n_code, 0);
41742
41743         ret_val = xmlUCSIsHiragana(code);
41744         desret_int(ret_val);
41745         call_tests++;
41746         des_int(n_code, code, 0);
41747         xmlResetLastError();
41748         if (mem_base != xmlMemBlocks()) {
41749             printf("Leak of %d blocks found in xmlUCSIsHiragana",
41750                    xmlMemBlocks() - mem_base);
41751             test_ret++;
41752             printf(" %d", n_code);
41753             printf("\n");
41754         }
41755     }
41756     function_tests++;
41757 #endif
41758
41759     return(test_ret);
41760 }
41761
41762
41763 static int
41764 test_xmlUCSIsIPAExtensions(void) {
41765     int test_ret = 0;
41766
41767 #if defined(LIBXML_UNICODE_ENABLED)
41768     int mem_base;
41769     int ret_val;
41770     int code; /* UCS code point */
41771     int n_code;
41772
41773     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41774         mem_base = xmlMemBlocks();
41775         code = gen_int(n_code, 0);
41776
41777         ret_val = xmlUCSIsIPAExtensions(code);
41778         desret_int(ret_val);
41779         call_tests++;
41780         des_int(n_code, code, 0);
41781         xmlResetLastError();
41782         if (mem_base != xmlMemBlocks()) {
41783             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
41784                    xmlMemBlocks() - mem_base);
41785             test_ret++;
41786             printf(" %d", n_code);
41787             printf("\n");
41788         }
41789     }
41790     function_tests++;
41791 #endif
41792
41793     return(test_ret);
41794 }
41795
41796
41797 static int
41798 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
41799     int test_ret = 0;
41800
41801 #if defined(LIBXML_UNICODE_ENABLED)
41802     int mem_base;
41803     int ret_val;
41804     int code; /* UCS code point */
41805     int n_code;
41806
41807     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41808         mem_base = xmlMemBlocks();
41809         code = gen_int(n_code, 0);
41810
41811         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
41812         desret_int(ret_val);
41813         call_tests++;
41814         des_int(n_code, code, 0);
41815         xmlResetLastError();
41816         if (mem_base != xmlMemBlocks()) {
41817             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
41818                    xmlMemBlocks() - mem_base);
41819             test_ret++;
41820             printf(" %d", n_code);
41821             printf("\n");
41822         }
41823     }
41824     function_tests++;
41825 #endif
41826
41827     return(test_ret);
41828 }
41829
41830
41831 static int
41832 test_xmlUCSIsKanbun(void) {
41833     int test_ret = 0;
41834
41835 #if defined(LIBXML_UNICODE_ENABLED)
41836     int mem_base;
41837     int ret_val;
41838     int code; /* UCS code point */
41839     int n_code;
41840
41841     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41842         mem_base = xmlMemBlocks();
41843         code = gen_int(n_code, 0);
41844
41845         ret_val = xmlUCSIsKanbun(code);
41846         desret_int(ret_val);
41847         call_tests++;
41848         des_int(n_code, code, 0);
41849         xmlResetLastError();
41850         if (mem_base != xmlMemBlocks()) {
41851             printf("Leak of %d blocks found in xmlUCSIsKanbun",
41852                    xmlMemBlocks() - mem_base);
41853             test_ret++;
41854             printf(" %d", n_code);
41855             printf("\n");
41856         }
41857     }
41858     function_tests++;
41859 #endif
41860
41861     return(test_ret);
41862 }
41863
41864
41865 static int
41866 test_xmlUCSIsKangxiRadicals(void) {
41867     int test_ret = 0;
41868
41869 #if defined(LIBXML_UNICODE_ENABLED)
41870     int mem_base;
41871     int ret_val;
41872     int code; /* UCS code point */
41873     int n_code;
41874
41875     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41876         mem_base = xmlMemBlocks();
41877         code = gen_int(n_code, 0);
41878
41879         ret_val = xmlUCSIsKangxiRadicals(code);
41880         desret_int(ret_val);
41881         call_tests++;
41882         des_int(n_code, code, 0);
41883         xmlResetLastError();
41884         if (mem_base != xmlMemBlocks()) {
41885             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
41886                    xmlMemBlocks() - mem_base);
41887             test_ret++;
41888             printf(" %d", n_code);
41889             printf("\n");
41890         }
41891     }
41892     function_tests++;
41893 #endif
41894
41895     return(test_ret);
41896 }
41897
41898
41899 static int
41900 test_xmlUCSIsKannada(void) {
41901     int test_ret = 0;
41902
41903 #if defined(LIBXML_UNICODE_ENABLED)
41904     int mem_base;
41905     int ret_val;
41906     int code; /* UCS code point */
41907     int n_code;
41908
41909     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41910         mem_base = xmlMemBlocks();
41911         code = gen_int(n_code, 0);
41912
41913         ret_val = xmlUCSIsKannada(code);
41914         desret_int(ret_val);
41915         call_tests++;
41916         des_int(n_code, code, 0);
41917         xmlResetLastError();
41918         if (mem_base != xmlMemBlocks()) {
41919             printf("Leak of %d blocks found in xmlUCSIsKannada",
41920                    xmlMemBlocks() - mem_base);
41921             test_ret++;
41922             printf(" %d", n_code);
41923             printf("\n");
41924         }
41925     }
41926     function_tests++;
41927 #endif
41928
41929     return(test_ret);
41930 }
41931
41932
41933 static int
41934 test_xmlUCSIsKatakana(void) {
41935     int test_ret = 0;
41936
41937 #if defined(LIBXML_UNICODE_ENABLED)
41938     int mem_base;
41939     int ret_val;
41940     int code; /* UCS code point */
41941     int n_code;
41942
41943     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41944         mem_base = xmlMemBlocks();
41945         code = gen_int(n_code, 0);
41946
41947         ret_val = xmlUCSIsKatakana(code);
41948         desret_int(ret_val);
41949         call_tests++;
41950         des_int(n_code, code, 0);
41951         xmlResetLastError();
41952         if (mem_base != xmlMemBlocks()) {
41953             printf("Leak of %d blocks found in xmlUCSIsKatakana",
41954                    xmlMemBlocks() - mem_base);
41955             test_ret++;
41956             printf(" %d", n_code);
41957             printf("\n");
41958         }
41959     }
41960     function_tests++;
41961 #endif
41962
41963     return(test_ret);
41964 }
41965
41966
41967 static int
41968 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
41969     int test_ret = 0;
41970
41971 #if defined(LIBXML_UNICODE_ENABLED)
41972     int mem_base;
41973     int ret_val;
41974     int code; /* UCS code point */
41975     int n_code;
41976
41977     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41978         mem_base = xmlMemBlocks();
41979         code = gen_int(n_code, 0);
41980
41981         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
41982         desret_int(ret_val);
41983         call_tests++;
41984         des_int(n_code, code, 0);
41985         xmlResetLastError();
41986         if (mem_base != xmlMemBlocks()) {
41987             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
41988                    xmlMemBlocks() - mem_base);
41989             test_ret++;
41990             printf(" %d", n_code);
41991             printf("\n");
41992         }
41993     }
41994     function_tests++;
41995 #endif
41996
41997     return(test_ret);
41998 }
41999
42000
42001 static int
42002 test_xmlUCSIsKhmer(void) {
42003     int test_ret = 0;
42004
42005 #if defined(LIBXML_UNICODE_ENABLED)
42006     int mem_base;
42007     int ret_val;
42008     int code; /* UCS code point */
42009     int n_code;
42010
42011     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42012         mem_base = xmlMemBlocks();
42013         code = gen_int(n_code, 0);
42014
42015         ret_val = xmlUCSIsKhmer(code);
42016         desret_int(ret_val);
42017         call_tests++;
42018         des_int(n_code, code, 0);
42019         xmlResetLastError();
42020         if (mem_base != xmlMemBlocks()) {
42021             printf("Leak of %d blocks found in xmlUCSIsKhmer",
42022                    xmlMemBlocks() - mem_base);
42023             test_ret++;
42024             printf(" %d", n_code);
42025             printf("\n");
42026         }
42027     }
42028     function_tests++;
42029 #endif
42030
42031     return(test_ret);
42032 }
42033
42034
42035 static int
42036 test_xmlUCSIsKhmerSymbols(void) {
42037     int test_ret = 0;
42038
42039 #if defined(LIBXML_UNICODE_ENABLED)
42040     int mem_base;
42041     int ret_val;
42042     int code; /* UCS code point */
42043     int n_code;
42044
42045     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42046         mem_base = xmlMemBlocks();
42047         code = gen_int(n_code, 0);
42048
42049         ret_val = xmlUCSIsKhmerSymbols(code);
42050         desret_int(ret_val);
42051         call_tests++;
42052         des_int(n_code, code, 0);
42053         xmlResetLastError();
42054         if (mem_base != xmlMemBlocks()) {
42055             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
42056                    xmlMemBlocks() - mem_base);
42057             test_ret++;
42058             printf(" %d", n_code);
42059             printf("\n");
42060         }
42061     }
42062     function_tests++;
42063 #endif
42064
42065     return(test_ret);
42066 }
42067
42068
42069 static int
42070 test_xmlUCSIsLao(void) {
42071     int test_ret = 0;
42072
42073 #if defined(LIBXML_UNICODE_ENABLED)
42074     int mem_base;
42075     int ret_val;
42076     int code; /* UCS code point */
42077     int n_code;
42078
42079     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42080         mem_base = xmlMemBlocks();
42081         code = gen_int(n_code, 0);
42082
42083         ret_val = xmlUCSIsLao(code);
42084         desret_int(ret_val);
42085         call_tests++;
42086         des_int(n_code, code, 0);
42087         xmlResetLastError();
42088         if (mem_base != xmlMemBlocks()) {
42089             printf("Leak of %d blocks found in xmlUCSIsLao",
42090                    xmlMemBlocks() - mem_base);
42091             test_ret++;
42092             printf(" %d", n_code);
42093             printf("\n");
42094         }
42095     }
42096     function_tests++;
42097 #endif
42098
42099     return(test_ret);
42100 }
42101
42102
42103 static int
42104 test_xmlUCSIsLatin1Supplement(void) {
42105     int test_ret = 0;
42106
42107 #if defined(LIBXML_UNICODE_ENABLED)
42108     int mem_base;
42109     int ret_val;
42110     int code; /* UCS code point */
42111     int n_code;
42112
42113     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42114         mem_base = xmlMemBlocks();
42115         code = gen_int(n_code, 0);
42116
42117         ret_val = xmlUCSIsLatin1Supplement(code);
42118         desret_int(ret_val);
42119         call_tests++;
42120         des_int(n_code, code, 0);
42121         xmlResetLastError();
42122         if (mem_base != xmlMemBlocks()) {
42123             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
42124                    xmlMemBlocks() - mem_base);
42125             test_ret++;
42126             printf(" %d", n_code);
42127             printf("\n");
42128         }
42129     }
42130     function_tests++;
42131 #endif
42132
42133     return(test_ret);
42134 }
42135
42136
42137 static int
42138 test_xmlUCSIsLatinExtendedA(void) {
42139     int test_ret = 0;
42140
42141 #if defined(LIBXML_UNICODE_ENABLED)
42142     int mem_base;
42143     int ret_val;
42144     int code; /* UCS code point */
42145     int n_code;
42146
42147     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42148         mem_base = xmlMemBlocks();
42149         code = gen_int(n_code, 0);
42150
42151         ret_val = xmlUCSIsLatinExtendedA(code);
42152         desret_int(ret_val);
42153         call_tests++;
42154         des_int(n_code, code, 0);
42155         xmlResetLastError();
42156         if (mem_base != xmlMemBlocks()) {
42157             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
42158                    xmlMemBlocks() - mem_base);
42159             test_ret++;
42160             printf(" %d", n_code);
42161             printf("\n");
42162         }
42163     }
42164     function_tests++;
42165 #endif
42166
42167     return(test_ret);
42168 }
42169
42170
42171 static int
42172 test_xmlUCSIsLatinExtendedAdditional(void) {
42173     int test_ret = 0;
42174
42175 #if defined(LIBXML_UNICODE_ENABLED)
42176     int mem_base;
42177     int ret_val;
42178     int code; /* UCS code point */
42179     int n_code;
42180
42181     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42182         mem_base = xmlMemBlocks();
42183         code = gen_int(n_code, 0);
42184
42185         ret_val = xmlUCSIsLatinExtendedAdditional(code);
42186         desret_int(ret_val);
42187         call_tests++;
42188         des_int(n_code, code, 0);
42189         xmlResetLastError();
42190         if (mem_base != xmlMemBlocks()) {
42191             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
42192                    xmlMemBlocks() - mem_base);
42193             test_ret++;
42194             printf(" %d", n_code);
42195             printf("\n");
42196         }
42197     }
42198     function_tests++;
42199 #endif
42200
42201     return(test_ret);
42202 }
42203
42204
42205 static int
42206 test_xmlUCSIsLatinExtendedB(void) {
42207     int test_ret = 0;
42208
42209 #if defined(LIBXML_UNICODE_ENABLED)
42210     int mem_base;
42211     int ret_val;
42212     int code; /* UCS code point */
42213     int n_code;
42214
42215     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42216         mem_base = xmlMemBlocks();
42217         code = gen_int(n_code, 0);
42218
42219         ret_val = xmlUCSIsLatinExtendedB(code);
42220         desret_int(ret_val);
42221         call_tests++;
42222         des_int(n_code, code, 0);
42223         xmlResetLastError();
42224         if (mem_base != xmlMemBlocks()) {
42225             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
42226                    xmlMemBlocks() - mem_base);
42227             test_ret++;
42228             printf(" %d", n_code);
42229             printf("\n");
42230         }
42231     }
42232     function_tests++;
42233 #endif
42234
42235     return(test_ret);
42236 }
42237
42238
42239 static int
42240 test_xmlUCSIsLetterlikeSymbols(void) {
42241     int test_ret = 0;
42242
42243 #if defined(LIBXML_UNICODE_ENABLED)
42244     int mem_base;
42245     int ret_val;
42246     int code; /* UCS code point */
42247     int n_code;
42248
42249     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42250         mem_base = xmlMemBlocks();
42251         code = gen_int(n_code, 0);
42252
42253         ret_val = xmlUCSIsLetterlikeSymbols(code);
42254         desret_int(ret_val);
42255         call_tests++;
42256         des_int(n_code, code, 0);
42257         xmlResetLastError();
42258         if (mem_base != xmlMemBlocks()) {
42259             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
42260                    xmlMemBlocks() - mem_base);
42261             test_ret++;
42262             printf(" %d", n_code);
42263             printf("\n");
42264         }
42265     }
42266     function_tests++;
42267 #endif
42268
42269     return(test_ret);
42270 }
42271
42272
42273 static int
42274 test_xmlUCSIsLimbu(void) {
42275     int test_ret = 0;
42276
42277 #if defined(LIBXML_UNICODE_ENABLED)
42278     int mem_base;
42279     int ret_val;
42280     int code; /* UCS code point */
42281     int n_code;
42282
42283     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42284         mem_base = xmlMemBlocks();
42285         code = gen_int(n_code, 0);
42286
42287         ret_val = xmlUCSIsLimbu(code);
42288         desret_int(ret_val);
42289         call_tests++;
42290         des_int(n_code, code, 0);
42291         xmlResetLastError();
42292         if (mem_base != xmlMemBlocks()) {
42293             printf("Leak of %d blocks found in xmlUCSIsLimbu",
42294                    xmlMemBlocks() - mem_base);
42295             test_ret++;
42296             printf(" %d", n_code);
42297             printf("\n");
42298         }
42299     }
42300     function_tests++;
42301 #endif
42302
42303     return(test_ret);
42304 }
42305
42306
42307 static int
42308 test_xmlUCSIsLinearBIdeograms(void) {
42309     int test_ret = 0;
42310
42311 #if defined(LIBXML_UNICODE_ENABLED)
42312     int mem_base;
42313     int ret_val;
42314     int code; /* UCS code point */
42315     int n_code;
42316
42317     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42318         mem_base = xmlMemBlocks();
42319         code = gen_int(n_code, 0);
42320
42321         ret_val = xmlUCSIsLinearBIdeograms(code);
42322         desret_int(ret_val);
42323         call_tests++;
42324         des_int(n_code, code, 0);
42325         xmlResetLastError();
42326         if (mem_base != xmlMemBlocks()) {
42327             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
42328                    xmlMemBlocks() - mem_base);
42329             test_ret++;
42330             printf(" %d", n_code);
42331             printf("\n");
42332         }
42333     }
42334     function_tests++;
42335 #endif
42336
42337     return(test_ret);
42338 }
42339
42340
42341 static int
42342 test_xmlUCSIsLinearBSyllabary(void) {
42343     int test_ret = 0;
42344
42345 #if defined(LIBXML_UNICODE_ENABLED)
42346     int mem_base;
42347     int ret_val;
42348     int code; /* UCS code point */
42349     int n_code;
42350
42351     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42352         mem_base = xmlMemBlocks();
42353         code = gen_int(n_code, 0);
42354
42355         ret_val = xmlUCSIsLinearBSyllabary(code);
42356         desret_int(ret_val);
42357         call_tests++;
42358         des_int(n_code, code, 0);
42359         xmlResetLastError();
42360         if (mem_base != xmlMemBlocks()) {
42361             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
42362                    xmlMemBlocks() - mem_base);
42363             test_ret++;
42364             printf(" %d", n_code);
42365             printf("\n");
42366         }
42367     }
42368     function_tests++;
42369 #endif
42370
42371     return(test_ret);
42372 }
42373
42374
42375 static int
42376 test_xmlUCSIsLowSurrogates(void) {
42377     int test_ret = 0;
42378
42379 #if defined(LIBXML_UNICODE_ENABLED)
42380     int mem_base;
42381     int ret_val;
42382     int code; /* UCS code point */
42383     int n_code;
42384
42385     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42386         mem_base = xmlMemBlocks();
42387         code = gen_int(n_code, 0);
42388
42389         ret_val = xmlUCSIsLowSurrogates(code);
42390         desret_int(ret_val);
42391         call_tests++;
42392         des_int(n_code, code, 0);
42393         xmlResetLastError();
42394         if (mem_base != xmlMemBlocks()) {
42395             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
42396                    xmlMemBlocks() - mem_base);
42397             test_ret++;
42398             printf(" %d", n_code);
42399             printf("\n");
42400         }
42401     }
42402     function_tests++;
42403 #endif
42404
42405     return(test_ret);
42406 }
42407
42408
42409 static int
42410 test_xmlUCSIsMalayalam(void) {
42411     int test_ret = 0;
42412
42413 #if defined(LIBXML_UNICODE_ENABLED)
42414     int mem_base;
42415     int ret_val;
42416     int code; /* UCS code point */
42417     int n_code;
42418
42419     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42420         mem_base = xmlMemBlocks();
42421         code = gen_int(n_code, 0);
42422
42423         ret_val = xmlUCSIsMalayalam(code);
42424         desret_int(ret_val);
42425         call_tests++;
42426         des_int(n_code, code, 0);
42427         xmlResetLastError();
42428         if (mem_base != xmlMemBlocks()) {
42429             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
42430                    xmlMemBlocks() - mem_base);
42431             test_ret++;
42432             printf(" %d", n_code);
42433             printf("\n");
42434         }
42435     }
42436     function_tests++;
42437 #endif
42438
42439     return(test_ret);
42440 }
42441
42442
42443 static int
42444 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
42445     int test_ret = 0;
42446
42447 #if defined(LIBXML_UNICODE_ENABLED)
42448     int mem_base;
42449     int ret_val;
42450     int code; /* UCS code point */
42451     int n_code;
42452
42453     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42454         mem_base = xmlMemBlocks();
42455         code = gen_int(n_code, 0);
42456
42457         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
42458         desret_int(ret_val);
42459         call_tests++;
42460         des_int(n_code, code, 0);
42461         xmlResetLastError();
42462         if (mem_base != xmlMemBlocks()) {
42463             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
42464                    xmlMemBlocks() - mem_base);
42465             test_ret++;
42466             printf(" %d", n_code);
42467             printf("\n");
42468         }
42469     }
42470     function_tests++;
42471 #endif
42472
42473     return(test_ret);
42474 }
42475
42476
42477 static int
42478 test_xmlUCSIsMathematicalOperators(void) {
42479     int test_ret = 0;
42480
42481 #if defined(LIBXML_UNICODE_ENABLED)
42482     int mem_base;
42483     int ret_val;
42484     int code; /* UCS code point */
42485     int n_code;
42486
42487     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42488         mem_base = xmlMemBlocks();
42489         code = gen_int(n_code, 0);
42490
42491         ret_val = xmlUCSIsMathematicalOperators(code);
42492         desret_int(ret_val);
42493         call_tests++;
42494         des_int(n_code, code, 0);
42495         xmlResetLastError();
42496         if (mem_base != xmlMemBlocks()) {
42497             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
42498                    xmlMemBlocks() - mem_base);
42499             test_ret++;
42500             printf(" %d", n_code);
42501             printf("\n");
42502         }
42503     }
42504     function_tests++;
42505 #endif
42506
42507     return(test_ret);
42508 }
42509
42510
42511 static int
42512 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
42513     int test_ret = 0;
42514
42515 #if defined(LIBXML_UNICODE_ENABLED)
42516     int mem_base;
42517     int ret_val;
42518     int code; /* UCS code point */
42519     int n_code;
42520
42521     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42522         mem_base = xmlMemBlocks();
42523         code = gen_int(n_code, 0);
42524
42525         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
42526         desret_int(ret_val);
42527         call_tests++;
42528         des_int(n_code, code, 0);
42529         xmlResetLastError();
42530         if (mem_base != xmlMemBlocks()) {
42531             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
42532                    xmlMemBlocks() - mem_base);
42533             test_ret++;
42534             printf(" %d", n_code);
42535             printf("\n");
42536         }
42537     }
42538     function_tests++;
42539 #endif
42540
42541     return(test_ret);
42542 }
42543
42544
42545 static int
42546 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
42547     int test_ret = 0;
42548
42549 #if defined(LIBXML_UNICODE_ENABLED)
42550     int mem_base;
42551     int ret_val;
42552     int code; /* UCS code point */
42553     int n_code;
42554
42555     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42556         mem_base = xmlMemBlocks();
42557         code = gen_int(n_code, 0);
42558
42559         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
42560         desret_int(ret_val);
42561         call_tests++;
42562         des_int(n_code, code, 0);
42563         xmlResetLastError();
42564         if (mem_base != xmlMemBlocks()) {
42565             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
42566                    xmlMemBlocks() - mem_base);
42567             test_ret++;
42568             printf(" %d", n_code);
42569             printf("\n");
42570         }
42571     }
42572     function_tests++;
42573 #endif
42574
42575     return(test_ret);
42576 }
42577
42578
42579 static int
42580 test_xmlUCSIsMiscellaneousSymbols(void) {
42581     int test_ret = 0;
42582
42583 #if defined(LIBXML_UNICODE_ENABLED)
42584     int mem_base;
42585     int ret_val;
42586     int code; /* UCS code point */
42587     int n_code;
42588
42589     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42590         mem_base = xmlMemBlocks();
42591         code = gen_int(n_code, 0);
42592
42593         ret_val = xmlUCSIsMiscellaneousSymbols(code);
42594         desret_int(ret_val);
42595         call_tests++;
42596         des_int(n_code, code, 0);
42597         xmlResetLastError();
42598         if (mem_base != xmlMemBlocks()) {
42599             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
42600                    xmlMemBlocks() - mem_base);
42601             test_ret++;
42602             printf(" %d", n_code);
42603             printf("\n");
42604         }
42605     }
42606     function_tests++;
42607 #endif
42608
42609     return(test_ret);
42610 }
42611
42612
42613 static int
42614 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
42615     int test_ret = 0;
42616
42617 #if defined(LIBXML_UNICODE_ENABLED)
42618     int mem_base;
42619     int ret_val;
42620     int code; /* UCS code point */
42621     int n_code;
42622
42623     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42624         mem_base = xmlMemBlocks();
42625         code = gen_int(n_code, 0);
42626
42627         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
42628         desret_int(ret_val);
42629         call_tests++;
42630         des_int(n_code, code, 0);
42631         xmlResetLastError();
42632         if (mem_base != xmlMemBlocks()) {
42633             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
42634                    xmlMemBlocks() - mem_base);
42635             test_ret++;
42636             printf(" %d", n_code);
42637             printf("\n");
42638         }
42639     }
42640     function_tests++;
42641 #endif
42642
42643     return(test_ret);
42644 }
42645
42646
42647 static int
42648 test_xmlUCSIsMiscellaneousTechnical(void) {
42649     int test_ret = 0;
42650
42651 #if defined(LIBXML_UNICODE_ENABLED)
42652     int mem_base;
42653     int ret_val;
42654     int code; /* UCS code point */
42655     int n_code;
42656
42657     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42658         mem_base = xmlMemBlocks();
42659         code = gen_int(n_code, 0);
42660
42661         ret_val = xmlUCSIsMiscellaneousTechnical(code);
42662         desret_int(ret_val);
42663         call_tests++;
42664         des_int(n_code, code, 0);
42665         xmlResetLastError();
42666         if (mem_base != xmlMemBlocks()) {
42667             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
42668                    xmlMemBlocks() - mem_base);
42669             test_ret++;
42670             printf(" %d", n_code);
42671             printf("\n");
42672         }
42673     }
42674     function_tests++;
42675 #endif
42676
42677     return(test_ret);
42678 }
42679
42680
42681 static int
42682 test_xmlUCSIsMongolian(void) {
42683     int test_ret = 0;
42684
42685 #if defined(LIBXML_UNICODE_ENABLED)
42686     int mem_base;
42687     int ret_val;
42688     int code; /* UCS code point */
42689     int n_code;
42690
42691     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42692         mem_base = xmlMemBlocks();
42693         code = gen_int(n_code, 0);
42694
42695         ret_val = xmlUCSIsMongolian(code);
42696         desret_int(ret_val);
42697         call_tests++;
42698         des_int(n_code, code, 0);
42699         xmlResetLastError();
42700         if (mem_base != xmlMemBlocks()) {
42701             printf("Leak of %d blocks found in xmlUCSIsMongolian",
42702                    xmlMemBlocks() - mem_base);
42703             test_ret++;
42704             printf(" %d", n_code);
42705             printf("\n");
42706         }
42707     }
42708     function_tests++;
42709 #endif
42710
42711     return(test_ret);
42712 }
42713
42714
42715 static int
42716 test_xmlUCSIsMusicalSymbols(void) {
42717     int test_ret = 0;
42718
42719 #if defined(LIBXML_UNICODE_ENABLED)
42720     int mem_base;
42721     int ret_val;
42722     int code; /* UCS code point */
42723     int n_code;
42724
42725     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42726         mem_base = xmlMemBlocks();
42727         code = gen_int(n_code, 0);
42728
42729         ret_val = xmlUCSIsMusicalSymbols(code);
42730         desret_int(ret_val);
42731         call_tests++;
42732         des_int(n_code, code, 0);
42733         xmlResetLastError();
42734         if (mem_base != xmlMemBlocks()) {
42735             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
42736                    xmlMemBlocks() - mem_base);
42737             test_ret++;
42738             printf(" %d", n_code);
42739             printf("\n");
42740         }
42741     }
42742     function_tests++;
42743 #endif
42744
42745     return(test_ret);
42746 }
42747
42748
42749 static int
42750 test_xmlUCSIsMyanmar(void) {
42751     int test_ret = 0;
42752
42753 #if defined(LIBXML_UNICODE_ENABLED)
42754     int mem_base;
42755     int ret_val;
42756     int code; /* UCS code point */
42757     int n_code;
42758
42759     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42760         mem_base = xmlMemBlocks();
42761         code = gen_int(n_code, 0);
42762
42763         ret_val = xmlUCSIsMyanmar(code);
42764         desret_int(ret_val);
42765         call_tests++;
42766         des_int(n_code, code, 0);
42767         xmlResetLastError();
42768         if (mem_base != xmlMemBlocks()) {
42769             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
42770                    xmlMemBlocks() - mem_base);
42771             test_ret++;
42772             printf(" %d", n_code);
42773             printf("\n");
42774         }
42775     }
42776     function_tests++;
42777 #endif
42778
42779     return(test_ret);
42780 }
42781
42782
42783 static int
42784 test_xmlUCSIsNumberForms(void) {
42785     int test_ret = 0;
42786
42787 #if defined(LIBXML_UNICODE_ENABLED)
42788     int mem_base;
42789     int ret_val;
42790     int code; /* UCS code point */
42791     int n_code;
42792
42793     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42794         mem_base = xmlMemBlocks();
42795         code = gen_int(n_code, 0);
42796
42797         ret_val = xmlUCSIsNumberForms(code);
42798         desret_int(ret_val);
42799         call_tests++;
42800         des_int(n_code, code, 0);
42801         xmlResetLastError();
42802         if (mem_base != xmlMemBlocks()) {
42803             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
42804                    xmlMemBlocks() - mem_base);
42805             test_ret++;
42806             printf(" %d", n_code);
42807             printf("\n");
42808         }
42809     }
42810     function_tests++;
42811 #endif
42812
42813     return(test_ret);
42814 }
42815
42816
42817 static int
42818 test_xmlUCSIsOgham(void) {
42819     int test_ret = 0;
42820
42821 #if defined(LIBXML_UNICODE_ENABLED)
42822     int mem_base;
42823     int ret_val;
42824     int code; /* UCS code point */
42825     int n_code;
42826
42827     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42828         mem_base = xmlMemBlocks();
42829         code = gen_int(n_code, 0);
42830
42831         ret_val = xmlUCSIsOgham(code);
42832         desret_int(ret_val);
42833         call_tests++;
42834         des_int(n_code, code, 0);
42835         xmlResetLastError();
42836         if (mem_base != xmlMemBlocks()) {
42837             printf("Leak of %d blocks found in xmlUCSIsOgham",
42838                    xmlMemBlocks() - mem_base);
42839             test_ret++;
42840             printf(" %d", n_code);
42841             printf("\n");
42842         }
42843     }
42844     function_tests++;
42845 #endif
42846
42847     return(test_ret);
42848 }
42849
42850
42851 static int
42852 test_xmlUCSIsOldItalic(void) {
42853     int test_ret = 0;
42854
42855 #if defined(LIBXML_UNICODE_ENABLED)
42856     int mem_base;
42857     int ret_val;
42858     int code; /* UCS code point */
42859     int n_code;
42860
42861     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42862         mem_base = xmlMemBlocks();
42863         code = gen_int(n_code, 0);
42864
42865         ret_val = xmlUCSIsOldItalic(code);
42866         desret_int(ret_val);
42867         call_tests++;
42868         des_int(n_code, code, 0);
42869         xmlResetLastError();
42870         if (mem_base != xmlMemBlocks()) {
42871             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
42872                    xmlMemBlocks() - mem_base);
42873             test_ret++;
42874             printf(" %d", n_code);
42875             printf("\n");
42876         }
42877     }
42878     function_tests++;
42879 #endif
42880
42881     return(test_ret);
42882 }
42883
42884
42885 static int
42886 test_xmlUCSIsOpticalCharacterRecognition(void) {
42887     int test_ret = 0;
42888
42889 #if defined(LIBXML_UNICODE_ENABLED)
42890     int mem_base;
42891     int ret_val;
42892     int code; /* UCS code point */
42893     int n_code;
42894
42895     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42896         mem_base = xmlMemBlocks();
42897         code = gen_int(n_code, 0);
42898
42899         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
42900         desret_int(ret_val);
42901         call_tests++;
42902         des_int(n_code, code, 0);
42903         xmlResetLastError();
42904         if (mem_base != xmlMemBlocks()) {
42905             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
42906                    xmlMemBlocks() - mem_base);
42907             test_ret++;
42908             printf(" %d", n_code);
42909             printf("\n");
42910         }
42911     }
42912     function_tests++;
42913 #endif
42914
42915     return(test_ret);
42916 }
42917
42918
42919 static int
42920 test_xmlUCSIsOriya(void) {
42921     int test_ret = 0;
42922
42923 #if defined(LIBXML_UNICODE_ENABLED)
42924     int mem_base;
42925     int ret_val;
42926     int code; /* UCS code point */
42927     int n_code;
42928
42929     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42930         mem_base = xmlMemBlocks();
42931         code = gen_int(n_code, 0);
42932
42933         ret_val = xmlUCSIsOriya(code);
42934         desret_int(ret_val);
42935         call_tests++;
42936         des_int(n_code, code, 0);
42937         xmlResetLastError();
42938         if (mem_base != xmlMemBlocks()) {
42939             printf("Leak of %d blocks found in xmlUCSIsOriya",
42940                    xmlMemBlocks() - mem_base);
42941             test_ret++;
42942             printf(" %d", n_code);
42943             printf("\n");
42944         }
42945     }
42946     function_tests++;
42947 #endif
42948
42949     return(test_ret);
42950 }
42951
42952
42953 static int
42954 test_xmlUCSIsOsmanya(void) {
42955     int test_ret = 0;
42956
42957 #if defined(LIBXML_UNICODE_ENABLED)
42958     int mem_base;
42959     int ret_val;
42960     int code; /* UCS code point */
42961     int n_code;
42962
42963     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42964         mem_base = xmlMemBlocks();
42965         code = gen_int(n_code, 0);
42966
42967         ret_val = xmlUCSIsOsmanya(code);
42968         desret_int(ret_val);
42969         call_tests++;
42970         des_int(n_code, code, 0);
42971         xmlResetLastError();
42972         if (mem_base != xmlMemBlocks()) {
42973             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
42974                    xmlMemBlocks() - mem_base);
42975             test_ret++;
42976             printf(" %d", n_code);
42977             printf("\n");
42978         }
42979     }
42980     function_tests++;
42981 #endif
42982
42983     return(test_ret);
42984 }
42985
42986
42987 static int
42988 test_xmlUCSIsPhoneticExtensions(void) {
42989     int test_ret = 0;
42990
42991 #if defined(LIBXML_UNICODE_ENABLED)
42992     int mem_base;
42993     int ret_val;
42994     int code; /* UCS code point */
42995     int n_code;
42996
42997     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42998         mem_base = xmlMemBlocks();
42999         code = gen_int(n_code, 0);
43000
43001         ret_val = xmlUCSIsPhoneticExtensions(code);
43002         desret_int(ret_val);
43003         call_tests++;
43004         des_int(n_code, code, 0);
43005         xmlResetLastError();
43006         if (mem_base != xmlMemBlocks()) {
43007             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
43008                    xmlMemBlocks() - mem_base);
43009             test_ret++;
43010             printf(" %d", n_code);
43011             printf("\n");
43012         }
43013     }
43014     function_tests++;
43015 #endif
43016
43017     return(test_ret);
43018 }
43019
43020
43021 static int
43022 test_xmlUCSIsPrivateUse(void) {
43023     int test_ret = 0;
43024
43025 #if defined(LIBXML_UNICODE_ENABLED)
43026     int mem_base;
43027     int ret_val;
43028     int code; /* UCS code point */
43029     int n_code;
43030
43031     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43032         mem_base = xmlMemBlocks();
43033         code = gen_int(n_code, 0);
43034
43035         ret_val = xmlUCSIsPrivateUse(code);
43036         desret_int(ret_val);
43037         call_tests++;
43038         des_int(n_code, code, 0);
43039         xmlResetLastError();
43040         if (mem_base != xmlMemBlocks()) {
43041             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
43042                    xmlMemBlocks() - mem_base);
43043             test_ret++;
43044             printf(" %d", n_code);
43045             printf("\n");
43046         }
43047     }
43048     function_tests++;
43049 #endif
43050
43051     return(test_ret);
43052 }
43053
43054
43055 static int
43056 test_xmlUCSIsPrivateUseArea(void) {
43057     int test_ret = 0;
43058
43059 #if defined(LIBXML_UNICODE_ENABLED)
43060     int mem_base;
43061     int ret_val;
43062     int code; /* UCS code point */
43063     int n_code;
43064
43065     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43066         mem_base = xmlMemBlocks();
43067         code = gen_int(n_code, 0);
43068
43069         ret_val = xmlUCSIsPrivateUseArea(code);
43070         desret_int(ret_val);
43071         call_tests++;
43072         des_int(n_code, code, 0);
43073         xmlResetLastError();
43074         if (mem_base != xmlMemBlocks()) {
43075             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
43076                    xmlMemBlocks() - mem_base);
43077             test_ret++;
43078             printf(" %d", n_code);
43079             printf("\n");
43080         }
43081     }
43082     function_tests++;
43083 #endif
43084
43085     return(test_ret);
43086 }
43087
43088
43089 static int
43090 test_xmlUCSIsRunic(void) {
43091     int test_ret = 0;
43092
43093 #if defined(LIBXML_UNICODE_ENABLED)
43094     int mem_base;
43095     int ret_val;
43096     int code; /* UCS code point */
43097     int n_code;
43098
43099     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43100         mem_base = xmlMemBlocks();
43101         code = gen_int(n_code, 0);
43102
43103         ret_val = xmlUCSIsRunic(code);
43104         desret_int(ret_val);
43105         call_tests++;
43106         des_int(n_code, code, 0);
43107         xmlResetLastError();
43108         if (mem_base != xmlMemBlocks()) {
43109             printf("Leak of %d blocks found in xmlUCSIsRunic",
43110                    xmlMemBlocks() - mem_base);
43111             test_ret++;
43112             printf(" %d", n_code);
43113             printf("\n");
43114         }
43115     }
43116     function_tests++;
43117 #endif
43118
43119     return(test_ret);
43120 }
43121
43122
43123 static int
43124 test_xmlUCSIsShavian(void) {
43125     int test_ret = 0;
43126
43127 #if defined(LIBXML_UNICODE_ENABLED)
43128     int mem_base;
43129     int ret_val;
43130     int code; /* UCS code point */
43131     int n_code;
43132
43133     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43134         mem_base = xmlMemBlocks();
43135         code = gen_int(n_code, 0);
43136
43137         ret_val = xmlUCSIsShavian(code);
43138         desret_int(ret_val);
43139         call_tests++;
43140         des_int(n_code, code, 0);
43141         xmlResetLastError();
43142         if (mem_base != xmlMemBlocks()) {
43143             printf("Leak of %d blocks found in xmlUCSIsShavian",
43144                    xmlMemBlocks() - mem_base);
43145             test_ret++;
43146             printf(" %d", n_code);
43147             printf("\n");
43148         }
43149     }
43150     function_tests++;
43151 #endif
43152
43153     return(test_ret);
43154 }
43155
43156
43157 static int
43158 test_xmlUCSIsSinhala(void) {
43159     int test_ret = 0;
43160
43161 #if defined(LIBXML_UNICODE_ENABLED)
43162     int mem_base;
43163     int ret_val;
43164     int code; /* UCS code point */
43165     int n_code;
43166
43167     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43168         mem_base = xmlMemBlocks();
43169         code = gen_int(n_code, 0);
43170
43171         ret_val = xmlUCSIsSinhala(code);
43172         desret_int(ret_val);
43173         call_tests++;
43174         des_int(n_code, code, 0);
43175         xmlResetLastError();
43176         if (mem_base != xmlMemBlocks()) {
43177             printf("Leak of %d blocks found in xmlUCSIsSinhala",
43178                    xmlMemBlocks() - mem_base);
43179             test_ret++;
43180             printf(" %d", n_code);
43181             printf("\n");
43182         }
43183     }
43184     function_tests++;
43185 #endif
43186
43187     return(test_ret);
43188 }
43189
43190
43191 static int
43192 test_xmlUCSIsSmallFormVariants(void) {
43193     int test_ret = 0;
43194
43195 #if defined(LIBXML_UNICODE_ENABLED)
43196     int mem_base;
43197     int ret_val;
43198     int code; /* UCS code point */
43199     int n_code;
43200
43201     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43202         mem_base = xmlMemBlocks();
43203         code = gen_int(n_code, 0);
43204
43205         ret_val = xmlUCSIsSmallFormVariants(code);
43206         desret_int(ret_val);
43207         call_tests++;
43208         des_int(n_code, code, 0);
43209         xmlResetLastError();
43210         if (mem_base != xmlMemBlocks()) {
43211             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
43212                    xmlMemBlocks() - mem_base);
43213             test_ret++;
43214             printf(" %d", n_code);
43215             printf("\n");
43216         }
43217     }
43218     function_tests++;
43219 #endif
43220
43221     return(test_ret);
43222 }
43223
43224
43225 static int
43226 test_xmlUCSIsSpacingModifierLetters(void) {
43227     int test_ret = 0;
43228
43229 #if defined(LIBXML_UNICODE_ENABLED)
43230     int mem_base;
43231     int ret_val;
43232     int code; /* UCS code point */
43233     int n_code;
43234
43235     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43236         mem_base = xmlMemBlocks();
43237         code = gen_int(n_code, 0);
43238
43239         ret_val = xmlUCSIsSpacingModifierLetters(code);
43240         desret_int(ret_val);
43241         call_tests++;
43242         des_int(n_code, code, 0);
43243         xmlResetLastError();
43244         if (mem_base != xmlMemBlocks()) {
43245             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
43246                    xmlMemBlocks() - mem_base);
43247             test_ret++;
43248             printf(" %d", n_code);
43249             printf("\n");
43250         }
43251     }
43252     function_tests++;
43253 #endif
43254
43255     return(test_ret);
43256 }
43257
43258
43259 static int
43260 test_xmlUCSIsSpecials(void) {
43261     int test_ret = 0;
43262
43263 #if defined(LIBXML_UNICODE_ENABLED)
43264     int mem_base;
43265     int ret_val;
43266     int code; /* UCS code point */
43267     int n_code;
43268
43269     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43270         mem_base = xmlMemBlocks();
43271         code = gen_int(n_code, 0);
43272
43273         ret_val = xmlUCSIsSpecials(code);
43274         desret_int(ret_val);
43275         call_tests++;
43276         des_int(n_code, code, 0);
43277         xmlResetLastError();
43278         if (mem_base != xmlMemBlocks()) {
43279             printf("Leak of %d blocks found in xmlUCSIsSpecials",
43280                    xmlMemBlocks() - mem_base);
43281             test_ret++;
43282             printf(" %d", n_code);
43283             printf("\n");
43284         }
43285     }
43286     function_tests++;
43287 #endif
43288
43289     return(test_ret);
43290 }
43291
43292
43293 static int
43294 test_xmlUCSIsSuperscriptsandSubscripts(void) {
43295     int test_ret = 0;
43296
43297 #if defined(LIBXML_UNICODE_ENABLED)
43298     int mem_base;
43299     int ret_val;
43300     int code; /* UCS code point */
43301     int n_code;
43302
43303     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43304         mem_base = xmlMemBlocks();
43305         code = gen_int(n_code, 0);
43306
43307         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
43308         desret_int(ret_val);
43309         call_tests++;
43310         des_int(n_code, code, 0);
43311         xmlResetLastError();
43312         if (mem_base != xmlMemBlocks()) {
43313             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
43314                    xmlMemBlocks() - mem_base);
43315             test_ret++;
43316             printf(" %d", n_code);
43317             printf("\n");
43318         }
43319     }
43320     function_tests++;
43321 #endif
43322
43323     return(test_ret);
43324 }
43325
43326
43327 static int
43328 test_xmlUCSIsSupplementalArrowsA(void) {
43329     int test_ret = 0;
43330
43331 #if defined(LIBXML_UNICODE_ENABLED)
43332     int mem_base;
43333     int ret_val;
43334     int code; /* UCS code point */
43335     int n_code;
43336
43337     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43338         mem_base = xmlMemBlocks();
43339         code = gen_int(n_code, 0);
43340
43341         ret_val = xmlUCSIsSupplementalArrowsA(code);
43342         desret_int(ret_val);
43343         call_tests++;
43344         des_int(n_code, code, 0);
43345         xmlResetLastError();
43346         if (mem_base != xmlMemBlocks()) {
43347             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
43348                    xmlMemBlocks() - mem_base);
43349             test_ret++;
43350             printf(" %d", n_code);
43351             printf("\n");
43352         }
43353     }
43354     function_tests++;
43355 #endif
43356
43357     return(test_ret);
43358 }
43359
43360
43361 static int
43362 test_xmlUCSIsSupplementalArrowsB(void) {
43363     int test_ret = 0;
43364
43365 #if defined(LIBXML_UNICODE_ENABLED)
43366     int mem_base;
43367     int ret_val;
43368     int code; /* UCS code point */
43369     int n_code;
43370
43371     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43372         mem_base = xmlMemBlocks();
43373         code = gen_int(n_code, 0);
43374
43375         ret_val = xmlUCSIsSupplementalArrowsB(code);
43376         desret_int(ret_val);
43377         call_tests++;
43378         des_int(n_code, code, 0);
43379         xmlResetLastError();
43380         if (mem_base != xmlMemBlocks()) {
43381             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
43382                    xmlMemBlocks() - mem_base);
43383             test_ret++;
43384             printf(" %d", n_code);
43385             printf("\n");
43386         }
43387     }
43388     function_tests++;
43389 #endif
43390
43391     return(test_ret);
43392 }
43393
43394
43395 static int
43396 test_xmlUCSIsSupplementalMathematicalOperators(void) {
43397     int test_ret = 0;
43398
43399 #if defined(LIBXML_UNICODE_ENABLED)
43400     int mem_base;
43401     int ret_val;
43402     int code; /* UCS code point */
43403     int n_code;
43404
43405     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43406         mem_base = xmlMemBlocks();
43407         code = gen_int(n_code, 0);
43408
43409         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
43410         desret_int(ret_val);
43411         call_tests++;
43412         des_int(n_code, code, 0);
43413         xmlResetLastError();
43414         if (mem_base != xmlMemBlocks()) {
43415             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
43416                    xmlMemBlocks() - mem_base);
43417             test_ret++;
43418             printf(" %d", n_code);
43419             printf("\n");
43420         }
43421     }
43422     function_tests++;
43423 #endif
43424
43425     return(test_ret);
43426 }
43427
43428
43429 static int
43430 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
43431     int test_ret = 0;
43432
43433 #if defined(LIBXML_UNICODE_ENABLED)
43434     int mem_base;
43435     int ret_val;
43436     int code; /* UCS code point */
43437     int n_code;
43438
43439     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43440         mem_base = xmlMemBlocks();
43441         code = gen_int(n_code, 0);
43442
43443         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
43444         desret_int(ret_val);
43445         call_tests++;
43446         des_int(n_code, code, 0);
43447         xmlResetLastError();
43448         if (mem_base != xmlMemBlocks()) {
43449             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
43450                    xmlMemBlocks() - mem_base);
43451             test_ret++;
43452             printf(" %d", n_code);
43453             printf("\n");
43454         }
43455     }
43456     function_tests++;
43457 #endif
43458
43459     return(test_ret);
43460 }
43461
43462
43463 static int
43464 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
43465     int test_ret = 0;
43466
43467 #if defined(LIBXML_UNICODE_ENABLED)
43468     int mem_base;
43469     int ret_val;
43470     int code; /* UCS code point */
43471     int n_code;
43472
43473     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43474         mem_base = xmlMemBlocks();
43475         code = gen_int(n_code, 0);
43476
43477         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
43478         desret_int(ret_val);
43479         call_tests++;
43480         des_int(n_code, code, 0);
43481         xmlResetLastError();
43482         if (mem_base != xmlMemBlocks()) {
43483             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
43484                    xmlMemBlocks() - mem_base);
43485             test_ret++;
43486             printf(" %d", n_code);
43487             printf("\n");
43488         }
43489     }
43490     function_tests++;
43491 #endif
43492
43493     return(test_ret);
43494 }
43495
43496
43497 static int
43498 test_xmlUCSIsSyriac(void) {
43499     int test_ret = 0;
43500
43501 #if defined(LIBXML_UNICODE_ENABLED)
43502     int mem_base;
43503     int ret_val;
43504     int code; /* UCS code point */
43505     int n_code;
43506
43507     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43508         mem_base = xmlMemBlocks();
43509         code = gen_int(n_code, 0);
43510
43511         ret_val = xmlUCSIsSyriac(code);
43512         desret_int(ret_val);
43513         call_tests++;
43514         des_int(n_code, code, 0);
43515         xmlResetLastError();
43516         if (mem_base != xmlMemBlocks()) {
43517             printf("Leak of %d blocks found in xmlUCSIsSyriac",
43518                    xmlMemBlocks() - mem_base);
43519             test_ret++;
43520             printf(" %d", n_code);
43521             printf("\n");
43522         }
43523     }
43524     function_tests++;
43525 #endif
43526
43527     return(test_ret);
43528 }
43529
43530
43531 static int
43532 test_xmlUCSIsTagalog(void) {
43533     int test_ret = 0;
43534
43535 #if defined(LIBXML_UNICODE_ENABLED)
43536     int mem_base;
43537     int ret_val;
43538     int code; /* UCS code point */
43539     int n_code;
43540
43541     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43542         mem_base = xmlMemBlocks();
43543         code = gen_int(n_code, 0);
43544
43545         ret_val = xmlUCSIsTagalog(code);
43546         desret_int(ret_val);
43547         call_tests++;
43548         des_int(n_code, code, 0);
43549         xmlResetLastError();
43550         if (mem_base != xmlMemBlocks()) {
43551             printf("Leak of %d blocks found in xmlUCSIsTagalog",
43552                    xmlMemBlocks() - mem_base);
43553             test_ret++;
43554             printf(" %d", n_code);
43555             printf("\n");
43556         }
43557     }
43558     function_tests++;
43559 #endif
43560
43561     return(test_ret);
43562 }
43563
43564
43565 static int
43566 test_xmlUCSIsTagbanwa(void) {
43567     int test_ret = 0;
43568
43569 #if defined(LIBXML_UNICODE_ENABLED)
43570     int mem_base;
43571     int ret_val;
43572     int code; /* UCS code point */
43573     int n_code;
43574
43575     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43576         mem_base = xmlMemBlocks();
43577         code = gen_int(n_code, 0);
43578
43579         ret_val = xmlUCSIsTagbanwa(code);
43580         desret_int(ret_val);
43581         call_tests++;
43582         des_int(n_code, code, 0);
43583         xmlResetLastError();
43584         if (mem_base != xmlMemBlocks()) {
43585             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
43586                    xmlMemBlocks() - mem_base);
43587             test_ret++;
43588             printf(" %d", n_code);
43589             printf("\n");
43590         }
43591     }
43592     function_tests++;
43593 #endif
43594
43595     return(test_ret);
43596 }
43597
43598
43599 static int
43600 test_xmlUCSIsTags(void) {
43601     int test_ret = 0;
43602
43603 #if defined(LIBXML_UNICODE_ENABLED)
43604     int mem_base;
43605     int ret_val;
43606     int code; /* UCS code point */
43607     int n_code;
43608
43609     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43610         mem_base = xmlMemBlocks();
43611         code = gen_int(n_code, 0);
43612
43613         ret_val = xmlUCSIsTags(code);
43614         desret_int(ret_val);
43615         call_tests++;
43616         des_int(n_code, code, 0);
43617         xmlResetLastError();
43618         if (mem_base != xmlMemBlocks()) {
43619             printf("Leak of %d blocks found in xmlUCSIsTags",
43620                    xmlMemBlocks() - mem_base);
43621             test_ret++;
43622             printf(" %d", n_code);
43623             printf("\n");
43624         }
43625     }
43626     function_tests++;
43627 #endif
43628
43629     return(test_ret);
43630 }
43631
43632
43633 static int
43634 test_xmlUCSIsTaiLe(void) {
43635     int test_ret = 0;
43636
43637 #if defined(LIBXML_UNICODE_ENABLED)
43638     int mem_base;
43639     int ret_val;
43640     int code; /* UCS code point */
43641     int n_code;
43642
43643     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43644         mem_base = xmlMemBlocks();
43645         code = gen_int(n_code, 0);
43646
43647         ret_val = xmlUCSIsTaiLe(code);
43648         desret_int(ret_val);
43649         call_tests++;
43650         des_int(n_code, code, 0);
43651         xmlResetLastError();
43652         if (mem_base != xmlMemBlocks()) {
43653             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
43654                    xmlMemBlocks() - mem_base);
43655             test_ret++;
43656             printf(" %d", n_code);
43657             printf("\n");
43658         }
43659     }
43660     function_tests++;
43661 #endif
43662
43663     return(test_ret);
43664 }
43665
43666
43667 static int
43668 test_xmlUCSIsTaiXuanJingSymbols(void) {
43669     int test_ret = 0;
43670
43671 #if defined(LIBXML_UNICODE_ENABLED)
43672     int mem_base;
43673     int ret_val;
43674     int code; /* UCS code point */
43675     int n_code;
43676
43677     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43678         mem_base = xmlMemBlocks();
43679         code = gen_int(n_code, 0);
43680
43681         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
43682         desret_int(ret_val);
43683         call_tests++;
43684         des_int(n_code, code, 0);
43685         xmlResetLastError();
43686         if (mem_base != xmlMemBlocks()) {
43687             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
43688                    xmlMemBlocks() - mem_base);
43689             test_ret++;
43690             printf(" %d", n_code);
43691             printf("\n");
43692         }
43693     }
43694     function_tests++;
43695 #endif
43696
43697     return(test_ret);
43698 }
43699
43700
43701 static int
43702 test_xmlUCSIsTamil(void) {
43703     int test_ret = 0;
43704
43705 #if defined(LIBXML_UNICODE_ENABLED)
43706     int mem_base;
43707     int ret_val;
43708     int code; /* UCS code point */
43709     int n_code;
43710
43711     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43712         mem_base = xmlMemBlocks();
43713         code = gen_int(n_code, 0);
43714
43715         ret_val = xmlUCSIsTamil(code);
43716         desret_int(ret_val);
43717         call_tests++;
43718         des_int(n_code, code, 0);
43719         xmlResetLastError();
43720         if (mem_base != xmlMemBlocks()) {
43721             printf("Leak of %d blocks found in xmlUCSIsTamil",
43722                    xmlMemBlocks() - mem_base);
43723             test_ret++;
43724             printf(" %d", n_code);
43725             printf("\n");
43726         }
43727     }
43728     function_tests++;
43729 #endif
43730
43731     return(test_ret);
43732 }
43733
43734
43735 static int
43736 test_xmlUCSIsTelugu(void) {
43737     int test_ret = 0;
43738
43739 #if defined(LIBXML_UNICODE_ENABLED)
43740     int mem_base;
43741     int ret_val;
43742     int code; /* UCS code point */
43743     int n_code;
43744
43745     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43746         mem_base = xmlMemBlocks();
43747         code = gen_int(n_code, 0);
43748
43749         ret_val = xmlUCSIsTelugu(code);
43750         desret_int(ret_val);
43751         call_tests++;
43752         des_int(n_code, code, 0);
43753         xmlResetLastError();
43754         if (mem_base != xmlMemBlocks()) {
43755             printf("Leak of %d blocks found in xmlUCSIsTelugu",
43756                    xmlMemBlocks() - mem_base);
43757             test_ret++;
43758             printf(" %d", n_code);
43759             printf("\n");
43760         }
43761     }
43762     function_tests++;
43763 #endif
43764
43765     return(test_ret);
43766 }
43767
43768
43769 static int
43770 test_xmlUCSIsThaana(void) {
43771     int test_ret = 0;
43772
43773 #if defined(LIBXML_UNICODE_ENABLED)
43774     int mem_base;
43775     int ret_val;
43776     int code; /* UCS code point */
43777     int n_code;
43778
43779     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43780         mem_base = xmlMemBlocks();
43781         code = gen_int(n_code, 0);
43782
43783         ret_val = xmlUCSIsThaana(code);
43784         desret_int(ret_val);
43785         call_tests++;
43786         des_int(n_code, code, 0);
43787         xmlResetLastError();
43788         if (mem_base != xmlMemBlocks()) {
43789             printf("Leak of %d blocks found in xmlUCSIsThaana",
43790                    xmlMemBlocks() - mem_base);
43791             test_ret++;
43792             printf(" %d", n_code);
43793             printf("\n");
43794         }
43795     }
43796     function_tests++;
43797 #endif
43798
43799     return(test_ret);
43800 }
43801
43802
43803 static int
43804 test_xmlUCSIsThai(void) {
43805     int test_ret = 0;
43806
43807 #if defined(LIBXML_UNICODE_ENABLED)
43808     int mem_base;
43809     int ret_val;
43810     int code; /* UCS code point */
43811     int n_code;
43812
43813     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43814         mem_base = xmlMemBlocks();
43815         code = gen_int(n_code, 0);
43816
43817         ret_val = xmlUCSIsThai(code);
43818         desret_int(ret_val);
43819         call_tests++;
43820         des_int(n_code, code, 0);
43821         xmlResetLastError();
43822         if (mem_base != xmlMemBlocks()) {
43823             printf("Leak of %d blocks found in xmlUCSIsThai",
43824                    xmlMemBlocks() - mem_base);
43825             test_ret++;
43826             printf(" %d", n_code);
43827             printf("\n");
43828         }
43829     }
43830     function_tests++;
43831 #endif
43832
43833     return(test_ret);
43834 }
43835
43836
43837 static int
43838 test_xmlUCSIsTibetan(void) {
43839     int test_ret = 0;
43840
43841 #if defined(LIBXML_UNICODE_ENABLED)
43842     int mem_base;
43843     int ret_val;
43844     int code; /* UCS code point */
43845     int n_code;
43846
43847     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43848         mem_base = xmlMemBlocks();
43849         code = gen_int(n_code, 0);
43850
43851         ret_val = xmlUCSIsTibetan(code);
43852         desret_int(ret_val);
43853         call_tests++;
43854         des_int(n_code, code, 0);
43855         xmlResetLastError();
43856         if (mem_base != xmlMemBlocks()) {
43857             printf("Leak of %d blocks found in xmlUCSIsTibetan",
43858                    xmlMemBlocks() - mem_base);
43859             test_ret++;
43860             printf(" %d", n_code);
43861             printf("\n");
43862         }
43863     }
43864     function_tests++;
43865 #endif
43866
43867     return(test_ret);
43868 }
43869
43870
43871 static int
43872 test_xmlUCSIsUgaritic(void) {
43873     int test_ret = 0;
43874
43875 #if defined(LIBXML_UNICODE_ENABLED)
43876     int mem_base;
43877     int ret_val;
43878     int code; /* UCS code point */
43879     int n_code;
43880
43881     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43882         mem_base = xmlMemBlocks();
43883         code = gen_int(n_code, 0);
43884
43885         ret_val = xmlUCSIsUgaritic(code);
43886         desret_int(ret_val);
43887         call_tests++;
43888         des_int(n_code, code, 0);
43889         xmlResetLastError();
43890         if (mem_base != xmlMemBlocks()) {
43891             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
43892                    xmlMemBlocks() - mem_base);
43893             test_ret++;
43894             printf(" %d", n_code);
43895             printf("\n");
43896         }
43897     }
43898     function_tests++;
43899 #endif
43900
43901     return(test_ret);
43902 }
43903
43904
43905 static int
43906 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
43907     int test_ret = 0;
43908
43909 #if defined(LIBXML_UNICODE_ENABLED)
43910     int mem_base;
43911     int ret_val;
43912     int code; /* UCS code point */
43913     int n_code;
43914
43915     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43916         mem_base = xmlMemBlocks();
43917         code = gen_int(n_code, 0);
43918
43919         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
43920         desret_int(ret_val);
43921         call_tests++;
43922         des_int(n_code, code, 0);
43923         xmlResetLastError();
43924         if (mem_base != xmlMemBlocks()) {
43925             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
43926                    xmlMemBlocks() - mem_base);
43927             test_ret++;
43928             printf(" %d", n_code);
43929             printf("\n");
43930         }
43931     }
43932     function_tests++;
43933 #endif
43934
43935     return(test_ret);
43936 }
43937
43938
43939 static int
43940 test_xmlUCSIsVariationSelectors(void) {
43941     int test_ret = 0;
43942
43943 #if defined(LIBXML_UNICODE_ENABLED)
43944     int mem_base;
43945     int ret_val;
43946     int code; /* UCS code point */
43947     int n_code;
43948
43949     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43950         mem_base = xmlMemBlocks();
43951         code = gen_int(n_code, 0);
43952
43953         ret_val = xmlUCSIsVariationSelectors(code);
43954         desret_int(ret_val);
43955         call_tests++;
43956         des_int(n_code, code, 0);
43957         xmlResetLastError();
43958         if (mem_base != xmlMemBlocks()) {
43959             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
43960                    xmlMemBlocks() - mem_base);
43961             test_ret++;
43962             printf(" %d", n_code);
43963             printf("\n");
43964         }
43965     }
43966     function_tests++;
43967 #endif
43968
43969     return(test_ret);
43970 }
43971
43972
43973 static int
43974 test_xmlUCSIsVariationSelectorsSupplement(void) {
43975     int test_ret = 0;
43976
43977 #if defined(LIBXML_UNICODE_ENABLED)
43978     int mem_base;
43979     int ret_val;
43980     int code; /* UCS code point */
43981     int n_code;
43982
43983     for (n_code = 0;n_code < gen_nb_int;n_code++) {
43984         mem_base = xmlMemBlocks();
43985         code = gen_int(n_code, 0);
43986
43987         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
43988         desret_int(ret_val);
43989         call_tests++;
43990         des_int(n_code, code, 0);
43991         xmlResetLastError();
43992         if (mem_base != xmlMemBlocks()) {
43993             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
43994                    xmlMemBlocks() - mem_base);
43995             test_ret++;
43996             printf(" %d", n_code);
43997             printf("\n");
43998         }
43999     }
44000     function_tests++;
44001 #endif
44002
44003     return(test_ret);
44004 }
44005
44006
44007 static int
44008 test_xmlUCSIsYiRadicals(void) {
44009     int test_ret = 0;
44010
44011 #if defined(LIBXML_UNICODE_ENABLED)
44012     int mem_base;
44013     int ret_val;
44014     int code; /* UCS code point */
44015     int n_code;
44016
44017     for (n_code = 0;n_code < gen_nb_int;n_code++) {
44018         mem_base = xmlMemBlocks();
44019         code = gen_int(n_code, 0);
44020
44021         ret_val = xmlUCSIsYiRadicals(code);
44022         desret_int(ret_val);
44023         call_tests++;
44024         des_int(n_code, code, 0);
44025         xmlResetLastError();
44026         if (mem_base != xmlMemBlocks()) {
44027             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
44028                    xmlMemBlocks() - mem_base);
44029             test_ret++;
44030             printf(" %d", n_code);
44031             printf("\n");
44032         }
44033     }
44034     function_tests++;
44035 #endif
44036
44037     return(test_ret);
44038 }
44039
44040
44041 static int
44042 test_xmlUCSIsYiSyllables(void) {
44043     int test_ret = 0;
44044
44045 #if defined(LIBXML_UNICODE_ENABLED)
44046     int mem_base;
44047     int ret_val;
44048     int code; /* UCS code point */
44049     int n_code;
44050
44051     for (n_code = 0;n_code < gen_nb_int;n_code++) {
44052         mem_base = xmlMemBlocks();
44053         code = gen_int(n_code, 0);
44054
44055         ret_val = xmlUCSIsYiSyllables(code);
44056         desret_int(ret_val);
44057         call_tests++;
44058         des_int(n_code, code, 0);
44059         xmlResetLastError();
44060         if (mem_base != xmlMemBlocks()) {
44061             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
44062                    xmlMemBlocks() - mem_base);
44063             test_ret++;
44064             printf(" %d", n_code);
44065             printf("\n");
44066         }
44067     }
44068     function_tests++;
44069 #endif
44070
44071     return(test_ret);
44072 }
44073
44074
44075 static int
44076 test_xmlUCSIsYijingHexagramSymbols(void) {
44077     int test_ret = 0;
44078
44079 #if defined(LIBXML_UNICODE_ENABLED)
44080     int mem_base;
44081     int ret_val;
44082     int code; /* UCS code point */
44083     int n_code;
44084
44085     for (n_code = 0;n_code < gen_nb_int;n_code++) {
44086         mem_base = xmlMemBlocks();
44087         code = gen_int(n_code, 0);
44088
44089         ret_val = xmlUCSIsYijingHexagramSymbols(code);
44090         desret_int(ret_val);
44091         call_tests++;
44092         des_int(n_code, code, 0);
44093         xmlResetLastError();
44094         if (mem_base != xmlMemBlocks()) {
44095             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
44096                    xmlMemBlocks() - mem_base);
44097             test_ret++;
44098             printf(" %d", n_code);
44099             printf("\n");
44100         }
44101     }
44102     function_tests++;
44103 #endif
44104
44105     return(test_ret);
44106 }
44107
44108 static int
44109 test_xmlunicode(void) {
44110     int test_ret = 0;
44111         int rc = 0;
44112
44113     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
44114     rc = test_xmlUCSIsAegeanNumbers();
44115         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44116     rc = test_xmlUCSIsAlphabeticPresentationForms();
44117         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44118     rc = test_xmlUCSIsArabic();
44119         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44120     rc = test_xmlUCSIsArabicPresentationFormsA();
44121         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44122     rc = test_xmlUCSIsArabicPresentationFormsB();
44123         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44124     rc = test_xmlUCSIsArmenian();
44125         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44126     rc = test_xmlUCSIsArrows();
44127         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44128     rc = test_xmlUCSIsBasicLatin();
44129         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44130     rc = test_xmlUCSIsBengali();
44131         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44132     rc = test_xmlUCSIsBlock();
44133         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44134     rc = test_xmlUCSIsBlockElements();
44135         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44136     rc = test_xmlUCSIsBopomofo();
44137         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44138     rc = test_xmlUCSIsBopomofoExtended();
44139         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44140     rc = test_xmlUCSIsBoxDrawing();
44141         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44142     rc = test_xmlUCSIsBraillePatterns();
44143         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44144     rc = test_xmlUCSIsBuhid();
44145         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44146     rc = test_xmlUCSIsByzantineMusicalSymbols();
44147         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44148     rc = test_xmlUCSIsCJKCompatibility();
44149         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44150     rc = test_xmlUCSIsCJKCompatibilityForms();
44151         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44152     rc = test_xmlUCSIsCJKCompatibilityIdeographs();
44153         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44154     rc = test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
44155         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44156     rc = test_xmlUCSIsCJKRadicalsSupplement();
44157         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44158     rc = test_xmlUCSIsCJKSymbolsandPunctuation();
44159         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44160     rc = test_xmlUCSIsCJKUnifiedIdeographs();
44161         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44162     rc = test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
44163         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44164     rc = test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
44165         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44166     rc = test_xmlUCSIsCat();
44167         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44168     rc = test_xmlUCSIsCatC();
44169         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44170     rc = test_xmlUCSIsCatCc();
44171         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44172     rc = test_xmlUCSIsCatCf();
44173         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44174     rc = test_xmlUCSIsCatCo();
44175         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44176     rc = test_xmlUCSIsCatCs();
44177         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44178     rc = test_xmlUCSIsCatL();
44179         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44180     rc = test_xmlUCSIsCatLl();
44181         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44182     rc = test_xmlUCSIsCatLm();
44183         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44184     rc = test_xmlUCSIsCatLo();
44185         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44186     rc = test_xmlUCSIsCatLt();
44187         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44188     rc = test_xmlUCSIsCatLu();
44189         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44190     rc = test_xmlUCSIsCatM();
44191         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44192     rc = test_xmlUCSIsCatMc();
44193         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44194     rc = test_xmlUCSIsCatMe();
44195         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44196     rc = test_xmlUCSIsCatMn();
44197         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44198     rc = test_xmlUCSIsCatN();
44199         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44200     rc = test_xmlUCSIsCatNd();
44201         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44202     rc = test_xmlUCSIsCatNl();
44203         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44204     rc = test_xmlUCSIsCatNo();
44205         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44206     rc = test_xmlUCSIsCatP();
44207         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44208     rc = test_xmlUCSIsCatPc();
44209         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44210     rc = test_xmlUCSIsCatPd();
44211         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44212     rc = test_xmlUCSIsCatPe();
44213         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44214     rc = test_xmlUCSIsCatPf();
44215         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44216     rc = test_xmlUCSIsCatPi();
44217         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44218     rc = test_xmlUCSIsCatPo();
44219         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44220     rc = test_xmlUCSIsCatPs();
44221         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44222     rc = test_xmlUCSIsCatS();
44223         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44224     rc = test_xmlUCSIsCatSc();
44225         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44226     rc = test_xmlUCSIsCatSk();
44227         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44228     rc = test_xmlUCSIsCatSm();
44229         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44230     rc = test_xmlUCSIsCatSo();
44231         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44232     rc = test_xmlUCSIsCatZ();
44233         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44234     rc = test_xmlUCSIsCatZl();
44235         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44236     rc = test_xmlUCSIsCatZp();
44237         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44238     rc = test_xmlUCSIsCatZs();
44239         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44240     rc = test_xmlUCSIsCherokee();
44241         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44242     rc = test_xmlUCSIsCombiningDiacriticalMarks();
44243         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44244     rc = test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
44245         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44246     rc = test_xmlUCSIsCombiningHalfMarks();
44247         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44248     rc = test_xmlUCSIsCombiningMarksforSymbols();
44249         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44250     rc = test_xmlUCSIsControlPictures();
44251         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44252     rc = test_xmlUCSIsCurrencySymbols();
44253         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44254     rc = test_xmlUCSIsCypriotSyllabary();
44255         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44256     rc = test_xmlUCSIsCyrillic();
44257         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44258     rc = test_xmlUCSIsCyrillicSupplement();
44259         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44260     rc = test_xmlUCSIsDeseret();
44261         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44262     rc = test_xmlUCSIsDevanagari();
44263         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44264     rc = test_xmlUCSIsDingbats();
44265         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44266     rc = test_xmlUCSIsEnclosedAlphanumerics();
44267         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44268     rc = test_xmlUCSIsEnclosedCJKLettersandMonths();
44269         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44270     rc = test_xmlUCSIsEthiopic();
44271         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44272     rc = test_xmlUCSIsGeneralPunctuation();
44273         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44274     rc = test_xmlUCSIsGeometricShapes();
44275         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44276     rc = test_xmlUCSIsGeorgian();
44277         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44278     rc = test_xmlUCSIsGothic();
44279         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44280     rc = test_xmlUCSIsGreek();
44281         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44282     rc = test_xmlUCSIsGreekExtended();
44283         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44284     rc = test_xmlUCSIsGreekandCoptic();
44285         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44286     rc = test_xmlUCSIsGujarati();
44287         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44288     rc = test_xmlUCSIsGurmukhi();
44289         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44290     rc = test_xmlUCSIsHalfwidthandFullwidthForms();
44291         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44292     rc = test_xmlUCSIsHangulCompatibilityJamo();
44293         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44294     rc = test_xmlUCSIsHangulJamo();
44295         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44296     rc = test_xmlUCSIsHangulSyllables();
44297         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44298     rc = test_xmlUCSIsHanunoo();
44299         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44300     rc = test_xmlUCSIsHebrew();
44301         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44302     rc = test_xmlUCSIsHighPrivateUseSurrogates();
44303         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44304     rc = test_xmlUCSIsHighSurrogates();
44305         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44306     rc = test_xmlUCSIsHiragana();
44307         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44308     rc = test_xmlUCSIsIPAExtensions();
44309         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44310     rc = test_xmlUCSIsIdeographicDescriptionCharacters();
44311         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44312     rc = test_xmlUCSIsKanbun();
44313         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44314     rc = test_xmlUCSIsKangxiRadicals();
44315         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44316     rc = test_xmlUCSIsKannada();
44317         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44318     rc = test_xmlUCSIsKatakana();
44319         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44320     rc = test_xmlUCSIsKatakanaPhoneticExtensions();
44321         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44322     rc = test_xmlUCSIsKhmer();
44323         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44324     rc = test_xmlUCSIsKhmerSymbols();
44325         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44326     rc = test_xmlUCSIsLao();
44327         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44328     rc = test_xmlUCSIsLatin1Supplement();
44329         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44330     rc = test_xmlUCSIsLatinExtendedA();
44331         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44332     rc = test_xmlUCSIsLatinExtendedAdditional();
44333         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44334     rc = test_xmlUCSIsLatinExtendedB();
44335         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44336     rc = test_xmlUCSIsLetterlikeSymbols();
44337         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44338     rc = test_xmlUCSIsLimbu();
44339         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44340     rc = test_xmlUCSIsLinearBIdeograms();
44341         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44342     rc = test_xmlUCSIsLinearBSyllabary();
44343         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44344     rc = test_xmlUCSIsLowSurrogates();
44345         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44346     rc = test_xmlUCSIsMalayalam();
44347         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44348     rc = test_xmlUCSIsMathematicalAlphanumericSymbols();
44349         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44350     rc = test_xmlUCSIsMathematicalOperators();
44351         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44352     rc = test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
44353         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44354     rc = test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
44355         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44356     rc = test_xmlUCSIsMiscellaneousSymbols();
44357         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44358     rc = test_xmlUCSIsMiscellaneousSymbolsandArrows();
44359         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44360     rc = test_xmlUCSIsMiscellaneousTechnical();
44361         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44362     rc = test_xmlUCSIsMongolian();
44363         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44364     rc = test_xmlUCSIsMusicalSymbols();
44365         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44366     rc = test_xmlUCSIsMyanmar();
44367         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44368     rc = test_xmlUCSIsNumberForms();
44369         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44370     rc = test_xmlUCSIsOgham();
44371         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44372     rc = test_xmlUCSIsOldItalic();
44373         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44374     rc = test_xmlUCSIsOpticalCharacterRecognition();
44375         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44376     rc = test_xmlUCSIsOriya();
44377         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44378     rc = test_xmlUCSIsOsmanya();
44379         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44380     rc = test_xmlUCSIsPhoneticExtensions();
44381         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44382     rc = test_xmlUCSIsPrivateUse();
44383         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44384     rc = test_xmlUCSIsPrivateUseArea();
44385         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44386     rc = test_xmlUCSIsRunic();
44387         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44388     rc = test_xmlUCSIsShavian();
44389         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44390     rc = test_xmlUCSIsSinhala();
44391         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44392     rc = test_xmlUCSIsSmallFormVariants();
44393         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44394     rc = test_xmlUCSIsSpacingModifierLetters();
44395         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44396     rc = test_xmlUCSIsSpecials();
44397         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44398     rc = test_xmlUCSIsSuperscriptsandSubscripts();
44399         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44400     rc = test_xmlUCSIsSupplementalArrowsA();
44401         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44402     rc = test_xmlUCSIsSupplementalArrowsB();
44403         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44404     rc = test_xmlUCSIsSupplementalMathematicalOperators();
44405         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44406     rc = test_xmlUCSIsSupplementaryPrivateUseAreaA();
44407         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44408     rc = test_xmlUCSIsSupplementaryPrivateUseAreaB();
44409         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44410     rc = test_xmlUCSIsSyriac();
44411         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44412     rc = test_xmlUCSIsTagalog();
44413         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44414     rc = test_xmlUCSIsTagbanwa();
44415         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44416     rc = test_xmlUCSIsTags();
44417         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44418     rc = test_xmlUCSIsTaiLe();
44419         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44420     rc = test_xmlUCSIsTaiXuanJingSymbols();
44421         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44422     rc = test_xmlUCSIsTamil();
44423         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44424     rc = test_xmlUCSIsTelugu();
44425         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44426     rc = test_xmlUCSIsThaana();
44427         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44428     rc = test_xmlUCSIsThai();
44429         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44430     rc = test_xmlUCSIsTibetan();
44431         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44432     rc = test_xmlUCSIsUgaritic();
44433         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44434     rc = test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
44435         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44436     rc = test_xmlUCSIsVariationSelectors();
44437         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44438     rc = test_xmlUCSIsVariationSelectorsSupplement();
44439         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44440     rc = test_xmlUCSIsYiRadicals();
44441         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44442     rc = test_xmlUCSIsYiSyllables();
44443         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44444     rc = test_xmlUCSIsYijingHexagramSymbols();
44445         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
44446
44447     if (test_ret != 0)
44448         printf("Module xmlunicode: %d errors\n", test_ret);
44449     return(test_ret);
44450 }
44451
44452 static int
44453 test_xmlNewTextWriter(void) {
44454     int test_ret = 0;
44455
44456 #if defined(LIBXML_WRITER_ENABLED)
44457     int mem_base;
44458     xmlTextWriterPtr ret_val;
44459     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
44460     int n_out;
44461
44462     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
44463         mem_base = xmlMemBlocks();
44464         out = gen_xmlOutputBufferPtr(n_out, 0);
44465
44466         ret_val = xmlNewTextWriter(out);
44467         if (ret_val != NULL) out = NULL;
44468         desret_xmlTextWriterPtr(ret_val);
44469         call_tests++;
44470         des_xmlOutputBufferPtr(n_out, out, 0);
44471         xmlResetLastError();
44472         if (mem_base != xmlMemBlocks()) {
44473             printf("Leak of %d blocks found in xmlNewTextWriter",
44474                    xmlMemBlocks() - mem_base);
44475             test_ret++;
44476             printf(" %d", n_out);
44477             printf("\n");
44478         }
44479     }
44480     function_tests++;
44481 #endif
44482
44483     return(test_ret);
44484 }
44485
44486
44487 static int
44488 test_xmlNewTextWriterFilename(void) {
44489     int test_ret = 0;
44490
44491 #if defined(LIBXML_WRITER_ENABLED)
44492     int mem_base;
44493     xmlTextWriterPtr ret_val;
44494     const char * uri; /* the URI of the resource for the output */
44495     int n_uri;
44496     int compression; /* compress the output? */
44497     int n_compression;
44498
44499     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
44500     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
44501         mem_base = xmlMemBlocks();
44502         uri = gen_fileoutput(n_uri, 0);
44503         compression = gen_int(n_compression, 1);
44504
44505         ret_val = xmlNewTextWriterFilename(uri, compression);
44506         desret_xmlTextWriterPtr(ret_val);
44507         call_tests++;
44508         des_fileoutput(n_uri, uri, 0);
44509         des_int(n_compression, compression, 1);
44510         xmlResetLastError();
44511         if (mem_base != xmlMemBlocks()) {
44512             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
44513                    xmlMemBlocks() - mem_base);
44514             test_ret++;
44515             printf(" %d", n_uri);
44516             printf(" %d", n_compression);
44517             printf("\n");
44518         }
44519     }
44520     }
44521     function_tests++;
44522 #endif
44523
44524     return(test_ret);
44525 }
44526
44527
44528 static int
44529 test_xmlNewTextWriterMemory(void) {
44530     int test_ret = 0;
44531
44532 #if defined(LIBXML_WRITER_ENABLED)
44533     int mem_base;
44534     xmlTextWriterPtr ret_val;
44535     xmlBufferPtr buf; /* xmlBufferPtr */
44536     int n_buf;
44537     int compression; /* compress the output? */
44538     int n_compression;
44539
44540     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
44541     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
44542         mem_base = xmlMemBlocks();
44543         buf = gen_xmlBufferPtr(n_buf, 0);
44544         compression = gen_int(n_compression, 1);
44545
44546         ret_val = xmlNewTextWriterMemory(buf, compression);
44547         desret_xmlTextWriterPtr(ret_val);
44548         call_tests++;
44549         des_xmlBufferPtr(n_buf, buf, 0);
44550         des_int(n_compression, compression, 1);
44551         xmlResetLastError();
44552         if (mem_base != xmlMemBlocks()) {
44553             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
44554                    xmlMemBlocks() - mem_base);
44555             test_ret++;
44556             printf(" %d", n_buf);
44557             printf(" %d", n_compression);
44558             printf("\n");
44559         }
44560     }
44561     }
44562     function_tests++;
44563 #endif
44564
44565     return(test_ret);
44566 }
44567
44568
44569 static int
44570 test_xmlNewTextWriterPushParser(void) {
44571     int test_ret = 0;
44572
44573 #if defined(LIBXML_WRITER_ENABLED)
44574     int mem_base;
44575     xmlTextWriterPtr ret_val;
44576     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
44577     int n_ctxt;
44578     int compression; /* compress the output? */
44579     int n_compression;
44580
44581     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
44582     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
44583         mem_base = xmlMemBlocks();
44584         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
44585         compression = gen_int(n_compression, 1);
44586
44587         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
44588         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
44589         desret_xmlTextWriterPtr(ret_val);
44590         call_tests++;
44591         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
44592         des_int(n_compression, compression, 1);
44593         xmlResetLastError();
44594         if (mem_base != xmlMemBlocks()) {
44595             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
44596                    xmlMemBlocks() - mem_base);
44597             test_ret++;
44598             printf(" %d", n_ctxt);
44599             printf(" %d", n_compression);
44600             printf("\n");
44601         }
44602     }
44603     }
44604     function_tests++;
44605 #endif
44606
44607     return(test_ret);
44608 }
44609
44610
44611 static int
44612 test_xmlNewTextWriterTree(void) {
44613     int test_ret = 0;
44614
44615 #if defined(LIBXML_WRITER_ENABLED)
44616     int mem_base;
44617     xmlTextWriterPtr ret_val;
44618     xmlDocPtr doc; /* xmlDocPtr */
44619     int n_doc;
44620     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
44621     int n_node;
44622     int compression; /* compress the output? */
44623     int n_compression;
44624
44625     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
44626     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
44627     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
44628         mem_base = xmlMemBlocks();
44629         doc = gen_xmlDocPtr(n_doc, 0);
44630         node = gen_xmlNodePtr(n_node, 1);
44631         compression = gen_int(n_compression, 2);
44632
44633         ret_val = xmlNewTextWriterTree(doc, node, compression);
44634         desret_xmlTextWriterPtr(ret_val);
44635         call_tests++;
44636         des_xmlDocPtr(n_doc, doc, 0);
44637         des_xmlNodePtr(n_node, node, 1);
44638         des_int(n_compression, compression, 2);
44639         xmlResetLastError();
44640         if (mem_base != xmlMemBlocks()) {
44641             printf("Leak of %d blocks found in xmlNewTextWriterTree",
44642                    xmlMemBlocks() - mem_base);
44643             test_ret++;
44644             printf(" %d", n_doc);
44645             printf(" %d", n_node);
44646             printf(" %d", n_compression);
44647             printf("\n");
44648         }
44649     }
44650     }
44651     }
44652     function_tests++;
44653 #endif
44654
44655     return(test_ret);
44656 }
44657
44658
44659 static int
44660 test_xmlTextWriterEndAttribute(void) {
44661     int test_ret = 0;
44662
44663 #if defined(LIBXML_WRITER_ENABLED)
44664     int mem_base;
44665     int ret_val;
44666     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44667     int n_writer;
44668
44669     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44670         mem_base = xmlMemBlocks();
44671         writer = gen_xmlTextWriterPtr(n_writer, 0);
44672
44673         ret_val = xmlTextWriterEndAttribute(writer);
44674         desret_int(ret_val);
44675         call_tests++;
44676         des_xmlTextWriterPtr(n_writer, writer, 0);
44677         xmlResetLastError();
44678         if (mem_base != xmlMemBlocks()) {
44679             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
44680                    xmlMemBlocks() - mem_base);
44681             test_ret++;
44682             printf(" %d", n_writer);
44683             printf("\n");
44684         }
44685     }
44686     function_tests++;
44687 #endif
44688
44689     return(test_ret);
44690 }
44691
44692
44693 static int
44694 test_xmlTextWriterEndCDATA(void) {
44695     int test_ret = 0;
44696
44697 #if defined(LIBXML_WRITER_ENABLED)
44698     int mem_base;
44699     int ret_val;
44700     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44701     int n_writer;
44702
44703     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44704         mem_base = xmlMemBlocks();
44705         writer = gen_xmlTextWriterPtr(n_writer, 0);
44706
44707         ret_val = xmlTextWriterEndCDATA(writer);
44708         desret_int(ret_val);
44709         call_tests++;
44710         des_xmlTextWriterPtr(n_writer, writer, 0);
44711         xmlResetLastError();
44712         if (mem_base != xmlMemBlocks()) {
44713             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
44714                    xmlMemBlocks() - mem_base);
44715             test_ret++;
44716             printf(" %d", n_writer);
44717             printf("\n");
44718         }
44719     }
44720     function_tests++;
44721 #endif
44722
44723     return(test_ret);
44724 }
44725
44726
44727 static int
44728 test_xmlTextWriterEndComment(void) {
44729     int test_ret = 0;
44730
44731 #if defined(LIBXML_WRITER_ENABLED)
44732     int mem_base;
44733     int ret_val;
44734     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44735     int n_writer;
44736
44737     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44738         mem_base = xmlMemBlocks();
44739         writer = gen_xmlTextWriterPtr(n_writer, 0);
44740
44741         ret_val = xmlTextWriterEndComment(writer);
44742         desret_int(ret_val);
44743         call_tests++;
44744         des_xmlTextWriterPtr(n_writer, writer, 0);
44745         xmlResetLastError();
44746         if (mem_base != xmlMemBlocks()) {
44747             printf("Leak of %d blocks found in xmlTextWriterEndComment",
44748                    xmlMemBlocks() - mem_base);
44749             test_ret++;
44750             printf(" %d", n_writer);
44751             printf("\n");
44752         }
44753     }
44754     function_tests++;
44755 #endif
44756
44757     return(test_ret);
44758 }
44759
44760
44761 static int
44762 test_xmlTextWriterEndDTD(void) {
44763     int test_ret = 0;
44764
44765 #if defined(LIBXML_WRITER_ENABLED)
44766     int mem_base;
44767     int ret_val;
44768     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44769     int n_writer;
44770
44771     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44772         mem_base = xmlMemBlocks();
44773         writer = gen_xmlTextWriterPtr(n_writer, 0);
44774
44775         ret_val = xmlTextWriterEndDTD(writer);
44776         desret_int(ret_val);
44777         call_tests++;
44778         des_xmlTextWriterPtr(n_writer, writer, 0);
44779         xmlResetLastError();
44780         if (mem_base != xmlMemBlocks()) {
44781             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
44782                    xmlMemBlocks() - mem_base);
44783             test_ret++;
44784             printf(" %d", n_writer);
44785             printf("\n");
44786         }
44787     }
44788     function_tests++;
44789 #endif
44790
44791     return(test_ret);
44792 }
44793
44794
44795 static int
44796 test_xmlTextWriterEndDTDAttlist(void) {
44797     int test_ret = 0;
44798
44799 #if defined(LIBXML_WRITER_ENABLED)
44800     int mem_base;
44801     int ret_val;
44802     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44803     int n_writer;
44804
44805     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44806         mem_base = xmlMemBlocks();
44807         writer = gen_xmlTextWriterPtr(n_writer, 0);
44808
44809         ret_val = xmlTextWriterEndDTDAttlist(writer);
44810         desret_int(ret_val);
44811         call_tests++;
44812         des_xmlTextWriterPtr(n_writer, writer, 0);
44813         xmlResetLastError();
44814         if (mem_base != xmlMemBlocks()) {
44815             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
44816                    xmlMemBlocks() - mem_base);
44817             test_ret++;
44818             printf(" %d", n_writer);
44819             printf("\n");
44820         }
44821     }
44822     function_tests++;
44823 #endif
44824
44825     return(test_ret);
44826 }
44827
44828
44829 static int
44830 test_xmlTextWriterEndDTDElement(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
44839     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44840         mem_base = xmlMemBlocks();
44841         writer = gen_xmlTextWriterPtr(n_writer, 0);
44842
44843         ret_val = xmlTextWriterEndDTDElement(writer);
44844         desret_int(ret_val);
44845         call_tests++;
44846         des_xmlTextWriterPtr(n_writer, writer, 0);
44847         xmlResetLastError();
44848         if (mem_base != xmlMemBlocks()) {
44849             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
44850                    xmlMemBlocks() - mem_base);
44851             test_ret++;
44852             printf(" %d", n_writer);
44853             printf("\n");
44854         }
44855     }
44856     function_tests++;
44857 #endif
44858
44859     return(test_ret);
44860 }
44861
44862
44863 static int
44864 test_xmlTextWriterEndDTDEntity(void) {
44865     int test_ret = 0;
44866
44867 #if defined(LIBXML_WRITER_ENABLED)
44868     int mem_base;
44869     int ret_val;
44870     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44871     int n_writer;
44872
44873     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44874         mem_base = xmlMemBlocks();
44875         writer = gen_xmlTextWriterPtr(n_writer, 0);
44876
44877         ret_val = xmlTextWriterEndDTDEntity(writer);
44878         desret_int(ret_val);
44879         call_tests++;
44880         des_xmlTextWriterPtr(n_writer, writer, 0);
44881         xmlResetLastError();
44882         if (mem_base != xmlMemBlocks()) {
44883             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
44884                    xmlMemBlocks() - mem_base);
44885             test_ret++;
44886             printf(" %d", n_writer);
44887             printf("\n");
44888         }
44889     }
44890     function_tests++;
44891 #endif
44892
44893     return(test_ret);
44894 }
44895
44896
44897 static int
44898 test_xmlTextWriterEndDocument(void) {
44899     int test_ret = 0;
44900
44901 #if defined(LIBXML_WRITER_ENABLED)
44902     int mem_base;
44903     int ret_val;
44904     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44905     int n_writer;
44906
44907     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44908         mem_base = xmlMemBlocks();
44909         writer = gen_xmlTextWriterPtr(n_writer, 0);
44910
44911         ret_val = xmlTextWriterEndDocument(writer);
44912         desret_int(ret_val);
44913         call_tests++;
44914         des_xmlTextWriterPtr(n_writer, writer, 0);
44915         xmlResetLastError();
44916         if (mem_base != xmlMemBlocks()) {
44917             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
44918                    xmlMemBlocks() - mem_base);
44919             test_ret++;
44920             printf(" %d", n_writer);
44921             printf("\n");
44922         }
44923     }
44924     function_tests++;
44925 #endif
44926
44927     return(test_ret);
44928 }
44929
44930
44931 static int
44932 test_xmlTextWriterEndElement(void) {
44933     int test_ret = 0;
44934
44935 #if defined(LIBXML_WRITER_ENABLED)
44936     int mem_base;
44937     int ret_val;
44938     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44939     int n_writer;
44940
44941     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44942         mem_base = xmlMemBlocks();
44943         writer = gen_xmlTextWriterPtr(n_writer, 0);
44944
44945         ret_val = xmlTextWriterEndElement(writer);
44946         desret_int(ret_val);
44947         call_tests++;
44948         des_xmlTextWriterPtr(n_writer, writer, 0);
44949         xmlResetLastError();
44950         if (mem_base != xmlMemBlocks()) {
44951             printf("Leak of %d blocks found in xmlTextWriterEndElement",
44952                    xmlMemBlocks() - mem_base);
44953             test_ret++;
44954             printf(" %d", n_writer);
44955             printf("\n");
44956         }
44957     }
44958     function_tests++;
44959 #endif
44960
44961     return(test_ret);
44962 }
44963
44964
44965 static int
44966 test_xmlTextWriterEndPI(void) {
44967     int test_ret = 0;
44968
44969 #if defined(LIBXML_WRITER_ENABLED)
44970     int mem_base;
44971     int ret_val;
44972     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44973     int n_writer;
44974
44975     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44976         mem_base = xmlMemBlocks();
44977         writer = gen_xmlTextWriterPtr(n_writer, 0);
44978
44979         ret_val = xmlTextWriterEndPI(writer);
44980         desret_int(ret_val);
44981         call_tests++;
44982         des_xmlTextWriterPtr(n_writer, writer, 0);
44983         xmlResetLastError();
44984         if (mem_base != xmlMemBlocks()) {
44985             printf("Leak of %d blocks found in xmlTextWriterEndPI",
44986                    xmlMemBlocks() - mem_base);
44987             test_ret++;
44988             printf(" %d", n_writer);
44989             printf("\n");
44990         }
44991     }
44992     function_tests++;
44993 #endif
44994
44995     return(test_ret);
44996 }
44997
44998
44999 static int
45000 test_xmlTextWriterFlush(void) {
45001     int test_ret = 0;
45002
45003 #if defined(LIBXML_WRITER_ENABLED)
45004     int mem_base;
45005     int ret_val;
45006     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45007     int n_writer;
45008
45009     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45010         mem_base = xmlMemBlocks();
45011         writer = gen_xmlTextWriterPtr(n_writer, 0);
45012
45013         ret_val = xmlTextWriterFlush(writer);
45014         desret_int(ret_val);
45015         call_tests++;
45016         des_xmlTextWriterPtr(n_writer, writer, 0);
45017         xmlResetLastError();
45018         if (mem_base != xmlMemBlocks()) {
45019             printf("Leak of %d blocks found in xmlTextWriterFlush",
45020                    xmlMemBlocks() - mem_base);
45021             test_ret++;
45022             printf(" %d", n_writer);
45023             printf("\n");
45024         }
45025     }
45026     function_tests++;
45027 #endif
45028
45029     return(test_ret);
45030 }
45031
45032
45033 static int
45034 test_xmlTextWriterFullEndElement(void) {
45035     int test_ret = 0;
45036
45037 #if defined(LIBXML_WRITER_ENABLED)
45038     int mem_base;
45039     int ret_val;
45040     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45041     int n_writer;
45042
45043     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45044         mem_base = xmlMemBlocks();
45045         writer = gen_xmlTextWriterPtr(n_writer, 0);
45046
45047         ret_val = xmlTextWriterFullEndElement(writer);
45048         desret_int(ret_val);
45049         call_tests++;
45050         des_xmlTextWriterPtr(n_writer, writer, 0);
45051         xmlResetLastError();
45052         if (mem_base != xmlMemBlocks()) {
45053             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
45054                    xmlMemBlocks() - mem_base);
45055             test_ret++;
45056             printf(" %d", n_writer);
45057             printf("\n");
45058         }
45059     }
45060     function_tests++;
45061 #endif
45062
45063     return(test_ret);
45064 }
45065
45066
45067 static int
45068 test_xmlTextWriterSetIndent(void) {
45069     int test_ret = 0;
45070
45071 #if defined(LIBXML_WRITER_ENABLED)
45072     int mem_base;
45073     int ret_val;
45074     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45075     int n_writer;
45076     int indent; /* do indentation? */
45077     int n_indent;
45078
45079     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45080     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
45081         mem_base = xmlMemBlocks();
45082         writer = gen_xmlTextWriterPtr(n_writer, 0);
45083         indent = gen_int(n_indent, 1);
45084
45085         ret_val = xmlTextWriterSetIndent(writer, indent);
45086         desret_int(ret_val);
45087         call_tests++;
45088         des_xmlTextWriterPtr(n_writer, writer, 0);
45089         des_int(n_indent, indent, 1);
45090         xmlResetLastError();
45091         if (mem_base != xmlMemBlocks()) {
45092             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
45093                    xmlMemBlocks() - mem_base);
45094             test_ret++;
45095             printf(" %d", n_writer);
45096             printf(" %d", n_indent);
45097             printf("\n");
45098         }
45099     }
45100     }
45101     function_tests++;
45102 #endif
45103
45104     return(test_ret);
45105 }
45106
45107
45108 static int
45109 test_xmlTextWriterSetIndentString(void) {
45110     int test_ret = 0;
45111
45112 #if defined(LIBXML_WRITER_ENABLED)
45113     int mem_base;
45114     int ret_val;
45115     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45116     int n_writer;
45117     xmlChar * str; /* the xmlChar string */
45118     int n_str;
45119
45120     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45121     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
45122         mem_base = xmlMemBlocks();
45123         writer = gen_xmlTextWriterPtr(n_writer, 0);
45124         str = gen_const_xmlChar_ptr(n_str, 1);
45125
45126         ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
45127         desret_int(ret_val);
45128         call_tests++;
45129         des_xmlTextWriterPtr(n_writer, writer, 0);
45130         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
45131         xmlResetLastError();
45132         if (mem_base != xmlMemBlocks()) {
45133             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
45134                    xmlMemBlocks() - mem_base);
45135             test_ret++;
45136             printf(" %d", n_writer);
45137             printf(" %d", n_str);
45138             printf("\n");
45139         }
45140     }
45141     }
45142     function_tests++;
45143 #endif
45144
45145     return(test_ret);
45146 }
45147
45148
45149 static int
45150 test_xmlTextWriterSetQuoteChar(void) {
45151     int test_ret = 0;
45152
45153 #if defined(LIBXML_WRITER_ENABLED)
45154     int mem_base;
45155     int ret_val;
45156     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45157     int n_writer;
45158     xmlChar quotechar; /* the quote character */
45159     int n_quotechar;
45160
45161     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45162     for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
45163         mem_base = xmlMemBlocks();
45164         writer = gen_xmlTextWriterPtr(n_writer, 0);
45165         quotechar = gen_xmlChar(n_quotechar, 1);
45166
45167         ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
45168         desret_int(ret_val);
45169         call_tests++;
45170         des_xmlTextWriterPtr(n_writer, writer, 0);
45171         des_xmlChar(n_quotechar, quotechar, 1);
45172         xmlResetLastError();
45173         if (mem_base != xmlMemBlocks()) {
45174             printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
45175                    xmlMemBlocks() - mem_base);
45176             test_ret++;
45177             printf(" %d", n_writer);
45178             printf(" %d", n_quotechar);
45179             printf("\n");
45180         }
45181     }
45182     }
45183     function_tests++;
45184 #endif
45185
45186     return(test_ret);
45187 }
45188
45189
45190 static int
45191 test_xmlTextWriterStartAttribute(void) {
45192     int test_ret = 0;
45193
45194 #if defined(LIBXML_WRITER_ENABLED)
45195     int mem_base;
45196     int ret_val;
45197     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45198     int n_writer;
45199     xmlChar * name; /* element name */
45200     int n_name;
45201
45202     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45203     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45204         mem_base = xmlMemBlocks();
45205         writer = gen_xmlTextWriterPtr(n_writer, 0);
45206         name = gen_const_xmlChar_ptr(n_name, 1);
45207
45208         ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
45209         desret_int(ret_val);
45210         call_tests++;
45211         des_xmlTextWriterPtr(n_writer, writer, 0);
45212         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45213         xmlResetLastError();
45214         if (mem_base != xmlMemBlocks()) {
45215             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
45216                    xmlMemBlocks() - mem_base);
45217             test_ret++;
45218             printf(" %d", n_writer);
45219             printf(" %d", n_name);
45220             printf("\n");
45221         }
45222     }
45223     }
45224     function_tests++;
45225 #endif
45226
45227     return(test_ret);
45228 }
45229
45230
45231 static int
45232 test_xmlTextWriterStartAttributeNS(void) {
45233     int test_ret = 0;
45234
45235 #if defined(LIBXML_WRITER_ENABLED)
45236     int mem_base;
45237     int ret_val;
45238     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45239     int n_writer;
45240     xmlChar * prefix; /* namespace prefix or NULL */
45241     int n_prefix;
45242     xmlChar * name; /* element local name */
45243     int n_name;
45244     xmlChar * namespaceURI; /* namespace URI or NULL */
45245     int n_namespaceURI;
45246
45247     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45248     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45249     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45250     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45251         mem_base = xmlMemBlocks();
45252         writer = gen_xmlTextWriterPtr(n_writer, 0);
45253         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45254         name = gen_const_xmlChar_ptr(n_name, 2);
45255         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45256
45257         ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
45258         desret_int(ret_val);
45259         call_tests++;
45260         des_xmlTextWriterPtr(n_writer, writer, 0);
45261         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45262         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45263         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45264         xmlResetLastError();
45265         if (mem_base != xmlMemBlocks()) {
45266             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
45267                    xmlMemBlocks() - mem_base);
45268             test_ret++;
45269             printf(" %d", n_writer);
45270             printf(" %d", n_prefix);
45271             printf(" %d", n_name);
45272             printf(" %d", n_namespaceURI);
45273             printf("\n");
45274         }
45275     }
45276     }
45277     }
45278     }
45279     function_tests++;
45280 #endif
45281
45282     return(test_ret);
45283 }
45284
45285
45286 static int
45287 test_xmlTextWriterStartCDATA(void) {
45288     int test_ret = 0;
45289
45290 #if defined(LIBXML_WRITER_ENABLED)
45291     int mem_base;
45292     int ret_val;
45293     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45294     int n_writer;
45295
45296     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45297         mem_base = xmlMemBlocks();
45298         writer = gen_xmlTextWriterPtr(n_writer, 0);
45299
45300         ret_val = xmlTextWriterStartCDATA(writer);
45301         desret_int(ret_val);
45302         call_tests++;
45303         des_xmlTextWriterPtr(n_writer, writer, 0);
45304         xmlResetLastError();
45305         if (mem_base != xmlMemBlocks()) {
45306             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
45307                    xmlMemBlocks() - mem_base);
45308             test_ret++;
45309             printf(" %d", n_writer);
45310             printf("\n");
45311         }
45312     }
45313     function_tests++;
45314 #endif
45315
45316     return(test_ret);
45317 }
45318
45319
45320 static int
45321 test_xmlTextWriterStartComment(void) {
45322     int test_ret = 0;
45323
45324 #if defined(LIBXML_WRITER_ENABLED)
45325     int mem_base;
45326     int ret_val;
45327     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45328     int n_writer;
45329
45330     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45331         mem_base = xmlMemBlocks();
45332         writer = gen_xmlTextWriterPtr(n_writer, 0);
45333
45334         ret_val = xmlTextWriterStartComment(writer);
45335         desret_int(ret_val);
45336         call_tests++;
45337         des_xmlTextWriterPtr(n_writer, writer, 0);
45338         xmlResetLastError();
45339         if (mem_base != xmlMemBlocks()) {
45340             printf("Leak of %d blocks found in xmlTextWriterStartComment",
45341                    xmlMemBlocks() - mem_base);
45342             test_ret++;
45343             printf(" %d", n_writer);
45344             printf("\n");
45345         }
45346     }
45347     function_tests++;
45348 #endif
45349
45350     return(test_ret);
45351 }
45352
45353
45354 static int
45355 test_xmlTextWriterStartDTD(void) {
45356     int test_ret = 0;
45357
45358 #if defined(LIBXML_WRITER_ENABLED)
45359     int mem_base;
45360     int ret_val;
45361     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45362     int n_writer;
45363     xmlChar * name; /* the name of the DTD */
45364     int n_name;
45365     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
45366     int n_pubid;
45367     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
45368     int n_sysid;
45369
45370     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45371     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45372     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
45373     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
45374         mem_base = xmlMemBlocks();
45375         writer = gen_xmlTextWriterPtr(n_writer, 0);
45376         name = gen_const_xmlChar_ptr(n_name, 1);
45377         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
45378         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
45379
45380         ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
45381         desret_int(ret_val);
45382         call_tests++;
45383         des_xmlTextWriterPtr(n_writer, writer, 0);
45384         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45385         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
45386         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
45387         xmlResetLastError();
45388         if (mem_base != xmlMemBlocks()) {
45389             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
45390                    xmlMemBlocks() - mem_base);
45391             test_ret++;
45392             printf(" %d", n_writer);
45393             printf(" %d", n_name);
45394             printf(" %d", n_pubid);
45395             printf(" %d", n_sysid);
45396             printf("\n");
45397         }
45398     }
45399     }
45400     }
45401     }
45402     function_tests++;
45403 #endif
45404
45405     return(test_ret);
45406 }
45407
45408
45409 static int
45410 test_xmlTextWriterStartDTDAttlist(void) {
45411     int test_ret = 0;
45412
45413 #if defined(LIBXML_WRITER_ENABLED)
45414     int mem_base;
45415     int ret_val;
45416     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45417     int n_writer;
45418     xmlChar * name; /* the name of the DTD ATTLIST */
45419     int n_name;
45420
45421     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45422     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45423         mem_base = xmlMemBlocks();
45424         writer = gen_xmlTextWriterPtr(n_writer, 0);
45425         name = gen_const_xmlChar_ptr(n_name, 1);
45426
45427         ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
45428         desret_int(ret_val);
45429         call_tests++;
45430         des_xmlTextWriterPtr(n_writer, writer, 0);
45431         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45432         xmlResetLastError();
45433         if (mem_base != xmlMemBlocks()) {
45434             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
45435                    xmlMemBlocks() - mem_base);
45436             test_ret++;
45437             printf(" %d", n_writer);
45438             printf(" %d", n_name);
45439             printf("\n");
45440         }
45441     }
45442     }
45443     function_tests++;
45444 #endif
45445
45446     return(test_ret);
45447 }
45448
45449
45450 static int
45451 test_xmlTextWriterStartDTDElement(void) {
45452     int test_ret = 0;
45453
45454 #if defined(LIBXML_WRITER_ENABLED)
45455     int mem_base;
45456     int ret_val;
45457     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45458     int n_writer;
45459     xmlChar * name; /* the name of the DTD element */
45460     int n_name;
45461
45462     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45463     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45464         mem_base = xmlMemBlocks();
45465         writer = gen_xmlTextWriterPtr(n_writer, 0);
45466         name = gen_const_xmlChar_ptr(n_name, 1);
45467
45468         ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
45469         desret_int(ret_val);
45470         call_tests++;
45471         des_xmlTextWriterPtr(n_writer, writer, 0);
45472         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45473         xmlResetLastError();
45474         if (mem_base != xmlMemBlocks()) {
45475             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
45476                    xmlMemBlocks() - mem_base);
45477             test_ret++;
45478             printf(" %d", n_writer);
45479             printf(" %d", n_name);
45480             printf("\n");
45481         }
45482     }
45483     }
45484     function_tests++;
45485 #endif
45486
45487     return(test_ret);
45488 }
45489
45490
45491 static int
45492 test_xmlTextWriterStartDTDEntity(void) {
45493     int test_ret = 0;
45494
45495 #if defined(LIBXML_WRITER_ENABLED)
45496     int mem_base;
45497     int ret_val;
45498     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45499     int n_writer;
45500     int pe; /* TRUE if this is a parameter entity, FALSE if not */
45501     int n_pe;
45502     xmlChar * name; /* the name of the DTD ATTLIST */
45503     int n_name;
45504
45505     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45506     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
45507     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45508         mem_base = xmlMemBlocks();
45509         writer = gen_xmlTextWriterPtr(n_writer, 0);
45510         pe = gen_int(n_pe, 1);
45511         name = gen_const_xmlChar_ptr(n_name, 2);
45512
45513         ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
45514         desret_int(ret_val);
45515         call_tests++;
45516         des_xmlTextWriterPtr(n_writer, writer, 0);
45517         des_int(n_pe, pe, 1);
45518         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45519         xmlResetLastError();
45520         if (mem_base != xmlMemBlocks()) {
45521             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
45522                    xmlMemBlocks() - mem_base);
45523             test_ret++;
45524             printf(" %d", n_writer);
45525             printf(" %d", n_pe);
45526             printf(" %d", n_name);
45527             printf("\n");
45528         }
45529     }
45530     }
45531     }
45532     function_tests++;
45533 #endif
45534
45535     return(test_ret);
45536 }
45537
45538
45539 static int
45540 test_xmlTextWriterStartDocument(void) {
45541     int test_ret = 0;
45542
45543 #if defined(LIBXML_WRITER_ENABLED)
45544     int mem_base;
45545     int ret_val;
45546     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45547     int n_writer;
45548     char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
45549     int n_version;
45550     char * encoding; /* the encoding or NULL for default */
45551     int n_encoding;
45552     char * standalone; /* "yes" or "no" or NULL for default */
45553     int n_standalone;
45554
45555     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45556     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
45557     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
45558     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
45559         mem_base = xmlMemBlocks();
45560         writer = gen_xmlTextWriterPtr(n_writer, 0);
45561         version = gen_const_char_ptr(n_version, 1);
45562         encoding = gen_const_char_ptr(n_encoding, 2);
45563         standalone = gen_const_char_ptr(n_standalone, 3);
45564
45565         ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
45566         desret_int(ret_val);
45567         call_tests++;
45568         des_xmlTextWriterPtr(n_writer, writer, 0);
45569         des_const_char_ptr(n_version, (const char *)version, 1);
45570         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
45571         des_const_char_ptr(n_standalone, (const char *)standalone, 3);
45572         xmlResetLastError();
45573         if (mem_base != xmlMemBlocks()) {
45574             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
45575                    xmlMemBlocks() - mem_base);
45576             test_ret++;
45577             printf(" %d", n_writer);
45578             printf(" %d", n_version);
45579             printf(" %d", n_encoding);
45580             printf(" %d", n_standalone);
45581             printf("\n");
45582         }
45583     }
45584     }
45585     }
45586     }
45587     function_tests++;
45588 #endif
45589
45590     return(test_ret);
45591 }
45592
45593
45594 static int
45595 test_xmlTextWriterStartElement(void) {
45596     int test_ret = 0;
45597
45598 #if defined(LIBXML_WRITER_ENABLED)
45599     int mem_base;
45600     int ret_val;
45601     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45602     int n_writer;
45603     xmlChar * name; /* element name */
45604     int n_name;
45605
45606     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45607     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45608         mem_base = xmlMemBlocks();
45609         writer = gen_xmlTextWriterPtr(n_writer, 0);
45610         name = gen_const_xmlChar_ptr(n_name, 1);
45611
45612         ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
45613         desret_int(ret_val);
45614         call_tests++;
45615         des_xmlTextWriterPtr(n_writer, writer, 0);
45616         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45617         xmlResetLastError();
45618         if (mem_base != xmlMemBlocks()) {
45619             printf("Leak of %d blocks found in xmlTextWriterStartElement",
45620                    xmlMemBlocks() - mem_base);
45621             test_ret++;
45622             printf(" %d", n_writer);
45623             printf(" %d", n_name);
45624             printf("\n");
45625         }
45626     }
45627     }
45628     function_tests++;
45629 #endif
45630
45631     return(test_ret);
45632 }
45633
45634
45635 static int
45636 test_xmlTextWriterStartElementNS(void) {
45637     int test_ret = 0;
45638
45639 #if defined(LIBXML_WRITER_ENABLED)
45640     int mem_base;
45641     int ret_val;
45642     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45643     int n_writer;
45644     xmlChar * prefix; /* namespace prefix or NULL */
45645     int n_prefix;
45646     xmlChar * name; /* element local name */
45647     int n_name;
45648     xmlChar * namespaceURI; /* namespace URI or NULL */
45649     int n_namespaceURI;
45650
45651     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45652     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45653     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45654     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45655         mem_base = xmlMemBlocks();
45656         writer = gen_xmlTextWriterPtr(n_writer, 0);
45657         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45658         name = gen_const_xmlChar_ptr(n_name, 2);
45659         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45660
45661         ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
45662         desret_int(ret_val);
45663         call_tests++;
45664         des_xmlTextWriterPtr(n_writer, writer, 0);
45665         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45666         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45667         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45668         xmlResetLastError();
45669         if (mem_base != xmlMemBlocks()) {
45670             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
45671                    xmlMemBlocks() - mem_base);
45672             test_ret++;
45673             printf(" %d", n_writer);
45674             printf(" %d", n_prefix);
45675             printf(" %d", n_name);
45676             printf(" %d", n_namespaceURI);
45677             printf("\n");
45678         }
45679     }
45680     }
45681     }
45682     }
45683     function_tests++;
45684 #endif
45685
45686     return(test_ret);
45687 }
45688
45689
45690 static int
45691 test_xmlTextWriterStartPI(void) {
45692     int test_ret = 0;
45693
45694 #if defined(LIBXML_WRITER_ENABLED)
45695     int mem_base;
45696     int ret_val;
45697     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45698     int n_writer;
45699     xmlChar * target; /* PI target */
45700     int n_target;
45701
45702     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45703     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45704         mem_base = xmlMemBlocks();
45705         writer = gen_xmlTextWriterPtr(n_writer, 0);
45706         target = gen_const_xmlChar_ptr(n_target, 1);
45707
45708         ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
45709         desret_int(ret_val);
45710         call_tests++;
45711         des_xmlTextWriterPtr(n_writer, writer, 0);
45712         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45713         xmlResetLastError();
45714         if (mem_base != xmlMemBlocks()) {
45715             printf("Leak of %d blocks found in xmlTextWriterStartPI",
45716                    xmlMemBlocks() - mem_base);
45717             test_ret++;
45718             printf(" %d", n_writer);
45719             printf(" %d", n_target);
45720             printf("\n");
45721         }
45722     }
45723     }
45724     function_tests++;
45725 #endif
45726
45727     return(test_ret);
45728 }
45729
45730
45731 static int
45732 test_xmlTextWriterWriteAttribute(void) {
45733     int test_ret = 0;
45734
45735 #if defined(LIBXML_WRITER_ENABLED)
45736     int mem_base;
45737     int ret_val;
45738     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45739     int n_writer;
45740     xmlChar * name; /* attribute name */
45741     int n_name;
45742     xmlChar * content; /* attribute content */
45743     int n_content;
45744
45745     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45746     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45747     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45748         mem_base = xmlMemBlocks();
45749         writer = gen_xmlTextWriterPtr(n_writer, 0);
45750         name = gen_const_xmlChar_ptr(n_name, 1);
45751         content = gen_const_xmlChar_ptr(n_content, 2);
45752
45753         ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
45754         desret_int(ret_val);
45755         call_tests++;
45756         des_xmlTextWriterPtr(n_writer, writer, 0);
45757         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
45758         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45759         xmlResetLastError();
45760         if (mem_base != xmlMemBlocks()) {
45761             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
45762                    xmlMemBlocks() - mem_base);
45763             test_ret++;
45764             printf(" %d", n_writer);
45765             printf(" %d", n_name);
45766             printf(" %d", n_content);
45767             printf("\n");
45768         }
45769     }
45770     }
45771     }
45772     function_tests++;
45773 #endif
45774
45775     return(test_ret);
45776 }
45777
45778
45779 static int
45780 test_xmlTextWriterWriteAttributeNS(void) {
45781     int test_ret = 0;
45782
45783 #if defined(LIBXML_WRITER_ENABLED)
45784     int mem_base;
45785     int ret_val;
45786     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45787     int n_writer;
45788     xmlChar * prefix; /* namespace prefix */
45789     int n_prefix;
45790     xmlChar * name; /* attribute local name */
45791     int n_name;
45792     xmlChar * namespaceURI; /* namespace URI */
45793     int n_namespaceURI;
45794     xmlChar * content; /* attribute content */
45795     int n_content;
45796
45797     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45798     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
45799     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45800     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
45801     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45802         mem_base = xmlMemBlocks();
45803         writer = gen_xmlTextWriterPtr(n_writer, 0);
45804         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
45805         name = gen_const_xmlChar_ptr(n_name, 2);
45806         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
45807         content = gen_const_xmlChar_ptr(n_content, 4);
45808
45809         ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
45810         desret_int(ret_val);
45811         call_tests++;
45812         des_xmlTextWriterPtr(n_writer, writer, 0);
45813         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
45814         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
45815         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
45816         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
45817         xmlResetLastError();
45818         if (mem_base != xmlMemBlocks()) {
45819             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
45820                    xmlMemBlocks() - mem_base);
45821             test_ret++;
45822             printf(" %d", n_writer);
45823             printf(" %d", n_prefix);
45824             printf(" %d", n_name);
45825             printf(" %d", n_namespaceURI);
45826             printf(" %d", n_content);
45827             printf("\n");
45828         }
45829     }
45830     }
45831     }
45832     }
45833     }
45834     function_tests++;
45835 #endif
45836
45837     return(test_ret);
45838 }
45839
45840
45841 static int
45842 test_xmlTextWriterWriteBase64(void) {
45843     int test_ret = 0;
45844
45845 #if defined(LIBXML_WRITER_ENABLED)
45846     int mem_base;
45847     int ret_val;
45848     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45849     int n_writer;
45850     char * data; /* binary data */
45851     int n_data;
45852     int start; /* the position within the data of the first byte to encode */
45853     int n_start;
45854     int len; /* the number of bytes to encode */
45855     int n_len;
45856
45857     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45858     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
45859     for (n_start = 0;n_start < gen_nb_int;n_start++) {
45860     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45861         mem_base = xmlMemBlocks();
45862         writer = gen_xmlTextWriterPtr(n_writer, 0);
45863         data = gen_const_char_ptr(n_data, 1);
45864         start = gen_int(n_start, 2);
45865         len = gen_int(n_len, 3);
45866         if ((data != NULL) &&
45867             (start > (int) strlen((const char *) data) + 1))
45868             continue;
45869         if ((data != NULL) &&
45870             (len > (int) strlen((const char *) data) + 1))
45871             continue;
45872
45873         ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
45874         desret_int(ret_val);
45875         call_tests++;
45876         des_xmlTextWriterPtr(n_writer, writer, 0);
45877         des_const_char_ptr(n_data, (const char *)data, 1);
45878         des_int(n_start, start, 2);
45879         des_int(n_len, len, 3);
45880         xmlResetLastError();
45881         if (mem_base != xmlMemBlocks()) {
45882             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
45883                    xmlMemBlocks() - mem_base);
45884             test_ret++;
45885             printf(" %d", n_writer);
45886             printf(" %d", n_data);
45887             printf(" %d", n_start);
45888             printf(" %d", n_len);
45889             printf("\n");
45890         }
45891     }
45892     }
45893     }
45894     }
45895     function_tests++;
45896 #endif
45897
45898     return(test_ret);
45899 }
45900
45901
45902 static int
45903 test_xmlTextWriterWriteBinHex(void) {
45904     int test_ret = 0;
45905
45906 #if defined(LIBXML_WRITER_ENABLED)
45907     int mem_base;
45908     int ret_val;
45909     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45910     int n_writer;
45911     char * data; /* binary data */
45912     int n_data;
45913     int start; /* the position within the data of the first byte to encode */
45914     int n_start;
45915     int len; /* the number of bytes to encode */
45916     int n_len;
45917
45918     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45919     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
45920     for (n_start = 0;n_start < gen_nb_int;n_start++) {
45921     for (n_len = 0;n_len < gen_nb_int;n_len++) {
45922         mem_base = xmlMemBlocks();
45923         writer = gen_xmlTextWriterPtr(n_writer, 0);
45924         data = gen_const_char_ptr(n_data, 1);
45925         start = gen_int(n_start, 2);
45926         len = gen_int(n_len, 3);
45927         if ((data != NULL) &&
45928             (start > (int) strlen((const char *) data) + 1))
45929             continue;
45930         if ((data != NULL) &&
45931             (len > (int) strlen((const char *) data) + 1))
45932             continue;
45933
45934         ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
45935         desret_int(ret_val);
45936         call_tests++;
45937         des_xmlTextWriterPtr(n_writer, writer, 0);
45938         des_const_char_ptr(n_data, (const char *)data, 1);
45939         des_int(n_start, start, 2);
45940         des_int(n_len, len, 3);
45941         xmlResetLastError();
45942         if (mem_base != xmlMemBlocks()) {
45943             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
45944                    xmlMemBlocks() - mem_base);
45945             test_ret++;
45946             printf(" %d", n_writer);
45947             printf(" %d", n_data);
45948             printf(" %d", n_start);
45949             printf(" %d", n_len);
45950             printf("\n");
45951         }
45952     }
45953     }
45954     }
45955     }
45956     function_tests++;
45957 #endif
45958
45959     return(test_ret);
45960 }
45961
45962
45963 static int
45964 test_xmlTextWriterWriteCDATA(void) {
45965     int test_ret = 0;
45966
45967 #if defined(LIBXML_WRITER_ENABLED)
45968     int mem_base;
45969     int ret_val;
45970     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45971     int n_writer;
45972     xmlChar * content; /* CDATA content */
45973     int n_content;
45974
45975     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45976     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45977         mem_base = xmlMemBlocks();
45978         writer = gen_xmlTextWriterPtr(n_writer, 0);
45979         content = gen_const_xmlChar_ptr(n_content, 1);
45980
45981         ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
45982         desret_int(ret_val);
45983         call_tests++;
45984         des_xmlTextWriterPtr(n_writer, writer, 0);
45985         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45986         xmlResetLastError();
45987         if (mem_base != xmlMemBlocks()) {
45988             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
45989                    xmlMemBlocks() - mem_base);
45990             test_ret++;
45991             printf(" %d", n_writer);
45992             printf(" %d", n_content);
45993             printf("\n");
45994         }
45995     }
45996     }
45997     function_tests++;
45998 #endif
45999
46000     return(test_ret);
46001 }
46002
46003
46004 static int
46005 test_xmlTextWriterWriteComment(void) {
46006     int test_ret = 0;
46007
46008 #if defined(LIBXML_WRITER_ENABLED)
46009     int mem_base;
46010     int ret_val;
46011     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46012     int n_writer;
46013     xmlChar * content; /* comment string */
46014     int n_content;
46015
46016     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46017     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46018         mem_base = xmlMemBlocks();
46019         writer = gen_xmlTextWriterPtr(n_writer, 0);
46020         content = gen_const_xmlChar_ptr(n_content, 1);
46021
46022         ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
46023         desret_int(ret_val);
46024         call_tests++;
46025         des_xmlTextWriterPtr(n_writer, writer, 0);
46026         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
46027         xmlResetLastError();
46028         if (mem_base != xmlMemBlocks()) {
46029             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
46030                    xmlMemBlocks() - mem_base);
46031             test_ret++;
46032             printf(" %d", n_writer);
46033             printf(" %d", n_content);
46034             printf("\n");
46035         }
46036     }
46037     }
46038     function_tests++;
46039 #endif
46040
46041     return(test_ret);
46042 }
46043
46044
46045 static int
46046 test_xmlTextWriterWriteDTD(void) {
46047     int test_ret = 0;
46048
46049 #if defined(LIBXML_WRITER_ENABLED)
46050     int mem_base;
46051     int ret_val;
46052     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46053     int n_writer;
46054     xmlChar * name; /* the name of the DTD */
46055     int n_name;
46056     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
46057     int n_pubid;
46058     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
46059     int n_sysid;
46060     xmlChar * subset; /* string content of the DTD */
46061     int n_subset;
46062
46063     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46064     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46065     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
46066     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
46067     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
46068         mem_base = xmlMemBlocks();
46069         writer = gen_xmlTextWriterPtr(n_writer, 0);
46070         name = gen_const_xmlChar_ptr(n_name, 1);
46071         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
46072         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
46073         subset = gen_const_xmlChar_ptr(n_subset, 4);
46074
46075         ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
46076         desret_int(ret_val);
46077         call_tests++;
46078         des_xmlTextWriterPtr(n_writer, writer, 0);
46079         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46080         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
46081         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
46082         des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
46083         xmlResetLastError();
46084         if (mem_base != xmlMemBlocks()) {
46085             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
46086                    xmlMemBlocks() - mem_base);
46087             test_ret++;
46088             printf(" %d", n_writer);
46089             printf(" %d", n_name);
46090             printf(" %d", n_pubid);
46091             printf(" %d", n_sysid);
46092             printf(" %d", n_subset);
46093             printf("\n");
46094         }
46095     }
46096     }
46097     }
46098     }
46099     }
46100     function_tests++;
46101 #endif
46102
46103     return(test_ret);
46104 }
46105
46106
46107 static int
46108 test_xmlTextWriterWriteDTDAttlist(void) {
46109     int test_ret = 0;
46110
46111 #if defined(LIBXML_WRITER_ENABLED)
46112     int mem_base;
46113     int ret_val;
46114     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46115     int n_writer;
46116     xmlChar * name; /* the name of the DTD ATTLIST */
46117     int n_name;
46118     xmlChar * content; /* content of the ATTLIST */
46119     int n_content;
46120
46121     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46122     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46123     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46124         mem_base = xmlMemBlocks();
46125         writer = gen_xmlTextWriterPtr(n_writer, 0);
46126         name = gen_const_xmlChar_ptr(n_name, 1);
46127         content = gen_const_xmlChar_ptr(n_content, 2);
46128
46129         ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
46130         desret_int(ret_val);
46131         call_tests++;
46132         des_xmlTextWriterPtr(n_writer, writer, 0);
46133         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46134         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
46135         xmlResetLastError();
46136         if (mem_base != xmlMemBlocks()) {
46137             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
46138                    xmlMemBlocks() - mem_base);
46139             test_ret++;
46140             printf(" %d", n_writer);
46141             printf(" %d", n_name);
46142             printf(" %d", n_content);
46143             printf("\n");
46144         }
46145     }
46146     }
46147     }
46148     function_tests++;
46149 #endif
46150
46151     return(test_ret);
46152 }
46153
46154
46155 static int
46156 test_xmlTextWriterWriteDTDElement(void) {
46157     int test_ret = 0;
46158
46159 #if defined(LIBXML_WRITER_ENABLED)
46160     int mem_base;
46161     int ret_val;
46162     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46163     int n_writer;
46164     xmlChar * name; /* the name of the DTD element */
46165     int n_name;
46166     xmlChar * content; /* content of the element */
46167     int n_content;
46168
46169     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46170     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46171     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46172         mem_base = xmlMemBlocks();
46173         writer = gen_xmlTextWriterPtr(n_writer, 0);
46174         name = gen_const_xmlChar_ptr(n_name, 1);
46175         content = gen_const_xmlChar_ptr(n_content, 2);
46176
46177         ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
46178         desret_int(ret_val);
46179         call_tests++;
46180         des_xmlTextWriterPtr(n_writer, writer, 0);
46181         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46182         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
46183         xmlResetLastError();
46184         if (mem_base != xmlMemBlocks()) {
46185             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
46186                    xmlMemBlocks() - mem_base);
46187             test_ret++;
46188             printf(" %d", n_writer);
46189             printf(" %d", n_name);
46190             printf(" %d", n_content);
46191             printf("\n");
46192         }
46193     }
46194     }
46195     }
46196     function_tests++;
46197 #endif
46198
46199     return(test_ret);
46200 }
46201
46202
46203 static int
46204 test_xmlTextWriterWriteDTDEntity(void) {
46205     int test_ret = 0;
46206
46207 #if defined(LIBXML_WRITER_ENABLED)
46208     int mem_base;
46209     int ret_val;
46210     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46211     int n_writer;
46212     int pe; /* TRUE if this is a parameter entity, FALSE if not */
46213     int n_pe;
46214     xmlChar * name; /* the name of the DTD entity */
46215     int n_name;
46216     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
46217     int n_pubid;
46218     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
46219     int n_sysid;
46220     xmlChar * ndataid; /* the xml notation name. */
46221     int n_ndataid;
46222     xmlChar * content; /* content of the entity */
46223     int n_content;
46224
46225     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46226     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
46227     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46228     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
46229     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
46230     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
46231     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46232         mem_base = xmlMemBlocks();
46233         writer = gen_xmlTextWriterPtr(n_writer, 0);
46234         pe = gen_int(n_pe, 1);
46235         name = gen_const_xmlChar_ptr(n_name, 2);
46236         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
46237         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
46238         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
46239         content = gen_const_xmlChar_ptr(n_content, 6);
46240
46241         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
46242         desret_int(ret_val);
46243         call_tests++;
46244         des_xmlTextWriterPtr(n_writer, writer, 0);
46245         des_int(n_pe, pe, 1);
46246         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
46247         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
46248         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
46249         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
46250         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
46251         xmlResetLastError();
46252         if (mem_base != xmlMemBlocks()) {
46253             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
46254                    xmlMemBlocks() - mem_base);
46255             test_ret++;
46256             printf(" %d", n_writer);
46257             printf(" %d", n_pe);
46258             printf(" %d", n_name);
46259             printf(" %d", n_pubid);
46260             printf(" %d", n_sysid);
46261             printf(" %d", n_ndataid);
46262             printf(" %d", n_content);
46263             printf("\n");
46264         }
46265     }
46266     }
46267     }
46268     }
46269     }
46270     }
46271     }
46272     function_tests++;
46273 #endif
46274
46275     return(test_ret);
46276 }
46277
46278
46279 static int
46280 test_xmlTextWriterWriteDTDExternalEntity(void) {
46281     int test_ret = 0;
46282
46283 #if defined(LIBXML_WRITER_ENABLED)
46284     int mem_base;
46285     int ret_val;
46286     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46287     int n_writer;
46288     int pe; /* TRUE if this is a parameter entity, FALSE if not */
46289     int n_pe;
46290     xmlChar * name; /* the name of the DTD entity */
46291     int n_name;
46292     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
46293     int n_pubid;
46294     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
46295     int n_sysid;
46296     xmlChar * ndataid; /* the xml notation name. */
46297     int n_ndataid;
46298
46299     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46300     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
46301     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46302     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
46303     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
46304     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
46305         mem_base = xmlMemBlocks();
46306         writer = gen_xmlTextWriterPtr(n_writer, 0);
46307         pe = gen_int(n_pe, 1);
46308         name = gen_const_xmlChar_ptr(n_name, 2);
46309         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
46310         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
46311         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
46312
46313         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
46314         desret_int(ret_val);
46315         call_tests++;
46316         des_xmlTextWriterPtr(n_writer, writer, 0);
46317         des_int(n_pe, pe, 1);
46318         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
46319         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
46320         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
46321         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
46322         xmlResetLastError();
46323         if (mem_base != xmlMemBlocks()) {
46324             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
46325                    xmlMemBlocks() - mem_base);
46326             test_ret++;
46327             printf(" %d", n_writer);
46328             printf(" %d", n_pe);
46329             printf(" %d", n_name);
46330             printf(" %d", n_pubid);
46331             printf(" %d", n_sysid);
46332             printf(" %d", n_ndataid);
46333             printf("\n");
46334         }
46335     }
46336     }
46337     }
46338     }
46339     }
46340     }
46341     function_tests++;
46342 #endif
46343
46344     return(test_ret);
46345 }
46346
46347
46348 static int
46349 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
46350     int test_ret = 0;
46351
46352 #if defined(LIBXML_WRITER_ENABLED)
46353     int mem_base;
46354     int ret_val;
46355     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46356     int n_writer;
46357     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
46358     int n_pubid;
46359     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
46360     int n_sysid;
46361     xmlChar * ndataid; /* the xml notation name. */
46362     int n_ndataid;
46363
46364     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46365     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
46366     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
46367     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
46368         mem_base = xmlMemBlocks();
46369         writer = gen_xmlTextWriterPtr(n_writer, 0);
46370         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
46371         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
46372         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
46373
46374         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
46375         desret_int(ret_val);
46376         call_tests++;
46377         des_xmlTextWriterPtr(n_writer, writer, 0);
46378         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
46379         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
46380         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
46381         xmlResetLastError();
46382         if (mem_base != xmlMemBlocks()) {
46383             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
46384                    xmlMemBlocks() - mem_base);
46385             test_ret++;
46386             printf(" %d", n_writer);
46387             printf(" %d", n_pubid);
46388             printf(" %d", n_sysid);
46389             printf(" %d", n_ndataid);
46390             printf("\n");
46391         }
46392     }
46393     }
46394     }
46395     }
46396     function_tests++;
46397 #endif
46398
46399     return(test_ret);
46400 }
46401
46402
46403 static int
46404 test_xmlTextWriterWriteDTDInternalEntity(void) {
46405     int test_ret = 0;
46406
46407 #if defined(LIBXML_WRITER_ENABLED)
46408     int mem_base;
46409     int ret_val;
46410     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46411     int n_writer;
46412     int pe; /* TRUE if this is a parameter entity, FALSE if not */
46413     int n_pe;
46414     xmlChar * name; /* the name of the DTD entity */
46415     int n_name;
46416     xmlChar * content; /* content of the entity */
46417     int n_content;
46418
46419     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46420     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
46421     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46422     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46423         mem_base = xmlMemBlocks();
46424         writer = gen_xmlTextWriterPtr(n_writer, 0);
46425         pe = gen_int(n_pe, 1);
46426         name = gen_const_xmlChar_ptr(n_name, 2);
46427         content = gen_const_xmlChar_ptr(n_content, 3);
46428
46429         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
46430         desret_int(ret_val);
46431         call_tests++;
46432         des_xmlTextWriterPtr(n_writer, writer, 0);
46433         des_int(n_pe, pe, 1);
46434         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
46435         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
46436         xmlResetLastError();
46437         if (mem_base != xmlMemBlocks()) {
46438             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
46439                    xmlMemBlocks() - mem_base);
46440             test_ret++;
46441             printf(" %d", n_writer);
46442             printf(" %d", n_pe);
46443             printf(" %d", n_name);
46444             printf(" %d", n_content);
46445             printf("\n");
46446         }
46447     }
46448     }
46449     }
46450     }
46451     function_tests++;
46452 #endif
46453
46454     return(test_ret);
46455 }
46456
46457
46458 static int
46459 test_xmlTextWriterWriteDTDNotation(void) {
46460     int test_ret = 0;
46461
46462 #if defined(LIBXML_WRITER_ENABLED)
46463     int mem_base;
46464     int ret_val;
46465     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46466     int n_writer;
46467     xmlChar * name; /* the name of the xml notation */
46468     int n_name;
46469     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
46470     int n_pubid;
46471     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
46472     int n_sysid;
46473
46474     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46475     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46476     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
46477     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
46478         mem_base = xmlMemBlocks();
46479         writer = gen_xmlTextWriterPtr(n_writer, 0);
46480         name = gen_const_xmlChar_ptr(n_name, 1);
46481         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
46482         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
46483
46484         ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
46485         desret_int(ret_val);
46486         call_tests++;
46487         des_xmlTextWriterPtr(n_writer, writer, 0);
46488         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46489         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
46490         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
46491         xmlResetLastError();
46492         if (mem_base != xmlMemBlocks()) {
46493             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
46494                    xmlMemBlocks() - mem_base);
46495             test_ret++;
46496             printf(" %d", n_writer);
46497             printf(" %d", n_name);
46498             printf(" %d", n_pubid);
46499             printf(" %d", n_sysid);
46500             printf("\n");
46501         }
46502     }
46503     }
46504     }
46505     }
46506     function_tests++;
46507 #endif
46508
46509     return(test_ret);
46510 }
46511
46512
46513 static int
46514 test_xmlTextWriterWriteElement(void) {
46515     int test_ret = 0;
46516
46517 #if defined(LIBXML_WRITER_ENABLED)
46518     int mem_base;
46519     int ret_val;
46520     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46521     int n_writer;
46522     xmlChar * name; /* element name */
46523     int n_name;
46524     xmlChar * content; /* element content */
46525     int n_content;
46526
46527     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46528     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46529     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46530         mem_base = xmlMemBlocks();
46531         writer = gen_xmlTextWriterPtr(n_writer, 0);
46532         name = gen_const_xmlChar_ptr(n_name, 1);
46533         content = gen_const_xmlChar_ptr(n_content, 2);
46534
46535         ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
46536         desret_int(ret_val);
46537         call_tests++;
46538         des_xmlTextWriterPtr(n_writer, writer, 0);
46539         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46540         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
46541         xmlResetLastError();
46542         if (mem_base != xmlMemBlocks()) {
46543             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
46544                    xmlMemBlocks() - mem_base);
46545             test_ret++;
46546             printf(" %d", n_writer);
46547             printf(" %d", n_name);
46548             printf(" %d", n_content);
46549             printf("\n");
46550         }
46551     }
46552     }
46553     }
46554     function_tests++;
46555 #endif
46556
46557     return(test_ret);
46558 }
46559
46560
46561 static int
46562 test_xmlTextWriterWriteElementNS(void) {
46563     int test_ret = 0;
46564
46565 #if defined(LIBXML_WRITER_ENABLED)
46566     int mem_base;
46567     int ret_val;
46568     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46569     int n_writer;
46570     xmlChar * prefix; /* namespace prefix */
46571     int n_prefix;
46572     xmlChar * name; /* element local name */
46573     int n_name;
46574     xmlChar * namespaceURI; /* namespace URI */
46575     int n_namespaceURI;
46576     xmlChar * content; /* element content */
46577     int n_content;
46578
46579     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46580     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
46581     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46582     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
46583     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46584         mem_base = xmlMemBlocks();
46585         writer = gen_xmlTextWriterPtr(n_writer, 0);
46586         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
46587         name = gen_const_xmlChar_ptr(n_name, 2);
46588         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
46589         content = gen_const_xmlChar_ptr(n_content, 4);
46590
46591         ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
46592         desret_int(ret_val);
46593         call_tests++;
46594         des_xmlTextWriterPtr(n_writer, writer, 0);
46595         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
46596         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
46597         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
46598         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
46599         xmlResetLastError();
46600         if (mem_base != xmlMemBlocks()) {
46601             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
46602                    xmlMemBlocks() - mem_base);
46603             test_ret++;
46604             printf(" %d", n_writer);
46605             printf(" %d", n_prefix);
46606             printf(" %d", n_name);
46607             printf(" %d", n_namespaceURI);
46608             printf(" %d", n_content);
46609             printf("\n");
46610         }
46611     }
46612     }
46613     }
46614     }
46615     }
46616     function_tests++;
46617 #endif
46618
46619     return(test_ret);
46620 }
46621
46622
46623 static int
46624 test_xmlTextWriterWriteFormatAttribute(void) {
46625     int test_ret = 0;
46626
46627
46628     /* missing type support */
46629     return(test_ret);
46630 }
46631
46632
46633 static int
46634 test_xmlTextWriterWriteFormatAttributeNS(void) {
46635     int test_ret = 0;
46636
46637
46638     /* missing type support */
46639     return(test_ret);
46640 }
46641
46642
46643 static int
46644 test_xmlTextWriterWriteFormatCDATA(void) {
46645     int test_ret = 0;
46646
46647
46648     /* missing type support */
46649     return(test_ret);
46650 }
46651
46652
46653 static int
46654 test_xmlTextWriterWriteFormatComment(void) {
46655     int test_ret = 0;
46656
46657
46658     /* missing type support */
46659     return(test_ret);
46660 }
46661
46662
46663 static int
46664 test_xmlTextWriterWriteFormatDTD(void) {
46665     int test_ret = 0;
46666
46667
46668     /* missing type support */
46669     return(test_ret);
46670 }
46671
46672
46673 static int
46674 test_xmlTextWriterWriteFormatDTDAttlist(void) {
46675     int test_ret = 0;
46676
46677
46678     /* missing type support */
46679     return(test_ret);
46680 }
46681
46682
46683 static int
46684 test_xmlTextWriterWriteFormatDTDElement(void) {
46685     int test_ret = 0;
46686
46687
46688     /* missing type support */
46689     return(test_ret);
46690 }
46691
46692
46693 static int
46694 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
46695     int test_ret = 0;
46696
46697
46698     /* missing type support */
46699     return(test_ret);
46700 }
46701
46702
46703 static int
46704 test_xmlTextWriterWriteFormatElement(void) {
46705     int test_ret = 0;
46706
46707
46708     /* missing type support */
46709     return(test_ret);
46710 }
46711
46712
46713 static int
46714 test_xmlTextWriterWriteFormatElementNS(void) {
46715     int test_ret = 0;
46716
46717
46718     /* missing type support */
46719     return(test_ret);
46720 }
46721
46722
46723 static int
46724 test_xmlTextWriterWriteFormatPI(void) {
46725     int test_ret = 0;
46726
46727
46728     /* missing type support */
46729     return(test_ret);
46730 }
46731
46732
46733 static int
46734 test_xmlTextWriterWriteFormatRaw(void) {
46735     int test_ret = 0;
46736
46737
46738     /* missing type support */
46739     return(test_ret);
46740 }
46741
46742
46743 static int
46744 test_xmlTextWriterWriteFormatString(void) {
46745     int test_ret = 0;
46746
46747
46748     /* missing type support */
46749     return(test_ret);
46750 }
46751
46752
46753 static int
46754 test_xmlTextWriterWritePI(void) {
46755     int test_ret = 0;
46756
46757 #if defined(LIBXML_WRITER_ENABLED)
46758     int mem_base;
46759     int ret_val;
46760     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46761     int n_writer;
46762     xmlChar * target; /* PI target */
46763     int n_target;
46764     xmlChar * content; /* PI content */
46765     int n_content;
46766
46767     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46768     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
46769     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46770         mem_base = xmlMemBlocks();
46771         writer = gen_xmlTextWriterPtr(n_writer, 0);
46772         target = gen_const_xmlChar_ptr(n_target, 1);
46773         content = gen_const_xmlChar_ptr(n_content, 2);
46774
46775         ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
46776         desret_int(ret_val);
46777         call_tests++;
46778         des_xmlTextWriterPtr(n_writer, writer, 0);
46779         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
46780         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
46781         xmlResetLastError();
46782         if (mem_base != xmlMemBlocks()) {
46783             printf("Leak of %d blocks found in xmlTextWriterWritePI",
46784                    xmlMemBlocks() - mem_base);
46785             test_ret++;
46786             printf(" %d", n_writer);
46787             printf(" %d", n_target);
46788             printf(" %d", n_content);
46789             printf("\n");
46790         }
46791     }
46792     }
46793     }
46794     function_tests++;
46795 #endif
46796
46797     return(test_ret);
46798 }
46799
46800
46801 static int
46802 test_xmlTextWriterWriteRaw(void) {
46803     int test_ret = 0;
46804
46805 #if defined(LIBXML_WRITER_ENABLED)
46806     int mem_base;
46807     int ret_val;
46808     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46809     int n_writer;
46810     xmlChar * content; /* text string */
46811     int n_content;
46812
46813     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46814     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46815         mem_base = xmlMemBlocks();
46816         writer = gen_xmlTextWriterPtr(n_writer, 0);
46817         content = gen_const_xmlChar_ptr(n_content, 1);
46818
46819         ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
46820         desret_int(ret_val);
46821         call_tests++;
46822         des_xmlTextWriterPtr(n_writer, writer, 0);
46823         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
46824         xmlResetLastError();
46825         if (mem_base != xmlMemBlocks()) {
46826             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
46827                    xmlMemBlocks() - mem_base);
46828             test_ret++;
46829             printf(" %d", n_writer);
46830             printf(" %d", n_content);
46831             printf("\n");
46832         }
46833     }
46834     }
46835     function_tests++;
46836 #endif
46837
46838     return(test_ret);
46839 }
46840
46841
46842 static int
46843 test_xmlTextWriterWriteRawLen(void) {
46844     int test_ret = 0;
46845
46846 #if defined(LIBXML_WRITER_ENABLED)
46847     int mem_base;
46848     int ret_val;
46849     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46850     int n_writer;
46851     xmlChar * content; /* text string */
46852     int n_content;
46853     int len; /* length of the text string */
46854     int n_len;
46855
46856     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46857     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46858     for (n_len = 0;n_len < gen_nb_int;n_len++) {
46859         mem_base = xmlMemBlocks();
46860         writer = gen_xmlTextWriterPtr(n_writer, 0);
46861         content = gen_const_xmlChar_ptr(n_content, 1);
46862         len = gen_int(n_len, 2);
46863         if ((content != NULL) &&
46864             (len > (int) strlen((const char *) content) + 1))
46865             continue;
46866
46867         ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
46868         desret_int(ret_val);
46869         call_tests++;
46870         des_xmlTextWriterPtr(n_writer, writer, 0);
46871         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
46872         des_int(n_len, len, 2);
46873         xmlResetLastError();
46874         if (mem_base != xmlMemBlocks()) {
46875             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
46876                    xmlMemBlocks() - mem_base);
46877             test_ret++;
46878             printf(" %d", n_writer);
46879             printf(" %d", n_content);
46880             printf(" %d", n_len);
46881             printf("\n");
46882         }
46883     }
46884     }
46885     }
46886     function_tests++;
46887 #endif
46888
46889     return(test_ret);
46890 }
46891
46892
46893 static int
46894 test_xmlTextWriterWriteString(void) {
46895     int test_ret = 0;
46896
46897 #if defined(LIBXML_WRITER_ENABLED)
46898     int mem_base;
46899     int ret_val;
46900     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
46901     int n_writer;
46902     xmlChar * content; /* text string */
46903     int n_content;
46904
46905     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
46906     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
46907         mem_base = xmlMemBlocks();
46908         writer = gen_xmlTextWriterPtr(n_writer, 0);
46909         content = gen_const_xmlChar_ptr(n_content, 1);
46910
46911         ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
46912         desret_int(ret_val);
46913         call_tests++;
46914         des_xmlTextWriterPtr(n_writer, writer, 0);
46915         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
46916         xmlResetLastError();
46917         if (mem_base != xmlMemBlocks()) {
46918             printf("Leak of %d blocks found in xmlTextWriterWriteString",
46919                    xmlMemBlocks() - mem_base);
46920             test_ret++;
46921             printf(" %d", n_writer);
46922             printf(" %d", n_content);
46923             printf("\n");
46924         }
46925     }
46926     }
46927     function_tests++;
46928 #endif
46929
46930     return(test_ret);
46931 }
46932
46933
46934 static int
46935 test_xmlTextWriterWriteVFormatAttribute(void) {
46936     int test_ret = 0;
46937
46938
46939     /* missing type support */
46940     return(test_ret);
46941 }
46942
46943
46944 static int
46945 test_xmlTextWriterWriteVFormatAttributeNS(void) {
46946     int test_ret = 0;
46947
46948
46949     /* missing type support */
46950     return(test_ret);
46951 }
46952
46953
46954 static int
46955 test_xmlTextWriterWriteVFormatCDATA(void) {
46956     int test_ret = 0;
46957
46958
46959     /* missing type support */
46960     return(test_ret);
46961 }
46962
46963
46964 static int
46965 test_xmlTextWriterWriteVFormatComment(void) {
46966     int test_ret = 0;
46967
46968
46969     /* missing type support */
46970     return(test_ret);
46971 }
46972
46973
46974 static int
46975 test_xmlTextWriterWriteVFormatDTD(void) {
46976     int test_ret = 0;
46977
46978
46979     /* missing type support */
46980     return(test_ret);
46981 }
46982
46983
46984 static int
46985 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
46986     int test_ret = 0;
46987
46988
46989     /* missing type support */
46990     return(test_ret);
46991 }
46992
46993
46994 static int
46995 test_xmlTextWriterWriteVFormatDTDElement(void) {
46996     int test_ret = 0;
46997
46998
46999     /* missing type support */
47000     return(test_ret);
47001 }
47002
47003
47004 static int
47005 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
47006     int test_ret = 0;
47007
47008
47009     /* missing type support */
47010     return(test_ret);
47011 }
47012
47013
47014 static int
47015 test_xmlTextWriterWriteVFormatElement(void) {
47016     int test_ret = 0;
47017
47018
47019     /* missing type support */
47020     return(test_ret);
47021 }
47022
47023
47024 static int
47025 test_xmlTextWriterWriteVFormatElementNS(void) {
47026     int test_ret = 0;
47027
47028
47029     /* missing type support */
47030     return(test_ret);
47031 }
47032
47033
47034 static int
47035 test_xmlTextWriterWriteVFormatPI(void) {
47036     int test_ret = 0;
47037
47038
47039     /* missing type support */
47040     return(test_ret);
47041 }
47042
47043
47044 static int
47045 test_xmlTextWriterWriteVFormatRaw(void) {
47046     int test_ret = 0;
47047
47048
47049     /* missing type support */
47050     return(test_ret);
47051 }
47052
47053
47054 static int
47055 test_xmlTextWriterWriteVFormatString(void) {
47056     int test_ret = 0;
47057
47058
47059     /* missing type support */
47060     return(test_ret);
47061 }
47062
47063 static int
47064 test_xmlwriter(void) {
47065     int test_ret = 0;
47066         int rc = 0;
47067
47068     if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
47069     rc = test_xmlNewTextWriter();
47070         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47071     rc = test_xmlNewTextWriterFilename();
47072         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47073     rc = test_xmlNewTextWriterMemory();
47074         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47075     rc = test_xmlNewTextWriterPushParser();
47076         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47077     rc = test_xmlNewTextWriterTree();
47078         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47079     rc = test_xmlTextWriterEndAttribute();
47080         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47081     rc = test_xmlTextWriterEndCDATA();
47082         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47083     rc = test_xmlTextWriterEndComment();
47084         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47085     rc = test_xmlTextWriterEndDTD();
47086         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47087     rc = test_xmlTextWriterEndDTDAttlist();
47088         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47089     rc = test_xmlTextWriterEndDTDElement();
47090         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47091     rc = test_xmlTextWriterEndDTDEntity();
47092         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47093     rc = test_xmlTextWriterEndDocument();
47094         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47095     rc = test_xmlTextWriterEndElement();
47096         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47097     rc = test_xmlTextWriterEndPI();
47098         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47099     rc = test_xmlTextWriterFlush();
47100         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47101     rc = test_xmlTextWriterFullEndElement();
47102         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47103     rc = test_xmlTextWriterSetIndent();
47104         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47105     rc = test_xmlTextWriterSetIndentString();
47106         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47107     rc = test_xmlTextWriterSetQuoteChar();
47108         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47109     rc = test_xmlTextWriterStartAttribute();
47110         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47111     rc = test_xmlTextWriterStartAttributeNS();
47112         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47113     rc = test_xmlTextWriterStartCDATA();
47114         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47115     rc = test_xmlTextWriterStartComment();
47116         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47117     rc = test_xmlTextWriterStartDTD();
47118         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47119     rc = test_xmlTextWriterStartDTDAttlist();
47120         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47121     rc = test_xmlTextWriterStartDTDElement();
47122         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47123     rc = test_xmlTextWriterStartDTDEntity();
47124         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47125     rc = test_xmlTextWriterStartDocument();
47126         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47127     rc = test_xmlTextWriterStartElement();
47128         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47129     rc = test_xmlTextWriterStartElementNS();
47130         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47131     rc = test_xmlTextWriterStartPI();
47132         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47133     rc = test_xmlTextWriterWriteAttribute();
47134         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47135     rc = test_xmlTextWriterWriteAttributeNS();
47136         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47137     rc = test_xmlTextWriterWriteBase64();
47138         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47139     rc = test_xmlTextWriterWriteBinHex();
47140         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47141     rc = test_xmlTextWriterWriteCDATA();
47142         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47143     rc = test_xmlTextWriterWriteComment();
47144         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47145     rc = test_xmlTextWriterWriteDTD();
47146         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47147     rc = test_xmlTextWriterWriteDTDAttlist();
47148         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47149     rc = test_xmlTextWriterWriteDTDElement();
47150         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47151     rc = test_xmlTextWriterWriteDTDEntity();
47152         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47153     rc = test_xmlTextWriterWriteDTDExternalEntity();
47154         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47155     rc = test_xmlTextWriterWriteDTDExternalEntityContents();
47156         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47157     rc = test_xmlTextWriterWriteDTDInternalEntity();
47158         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47159     rc = test_xmlTextWriterWriteDTDNotation();
47160         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47161     rc = test_xmlTextWriterWriteElement();
47162         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47163     rc = test_xmlTextWriterWriteElementNS();
47164         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47165     rc = test_xmlTextWriterWriteFormatAttribute();
47166         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47167     rc = test_xmlTextWriterWriteFormatAttributeNS();
47168         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47169     rc = test_xmlTextWriterWriteFormatCDATA();
47170         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47171     rc = test_xmlTextWriterWriteFormatComment();
47172         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47173     rc = test_xmlTextWriterWriteFormatDTD();
47174         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47175     rc = test_xmlTextWriterWriteFormatDTDAttlist();
47176         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47177     rc = test_xmlTextWriterWriteFormatDTDElement();
47178         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47179     rc = test_xmlTextWriterWriteFormatDTDInternalEntity();
47180         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47181     rc = test_xmlTextWriterWriteFormatElement();
47182         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47183     rc = test_xmlTextWriterWriteFormatElementNS();
47184         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47185     rc = test_xmlTextWriterWriteFormatPI();
47186         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47187     rc = test_xmlTextWriterWriteFormatRaw();
47188         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47189     rc = test_xmlTextWriterWriteFormatString();
47190         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47191     rc = test_xmlTextWriterWritePI();
47192         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47193     rc = test_xmlTextWriterWriteRaw();
47194         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47195     rc = test_xmlTextWriterWriteRawLen();
47196         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47197     rc = test_xmlTextWriterWriteString();
47198         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47199     rc = test_xmlTextWriterWriteVFormatAttribute();
47200         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47201     rc = test_xmlTextWriterWriteVFormatAttributeNS();
47202         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47203     rc = test_xmlTextWriterWriteVFormatCDATA();
47204         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47205     rc = test_xmlTextWriterWriteVFormatComment();
47206         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47207     rc = test_xmlTextWriterWriteVFormatDTD();
47208         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47209     rc = test_xmlTextWriterWriteVFormatDTDAttlist();
47210         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47211     rc = test_xmlTextWriterWriteVFormatDTDElement();
47212         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47213     rc = test_xmlTextWriterWriteVFormatDTDInternalEntity();
47214         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47215     rc = test_xmlTextWriterWriteVFormatElement();
47216         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47217     rc = test_xmlTextWriterWriteVFormatElementNS();
47218         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47219     rc = test_xmlTextWriterWriteVFormatPI();
47220         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47221     rc = test_xmlTextWriterWriteVFormatRaw();
47222         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47223     rc = test_xmlTextWriterWriteVFormatString();
47224         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
47225
47226     if (test_ret != 0)
47227         printf("Module xmlwriter: %d errors\n", test_ret);
47228     return(test_ret);
47229 }
47230
47231 static int
47232 test_xmlXPathCastBooleanToNumber(void) {
47233     int test_ret = 0;
47234
47235 #if defined(LIBXML_XPATH_ENABLED)
47236     int mem_base;
47237     double ret_val;
47238     int val; /* a boolean */
47239     int n_val;
47240
47241     for (n_val = 0;n_val < gen_nb_int;n_val++) {
47242         mem_base = xmlMemBlocks();
47243         val = gen_int(n_val, 0);
47244
47245         ret_val = xmlXPathCastBooleanToNumber(val);
47246         desret_double(ret_val);
47247         call_tests++;
47248         des_int(n_val, val, 0);
47249         xmlResetLastError();
47250         if (mem_base != xmlMemBlocks()) {
47251             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
47252                    xmlMemBlocks() - mem_base);
47253             test_ret++;
47254             printf(" %d", n_val);
47255             printf("\n");
47256         }
47257     }
47258     function_tests++;
47259 #endif
47260
47261     return(test_ret);
47262 }
47263
47264
47265 static int
47266 test_xmlXPathCastBooleanToString(void) {
47267     int test_ret = 0;
47268
47269 #if defined(LIBXML_XPATH_ENABLED)
47270     int mem_base;
47271     xmlChar * ret_val;
47272     int val; /* a boolean */
47273     int n_val;
47274
47275     for (n_val = 0;n_val < gen_nb_int;n_val++) {
47276         mem_base = xmlMemBlocks();
47277         val = gen_int(n_val, 0);
47278
47279         ret_val = xmlXPathCastBooleanToString(val);
47280         desret_xmlChar_ptr(ret_val);
47281         call_tests++;
47282         des_int(n_val, val, 0);
47283         xmlResetLastError();
47284         if (mem_base != xmlMemBlocks()) {
47285             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
47286                    xmlMemBlocks() - mem_base);
47287             test_ret++;
47288             printf(" %d", n_val);
47289             printf("\n");
47290         }
47291     }
47292     function_tests++;
47293 #endif
47294
47295     return(test_ret);
47296 }
47297
47298
47299 static int
47300 test_xmlXPathCastNodeSetToBoolean(void) {
47301     int test_ret = 0;
47302
47303 #if defined(LIBXML_XPATH_ENABLED)
47304     int mem_base;
47305     int ret_val;
47306     xmlNodeSetPtr ns; /* a node-set */
47307     int n_ns;
47308
47309     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
47310         mem_base = xmlMemBlocks();
47311         ns = gen_xmlNodeSetPtr(n_ns, 0);
47312
47313         ret_val = xmlXPathCastNodeSetToBoolean(ns);
47314         desret_int(ret_val);
47315         call_tests++;
47316         des_xmlNodeSetPtr(n_ns, ns, 0);
47317         xmlResetLastError();
47318         if (mem_base != xmlMemBlocks()) {
47319             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
47320                    xmlMemBlocks() - mem_base);
47321             test_ret++;
47322             printf(" %d", n_ns);
47323             printf("\n");
47324         }
47325     }
47326     function_tests++;
47327 #endif
47328
47329     return(test_ret);
47330 }
47331
47332
47333 static int
47334 test_xmlXPathCastNodeSetToNumber(void) {
47335     int test_ret = 0;
47336
47337 #if defined(LIBXML_XPATH_ENABLED)
47338     int mem_base;
47339     double ret_val;
47340     xmlNodeSetPtr ns; /* a node-set */
47341     int n_ns;
47342
47343     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
47344         mem_base = xmlMemBlocks();
47345         ns = gen_xmlNodeSetPtr(n_ns, 0);
47346
47347         ret_val = xmlXPathCastNodeSetToNumber(ns);
47348         desret_double(ret_val);
47349         call_tests++;
47350         des_xmlNodeSetPtr(n_ns, ns, 0);
47351         xmlResetLastError();
47352         if (mem_base != xmlMemBlocks()) {
47353             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
47354                    xmlMemBlocks() - mem_base);
47355             test_ret++;
47356             printf(" %d", n_ns);
47357             printf("\n");
47358         }
47359     }
47360     function_tests++;
47361 #endif
47362
47363     return(test_ret);
47364 }
47365
47366
47367 static int
47368 test_xmlXPathCastNodeSetToString(void) {
47369     int test_ret = 0;
47370
47371 #if defined(LIBXML_XPATH_ENABLED)
47372     int mem_base;
47373     xmlChar * ret_val;
47374     xmlNodeSetPtr ns; /* a node-set */
47375     int n_ns;
47376
47377     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
47378         mem_base = xmlMemBlocks();
47379         ns = gen_xmlNodeSetPtr(n_ns, 0);
47380
47381         ret_val = xmlXPathCastNodeSetToString(ns);
47382         desret_xmlChar_ptr(ret_val);
47383         call_tests++;
47384         des_xmlNodeSetPtr(n_ns, ns, 0);
47385         xmlResetLastError();
47386         if (mem_base != xmlMemBlocks()) {
47387             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
47388                    xmlMemBlocks() - mem_base);
47389             test_ret++;
47390             printf(" %d", n_ns);
47391             printf("\n");
47392         }
47393     }
47394     function_tests++;
47395 #endif
47396
47397     return(test_ret);
47398 }
47399
47400
47401 static int
47402 test_xmlXPathCastNodeToNumber(void) {
47403     int test_ret = 0;
47404
47405 #if defined(LIBXML_XPATH_ENABLED)
47406     int mem_base;
47407     double ret_val;
47408     xmlNodePtr node; /* a node */
47409     int n_node;
47410
47411     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47412         mem_base = xmlMemBlocks();
47413         node = gen_xmlNodePtr(n_node, 0);
47414
47415         ret_val = xmlXPathCastNodeToNumber(node);
47416         desret_double(ret_val);
47417         call_tests++;
47418         des_xmlNodePtr(n_node, node, 0);
47419         xmlResetLastError();
47420         if (mem_base != xmlMemBlocks()) {
47421             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
47422                    xmlMemBlocks() - mem_base);
47423             test_ret++;
47424             printf(" %d", n_node);
47425             printf("\n");
47426         }
47427     }
47428     function_tests++;
47429 #endif
47430
47431     return(test_ret);
47432 }
47433
47434
47435 static int
47436 test_xmlXPathCastNodeToString(void) {
47437     int test_ret = 0;
47438
47439 #if defined(LIBXML_XPATH_ENABLED)
47440     int mem_base;
47441     xmlChar * ret_val;
47442     xmlNodePtr node; /* a node */
47443     int n_node;
47444
47445     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
47446         mem_base = xmlMemBlocks();
47447         node = gen_xmlNodePtr(n_node, 0);
47448
47449         ret_val = xmlXPathCastNodeToString(node);
47450         desret_xmlChar_ptr(ret_val);
47451         call_tests++;
47452         des_xmlNodePtr(n_node, node, 0);
47453         xmlResetLastError();
47454         if (mem_base != xmlMemBlocks()) {
47455             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
47456                    xmlMemBlocks() - mem_base);
47457             test_ret++;
47458             printf(" %d", n_node);
47459             printf("\n");
47460         }
47461     }
47462     function_tests++;
47463 #endif
47464
47465     return(test_ret);
47466 }
47467
47468
47469 static int
47470 test_xmlXPathCastNumberToBoolean(void) {
47471     int test_ret = 0;
47472
47473 #if defined(LIBXML_XPATH_ENABLED)
47474     int mem_base;
47475     int ret_val;
47476     double val; /* a number */
47477     int n_val;
47478
47479     for (n_val = 0;n_val < gen_nb_double;n_val++) {
47480         mem_base = xmlMemBlocks();
47481         val = gen_double(n_val, 0);
47482
47483         ret_val = xmlXPathCastNumberToBoolean(val);
47484         desret_int(ret_val);
47485         call_tests++;
47486         des_double(n_val, val, 0);
47487         xmlResetLastError();
47488         if (mem_base != xmlMemBlocks()) {
47489             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
47490                    xmlMemBlocks() - mem_base);
47491             test_ret++;
47492             printf(" %d", n_val);
47493             printf("\n");
47494         }
47495     }
47496     function_tests++;
47497 #endif
47498
47499     return(test_ret);
47500 }
47501
47502
47503 static int
47504 test_xmlXPathCastNumberToString(void) {
47505     int test_ret = 0;
47506
47507 #if defined(LIBXML_XPATH_ENABLED)
47508     int mem_base;
47509     xmlChar * ret_val;
47510     double val; /* a number */
47511     int n_val;
47512
47513     for (n_val = 0;n_val < gen_nb_double;n_val++) {
47514         mem_base = xmlMemBlocks();
47515         val = gen_double(n_val, 0);
47516
47517         ret_val = xmlXPathCastNumberToString(val);
47518         desret_xmlChar_ptr(ret_val);
47519         call_tests++;
47520         des_double(n_val, val, 0);
47521         xmlResetLastError();
47522         if (mem_base != xmlMemBlocks()) {
47523             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
47524                    xmlMemBlocks() - mem_base);
47525             test_ret++;
47526             printf(" %d", n_val);
47527             printf("\n");
47528         }
47529     }
47530     function_tests++;
47531 #endif
47532
47533     return(test_ret);
47534 }
47535
47536
47537 static int
47538 test_xmlXPathCastStringToBoolean(void) {
47539     int test_ret = 0;
47540
47541 #if defined(LIBXML_XPATH_ENABLED)
47542     int mem_base;
47543     int ret_val;
47544     xmlChar * val; /* a string */
47545     int n_val;
47546
47547     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47548         mem_base = xmlMemBlocks();
47549         val = gen_const_xmlChar_ptr(n_val, 0);
47550
47551         ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
47552         desret_int(ret_val);
47553         call_tests++;
47554         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47555         xmlResetLastError();
47556         if (mem_base != xmlMemBlocks()) {
47557             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
47558                    xmlMemBlocks() - mem_base);
47559             test_ret++;
47560             printf(" %d", n_val);
47561             printf("\n");
47562         }
47563     }
47564     function_tests++;
47565 #endif
47566
47567     return(test_ret);
47568 }
47569
47570
47571 static int
47572 test_xmlXPathCastStringToNumber(void) {
47573     int test_ret = 0;
47574
47575 #if defined(LIBXML_XPATH_ENABLED)
47576     int mem_base;
47577     double ret_val;
47578     xmlChar * val; /* a string */
47579     int n_val;
47580
47581     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47582         mem_base = xmlMemBlocks();
47583         val = gen_const_xmlChar_ptr(n_val, 0);
47584
47585         ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
47586         desret_double(ret_val);
47587         call_tests++;
47588         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47589         xmlResetLastError();
47590         if (mem_base != xmlMemBlocks()) {
47591             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
47592                    xmlMemBlocks() - mem_base);
47593             test_ret++;
47594             printf(" %d", n_val);
47595             printf("\n");
47596         }
47597     }
47598     function_tests++;
47599 #endif
47600
47601     return(test_ret);
47602 }
47603
47604
47605 static int
47606 test_xmlXPathCastToBoolean(void) {
47607     int test_ret = 0;
47608
47609 #if defined(LIBXML_XPATH_ENABLED)
47610     int mem_base;
47611     int ret_val;
47612     xmlXPathObjectPtr val; /* an XPath object */
47613     int n_val;
47614
47615     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47616         mem_base = xmlMemBlocks();
47617         val = gen_xmlXPathObjectPtr(n_val, 0);
47618
47619         ret_val = xmlXPathCastToBoolean(val);
47620         desret_int(ret_val);
47621         call_tests++;
47622         des_xmlXPathObjectPtr(n_val, val, 0);
47623         xmlResetLastError();
47624         if (mem_base != xmlMemBlocks()) {
47625             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
47626                    xmlMemBlocks() - mem_base);
47627             test_ret++;
47628             printf(" %d", n_val);
47629             printf("\n");
47630         }
47631     }
47632     function_tests++;
47633 #endif
47634
47635     return(test_ret);
47636 }
47637
47638
47639 static int
47640 test_xmlXPathCastToNumber(void) {
47641     int test_ret = 0;
47642
47643 #if defined(LIBXML_XPATH_ENABLED)
47644     int mem_base;
47645     double ret_val;
47646     xmlXPathObjectPtr val; /* an XPath object */
47647     int n_val;
47648
47649     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47650         mem_base = xmlMemBlocks();
47651         val = gen_xmlXPathObjectPtr(n_val, 0);
47652
47653         ret_val = xmlXPathCastToNumber(val);
47654         desret_double(ret_val);
47655         call_tests++;
47656         des_xmlXPathObjectPtr(n_val, val, 0);
47657         xmlResetLastError();
47658         if (mem_base != xmlMemBlocks()) {
47659             printf("Leak of %d blocks found in xmlXPathCastToNumber",
47660                    xmlMemBlocks() - mem_base);
47661             test_ret++;
47662             printf(" %d", n_val);
47663             printf("\n");
47664         }
47665     }
47666     function_tests++;
47667 #endif
47668
47669     return(test_ret);
47670 }
47671
47672
47673 static int
47674 test_xmlXPathCastToString(void) {
47675     int test_ret = 0;
47676
47677 #if defined(LIBXML_XPATH_ENABLED)
47678     int mem_base;
47679     xmlChar * ret_val;
47680     xmlXPathObjectPtr val; /* an XPath object */
47681     int n_val;
47682
47683     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47684         mem_base = xmlMemBlocks();
47685         val = gen_xmlXPathObjectPtr(n_val, 0);
47686
47687         ret_val = xmlXPathCastToString(val);
47688         desret_xmlChar_ptr(ret_val);
47689         call_tests++;
47690         des_xmlXPathObjectPtr(n_val, val, 0);
47691         xmlResetLastError();
47692         if (mem_base != xmlMemBlocks()) {
47693             printf("Leak of %d blocks found in xmlXPathCastToString",
47694                    xmlMemBlocks() - mem_base);
47695             test_ret++;
47696             printf(" %d", n_val);
47697             printf("\n");
47698         }
47699     }
47700     function_tests++;
47701 #endif
47702
47703     return(test_ret);
47704 }
47705
47706
47707 static int
47708 test_xmlXPathCmpNodes(void) {
47709     int test_ret = 0;
47710
47711 #if defined(LIBXML_XPATH_ENABLED)
47712     int mem_base;
47713     int ret_val;
47714     xmlNodePtr node1; /* the first node */
47715     int n_node1;
47716     xmlNodePtr node2; /* the second node */
47717     int n_node2;
47718
47719     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
47720     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
47721         mem_base = xmlMemBlocks();
47722         node1 = gen_xmlNodePtr(n_node1, 0);
47723         node2 = gen_xmlNodePtr(n_node2, 1);
47724
47725         ret_val = xmlXPathCmpNodes(node1, node2);
47726         desret_int(ret_val);
47727         call_tests++;
47728         des_xmlNodePtr(n_node1, node1, 0);
47729         des_xmlNodePtr(n_node2, node2, 1);
47730         xmlResetLastError();
47731         if (mem_base != xmlMemBlocks()) {
47732             printf("Leak of %d blocks found in xmlXPathCmpNodes",
47733                    xmlMemBlocks() - mem_base);
47734             test_ret++;
47735             printf(" %d", n_node1);
47736             printf(" %d", n_node2);
47737             printf("\n");
47738         }
47739     }
47740     }
47741     function_tests++;
47742 #endif
47743
47744     return(test_ret);
47745 }
47746
47747
47748 static int
47749 test_xmlXPathCompile(void) {
47750     int test_ret = 0;
47751
47752
47753     /* missing type support */
47754     return(test_ret);
47755 }
47756
47757 #ifdef LIBXML_XPATH_ENABLED
47758
47759 #define gen_nb_xmlXPathCompExprPtr 1
47760 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47761     return(NULL);
47762 }
47763 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47764 }
47765 #endif
47766
47767 #ifdef LIBXML_XPATH_ENABLED
47768
47769 #define gen_nb_xmlXPathContextPtr 1
47770 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47771     return(NULL);
47772 }
47773 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47774 }
47775 #endif
47776
47777
47778 static int
47779 test_xmlXPathCompiledEval(void) {
47780     int test_ret = 0;
47781
47782 #if defined(LIBXML_XPATH_ENABLED)
47783     int mem_base;
47784     xmlXPathObjectPtr ret_val;
47785     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
47786     int n_comp;
47787     xmlXPathContextPtr ctx; /* the XPath context */
47788     int n_ctx;
47789
47790     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47791     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47792         mem_base = xmlMemBlocks();
47793         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
47794         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47795
47796         ret_val = xmlXPathCompiledEval(comp, ctx);
47797         desret_xmlXPathObjectPtr(ret_val);
47798         call_tests++;
47799         des_xmlXPathCompExprPtr(n_comp, comp, 0);
47800         des_xmlXPathContextPtr(n_ctx, ctx, 1);
47801         xmlResetLastError();
47802         if (mem_base != xmlMemBlocks()) {
47803             printf("Leak of %d blocks found in xmlXPathCompiledEval",
47804                    xmlMemBlocks() - mem_base);
47805             test_ret++;
47806             printf(" %d", n_comp);
47807             printf(" %d", n_ctx);
47808             printf("\n");
47809         }
47810     }
47811     }
47812     function_tests++;
47813 #endif
47814
47815     return(test_ret);
47816 }
47817
47818
47819 static int
47820 test_xmlXPathCompiledEvalToBoolean(void) {
47821     int test_ret = 0;
47822
47823 #if defined(LIBXML_XPATH_ENABLED)
47824     int mem_base;
47825     int ret_val;
47826     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
47827     int n_comp;
47828     xmlXPathContextPtr ctxt; /* the XPath context */
47829     int n_ctxt;
47830
47831     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47832     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47833         mem_base = xmlMemBlocks();
47834         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
47835         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
47836
47837         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
47838         desret_int(ret_val);
47839         call_tests++;
47840         des_xmlXPathCompExprPtr(n_comp, comp, 0);
47841         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
47842         xmlResetLastError();
47843         if (mem_base != xmlMemBlocks()) {
47844             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
47845                    xmlMemBlocks() - mem_base);
47846             test_ret++;
47847             printf(" %d", n_comp);
47848             printf(" %d", n_ctxt);
47849             printf("\n");
47850         }
47851     }
47852     }
47853     function_tests++;
47854 #endif
47855
47856     return(test_ret);
47857 }
47858
47859
47860 static int
47861 test_xmlXPathContextSetCache(void) {
47862     int test_ret = 0;
47863
47864 #if defined(LIBXML_XPATH_ENABLED)
47865     int mem_base;
47866     int ret_val;
47867     xmlXPathContextPtr ctxt; /* the XPath context */
47868     int n_ctxt;
47869     int active; /* enables/disables (creates/frees) the cache */
47870     int n_active;
47871     int value; /* a value with semantics dependant on @options */
47872     int n_value;
47873     int options; /* options (currently only the value 0 is used) */
47874     int n_options;
47875
47876     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47877     for (n_active = 0;n_active < gen_nb_int;n_active++) {
47878     for (n_value = 0;n_value < gen_nb_int;n_value++) {
47879     for (n_options = 0;n_options < gen_nb_int;n_options++) {
47880         mem_base = xmlMemBlocks();
47881         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47882         active = gen_int(n_active, 1);
47883         value = gen_int(n_value, 2);
47884         options = gen_int(n_options, 3);
47885
47886         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
47887         desret_int(ret_val);
47888         call_tests++;
47889         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47890         des_int(n_active, active, 1);
47891         des_int(n_value, value, 2);
47892         des_int(n_options, options, 3);
47893         xmlResetLastError();
47894         if (mem_base != xmlMemBlocks()) {
47895             printf("Leak of %d blocks found in xmlXPathContextSetCache",
47896                    xmlMemBlocks() - mem_base);
47897             test_ret++;
47898             printf(" %d", n_ctxt);
47899             printf(" %d", n_active);
47900             printf(" %d", n_value);
47901             printf(" %d", n_options);
47902             printf("\n");
47903         }
47904     }
47905     }
47906     }
47907     }
47908     function_tests++;
47909 #endif
47910
47911     return(test_ret);
47912 }
47913
47914
47915 static int
47916 test_xmlXPathConvertBoolean(void) {
47917     int test_ret = 0;
47918
47919 #if defined(LIBXML_XPATH_ENABLED)
47920     int mem_base;
47921     xmlXPathObjectPtr ret_val;
47922     xmlXPathObjectPtr val; /* an XPath object */
47923     int n_val;
47924
47925     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47926         mem_base = xmlMemBlocks();
47927         val = gen_xmlXPathObjectPtr(n_val, 0);
47928
47929         ret_val = xmlXPathConvertBoolean(val);
47930         val = NULL;
47931         desret_xmlXPathObjectPtr(ret_val);
47932         call_tests++;
47933         des_xmlXPathObjectPtr(n_val, val, 0);
47934         xmlResetLastError();
47935         if (mem_base != xmlMemBlocks()) {
47936             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
47937                    xmlMemBlocks() - mem_base);
47938             test_ret++;
47939             printf(" %d", n_val);
47940             printf("\n");
47941         }
47942     }
47943     function_tests++;
47944 #endif
47945
47946     return(test_ret);
47947 }
47948
47949
47950 static int
47951 test_xmlXPathConvertNumber(void) {
47952     int test_ret = 0;
47953
47954 #if defined(LIBXML_XPATH_ENABLED)
47955     int mem_base;
47956     xmlXPathObjectPtr ret_val;
47957     xmlXPathObjectPtr val; /* an XPath object */
47958     int n_val;
47959
47960     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47961         mem_base = xmlMemBlocks();
47962         val = gen_xmlXPathObjectPtr(n_val, 0);
47963
47964         ret_val = xmlXPathConvertNumber(val);
47965         val = NULL;
47966         desret_xmlXPathObjectPtr(ret_val);
47967         call_tests++;
47968         des_xmlXPathObjectPtr(n_val, val, 0);
47969         xmlResetLastError();
47970         if (mem_base != xmlMemBlocks()) {
47971             printf("Leak of %d blocks found in xmlXPathConvertNumber",
47972                    xmlMemBlocks() - mem_base);
47973             test_ret++;
47974             printf(" %d", n_val);
47975             printf("\n");
47976         }
47977     }
47978     function_tests++;
47979 #endif
47980
47981     return(test_ret);
47982 }
47983
47984
47985 static int
47986 test_xmlXPathConvertString(void) {
47987     int test_ret = 0;
47988
47989 #if defined(LIBXML_XPATH_ENABLED)
47990     int mem_base;
47991     xmlXPathObjectPtr ret_val;
47992     xmlXPathObjectPtr val; /* an XPath object */
47993     int n_val;
47994
47995     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47996         mem_base = xmlMemBlocks();
47997         val = gen_xmlXPathObjectPtr(n_val, 0);
47998
47999         ret_val = xmlXPathConvertString(val);
48000         val = NULL;
48001         desret_xmlXPathObjectPtr(ret_val);
48002         call_tests++;
48003         des_xmlXPathObjectPtr(n_val, val, 0);
48004         xmlResetLastError();
48005         if (mem_base != xmlMemBlocks()) {
48006             printf("Leak of %d blocks found in xmlXPathConvertString",
48007                    xmlMemBlocks() - mem_base);
48008             test_ret++;
48009             printf(" %d", n_val);
48010             printf("\n");
48011         }
48012     }
48013     function_tests++;
48014 #endif
48015
48016     return(test_ret);
48017 }
48018
48019
48020 static int
48021 test_xmlXPathCtxtCompile(void) {
48022     int test_ret = 0;
48023
48024
48025     /* missing type support */
48026     return(test_ret);
48027 }
48028
48029
48030 static int
48031 test_xmlXPathEval(void) {
48032     int test_ret = 0;
48033
48034 #if defined(LIBXML_XPATH_ENABLED)
48035     int mem_base;
48036     xmlXPathObjectPtr ret_val;
48037     xmlChar * str; /* the XPath expression */
48038     int n_str;
48039     xmlXPathContextPtr ctx; /* the XPath context */
48040     int n_ctx;
48041
48042     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
48043     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
48044         mem_base = xmlMemBlocks();
48045         str = gen_const_xmlChar_ptr(n_str, 0);
48046         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
48047
48048         ret_val = xmlXPathEval((const xmlChar *)str, ctx);
48049         desret_xmlXPathObjectPtr(ret_val);
48050         call_tests++;
48051         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
48052         des_xmlXPathContextPtr(n_ctx, ctx, 1);
48053         xmlResetLastError();
48054         if (mem_base != xmlMemBlocks()) {
48055             printf("Leak of %d blocks found in xmlXPathEval",
48056                    xmlMemBlocks() - mem_base);
48057             test_ret++;
48058             printf(" %d", n_str);
48059             printf(" %d", n_ctx);
48060             printf("\n");
48061         }
48062     }
48063     }
48064     function_tests++;
48065 #endif
48066
48067     return(test_ret);
48068 }
48069
48070
48071 static int
48072 test_xmlXPathEvalExpression(void) {
48073     int test_ret = 0;
48074
48075 #if defined(LIBXML_XPATH_ENABLED)
48076     int mem_base;
48077     xmlXPathObjectPtr ret_val;
48078     xmlChar * str; /* the XPath expression */
48079     int n_str;
48080     xmlXPathContextPtr ctxt; /* the XPath context */
48081     int n_ctxt;
48082
48083     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
48084     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48085         mem_base = xmlMemBlocks();
48086         str = gen_const_xmlChar_ptr(n_str, 0);
48087         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
48088
48089         ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
48090         desret_xmlXPathObjectPtr(ret_val);
48091         call_tests++;
48092         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
48093         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
48094         xmlResetLastError();
48095         if (mem_base != xmlMemBlocks()) {
48096             printf("Leak of %d blocks found in xmlXPathEvalExpression",
48097                    xmlMemBlocks() - mem_base);
48098             test_ret++;
48099             printf(" %d", n_str);
48100             printf(" %d", n_ctxt);
48101             printf("\n");
48102         }
48103     }
48104     }
48105     function_tests++;
48106 #endif
48107
48108     return(test_ret);
48109 }
48110
48111
48112 static int
48113 test_xmlXPathEvalPredicate(void) {
48114     int test_ret = 0;
48115
48116 #if defined(LIBXML_XPATH_ENABLED)
48117     int mem_base;
48118     int ret_val;
48119     xmlXPathContextPtr ctxt; /* the XPath context */
48120     int n_ctxt;
48121     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
48122     int n_res;
48123
48124     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48125     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
48126         mem_base = xmlMemBlocks();
48127         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48128         res = gen_xmlXPathObjectPtr(n_res, 1);
48129
48130         ret_val = xmlXPathEvalPredicate(ctxt, res);
48131         desret_int(ret_val);
48132         call_tests++;
48133         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48134         des_xmlXPathObjectPtr(n_res, res, 1);
48135         xmlResetLastError();
48136         if (mem_base != xmlMemBlocks()) {
48137             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
48138                    xmlMemBlocks() - mem_base);
48139             test_ret++;
48140             printf(" %d", n_ctxt);
48141             printf(" %d", n_res);
48142             printf("\n");
48143         }
48144     }
48145     }
48146     function_tests++;
48147 #endif
48148
48149     return(test_ret);
48150 }
48151
48152
48153 static int
48154 test_xmlXPathInit(void) {
48155     int test_ret = 0;
48156
48157 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
48158     int mem_base;
48159
48160         mem_base = xmlMemBlocks();
48161
48162         xmlXPathInit();
48163         call_tests++;
48164         xmlResetLastError();
48165         if (mem_base != xmlMemBlocks()) {
48166             printf("Leak of %d blocks found in xmlXPathInit",
48167                    xmlMemBlocks() - mem_base);
48168             test_ret++;
48169             printf("\n");
48170         }
48171     function_tests++;
48172 #endif
48173
48174     return(test_ret);
48175 }
48176
48177
48178 static int
48179 test_xmlXPathIsInf(void) {
48180     int test_ret = 0;
48181
48182 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
48183     int mem_base;
48184     int ret_val;
48185     double val; /* a double value */
48186     int n_val;
48187
48188     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48189         mem_base = xmlMemBlocks();
48190         val = gen_double(n_val, 0);
48191
48192         ret_val = xmlXPathIsInf(val);
48193         desret_int(ret_val);
48194         call_tests++;
48195         des_double(n_val, val, 0);
48196         xmlResetLastError();
48197         if (mem_base != xmlMemBlocks()) {
48198             printf("Leak of %d blocks found in xmlXPathIsInf",
48199                    xmlMemBlocks() - mem_base);
48200             test_ret++;
48201             printf(" %d", n_val);
48202             printf("\n");
48203         }
48204     }
48205     function_tests++;
48206 #endif
48207
48208     return(test_ret);
48209 }
48210
48211
48212 static int
48213 test_xmlXPathIsNaN(void) {
48214     int test_ret = 0;
48215
48216 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
48217     int mem_base;
48218     int ret_val;
48219     double val; /* a double value */
48220     int n_val;
48221
48222     for (n_val = 0;n_val < gen_nb_double;n_val++) {
48223         mem_base = xmlMemBlocks();
48224         val = gen_double(n_val, 0);
48225
48226         ret_val = xmlXPathIsNaN(val);
48227         desret_int(ret_val);
48228         call_tests++;
48229         des_double(n_val, val, 0);
48230         xmlResetLastError();
48231         if (mem_base != xmlMemBlocks()) {
48232             printf("Leak of %d blocks found in xmlXPathIsNaN",
48233                    xmlMemBlocks() - mem_base);
48234             test_ret++;
48235             printf(" %d", n_val);
48236             printf("\n");
48237         }
48238     }
48239     function_tests++;
48240 #endif
48241
48242     return(test_ret);
48243 }
48244
48245
48246 static int
48247 test_xmlXPathNewContext(void) {
48248     int test_ret = 0;
48249
48250
48251     /* missing type support */
48252     return(test_ret);
48253 }
48254
48255
48256 static int
48257 test_xmlXPathNodeEval(void) {
48258     int test_ret = 0;
48259
48260 #if defined(LIBXML_XPATH_ENABLED)
48261     int mem_base;
48262     xmlXPathObjectPtr ret_val;
48263     xmlNodePtr node; /* the node to to use as the context node */
48264     int n_node;
48265     xmlChar * str; /* the XPath expression */
48266     int n_str;
48267     xmlXPathContextPtr ctx; /* the XPath context */
48268     int n_ctx;
48269
48270     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48271     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
48272     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
48273         mem_base = xmlMemBlocks();
48274         node = gen_xmlNodePtr(n_node, 0);
48275         str = gen_const_xmlChar_ptr(n_str, 1);
48276         ctx = gen_xmlXPathContextPtr(n_ctx, 2);
48277
48278         ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
48279         desret_xmlXPathObjectPtr(ret_val);
48280         call_tests++;
48281         des_xmlNodePtr(n_node, node, 0);
48282         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
48283         des_xmlXPathContextPtr(n_ctx, ctx, 2);
48284         xmlResetLastError();
48285         if (mem_base != xmlMemBlocks()) {
48286             printf("Leak of %d blocks found in xmlXPathNodeEval",
48287                    xmlMemBlocks() - mem_base);
48288             test_ret++;
48289             printf(" %d", n_node);
48290             printf(" %d", n_str);
48291             printf(" %d", n_ctx);
48292             printf("\n");
48293         }
48294     }
48295     }
48296     }
48297     function_tests++;
48298 #endif
48299
48300     return(test_ret);
48301 }
48302
48303
48304 static int
48305 test_xmlXPathNodeSetCreate(void) {
48306     int test_ret = 0;
48307
48308 #if defined(LIBXML_XPATH_ENABLED)
48309     int mem_base;
48310     xmlNodeSetPtr ret_val;
48311     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
48312     int n_val;
48313
48314     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48315         mem_base = xmlMemBlocks();
48316         val = gen_xmlNodePtr(n_val, 0);
48317
48318         ret_val = xmlXPathNodeSetCreate(val);
48319         desret_xmlNodeSetPtr(ret_val);
48320         call_tests++;
48321         des_xmlNodePtr(n_val, val, 0);
48322         xmlResetLastError();
48323         if (mem_base != xmlMemBlocks()) {
48324             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
48325                    xmlMemBlocks() - mem_base);
48326             test_ret++;
48327             printf(" %d", n_val);
48328             printf("\n");
48329         }
48330     }
48331     function_tests++;
48332 #endif
48333
48334     return(test_ret);
48335 }
48336
48337
48338 static int
48339 test_xmlXPathObjectCopy(void) {
48340     int test_ret = 0;
48341
48342 #if defined(LIBXML_XPATH_ENABLED)
48343     int mem_base;
48344     xmlXPathObjectPtr ret_val;
48345     xmlXPathObjectPtr val; /* the original object */
48346     int n_val;
48347
48348     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
48349         mem_base = xmlMemBlocks();
48350         val = gen_xmlXPathObjectPtr(n_val, 0);
48351
48352         ret_val = xmlXPathObjectCopy(val);
48353         desret_xmlXPathObjectPtr(ret_val);
48354         call_tests++;
48355         des_xmlXPathObjectPtr(n_val, val, 0);
48356         xmlResetLastError();
48357         if (mem_base != xmlMemBlocks()) {
48358             printf("Leak of %d blocks found in xmlXPathObjectCopy",
48359                    xmlMemBlocks() - mem_base);
48360             test_ret++;
48361             printf(" %d", n_val);
48362             printf("\n");
48363         }
48364     }
48365     function_tests++;
48366 #endif
48367
48368     return(test_ret);
48369 }
48370
48371
48372 static int
48373 test_xmlXPathOrderDocElems(void) {
48374     int test_ret = 0;
48375
48376 #if defined(LIBXML_XPATH_ENABLED)
48377     int mem_base;
48378     long ret_val;
48379     xmlDocPtr doc; /* an input document */
48380     int n_doc;
48381
48382     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
48383         mem_base = xmlMemBlocks();
48384         doc = gen_xmlDocPtr(n_doc, 0);
48385
48386         ret_val = xmlXPathOrderDocElems(doc);
48387         desret_long(ret_val);
48388         call_tests++;
48389         des_xmlDocPtr(n_doc, doc, 0);
48390         xmlResetLastError();
48391         if (mem_base != xmlMemBlocks()) {
48392             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
48393                    xmlMemBlocks() - mem_base);
48394             test_ret++;
48395             printf(" %d", n_doc);
48396             printf("\n");
48397         }
48398     }
48399     function_tests++;
48400 #endif
48401
48402     return(test_ret);
48403 }
48404
48405
48406 static int
48407 test_xmlXPathSetContextNode(void) {
48408     int test_ret = 0;
48409
48410 #if defined(LIBXML_XPATH_ENABLED)
48411     int mem_base;
48412     int ret_val;
48413     xmlNodePtr node; /* the node to to use as the context node */
48414     int n_node;
48415     xmlXPathContextPtr ctx; /* the XPath context */
48416     int n_ctx;
48417
48418     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48419     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
48420         mem_base = xmlMemBlocks();
48421         node = gen_xmlNodePtr(n_node, 0);
48422         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
48423
48424         ret_val = xmlXPathSetContextNode(node, ctx);
48425         desret_int(ret_val);
48426         call_tests++;
48427         des_xmlNodePtr(n_node, node, 0);
48428         des_xmlXPathContextPtr(n_ctx, ctx, 1);
48429         xmlResetLastError();
48430         if (mem_base != xmlMemBlocks()) {
48431             printf("Leak of %d blocks found in xmlXPathSetContextNode",
48432                    xmlMemBlocks() - mem_base);
48433             test_ret++;
48434             printf(" %d", n_node);
48435             printf(" %d", n_ctx);
48436             printf("\n");
48437         }
48438     }
48439     }
48440     function_tests++;
48441 #endif
48442
48443     return(test_ret);
48444 }
48445
48446 static int
48447 test_xpath(void) {
48448     int test_ret = 0;
48449         int rc = 0;
48450
48451     if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
48452     rc = test_xmlXPathCastBooleanToNumber();
48453         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48454     rc = test_xmlXPathCastBooleanToString();
48455         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48456     rc = test_xmlXPathCastNodeSetToBoolean();
48457         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48458     rc = test_xmlXPathCastNodeSetToNumber();
48459         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48460     rc = test_xmlXPathCastNodeSetToString();
48461         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48462     rc = test_xmlXPathCastNodeToNumber();
48463         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48464     rc = test_xmlXPathCastNodeToString();
48465         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48466     rc = test_xmlXPathCastNumberToBoolean();
48467         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48468     rc = test_xmlXPathCastNumberToString();
48469         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48470     rc = test_xmlXPathCastStringToBoolean();
48471         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48472     rc = test_xmlXPathCastStringToNumber();
48473         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48474     rc = test_xmlXPathCastToBoolean();
48475         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48476     rc = test_xmlXPathCastToNumber();
48477         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48478     rc = test_xmlXPathCastToString();
48479         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48480     rc = test_xmlXPathCmpNodes();
48481         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48482     rc = test_xmlXPathCompile();
48483         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48484     rc = test_xmlXPathCompiledEval();
48485         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48486     rc = test_xmlXPathCompiledEvalToBoolean();
48487         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48488     rc = test_xmlXPathContextSetCache();
48489         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48490     rc = test_xmlXPathConvertBoolean();
48491         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48492     rc = test_xmlXPathConvertNumber();
48493         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48494     rc = test_xmlXPathConvertString();
48495         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48496     rc = test_xmlXPathCtxtCompile();
48497         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48498     rc = test_xmlXPathEval();
48499         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48500     rc = test_xmlXPathEvalExpression();
48501         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48502     rc = test_xmlXPathEvalPredicate();
48503         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48504     rc = test_xmlXPathInit();
48505         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48506     rc = test_xmlXPathIsInf();
48507         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48508     rc = test_xmlXPathIsNaN();
48509         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48510     rc = test_xmlXPathNewContext();
48511         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48512     rc = test_xmlXPathNodeEval();
48513         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48514     rc = test_xmlXPathNodeSetCreate();
48515         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48516     rc = test_xmlXPathObjectCopy();
48517         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48518     rc = test_xmlXPathOrderDocElems();
48519         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48520     rc = test_xmlXPathSetContextNode();
48521         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
48522
48523     if (test_ret != 0)
48524         printf("Module xpath: %d errors\n", test_ret);
48525     return(test_ret);
48526 }
48527 #ifdef LIBXML_XPATH_ENABLED
48528
48529 #define gen_nb_xmlXPathParserContextPtr 1
48530 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
48531     return(NULL);
48532 }
48533 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
48534 }
48535 #endif
48536
48537
48538 static int
48539 test_valuePop(void) {
48540     int test_ret = 0;
48541
48542 #if defined(LIBXML_XPATH_ENABLED)
48543     int mem_base;
48544     xmlXPathObjectPtr ret_val;
48545     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
48546     int n_ctxt;
48547
48548     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48549         mem_base = xmlMemBlocks();
48550         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48551
48552         ret_val = valuePop(ctxt);
48553         desret_xmlXPathObjectPtr(ret_val);
48554         call_tests++;
48555         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48556         xmlResetLastError();
48557         if (mem_base != xmlMemBlocks()) {
48558             printf("Leak of %d blocks found in valuePop",
48559                    xmlMemBlocks() - mem_base);
48560             test_ret++;
48561             printf(" %d", n_ctxt);
48562             printf("\n");
48563         }
48564     }
48565     function_tests++;
48566 #endif
48567
48568     return(test_ret);
48569 }
48570
48571
48572 static int
48573 test_valuePush(void) {
48574     int test_ret = 0;
48575
48576 #if defined(LIBXML_XPATH_ENABLED)
48577     int mem_base;
48578     int ret_val;
48579     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
48580     int n_ctxt;
48581     xmlXPathObjectPtr value; /* the XPath object */
48582     int n_value;
48583
48584     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48585     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
48586         mem_base = xmlMemBlocks();
48587         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48588         value = gen_xmlXPathObjectPtr(n_value, 1);
48589
48590         ret_val = valuePush(ctxt, value);
48591         desret_int(ret_val);
48592         call_tests++;
48593         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48594         des_xmlXPathObjectPtr(n_value, value, 1);
48595         xmlResetLastError();
48596         if (mem_base != xmlMemBlocks()) {
48597             printf("Leak of %d blocks found in valuePush",
48598                    xmlMemBlocks() - mem_base);
48599             test_ret++;
48600             printf(" %d", n_ctxt);
48601             printf(" %d", n_value);
48602             printf("\n");
48603         }
48604     }
48605     }
48606     function_tests++;
48607 #endif
48608
48609     return(test_ret);
48610 }
48611
48612
48613 static int
48614 test_xmlXPathAddValues(void) {
48615     int test_ret = 0;
48616
48617 #if defined(LIBXML_XPATH_ENABLED)
48618     int mem_base;
48619     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48620     int n_ctxt;
48621
48622     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48623         mem_base = xmlMemBlocks();
48624         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48625
48626         xmlXPathAddValues(ctxt);
48627         call_tests++;
48628         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48629         xmlResetLastError();
48630         if (mem_base != xmlMemBlocks()) {
48631             printf("Leak of %d blocks found in xmlXPathAddValues",
48632                    xmlMemBlocks() - mem_base);
48633             test_ret++;
48634             printf(" %d", n_ctxt);
48635             printf("\n");
48636         }
48637     }
48638     function_tests++;
48639 #endif
48640
48641     return(test_ret);
48642 }
48643
48644
48645 static int
48646 test_xmlXPathBooleanFunction(void) {
48647     int test_ret = 0;
48648
48649 #if defined(LIBXML_XPATH_ENABLED)
48650     int mem_base;
48651     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48652     int n_ctxt;
48653     int nargs; /* the number of arguments */
48654     int n_nargs;
48655
48656     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48657     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48658         mem_base = xmlMemBlocks();
48659         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48660         nargs = gen_int(n_nargs, 1);
48661
48662         xmlXPathBooleanFunction(ctxt, nargs);
48663         call_tests++;
48664         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48665         des_int(n_nargs, nargs, 1);
48666         xmlResetLastError();
48667         if (mem_base != xmlMemBlocks()) {
48668             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
48669                    xmlMemBlocks() - mem_base);
48670             test_ret++;
48671             printf(" %d", n_ctxt);
48672             printf(" %d", n_nargs);
48673             printf("\n");
48674         }
48675     }
48676     }
48677     function_tests++;
48678 #endif
48679
48680     return(test_ret);
48681 }
48682
48683
48684 static int
48685 test_xmlXPathCeilingFunction(void) {
48686     int test_ret = 0;
48687
48688 #if defined(LIBXML_XPATH_ENABLED)
48689     int mem_base;
48690     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48691     int n_ctxt;
48692     int nargs; /* the number of arguments */
48693     int n_nargs;
48694
48695     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48696     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48697         mem_base = xmlMemBlocks();
48698         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48699         nargs = gen_int(n_nargs, 1);
48700
48701         xmlXPathCeilingFunction(ctxt, nargs);
48702         call_tests++;
48703         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48704         des_int(n_nargs, nargs, 1);
48705         xmlResetLastError();
48706         if (mem_base != xmlMemBlocks()) {
48707             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
48708                    xmlMemBlocks() - mem_base);
48709             test_ret++;
48710             printf(" %d", n_ctxt);
48711             printf(" %d", n_nargs);
48712             printf("\n");
48713         }
48714     }
48715     }
48716     function_tests++;
48717 #endif
48718
48719     return(test_ret);
48720 }
48721
48722
48723 static int
48724 test_xmlXPathCompareValues(void) {
48725     int test_ret = 0;
48726
48727 #if defined(LIBXML_XPATH_ENABLED)
48728     int mem_base;
48729     int ret_val;
48730     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48731     int n_ctxt;
48732     int inf; /* less than (1) or greater than (0) */
48733     int n_inf;
48734     int strict; /* is the comparison strict */
48735     int n_strict;
48736
48737     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48738     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
48739     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
48740         mem_base = xmlMemBlocks();
48741         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48742         inf = gen_int(n_inf, 1);
48743         strict = gen_int(n_strict, 2);
48744
48745         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
48746         desret_int(ret_val);
48747         call_tests++;
48748         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48749         des_int(n_inf, inf, 1);
48750         des_int(n_strict, strict, 2);
48751         xmlResetLastError();
48752         if (mem_base != xmlMemBlocks()) {
48753             printf("Leak of %d blocks found in xmlXPathCompareValues",
48754                    xmlMemBlocks() - mem_base);
48755             test_ret++;
48756             printf(" %d", n_ctxt);
48757             printf(" %d", n_inf);
48758             printf(" %d", n_strict);
48759             printf("\n");
48760         }
48761     }
48762     }
48763     }
48764     function_tests++;
48765 #endif
48766
48767     return(test_ret);
48768 }
48769
48770
48771 static int
48772 test_xmlXPathConcatFunction(void) {
48773     int test_ret = 0;
48774
48775 #if defined(LIBXML_XPATH_ENABLED)
48776     int mem_base;
48777     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48778     int n_ctxt;
48779     int nargs; /* the number of arguments */
48780     int n_nargs;
48781
48782     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48783     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48784         mem_base = xmlMemBlocks();
48785         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48786         nargs = gen_int(n_nargs, 1);
48787
48788         xmlXPathConcatFunction(ctxt, nargs);
48789         call_tests++;
48790         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48791         des_int(n_nargs, nargs, 1);
48792         xmlResetLastError();
48793         if (mem_base != xmlMemBlocks()) {
48794             printf("Leak of %d blocks found in xmlXPathConcatFunction",
48795                    xmlMemBlocks() - mem_base);
48796             test_ret++;
48797             printf(" %d", n_ctxt);
48798             printf(" %d", n_nargs);
48799             printf("\n");
48800         }
48801     }
48802     }
48803     function_tests++;
48804 #endif
48805
48806     return(test_ret);
48807 }
48808
48809
48810 static int
48811 test_xmlXPathContainsFunction(void) {
48812     int test_ret = 0;
48813
48814 #if defined(LIBXML_XPATH_ENABLED)
48815     int mem_base;
48816     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48817     int n_ctxt;
48818     int nargs; /* the number of arguments */
48819     int n_nargs;
48820
48821     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48822     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48823         mem_base = xmlMemBlocks();
48824         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48825         nargs = gen_int(n_nargs, 1);
48826
48827         xmlXPathContainsFunction(ctxt, nargs);
48828         call_tests++;
48829         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48830         des_int(n_nargs, nargs, 1);
48831         xmlResetLastError();
48832         if (mem_base != xmlMemBlocks()) {
48833             printf("Leak of %d blocks found in xmlXPathContainsFunction",
48834                    xmlMemBlocks() - mem_base);
48835             test_ret++;
48836             printf(" %d", n_ctxt);
48837             printf(" %d", n_nargs);
48838             printf("\n");
48839         }
48840     }
48841     }
48842     function_tests++;
48843 #endif
48844
48845     return(test_ret);
48846 }
48847
48848
48849 static int
48850 test_xmlXPathCountFunction(void) {
48851     int test_ret = 0;
48852
48853 #if defined(LIBXML_XPATH_ENABLED)
48854     int mem_base;
48855     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48856     int n_ctxt;
48857     int nargs; /* the number of arguments */
48858     int n_nargs;
48859
48860     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48861     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48862         mem_base = xmlMemBlocks();
48863         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48864         nargs = gen_int(n_nargs, 1);
48865
48866         xmlXPathCountFunction(ctxt, nargs);
48867         call_tests++;
48868         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48869         des_int(n_nargs, nargs, 1);
48870         xmlResetLastError();
48871         if (mem_base != xmlMemBlocks()) {
48872             printf("Leak of %d blocks found in xmlXPathCountFunction",
48873                    xmlMemBlocks() - mem_base);
48874             test_ret++;
48875             printf(" %d", n_ctxt);
48876             printf(" %d", n_nargs);
48877             printf("\n");
48878         }
48879     }
48880     }
48881     function_tests++;
48882 #endif
48883
48884     return(test_ret);
48885 }
48886
48887
48888 static int
48889 test_xmlXPathDebugDumpCompExpr(void) {
48890     int test_ret = 0;
48891
48892 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
48893     int mem_base;
48894     FILE * output; /* the FILE * for the output */
48895     int n_output;
48896     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
48897     int n_comp;
48898     int depth; /* the indentation level. */
48899     int n_depth;
48900
48901     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
48902     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
48903     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
48904         mem_base = xmlMemBlocks();
48905         output = gen_FILE_ptr(n_output, 0);
48906         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
48907         depth = gen_int(n_depth, 2);
48908
48909         xmlXPathDebugDumpCompExpr(output, comp, depth);
48910         call_tests++;
48911         des_FILE_ptr(n_output, output, 0);
48912         des_xmlXPathCompExprPtr(n_comp, comp, 1);
48913         des_int(n_depth, depth, 2);
48914         xmlResetLastError();
48915         if (mem_base != xmlMemBlocks()) {
48916             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
48917                    xmlMemBlocks() - mem_base);
48918             test_ret++;
48919             printf(" %d", n_output);
48920             printf(" %d", n_comp);
48921             printf(" %d", n_depth);
48922             printf("\n");
48923         }
48924     }
48925     }
48926     }
48927     function_tests++;
48928 #endif
48929
48930     return(test_ret);
48931 }
48932
48933
48934 static int
48935 test_xmlXPathDebugDumpObject(void) {
48936     int test_ret = 0;
48937
48938 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
48939     int mem_base;
48940     FILE * output; /* the FILE * to dump the output */
48941     int n_output;
48942     xmlXPathObjectPtr cur; /* the object to inspect */
48943     int n_cur;
48944     int depth; /* indentation level */
48945     int n_depth;
48946
48947     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
48948     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
48949     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
48950         mem_base = xmlMemBlocks();
48951         output = gen_FILE_ptr(n_output, 0);
48952         cur = gen_xmlXPathObjectPtr(n_cur, 1);
48953         depth = gen_int(n_depth, 2);
48954
48955         xmlXPathDebugDumpObject(output, cur, depth);
48956         call_tests++;
48957         des_FILE_ptr(n_output, output, 0);
48958         des_xmlXPathObjectPtr(n_cur, cur, 1);
48959         des_int(n_depth, depth, 2);
48960         xmlResetLastError();
48961         if (mem_base != xmlMemBlocks()) {
48962             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
48963                    xmlMemBlocks() - mem_base);
48964             test_ret++;
48965             printf(" %d", n_output);
48966             printf(" %d", n_cur);
48967             printf(" %d", n_depth);
48968             printf("\n");
48969         }
48970     }
48971     }
48972     }
48973     function_tests++;
48974 #endif
48975
48976     return(test_ret);
48977 }
48978
48979
48980 static int
48981 test_xmlXPathDifference(void) {
48982     int test_ret = 0;
48983
48984 #if defined(LIBXML_XPATH_ENABLED)
48985     int mem_base;
48986     xmlNodeSetPtr ret_val;
48987     xmlNodeSetPtr nodes1; /* a node-set */
48988     int n_nodes1;
48989     xmlNodeSetPtr nodes2; /* a node-set */
48990     int n_nodes2;
48991
48992     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48993     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48994         mem_base = xmlMemBlocks();
48995         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48996         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48997
48998         ret_val = xmlXPathDifference(nodes1, nodes2);
48999         desret_xmlNodeSetPtr(ret_val);
49000         call_tests++;
49001         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49002         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49003         xmlResetLastError();
49004         if (mem_base != xmlMemBlocks()) {
49005             printf("Leak of %d blocks found in xmlXPathDifference",
49006                    xmlMemBlocks() - mem_base);
49007             test_ret++;
49008             printf(" %d", n_nodes1);
49009             printf(" %d", n_nodes2);
49010             printf("\n");
49011         }
49012     }
49013     }
49014     function_tests++;
49015 #endif
49016
49017     return(test_ret);
49018 }
49019
49020
49021 static int
49022 test_xmlXPathDistinct(void) {
49023     int test_ret = 0;
49024
49025 #if defined(LIBXML_XPATH_ENABLED)
49026     int mem_base;
49027     xmlNodeSetPtr ret_val;
49028     xmlNodeSetPtr nodes; /* a node-set */
49029     int n_nodes;
49030
49031     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49032         mem_base = xmlMemBlocks();
49033         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49034
49035         ret_val = xmlXPathDistinct(nodes);
49036         desret_xmlNodeSetPtr(ret_val);
49037         call_tests++;
49038         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49039         xmlResetLastError();
49040         if (mem_base != xmlMemBlocks()) {
49041             printf("Leak of %d blocks found in xmlXPathDistinct",
49042                    xmlMemBlocks() - mem_base);
49043             test_ret++;
49044             printf(" %d", n_nodes);
49045             printf("\n");
49046         }
49047     }
49048     function_tests++;
49049 #endif
49050
49051     return(test_ret);
49052 }
49053
49054
49055 static int
49056 test_xmlXPathDistinctSorted(void) {
49057     int test_ret = 0;
49058
49059 #if defined(LIBXML_XPATH_ENABLED)
49060     int mem_base;
49061     xmlNodeSetPtr ret_val;
49062     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49063     int n_nodes;
49064
49065     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49066         mem_base = xmlMemBlocks();
49067         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49068
49069         ret_val = xmlXPathDistinctSorted(nodes);
49070         desret_xmlNodeSetPtr(ret_val);
49071         call_tests++;
49072         des_xmlNodeSetPtr(n_nodes, nodes, 0);
49073         xmlResetLastError();
49074         if (mem_base != xmlMemBlocks()) {
49075             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
49076                    xmlMemBlocks() - mem_base);
49077             test_ret++;
49078             printf(" %d", n_nodes);
49079             printf("\n");
49080         }
49081     }
49082     function_tests++;
49083 #endif
49084
49085     return(test_ret);
49086 }
49087
49088
49089 static int
49090 test_xmlXPathDivValues(void) {
49091     int test_ret = 0;
49092
49093 #if defined(LIBXML_XPATH_ENABLED)
49094     int mem_base;
49095     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49096     int n_ctxt;
49097
49098     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49099         mem_base = xmlMemBlocks();
49100         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49101
49102         xmlXPathDivValues(ctxt);
49103         call_tests++;
49104         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49105         xmlResetLastError();
49106         if (mem_base != xmlMemBlocks()) {
49107             printf("Leak of %d blocks found in xmlXPathDivValues",
49108                    xmlMemBlocks() - mem_base);
49109             test_ret++;
49110             printf(" %d", n_ctxt);
49111             printf("\n");
49112         }
49113     }
49114     function_tests++;
49115 #endif
49116
49117     return(test_ret);
49118 }
49119
49120
49121 static int
49122 test_xmlXPathEqualValues(void) {
49123     int test_ret = 0;
49124
49125 #if defined(LIBXML_XPATH_ENABLED)
49126     int mem_base;
49127     int ret_val;
49128     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49129     int n_ctxt;
49130
49131     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49132         mem_base = xmlMemBlocks();
49133         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49134
49135         ret_val = xmlXPathEqualValues(ctxt);
49136         desret_int(ret_val);
49137         call_tests++;
49138         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49139         xmlResetLastError();
49140         if (mem_base != xmlMemBlocks()) {
49141             printf("Leak of %d blocks found in xmlXPathEqualValues",
49142                    xmlMemBlocks() - mem_base);
49143             test_ret++;
49144             printf(" %d", n_ctxt);
49145             printf("\n");
49146         }
49147     }
49148     function_tests++;
49149 #endif
49150
49151     return(test_ret);
49152 }
49153
49154
49155 static int
49156 test_xmlXPathErr(void) {
49157     int test_ret = 0;
49158
49159 #if defined(LIBXML_XPATH_ENABLED)
49160     int mem_base;
49161     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
49162     int n_ctxt;
49163     int error; /* the error code */
49164     int n_error;
49165
49166     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49167     for (n_error = 0;n_error < gen_nb_int;n_error++) {
49168         mem_base = xmlMemBlocks();
49169         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49170         error = gen_int(n_error, 1);
49171
49172         xmlXPathErr(ctxt, error);
49173         call_tests++;
49174         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49175         des_int(n_error, error, 1);
49176         xmlResetLastError();
49177         if (mem_base != xmlMemBlocks()) {
49178             printf("Leak of %d blocks found in xmlXPathErr",
49179                    xmlMemBlocks() - mem_base);
49180             test_ret++;
49181             printf(" %d", n_ctxt);
49182             printf(" %d", n_error);
49183             printf("\n");
49184         }
49185     }
49186     }
49187     function_tests++;
49188 #endif
49189
49190     return(test_ret);
49191 }
49192
49193
49194 static int
49195 test_xmlXPathEvalExpr(void) {
49196     int test_ret = 0;
49197
49198 #if defined(LIBXML_XPATH_ENABLED)
49199     int mem_base;
49200     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49201     int n_ctxt;
49202
49203     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49204         mem_base = xmlMemBlocks();
49205         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49206
49207         xmlXPathEvalExpr(ctxt);
49208         call_tests++;
49209         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49210         xmlResetLastError();
49211         if (mem_base != xmlMemBlocks()) {
49212             printf("Leak of %d blocks found in xmlXPathEvalExpr",
49213                    xmlMemBlocks() - mem_base);
49214             test_ret++;
49215             printf(" %d", n_ctxt);
49216             printf("\n");
49217         }
49218     }
49219     function_tests++;
49220 #endif
49221
49222     return(test_ret);
49223 }
49224
49225
49226 static int
49227 test_xmlXPathEvaluatePredicateResult(void) {
49228     int test_ret = 0;
49229
49230 #if defined(LIBXML_XPATH_ENABLED)
49231     int mem_base;
49232     int ret_val;
49233     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49234     int n_ctxt;
49235     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
49236     int n_res;
49237
49238     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49239     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
49240         mem_base = xmlMemBlocks();
49241         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49242         res = gen_xmlXPathObjectPtr(n_res, 1);
49243
49244         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
49245         desret_int(ret_val);
49246         call_tests++;
49247         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49248         des_xmlXPathObjectPtr(n_res, res, 1);
49249         xmlResetLastError();
49250         if (mem_base != xmlMemBlocks()) {
49251             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
49252                    xmlMemBlocks() - mem_base);
49253             test_ret++;
49254             printf(" %d", n_ctxt);
49255             printf(" %d", n_res);
49256             printf("\n");
49257         }
49258     }
49259     }
49260     function_tests++;
49261 #endif
49262
49263     return(test_ret);
49264 }
49265
49266
49267 static int
49268 test_xmlXPathFalseFunction(void) {
49269     int test_ret = 0;
49270
49271 #if defined(LIBXML_XPATH_ENABLED)
49272     int mem_base;
49273     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49274     int n_ctxt;
49275     int nargs; /* the number of arguments */
49276     int n_nargs;
49277
49278     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49279     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49280         mem_base = xmlMemBlocks();
49281         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49282         nargs = gen_int(n_nargs, 1);
49283
49284         xmlXPathFalseFunction(ctxt, nargs);
49285         call_tests++;
49286         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49287         des_int(n_nargs, nargs, 1);
49288         xmlResetLastError();
49289         if (mem_base != xmlMemBlocks()) {
49290             printf("Leak of %d blocks found in xmlXPathFalseFunction",
49291                    xmlMemBlocks() - mem_base);
49292             test_ret++;
49293             printf(" %d", n_ctxt);
49294             printf(" %d", n_nargs);
49295             printf("\n");
49296         }
49297     }
49298     }
49299     function_tests++;
49300 #endif
49301
49302     return(test_ret);
49303 }
49304
49305
49306 static int
49307 test_xmlXPathFloorFunction(void) {
49308     int test_ret = 0;
49309
49310 #if defined(LIBXML_XPATH_ENABLED)
49311     int mem_base;
49312     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49313     int n_ctxt;
49314     int nargs; /* the number of arguments */
49315     int n_nargs;
49316
49317     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49318     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49319         mem_base = xmlMemBlocks();
49320         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49321         nargs = gen_int(n_nargs, 1);
49322
49323         xmlXPathFloorFunction(ctxt, nargs);
49324         call_tests++;
49325         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49326         des_int(n_nargs, nargs, 1);
49327         xmlResetLastError();
49328         if (mem_base != xmlMemBlocks()) {
49329             printf("Leak of %d blocks found in xmlXPathFloorFunction",
49330                    xmlMemBlocks() - mem_base);
49331             test_ret++;
49332             printf(" %d", n_ctxt);
49333             printf(" %d", n_nargs);
49334             printf("\n");
49335         }
49336     }
49337     }
49338     function_tests++;
49339 #endif
49340
49341     return(test_ret);
49342 }
49343
49344
49345 static int
49346 test_xmlXPathFunctionLookup(void) {
49347     int test_ret = 0;
49348
49349
49350     /* missing type support */
49351     return(test_ret);
49352 }
49353
49354
49355 static int
49356 test_xmlXPathFunctionLookupNS(void) {
49357     int test_ret = 0;
49358
49359
49360     /* missing type support */
49361     return(test_ret);
49362 }
49363
49364
49365 static int
49366 test_xmlXPathHasSameNodes(void) {
49367     int test_ret = 0;
49368
49369 #if defined(LIBXML_XPATH_ENABLED)
49370     int mem_base;
49371     int ret_val;
49372     xmlNodeSetPtr nodes1; /* a node-set */
49373     int n_nodes1;
49374     xmlNodeSetPtr nodes2; /* a node-set */
49375     int n_nodes2;
49376
49377     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49378     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49379         mem_base = xmlMemBlocks();
49380         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49381         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49382
49383         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
49384         desret_int(ret_val);
49385         call_tests++;
49386         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49387         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49388         xmlResetLastError();
49389         if (mem_base != xmlMemBlocks()) {
49390             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
49391                    xmlMemBlocks() - mem_base);
49392             test_ret++;
49393             printf(" %d", n_nodes1);
49394             printf(" %d", n_nodes2);
49395             printf("\n");
49396         }
49397     }
49398     }
49399     function_tests++;
49400 #endif
49401
49402     return(test_ret);
49403 }
49404
49405
49406 static int
49407 test_xmlXPathIdFunction(void) {
49408     int test_ret = 0;
49409
49410 #if defined(LIBXML_XPATH_ENABLED)
49411     int mem_base;
49412     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49413     int n_ctxt;
49414     int nargs; /* the number of arguments */
49415     int n_nargs;
49416
49417     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49418     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49419         mem_base = xmlMemBlocks();
49420         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49421         nargs = gen_int(n_nargs, 1);
49422
49423         xmlXPathIdFunction(ctxt, nargs);
49424         call_tests++;
49425         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49426         des_int(n_nargs, nargs, 1);
49427         xmlResetLastError();
49428         if (mem_base != xmlMemBlocks()) {
49429             printf("Leak of %d blocks found in xmlXPathIdFunction",
49430                    xmlMemBlocks() - mem_base);
49431             test_ret++;
49432             printf(" %d", n_ctxt);
49433             printf(" %d", n_nargs);
49434             printf("\n");
49435         }
49436     }
49437     }
49438     function_tests++;
49439 #endif
49440
49441     return(test_ret);
49442 }
49443
49444
49445 static int
49446 test_xmlXPathIntersection(void) {
49447     int test_ret = 0;
49448
49449 #if defined(LIBXML_XPATH_ENABLED)
49450     int mem_base;
49451     xmlNodeSetPtr ret_val;
49452     xmlNodeSetPtr nodes1; /* a node-set */
49453     int n_nodes1;
49454     xmlNodeSetPtr nodes2; /* a node-set */
49455     int n_nodes2;
49456
49457     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49458     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49459         mem_base = xmlMemBlocks();
49460         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49461         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49462
49463         ret_val = xmlXPathIntersection(nodes1, nodes2);
49464         desret_xmlNodeSetPtr(ret_val);
49465         call_tests++;
49466         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49467         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49468         xmlResetLastError();
49469         if (mem_base != xmlMemBlocks()) {
49470             printf("Leak of %d blocks found in xmlXPathIntersection",
49471                    xmlMemBlocks() - mem_base);
49472             test_ret++;
49473             printf(" %d", n_nodes1);
49474             printf(" %d", n_nodes2);
49475             printf("\n");
49476         }
49477     }
49478     }
49479     function_tests++;
49480 #endif
49481
49482     return(test_ret);
49483 }
49484
49485
49486 static int
49487 test_xmlXPathIsNodeType(void) {
49488     int test_ret = 0;
49489
49490 #if defined(LIBXML_XPATH_ENABLED)
49491     int mem_base;
49492     int ret_val;
49493     xmlChar * name; /* a name string */
49494     int n_name;
49495
49496     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49497         mem_base = xmlMemBlocks();
49498         name = gen_const_xmlChar_ptr(n_name, 0);
49499
49500         ret_val = xmlXPathIsNodeType((const xmlChar *)name);
49501         desret_int(ret_val);
49502         call_tests++;
49503         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
49504         xmlResetLastError();
49505         if (mem_base != xmlMemBlocks()) {
49506             printf("Leak of %d blocks found in xmlXPathIsNodeType",
49507                    xmlMemBlocks() - mem_base);
49508             test_ret++;
49509             printf(" %d", n_name);
49510             printf("\n");
49511         }
49512     }
49513     function_tests++;
49514 #endif
49515
49516     return(test_ret);
49517 }
49518
49519
49520 static int
49521 test_xmlXPathLangFunction(void) {
49522     int test_ret = 0;
49523
49524 #if defined(LIBXML_XPATH_ENABLED)
49525     int mem_base;
49526     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49527     int n_ctxt;
49528     int nargs; /* the number of arguments */
49529     int n_nargs;
49530
49531     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49532     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49533         mem_base = xmlMemBlocks();
49534         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49535         nargs = gen_int(n_nargs, 1);
49536
49537         xmlXPathLangFunction(ctxt, nargs);
49538         call_tests++;
49539         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49540         des_int(n_nargs, nargs, 1);
49541         xmlResetLastError();
49542         if (mem_base != xmlMemBlocks()) {
49543             printf("Leak of %d blocks found in xmlXPathLangFunction",
49544                    xmlMemBlocks() - mem_base);
49545             test_ret++;
49546             printf(" %d", n_ctxt);
49547             printf(" %d", n_nargs);
49548             printf("\n");
49549         }
49550     }
49551     }
49552     function_tests++;
49553 #endif
49554
49555     return(test_ret);
49556 }
49557
49558
49559 static int
49560 test_xmlXPathLastFunction(void) {
49561     int test_ret = 0;
49562
49563 #if defined(LIBXML_XPATH_ENABLED)
49564     int mem_base;
49565     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49566     int n_ctxt;
49567     int nargs; /* the number of arguments */
49568     int n_nargs;
49569
49570     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49571     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49572         mem_base = xmlMemBlocks();
49573         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49574         nargs = gen_int(n_nargs, 1);
49575
49576         xmlXPathLastFunction(ctxt, nargs);
49577         call_tests++;
49578         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49579         des_int(n_nargs, nargs, 1);
49580         xmlResetLastError();
49581         if (mem_base != xmlMemBlocks()) {
49582             printf("Leak of %d blocks found in xmlXPathLastFunction",
49583                    xmlMemBlocks() - mem_base);
49584             test_ret++;
49585             printf(" %d", n_ctxt);
49586             printf(" %d", n_nargs);
49587             printf("\n");
49588         }
49589     }
49590     }
49591     function_tests++;
49592 #endif
49593
49594     return(test_ret);
49595 }
49596
49597
49598 static int
49599 test_xmlXPathLeading(void) {
49600     int test_ret = 0;
49601
49602 #if defined(LIBXML_XPATH_ENABLED)
49603     int mem_base;
49604     xmlNodeSetPtr ret_val;
49605     xmlNodeSetPtr nodes1; /* a node-set */
49606     int n_nodes1;
49607     xmlNodeSetPtr nodes2; /* a node-set */
49608     int n_nodes2;
49609
49610     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49611     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49612         mem_base = xmlMemBlocks();
49613         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49614         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49615
49616         ret_val = xmlXPathLeading(nodes1, nodes2);
49617         desret_xmlNodeSetPtr(ret_val);
49618         call_tests++;
49619         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49620         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49621         xmlResetLastError();
49622         if (mem_base != xmlMemBlocks()) {
49623             printf("Leak of %d blocks found in xmlXPathLeading",
49624                    xmlMemBlocks() - mem_base);
49625             test_ret++;
49626             printf(" %d", n_nodes1);
49627             printf(" %d", n_nodes2);
49628             printf("\n");
49629         }
49630     }
49631     }
49632     function_tests++;
49633 #endif
49634
49635     return(test_ret);
49636 }
49637
49638
49639 static int
49640 test_xmlXPathLeadingSorted(void) {
49641     int test_ret = 0;
49642
49643 #if defined(LIBXML_XPATH_ENABLED)
49644     int mem_base;
49645     xmlNodeSetPtr ret_val;
49646     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
49647     int n_nodes1;
49648     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
49649     int n_nodes2;
49650
49651     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
49652     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
49653         mem_base = xmlMemBlocks();
49654         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
49655         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
49656
49657         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
49658         desret_xmlNodeSetPtr(ret_val);
49659         call_tests++;
49660         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
49661         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
49662         xmlResetLastError();
49663         if (mem_base != xmlMemBlocks()) {
49664             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
49665                    xmlMemBlocks() - mem_base);
49666             test_ret++;
49667             printf(" %d", n_nodes1);
49668             printf(" %d", n_nodes2);
49669             printf("\n");
49670         }
49671     }
49672     }
49673     function_tests++;
49674 #endif
49675
49676     return(test_ret);
49677 }
49678
49679
49680 static int
49681 test_xmlXPathLocalNameFunction(void) {
49682     int test_ret = 0;
49683
49684 #if defined(LIBXML_XPATH_ENABLED)
49685     int mem_base;
49686     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49687     int n_ctxt;
49688     int nargs; /* the number of arguments */
49689     int n_nargs;
49690
49691     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49692     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49693         mem_base = xmlMemBlocks();
49694         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49695         nargs = gen_int(n_nargs, 1);
49696
49697         xmlXPathLocalNameFunction(ctxt, nargs);
49698         call_tests++;
49699         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49700         des_int(n_nargs, nargs, 1);
49701         xmlResetLastError();
49702         if (mem_base != xmlMemBlocks()) {
49703             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
49704                    xmlMemBlocks() - mem_base);
49705             test_ret++;
49706             printf(" %d", n_ctxt);
49707             printf(" %d", n_nargs);
49708             printf("\n");
49709         }
49710     }
49711     }
49712     function_tests++;
49713 #endif
49714
49715     return(test_ret);
49716 }
49717
49718
49719 static int
49720 test_xmlXPathModValues(void) {
49721     int test_ret = 0;
49722
49723 #if defined(LIBXML_XPATH_ENABLED)
49724     int mem_base;
49725     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49726     int n_ctxt;
49727
49728     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49729         mem_base = xmlMemBlocks();
49730         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49731
49732         xmlXPathModValues(ctxt);
49733         call_tests++;
49734         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49735         xmlResetLastError();
49736         if (mem_base != xmlMemBlocks()) {
49737             printf("Leak of %d blocks found in xmlXPathModValues",
49738                    xmlMemBlocks() - mem_base);
49739             test_ret++;
49740             printf(" %d", n_ctxt);
49741             printf("\n");
49742         }
49743     }
49744     function_tests++;
49745 #endif
49746
49747     return(test_ret);
49748 }
49749
49750
49751 static int
49752 test_xmlXPathMultValues(void) {
49753     int test_ret = 0;
49754
49755 #if defined(LIBXML_XPATH_ENABLED)
49756     int mem_base;
49757     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49758     int n_ctxt;
49759
49760     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49761         mem_base = xmlMemBlocks();
49762         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49763
49764         xmlXPathMultValues(ctxt);
49765         call_tests++;
49766         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49767         xmlResetLastError();
49768         if (mem_base != xmlMemBlocks()) {
49769             printf("Leak of %d blocks found in xmlXPathMultValues",
49770                    xmlMemBlocks() - mem_base);
49771             test_ret++;
49772             printf(" %d", n_ctxt);
49773             printf("\n");
49774         }
49775     }
49776     function_tests++;
49777 #endif
49778
49779     return(test_ret);
49780 }
49781
49782
49783 static int
49784 test_xmlXPathNamespaceURIFunction(void) {
49785     int test_ret = 0;
49786
49787 #if defined(LIBXML_XPATH_ENABLED)
49788     int mem_base;
49789     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49790     int n_ctxt;
49791     int nargs; /* the number of arguments */
49792     int n_nargs;
49793
49794     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49795     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49796         mem_base = xmlMemBlocks();
49797         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49798         nargs = gen_int(n_nargs, 1);
49799
49800         xmlXPathNamespaceURIFunction(ctxt, nargs);
49801         call_tests++;
49802         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49803         des_int(n_nargs, nargs, 1);
49804         xmlResetLastError();
49805         if (mem_base != xmlMemBlocks()) {
49806             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
49807                    xmlMemBlocks() - mem_base);
49808             test_ret++;
49809             printf(" %d", n_ctxt);
49810             printf(" %d", n_nargs);
49811             printf("\n");
49812         }
49813     }
49814     }
49815     function_tests++;
49816 #endif
49817
49818     return(test_ret);
49819 }
49820
49821
49822 static int
49823 test_xmlXPathNewBoolean(void) {
49824     int test_ret = 0;
49825
49826 #if defined(LIBXML_XPATH_ENABLED)
49827     int mem_base;
49828     xmlXPathObjectPtr ret_val;
49829     int val; /* the boolean value */
49830     int n_val;
49831
49832     for (n_val = 0;n_val < gen_nb_int;n_val++) {
49833         mem_base = xmlMemBlocks();
49834         val = gen_int(n_val, 0);
49835
49836         ret_val = xmlXPathNewBoolean(val);
49837         desret_xmlXPathObjectPtr(ret_val);
49838         call_tests++;
49839         des_int(n_val, val, 0);
49840         xmlResetLastError();
49841         if (mem_base != xmlMemBlocks()) {
49842             printf("Leak of %d blocks found in xmlXPathNewBoolean",
49843                    xmlMemBlocks() - mem_base);
49844             test_ret++;
49845             printf(" %d", n_val);
49846             printf("\n");
49847         }
49848     }
49849     function_tests++;
49850 #endif
49851
49852     return(test_ret);
49853 }
49854
49855
49856 static int
49857 test_xmlXPathNewCString(void) {
49858     int test_ret = 0;
49859
49860 #if defined(LIBXML_XPATH_ENABLED)
49861     int mem_base;
49862     xmlXPathObjectPtr ret_val;
49863     char * val; /* the char * value */
49864     int n_val;
49865
49866     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
49867         mem_base = xmlMemBlocks();
49868         val = gen_const_char_ptr(n_val, 0);
49869
49870         ret_val = xmlXPathNewCString((const char *)val);
49871         desret_xmlXPathObjectPtr(ret_val);
49872         call_tests++;
49873         des_const_char_ptr(n_val, (const char *)val, 0);
49874         xmlResetLastError();
49875         if (mem_base != xmlMemBlocks()) {
49876             printf("Leak of %d blocks found in xmlXPathNewCString",
49877                    xmlMemBlocks() - mem_base);
49878             test_ret++;
49879             printf(" %d", n_val);
49880             printf("\n");
49881         }
49882     }
49883     function_tests++;
49884 #endif
49885
49886     return(test_ret);
49887 }
49888
49889
49890 static int
49891 test_xmlXPathNewFloat(void) {
49892     int test_ret = 0;
49893
49894 #if defined(LIBXML_XPATH_ENABLED)
49895     int mem_base;
49896     xmlXPathObjectPtr ret_val;
49897     double val; /* the double value */
49898     int n_val;
49899
49900     for (n_val = 0;n_val < gen_nb_double;n_val++) {
49901         mem_base = xmlMemBlocks();
49902         val = gen_double(n_val, 0);
49903
49904         ret_val = xmlXPathNewFloat(val);
49905         desret_xmlXPathObjectPtr(ret_val);
49906         call_tests++;
49907         des_double(n_val, val, 0);
49908         xmlResetLastError();
49909         if (mem_base != xmlMemBlocks()) {
49910             printf("Leak of %d blocks found in xmlXPathNewFloat",
49911                    xmlMemBlocks() - mem_base);
49912             test_ret++;
49913             printf(" %d", n_val);
49914             printf("\n");
49915         }
49916     }
49917     function_tests++;
49918 #endif
49919
49920     return(test_ret);
49921 }
49922
49923
49924 static int
49925 test_xmlXPathNewNodeSet(void) {
49926     int test_ret = 0;
49927
49928 #if defined(LIBXML_XPATH_ENABLED)
49929     int mem_base;
49930     xmlXPathObjectPtr ret_val;
49931     xmlNodePtr val; /* the NodePtr value */
49932     int n_val;
49933
49934     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
49935         mem_base = xmlMemBlocks();
49936         val = gen_xmlNodePtr(n_val, 0);
49937
49938         ret_val = xmlXPathNewNodeSet(val);
49939         desret_xmlXPathObjectPtr(ret_val);
49940         call_tests++;
49941         des_xmlNodePtr(n_val, val, 0);
49942         xmlResetLastError();
49943         if (mem_base != xmlMemBlocks()) {
49944             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
49945                    xmlMemBlocks() - mem_base);
49946             test_ret++;
49947             printf(" %d", n_val);
49948             printf("\n");
49949         }
49950     }
49951     function_tests++;
49952 #endif
49953
49954     return(test_ret);
49955 }
49956
49957
49958 static int
49959 test_xmlXPathNewNodeSetList(void) {
49960     int test_ret = 0;
49961
49962 #if defined(LIBXML_XPATH_ENABLED)
49963     int mem_base;
49964     xmlXPathObjectPtr ret_val;
49965     xmlNodeSetPtr val; /* an existing NodeSet */
49966     int n_val;
49967
49968     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
49969         mem_base = xmlMemBlocks();
49970         val = gen_xmlNodeSetPtr(n_val, 0);
49971
49972         ret_val = xmlXPathNewNodeSetList(val);
49973         desret_xmlXPathObjectPtr(ret_val);
49974         call_tests++;
49975         des_xmlNodeSetPtr(n_val, val, 0);
49976         xmlResetLastError();
49977         if (mem_base != xmlMemBlocks()) {
49978             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
49979                    xmlMemBlocks() - mem_base);
49980             test_ret++;
49981             printf(" %d", n_val);
49982             printf("\n");
49983         }
49984     }
49985     function_tests++;
49986 #endif
49987
49988     return(test_ret);
49989 }
49990
49991
49992 static int
49993 test_xmlXPathNewParserContext(void) {
49994     int test_ret = 0;
49995
49996
49997     /* missing type support */
49998     return(test_ret);
49999 }
50000
50001
50002 static int
50003 test_xmlXPathNewString(void) {
50004     int test_ret = 0;
50005
50006 #if defined(LIBXML_XPATH_ENABLED)
50007     int mem_base;
50008     xmlXPathObjectPtr ret_val;
50009     xmlChar * val; /* the xmlChar * value */
50010     int n_val;
50011
50012     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
50013         mem_base = xmlMemBlocks();
50014         val = gen_const_xmlChar_ptr(n_val, 0);
50015
50016         ret_val = xmlXPathNewString((const xmlChar *)val);
50017         desret_xmlXPathObjectPtr(ret_val);
50018         call_tests++;
50019         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
50020         xmlResetLastError();
50021         if (mem_base != xmlMemBlocks()) {
50022             printf("Leak of %d blocks found in xmlXPathNewString",
50023                    xmlMemBlocks() - mem_base);
50024             test_ret++;
50025             printf(" %d", n_val);
50026             printf("\n");
50027         }
50028     }
50029     function_tests++;
50030 #endif
50031
50032     return(test_ret);
50033 }
50034
50035
50036 static int
50037 test_xmlXPathNextAncestor(void) {
50038     int test_ret = 0;
50039
50040 #if defined(LIBXML_XPATH_ENABLED)
50041     int mem_base;
50042     xmlNodePtr ret_val;
50043     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50044     int n_ctxt;
50045     xmlNodePtr cur; /* the current node in the traversal */
50046     int n_cur;
50047
50048     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50049     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50050         mem_base = xmlMemBlocks();
50051         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50052         cur = gen_xmlNodePtr(n_cur, 1);
50053
50054         ret_val = xmlXPathNextAncestor(ctxt, cur);
50055         desret_xmlNodePtr(ret_val);
50056         call_tests++;
50057         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50058         des_xmlNodePtr(n_cur, cur, 1);
50059         xmlResetLastError();
50060         if (mem_base != xmlMemBlocks()) {
50061             printf("Leak of %d blocks found in xmlXPathNextAncestor",
50062                    xmlMemBlocks() - mem_base);
50063             test_ret++;
50064             printf(" %d", n_ctxt);
50065             printf(" %d", n_cur);
50066             printf("\n");
50067         }
50068     }
50069     }
50070     function_tests++;
50071 #endif
50072
50073     return(test_ret);
50074 }
50075
50076
50077 static int
50078 test_xmlXPathNextAncestorOrSelf(void) {
50079     int test_ret = 0;
50080
50081 #if defined(LIBXML_XPATH_ENABLED)
50082     int mem_base;
50083     xmlNodePtr ret_val;
50084     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50085     int n_ctxt;
50086     xmlNodePtr cur; /* the current node in the traversal */
50087     int n_cur;
50088
50089     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50090     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50091         mem_base = xmlMemBlocks();
50092         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50093         cur = gen_xmlNodePtr(n_cur, 1);
50094
50095         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
50096         desret_xmlNodePtr(ret_val);
50097         call_tests++;
50098         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50099         des_xmlNodePtr(n_cur, cur, 1);
50100         xmlResetLastError();
50101         if (mem_base != xmlMemBlocks()) {
50102             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
50103                    xmlMemBlocks() - mem_base);
50104             test_ret++;
50105             printf(" %d", n_ctxt);
50106             printf(" %d", n_cur);
50107             printf("\n");
50108         }
50109     }
50110     }
50111     function_tests++;
50112 #endif
50113
50114     return(test_ret);
50115 }
50116
50117
50118 static int
50119 test_xmlXPathNextAttribute(void) {
50120     int test_ret = 0;
50121
50122 #if defined(LIBXML_XPATH_ENABLED)
50123     int mem_base;
50124     xmlNodePtr ret_val;
50125     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50126     int n_ctxt;
50127     xmlNodePtr cur; /* the current attribute in the traversal */
50128     int n_cur;
50129
50130     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50131     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50132         mem_base = xmlMemBlocks();
50133         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50134         cur = gen_xmlNodePtr(n_cur, 1);
50135
50136         ret_val = xmlXPathNextAttribute(ctxt, cur);
50137         desret_xmlNodePtr(ret_val);
50138         call_tests++;
50139         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50140         des_xmlNodePtr(n_cur, cur, 1);
50141         xmlResetLastError();
50142         if (mem_base != xmlMemBlocks()) {
50143             printf("Leak of %d blocks found in xmlXPathNextAttribute",
50144                    xmlMemBlocks() - mem_base);
50145             test_ret++;
50146             printf(" %d", n_ctxt);
50147             printf(" %d", n_cur);
50148             printf("\n");
50149         }
50150     }
50151     }
50152     function_tests++;
50153 #endif
50154
50155     return(test_ret);
50156 }
50157
50158
50159 static int
50160 test_xmlXPathNextChild(void) {
50161     int test_ret = 0;
50162
50163 #if defined(LIBXML_XPATH_ENABLED)
50164     int mem_base;
50165     xmlNodePtr ret_val;
50166     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50167     int n_ctxt;
50168     xmlNodePtr cur; /* the current node in the traversal */
50169     int n_cur;
50170
50171     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50172     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50173         mem_base = xmlMemBlocks();
50174         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50175         cur = gen_xmlNodePtr(n_cur, 1);
50176
50177         ret_val = xmlXPathNextChild(ctxt, cur);
50178         desret_xmlNodePtr(ret_val);
50179         call_tests++;
50180         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50181         des_xmlNodePtr(n_cur, cur, 1);
50182         xmlResetLastError();
50183         if (mem_base != xmlMemBlocks()) {
50184             printf("Leak of %d blocks found in xmlXPathNextChild",
50185                    xmlMemBlocks() - mem_base);
50186             test_ret++;
50187             printf(" %d", n_ctxt);
50188             printf(" %d", n_cur);
50189             printf("\n");
50190         }
50191     }
50192     }
50193     function_tests++;
50194 #endif
50195
50196     return(test_ret);
50197 }
50198
50199
50200 static int
50201 test_xmlXPathNextDescendant(void) {
50202     int test_ret = 0;
50203
50204 #if defined(LIBXML_XPATH_ENABLED)
50205     int mem_base;
50206     xmlNodePtr ret_val;
50207     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50208     int n_ctxt;
50209     xmlNodePtr cur; /* the current node in the traversal */
50210     int n_cur;
50211
50212     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50213     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50214         mem_base = xmlMemBlocks();
50215         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50216         cur = gen_xmlNodePtr(n_cur, 1);
50217
50218         ret_val = xmlXPathNextDescendant(ctxt, cur);
50219         desret_xmlNodePtr(ret_val);
50220         call_tests++;
50221         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50222         des_xmlNodePtr(n_cur, cur, 1);
50223         xmlResetLastError();
50224         if (mem_base != xmlMemBlocks()) {
50225             printf("Leak of %d blocks found in xmlXPathNextDescendant",
50226                    xmlMemBlocks() - mem_base);
50227             test_ret++;
50228             printf(" %d", n_ctxt);
50229             printf(" %d", n_cur);
50230             printf("\n");
50231         }
50232     }
50233     }
50234     function_tests++;
50235 #endif
50236
50237     return(test_ret);
50238 }
50239
50240
50241 static int
50242 test_xmlXPathNextDescendantOrSelf(void) {
50243     int test_ret = 0;
50244
50245 #if defined(LIBXML_XPATH_ENABLED)
50246     int mem_base;
50247     xmlNodePtr ret_val;
50248     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50249     int n_ctxt;
50250     xmlNodePtr cur; /* the current node in the traversal */
50251     int n_cur;
50252
50253     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50254     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50255         mem_base = xmlMemBlocks();
50256         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50257         cur = gen_xmlNodePtr(n_cur, 1);
50258
50259         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
50260         desret_xmlNodePtr(ret_val);
50261         call_tests++;
50262         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50263         des_xmlNodePtr(n_cur, cur, 1);
50264         xmlResetLastError();
50265         if (mem_base != xmlMemBlocks()) {
50266             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
50267                    xmlMemBlocks() - mem_base);
50268             test_ret++;
50269             printf(" %d", n_ctxt);
50270             printf(" %d", n_cur);
50271             printf("\n");
50272         }
50273     }
50274     }
50275     function_tests++;
50276 #endif
50277
50278     return(test_ret);
50279 }
50280
50281
50282 static int
50283 test_xmlXPathNextFollowing(void) {
50284     int test_ret = 0;
50285
50286 #if defined(LIBXML_XPATH_ENABLED)
50287     int mem_base;
50288     xmlNodePtr ret_val;
50289     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50290     int n_ctxt;
50291     xmlNodePtr cur; /* the current node in the traversal */
50292     int n_cur;
50293
50294     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50295     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50296         mem_base = xmlMemBlocks();
50297         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50298         cur = gen_xmlNodePtr(n_cur, 1);
50299
50300         ret_val = xmlXPathNextFollowing(ctxt, cur);
50301         desret_xmlNodePtr(ret_val);
50302         call_tests++;
50303         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50304         des_xmlNodePtr(n_cur, cur, 1);
50305         xmlResetLastError();
50306         if (mem_base != xmlMemBlocks()) {
50307             printf("Leak of %d blocks found in xmlXPathNextFollowing",
50308                    xmlMemBlocks() - mem_base);
50309             test_ret++;
50310             printf(" %d", n_ctxt);
50311             printf(" %d", n_cur);
50312             printf("\n");
50313         }
50314     }
50315     }
50316     function_tests++;
50317 #endif
50318
50319     return(test_ret);
50320 }
50321
50322
50323 static int
50324 test_xmlXPathNextFollowingSibling(void) {
50325     int test_ret = 0;
50326
50327 #if defined(LIBXML_XPATH_ENABLED)
50328     int mem_base;
50329     xmlNodePtr ret_val;
50330     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50331     int n_ctxt;
50332     xmlNodePtr cur; /* the current node in the traversal */
50333     int n_cur;
50334
50335     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50336     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50337         mem_base = xmlMemBlocks();
50338         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50339         cur = gen_xmlNodePtr(n_cur, 1);
50340
50341         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
50342         desret_xmlNodePtr(ret_val);
50343         call_tests++;
50344         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50345         des_xmlNodePtr(n_cur, cur, 1);
50346         xmlResetLastError();
50347         if (mem_base != xmlMemBlocks()) {
50348             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
50349                    xmlMemBlocks() - mem_base);
50350             test_ret++;
50351             printf(" %d", n_ctxt);
50352             printf(" %d", n_cur);
50353             printf("\n");
50354         }
50355     }
50356     }
50357     function_tests++;
50358 #endif
50359
50360     return(test_ret);
50361 }
50362
50363
50364 static int
50365 test_xmlXPathNextNamespace(void) {
50366     int test_ret = 0;
50367
50368 #if defined(LIBXML_XPATH_ENABLED)
50369     int mem_base;
50370     xmlNodePtr ret_val;
50371     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50372     int n_ctxt;
50373     xmlNodePtr cur; /* the current attribute in the traversal */
50374     int n_cur;
50375
50376     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50377     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50378         mem_base = xmlMemBlocks();
50379         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50380         cur = gen_xmlNodePtr(n_cur, 1);
50381
50382         ret_val = xmlXPathNextNamespace(ctxt, cur);
50383         desret_xmlNodePtr(ret_val);
50384         call_tests++;
50385         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50386         des_xmlNodePtr(n_cur, cur, 1);
50387         xmlResetLastError();
50388         if (mem_base != xmlMemBlocks()) {
50389             printf("Leak of %d blocks found in xmlXPathNextNamespace",
50390                    xmlMemBlocks() - mem_base);
50391             test_ret++;
50392             printf(" %d", n_ctxt);
50393             printf(" %d", n_cur);
50394             printf("\n");
50395         }
50396     }
50397     }
50398     function_tests++;
50399 #endif
50400
50401     return(test_ret);
50402 }
50403
50404
50405 static int
50406 test_xmlXPathNextParent(void) {
50407     int test_ret = 0;
50408
50409 #if defined(LIBXML_XPATH_ENABLED)
50410     int mem_base;
50411     xmlNodePtr ret_val;
50412     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50413     int n_ctxt;
50414     xmlNodePtr cur; /* the current node in the traversal */
50415     int n_cur;
50416
50417     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50418     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50419         mem_base = xmlMemBlocks();
50420         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50421         cur = gen_xmlNodePtr(n_cur, 1);
50422
50423         ret_val = xmlXPathNextParent(ctxt, cur);
50424         desret_xmlNodePtr(ret_val);
50425         call_tests++;
50426         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50427         des_xmlNodePtr(n_cur, cur, 1);
50428         xmlResetLastError();
50429         if (mem_base != xmlMemBlocks()) {
50430             printf("Leak of %d blocks found in xmlXPathNextParent",
50431                    xmlMemBlocks() - mem_base);
50432             test_ret++;
50433             printf(" %d", n_ctxt);
50434             printf(" %d", n_cur);
50435             printf("\n");
50436         }
50437     }
50438     }
50439     function_tests++;
50440 #endif
50441
50442     return(test_ret);
50443 }
50444
50445
50446 static int
50447 test_xmlXPathNextPreceding(void) {
50448     int test_ret = 0;
50449
50450 #if defined(LIBXML_XPATH_ENABLED)
50451     int mem_base;
50452     xmlNodePtr ret_val;
50453     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50454     int n_ctxt;
50455     xmlNodePtr cur; /* the current node in the traversal */
50456     int n_cur;
50457
50458     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50459     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50460         mem_base = xmlMemBlocks();
50461         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50462         cur = gen_xmlNodePtr(n_cur, 1);
50463
50464         ret_val = xmlXPathNextPreceding(ctxt, cur);
50465         desret_xmlNodePtr(ret_val);
50466         call_tests++;
50467         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50468         des_xmlNodePtr(n_cur, cur, 1);
50469         xmlResetLastError();
50470         if (mem_base != xmlMemBlocks()) {
50471             printf("Leak of %d blocks found in xmlXPathNextPreceding",
50472                    xmlMemBlocks() - mem_base);
50473             test_ret++;
50474             printf(" %d", n_ctxt);
50475             printf(" %d", n_cur);
50476             printf("\n");
50477         }
50478     }
50479     }
50480     function_tests++;
50481 #endif
50482
50483     return(test_ret);
50484 }
50485
50486
50487 static int
50488 test_xmlXPathNextPrecedingSibling(void) {
50489     int test_ret = 0;
50490
50491 #if defined(LIBXML_XPATH_ENABLED)
50492     int mem_base;
50493     xmlNodePtr ret_val;
50494     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50495     int n_ctxt;
50496     xmlNodePtr cur; /* the current node in the traversal */
50497     int n_cur;
50498
50499     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50500     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50501         mem_base = xmlMemBlocks();
50502         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50503         cur = gen_xmlNodePtr(n_cur, 1);
50504
50505         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
50506         desret_xmlNodePtr(ret_val);
50507         call_tests++;
50508         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50509         des_xmlNodePtr(n_cur, cur, 1);
50510         xmlResetLastError();
50511         if (mem_base != xmlMemBlocks()) {
50512             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
50513                    xmlMemBlocks() - mem_base);
50514             test_ret++;
50515             printf(" %d", n_ctxt);
50516             printf(" %d", n_cur);
50517             printf("\n");
50518         }
50519     }
50520     }
50521     function_tests++;
50522 #endif
50523
50524     return(test_ret);
50525 }
50526
50527
50528 static int
50529 test_xmlXPathNextSelf(void) {
50530     int test_ret = 0;
50531
50532 #if defined(LIBXML_XPATH_ENABLED)
50533     int mem_base;
50534     xmlNodePtr ret_val;
50535     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50536     int n_ctxt;
50537     xmlNodePtr cur; /* the current node in the traversal */
50538     int n_cur;
50539
50540     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50541     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
50542         mem_base = xmlMemBlocks();
50543         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50544         cur = gen_xmlNodePtr(n_cur, 1);
50545
50546         ret_val = xmlXPathNextSelf(ctxt, cur);
50547         desret_xmlNodePtr(ret_val);
50548         call_tests++;
50549         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50550         des_xmlNodePtr(n_cur, cur, 1);
50551         xmlResetLastError();
50552         if (mem_base != xmlMemBlocks()) {
50553             printf("Leak of %d blocks found in xmlXPathNextSelf",
50554                    xmlMemBlocks() - mem_base);
50555             test_ret++;
50556             printf(" %d", n_ctxt);
50557             printf(" %d", n_cur);
50558             printf("\n");
50559         }
50560     }
50561     }
50562     function_tests++;
50563 #endif
50564
50565     return(test_ret);
50566 }
50567
50568
50569 static int
50570 test_xmlXPathNodeLeading(void) {
50571     int test_ret = 0;
50572
50573 #if defined(LIBXML_XPATH_ENABLED)
50574     int mem_base;
50575     xmlNodeSetPtr ret_val;
50576     xmlNodeSetPtr nodes; /* a node-set */
50577     int n_nodes;
50578     xmlNodePtr node; /* a node */
50579     int n_node;
50580
50581     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
50582     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
50583         mem_base = xmlMemBlocks();
50584         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
50585         node = gen_xmlNodePtr(n_node, 1);
50586
50587         ret_val = xmlXPathNodeLeading(nodes, node);
50588         desret_xmlNodeSetPtr(ret_val);
50589         call_tests++;
50590         des_xmlNodeSetPtr(n_nodes, nodes, 0);
50591         des_xmlNodePtr(n_node, node, 1);
50592         xmlResetLastError();
50593         if (mem_base != xmlMemBlocks()) {
50594             printf("Leak of %d blocks found in xmlXPathNodeLeading",
50595                    xmlMemBlocks() - mem_base);
50596             test_ret++;
50597             printf(" %d", n_nodes);
50598             printf(" %d", n_node);
50599             printf("\n");
50600         }
50601     }
50602     }
50603     function_tests++;
50604 #endif
50605
50606     return(test_ret);
50607 }
50608
50609
50610 static int
50611 test_xmlXPathNodeLeadingSorted(void) {
50612     int test_ret = 0;
50613
50614 #if defined(LIBXML_XPATH_ENABLED)
50615     int mem_base;
50616     xmlNodeSetPtr ret_val;
50617     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
50618     int n_nodes;
50619     xmlNodePtr node; /* a node */
50620     int n_node;
50621
50622     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
50623     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
50624         mem_base = xmlMemBlocks();
50625         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
50626         node = gen_xmlNodePtr(n_node, 1);
50627
50628         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
50629         desret_xmlNodeSetPtr(ret_val);
50630         call_tests++;
50631         des_xmlNodeSetPtr(n_nodes, nodes, 0);
50632         des_xmlNodePtr(n_node, node, 1);
50633         xmlResetLastError();
50634         if (mem_base != xmlMemBlocks()) {
50635             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
50636                    xmlMemBlocks() - mem_base);
50637             test_ret++;
50638             printf(" %d", n_nodes);
50639             printf(" %d", n_node);
50640             printf("\n");
50641         }
50642     }
50643     }
50644     function_tests++;
50645 #endif
50646
50647     return(test_ret);
50648 }
50649
50650
50651 static int
50652 test_xmlXPathNodeSetAdd(void) {
50653     int test_ret = 0;
50654
50655 #if defined(LIBXML_XPATH_ENABLED)
50656     int mem_base;
50657     int ret_val;
50658     xmlNodeSetPtr cur; /* the initial node set */
50659     int n_cur;
50660     xmlNodePtr val; /* a new xmlNodePtr */
50661     int n_val;
50662
50663     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50664     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
50665         mem_base = xmlMemBlocks();
50666         cur = gen_xmlNodeSetPtr(n_cur, 0);
50667         val = gen_xmlNodePtr(n_val, 1);
50668
50669         ret_val = xmlXPathNodeSetAdd(cur, val);
50670         desret_int(ret_val);
50671         call_tests++;
50672         des_xmlNodeSetPtr(n_cur, cur, 0);
50673         des_xmlNodePtr(n_val, val, 1);
50674         xmlResetLastError();
50675         if (mem_base != xmlMemBlocks()) {
50676             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
50677                    xmlMemBlocks() - mem_base);
50678             test_ret++;
50679             printf(" %d", n_cur);
50680             printf(" %d", n_val);
50681             printf("\n");
50682         }
50683     }
50684     }
50685     function_tests++;
50686 #endif
50687
50688     return(test_ret);
50689 }
50690
50691
50692 static int
50693 test_xmlXPathNodeSetAddNs(void) {
50694     int test_ret = 0;
50695
50696 #if defined(LIBXML_XPATH_ENABLED)
50697     int mem_base;
50698     int ret_val;
50699     xmlNodeSetPtr cur; /* the initial node set */
50700     int n_cur;
50701     xmlNodePtr node; /* the hosting node */
50702     int n_node;
50703     xmlNsPtr ns; /* a the namespace node */
50704     int n_ns;
50705
50706     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50707     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
50708     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
50709         mem_base = xmlMemBlocks();
50710         cur = gen_xmlNodeSetPtr(n_cur, 0);
50711         node = gen_xmlNodePtr(n_node, 1);
50712         ns = gen_xmlNsPtr(n_ns, 2);
50713
50714         ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
50715         desret_int(ret_val);
50716         call_tests++;
50717         des_xmlNodeSetPtr(n_cur, cur, 0);
50718         des_xmlNodePtr(n_node, node, 1);
50719         des_xmlNsPtr(n_ns, ns, 2);
50720         xmlResetLastError();
50721         if (mem_base != xmlMemBlocks()) {
50722             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
50723                    xmlMemBlocks() - mem_base);
50724             test_ret++;
50725             printf(" %d", n_cur);
50726             printf(" %d", n_node);
50727             printf(" %d", n_ns);
50728             printf("\n");
50729         }
50730     }
50731     }
50732     }
50733     function_tests++;
50734 #endif
50735
50736     return(test_ret);
50737 }
50738
50739
50740 static int
50741 test_xmlXPathNodeSetAddUnique(void) {
50742     int test_ret = 0;
50743
50744 #if defined(LIBXML_XPATH_ENABLED)
50745     int mem_base;
50746     int ret_val;
50747     xmlNodeSetPtr cur; /* the initial node set */
50748     int n_cur;
50749     xmlNodePtr val; /* a new xmlNodePtr */
50750     int n_val;
50751
50752     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50753     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
50754         mem_base = xmlMemBlocks();
50755         cur = gen_xmlNodeSetPtr(n_cur, 0);
50756         val = gen_xmlNodePtr(n_val, 1);
50757
50758         ret_val = xmlXPathNodeSetAddUnique(cur, val);
50759         desret_int(ret_val);
50760         call_tests++;
50761         des_xmlNodeSetPtr(n_cur, cur, 0);
50762         des_xmlNodePtr(n_val, val, 1);
50763         xmlResetLastError();
50764         if (mem_base != xmlMemBlocks()) {
50765             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
50766                    xmlMemBlocks() - mem_base);
50767             test_ret++;
50768             printf(" %d", n_cur);
50769             printf(" %d", n_val);
50770             printf("\n");
50771         }
50772     }
50773     }
50774     function_tests++;
50775 #endif
50776
50777     return(test_ret);
50778 }
50779
50780
50781 static int
50782 test_xmlXPathNodeSetContains(void) {
50783     int test_ret = 0;
50784
50785 #if defined(LIBXML_XPATH_ENABLED)
50786     int mem_base;
50787     int ret_val;
50788     xmlNodeSetPtr cur; /* the node-set */
50789     int n_cur;
50790     xmlNodePtr val; /* the node */
50791     int n_val;
50792
50793     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50794     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
50795         mem_base = xmlMemBlocks();
50796         cur = gen_xmlNodeSetPtr(n_cur, 0);
50797         val = gen_xmlNodePtr(n_val, 1);
50798
50799         ret_val = xmlXPathNodeSetContains(cur, val);
50800         desret_int(ret_val);
50801         call_tests++;
50802         des_xmlNodeSetPtr(n_cur, cur, 0);
50803         des_xmlNodePtr(n_val, val, 1);
50804         xmlResetLastError();
50805         if (mem_base != xmlMemBlocks()) {
50806             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
50807                    xmlMemBlocks() - mem_base);
50808             test_ret++;
50809             printf(" %d", n_cur);
50810             printf(" %d", n_val);
50811             printf("\n");
50812         }
50813     }
50814     }
50815     function_tests++;
50816 #endif
50817
50818     return(test_ret);
50819 }
50820
50821
50822 static int
50823 test_xmlXPathNodeSetDel(void) {
50824     int test_ret = 0;
50825
50826 #if defined(LIBXML_XPATH_ENABLED)
50827     int mem_base;
50828     xmlNodeSetPtr cur; /* the initial node set */
50829     int n_cur;
50830     xmlNodePtr val; /* an xmlNodePtr */
50831     int n_val;
50832
50833     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50834     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
50835         mem_base = xmlMemBlocks();
50836         cur = gen_xmlNodeSetPtr(n_cur, 0);
50837         val = gen_xmlNodePtr(n_val, 1);
50838
50839         xmlXPathNodeSetDel(cur, val);
50840         call_tests++;
50841         des_xmlNodeSetPtr(n_cur, cur, 0);
50842         des_xmlNodePtr(n_val, val, 1);
50843         xmlResetLastError();
50844         if (mem_base != xmlMemBlocks()) {
50845             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
50846                    xmlMemBlocks() - mem_base);
50847             test_ret++;
50848             printf(" %d", n_cur);
50849             printf(" %d", n_val);
50850             printf("\n");
50851         }
50852     }
50853     }
50854     function_tests++;
50855 #endif
50856
50857     return(test_ret);
50858 }
50859
50860
50861 static int
50862 test_xmlXPathNodeSetMerge(void) {
50863     int test_ret = 0;
50864
50865 #if defined(LIBXML_XPATH_ENABLED)
50866     int mem_base;
50867     xmlNodeSetPtr ret_val;
50868     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
50869     int n_val1;
50870     xmlNodeSetPtr val2; /* the second NodeSet */
50871     int n_val2;
50872
50873     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
50874     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
50875         mem_base = xmlMemBlocks();
50876         val1 = gen_xmlNodeSetPtr(n_val1, 0);
50877         val2 = gen_xmlNodeSetPtr(n_val2, 1);
50878
50879         ret_val = xmlXPathNodeSetMerge(val1, val2);
50880         desret_xmlNodeSetPtr(ret_val);
50881         call_tests++;
50882         des_xmlNodeSetPtr(n_val1, val1, 0);
50883         des_xmlNodeSetPtr(n_val2, val2, 1);
50884         xmlResetLastError();
50885         if (mem_base != xmlMemBlocks()) {
50886             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
50887                    xmlMemBlocks() - mem_base);
50888             test_ret++;
50889             printf(" %d", n_val1);
50890             printf(" %d", n_val2);
50891             printf("\n");
50892         }
50893     }
50894     }
50895     function_tests++;
50896 #endif
50897
50898     return(test_ret);
50899 }
50900
50901
50902 static int
50903 test_xmlXPathNodeSetRemove(void) {
50904     int test_ret = 0;
50905
50906 #if defined(LIBXML_XPATH_ENABLED)
50907     int mem_base;
50908     xmlNodeSetPtr cur; /* the initial node set */
50909     int n_cur;
50910     int val; /* the index to remove */
50911     int n_val;
50912
50913     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
50914     for (n_val = 0;n_val < gen_nb_int;n_val++) {
50915         mem_base = xmlMemBlocks();
50916         cur = gen_xmlNodeSetPtr(n_cur, 0);
50917         val = gen_int(n_val, 1);
50918
50919         xmlXPathNodeSetRemove(cur, val);
50920         call_tests++;
50921         des_xmlNodeSetPtr(n_cur, cur, 0);
50922         des_int(n_val, val, 1);
50923         xmlResetLastError();
50924         if (mem_base != xmlMemBlocks()) {
50925             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
50926                    xmlMemBlocks() - mem_base);
50927             test_ret++;
50928             printf(" %d", n_cur);
50929             printf(" %d", n_val);
50930             printf("\n");
50931         }
50932     }
50933     }
50934     function_tests++;
50935 #endif
50936
50937     return(test_ret);
50938 }
50939
50940
50941 static int
50942 test_xmlXPathNodeSetSort(void) {
50943     int test_ret = 0;
50944
50945 #if defined(LIBXML_XPATH_ENABLED)
50946     int mem_base;
50947     xmlNodeSetPtr set; /* the node set */
50948     int n_set;
50949
50950     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
50951         mem_base = xmlMemBlocks();
50952         set = gen_xmlNodeSetPtr(n_set, 0);
50953
50954         xmlXPathNodeSetSort(set);
50955         call_tests++;
50956         des_xmlNodeSetPtr(n_set, set, 0);
50957         xmlResetLastError();
50958         if (mem_base != xmlMemBlocks()) {
50959             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
50960                    xmlMemBlocks() - mem_base);
50961             test_ret++;
50962             printf(" %d", n_set);
50963             printf("\n");
50964         }
50965     }
50966     function_tests++;
50967 #endif
50968
50969     return(test_ret);
50970 }
50971
50972
50973 static int
50974 test_xmlXPathNodeTrailing(void) {
50975     int test_ret = 0;
50976
50977 #if defined(LIBXML_XPATH_ENABLED)
50978     int mem_base;
50979     xmlNodeSetPtr ret_val;
50980     xmlNodeSetPtr nodes; /* a node-set */
50981     int n_nodes;
50982     xmlNodePtr node; /* a node */
50983     int n_node;
50984
50985     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
50986     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
50987         mem_base = xmlMemBlocks();
50988         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
50989         node = gen_xmlNodePtr(n_node, 1);
50990
50991         ret_val = xmlXPathNodeTrailing(nodes, node);
50992         desret_xmlNodeSetPtr(ret_val);
50993         call_tests++;
50994         des_xmlNodeSetPtr(n_nodes, nodes, 0);
50995         des_xmlNodePtr(n_node, node, 1);
50996         xmlResetLastError();
50997         if (mem_base != xmlMemBlocks()) {
50998             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
50999                    xmlMemBlocks() - mem_base);
51000             test_ret++;
51001             printf(" %d", n_nodes);
51002             printf(" %d", n_node);
51003             printf("\n");
51004         }
51005     }
51006     }
51007     function_tests++;
51008 #endif
51009
51010     return(test_ret);
51011 }
51012
51013
51014 static int
51015 test_xmlXPathNodeTrailingSorted(void) {
51016     int test_ret = 0;
51017
51018 #if defined(LIBXML_XPATH_ENABLED)
51019     int mem_base;
51020     xmlNodeSetPtr ret_val;
51021     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
51022     int n_nodes;
51023     xmlNodePtr node; /* a node */
51024     int n_node;
51025
51026     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
51027     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
51028         mem_base = xmlMemBlocks();
51029         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
51030         node = gen_xmlNodePtr(n_node, 1);
51031
51032         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
51033         desret_xmlNodeSetPtr(ret_val);
51034         call_tests++;
51035         des_xmlNodeSetPtr(n_nodes, nodes, 0);
51036         des_xmlNodePtr(n_node, node, 1);
51037         xmlResetLastError();
51038         if (mem_base != xmlMemBlocks()) {
51039             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
51040                    xmlMemBlocks() - mem_base);
51041             test_ret++;
51042             printf(" %d", n_nodes);
51043             printf(" %d", n_node);
51044             printf("\n");
51045         }
51046     }
51047     }
51048     function_tests++;
51049 #endif
51050
51051     return(test_ret);
51052 }
51053
51054
51055 static int
51056 test_xmlXPathNormalizeFunction(void) {
51057     int test_ret = 0;
51058
51059 #if defined(LIBXML_XPATH_ENABLED)
51060     int mem_base;
51061     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51062     int n_ctxt;
51063     int nargs; /* the number of arguments */
51064     int n_nargs;
51065
51066     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51067     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51068         mem_base = xmlMemBlocks();
51069         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51070         nargs = gen_int(n_nargs, 1);
51071
51072         xmlXPathNormalizeFunction(ctxt, nargs);
51073         call_tests++;
51074         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51075         des_int(n_nargs, nargs, 1);
51076         xmlResetLastError();
51077         if (mem_base != xmlMemBlocks()) {
51078             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
51079                    xmlMemBlocks() - mem_base);
51080             test_ret++;
51081             printf(" %d", n_ctxt);
51082             printf(" %d", n_nargs);
51083             printf("\n");
51084         }
51085     }
51086     }
51087     function_tests++;
51088 #endif
51089
51090     return(test_ret);
51091 }
51092
51093
51094 static int
51095 test_xmlXPathNotEqualValues(void) {
51096     int test_ret = 0;
51097
51098 #if defined(LIBXML_XPATH_ENABLED)
51099     int mem_base;
51100     int ret_val;
51101     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51102     int n_ctxt;
51103
51104     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51105         mem_base = xmlMemBlocks();
51106         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51107
51108         ret_val = xmlXPathNotEqualValues(ctxt);
51109         desret_int(ret_val);
51110         call_tests++;
51111         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51112         xmlResetLastError();
51113         if (mem_base != xmlMemBlocks()) {
51114             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
51115                    xmlMemBlocks() - mem_base);
51116             test_ret++;
51117             printf(" %d", n_ctxt);
51118             printf("\n");
51119         }
51120     }
51121     function_tests++;
51122 #endif
51123
51124     return(test_ret);
51125 }
51126
51127
51128 static int
51129 test_xmlXPathNotFunction(void) {
51130     int test_ret = 0;
51131
51132 #if defined(LIBXML_XPATH_ENABLED)
51133     int mem_base;
51134     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51135     int n_ctxt;
51136     int nargs; /* the number of arguments */
51137     int n_nargs;
51138
51139     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51140     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51141         mem_base = xmlMemBlocks();
51142         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51143         nargs = gen_int(n_nargs, 1);
51144
51145         xmlXPathNotFunction(ctxt, nargs);
51146         call_tests++;
51147         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51148         des_int(n_nargs, nargs, 1);
51149         xmlResetLastError();
51150         if (mem_base != xmlMemBlocks()) {
51151             printf("Leak of %d blocks found in xmlXPathNotFunction",
51152                    xmlMemBlocks() - mem_base);
51153             test_ret++;
51154             printf(" %d", n_ctxt);
51155             printf(" %d", n_nargs);
51156             printf("\n");
51157         }
51158     }
51159     }
51160     function_tests++;
51161 #endif
51162
51163     return(test_ret);
51164 }
51165
51166
51167 static int
51168 test_xmlXPathNsLookup(void) {
51169     int test_ret = 0;
51170
51171 #if defined(LIBXML_XPATH_ENABLED)
51172     int mem_base;
51173     const xmlChar * ret_val;
51174     xmlXPathContextPtr ctxt; /* the XPath context */
51175     int n_ctxt;
51176     xmlChar * prefix; /* the namespace prefix value */
51177     int n_prefix;
51178
51179     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51180     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
51181         mem_base = xmlMemBlocks();
51182         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51183         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
51184
51185         ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
51186         desret_const_xmlChar_ptr(ret_val);
51187         call_tests++;
51188         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51189         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
51190         xmlResetLastError();
51191         if (mem_base != xmlMemBlocks()) {
51192             printf("Leak of %d blocks found in xmlXPathNsLookup",
51193                    xmlMemBlocks() - mem_base);
51194             test_ret++;
51195             printf(" %d", n_ctxt);
51196             printf(" %d", n_prefix);
51197             printf("\n");
51198         }
51199     }
51200     }
51201     function_tests++;
51202 #endif
51203
51204     return(test_ret);
51205 }
51206
51207
51208 static int
51209 test_xmlXPathNumberFunction(void) {
51210     int test_ret = 0;
51211
51212 #if defined(LIBXML_XPATH_ENABLED)
51213     int mem_base;
51214     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51215     int n_ctxt;
51216     int nargs; /* the number of arguments */
51217     int n_nargs;
51218
51219     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51220     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51221         mem_base = xmlMemBlocks();
51222         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51223         nargs = gen_int(n_nargs, 1);
51224
51225         xmlXPathNumberFunction(ctxt, nargs);
51226         call_tests++;
51227         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51228         des_int(n_nargs, nargs, 1);
51229         xmlResetLastError();
51230         if (mem_base != xmlMemBlocks()) {
51231             printf("Leak of %d blocks found in xmlXPathNumberFunction",
51232                    xmlMemBlocks() - mem_base);
51233             test_ret++;
51234             printf(" %d", n_ctxt);
51235             printf(" %d", n_nargs);
51236             printf("\n");
51237         }
51238     }
51239     }
51240     function_tests++;
51241 #endif
51242
51243     return(test_ret);
51244 }
51245
51246
51247 static int
51248 test_xmlXPathParseNCName(void) {
51249     int test_ret = 0;
51250
51251 #if defined(LIBXML_XPATH_ENABLED)
51252     int mem_base;
51253     xmlChar * ret_val;
51254     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51255     int n_ctxt;
51256
51257     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51258         mem_base = xmlMemBlocks();
51259         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51260
51261         ret_val = xmlXPathParseNCName(ctxt);
51262         desret_xmlChar_ptr(ret_val);
51263         call_tests++;
51264         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51265         xmlResetLastError();
51266         if (mem_base != xmlMemBlocks()) {
51267             printf("Leak of %d blocks found in xmlXPathParseNCName",
51268                    xmlMemBlocks() - mem_base);
51269             test_ret++;
51270             printf(" %d", n_ctxt);
51271             printf("\n");
51272         }
51273     }
51274     function_tests++;
51275 #endif
51276
51277     return(test_ret);
51278 }
51279
51280
51281 static int
51282 test_xmlXPathParseName(void) {
51283     int test_ret = 0;
51284
51285 #if defined(LIBXML_XPATH_ENABLED)
51286     int mem_base;
51287     xmlChar * ret_val;
51288     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51289     int n_ctxt;
51290
51291     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51292         mem_base = xmlMemBlocks();
51293         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51294
51295         ret_val = xmlXPathParseName(ctxt);
51296         desret_xmlChar_ptr(ret_val);
51297         call_tests++;
51298         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51299         xmlResetLastError();
51300         if (mem_base != xmlMemBlocks()) {
51301             printf("Leak of %d blocks found in xmlXPathParseName",
51302                    xmlMemBlocks() - mem_base);
51303             test_ret++;
51304             printf(" %d", n_ctxt);
51305             printf("\n");
51306         }
51307     }
51308     function_tests++;
51309 #endif
51310
51311     return(test_ret);
51312 }
51313
51314
51315 static int
51316 test_xmlXPathPopBoolean(void) {
51317     int test_ret = 0;
51318
51319 #if defined(LIBXML_XPATH_ENABLED)
51320     int mem_base;
51321     int ret_val;
51322     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51323     int n_ctxt;
51324
51325     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51326         mem_base = xmlMemBlocks();
51327         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51328
51329         ret_val = xmlXPathPopBoolean(ctxt);
51330         desret_int(ret_val);
51331         call_tests++;
51332         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51333         xmlResetLastError();
51334         if (mem_base != xmlMemBlocks()) {
51335             printf("Leak of %d blocks found in xmlXPathPopBoolean",
51336                    xmlMemBlocks() - mem_base);
51337             test_ret++;
51338             printf(" %d", n_ctxt);
51339             printf("\n");
51340         }
51341     }
51342     function_tests++;
51343 #endif
51344
51345     return(test_ret);
51346 }
51347
51348
51349 static int
51350 test_xmlXPathPopExternal(void) {
51351     int test_ret = 0;
51352
51353 #if defined(LIBXML_XPATH_ENABLED)
51354     int mem_base;
51355     void * ret_val;
51356     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51357     int n_ctxt;
51358
51359     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51360         mem_base = xmlMemBlocks();
51361         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51362
51363         ret_val = xmlXPathPopExternal(ctxt);
51364         desret_void_ptr(ret_val);
51365         call_tests++;
51366         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51367         xmlResetLastError();
51368         if (mem_base != xmlMemBlocks()) {
51369             printf("Leak of %d blocks found in xmlXPathPopExternal",
51370                    xmlMemBlocks() - mem_base);
51371             test_ret++;
51372             printf(" %d", n_ctxt);
51373             printf("\n");
51374         }
51375     }
51376     function_tests++;
51377 #endif
51378
51379     return(test_ret);
51380 }
51381
51382
51383 static int
51384 test_xmlXPathPopNodeSet(void) {
51385     int test_ret = 0;
51386
51387 #if defined(LIBXML_XPATH_ENABLED)
51388     int mem_base;
51389     xmlNodeSetPtr ret_val;
51390     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51391     int n_ctxt;
51392
51393     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51394         mem_base = xmlMemBlocks();
51395         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51396
51397         ret_val = xmlXPathPopNodeSet(ctxt);
51398         desret_xmlNodeSetPtr(ret_val);
51399         call_tests++;
51400         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51401         xmlResetLastError();
51402         if (mem_base != xmlMemBlocks()) {
51403             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
51404                    xmlMemBlocks() - mem_base);
51405             test_ret++;
51406             printf(" %d", n_ctxt);
51407             printf("\n");
51408         }
51409     }
51410     function_tests++;
51411 #endif
51412
51413     return(test_ret);
51414 }
51415
51416
51417 static int
51418 test_xmlXPathPopNumber(void) {
51419     int test_ret = 0;
51420
51421 #if defined(LIBXML_XPATH_ENABLED)
51422     int mem_base;
51423     double ret_val;
51424     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51425     int n_ctxt;
51426
51427     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51428         mem_base = xmlMemBlocks();
51429         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51430
51431         ret_val = xmlXPathPopNumber(ctxt);
51432         desret_double(ret_val);
51433         call_tests++;
51434         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51435         xmlResetLastError();
51436         if (mem_base != xmlMemBlocks()) {
51437             printf("Leak of %d blocks found in xmlXPathPopNumber",
51438                    xmlMemBlocks() - mem_base);
51439             test_ret++;
51440             printf(" %d", n_ctxt);
51441             printf("\n");
51442         }
51443     }
51444     function_tests++;
51445 #endif
51446
51447     return(test_ret);
51448 }
51449
51450
51451 static int
51452 test_xmlXPathPopString(void) {
51453     int test_ret = 0;
51454
51455 #if defined(LIBXML_XPATH_ENABLED)
51456     int mem_base;
51457     xmlChar * ret_val;
51458     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
51459     int n_ctxt;
51460
51461     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51462         mem_base = xmlMemBlocks();
51463         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51464
51465         ret_val = xmlXPathPopString(ctxt);
51466         desret_xmlChar_ptr(ret_val);
51467         call_tests++;
51468         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51469         xmlResetLastError();
51470         if (mem_base != xmlMemBlocks()) {
51471             printf("Leak of %d blocks found in xmlXPathPopString",
51472                    xmlMemBlocks() - mem_base);
51473             test_ret++;
51474             printf(" %d", n_ctxt);
51475             printf("\n");
51476         }
51477     }
51478     function_tests++;
51479 #endif
51480
51481     return(test_ret);
51482 }
51483
51484
51485 static int
51486 test_xmlXPathPositionFunction(void) {
51487     int test_ret = 0;
51488
51489 #if defined(LIBXML_XPATH_ENABLED)
51490     int mem_base;
51491     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51492     int n_ctxt;
51493     int nargs; /* the number of arguments */
51494     int n_nargs;
51495
51496     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51497     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51498         mem_base = xmlMemBlocks();
51499         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51500         nargs = gen_int(n_nargs, 1);
51501
51502         xmlXPathPositionFunction(ctxt, nargs);
51503         call_tests++;
51504         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51505         des_int(n_nargs, nargs, 1);
51506         xmlResetLastError();
51507         if (mem_base != xmlMemBlocks()) {
51508             printf("Leak of %d blocks found in xmlXPathPositionFunction",
51509                    xmlMemBlocks() - mem_base);
51510             test_ret++;
51511             printf(" %d", n_ctxt);
51512             printf(" %d", n_nargs);
51513             printf("\n");
51514         }
51515     }
51516     }
51517     function_tests++;
51518 #endif
51519
51520     return(test_ret);
51521 }
51522
51523
51524 static int
51525 test_xmlXPathRegisterAllFunctions(void) {
51526     int test_ret = 0;
51527
51528 #if defined(LIBXML_XPATH_ENABLED)
51529     int mem_base;
51530     xmlXPathContextPtr ctxt; /* the XPath context */
51531     int n_ctxt;
51532
51533     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51534         mem_base = xmlMemBlocks();
51535         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51536
51537         xmlXPathRegisterAllFunctions(ctxt);
51538         call_tests++;
51539         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51540         xmlResetLastError();
51541         if (mem_base != xmlMemBlocks()) {
51542             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
51543                    xmlMemBlocks() - mem_base);
51544             test_ret++;
51545             printf(" %d", n_ctxt);
51546             printf("\n");
51547         }
51548     }
51549     function_tests++;
51550 #endif
51551
51552     return(test_ret);
51553 }
51554
51555
51556 static int
51557 test_xmlXPathRegisterFunc(void) {
51558     int test_ret = 0;
51559
51560
51561     /* missing type support */
51562     return(test_ret);
51563 }
51564
51565
51566 static int
51567 test_xmlXPathRegisterFuncLookup(void) {
51568     int test_ret = 0;
51569
51570
51571     /* missing type support */
51572     return(test_ret);
51573 }
51574
51575
51576 static int
51577 test_xmlXPathRegisterFuncNS(void) {
51578     int test_ret = 0;
51579
51580
51581     /* missing type support */
51582     return(test_ret);
51583 }
51584
51585
51586 static int
51587 test_xmlXPathRegisterNs(void) {
51588     int test_ret = 0;
51589
51590 #if defined(LIBXML_XPATH_ENABLED)
51591     int mem_base;
51592     int ret_val;
51593     xmlXPathContextPtr ctxt; /* the XPath context */
51594     int n_ctxt;
51595     xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
51596     int n_prefix;
51597     xmlChar * ns_uri; /* the namespace name */
51598     int n_ns_uri;
51599
51600     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51601     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
51602     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51603         mem_base = xmlMemBlocks();
51604         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51605         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
51606         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51607
51608         ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
51609         desret_int(ret_val);
51610         call_tests++;
51611         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51612         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
51613         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51614         xmlResetLastError();
51615         if (mem_base != xmlMemBlocks()) {
51616             printf("Leak of %d blocks found in xmlXPathRegisterNs",
51617                    xmlMemBlocks() - mem_base);
51618             test_ret++;
51619             printf(" %d", n_ctxt);
51620             printf(" %d", n_prefix);
51621             printf(" %d", n_ns_uri);
51622             printf("\n");
51623         }
51624     }
51625     }
51626     }
51627     function_tests++;
51628 #endif
51629
51630     return(test_ret);
51631 }
51632
51633
51634 static int
51635 test_xmlXPathRegisterVariable(void) {
51636     int test_ret = 0;
51637
51638 #if defined(LIBXML_XPATH_ENABLED)
51639     int mem_base;
51640     int ret_val;
51641     xmlXPathContextPtr ctxt; /* the XPath context */
51642     int n_ctxt;
51643     xmlChar * name; /* the variable name */
51644     int n_name;
51645     xmlXPathObjectPtr value; /* the variable value or NULL */
51646     int n_value;
51647
51648     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51649     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51650     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
51651         mem_base = xmlMemBlocks();
51652         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51653         name = gen_const_xmlChar_ptr(n_name, 1);
51654         value = gen_xmlXPathObjectPtr(n_value, 2);
51655
51656         ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
51657         desret_int(ret_val);
51658         call_tests++;
51659         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51660         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51661         des_xmlXPathObjectPtr(n_value, value, 2);
51662         xmlResetLastError();
51663         if (mem_base != xmlMemBlocks()) {
51664             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
51665                    xmlMemBlocks() - mem_base);
51666             test_ret++;
51667             printf(" %d", n_ctxt);
51668             printf(" %d", n_name);
51669             printf(" %d", n_value);
51670             printf("\n");
51671         }
51672     }
51673     }
51674     }
51675     function_tests++;
51676 #endif
51677
51678     return(test_ret);
51679 }
51680
51681
51682 static int
51683 test_xmlXPathRegisterVariableLookup(void) {
51684     int test_ret = 0;
51685
51686
51687     /* missing type support */
51688     return(test_ret);
51689 }
51690
51691
51692 static int
51693 test_xmlXPathRegisterVariableNS(void) {
51694     int test_ret = 0;
51695
51696 #if defined(LIBXML_XPATH_ENABLED)
51697     int mem_base;
51698     int ret_val;
51699     xmlXPathContextPtr ctxt; /* the XPath context */
51700     int n_ctxt;
51701     xmlChar * name; /* the variable name */
51702     int n_name;
51703     xmlChar * ns_uri; /* the variable namespace URI */
51704     int n_ns_uri;
51705     xmlXPathObjectPtr value; /* the variable value or NULL */
51706     int n_value;
51707
51708     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51709     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
51710     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
51711     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
51712         mem_base = xmlMemBlocks();
51713         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51714         name = gen_const_xmlChar_ptr(n_name, 1);
51715         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
51716         value = gen_xmlXPathObjectPtr(n_value, 3);
51717
51718         ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
51719         desret_int(ret_val);
51720         call_tests++;
51721         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51722         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
51723         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
51724         des_xmlXPathObjectPtr(n_value, value, 3);
51725         xmlResetLastError();
51726         if (mem_base != xmlMemBlocks()) {
51727             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
51728                    xmlMemBlocks() - mem_base);
51729             test_ret++;
51730             printf(" %d", n_ctxt);
51731             printf(" %d", n_name);
51732             printf(" %d", n_ns_uri);
51733             printf(" %d", n_value);
51734             printf("\n");
51735         }
51736     }
51737     }
51738     }
51739     }
51740     function_tests++;
51741 #endif
51742
51743     return(test_ret);
51744 }
51745
51746
51747 static int
51748 test_xmlXPathRegisteredFuncsCleanup(void) {
51749     int test_ret = 0;
51750
51751 #if defined(LIBXML_XPATH_ENABLED)
51752     int mem_base;
51753     xmlXPathContextPtr ctxt; /* the XPath context */
51754     int n_ctxt;
51755
51756     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51757         mem_base = xmlMemBlocks();
51758         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51759
51760         xmlXPathRegisteredFuncsCleanup(ctxt);
51761         call_tests++;
51762         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51763         xmlResetLastError();
51764         if (mem_base != xmlMemBlocks()) {
51765             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
51766                    xmlMemBlocks() - mem_base);
51767             test_ret++;
51768             printf(" %d", n_ctxt);
51769             printf("\n");
51770         }
51771     }
51772     function_tests++;
51773 #endif
51774
51775     return(test_ret);
51776 }
51777
51778
51779 static int
51780 test_xmlXPathRegisteredNsCleanup(void) {
51781     int test_ret = 0;
51782
51783 #if defined(LIBXML_XPATH_ENABLED)
51784     int mem_base;
51785     xmlXPathContextPtr ctxt; /* the XPath context */
51786     int n_ctxt;
51787
51788     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51789         mem_base = xmlMemBlocks();
51790         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51791
51792         xmlXPathRegisteredNsCleanup(ctxt);
51793         call_tests++;
51794         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51795         xmlResetLastError();
51796         if (mem_base != xmlMemBlocks()) {
51797             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
51798                    xmlMemBlocks() - mem_base);
51799             test_ret++;
51800             printf(" %d", n_ctxt);
51801             printf("\n");
51802         }
51803     }
51804     function_tests++;
51805 #endif
51806
51807     return(test_ret);
51808 }
51809
51810
51811 static int
51812 test_xmlXPathRegisteredVariablesCleanup(void) {
51813     int test_ret = 0;
51814
51815 #if defined(LIBXML_XPATH_ENABLED)
51816     int mem_base;
51817     xmlXPathContextPtr ctxt; /* the XPath context */
51818     int n_ctxt;
51819
51820     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
51821         mem_base = xmlMemBlocks();
51822         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
51823
51824         xmlXPathRegisteredVariablesCleanup(ctxt);
51825         call_tests++;
51826         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
51827         xmlResetLastError();
51828         if (mem_base != xmlMemBlocks()) {
51829             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
51830                    xmlMemBlocks() - mem_base);
51831             test_ret++;
51832             printf(" %d", n_ctxt);
51833             printf("\n");
51834         }
51835     }
51836     function_tests++;
51837 #endif
51838
51839     return(test_ret);
51840 }
51841
51842
51843 static int
51844 test_xmlXPathRoot(void) {
51845     int test_ret = 0;
51846
51847 #if defined(LIBXML_XPATH_ENABLED)
51848     int mem_base;
51849     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51850     int n_ctxt;
51851
51852     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51853         mem_base = xmlMemBlocks();
51854         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51855
51856         xmlXPathRoot(ctxt);
51857         call_tests++;
51858         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51859         xmlResetLastError();
51860         if (mem_base != xmlMemBlocks()) {
51861             printf("Leak of %d blocks found in xmlXPathRoot",
51862                    xmlMemBlocks() - mem_base);
51863             test_ret++;
51864             printf(" %d", n_ctxt);
51865             printf("\n");
51866         }
51867     }
51868     function_tests++;
51869 #endif
51870
51871     return(test_ret);
51872 }
51873
51874
51875 static int
51876 test_xmlXPathRoundFunction(void) {
51877     int test_ret = 0;
51878
51879 #if defined(LIBXML_XPATH_ENABLED)
51880     int mem_base;
51881     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51882     int n_ctxt;
51883     int nargs; /* the number of arguments */
51884     int n_nargs;
51885
51886     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51887     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51888         mem_base = xmlMemBlocks();
51889         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51890         nargs = gen_int(n_nargs, 1);
51891
51892         xmlXPathRoundFunction(ctxt, nargs);
51893         call_tests++;
51894         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51895         des_int(n_nargs, nargs, 1);
51896         xmlResetLastError();
51897         if (mem_base != xmlMemBlocks()) {
51898             printf("Leak of %d blocks found in xmlXPathRoundFunction",
51899                    xmlMemBlocks() - mem_base);
51900             test_ret++;
51901             printf(" %d", n_ctxt);
51902             printf(" %d", n_nargs);
51903             printf("\n");
51904         }
51905     }
51906     }
51907     function_tests++;
51908 #endif
51909
51910     return(test_ret);
51911 }
51912
51913
51914 static int
51915 test_xmlXPathStartsWithFunction(void) {
51916     int test_ret = 0;
51917
51918 #if defined(LIBXML_XPATH_ENABLED)
51919     int mem_base;
51920     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51921     int n_ctxt;
51922     int nargs; /* the number of arguments */
51923     int n_nargs;
51924
51925     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51926     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51927         mem_base = xmlMemBlocks();
51928         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51929         nargs = gen_int(n_nargs, 1);
51930
51931         xmlXPathStartsWithFunction(ctxt, nargs);
51932         call_tests++;
51933         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51934         des_int(n_nargs, nargs, 1);
51935         xmlResetLastError();
51936         if (mem_base != xmlMemBlocks()) {
51937             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
51938                    xmlMemBlocks() - mem_base);
51939             test_ret++;
51940             printf(" %d", n_ctxt);
51941             printf(" %d", n_nargs);
51942             printf("\n");
51943         }
51944     }
51945     }
51946     function_tests++;
51947 #endif
51948
51949     return(test_ret);
51950 }
51951
51952
51953 static int
51954 test_xmlXPathStringEvalNumber(void) {
51955     int test_ret = 0;
51956
51957 #if defined(LIBXML_XPATH_ENABLED)
51958     int mem_base;
51959     double ret_val;
51960     xmlChar * str; /* A string to scan */
51961     int n_str;
51962
51963     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51964         mem_base = xmlMemBlocks();
51965         str = gen_const_xmlChar_ptr(n_str, 0);
51966
51967         ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
51968         desret_double(ret_val);
51969         call_tests++;
51970         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51971         xmlResetLastError();
51972         if (mem_base != xmlMemBlocks()) {
51973             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
51974                    xmlMemBlocks() - mem_base);
51975             test_ret++;
51976             printf(" %d", n_str);
51977             printf("\n");
51978         }
51979     }
51980     function_tests++;
51981 #endif
51982
51983     return(test_ret);
51984 }
51985
51986
51987 static int
51988 test_xmlXPathStringFunction(void) {
51989     int test_ret = 0;
51990
51991 #if defined(LIBXML_XPATH_ENABLED)
51992     int mem_base;
51993     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
51994     int n_ctxt;
51995     int nargs; /* the number of arguments */
51996     int n_nargs;
51997
51998     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51999     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52000         mem_base = xmlMemBlocks();
52001         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52002         nargs = gen_int(n_nargs, 1);
52003
52004         xmlXPathStringFunction(ctxt, nargs);
52005         call_tests++;
52006         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52007         des_int(n_nargs, nargs, 1);
52008         xmlResetLastError();
52009         if (mem_base != xmlMemBlocks()) {
52010             printf("Leak of %d blocks found in xmlXPathStringFunction",
52011                    xmlMemBlocks() - mem_base);
52012             test_ret++;
52013             printf(" %d", n_ctxt);
52014             printf(" %d", n_nargs);
52015             printf("\n");
52016         }
52017     }
52018     }
52019     function_tests++;
52020 #endif
52021
52022     return(test_ret);
52023 }
52024
52025
52026 static int
52027 test_xmlXPathStringLengthFunction(void) {
52028     int test_ret = 0;
52029
52030 #if defined(LIBXML_XPATH_ENABLED)
52031     int mem_base;
52032     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52033     int n_ctxt;
52034     int nargs; /* the number of arguments */
52035     int n_nargs;
52036
52037     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52038     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52039         mem_base = xmlMemBlocks();
52040         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52041         nargs = gen_int(n_nargs, 1);
52042
52043         xmlXPathStringLengthFunction(ctxt, nargs);
52044         call_tests++;
52045         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52046         des_int(n_nargs, nargs, 1);
52047         xmlResetLastError();
52048         if (mem_base != xmlMemBlocks()) {
52049             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
52050                    xmlMemBlocks() - mem_base);
52051             test_ret++;
52052             printf(" %d", n_ctxt);
52053             printf(" %d", n_nargs);
52054             printf("\n");
52055         }
52056     }
52057     }
52058     function_tests++;
52059 #endif
52060
52061     return(test_ret);
52062 }
52063
52064
52065 static int
52066 test_xmlXPathSubValues(void) {
52067     int test_ret = 0;
52068
52069 #if defined(LIBXML_XPATH_ENABLED)
52070     int mem_base;
52071     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52072     int n_ctxt;
52073
52074     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52075         mem_base = xmlMemBlocks();
52076         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52077
52078         xmlXPathSubValues(ctxt);
52079         call_tests++;
52080         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52081         xmlResetLastError();
52082         if (mem_base != xmlMemBlocks()) {
52083             printf("Leak of %d blocks found in xmlXPathSubValues",
52084                    xmlMemBlocks() - mem_base);
52085             test_ret++;
52086             printf(" %d", n_ctxt);
52087             printf("\n");
52088         }
52089     }
52090     function_tests++;
52091 #endif
52092
52093     return(test_ret);
52094 }
52095
52096
52097 static int
52098 test_xmlXPathSubstringAfterFunction(void) {
52099     int test_ret = 0;
52100
52101 #if defined(LIBXML_XPATH_ENABLED)
52102     int mem_base;
52103     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52104     int n_ctxt;
52105     int nargs; /* the number of arguments */
52106     int n_nargs;
52107
52108     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52109     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52110         mem_base = xmlMemBlocks();
52111         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52112         nargs = gen_int(n_nargs, 1);
52113
52114         xmlXPathSubstringAfterFunction(ctxt, nargs);
52115         call_tests++;
52116         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52117         des_int(n_nargs, nargs, 1);
52118         xmlResetLastError();
52119         if (mem_base != xmlMemBlocks()) {
52120             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
52121                    xmlMemBlocks() - mem_base);
52122             test_ret++;
52123             printf(" %d", n_ctxt);
52124             printf(" %d", n_nargs);
52125             printf("\n");
52126         }
52127     }
52128     }
52129     function_tests++;
52130 #endif
52131
52132     return(test_ret);
52133 }
52134
52135
52136 static int
52137 test_xmlXPathSubstringBeforeFunction(void) {
52138     int test_ret = 0;
52139
52140 #if defined(LIBXML_XPATH_ENABLED)
52141     int mem_base;
52142     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52143     int n_ctxt;
52144     int nargs; /* the number of arguments */
52145     int n_nargs;
52146
52147     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52148     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52149         mem_base = xmlMemBlocks();
52150         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52151         nargs = gen_int(n_nargs, 1);
52152
52153         xmlXPathSubstringBeforeFunction(ctxt, nargs);
52154         call_tests++;
52155         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52156         des_int(n_nargs, nargs, 1);
52157         xmlResetLastError();
52158         if (mem_base != xmlMemBlocks()) {
52159             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
52160                    xmlMemBlocks() - mem_base);
52161             test_ret++;
52162             printf(" %d", n_ctxt);
52163             printf(" %d", n_nargs);
52164             printf("\n");
52165         }
52166     }
52167     }
52168     function_tests++;
52169 #endif
52170
52171     return(test_ret);
52172 }
52173
52174
52175 static int
52176 test_xmlXPathSubstringFunction(void) {
52177     int test_ret = 0;
52178
52179 #if defined(LIBXML_XPATH_ENABLED)
52180     int mem_base;
52181     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52182     int n_ctxt;
52183     int nargs; /* the number of arguments */
52184     int n_nargs;
52185
52186     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52187     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52188         mem_base = xmlMemBlocks();
52189         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52190         nargs = gen_int(n_nargs, 1);
52191
52192         xmlXPathSubstringFunction(ctxt, nargs);
52193         call_tests++;
52194         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52195         des_int(n_nargs, nargs, 1);
52196         xmlResetLastError();
52197         if (mem_base != xmlMemBlocks()) {
52198             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
52199                    xmlMemBlocks() - mem_base);
52200             test_ret++;
52201             printf(" %d", n_ctxt);
52202             printf(" %d", n_nargs);
52203             printf("\n");
52204         }
52205     }
52206     }
52207     function_tests++;
52208 #endif
52209
52210     return(test_ret);
52211 }
52212
52213
52214 static int
52215 test_xmlXPathSumFunction(void) {
52216     int test_ret = 0;
52217
52218 #if defined(LIBXML_XPATH_ENABLED)
52219     int mem_base;
52220     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52221     int n_ctxt;
52222     int nargs; /* the number of arguments */
52223     int n_nargs;
52224
52225     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52226     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52227         mem_base = xmlMemBlocks();
52228         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52229         nargs = gen_int(n_nargs, 1);
52230
52231         xmlXPathSumFunction(ctxt, nargs);
52232         call_tests++;
52233         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52234         des_int(n_nargs, nargs, 1);
52235         xmlResetLastError();
52236         if (mem_base != xmlMemBlocks()) {
52237             printf("Leak of %d blocks found in xmlXPathSumFunction",
52238                    xmlMemBlocks() - mem_base);
52239             test_ret++;
52240             printf(" %d", n_ctxt);
52241             printf(" %d", n_nargs);
52242             printf("\n");
52243         }
52244     }
52245     }
52246     function_tests++;
52247 #endif
52248
52249     return(test_ret);
52250 }
52251
52252
52253 static int
52254 test_xmlXPathTrailing(void) {
52255     int test_ret = 0;
52256
52257 #if defined(LIBXML_XPATH_ENABLED)
52258     int mem_base;
52259     xmlNodeSetPtr ret_val;
52260     xmlNodeSetPtr nodes1; /* a node-set */
52261     int n_nodes1;
52262     xmlNodeSetPtr nodes2; /* a node-set */
52263     int n_nodes2;
52264
52265     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
52266     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
52267         mem_base = xmlMemBlocks();
52268         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
52269         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
52270
52271         ret_val = xmlXPathTrailing(nodes1, nodes2);
52272         desret_xmlNodeSetPtr(ret_val);
52273         call_tests++;
52274         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
52275         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
52276         xmlResetLastError();
52277         if (mem_base != xmlMemBlocks()) {
52278             printf("Leak of %d blocks found in xmlXPathTrailing",
52279                    xmlMemBlocks() - mem_base);
52280             test_ret++;
52281             printf(" %d", n_nodes1);
52282             printf(" %d", n_nodes2);
52283             printf("\n");
52284         }
52285     }
52286     }
52287     function_tests++;
52288 #endif
52289
52290     return(test_ret);
52291 }
52292
52293
52294 static int
52295 test_xmlXPathTrailingSorted(void) {
52296     int test_ret = 0;
52297
52298 #if defined(LIBXML_XPATH_ENABLED)
52299     int mem_base;
52300     xmlNodeSetPtr ret_val;
52301     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
52302     int n_nodes1;
52303     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
52304     int n_nodes2;
52305
52306     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
52307     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
52308         mem_base = xmlMemBlocks();
52309         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
52310         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
52311
52312         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
52313         desret_xmlNodeSetPtr(ret_val);
52314         call_tests++;
52315         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
52316         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
52317         xmlResetLastError();
52318         if (mem_base != xmlMemBlocks()) {
52319             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
52320                    xmlMemBlocks() - mem_base);
52321             test_ret++;
52322             printf(" %d", n_nodes1);
52323             printf(" %d", n_nodes2);
52324             printf("\n");
52325         }
52326     }
52327     }
52328     function_tests++;
52329 #endif
52330
52331     return(test_ret);
52332 }
52333
52334
52335 static int
52336 test_xmlXPathTranslateFunction(void) {
52337     int test_ret = 0;
52338
52339 #if defined(LIBXML_XPATH_ENABLED)
52340     int mem_base;
52341     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52342     int n_ctxt;
52343     int nargs; /* the number of arguments */
52344     int n_nargs;
52345
52346     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52347     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52348         mem_base = xmlMemBlocks();
52349         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52350         nargs = gen_int(n_nargs, 1);
52351
52352         xmlXPathTranslateFunction(ctxt, nargs);
52353         call_tests++;
52354         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52355         des_int(n_nargs, nargs, 1);
52356         xmlResetLastError();
52357         if (mem_base != xmlMemBlocks()) {
52358             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
52359                    xmlMemBlocks() - mem_base);
52360             test_ret++;
52361             printf(" %d", n_ctxt);
52362             printf(" %d", n_nargs);
52363             printf("\n");
52364         }
52365     }
52366     }
52367     function_tests++;
52368 #endif
52369
52370     return(test_ret);
52371 }
52372
52373
52374 static int
52375 test_xmlXPathTrueFunction(void) {
52376     int test_ret = 0;
52377
52378 #if defined(LIBXML_XPATH_ENABLED)
52379     int mem_base;
52380     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52381     int n_ctxt;
52382     int nargs; /* the number of arguments */
52383     int n_nargs;
52384
52385     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52386     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
52387         mem_base = xmlMemBlocks();
52388         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52389         nargs = gen_int(n_nargs, 1);
52390
52391         xmlXPathTrueFunction(ctxt, nargs);
52392         call_tests++;
52393         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52394         des_int(n_nargs, nargs, 1);
52395         xmlResetLastError();
52396         if (mem_base != xmlMemBlocks()) {
52397             printf("Leak of %d blocks found in xmlXPathTrueFunction",
52398                    xmlMemBlocks() - mem_base);
52399             test_ret++;
52400             printf(" %d", n_ctxt);
52401             printf(" %d", n_nargs);
52402             printf("\n");
52403         }
52404     }
52405     }
52406     function_tests++;
52407 #endif
52408
52409     return(test_ret);
52410 }
52411
52412
52413 static int
52414 test_xmlXPathValueFlipSign(void) {
52415     int test_ret = 0;
52416
52417 #if defined(LIBXML_XPATH_ENABLED)
52418     int mem_base;
52419     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52420     int n_ctxt;
52421
52422     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52423         mem_base = xmlMemBlocks();
52424         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52425
52426         xmlXPathValueFlipSign(ctxt);
52427         call_tests++;
52428         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52429         xmlResetLastError();
52430         if (mem_base != xmlMemBlocks()) {
52431             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
52432                    xmlMemBlocks() - mem_base);
52433             test_ret++;
52434             printf(" %d", n_ctxt);
52435             printf("\n");
52436         }
52437     }
52438     function_tests++;
52439 #endif
52440
52441     return(test_ret);
52442 }
52443
52444
52445 static int
52446 test_xmlXPathVariableLookup(void) {
52447     int test_ret = 0;
52448
52449 #if defined(LIBXML_XPATH_ENABLED)
52450     int mem_base;
52451     xmlXPathObjectPtr ret_val;
52452     xmlXPathContextPtr ctxt; /* the XPath context */
52453     int n_ctxt;
52454     xmlChar * name; /* the variable name */
52455     int n_name;
52456
52457     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
52458     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
52459         mem_base = xmlMemBlocks();
52460         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
52461         name = gen_const_xmlChar_ptr(n_name, 1);
52462
52463         ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
52464         desret_xmlXPathObjectPtr(ret_val);
52465         call_tests++;
52466         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
52467         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
52468         xmlResetLastError();
52469         if (mem_base != xmlMemBlocks()) {
52470             printf("Leak of %d blocks found in xmlXPathVariableLookup",
52471                    xmlMemBlocks() - mem_base);
52472             test_ret++;
52473             printf(" %d", n_ctxt);
52474             printf(" %d", n_name);
52475             printf("\n");
52476         }
52477     }
52478     }
52479     function_tests++;
52480 #endif
52481
52482     return(test_ret);
52483 }
52484
52485
52486 static int
52487 test_xmlXPathVariableLookupNS(void) {
52488     int test_ret = 0;
52489
52490 #if defined(LIBXML_XPATH_ENABLED)
52491     int mem_base;
52492     xmlXPathObjectPtr ret_val;
52493     xmlXPathContextPtr ctxt; /* the XPath context */
52494     int n_ctxt;
52495     xmlChar * name; /* the variable name */
52496     int n_name;
52497     xmlChar * ns_uri; /* the variable namespace URI */
52498     int n_ns_uri;
52499
52500     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
52501     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
52502     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
52503         mem_base = xmlMemBlocks();
52504         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
52505         name = gen_const_xmlChar_ptr(n_name, 1);
52506         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
52507
52508         ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
52509         desret_xmlXPathObjectPtr(ret_val);
52510         call_tests++;
52511         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
52512         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
52513         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
52514         xmlResetLastError();
52515         if (mem_base != xmlMemBlocks()) {
52516             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
52517                    xmlMemBlocks() - mem_base);
52518             test_ret++;
52519             printf(" %d", n_ctxt);
52520             printf(" %d", n_name);
52521             printf(" %d", n_ns_uri);
52522             printf("\n");
52523         }
52524     }
52525     }
52526     }
52527     function_tests++;
52528 #endif
52529
52530     return(test_ret);
52531 }
52532
52533
52534 static int
52535 test_xmlXPathWrapCString(void) {
52536     int test_ret = 0;
52537
52538 #if defined(LIBXML_XPATH_ENABLED)
52539     int mem_base;
52540     xmlXPathObjectPtr ret_val;
52541     char * val; /* the char * value */
52542     int n_val;
52543
52544     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
52545         mem_base = xmlMemBlocks();
52546         val = gen_char_ptr(n_val, 0);
52547
52548         ret_val = xmlXPathWrapCString(val);
52549         desret_xmlXPathObjectPtr(ret_val);
52550         call_tests++;
52551         des_char_ptr(n_val, val, 0);
52552         xmlResetLastError();
52553         if (mem_base != xmlMemBlocks()) {
52554             printf("Leak of %d blocks found in xmlXPathWrapCString",
52555                    xmlMemBlocks() - mem_base);
52556             test_ret++;
52557             printf(" %d", n_val);
52558             printf("\n");
52559         }
52560     }
52561     function_tests++;
52562 #endif
52563
52564     return(test_ret);
52565 }
52566
52567
52568 static int
52569 test_xmlXPathWrapExternal(void) {
52570     int test_ret = 0;
52571
52572 #if defined(LIBXML_XPATH_ENABLED)
52573     int mem_base;
52574     xmlXPathObjectPtr ret_val;
52575     void * val; /* the user data */
52576     int n_val;
52577
52578     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
52579         mem_base = xmlMemBlocks();
52580         val = gen_void_ptr(n_val, 0);
52581
52582         ret_val = xmlXPathWrapExternal(val);
52583         desret_xmlXPathObjectPtr(ret_val);
52584         call_tests++;
52585         des_void_ptr(n_val, val, 0);
52586         xmlResetLastError();
52587         if (mem_base != xmlMemBlocks()) {
52588             printf("Leak of %d blocks found in xmlXPathWrapExternal",
52589                    xmlMemBlocks() - mem_base);
52590             test_ret++;
52591             printf(" %d", n_val);
52592             printf("\n");
52593         }
52594     }
52595     function_tests++;
52596 #endif
52597
52598     return(test_ret);
52599 }
52600
52601
52602 static int
52603 test_xmlXPathWrapNodeSet(void) {
52604     int test_ret = 0;
52605
52606 #if defined(LIBXML_XPATH_ENABLED)
52607     int mem_base;
52608     xmlXPathObjectPtr ret_val;
52609     xmlNodeSetPtr val; /* the NodePtr value */
52610     int n_val;
52611
52612     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
52613         mem_base = xmlMemBlocks();
52614         val = gen_xmlNodeSetPtr(n_val, 0);
52615
52616         ret_val = xmlXPathWrapNodeSet(val);
52617         desret_xmlXPathObjectPtr(ret_val);
52618         call_tests++;
52619         des_xmlNodeSetPtr(n_val, val, 0);
52620         xmlResetLastError();
52621         if (mem_base != xmlMemBlocks()) {
52622             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
52623                    xmlMemBlocks() - mem_base);
52624             test_ret++;
52625             printf(" %d", n_val);
52626             printf("\n");
52627         }
52628     }
52629     function_tests++;
52630 #endif
52631
52632     return(test_ret);
52633 }
52634
52635
52636 static int
52637 test_xmlXPatherror(void) {
52638     int test_ret = 0;
52639
52640 #if defined(LIBXML_XPATH_ENABLED)
52641     int mem_base;
52642     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
52643     int n_ctxt;
52644     const char * file; /* the file name */
52645     int n_file;
52646     int line; /* the line number */
52647     int n_line;
52648     int no; /* the error number */
52649     int n_no;
52650
52651     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
52652     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
52653     for (n_line = 0;n_line < gen_nb_int;n_line++) {
52654     for (n_no = 0;n_no < gen_nb_int;n_no++) {
52655         mem_base = xmlMemBlocks();
52656         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
52657         file = gen_filepath(n_file, 1);
52658         line = gen_int(n_line, 2);
52659         no = gen_int(n_no, 3);
52660
52661         xmlXPatherror(ctxt, file, line, no);
52662         call_tests++;
52663         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
52664         des_filepath(n_file, file, 1);
52665         des_int(n_line, line, 2);
52666         des_int(n_no, no, 3);
52667         xmlResetLastError();
52668         if (mem_base != xmlMemBlocks()) {
52669             printf("Leak of %d blocks found in xmlXPatherror",
52670                    xmlMemBlocks() - mem_base);
52671             test_ret++;
52672             printf(" %d", n_ctxt);
52673             printf(" %d", n_file);
52674             printf(" %d", n_line);
52675             printf(" %d", n_no);
52676             printf("\n");
52677         }
52678     }
52679     }
52680     }
52681     }
52682     function_tests++;
52683 #endif
52684
52685     return(test_ret);
52686 }
52687
52688 static int
52689 test_xpathInternals(void) {
52690     int test_ret = 0;
52691         int rc = 0;
52692
52693     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
52694     rc = test_valuePop();
52695         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52696     rc = test_valuePush();
52697         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52698     rc = test_xmlXPathAddValues();
52699         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52700     rc = test_xmlXPathBooleanFunction();
52701         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52702     rc = test_xmlXPathCeilingFunction();
52703         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52704     rc = test_xmlXPathCompareValues();
52705         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52706     rc = test_xmlXPathConcatFunction();
52707         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52708     rc = test_xmlXPathContainsFunction();
52709         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52710     rc = test_xmlXPathCountFunction();
52711         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52712     rc = test_xmlXPathDebugDumpCompExpr();
52713         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52714     rc = test_xmlXPathDebugDumpObject();
52715         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52716     rc = test_xmlXPathDifference();
52717         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52718     rc = test_xmlXPathDistinct();
52719         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52720     rc = test_xmlXPathDistinctSorted();
52721         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52722     rc = test_xmlXPathDivValues();
52723         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52724     rc = test_xmlXPathEqualValues();
52725         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52726     rc = test_xmlXPathErr();
52727         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52728     rc = test_xmlXPathEvalExpr();
52729         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52730     rc = test_xmlXPathEvaluatePredicateResult();
52731         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52732     rc = test_xmlXPathFalseFunction();
52733         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52734     rc = test_xmlXPathFloorFunction();
52735         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52736     rc = test_xmlXPathFunctionLookup();
52737         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52738     rc = test_xmlXPathFunctionLookupNS();
52739         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52740     rc = test_xmlXPathHasSameNodes();
52741         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52742     rc = test_xmlXPathIdFunction();
52743         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52744     rc = test_xmlXPathIntersection();
52745         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52746     rc = test_xmlXPathIsNodeType();
52747         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52748     rc = test_xmlXPathLangFunction();
52749         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52750     rc = test_xmlXPathLastFunction();
52751         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52752     rc = test_xmlXPathLeading();
52753         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52754     rc = test_xmlXPathLeadingSorted();
52755         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52756     rc = test_xmlXPathLocalNameFunction();
52757         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52758     rc = test_xmlXPathModValues();
52759         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52760     rc = test_xmlXPathMultValues();
52761         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52762     rc = test_xmlXPathNamespaceURIFunction();
52763         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52764     rc = test_xmlXPathNewBoolean();
52765         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52766     rc = test_xmlXPathNewCString();
52767         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52768     rc = test_xmlXPathNewFloat();
52769         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52770     rc = test_xmlXPathNewNodeSet();
52771         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52772     rc = test_xmlXPathNewNodeSetList();
52773         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52774     rc = test_xmlXPathNewParserContext();
52775         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52776     rc = test_xmlXPathNewString();
52777         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52778     rc = test_xmlXPathNextAncestor();
52779         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52780     rc = test_xmlXPathNextAncestorOrSelf();
52781         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52782     rc = test_xmlXPathNextAttribute();
52783         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52784     rc = test_xmlXPathNextChild();
52785         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52786     rc = test_xmlXPathNextDescendant();
52787         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52788     rc = test_xmlXPathNextDescendantOrSelf();
52789         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52790     rc = test_xmlXPathNextFollowing();
52791         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52792     rc = test_xmlXPathNextFollowingSibling();
52793         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52794     rc = test_xmlXPathNextNamespace();
52795         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52796     rc = test_xmlXPathNextParent();
52797         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52798     rc = test_xmlXPathNextPreceding();
52799         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52800     rc = test_xmlXPathNextPrecedingSibling();
52801         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52802     rc = test_xmlXPathNextSelf();
52803         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52804     rc = test_xmlXPathNodeLeading();
52805         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52806     rc = test_xmlXPathNodeLeadingSorted();
52807         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52808     rc = test_xmlXPathNodeSetAdd();
52809         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52810     rc = test_xmlXPathNodeSetAddNs();
52811         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52812     rc = test_xmlXPathNodeSetAddUnique();
52813         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52814     rc = test_xmlXPathNodeSetContains();
52815         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52816     rc = test_xmlXPathNodeSetDel();
52817         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52818     rc = test_xmlXPathNodeSetMerge();
52819         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52820     rc = test_xmlXPathNodeSetRemove();
52821         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52822     rc = test_xmlXPathNodeSetSort();
52823         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52824     rc = test_xmlXPathNodeTrailing();
52825         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52826     rc = test_xmlXPathNodeTrailingSorted();
52827         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52828     rc = test_xmlXPathNormalizeFunction();
52829         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52830     rc = test_xmlXPathNotEqualValues();
52831         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52832     rc = test_xmlXPathNotFunction();
52833         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52834     rc = test_xmlXPathNsLookup();
52835         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52836     rc = test_xmlXPathNumberFunction();
52837         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52838     rc = test_xmlXPathParseNCName();
52839         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52840     rc = test_xmlXPathParseName();
52841         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52842     rc = test_xmlXPathPopBoolean();
52843         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52844     rc = test_xmlXPathPopExternal();
52845         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52846     rc = test_xmlXPathPopNodeSet();
52847         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52848     rc = test_xmlXPathPopNumber();
52849         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52850     rc = test_xmlXPathPopString();
52851         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52852     rc = test_xmlXPathPositionFunction();
52853         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52854     rc = test_xmlXPathRegisterAllFunctions();
52855         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52856     rc = test_xmlXPathRegisterFunc();
52857         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52858     rc = test_xmlXPathRegisterFuncLookup();
52859         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52860     rc = test_xmlXPathRegisterFuncNS();
52861         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52862     rc = test_xmlXPathRegisterNs();
52863         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52864     rc = test_xmlXPathRegisterVariable();
52865         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52866     rc = test_xmlXPathRegisterVariableLookup();
52867         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52868     rc = test_xmlXPathRegisterVariableNS();
52869         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52870     rc = test_xmlXPathRegisteredFuncsCleanup();
52871         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52872     rc = test_xmlXPathRegisteredNsCleanup();
52873         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52874     rc = test_xmlXPathRegisteredVariablesCleanup();
52875         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52876     rc = test_xmlXPathRoot();
52877         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52878     rc = test_xmlXPathRoundFunction();
52879         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52880     rc = test_xmlXPathStartsWithFunction();
52881         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52882     rc = test_xmlXPathStringEvalNumber();
52883         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52884     rc = test_xmlXPathStringFunction();
52885         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52886     rc = test_xmlXPathStringLengthFunction();
52887         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52888     rc = test_xmlXPathSubValues();
52889         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52890     rc = test_xmlXPathSubstringAfterFunction();
52891         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52892     rc = test_xmlXPathSubstringBeforeFunction();
52893         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52894     rc = test_xmlXPathSubstringFunction();
52895         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52896     rc = test_xmlXPathSumFunction();
52897         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52898     rc = test_xmlXPathTrailing();
52899         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52900     rc = test_xmlXPathTrailingSorted();
52901         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52902     rc = test_xmlXPathTranslateFunction();
52903         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52904     rc = test_xmlXPathTrueFunction();
52905         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52906     rc = test_xmlXPathValueFlipSign();
52907         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52908     rc = test_xmlXPathVariableLookup();
52909         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52910     rc = test_xmlXPathVariableLookupNS();
52911         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52912     rc = test_xmlXPathWrapCString();
52913         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52914     rc = test_xmlXPathWrapExternal();
52915         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52916     rc = test_xmlXPathWrapNodeSet();
52917         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52918     rc = test_xmlXPatherror();
52919         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
52920
52921     if (test_ret != 0)
52922         printf("Module xpathInternals: %d errors\n", test_ret);
52923     return(test_ret);
52924 }
52925
52926 static int
52927 test_xmlXPtrBuildNodeList(void) {
52928     int test_ret = 0;
52929
52930 #if defined(LIBXML_XPTR_ENABLED)
52931     int mem_base;
52932     xmlNodePtr ret_val;
52933     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
52934     int n_obj;
52935
52936     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
52937         mem_base = xmlMemBlocks();
52938         obj = gen_xmlXPathObjectPtr(n_obj, 0);
52939
52940         ret_val = xmlXPtrBuildNodeList(obj);
52941         desret_xmlNodePtr(ret_val);
52942         call_tests++;
52943         des_xmlXPathObjectPtr(n_obj, obj, 0);
52944         xmlResetLastError();
52945         if (mem_base != xmlMemBlocks()) {
52946             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
52947                    xmlMemBlocks() - mem_base);
52948             test_ret++;
52949             printf(" %d", n_obj);
52950             printf("\n");
52951         }
52952     }
52953     function_tests++;
52954 #endif
52955
52956     return(test_ret);
52957 }
52958
52959
52960 static int
52961 test_xmlXPtrEval(void) {
52962     int test_ret = 0;
52963
52964 #if defined(LIBXML_XPTR_ENABLED)
52965     int mem_base;
52966     xmlXPathObjectPtr ret_val;
52967     xmlChar * str; /* the XPointer expression */
52968     int n_str;
52969     xmlXPathContextPtr ctx; /* the XPointer context */
52970     int n_ctx;
52971
52972     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
52973     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
52974         mem_base = xmlMemBlocks();
52975         str = gen_const_xmlChar_ptr(n_str, 0);
52976         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
52977
52978         ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
52979         desret_xmlXPathObjectPtr(ret_val);
52980         call_tests++;
52981         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
52982         des_xmlXPathContextPtr(n_ctx, ctx, 1);
52983         xmlResetLastError();
52984         if (mem_base != xmlMemBlocks()) {
52985             printf("Leak of %d blocks found in xmlXPtrEval",
52986                    xmlMemBlocks() - mem_base);
52987             test_ret++;
52988             printf(" %d", n_str);
52989             printf(" %d", n_ctx);
52990             printf("\n");
52991         }
52992     }
52993     }
52994     function_tests++;
52995 #endif
52996
52997     return(test_ret);
52998 }
52999
53000
53001 static int
53002 test_xmlXPtrEvalRangePredicate(void) {
53003     int test_ret = 0;
53004
53005 #if defined(LIBXML_XPTR_ENABLED)
53006     int mem_base;
53007     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
53008     int n_ctxt;
53009
53010     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
53011         mem_base = xmlMemBlocks();
53012         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
53013
53014         xmlXPtrEvalRangePredicate(ctxt);
53015         call_tests++;
53016         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
53017         xmlResetLastError();
53018         if (mem_base != xmlMemBlocks()) {
53019             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
53020                    xmlMemBlocks() - mem_base);
53021             test_ret++;
53022             printf(" %d", n_ctxt);
53023             printf("\n");
53024         }
53025     }
53026     function_tests++;
53027 #endif
53028
53029     return(test_ret);
53030 }
53031
53032 #ifdef LIBXML_XPTR_ENABLED
53033
53034 #define gen_nb_xmlLocationSetPtr 1
53035 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
53036     return(NULL);
53037 }
53038 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
53039 }
53040 #endif
53041
53042
53043 static int
53044 test_xmlXPtrLocationSetAdd(void) {
53045     int test_ret = 0;
53046
53047 #if defined(LIBXML_XPTR_ENABLED)
53048     int mem_base;
53049     xmlLocationSetPtr cur; /* the initial range set */
53050     int n_cur;
53051     xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
53052     int n_val;
53053
53054     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
53055     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
53056         mem_base = xmlMemBlocks();
53057         cur = gen_xmlLocationSetPtr(n_cur, 0);
53058         val = gen_xmlXPathObjectPtr(n_val, 1);
53059
53060         xmlXPtrLocationSetAdd(cur, val);
53061         call_tests++;
53062         des_xmlLocationSetPtr(n_cur, cur, 0);
53063         des_xmlXPathObjectPtr(n_val, val, 1);
53064         xmlResetLastError();
53065         if (mem_base != xmlMemBlocks()) {
53066             printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
53067                    xmlMemBlocks() - mem_base);
53068             test_ret++;
53069             printf(" %d", n_cur);
53070             printf(" %d", n_val);
53071             printf("\n");
53072         }
53073     }
53074     }
53075     function_tests++;
53076 #endif
53077
53078     return(test_ret);
53079 }
53080
53081
53082 static int
53083 test_xmlXPtrLocationSetCreate(void) {
53084     int test_ret = 0;
53085
53086
53087     /* missing type support */
53088     return(test_ret);
53089 }
53090
53091
53092 static int
53093 test_xmlXPtrLocationSetDel(void) {
53094     int test_ret = 0;
53095
53096 #if defined(LIBXML_XPTR_ENABLED)
53097     int mem_base;
53098     xmlLocationSetPtr cur; /* the initial range set */
53099     int n_cur;
53100     xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
53101     int n_val;
53102
53103     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
53104     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
53105         mem_base = xmlMemBlocks();
53106         cur = gen_xmlLocationSetPtr(n_cur, 0);
53107         val = gen_xmlXPathObjectPtr(n_val, 1);
53108
53109         xmlXPtrLocationSetDel(cur, val);
53110         call_tests++;
53111         des_xmlLocationSetPtr(n_cur, cur, 0);
53112         des_xmlXPathObjectPtr(n_val, val, 1);
53113         xmlResetLastError();
53114         if (mem_base != xmlMemBlocks()) {
53115             printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
53116                    xmlMemBlocks() - mem_base);
53117             test_ret++;
53118             printf(" %d", n_cur);
53119             printf(" %d", n_val);
53120             printf("\n");
53121         }
53122     }
53123     }
53124     function_tests++;
53125 #endif
53126
53127     return(test_ret);
53128 }
53129
53130
53131 static int
53132 test_xmlXPtrLocationSetMerge(void) {
53133     int test_ret = 0;
53134
53135
53136     /* missing type support */
53137     return(test_ret);
53138 }
53139
53140
53141 static int
53142 test_xmlXPtrLocationSetRemove(void) {
53143     int test_ret = 0;
53144
53145 #if defined(LIBXML_XPTR_ENABLED)
53146     int mem_base;
53147     xmlLocationSetPtr cur; /* the initial range set */
53148     int n_cur;
53149     int val; /* the index to remove */
53150     int n_val;
53151
53152     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
53153     for (n_val = 0;n_val < gen_nb_int;n_val++) {
53154         mem_base = xmlMemBlocks();
53155         cur = gen_xmlLocationSetPtr(n_cur, 0);
53156         val = gen_int(n_val, 1);
53157
53158         xmlXPtrLocationSetRemove(cur, val);
53159         call_tests++;
53160         des_xmlLocationSetPtr(n_cur, cur, 0);
53161         des_int(n_val, val, 1);
53162         xmlResetLastError();
53163         if (mem_base != xmlMemBlocks()) {
53164             printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
53165                    xmlMemBlocks() - mem_base);
53166             test_ret++;
53167             printf(" %d", n_cur);
53168             printf(" %d", n_val);
53169             printf("\n");
53170         }
53171     }
53172     }
53173     function_tests++;
53174 #endif
53175
53176     return(test_ret);
53177 }
53178
53179
53180 static int
53181 test_xmlXPtrNewCollapsedRange(void) {
53182     int test_ret = 0;
53183
53184 #if defined(LIBXML_XPTR_ENABLED)
53185     int mem_base;
53186     xmlXPathObjectPtr ret_val;
53187     xmlNodePtr start; /* the starting and ending node */
53188     int n_start;
53189
53190     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53191         mem_base = xmlMemBlocks();
53192         start = gen_xmlNodePtr(n_start, 0);
53193
53194         ret_val = xmlXPtrNewCollapsedRange(start);
53195         desret_xmlXPathObjectPtr(ret_val);
53196         call_tests++;
53197         des_xmlNodePtr(n_start, start, 0);
53198         xmlResetLastError();
53199         if (mem_base != xmlMemBlocks()) {
53200             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
53201                    xmlMemBlocks() - mem_base);
53202             test_ret++;
53203             printf(" %d", n_start);
53204             printf("\n");
53205         }
53206     }
53207     function_tests++;
53208 #endif
53209
53210     return(test_ret);
53211 }
53212
53213
53214 static int
53215 test_xmlXPtrNewContext(void) {
53216     int test_ret = 0;
53217
53218
53219     /* missing type support */
53220     return(test_ret);
53221 }
53222
53223
53224 static int
53225 test_xmlXPtrNewLocationSetNodeSet(void) {
53226     int test_ret = 0;
53227
53228 #if defined(LIBXML_XPTR_ENABLED)
53229     int mem_base;
53230     xmlXPathObjectPtr ret_val;
53231     xmlNodeSetPtr set; /* a node set */
53232     int n_set;
53233
53234     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
53235         mem_base = xmlMemBlocks();
53236         set = gen_xmlNodeSetPtr(n_set, 0);
53237
53238         ret_val = xmlXPtrNewLocationSetNodeSet(set);
53239         desret_xmlXPathObjectPtr(ret_val);
53240         call_tests++;
53241         des_xmlNodeSetPtr(n_set, set, 0);
53242         xmlResetLastError();
53243         if (mem_base != xmlMemBlocks()) {
53244             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
53245                    xmlMemBlocks() - mem_base);
53246             test_ret++;
53247             printf(" %d", n_set);
53248             printf("\n");
53249         }
53250     }
53251     function_tests++;
53252 #endif
53253
53254     return(test_ret);
53255 }
53256
53257
53258 static int
53259 test_xmlXPtrNewLocationSetNodes(void) {
53260     int test_ret = 0;
53261
53262 #if defined(LIBXML_XPTR_ENABLED)
53263     int mem_base;
53264     xmlXPathObjectPtr ret_val;
53265     xmlNodePtr start; /* the start NodePtr value */
53266     int n_start;
53267     xmlNodePtr end; /* the end NodePtr value or NULL */
53268     int n_end;
53269
53270     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53271     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
53272         mem_base = xmlMemBlocks();
53273         start = gen_xmlNodePtr(n_start, 0);
53274         end = gen_xmlNodePtr(n_end, 1);
53275
53276         ret_val = xmlXPtrNewLocationSetNodes(start, end);
53277         desret_xmlXPathObjectPtr(ret_val);
53278         call_tests++;
53279         des_xmlNodePtr(n_start, start, 0);
53280         des_xmlNodePtr(n_end, end, 1);
53281         xmlResetLastError();
53282         if (mem_base != xmlMemBlocks()) {
53283             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
53284                    xmlMemBlocks() - mem_base);
53285             test_ret++;
53286             printf(" %d", n_start);
53287             printf(" %d", n_end);
53288             printf("\n");
53289         }
53290     }
53291     }
53292     function_tests++;
53293 #endif
53294
53295     return(test_ret);
53296 }
53297
53298
53299 static int
53300 test_xmlXPtrNewRange(void) {
53301     int test_ret = 0;
53302
53303 #if defined(LIBXML_XPTR_ENABLED)
53304     int mem_base;
53305     xmlXPathObjectPtr ret_val;
53306     xmlNodePtr start; /* the starting node */
53307     int n_start;
53308     int startindex; /* the start index */
53309     int n_startindex;
53310     xmlNodePtr end; /* the ending point */
53311     int n_end;
53312     int endindex; /* the ending index */
53313     int n_endindex;
53314
53315     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53316     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
53317     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
53318     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
53319         mem_base = xmlMemBlocks();
53320         start = gen_xmlNodePtr(n_start, 0);
53321         startindex = gen_int(n_startindex, 1);
53322         end = gen_xmlNodePtr(n_end, 2);
53323         endindex = gen_int(n_endindex, 3);
53324
53325         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
53326         desret_xmlXPathObjectPtr(ret_val);
53327         call_tests++;
53328         des_xmlNodePtr(n_start, start, 0);
53329         des_int(n_startindex, startindex, 1);
53330         des_xmlNodePtr(n_end, end, 2);
53331         des_int(n_endindex, endindex, 3);
53332         xmlResetLastError();
53333         if (mem_base != xmlMemBlocks()) {
53334             printf("Leak of %d blocks found in xmlXPtrNewRange",
53335                    xmlMemBlocks() - mem_base);
53336             test_ret++;
53337             printf(" %d", n_start);
53338             printf(" %d", n_startindex);
53339             printf(" %d", n_end);
53340             printf(" %d", n_endindex);
53341             printf("\n");
53342         }
53343     }
53344     }
53345     }
53346     }
53347     function_tests++;
53348 #endif
53349
53350     return(test_ret);
53351 }
53352
53353
53354 static int
53355 test_xmlXPtrNewRangeNodeObject(void) {
53356     int test_ret = 0;
53357
53358 #if defined(LIBXML_XPTR_ENABLED)
53359     int mem_base;
53360     xmlXPathObjectPtr ret_val;
53361     xmlNodePtr start; /* the starting node */
53362     int n_start;
53363     xmlXPathObjectPtr end; /* the ending object */
53364     int n_end;
53365
53366     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53367     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
53368         mem_base = xmlMemBlocks();
53369         start = gen_xmlNodePtr(n_start, 0);
53370         end = gen_xmlXPathObjectPtr(n_end, 1);
53371
53372         ret_val = xmlXPtrNewRangeNodeObject(start, end);
53373         desret_xmlXPathObjectPtr(ret_val);
53374         call_tests++;
53375         des_xmlNodePtr(n_start, start, 0);
53376         des_xmlXPathObjectPtr(n_end, end, 1);
53377         xmlResetLastError();
53378         if (mem_base != xmlMemBlocks()) {
53379             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
53380                    xmlMemBlocks() - mem_base);
53381             test_ret++;
53382             printf(" %d", n_start);
53383             printf(" %d", n_end);
53384             printf("\n");
53385         }
53386     }
53387     }
53388     function_tests++;
53389 #endif
53390
53391     return(test_ret);
53392 }
53393
53394
53395 static int
53396 test_xmlXPtrNewRangeNodePoint(void) {
53397     int test_ret = 0;
53398
53399 #if defined(LIBXML_XPTR_ENABLED)
53400     int mem_base;
53401     xmlXPathObjectPtr ret_val;
53402     xmlNodePtr start; /* the starting node */
53403     int n_start;
53404     xmlXPathObjectPtr end; /* the ending point */
53405     int n_end;
53406
53407     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53408     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
53409         mem_base = xmlMemBlocks();
53410         start = gen_xmlNodePtr(n_start, 0);
53411         end = gen_xmlXPathObjectPtr(n_end, 1);
53412
53413         ret_val = xmlXPtrNewRangeNodePoint(start, end);
53414         desret_xmlXPathObjectPtr(ret_val);
53415         call_tests++;
53416         des_xmlNodePtr(n_start, start, 0);
53417         des_xmlXPathObjectPtr(n_end, end, 1);
53418         xmlResetLastError();
53419         if (mem_base != xmlMemBlocks()) {
53420             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
53421                    xmlMemBlocks() - mem_base);
53422             test_ret++;
53423             printf(" %d", n_start);
53424             printf(" %d", n_end);
53425             printf("\n");
53426         }
53427     }
53428     }
53429     function_tests++;
53430 #endif
53431
53432     return(test_ret);
53433 }
53434
53435
53436 static int
53437 test_xmlXPtrNewRangeNodes(void) {
53438     int test_ret = 0;
53439
53440 #if defined(LIBXML_XPTR_ENABLED)
53441     int mem_base;
53442     xmlXPathObjectPtr ret_val;
53443     xmlNodePtr start; /* the starting node */
53444     int n_start;
53445     xmlNodePtr end; /* the ending node */
53446     int n_end;
53447
53448     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
53449     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
53450         mem_base = xmlMemBlocks();
53451         start = gen_xmlNodePtr(n_start, 0);
53452         end = gen_xmlNodePtr(n_end, 1);
53453
53454         ret_val = xmlXPtrNewRangeNodes(start, end);
53455         desret_xmlXPathObjectPtr(ret_val);
53456         call_tests++;
53457         des_xmlNodePtr(n_start, start, 0);
53458         des_xmlNodePtr(n_end, end, 1);
53459         xmlResetLastError();
53460         if (mem_base != xmlMemBlocks()) {
53461             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
53462                    xmlMemBlocks() - mem_base);
53463             test_ret++;
53464             printf(" %d", n_start);
53465             printf(" %d", n_end);
53466             printf("\n");
53467         }
53468     }
53469     }
53470     function_tests++;
53471 #endif
53472
53473     return(test_ret);
53474 }
53475
53476
53477 static int
53478 test_xmlXPtrNewRangePointNode(void) {
53479     int test_ret = 0;
53480
53481 #if defined(LIBXML_XPTR_ENABLED)
53482     int mem_base;
53483     xmlXPathObjectPtr ret_val;
53484     xmlXPathObjectPtr start; /* the starting point */
53485     int n_start;
53486     xmlNodePtr end; /* the ending node */
53487     int n_end;
53488
53489     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
53490     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
53491         mem_base = xmlMemBlocks();
53492         start = gen_xmlXPathObjectPtr(n_start, 0);
53493         end = gen_xmlNodePtr(n_end, 1);
53494
53495         ret_val = xmlXPtrNewRangePointNode(start, end);
53496         desret_xmlXPathObjectPtr(ret_val);
53497         call_tests++;
53498         des_xmlXPathObjectPtr(n_start, start, 0);
53499         des_xmlNodePtr(n_end, end, 1);
53500         xmlResetLastError();
53501         if (mem_base != xmlMemBlocks()) {
53502             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
53503                    xmlMemBlocks() - mem_base);
53504             test_ret++;
53505             printf(" %d", n_start);
53506             printf(" %d", n_end);
53507             printf("\n");
53508         }
53509     }
53510     }
53511     function_tests++;
53512 #endif
53513
53514     return(test_ret);
53515 }
53516
53517
53518 static int
53519 test_xmlXPtrNewRangePoints(void) {
53520     int test_ret = 0;
53521
53522 #if defined(LIBXML_XPTR_ENABLED)
53523     int mem_base;
53524     xmlXPathObjectPtr ret_val;
53525     xmlXPathObjectPtr start; /* the starting point */
53526     int n_start;
53527     xmlXPathObjectPtr end; /* the ending point */
53528     int n_end;
53529
53530     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
53531     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
53532         mem_base = xmlMemBlocks();
53533         start = gen_xmlXPathObjectPtr(n_start, 0);
53534         end = gen_xmlXPathObjectPtr(n_end, 1);
53535
53536         ret_val = xmlXPtrNewRangePoints(start, end);
53537         desret_xmlXPathObjectPtr(ret_val);
53538         call_tests++;
53539         des_xmlXPathObjectPtr(n_start, start, 0);
53540         des_xmlXPathObjectPtr(n_end, end, 1);
53541         xmlResetLastError();
53542         if (mem_base != xmlMemBlocks()) {
53543             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
53544                    xmlMemBlocks() - mem_base);
53545             test_ret++;
53546             printf(" %d", n_start);
53547             printf(" %d", n_end);
53548             printf("\n");
53549         }
53550     }
53551     }
53552     function_tests++;
53553 #endif
53554
53555     return(test_ret);
53556 }
53557
53558
53559 static int
53560 test_xmlXPtrRangeToFunction(void) {
53561     int test_ret = 0;
53562
53563 #if defined(LIBXML_XPTR_ENABLED)
53564     int mem_base;
53565     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
53566     int n_ctxt;
53567     int nargs; /* the number of args */
53568     int n_nargs;
53569
53570     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
53571     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
53572         mem_base = xmlMemBlocks();
53573         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
53574         nargs = gen_int(n_nargs, 1);
53575
53576         xmlXPtrRangeToFunction(ctxt, nargs);
53577         call_tests++;
53578         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
53579         des_int(n_nargs, nargs, 1);
53580         xmlResetLastError();
53581         if (mem_base != xmlMemBlocks()) {
53582             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
53583                    xmlMemBlocks() - mem_base);
53584             test_ret++;
53585             printf(" %d", n_ctxt);
53586             printf(" %d", n_nargs);
53587             printf("\n");
53588         }
53589     }
53590     }
53591     function_tests++;
53592 #endif
53593
53594     return(test_ret);
53595 }
53596
53597
53598 static int
53599 test_xmlXPtrWrapLocationSet(void) {
53600     int test_ret = 0;
53601
53602 #if defined(LIBXML_XPTR_ENABLED)
53603     int mem_base;
53604     xmlXPathObjectPtr ret_val;
53605     xmlLocationSetPtr val; /* the LocationSet value */
53606     int n_val;
53607
53608     for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
53609         mem_base = xmlMemBlocks();
53610         val = gen_xmlLocationSetPtr(n_val, 0);
53611
53612         ret_val = xmlXPtrWrapLocationSet(val);
53613         desret_xmlXPathObjectPtr(ret_val);
53614         call_tests++;
53615         des_xmlLocationSetPtr(n_val, val, 0);
53616         xmlResetLastError();
53617         if (mem_base != xmlMemBlocks()) {
53618             printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
53619                    xmlMemBlocks() - mem_base);
53620             test_ret++;
53621             printf(" %d", n_val);
53622             printf("\n");
53623         }
53624     }
53625     function_tests++;
53626 #endif
53627
53628     return(test_ret);
53629 }
53630
53631 static int
53632 test_xpointer(void) {
53633     int test_ret = 0;
53634         int rc = 0;
53635
53636     if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
53637     rc = test_xmlXPtrBuildNodeList();
53638         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53639     rc = test_xmlXPtrEval();
53640         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53641     rc = test_xmlXPtrEvalRangePredicate();
53642         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53643     rc = test_xmlXPtrLocationSetAdd();
53644         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53645     rc = test_xmlXPtrLocationSetCreate();
53646         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53647     rc = test_xmlXPtrLocationSetDel();
53648         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53649     rc = test_xmlXPtrLocationSetMerge();
53650         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53651     rc = test_xmlXPtrLocationSetRemove();
53652         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53653     rc = test_xmlXPtrNewCollapsedRange();
53654         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53655     rc = test_xmlXPtrNewContext();
53656         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53657     rc = test_xmlXPtrNewLocationSetNodeSet();
53658         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53659     rc = test_xmlXPtrNewLocationSetNodes();
53660         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53661     rc = test_xmlXPtrNewRange();
53662         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53663     rc = test_xmlXPtrNewRangeNodeObject();
53664         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53665     rc = test_xmlXPtrNewRangeNodePoint();
53666         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53667     rc = test_xmlXPtrNewRangeNodes();
53668         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53669     rc = test_xmlXPtrNewRangePointNode();
53670         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53671     rc = test_xmlXPtrNewRangePoints();
53672         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53673     rc = test_xmlXPtrRangeToFunction();
53674         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53675     rc = test_xmlXPtrWrapLocationSet();
53676         if( rc == 0 ) { printf("TEST: PASS: \n"); } else { printf("TEST: FAIL: \n"); } test_ret += rc;
53677
53678     if (test_ret != 0)
53679         printf("Module xpointer: %d errors\n", test_ret);
53680     return(test_ret);
53681 }
53682 static int
53683 test_module(const char *module) {
53684     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
53685     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
53686     if (!strcmp(module, "SAX2")) return(test_SAX2());
53687     if (!strcmp(module, "c14n")) return(test_c14n());
53688     if (!strcmp(module, "catalog")) return(test_catalog());
53689     if (!strcmp(module, "chvalid")) return(test_chvalid());
53690     if (!strcmp(module, "debugXML")) return(test_debugXML());
53691     if (!strcmp(module, "dict")) return(test_dict());
53692     if (!strcmp(module, "encoding")) return(test_encoding());
53693     if (!strcmp(module, "entities")) return(test_entities());
53694     if (!strcmp(module, "hash")) return(test_hash());
53695     if (!strcmp(module, "list")) return(test_list());
53696     if (!strcmp(module, "nanoftp")) return(test_nanoftp());
53697     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
53698     if (!strcmp(module, "parser")) return(test_parser());
53699     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
53700     if (!strcmp(module, "pattern")) return(test_pattern());
53701     if (!strcmp(module, "relaxng")) return(test_relaxng());
53702     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
53703     if (!strcmp(module, "schematron")) return(test_schematron());
53704     if (!strcmp(module, "tree")) return(test_tree());
53705     if (!strcmp(module, "uri")) return(test_uri());
53706     if (!strcmp(module, "valid")) return(test_valid());
53707     if (!strcmp(module, "xinclude")) return(test_xinclude());
53708     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
53709     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
53710     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
53711     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
53712     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
53713     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
53714     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
53715     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
53716     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
53717     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
53718     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
53719     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
53720     if (!strcmp(module, "xpath")) return(test_xpath());
53721     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
53722     if (!strcmp(module, "xpointer")) return(test_xpointer());
53723     return(0);
53724 }